web.script-min.js Maven / Gradle / Ivy
!function e(t,r,n){function i(l,a){if(!r[l]){if(!t[l]){var s="function"==typeof require&&require;if(!a&&s)return s(l,!0);if(o)return o(l,!0);throw new Error("Cannot find module '"+l+"'")}var u=r[l]={exports:{}};t[l][0].call(u.exports,function(e){var r=t[l][1][e];return i(r?r:e)},u,u.exports,e,t,r,n)}return r[l].exports}for(var o="function"==typeof require&&require,l=0;l=0;a--){var c=l[a].head;r.replaceRange("",d(c.line,c.ch-1),d(c.line,c.ch+1),"+delete")}}function o(r){var i=n(r),o=i&&t(i,"explode");if(!o||r.getOption("disableInput"))return e.Pass;for(var l=r.listSelections(),a=0;a0;return{anchor:new d(t.anchor.line,t.anchor.ch+(r?-1:1)),head:new d(t.head.line,t.head.ch+(r?1:-1))}}function a(r,i){var o=n(r);if(!o||r.getOption("disableInput"))return e.Pass;var a=t(o,"pairs"),u=a.indexOf(i);if(u==-1)return e.Pass;for(var h,p=t(o,"triples"),g=a.charAt(u+1)==i,v=r.listSelections(),m=u%2==0,y=0;y1&&p.indexOf(i)>=0&&r.getRange(d(x.line,x.ch-2),x)==i+i&&(x.ch<=2||r.getRange(d(x.line,x.ch-3),d(x.line,x.ch-2))!=i))b="addFour";else if(g){if(e.isWordChar(C)||!c(r,x,i))return e.Pass;b="both"}else{if(!m||r.getLine(x.line).length!=x.ch&&!s(C,a)&&!/\s/.test(C))return e.Pass;b="both"}else b=g&&f(r,x)?"both":p.indexOf(i)>=0&&r.getRange(x,d(x.line,x.ch+3))==i+i+i?"skipThree":"skip";if(h){if(h!=b)return e.Pass}else h=b}var S=u%2?a.charAt(u-1):i,k=u%2?i:a.charAt(u+1);r.operation(function(){if("skip"==h)r.execCommand("goCharRight");else if("skipThree"==h)for(var e=0;e<3;e++)r.execCommand("goCharRight");else if("surround"==h){for(var t=r.getSelections(),e=0;e-1&&r%2==1}function u(e,t){var r=e.getRange(d(t.line,t.ch-1),d(t.line,t.ch+1));return 2==r.length?r:null}function c(t,r,n){var i=t.getLine(r.line),o=t.getTokenAt(r);if(/\bstring2?\b/.test(o.type))return!1;var l=new e.StringStream(i.slice(0,r.ch)+n+i.slice(r.ch),4);for(l.pos=l.start=o.start;;){var a=t.getMode().token(l,o.state);if(l.pos>=r.ch+1)return/\bstring2?\b/.test(a);l.start=l.pos}}function f(e,t){var r=e.getTokenAt(d(t.line,t.ch+1));return/\bstring/.test(r.type)&&r.start==t.ch}var h={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},d=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,r,n){n&&n!=e.Init&&(t.removeKeyMap(g),t.state.closeBrackets=null),r&&(t.state.closeBrackets=r,t.addKeyMap(g))});for(var p=h.pairs+"`",g={Backspace:i,Enter:o},v=0;v=0&&a[o.text.charAt(s)]||a[o.text.charAt(++s)];if(!u)return null;var c=">"==u.charAt(1)?1:-1;if(n&&c>0!=(s==t.ch))return null;var f=e.getTokenTypeAt(l(t.line,s+1)),h=r(e,l(t.line,s+(c>0?1:0)),c,f||null,i);return null==h?null:{from:l(t.line,s),to:h&&h.pos,match:h&&h.ch==u.charAt(0),forward:c>0}}function r(e,t,r,n,i){for(var o=i&&i.maxScanLineLength||1e4,s=i&&i.maxScanLines||1e3,u=[],c=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,f=r>0?Math.min(t.line+s,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-s),h=t.line;h!=f;h+=r){var d=e.getLine(h);if(d){var p=r>0?0:d.length-1,g=r>0?d.length:-1;if(!(d.length>o))for(h==t.line&&(p=t.ch-(r<0?1:0));p!=g;p+=r){var v=d.charAt(p);if(c.test(v)&&(void 0===n||e.getTokenTypeAt(l(h,p+1))==n)){var m=a[v];if(">"==m.charAt(1)==r>0)u.push(v);else{if(!u.length)return{pos:l(h,p),ch:v};u.pop()}}}}}return h-r!=(r>0?e.lastLine():e.firstLine())&&null}function n(e,r,n){for(var i=e.state.matchBrackets.maxHighlightLineLength||1e3,a=[],s=e.listSelections(),u=0;u",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},s=null;e.defineOption("matchBrackets",!1,function(t,r,n){n&&n!=e.Init&&(t.off("cursorActivity",i),s&&(s(),s=null)),r&&(t.state.matchBrackets="object"==typeof r?r:{},t.on("cursorActivity",i))}),e.defineExtension("matchBrackets",function(){n(this,!0)}),e.defineExtension("findMatchingBracket",function(e,r,n){return t(this,e,r,n)}),e.defineExtension("scanForBracket",function(e,t,n,i){return r(this,e,t,n,i)})})},{"../../lib/codemirror":4}],4:[function(e,t,r){!function(e,n){"object"==typeof r&&"undefined"!=typeof t?t.exports=n():"function"==typeof define&&define.amd?define(n):e.CodeMirror=n()}(this,function(){"use strict";function e(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function t(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function r(e,r){return t(e).appendChild(r)}function n(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return l+(t-o);l+=a-o,l+=r-l%r,o=a+1}}function f(){this.id=null}function h(e,t){for(var r=0;r=t)return n+Math.min(l,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function p(e){for(;Al.length<=e;)Al.push(g(Al)+" ");return Al[e]}function g(e){return e[e.length-1]}function v(e,t){for(var r=[],n=0;n""&&(e.toUpperCase()!=e.toLowerCase()||Nl.test(e))}function x(e,t){return t?!!(t.source.indexOf("\\w")>-1&&w(e))||t.test(e):w(e)}function C(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function S(e){return e.charCodeAt(0)>=768&&Wl.test(e)}function k(e,t,r){var i=this;this.input=r,i.scrollbarFiller=n("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=n("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=n("div",null,"CodeMirror-code"),i.selectionDiv=n("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=n("div",null,"CodeMirror-cursors"),i.measure=n("div",null,"CodeMirror-measure"),i.lineMeasure=n("div",null,"CodeMirror-measure"),i.lineSpace=n("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none"),i.mover=n("div",[n("div",[i.lineSpace],"CodeMirror-lines")],null,"position: relative"),i.sizer=n("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=n("div",null,null,"position: absolute; height: "+kl+"px; width: 1px;"),i.gutters=n("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=n("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=n("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),rl&&nl<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),il||Qo&&hl||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,r.init(i)}function L(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t=e.first&&tr?D(r,L(e,r).text.length):F(t,L(e,t.line).text.length)}function F(e,t){var r=e.ch;return null==r||r>t?D(e.line,t):r<0?D(e.line,0):e}function j(e,t){for(var r=[],n=0;n=t:o.to>t);(n||(n=[])).push(new U(l,o.from,s?null:o.to))}}return n}function $(e,t,r){var n;if(e)for(var i=0;i=t:o.to>t);if(a||o.from==t&&"bookmark"==l.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(l.inclusiveLeft?o.from<=t:o.from0&&a)for(var x=0;x0)){var c=[s,1],f=H(u.from,a.from),d=H(u.to,a.to);(f<0||!l.inclusiveLeft&&!f)&&c.push({from:u.from,to:a.from}),(d>0||!l.inclusiveRight&&!d)&&c.push({from:a.to,to:u.to}),i.splice.apply(i,c),s+=c.length-1}}return i}function Q(e){var t=e.markedSpans;if(t){for(var r=0;r=0&&f<=0||c<=0&&f>=0)&&(c<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?H(u.to,r)>=0:H(u.to,r)>0)||c>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?H(u.from,n)<=0:H(u.from,n)<0)))return!0}}}function se(e){for(var t;t=oe(e);)e=t.find(-1,!0).line;return e}function ue(e){for(var t,r;t=le(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function ce(e,t){var r=L(e,t),n=se(r);return r==n?t:A(n)}function fe(e,t){if(t>e.lastLine())return t;var r,n=L(e,t);if(!he(e,n))return t;for(;r=le(n);)n=r.find(1,!0).line;return A(n)+1}function he(e,t){var r=Dl&&t.markedSpans;if(r)for(var n=void 0,i=0;it.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function me(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;ot||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),1==l.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function ye(e){return e.level%2?e.to:e.from}function be(e){return e.level%2?e.from:e.to}function we(e){var t=Me(e);return t?ye(t[0]):0}function xe(e){var t=Me(e);return t?be(g(t)):e.text.length}function Ce(e,t,r){var n=e[0].level;return t==n||r!=n&&tt)return n;if(i.from==t||i.to==t){if(null!=r)return Ce(e,i.level,e[r].level)?(i.from!=i.to&&(Hl=r),n):(i.from!=i.to&&(Hl=n),r);r=n}}return r}function ke(e,t,r,n){if(!n)return t+r;do t+=r;while(t>0&&S(e.text.charAt(t)));return t}function Le(e,t,r,n){var i=Me(e);if(!i)return Te(e,t,r,n);for(var o=Se(i,t),l=i[o],a=ke(e,t,l.level%2?-r:r,n);;){if(a>l.from&&a0==l.level%2?l.to:l.from);if(l=i[o+=r],!l)return null;a=r>0==l.level%2?ke(e,l.to,-1,n):ke(e,l.from,1,n)}}function Te(e,t,r,n){var i=t+r;if(n)for(;i>0&&S(e.text.charAt(i));)i+=r;return i<0||i>e.text.length?null:i}function Me(e){var t=e.order;return null==t&&(t=e.order=Il(e.text)),t}function Oe(e,t){return e._handlers&&e._handlers[t]||Pl}function Ae(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=h(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Ne(e,t){var r=Oe(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i0}function He(e){e.prototype.on=function(e,t){Rl(this,e,t)},e.prototype.off=function(e,t){Ae(this,e,t)}}function Ie(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Pe(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Re(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function ze(e){Ie(e),Pe(e)}function Be(e){return e.target||e.srcElement}function Fe(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),dl&&e.ctrlKey&&1==t&&(t=3),t}function je(e){if(null==Cl){var t=n("span","");r(e,n("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Cl=t.offsetWidth<=1&&t.offsetHeight>2&&!(rl&&nl<8))}var i=Cl?n("span",""):n("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}function Ve(e){if(null!=Sl)return Sl;var n=r(e,document.createTextNode("AخA")),i=ml(n,0,1).getBoundingClientRect(),o=ml(n,1,2).getBoundingClientRect();return t(e),!(!i||i.left==i.right)&&(Sl=o.right-i.right<3)}function Ge(e){if(null!=Vl)return Vl;var t=r(e,n("span","x")),i=t.getBoundingClientRect(),o=ml(t,0,1).getBoundingClientRect();return Vl=Math.abs(i.left-o.left)>1}function Ue(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Gl[e]=t}function _e(e,t){Ul[e]=t}function Ke(e){if("string"==typeof e&&Ul.hasOwnProperty(e))e=Ul[e];else if(e&&"string"==typeof e.name&&Ul.hasOwnProperty(e.name)){var t=Ul[e.name];"string"==typeof t&&(t={name:t}),e=b(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ke("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ke("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function qe(e,t){t=Ke(t);var r=Gl[t.name];if(!r)return qe(e,"text/plain");var n=r(e,t);if(_l.hasOwnProperty(t.name)){var i=_l[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}function Xe(e,t){var r=_l.hasOwnProperty(e)?_l[e]:_l[e]={};u(t,r)}function $e(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Ye(e,t){for(var r;e.innerMode&&(r=e.innerMode(t),r&&r.mode!=e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Je(e,t,r){return!e.startState||e.startState(t,r)}function Ze(e,t,r,n){var i=[e.state.modeGen],o={};lt(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var l=function(r){var n=e.state.overlays[r],l=1,a=0;lt(e,t.text,n.mode,!0,function(e,t){for(var r=l;ae&&i.splice(l,1,e,i[l+1],o),l+=2,a=Math.min(e,o)}if(t)if(n.opaque)i.splice(r,l-r,e,"overlay "+t),l=r+2;else for(;re.options.maxHighlightLength?$e(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function et(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=at(e,t,r),l=o>n.first&&L(n,o-1).stateAfter;return l=l?$e(n.mode,l):Je(n.mode),n.iter(o,t,function(r){tt(e,r.text,l);var a=o==t-1||o%5==0||o>=i.viewFrom&&ot.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function it(e,t,r,n){var i,o=function(e){return{start:f.start,end:f.pos,string:f.current(),type:i||null,state:e?$e(l.mode,c):c}},l=e.doc,a=l.mode;t=B(l,t);var s,u=L(l,t.line),c=et(e,t.line,r),f=new Kl(u.text,e.options.tabSize);for(n&&(s=[]);(n||f.pose.options.maxHighlightLength?(a=!1,l&&tt(e,t,n,f.pos),f.pos=t.length,s=null):s=ot(nt(r,f,n,h),o),h){var d=h[0].name;d&&(s="m-"+(s?d+" "+s:d))}if(!a||c!=s){for(;ul;--a){if(a<=o.first)return o.first;var s=L(o,a-1);if(s.stateAfter&&(!r||a<=o.frontier))return a;var u=c(s.text,null,e.options.tabSize);(null==i||n>u)&&(i=a-1,n=u)}return i}function st(e,t,r){this.text=e,ee(this,t),this.height=r?r(this):1}function ut(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),Q(e),ee(e,r);var i=n?n(e):1;i!=e.height&&O(e,i)}function ct(e){e.parent=null,Q(e)}function ft(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?$l:Xl;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function ht(e,t){var r=n("span",null,null,il?"padding-right: .1px":null),i={pre:n("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(rl||il)&&e.getOption("lineWrapping")};r.setAttribute("role","presentation"),i.pre.setAttribute("role","presentation"),t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var l=o?t.rest[o-1]:t.line,s=void 0;i.pos=0,i.addToken=pt,Ve(e.display.measure)&&(s=Me(l))&&(i.addToken=vt(i.addToken,s)),i.map=[];var u=t!=e.display.externalMeasured&&A(l);yt(l,i,Qe(e,l,u)),l.styleClasses&&(l.styleClasses.bgClass&&(i.bgClass=a(l.styleClasses.bgClass,i.bgClass||"")),l.styleClasses.textClass&&(i.textClass=a(l.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(je(e.display.measure))),0==o?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(il){var c=i.content.lastChild;(/\bcm-tab\b/.test(c.className)||c.querySelector&&c.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return Ne(e,"renderLine",e,t.line,i.pre),i.pre.className&&(i.textClass=a(i.pre.className,i.textClass||"")),i}function dt(e){var t=n("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function pt(e,t,r,i,o,l,a){if(t){var s,u=e.splitSpaces?gt(t,e.trailingSpace):t,c=e.cm.state.specialChars,f=!1;if(c.test(t)){s=document.createDocumentFragment();for(var h=0;;){c.lastIndex=h;var d=c.exec(t),g=d?d.index-h:t.length-h;if(g){var v=document.createTextNode(u.slice(h,h+g));rl&&nl<9?s.appendChild(n("span",[v])):s.appendChild(v),e.map.push(e.pos,e.pos+g,v),e.col+=g,e.pos+=g}if(!d)break;h+=g+1;var m=void 0;if("\t"==d[0]){var y=e.cm.options.tabSize,b=y-e.col%y;m=s.appendChild(n("span",p(b),"cm-tab")),m.setAttribute("role","presentation"),m.setAttribute("cm-text","\t"),e.col+=b}else"\r"==d[0]||"\n"==d[0]?(m=s.appendChild(n("span","\r"==d[0]?"␍":"","cm-invalidchar")),m.setAttribute("cm-text",d[0]),e.col+=1):(m=e.cm.options.specialCharPlaceholder(d[0]),m.setAttribute("cm-text",d[0]),rl&&nl<9?s.appendChild(n("span",[m])):s.appendChild(m),e.col+=1);e.map.push(e.pos,e.pos+1,m),e.pos++}}else e.col+=t.length,s=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,s),rl&&nl<9&&(f=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),r||i||o||f||a){var w=r||"";i&&(w+=i),o&&(w+=o);var x=n("span",[s],w,a);return l&&(x.title=l),e.content.appendChild(x)}e.content.appendChild(s)}}function gt(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;iu&&f.from<=u));h++);if(f.to>=c)return e(r,n,i,o,l,a,s);e(r,n.slice(0,f.to-u),i,o,null,a,s),o=null,n=n.slice(f.to-u),u=f.to}}}function mt(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function yt(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var l,a,s,u,c,f,h,d=i.length,p=0,g=1,v="",m=0;;){if(m==p){s=u=c=f=a="",h=null,m=1/0;for(var y=[],b=void 0,w=0;wp||C.collapsed&&x.to==p&&x.from==p)?(null!=x.to&&x.to!=p&&m>x.to&&(m=x.to,u=""),C.className&&(s+=" "+C.className),C.css&&(a=(a?a+";":"")+C.css),C.startStyle&&x.from==p&&(c+=" "+C.startStyle),C.endStyle&&x.to==m&&(b||(b=[])).push(C.endStyle,x.to),C.title&&!f&&(f=C.title),C.collapsed&&(!h||ne(h.marker,C)<0)&&(h=x)):x.from>p&&m>x.from&&(m=x.from)}if(b)for(var S=0;S=d)break;for(var L=Math.min(d,m);;){if(v){var T=p+v.length;if(!h){var M=T>L?v.slice(0,L-p):v;t.addToken(t,M,l?l+s:s,c,p+M.length==m?u:"",f,a)}if(T>=L){v=v.slice(L-p),p=L;break}p=T,c=""}v=i.slice(o,o=r[g++]),l=ft(r[g++],t.cm.options)}}else for(var O=1;O2&&o.push((s.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function qt(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;nr)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Xt(e,t){t=se(t);var n=A(t),i=e.display.externalMeasured=new bt(e.doc,t,n);i.lineN=n;var o=i.built=ht(e,i);return i.text=o.pre,r(e.display.lineMeasure,o.pre),i}function $t(e,t,r,n){return Zt(e,Jt(e,t),r,n)}function Yt(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt)&&(o=s-a,i=o-1,t>=s&&(l="right")),null!=i){if(n=e[u+2],a==s&&r==(n.insertLeft?"left":"right")&&(l=r),"left"==r&&0==i)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[(u-=3)+2],l="left";if("right"==r&&i==s-a)for(;u=0&&(r=e[i]).left==r.right;i--);return r}function tr(e,t,r,n){var i,o=Qt(t.map,r,n),l=o.node,a=o.start,s=o.end,u=o.collapse;if(3==l.nodeType){for(var c=0;c<4;c++){for(;a&&S(t.line.text.charAt(o.coverStart+a));)--a;for(;o.coverStart+s0&&(u=n="right");var f;i=e.options.lineWrapping&&(f=l.getClientRects()).length>1?f["right"==n?f.length-1:0]:l.getBoundingClientRect()}if(rl&&nl<9&&!a&&(!i||!i.left&&!i.right)){var h=l.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+mr(e.display),top:h.top,bottom:h.bottom}:Zl}for(var d=i.top-t.rect.top,p=i.bottom-t.rect.top,g=(d+p)/2,v=t.view.measure.heights,m=0;mr.from?l(e-1):l(e,n)}n=n||L(e.doc,t.line),i||(i=Jt(e,n));var s=Me(n),u=t.ch;if(!s)return l(u);var c=Se(s,u),f=a(u,c);return null!=Hl&&(f.other=a(u,Hl)),f}function hr(e,t){var r=0;t=B(e.doc,t),e.options.lineWrapping||(r=mr(e.display)*t.ch);var n=L(e.doc,t.line),i=pe(n)+Ft(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function dr(e,t,r,n){var i=D(e,t);return i.xRel=n,r&&(i.outside=!0),i}function pr(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return dr(n.first,0,!0,-1);var i=N(n,r),o=n.first+n.size-1;if(i>o)return dr(n.first+n.size-1,L(n,o).text.length,!0,1);t<0&&(t=0);for(var l=L(n,i);;){var a=gr(e,l,i,t,r),s=le(l),u=s&&s.find(0,!0);if(!s||!(a.ch>u.from.ch||a.ch==u.from.ch&&a.xRel>0))return a;i=A(l=u.to.line)}}function gr(e,t,r,n,i){function o(n){var i=fr(e,D(r,n),"line",t,u);return a=!0,l>i.bottom?i.left-s:lv)return dr(r,d,m,1);for(;;){if(c?d==h||d==Le(t,h,1):d-h<=1){var y=n0&&y1){var x=Zt(e,u,y,"right");l<=x.bottom&&l>=x.top&&Math.abs(n-x.right)1?1:0);return C}var k=Math.ceil(f/2),L=h+k;if(c){L=h;for(var T=0;Tn?(d=L,v=M,(m=a)&&(v+=1e3),f=k):(h=L,p=M,g=a,f-=k)}}function vr(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==ql){ql=n("pre");for(var i=0;i<49;++i)ql.appendChild(document.createTextNode("x")),ql.appendChild(n("br"));ql.appendChild(document.createTextNode("x"))}r(e.measure,ql);var o=ql.offsetHeight/50;return o>3&&(e.cachedTextHeight=o),t(e.measure),o||1}function mr(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=n("span","xxxxxxxxxx"),i=n("pre",[t]);r(e.measure,i);var o=t.getBoundingClientRect(),l=(o.right-o.left)/10;return l>2&&(e.cachedCharWidth=l),l||10}function yr(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l)r[e.options.gutters[l]]=o.offsetLeft+o.clientLeft+i,n[e.options.gutters[l]]=o.clientWidth;return{fixedPos:br(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function br(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function wr(e){var t=vr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/mr(e.display)-3);return function(i){if(he(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;n=e.display.viewTo||a.to().line3&&(i(d,g.top,null,g.bottom),d=c,g.bottoms.bottom||u.bottom==s.bottom&&u.right>s.right)&&(s=u),d0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Ar(e){e.state.focused||(e.display.input.focus(),Wr(e))}function Nr(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,Er(e))},100)}function Wr(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(Ne(e,"focus",e,t),e.state.focused=!0,l(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),il&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Or(e))}function Er(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ne(e,"blur",e,t),e.state.focused=!1,wl(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Dr(e){var t=e.display,r=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var n=br(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l.001||s<-.001)&&(O(i.line,o),Pr(i.line),i.rest))for(var u=0;u=l&&(o=N(t,pe(L(t,s))-e.wrapper.clientHeight),l=s)}return{from:o,to:Math.max(l,o+1)}}function zr(e,t){Math.abs(e.doc.scrollTop-t)<2||(e.doc.scrollTop=t,Qo||kn(e,{top:t}),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t),e.display.scrollbars.setScrollTop(t),Qo&&kn(e),bn(e,100))}function Br(e,t,r){(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)||(t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),e.doc.scrollLeft=t,Dr(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Fr(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==r&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:null==r&&(r=e.wheelDelta),{x:t,y:r}}function jr(e){var t=Fr(e);return t.x*=ea,t.y*=ea,t}function Vr(e,t){var r=Fr(t),n=r.x,i=r.y,o=e.display,l=o.scroller,a=l.scrollWidth>l.clientWidth,s=l.scrollHeight>l.clientHeight;if(n&&a||i&&s){if(i&&dl&&il)e:for(var u=t.target,c=o.view;u!=l;u=u.parentNode)for(var f=0;f(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!cl){var l=n("div","",null,"position: absolute;\n top: "+(t.top-r.viewOffset-Ft(e.display))+"px;\n height: "+(t.bottom-t.top+Gt(e)+r.barHeight)+"px;\n left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(o),e.display.lineSpace.removeChild(l)}}}function Xr(e,t,r,n){null==n&&(n=0);for(var i,o=0;o<5;o++){var l=!1;i=fr(e,t);var a=r&&r!=t?fr(e,r):i,s=Yr(e,Math.min(i.left,a.left),Math.min(i.top,a.top)-n,Math.max(i.left,a.left),Math.max(i.bottom,a.bottom)+n),u=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=s.scrollTop&&(zr(e,s.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(l=!0)),null!=s.scrollLeft&&(Br(e,s.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(l=!0)),!l)break}return i}function $r(e,t,r,n,i){var o=Yr(e,t,r,n,i);null!=o.scrollTop&&zr(e,o.scrollTop),null!=o.scrollLeft&&Br(e,o.scrollLeft)}function Yr(e,t,r,n,i){var o=e.display,l=vr(e.display);r<0&&(r=0);var a=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,s=_t(e),u={};i-r>s&&(i=r+s);var c=e.doc.height+jt(o),f=rc-l;if(ra+s){var d=Math.min(r,(h?c:i)-s);d!=a&&(u.scrollTop=d)}var p=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,g=Ut(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),v=n-t>g;return v&&(n=t+g),t<10?u.scrollLeft=0:tg+p-3&&(u.scrollLeft=n+(v?0:10)-g),u}function Jr(e,t,r){null==t&&null==r||Qr(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=r&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+r)}function Zr(e){Qr(e);var t=e.getCursor(),r=t,n=t;e.options.lineWrapping||(r=t.ch?D(t.line,t.ch-1):t,n=D(t.line,t.ch+1)),e.curOp.scrollToPos={from:r,to:n,margin:e.options.cursorScrollMargin,isCursor:!0}}function Qr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=hr(e,t.from),n=hr(e,t.to),i=Yr(e,Math.min(r.left,n.left),Math.min(r.top,n.top)-t.margin,Math.max(r.right,n.right),Math.max(r.bottom,n.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function en(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++ia},xt(e.curOp)}function tn(e){var t=e.curOp;St(t,function(e){for(var t=0;t=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new oa(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function on(e){e.updatedDisplay=e.mustUpdate&&Cn(e.cm,e.update)}function ln(e){var t=e.cm,r=t.display;e.updatedDisplay&&Ir(t),e.barMeasure=Gr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=$t(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Gt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Ut(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection(e.focus))}function an(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeftt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Dl&&ce(e.doc,t)i.viewFrom?gn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)gn(e);else if(t<=i.viewFrom){var o=vn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):gn(e)}else if(r>=i.viewTo){var l=vn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):gn(e)}else{var a=vn(e,t,t,-1),s=vn(e,r,r+n,1);a&&s?(i.view=i.view.slice(0,a.index).concat(wt(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):gn(e)}var u=i.externalMeasured;u&&(r=i.lineN&&t=n.viewTo)){var o=n.view[Sr(e,t)];if(null!=o.node){var l=o.changes||(o.changes=[]);h(l,r)==-1&&l.push(r)}}}function gn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function vn(e,t,r,n){var i,o=Sr(e,t),l=e.display.view;if(!Dl||r==e.doc.first+e.doc.size)return{index:o,lineN:r};for(var a=e.display.viewFrom,s=0;s0){if(o==l.length-1)return null;i=a+l[o].size-t,o++}else i=a-t;t+=i,r+=i}for(;ce(e.doc,r)!=r;){if(o==(n<0?0:l.length-1))return null;r+=n*l[o-(n<0?1:0)].size,o+=n}return{index:o,lineN:r}}function mn(e,t,r){var n=e.display,i=n.view;0==i.length||t>=n.viewTo||r<=n.viewFrom?(n.view=wt(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=wt(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,Sr(e,r)))),n.viewTo=r}function yn(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo)){var r=+new Date+e.options.workTime,n=$e(t.mode,et(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var l=o.styles,a=o.text.length>e.options.maxHighlightLength,s=Ze(e,o,a?$e(t.mode,n):n,!0);o.styles=s.styles;var u=o.styleClasses,c=s.classes;c?o.styleClasses=c:u&&(o.styleClasses=null);for(var f=!l||l.length!=o.styles.length||u!=c&&(!u||!c||u.bgClass!=c.bgClass||u.textClass!=c.textClass),h=0;!f&&hr)return bn(e,e.options.workDelay),!0}),i.length&&un(e,function(){for(var t=0;t=n.viewFrom&&r.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==yn(e))return!1;Hr(e)&&(gn(e),r.dims=yr(e));var l=i.first+i.size,a=Math.max(r.visible.from-e.options.viewportMargin,i.first),s=Math.min(l,r.visible.to+e.options.viewportMargin);n.viewFroms&&n.viewTo-s<20&&(s=Math.min(l,n.viewTo)),Dl&&(a=ce(e.doc,a),s=fe(e.doc,s));var u=a!=n.viewFrom||s!=n.viewTo||n.lastWrapHeight!=r.wrapperHeight||n.lastWrapWidth!=r.wrapperWidth;mn(e,a,s),n.viewOffset=pe(L(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var c=yn(e);if(!u&&0==c&&!r.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var f=o();return c>4&&(n.lineDiv.style.display="none"),Ln(e,n.updateLineNumbers,r.dims),c>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,f&&o()!=f&&f.offsetHeight&&f.focus(),t(n.cursorDiv),t(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,u&&(n.lastWrapHeight=r.wrapperHeight,n.lastWrapWidth=r.wrapperWidth,bn(e,400)),n.updateLineNumbers=null,!0}function Sn(e,t){for(var r=t.viewport,n=!0;(n&&e.options.lineWrapping&&t.oldDisplayWidth!=Ut(e)||(r&&null!=r.top&&(r={top:Math.min(e.doc.height+jt(e.display)-_t(e),r.top)}),t.visible=Rr(e.display,e.doc,r),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&Cn(e,t);n=!1){Ir(e);var i=Gr(e);kr(e),Ur(e,i),Mn(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function kn(e,t){var r=new oa(e,t);if(Cn(e,r)){Ir(e),Sn(e,r);var n=Gr(e);kr(e),Ur(e,n),Mn(e,n),r.finish()}}function Ln(e,r,n){function i(t){var r=t.nextSibling;return il&&dl&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),r}for(var o=e.display,l=e.options.lineNumbers,a=o.lineDiv,s=a.firstChild,u=o.view,c=o.viewFrom,f=0;f-1&&(p=!1),Tt(e,d,c,n)),p&&(t(d.lineNumber),d.lineNumber.appendChild(document.createTextNode(E(e.options,c)))),s=d.node.nextSibling}else{var g=Ht(e,d,c,n);a.insertBefore(g,s)}c+=d.size}for(;s;)s=i(s)}function Tn(e){var t=e.display.gutters.offsetWidth;e.display.sizer.style.marginLeft=t+"px"}function Mn(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Gt(e)+"px"}function On(e){var r=e.display.gutters,i=e.options.gutters;t(r);for(var o=0;o-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function Nn(e,t){this.ranges=e,this.primIndex=t}function Wn(e,t){this.anchor=e,this.head=t}function En(e,t){var r=e[t];e.sort(function(e,t){return H(e.from(),t.from())}),t=h(e,r);for(var n=1;n=0){var l=R(o.from(),i.from()),a=P(o.to(),i.to()),s=o.empty()?i.from()==i.head:o.from()==o.head;n<=t&&--t,e.splice(--n,2,new Wn(s?a:l,s?l:a))}}return new Nn(e,t)}function Dn(e,t){return new Nn([new Wn(e,t||e)],0)}function Hn(e){return e.text?D(e.from.line+e.text.length-1,g(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function In(e,t){if(H(e,t.from)<0)return e;if(H(e,t.to)<=0)return Hn(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=Hn(t).ch-t.to.ch),D(r,n)}function Pn(e,t){for(var r=[],n=0;n1&&e.remove(a.line+1,p-1),e.insert(a.line+1,y)}kt(e,"change",e,t)}function Gn(e,t,r){function n(e,i,o){if(e.linked)for(var l=0;l1&&!e.done[e.done.length-2].ranges?(e.done.pop(),g(e.done)):void 0}function $n(e,t,r,n){var i=e.history;i.undone.length=0;var o,l,a=+new Date;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>a-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=Xn(i,i.lastOp==n)))l=g(o.changes),0==H(t.from,t.to)&&0==H(t.from,l.to)?l.to=Hn(t):o.changes.push(Kn(e,t));else{var s=g(i.done);for(s&&s.ranges||Zn(e.sel,i.done),o={changes:[Kn(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,l||Ne(e,"historyAdded")}function Yn(e,t,r,n){var i=t.charAt(0);return"*"==i||"+"==i&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Jn(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||Yn(e,o,g(i.done),t))?i.done[i.done.length-1]=t:Zn(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&qn(i.undone)}function Zn(e,t){var r=g(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Qn(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(r){r.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=r.markedSpans),++o})}function ei(e){if(!e)return null;for(var t,r=0;r-1&&(g(a)[f]=u[f],delete u[f])}}}return n}function ii(e,t,r,n){if(e.cm&&e.cm.display.shift||e.extend){var i=t.anchor;if(n){var o=H(r,i)<0;o!=H(n,i)<0?(i=r,r=n):o!=H(r,n)<0&&(r=n)}return new Wn(i,r)}return new Wn(n||r,r)}function oi(e,t,r,n){fi(e,new Nn([ii(e,e.sel.primary(),t,r)],0),n)}function li(e,t,r){for(var n=[],i=0;i=t.ch:a.to>t.ch))){if(i&&(Ne(s,"beforeCursorEnter"),s.explicitlyCleared)){if(o.markedSpans){--l;continue}break}if(!s.atomic)continue;if(r){var u=s.find(n<0?1:-1),c=void 0;if((n<0?s.inclusiveRight:s.inclusiveLeft)&&(u=yi(e,u,-n,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=H(u,r))&&(n<0?c<0:c>0))return vi(e,u,t,n,i)}var f=s.find(n<0?-1:1);return(n<0?s.inclusiveLeft:s.inclusiveRight)&&(f=yi(e,f,n,f.line==t.line?o:null)),f?vi(e,f,t,n,i):null}}return t}function mi(e,t,r,n,i){var o=n||1,l=vi(e,t,r,o,i)||!i&&vi(e,t,r,o,!0)||vi(e,t,r,-o,i)||!i&&vi(e,t,r,-o,!0);return l?l:(e.cantEdit=!0,D(e.first,0))}function yi(e,t,r,n){return r<0&&0==t.ch?t.line>e.first?B(e,D(t.line-1)):null:r>0&&t.ch==(n||L(e,t.line)).text.length?t.line=0;--i)Ci(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text});else Ci(e,t)}}function Ci(e,t){if(1!=t.text.length||""!=t.text[0]||0!=H(t.from,t.to)){var r=Pn(e,t);$n(e,t,r,e.cm?e.cm.curOp.id:NaN),Li(e,t,r,Y(e,t));var n=[];Gn(e,function(e,r){r||h(n,e.history)!=-1||(Ni(e.history,t),n.push(e.history)),Li(e,t,null,Y(e,t))})}}function Si(e,t,r){if(!e.cm||!e.cm.state.suppressEdits||r){for(var n,i=e.history,o=e.sel,l="undo"==t?i.done:i.undone,a="undo"==t?i.undone:i.done,s=0;s=0;--d){var p=f(d);if(p)return p.v}}}}function ki(e,t){if(0!=t&&(e.first+=t,e.sel=new Nn(v(e.sel.ranges,function(e){return new Wn(D(e.anchor.line+t,e.anchor.ch),D(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){dn(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())){if(t.from.lineo&&(t={from:t.from,to:D(o,L(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=T(e,t.from,t.to),r||(r=Pn(e,t)),e.cm?Ti(e.cm,t,n):Vn(e,t,n),hi(e,r,Tl)}}function Ti(e,t,r){var n=e.doc,i=e.display,o=t.from,l=t.to,a=!1,s=o.line;e.options.lineWrapping||(s=A(se(L(n,o.line))),n.iter(s,l.line+1,function(e){if(e==i.maxLine)return a=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Ee(e),Vn(n,t,r,wr(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,function(e){var t=ge(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),n.frontier=Math.min(n.frontier,o.line),bn(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?dn(e):o.line!=l.line||1!=t.text.length||jn(e.doc,t)?dn(e,o.line,l.line+1,u):pn(e,o.line,"text");var c=De(e,"changes"),f=De(e,"change");if(f||c){var h={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};f&&kt(e,"change",e,h),c&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function Mi(e,t,r,n,i){if(n||(n=r),H(n,r)<0){var o=n;n=r,r=o}"string"==typeof t&&(t=e.splitLines(t)),xi(e,{from:r,to:n,text:t,origin:i})}function Oi(e,t,r,n){r0||0==a&&l.clearWhenEmpty!==!1)return l;if(l.replacedWith&&(l.collapsed=!0,l.widgetNode=n("span",[l.replacedWith],"CodeMirror-widget"),l.widgetNode.setAttribute("role","presentation"),i.handleMouseEvents||l.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(l.widgetNode.insertLeft=!0)),l.collapsed){if(ae(e,t.line,t,r,l)||t.line!=r.line&&ae(e,r.line,t,r,l))throw new Error("Inserting collapsed marker partially overlapping an existing one");G()}l.addToHistory&&$n(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s,c=t.line,f=e.cm;if(e.iter(c,r.line+1,function(e){f&&l.collapsed&&!f.options.lineWrapping&&se(e)==f.display.maxLine&&(s=!0),l.collapsed&&c!=t.line&&O(e,0),q(e,new U(l,c==t.line?t.ch:null,c==r.line?r.ch:null)),++c}),l.collapsed&&e.iter(t.line,r.line+1,function(t){he(e,t)&&O(t,0)}),l.clearOnEnter&&Rl(l,"beforeCursorEnter",function(){return l.clear()}),l.readOnly&&(V(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),l.collapsed&&(l.id=++la,l.atomic=!0),f){if(s&&(f.curOp.updateMaxLine=!0),l.collapsed)dn(f,t.line,r.line+1);else if(l.className||l.title||l.startStyle||l.endStyle||l.css)for(var h=t.line;h<=r.line;h++)pn(f,h,"text");l.atomic&&pi(f.doc),kt(f,"markerAdded",f,l)}return l}function Bi(e,t){var r=this;this.markers=e,this.primary=t;for(var n=0;n-1)return t.state.draggingText(e),void setTimeout(function(){return t.display.input.focus()},20);try{var u=e.dataTransfer.getData("Text");if(u){var c;if(t.state.draggingText&&!t.state.draggingText.copy&&(c=t.listSelections()),hi(t.doc,Dn(r,r)),c)for(var f=0;f=0;t--)Mi(e.doc,"",n[t].from,n[t].to,"+delete");Zr(e)})}function oo(e,t){var r=L(e.doc,t),n=se(r);n!=r&&(t=A(n));var i=Me(n),o=i?i[0].level%2?xe(n):we(n):0;return D(t,o)}function lo(e,t){for(var r,n=L(e.doc,t);r=le(n);)n=r.find(1,!0).line,t=null;var i=Me(n),o=i?i[0].level%2?we(n):xe(n):n.text.length;return D(null==t?A(n):t,o)}function ao(e,t){var r=oo(e,t.line),n=L(e.doc,r.line),i=Me(n);if(!i||0==i[0].level){var o=Math.max(0,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return D(r.line,l?0:o)}return r}function so(e,t,r){if("string"==typeof t&&(t=ya[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=Ll}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function uo(e,t,r){for(var n=0;ni-400&&0==H(ma.pos,r)?n="triple":va&&va.time>i-400&&0==H(va.pos,r)?(n="double",ma={time:i,pos:r}):(n="single",va={time:i,pos:r});var l,a=e.doc.sel,u=dl?t.metaKey:t.ctrlKey;e.options.dragDrop&&zl&&!e.isReadOnly()&&"single"==n&&(l=a.contains(r))>-1&&(H((l=a.ranges[l]).from(),r)<0||r.xRel>0)&&(H(l.to(),r)>0||r.xRel<0)?wo(e,t,r,u):xo(e,t,r,n,u)}function wo(e,t,r,n){var i=e.display,o=+new Date,l=cn(e,function(a){il&&(i.scroller.draggable=!1),e.state.draggingText=!1,Ae(document,"mouseup",l),Ae(i.scroller,"drop",l),Math.abs(t.clientX-a.clientX)+Math.abs(t.clientY-a.clientY)<10&&(Ie(a),!n&&+new Date-200w&&i.push(new Wn(D(v,w),D(v,d(y,u,o))))}i.length||i.push(new Wn(r,r)),fi(f,En(g.ranges.slice(0,p).concat(i),p),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var x=h,C=x.anchor,S=t;if("single"!=n){var k;k="double"==n?e.findWordAt(t):new Wn(D(t.line,0),B(f,D(t.line+1,0))),H(k.anchor,C)>0?(S=k.head,C=R(x.from(),k.anchor)):(S=k.anchor,C=P(x.to(),k.head))}var T=g.ranges.slice(0);T[p]=new Wn(B(f,C),S),fi(f,En(T,p),Ml)}}function a(t){var r=++x,i=Cr(e,t,!0,"rect"==n);if(i)if(0!=H(i,b)){e.curOp.focus=o(),l(i);var s=Rr(u,f);(i.line>=s.to||i.linew.bottom?20:0;c&&setTimeout(cn(e,function(){x==r&&(u.scroller.scrollTop+=c,a(t))}),50)}}function s(t){e.state.selectingText=!1,x=1/0,Ie(t),u.input.focus(),Ae(document,"mousemove",C),Ae(document,"mouseup",S),f.history.lastSelOrigin=null}var u=e.display,f=e.doc;Ie(t);var h,p,g=f.sel,v=g.ranges;if(i&&!t.shiftKey?(p=f.sel.contains(r),h=p>-1?v[p]:new Wn(r,r)):(h=f.sel.primary(),p=f.sel.primIndex),pl?t.shiftKey&&t.metaKey:t.altKey)n="rect",i||(h=new Wn(r,r)),r=Cr(e,t,!0,!0),p=-1;else if("double"==n){var m=e.findWordAt(r);h=e.display.shift||f.extend?ii(f,h,m.anchor,m.head):m}else if("triple"==n){var y=new Wn(D(r.line,0),B(f,D(r.line+1,0)));h=e.display.shift||f.extend?ii(f,h,y.anchor,y.head):y}else h=ii(f,h,r);i?p==-1?(p=v.length,fi(f,En(v.concat([h]),p),{scroll:!1,origin:"*mouse"})):v.length>1&&v[p].empty()&&"single"==n&&!t.shiftKey?(fi(f,En(v.slice(0,p).concat(v.slice(p+1)),0),{scroll:!1,origin:"*mouse"}),g=f.sel):ai(f,p,h,Ml):(p=0,fi(f,new Nn([h],0),Ml),g=f.sel);var b=r,w=u.wrapper.getBoundingClientRect(),x=0,C=cn(e,function(e){Fe(e)?a(e):s(e)}),S=cn(e,s);e.state.selectingText=S,Rl(document,"mousemove",C),Rl(document,"mouseup",S)}function Co(e,t,r,n){var i,o;try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Ie(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(o>a.bottom||!De(e,r))return Re(t);o-=a.top-l.viewOffset;for(var s=0;s=i){var c=N(e.doc,o),f=e.options.gutters[s];return Ne(e,r,e,c,f,t),Re(t)}}}function So(e,t){return Co(e,t,"gutterClick",!0)}function ko(e,t){Bt(e.display,t)||Lo(e,t)||We(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function Lo(e,t){return!!De(e,"gutterContextMenu")&&Co(e,t,"gutterContextMenu",!1)}function To(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),or(e)}function Mo(e){function t(t,n,i,o){e.defaults[t]=n,i&&(r[t]=o?function(e,t,r){r!=xa&&i(e,t,r)}:i)}var r=e.optionHandlers;e.defineOption=t,e.Init=xa,t("value","",function(e,t){return e.setValue(t)},!0),t("mode",null,function(e,t){e.doc.modeOption=t,Bn(e)},!0),t("indentUnit",2,Bn,!0),t("indentWithTabs",!1),t("smartIndent",!0),t("tabSize",4,function(e){Fn(e),or(e),dn(e)},!0),t("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,
t){var r=[],n=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(o==-1)break;i=o+t.length,r.push(D(n,o))}n++});for(var i=r.length-1;i>=0;i--)Mi(e.doc,t,r[i],D(r[i].line,r[i].ch+t.length))}}),t("specialChars",/[\u0000-\u001f\u007f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff]/g,function(e,t,r){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),r!=xa&&e.refresh()}),t("specialCharPlaceholder",dt,function(e){return e.refresh()},!0),t("electricChars",!0),t("inputStyle",hl?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),t("spellcheck",!1,function(e,t){return e.getInputField().spellcheck=t},!0),t("rtlMoveVisually",!gl),t("wholeLineUpdateBefore",!0),t("theme","default",function(e){To(e),Oo(e)},!0),t("keyMap","default",function(e,t,r){var n=no(t),i=r!=xa&&no(r);i&&i.detach&&i.detach(e,n),n.attach&&n.attach(e,i||null)}),t("extraKeys",null),t("lineWrapping",!1,No,!0),t("gutters",[],function(e){An(e.options),Oo(e)},!0),t("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?br(e.display)+"px":"0",e.refresh()},!0),t("coverGutterNextToScrollbar",!1,function(e){return Ur(e)},!0),t("scrollbarStyle","native",function(e){Kr(e),Ur(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),t("lineNumbers",!1,function(e){An(e.options),Oo(e)},!0),t("firstLineNumber",1,Oo,!0),t("lineNumberFormatter",function(e){return e},Oo,!0),t("showCursorWhenSelecting",!1,kr,!0),t("resetSelectionOnContextMenu",!0),t("lineWiseCopyCut",!0),t("readOnly",!1,function(e,t){"nocursor"==t?(Er(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),t("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),t("dragDrop",!0,Ao),t("allowDropFileTypes",null),t("cursorBlinkRate",530),t("cursorScrollMargin",0),t("cursorHeight",1,kr,!0),t("singleCursorHeightPerLine",!0,kr,!0),t("workTime",100),t("workDelay",100),t("flattenSpans",!0,Fn,!0),t("addModeClass",!1,Fn,!0),t("pollInterval",100),t("undoDepth",200,function(e,t){return e.doc.history.undoDepth=t}),t("historyEventDelay",1250),t("viewportMargin",10,function(e){return e.refresh()},!0),t("maxHighlightLength",1e4,Fn,!0),t("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),t("tabindex",null,function(e,t){return e.display.input.getField().tabIndex=t||""}),t("autofocus",null)}function Oo(e){On(e),dn(e),Dr(e)}function Ao(e,t,r){var n=r&&r!=xa;if(!t!=!n){var i=e.display.dragFunctions,o=t?Rl:Ae;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function No(e){e.options.lineWrapping?(l(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(wl(e.display.wrapper,"CodeMirror-wrap"),ve(e)),xr(e),dn(e),or(e),setTimeout(function(){return Ur(e)},100)}function Wo(e,t){var r=this;if(!(this instanceof Wo))return new Wo(e,t);this.options=t=t?u(t):{},u(Ca,t,!1),An(t);var n=t.value;"string"==typeof n&&(n=new sa(n,t.mode,null,t.lineSeparator)),this.doc=n;var i=new Wo.inputStyles[t.inputStyle](this),o=this.display=new k(e,n,i);o.wrapper.CodeMirror=this,On(this),To(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Kr(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 f,keySeq:null,specialChars:null},t.autofocus&&!hl&&o.input.focus(),rl&&nl<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Eo(this),$i(),en(this),this.curOp.forceUpdate=!0,Un(this,n),t.autofocus&&!hl||this.hasFocus()?setTimeout(s(Wr,this),20):Er(this);for(var l in Sa)Sa.hasOwnProperty(l)&&Sa[l](r,t[l],xa);Hr(this),t.finishInit&&t.finishInit(this);for(var a=0;a400}var i=e.display;Rl(i.scroller,"mousedown",cn(e,yo)),rl&&nl<11?Rl(i.scroller,"dblclick",cn(e,function(t){if(!We(e,t)){var r=Cr(e,t);if(r&&!So(e,t)&&!Bt(e.display,t)){Ie(t);var n=e.findWordAt(r);oi(e.doc,n.anchor,n.head)}}})):Rl(i.scroller,"dblclick",function(t){return We(e,t)||Ie(t)}),bl||Rl(i.scroller,"contextmenu",function(t){return ko(e,t)});var o,l={end:0};Rl(i.scroller,"touchstart",function(t){if(!We(e,t)&&!r(t)){i.input.ensurePolled(),clearTimeout(o);var n=+new Date;i.activeTouch={start:n,moved:!1,prev:n-l.end<=300?l:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Rl(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Rl(i.scroller,"touchend",function(r){var o=i.activeTouch;if(o&&!Bt(i,r)&&null!=o.left&&!o.moved&&new Date-o.start<300){var l,a=e.coordsChar(i.activeTouch,"page");l=!o.prev||n(o,o.prev)?new Wn(a,a):!o.prev.prev||n(o,o.prev.prev)?e.findWordAt(a):new Wn(D(a.line,0),B(e.doc,D(a.line+1,0))),e.setSelection(l.anchor,l.head),e.focus(),Ie(r)}t()}),Rl(i.scroller,"touchcancel",t),Rl(i.scroller,"scroll",function(){i.scroller.clientHeight&&(zr(e,i.scroller.scrollTop),Br(e,i.scroller.scrollLeft,!0),Ne(e,"scroll",e))}),Rl(i.scroller,"mousewheel",function(t){return Vr(e,t)}),Rl(i.scroller,"DOMMouseScroll",function(t){return Vr(e,t)}),Rl(i.wrapper,"scroll",function(){return i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){We(e,t)||ze(t)},over:function(t){We(e,t)||(Ki(e,t),ze(t))},start:function(t){return _i(e,t)},drop:cn(e,Ui),leave:function(t){We(e,t)||qi(e)}};var a=i.input.getField();Rl(a,"keyup",function(t){return vo.call(e,t)}),Rl(a,"keydown",cn(e,po)),Rl(a,"keypress",cn(e,mo)),Rl(a,"focus",function(t){return Wr(e,t)}),Rl(a,"blur",function(t){return Er(e,t)})}function Do(e,t,r,n){var i,o=e.doc;null==r&&(r="add"),"smart"==r&&(o.mode.indent?i=et(e,t):r="prev");var l=e.options.tabSize,a=L(o,t),s=c(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var u,f=a.text.match(/^\s*/)[0];if(n||/\S/.test(a.text)){if("smart"==r&&(u=o.mode.indent(i,a.text.slice(f.length),a.text),u==Ll||u>150)){if(!n)return;r="prev"}}else u=0,r="not";"prev"==r?u=t>o.first?c(L(o,t-1).text,null,l):0:"add"==r?u=s+e.options.indentUnit:"subtract"==r?u=s-e.options.indentUnit:"number"==typeof r&&(u=s+r),u=Math.max(0,u);var h="",d=0;if(e.options.indentWithTabs)for(var g=Math.floor(u/l);g;--g)d+=l,h+="\t";if(d1)if(La&&La.text.join("\n")==t){if(n.ranges.length%La.text.length==0){s=[];for(var u=0;u=0;f--){var h=n.ranges[f],d=h.from(),p=h.to();h.empty()&&(r&&r>0?d=D(d.line,d.ch-r):e.state.overwrite&&!l?p=D(p.line,Math.min(L(o,p.line).text.length,p.ch+g(a).length)):La&&La.lineWise&&La.text.join("\n")==t&&(d=p=D(d.line,0))),c=e.curOp.updateInput;var m={from:d,to:p,text:s?s[f%s.length]:a,origin:i||(l?"paste":e.state.cutIncoming?"cut":"+input")};xi(e.doc,m),kt(e,"inputRead",e,m)}t&&!l&&Ro(e,t),Zr(e),e.curOp.updateInput=c,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function Po(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||un(t,function(){return Io(t,r,0,null,"paste")}),!0}function Ro(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var a=0;a-1){l=Do(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(L(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Do(e,i.head.line,"smart"));l&&kt(e,"electricInput",e,i.head.line)}}}function zo(e){for(var t=[],r=[],n=0;nn&&(Do(t,o.head.line,e,!0),n=o.head.line,i==t.doc.sel.primIndex&&Zr(t));else{var l=o.from(),a=o.to(),s=Math.max(n,l.line);n=Math.min(t.lastLine(),a.line-(a.ch?0:1))+1;for(var u=s;u0&&ai(t.doc,i,new Wn(l,c[i].to()),Tl)}}}),getTokenAt:function(e,t){return it(this,e,t)},getLineTokens:function(e,t){return it(this,D(e),t,!0)},getTokenTypeAt:function(e){e=B(this.doc,e);var t,r=Qe(this,L(this.doc,e.line)),n=0,i=(r.length-1)/2,o=e.ch;if(0==o)t=r[2];else for(;;){var l=n+i>>1;if((l?r[2*l-1]:0)>=o)i=l;else{if(!(r[2*l+1]o&&(e=o,i=!0),n=L(this.doc,e)}else n=e;return sr(this,n,{top:0,left:0},t||"page",r).top+(i?this.doc.height-pe(n):0)},defaultTextHeight:function(){return vr(this.display)},defaultCharWidth:function(){return mr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,r,n,i){var o=this.display;e=fr(this,B(this.doc,e));var l=e.bottom,a=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==n)l=e.top;else if("above"==n||"near"==n){var s=Math.max(o.wrapper.clientHeight,this.doc.height),u=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==n||e.bottom+t.offsetHeight>s)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=s&&(l=e.bottom),a+t.offsetWidth>u&&(a=u-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(a=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?a=0:"middle"==i&&(a=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=a+"px"),r&&$r(this,a,l,a+t.offsetWidth,l+t.offsetHeight)},triggerOnKeyDown:fn(po),triggerOnKeyPress:fn(mo),triggerOnKeyUp:vo,execCommand:function(e){if(ya.hasOwnProperty(e))return ya[e].call(null,this)},triggerElectric:fn(function(e){Ro(this,e)}),findPosH:function(e,t,r,n){var i=this,o=1;t<0&&(o=-1,t=-t);for(var l=B(this.doc,e),a=0;a0&&a(r.charAt(n-1));)--n;for(;i.5)&&xr(this),Ne(this,"refresh",this)}),swapDoc:fn(function(e){var t=this.doc;return t.cm=null,Un(this,e),or(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,kt(this,"swapDoc",this,t),t}),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}},He(e),e.registerHelper=function(t,n,i){r.hasOwnProperty(t)||(r[t]=e[t]={_global:[]}),r[t][n]=i},e.registerGlobalHelper=function(t,n,i,o){e.registerHelper(t,n,o),r[t]._global.push({pred:i,val:o})}}function Vo(e,t,r,n,i){function o(){var t=a+r;return!(t=e.first+e.size)&&(a=t,c=L(e,t))}function l(e){var t=(i?Le:Te)(c,s,r,!0);if(null==t){if(e||!o())return!1;s=i?(r<0?xe:we)(c):r<0?c.text.length:0}else s=t;return!0}var a=t.line,s=t.ch,u=r,c=L(e,a);if("char"==n)l();else if("column"==n)l(!0);else if("word"==n||"group"==n)for(var f=null,h="group"==n,d=e.cm&&e.cm.getHelper(t,"wordChars"),p=!0;!(r<0)||l(!p);p=!1){var g=c.text.charAt(s)||"\n",v=x(g,d)?"w":h&&"\n"==g?"n":!h||/\s/.test(g)?null:"p";if(!h||p||v||(v="s"),f&&f!=v){r<0&&(r=1,l());break}if(v&&(f=v),r>0&&!l(!p))break}var m=mi(e,D(a,s),t,u,!0);return H(t,m)||(m.hitSide=!0),m}function Go(e,t,r,n){var i,o=e.doc,l=t.left;if("page"==n){var a=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Math.max(a-.5*vr(e.display),3);i=(r>0?t.bottom:t.top)+r*s}else"line"==n&&(i=r>0?t.bottom+3:t.top-3);for(var u;u=pr(e,l,i),u.outside;){if(r<0?i<=0:i>=o.height){u.hitSide=!0;break}i+=5*r}return u}function Uo(e,t){var r=Yt(e,t.line);if(!r||r.hidden)return null;var n=L(e.doc,t.line),i=qt(r,n,t.line),o=Me(n),l="left";if(o){var a=Se(o,t.ch);l=a%2?"right":"left"}var s=Qt(i.map,t.ch,l);return s.offset="right"==s.collapse?s.end:s.start,s}function _o(e,t){return t&&(e.bad=!0),e}function Ko(e,t,r,n,i){function o(e){return function(t){return t.id==e}}function l(t){if(1==t.nodeType){var r=t.getAttribute("cm-text");if(null!=r)return void(a+=""==r?t.textContent.replace(/\u200b/g,""):r);var c,f=t.getAttribute("cm-marker");if(f){var h=e.findMarks(D(n,0),D(i+1,0),o(+f));return void(h.length&&(c=h[0].find())&&(a+=T(e.doc,c.from,c.to).join(u)))}if("false"==t.getAttribute("contenteditable"))return;for(var d=0;d=15&&(al=!1,il=!0);var ml,yl=dl&&(ol||al&&(null==vl||vl<12.11)),bl=Qo||rl&&nl>=9,wl=function(t,r){var n=t.className,i=e(r).exec(n);if(i){var o=n.slice(i.index+i[0].length);t.className=n.slice(0,i.index)+(o?i[1]+o:"")}};ml=document.createRange?function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch(e){return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};var xl=function(e){e.select()};fl?xl=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:rl&&(xl=function(e){try{e.select()}catch(e){}}),f.prototype.set=function(e,t){clearTimeout(this.id),this.id=setTimeout(t,e)};var Cl,Sl,kl=30,Ll={toString:function(){return"CodeMirror.Pass"}},Tl={scroll:!1},Ml={origin:"*mouse"},Ol={origin:"+move"},Al=[""],Nl=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Wl=/[\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]/,El=!1,Dl=!1,Hl=null,Il=function(){function e(e){return e<=247?r.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1785?n.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,r){this.level=e,this.from=t,this.to=r}var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,l=/[LRr]/,a=/[Lb1n]/,s=/[1n]/,u="L";return function(r){if(!i.test(r))return!1;for(var n=r.length,c=[],f=0;f=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.post},eatSpace:function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}var i=function(e){return r?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}},He(st),st.prototype.lineNo=function(){return A(this)};var ql,Xl={},$l={},Yl=null,Jl=null,Zl={left:0,right:0,top:0,bottom:0},Ql=0,ea=null;rl?ea=-.53:Qo?ea=15:ll?ea=-.7:sl&&(ea=-1/3);var ta=function(e,t,r){this.cm=r;var i=this.vert=n("div",[n("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=n("div",[n("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(i),e(o),Rl(i,"scroll",function(){i.clientHeight&&t(i.scrollTop,"vertical");
}),Rl(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,rl&&nl<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ta.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==n&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},ta.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},ta.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},ta.prototype.zeroWidthHack=function(){var e=dl&&!ul?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new f,this.disableVert=new f},ta.prototype.enableZeroWidthBar=function(e,t){function r(){var n=e.getBoundingClientRect(),i=document.elementFromPoint(n.left+1,n.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,r)}e.style.pointerEvents="auto",t.set(1e3,r)},ta.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var ra=function(){};ra.prototype.update=function(){return{bottom:0,right:0}},ra.prototype.setScrollLeft=function(){},ra.prototype.setScrollTop=function(){},ra.prototype.clear=function(){};var na={native:ta,null:ra},ia=0,oa=function(e,t,r){var n=e.display;this.viewport=t,this.visible=Rr(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Ut(e),this.force=r,this.dims=yr(e),this.events=[]};oa.prototype.signal=function(e,t){De(e,t)&&this.events.push(arguments)},oa.prototype.finish=function(){for(var e=this,t=0;t=0&&H(e,i.to())<=0)return n}return-1}},Wn.prototype={from:function(){return R(this.anchor,this.head)},to:function(){return P(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}},Ei.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=this,n=e,i=e+t;n1||!(this.children[0]instanceof Ei))){var s=[];this.collapse(s),this.children=[new Ei(s)],this.children[0].parent=this}},collapse:function(e){for(var t=this,r=0;r50){for(var a=o.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=this,i=0;it.display.maxLineLength&&(t.display.maxLine=c,t.display.maxLineLength=f,t.display.maxLineChanged=!0)}null!=i&&t&&this.collapsed&&dn(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&pi(t.doc)),t&&kt(t,"markerCleared",t,this),r&&tn(t),this.parent&&this.parent.clear()}},Ri.prototype.find=function(e,t){var r=this;null==e&&"bookmark"==this.type&&(e=1);for(var n,i,o=0;o=0;u--)xi(n,i[u]);s?ci(this,s):this.cm&&Zr(this.cm)}),undo:hn(function(){Si(this,"undo")}),redo:hn(function(){Si(this,"redo")}),undoSelection:hn(function(){Si(this,"undo",!0)}),redoSelection:hn(function(){Si(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=B(this,e),t=B(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var a=0;a=s.to||null==s.from&&i!=e.line||null!=s.from&&i==t.line&&s.from>=t.ch||r&&!r(s.marker)||n.push(s.marker.parent||s.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne?(t=e,!0):(e-=o,void++r)}),B(this,D(r,t))},indexFromPos:function(e){e=B(this,e);var t=e.ch;if(e.linet&&(t=e.from),null!=e.to&&e.to0)i=new D(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),D(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=L(e.doc,i.line-1).text;l&&(i=new D(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),D(i.line-1,l.length-1),i,"+transpose"))}r.push(new Wn(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return un(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;ne.firstLine()&&(n=D(n.line-1,L(e.doc,n.line-1).length)),i.ch==L(e.doc,i.line).text.length&&i.linet.viewTo-1)return!1;var o,l,a;n.line==t.viewFrom||0==(o=Sr(e,n.line))?(l=A(t.view[0].line),a=t.view[0].node):(l=A(t.view[o].line),a=t.view[o-1].node.nextSibling);var s,u,c=Sr(e,i.line);if(c==t.view.length-1?(s=t.viewTo-1,u=t.lineDiv.lastChild):(s=A(t.view[c+1].line)-1,u=t.view[c+1].node.previousSibling),!a)return!1;for(var f=e.doc.splitLines(Ko(e,a,u,l,s)),h=T(e.doc,D(l,0),D(s,L(e.doc,s).text.length));f.length>1&&h.length>1;)if(g(f)==g(h))f.pop(),h.pop(),s--;else{if(f[0]!=h[0])break;f.shift(),h.shift(),l++}for(var d=0,p=0,v=f[0],m=h[0],y=Math.min(v.length,m.length);d1||f[0]||H(C,S)?(Mi(e.doc,f,C,S,"+input"),!0):void 0},Ta.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ta.prototype.reset=function(){this.forceCompositionEnd()},Ta.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.pollContent()||dn(this.cm),this.div.blur(),this.div.focus())},Ta.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}!e.cm.isReadOnly()&&e.pollContent()||un(e.cm,function(){return dn(e.cm)})},80))},Ta.prototype.setUneditable=function(e){e.contentEditable="false"},Ta.prototype.onKeyPress=function(e){e.preventDefault(),this.cm.isReadOnly()||cn(this.cm,Io)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},Ta.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ta.prototype.onContextMenu=function(){},Ta.prototype.resetPosition=function(){},Ta.prototype.needsContentAttribute=!0;var Ma=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new f,this.inaccurateSelection=!1,this.hasSelection=!1,this.composing=null};Ma.prototype.init=function(e){function t(e){if(!We(i,e)){if(i.somethingSelected())Ho({lineWise:!1,text:i.getSelections()}),n.inaccurateSelection&&(n.prevInput="",n.inaccurateSelection=!1,l.value=La.text.join("\n"),xl(l));else{if(!i.options.lineWiseCopyCut)return;var t=zo(i);Ho({lineWise:!0,text:t.text}),"cut"==e.type?i.setSelections(t.ranges,null,Tl):(n.prevInput="",l.value=t.text.join("\n"),
xl(l))}"cut"==e.type&&(i.state.cutIncoming=!0)}}var r=this,n=this,i=this.cm,o=this.wrapper=Fo(),l=this.textarea=o.firstChild;e.wrapper.insertBefore(o,e.wrapper.firstChild),fl&&(l.style.width="0px"),Rl(l,"input",function(){rl&&nl>=9&&r.hasSelection&&(r.hasSelection=null),n.poll()}),Rl(l,"paste",function(e){We(i,e)||Po(e,i)||(i.state.pasteIncoming=!0,n.fastPoll())}),Rl(l,"cut",t),Rl(l,"copy",t),Rl(e.scroller,"paste",function(t){Bt(e,t)||We(i,t)||(i.state.pasteIncoming=!0,n.focus())}),Rl(e.lineSpace,"selectstart",function(t){Bt(e,t)||Ie(t)}),Rl(l,"compositionstart",function(){var e=i.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:i.markText(e,i.getCursor("to"),{className:"CodeMirror-composing"})}}),Rl(l,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},Ma.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=Lr(e);if(e.options.moveInputWithCursor){var i=fr(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n},Ma.prototype.showSelection=function(e){var t=this.cm,n=t.display;r(n.cursorDiv,e.cursors),r(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ma.prototype.reset=function(e){if(!this.contextMenuPending){var t,r,n=this.cm,i=n.doc;if(n.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=jl&&(o.to().line-o.from().line>100||(r=n.getSelection()).length>1e3);var l=t?"-":r||n.getSelection();this.textarea.value=l,n.state.focused&&xl(this.textarea),rl&&nl>=9&&(this.hasSelection=l)}else e||(this.prevInput=this.textarea.value="",rl&&nl>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},Ma.prototype.getField=function(){return this.textarea},Ma.prototype.supportsTouch=function(){return!1},Ma.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!hl||o()!=this.textarea))try{this.textarea.focus()}catch(e){}},Ma.prototype.blur=function(){this.textarea.blur()},Ma.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ma.prototype.receivedFocus=function(){this.slowPoll()},Ma.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ma.prototype.fastPoll=function(){function e(){var n=r.poll();n||t?(r.pollingFast=!1,r.slowPoll()):(t=!0,r.polling.set(60,e))}var t=!1,r=this;r.pollingFast=!0,r.polling.set(20,e)},Ma.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Fl(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(rl&&nl>=9&&this.hasSelection===i||dl&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||n||(n=""),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var l=0,a=Math.min(n.length,i.length);l1e3||i.indexOf("\n")>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ma.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ma.prototype.onKeyPress=function(){rl&&nl>=9&&(this.hasSelection=null),this.fastPoll()},Ma.prototype.onContextMenu=function(e){function t(){if(null!=l.selectionStart){var e=i.somethingSelected(),t=""+(e?l.value:"");l.value="⇚",l.value=t,n.prevInput=e?"":"",l.selectionStart=1,l.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function r(){if(n.contextMenuPending=!1,n.wrapper.style.cssText=f,l.style.cssText=c,rl&&nl<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=s),null!=l.selectionStart){(!rl||rl&&nl<9)&&t();var e=0,r=function(){o.selForContextMenu==i.doc.sel&&0==l.selectionStart&&l.selectionEnd>0&&""==n.prevInput?cn(i,bi)(i):e++<10?o.detectingSelectAll=setTimeout(r,500):o.input.reset()};o.detectingSelectAll=setTimeout(r,200)}}var n=this,i=n.cm,o=i.display,l=n.textarea,a=Cr(i,e),s=o.scroller.scrollTop;if(a&&!al){var u=i.options.resetSelectionOnContextMenu;u&&i.doc.sel.contains(a)==-1&&cn(i,fi)(i.doc,Dn(a),Tl);var c=l.style.cssText,f=n.wrapper.style.cssText;n.wrapper.style.cssText="position: absolute";var h=n.wrapper.getBoundingClientRect();l.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(rl?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var d;if(il&&(d=window.scrollY),o.input.focus(),il&&window.scrollTo(null,d),o.input.reset(),i.somethingSelected()||(l.value=n.prevInput=" "),n.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),rl&&nl>=9&&t(),bl){ze(e);var p=function(){Ae(window,"mouseup",p),setTimeout(r,20)};Rl(window,"mouseup",p)}else setTimeout(r,50)}},Ma.prototype.readOnlyChanged=function(e){e||this.reset()},Ma.prototype.setUneditable=function(){},Ma.prototype.needsContentAttribute=!1,Mo(Wo),jo(Wo);var Oa="iter insert remove copy getEditor constructor".split(" ");for(var Aa in sa.prototype)sa.prototype.hasOwnProperty(Aa)&&h(Oa,Aa)<0&&(Wo.prototype[Aa]=function(e){return function(){return e.apply(this.doc,arguments)}}(sa.prototype[Aa]));return He(sa),Wo.inputStyles={textarea:Ma,contenteditable:Ta},Wo.defineMode=function(e){Wo.defaults.mode||"null"==e||(Wo.defaults.mode=e),Ue.apply(this,arguments)},Wo.defineMIME=_e,Wo.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Wo.defineMIME("text/plain","null"),Wo.defineExtension=function(e,t){Wo.prototype[e]=t},Wo.defineDocExtension=function(e,t){sa.prototype[e]=t},Wo.fromTextArea=$o,Yo(Wo),Wo.version="5.23.0",Wo})},{}],5:[function(e,t,r){!function(n){"object"==typeof r&&"object"==typeof t?n(e("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],n):n(CodeMirror)}(function(e){"use strict";function t(e,t,r){return/^(?:operator|sof|keyword c|case|new|export|default|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(r||0)))}e.defineMode("javascript",function(r,n){function i(e){for(var t,r=!1,n=!1;null!=(t=e.next());){if(!r){if("/"==t&&!n)return;"["==t?n=!0:n&&"]"==t&&(n=!1)}r=!r&&"\\"==t}}function o(e,t,r){return Le=e,Te=r,t}function l(e,r){var n=e.next();if('"'==n||"'"==n)return r.tokenize=a(n),r.tokenize(e,r);if("."==n&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==n&&e.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(n))return o(n);if("="==n&&e.eat(">"))return o("=>","operator");if("0"==n&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),o("number","number");if("0"==n&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),o("number","number");if("0"==n&&e.eat(/b/i))return e.eatWhile(/[01]/i),o("number","number");if(/\d/.test(n))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==n)return e.eat("*")?(r.tokenize=s,s(e,r)):e.eat("/")?(e.skipToEnd(),o("comment","comment")):t(e,r,1)?(i(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),o("regexp","string-2")):(e.eatWhile(He),o("operator","operator",e.current()));if("`"==n)return r.tokenize=u,u(e,r);if("#"==n)return e.skipToEnd(),o("error","error");if(He.test(n))return">"==n&&r.lexical&&">"==r.lexical.type||e.eatWhile(He),o("operator","operator",e.current());if(Ee.test(n)){e.eatWhile(Ee);var l=e.current(),c=De.propertyIsEnumerable(l)&&De[l];return c&&"."!=r.lastType?o(c.type,c.style,l):o("variable","variable",l)}}function a(e){return function(t,r){var n,i=!1;if(Ae&&"@"==t.peek()&&t.match(Ie))return r.tokenize=l,o("jsonld-keyword","meta");for(;null!=(n=t.next())&&(n!=e||i);)i=!i&&"\\"==n;return i||(r.tokenize=l),o("string","string")}}function s(e,t){for(var r,n=!1;r=e.next();){if("/"==r&&n){t.tokenize=l;break}n="*"==r}return o("comment","comment")}function u(e,t){for(var r,n=!1;null!=(r=e.next());){if(!n&&("`"==r||"$"==r&&e.eat("{"))){t.tokenize=l;break}n=!n&&"\\"==r}return o("quasi","string-2",e.current())}function c(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var r=e.string.indexOf("=>",e.start);if(!(r<0)){if(We){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,r));n&&(r=n.index)}for(var i=0,o=!1,l=r-1;l>=0;--l){var a=e.string.charAt(l),s=Pe.indexOf(a);if(s>=0&&s<3){if(!i){++l;break}if(0==--i){"("==a&&(o=!0);break}}else if(s>=3&&s<6)++i;else if(Ee.test(a))o=!0;else{if(/["'\/]/.test(a))return;if(o&&!i){++l;break}}}o&&!i&&(t.fatArrowAt=l)}}function f(e,t,r,n,i,o){this.indented=e,this.column=t,this.type=r,this.prev=i,this.info=o,null!=n&&(this.align=n)}function h(e,t){for(var r=e.localVars;r;r=r.next)if(r.name==t)return!0;for(var n=e.context;n;n=n.prev)for(var r=n.vars;r;r=r.next)if(r.name==t)return!0}function d(e,t,r,n,i){var o=e.cc;for(ze.state=e,ze.stream=i,ze.marked=null,ze.cc=o,ze.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var l=o.length?o.pop():Ne?S:C;if(l(r,n)){for(;o.length&&o[o.length-1].lex;)o.pop()();return ze.marked?ze.marked:"variable"==r&&h(e,n)?"variable-2":t}}}function p(){for(var e=arguments.length-1;e>=0;e--)ze.cc.push(arguments[e])}function g(){return p.apply(null,arguments),!0}function v(e){function t(t){for(var r=t;r;r=r.next)if(r.name==e)return!0;return!1}var r=ze.state;if(ze.marked="def",r.context){if(t(r.localVars))return;r.localVars={name:e,next:r.localVars}}else{if(t(r.globalVars))return;n.globalVars&&(r.globalVars={name:e,next:r.globalVars})}}function m(){ze.state.context={prev:ze.state.context,vars:ze.state.localVars},ze.state.localVars=Be}function y(){ze.state.localVars=ze.state.context.vars,ze.state.context=ze.state.context.prev}function b(e,t){var r=function(){var r=ze.state,n=r.indented;if("stat"==r.lexical.type)n=r.lexical.indented;else for(var i=r.lexical;i&&")"==i.type&&i.align;i=i.prev)n=i.indented;r.lexical=new f(n,ze.stream.column(),e,null,r.lexical,t)};return r.lex=!0,r}function w(){var e=ze.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function x(e){function t(r){return r==e?g():";"==e?p():g(t)}return t}function C(e,t){return"var"==e?g(b("vardef",t.length),Z,x(";"),w):"keyword a"==e?g(b("form"),L,C,w):"keyword b"==e?g(b("form"),C,w):"{"==e?g(b("}"),_,w):";"==e?g():"if"==e?("else"==ze.state.lexical.info&&ze.state.cc[ze.state.cc.length-1]==w&&ze.state.cc.pop()(),g(b("form"),L,C,w,ne)):"function"==e?g(ue):"for"==e?g(b("form"),ie,C,w):"variable"==e?g(b("stat"),z):"switch"==e?g(b("form"),L,b("}","switch"),x("{"),_,w,w):"case"==e?g(S,x(":")):"default"==e?g(x(":")):"catch"==e?g(b("form"),m,x("("),ce,x(")"),C,w,y):"class"==e?g(b("form"),he,w):"export"==e?g(b("stat"),ve,w):"import"==e?g(b("stat"),ye,w):"module"==e?g(b("form"),Q,b("}"),x("{"),_,w,w):"type"==e?g(q,x("operator"),q,x(";")):"async"==e?g(C):p(b("stat"),S,x(";"),w)}function S(e){return T(e,!1)}function k(e){return T(e,!0)}function L(e){return"("!=e?p():g(b(")"),S,x(")"),w)}function T(e,t){if(ze.state.fatArrowAt==ze.stream.start){var r=t?H:D;if("("==e)return g(m,b(")"),G(Q,")"),w,x("=>"),r,y);if("variable"==e)return p(m,Q,x("=>"),r,y)}var n=t?N:A;return Re.hasOwnProperty(e)?g(n):"function"==e?g(ue,n):"class"==e?g(b("form"),fe,w):"keyword c"==e||"async"==e?g(t?O:M):"("==e?g(b(")"),M,x(")"),w,n):"operator"==e||"spread"==e?g(t?k:S):"["==e?g(b("]"),Se,w,n):"{"==e?U(F,"}",null,n):"quasi"==e?p(W,n):"new"==e?g(I(t)):g()}function M(e){return e.match(/[;\}\)\],]/)?p():p(S)}function O(e){return e.match(/[;\}\)\],]/)?p():p(k)}function A(e,t){return","==e?g(S):N(e,t,!1)}function N(e,t,r){var n=0==r?A:N,i=0==r?S:k;return"=>"==e?g(m,r?H:D,y):"operator"==e?/\+\+|--/.test(t)?g(n):"?"==t?g(S,x(":"),i):g(i):"quasi"==e?p(W,n):";"!=e?"("==e?U(k,")","call",n):"."==e?g(B,n):"["==e?g(b("]"),M,x("]"),w,n):void 0:void 0}function W(e,t){return"quasi"!=e?p():"${"!=t.slice(t.length-2)?g(W):g(S,E)}function E(e){if("}"==e)return ze.marked="string-2",ze.state.tokenize=u,g(W)}function D(e){return c(ze.stream,ze.state),p("{"==e?C:S)}function H(e){return c(ze.stream,ze.state),p("{"==e?C:k)}function I(e){return function(t){return"."==t?g(e?R:P):p(e?k:S)}}function P(e,t){if("target"==t)return ze.marked="keyword",g(A)}function R(e,t){if("target"==t)return ze.marked="keyword",g(N)}function z(e){return":"==e?g(w,C):p(A,x(";"),w)}function B(e){if("variable"==e)return ze.marked="property",g()}function F(e,t){return"async"==e?(ze.marked="property",g(F)):"variable"==e||"keyword"==ze.style?(ze.marked="property",g("get"==t||"set"==t?j:V)):"number"==e||"string"==e?(ze.marked=Ae?"property":ze.style+" property",g(V)):"jsonld-keyword"==e?g(V):"modifier"==e?g(F):"["==e?g(S,x("]"),V):"spread"==e?g(S):":"==e?p(V):void 0}function j(e){return"variable"!=e?p(V):(ze.marked="property",g(ue))}function V(e){return":"==e?g(k):"("==e?p(ue):void 0}function G(e,t,r){function n(i,o){if(r?r.indexOf(i)>-1:","==i){var l=ze.state.lexical;return"call"==l.info&&(l.pos=(l.pos||0)+1),g(function(r,n){return r==t||n==t?p():p(e)},n)}return i==t||o==t?g():g(x(t))}return function(r,i){return r==t||i==t?g():p(e,n)}}function U(e,t,r){for(var n=3;n"==e)return g(q)}function $(e,t){return"variable"==e||"keyword"==ze.style?(ze.marked="property",g($)):"?"==t?g($):":"==e?g(q):void 0}function Y(e){return"variable"==e?g(Y):":"==e?g(q):void 0}function J(e,t){return"<"==t?g(b(">"),G(q,">"),w,J):"|"==t||"."==e?g(q):"["==e?g(x("]"),J):void 0}function Z(){return p(Q,K,te,re)}function Q(e,t){return"modifier"==e?g(Q):"variable"==e?(v(t),g()):"spread"==e?g(Q):"["==e?U(Q,"]"):"{"==e?U(ee,"}"):void 0}function ee(e,t){return"variable"!=e||ze.stream.match(/^\s*:/,!1)?("variable"==e&&(ze.marked="property"),"spread"==e?g(Q):"}"==e?p():g(x(":"),Q,te)):(v(t),g(te))}function te(e,t){if("="==t)return g(k)}function re(e){if(","==e)return g(Z)}function ne(e,t){if("keyword b"==e&&"else"==t)return g(b("form","else"),C,w)}function ie(e){if("("==e)return g(b(")"),oe,x(")"),w)}function oe(e){return"var"==e?g(Z,x(";"),ae):";"==e?g(ae):"variable"==e?g(le):p(S,x(";"),ae)}function le(e,t){return"in"==t||"of"==t?(ze.marked="keyword",g(S)):g(A,ae)}function ae(e,t){return";"==e?g(se):"in"==t||"of"==t?(ze.marked="keyword",g(S)):p(S,x(";"),se)}function se(e){")"!=e&&g(S)}function ue(e,t){return"*"==t?(ze.marked="keyword",g(ue)):"variable"==e?(v(t),g(ue)):"("==e?g(m,b(")"),G(ce,")"),w,K,C,y):void 0}function ce(e){return"spread"==e?g(ce):p(Q,K,te)}function fe(e,t){return"variable"==e?he(e,t):de(e,t)}function he(e,t){if("variable"==e)return v(t),g(de)}function de(e,t){return"extends"==t||"implements"==t?g(We?q:S,de):"{"==e?g(b("}"),pe,w):void 0}function pe(e,t){return"variable"==e||"keyword"==ze.style?("static"==t||"get"==t||"set"==t||We&&("public"==t||"private"==t||"protected"==t||"readonly"==t||"abstract"==t))&&ze.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(ze.marked="keyword",g(pe)):(ze.marked="property",g(We?ge:ue,pe)):"*"==t?(ze.marked="keyword",g(pe)):";"==e?g(pe):"}"==e?g():void 0}function ge(e,t){return"?"==t?g(ge):":"==e?g(q,te):p(ue)}function ve(e,t){return"*"==t?(ze.marked="keyword",g(Ce,x(";"))):"default"==t?(ze.marked="keyword",g(S,x(";"))):"{"==e?g(G(me,"}"),Ce,x(";")):p(C)}function me(e,t){return"as"==t?(ze.marked="keyword",g(x("variable"))):"variable"==e?p(k,me):void 0}function ye(e){return"string"==e?g():p(be,we,Ce)}function be(e,t){return"{"==e?U(be,"}"):("variable"==e&&v(t),"*"==t&&(ze.marked="keyword"),g(xe))}function we(e){if(","==e)return g(be,we)}function xe(e,t){if("as"==t)return ze.marked="keyword",g(be)}function Ce(e,t){if("from"==t)return ze.marked="keyword",g(S)}function Se(e){return"]"==e?g():p(G(k,"]"))}function ke(e,t){return"operator"==e.lastType||","==e.lastType||He.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var Le,Te,Me=r.indentUnit,Oe=n.statementIndent,Ae=n.jsonld,Ne=n.json||Ae,We=n.typescript,Ee=n.wordCharacters||/[\w$\xa1-\uffff]/,De=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),r=e("keyword b"),n=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},l={if:e("if"),while:t,with:t,else:r,do:r,try:r,finally:r,return:n,break:n,continue:n,new:e("new"),delete:n,throw:n,debugger:n,var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:i,typeof:i,instanceof:i,true:o,false:o,null:o,undefined:o,NaN:o,Infinity:o,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n,async:e("async")};if(We){var a={type:"variable",style:"variable-3"},s={interface:e("class"),implements:n,namespace:n,module:e("module"),enum:e("module"),type:e("type"),public:e("modifier"),private:e("modifier"),protected:e("modifier"),abstract:e("modifier"),as:i,string:a,number:a,boolean:a,any:a};for(var u in s)l[u]=s[u]}return l}(),He=/[+\-*&%=<>!?|~^]/,Ie=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Pe="([{}])",Re={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0},ze={state:null,column:null,marked:null,cc:null},Be={name:"this",next:{name:"arguments"}};return w.lex=!0,{startState:function(e){var t={tokenize:l,lastType:"sof",cc:[],lexical:new f((e||0)-Me,0,"block",!1),localVars:n.localVars,context:n.localVars&&{vars:n.localVars},indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),c(e,t)),t.tokenize!=s&&e.eatSpace())return null;var r=t.tokenize(e,t);return"comment"==Le?r:(t.lastType="operator"!=Le||"++"!=Te&&"--"!=Te?Le:"incdec",d(t,r,Le,Te,e))},indent:function(t,r){if(t.tokenize==s)return e.Pass;if(t.tokenize!=l)return 0;var i,o=r&&r.charAt(0),a=t.lexical;if(!/^\s*else\b/.test(r))for(var u=t.cc.length-1;u>=0;--u){var c=t.cc[u];if(c==w)a=a.prev;else if(c!=ne)break}for(;("stat"==a.type||"form"==a.type)&&("}"==o||(i=t.cc[t.cc.length-1])&&(i==A||i==N)&&!/^[,\.=+\-*:?[\(]/.test(r));)a=a.prev;Oe&&")"==a.type&&"stat"==a.prev.type&&(a=a.prev);var f=a.type,h=o==f;return"vardef"==f?a.indented+("operator"==t.lastType||","==t.lastType?a.info+1:0):"form"==f&&"{"==o?a.indented:"form"==f?a.indented+Me:"stat"==f?a.indented+(ke(t,r)?Oe||Me:0):"switch"!=a.info||h||0==n.doubleIndentSwitch?a.align?a.column+(h?0:1):a.indented+(h?0:Me):a.indented+(/^(?:case|default)\b/.test(r)?Me:2*Me)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Ne?null:"/*",blockCommentEnd:Ne?null:"*/",lineComment:Ne?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Ne?"json":"javascript",jsonldMode:Ae,jsonMode:Ne,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=S&&t!=k||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},{"../../lib/codemirror":4}],6:[function(e,t,r){!function(e,t){"object"==typeof r&&r&&"string"!=typeof r.nodeName?t(r):"function"==typeof define&&define.amd?define(["exports"],t):(e.Mustache={},t(e.Mustache))}(this,function(e){function t(e){return"function"==typeof e}function r(e){return g(e)?"array":typeof e}function n(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function i(e,t){return null!=e&&"object"==typeof e&&t in e}function o(e,t){return v.call(e,t)}function l(e){return!o(m,e)}function a(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return y[e]})}function s(t,r){function i(){if(m&&!y)for(;v.length;)delete p[v.pop()];else v=[];m=!1,y=!1}function o(e){if("string"==typeof e&&(e=e.split(w,2)),!g(e)||2!==e.length)throw new Error("Invalid tags: "+e);a=new RegExp(n(e[0])+"\\s*"),s=new RegExp("\\s*"+n(e[1])),h=new RegExp("\\s*"+n("}"+e[1]))}if(!t)return[];var a,s,h,d=[],p=[],v=[],m=!1,y=!1;o(r||e.tags);for(var k,L,T,M,O,A,N=new f(t);!N.eos();){if(k=N.pos,T=N.scanUntil(a))for(var W=0,E=T.length;W0?o[o.length-1][4]:n;break;default:i.push(t)}return n}function f(e){this.string=e,this.tail=e,this.pos=0}function h(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function d(){this.cache={}}var p=Object.prototype.toString,g=Array.isArray||function(e){return"[object Array]"===p.call(e)},v=RegExp.prototype.test,m=/\S/,y={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},b=/\s*/,w=/\s+/,x=/\s*=/,C=/\s*\}/,S=/#|\^|\/|>|\{|&|=|!/;f.prototype.eos=function(){return""===this.tail},f.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var r=t[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r},f.prototype.scanUntil=function(e){var t,r=this.tail.search(e);switch(r){case-1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=t.length,t},h.prototype.push=function(e){return new h(e,this)},h.prototype.lookup=function(e){var r,n=this.cache;if(n.hasOwnProperty(e))r=n[e];else{for(var o,l,a=this,s=!1;a;){if(e.indexOf(".")>0)for(r=a.view,o=e.split("."),l=0;null!=r&&l"===o?l=this.renderPartial(i,t,r,n):"&"===o?l=this.unescapedValue(i,t):"name"===o?l=this.escapedValue(i,t):"text"===o&&(l=this.rawValue(i)),void 0!==l&&(a+=l);return a},d.prototype.renderSection=function(e,r,n,i){function o(e){return l.render(e,r,n)}var l=this,a="",s=r.lookup(e[1]);if(s){if(g(s))for(var u=0,c=s.length;u