From a9b4fb30a3044883239261276205ac1227e38156 Mon Sep 17 00:00:00 2001 From: Bruno Bord Date: Mon, 5 Dec 2016 22:11:13 +0100 Subject: [PATCH] HTTPS is minified --- static/css/style.min.css | 2 +- static/js/load.min.js | 2 +- vendor/js/codemirror.min.js | 10 ++++++---- vendor/js/editor.min.js | 2 +- vendor/js/intro.min.js | 2 +- vendor/js/marked.min.js | 2 +- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/static/css/style.min.css b/static/css/style.min.css index 9c2062b..53de265 100644 --- a/static/css/style.min.css +++ b/static/css/style.min.css @@ -1 +1 @@ -@font-face{font-family:'Ubuntu Mono';font-style:normal;font-weight:400;src:local('Ubuntu Mono'),local('UbuntuMono-Regular'),url(http://themes.googleusercontent.com/static/fonts/ubuntumono/v4/ViZhet7Ak-LRXZMXzuAfkbrIa-7acMAeDBVuclsi6Gc.woff) format('woff')}@font-face{font-family:'Ubuntu Mono';font-style:normal;font-weight:700;src:local('Ubuntu Mono Bold'),local('UbuntuMono-Bold'),url(http://themes.googleusercontent.com/static/fonts/ubuntumono/v4/ceqTZGKHipo8pJj4molythbnBKKEOwRKgsHDreGcocg.woff) format('woff')}@font-face{font-family:'Ubuntu Mono';font-style:italic;font-weight:400;src:local('Ubuntu Mono Italic'),local('UbuntuMono-Italic'),url(http://themes.googleusercontent.com/static/fonts/ubuntumono/v4/KAKuHXAHZOeECOWAHsRKA4o3ZslTYfJv0R05CazkwN8.woff) format('woff')}@font-face{font-family:'Ubuntu Mono';font-style:italic;font-weight:700;src:local('Ubuntu Mono Bold Italic'),local('UbuntuMono-BoldItalic'),url(http://themes.googleusercontent.com/static/fonts/ubuntumono/v4/n_d8tv_JOIiYyMXR4eaV9SHgNb6vKVPdRA9LSAKGxzw.woff) format('woff')}@font-face{font-family:'Lato';font-style:normal;font-weight:400;src:local('Lato Regular'),local('Lato-Regular'),url(http://themes.googleusercontent.com/static/fonts/lato/v7/qIIYRU-oROkIk8vfvxw6QvesZW2xOQ-xsNqO47m55DA.woff) format('woff')}@font-face{font-family:'Lato';font-style:normal;font-weight:700;src:local('Lato Bold'),local('Lato-Bold'),url(http://themes.googleusercontent.com/static/fonts/lato/v7/qdgUG4U09HnJwhYI-uK18wLUuEpTyoUstqEm5AMlJo4.woff) format('woff')}@font-face{font-family:'Lato';font-style:italic;font-weight:400;src:local('Lato Italic'),local('Lato-Italic'),url(http://themes.googleusercontent.com/static/fonts/lato/v7/RYyZNoeFgb0l7W3Vu1aSWOvvDin1pK8aKteLpeZ5c0A.woff) format('woff')}@font-face{font-family:'Lato';font-style:italic;font-weight:700;src:local('Lato Bold Italic'),local('Lato-BoldItalic'),url(http://themes.googleusercontent.com/static/fonts/lato/v7/HkF_qI1x_noxlxhrhMQYELO3LdcAZYWl9Si6vvxL-qU.woff) format('woff')}@font-face{font-family:'Roboto Slab';font-style:normal;font-weight:400;src:local('Roboto Slab Regular'),local('RobotoSlab-Regular'),url(http://themes.googleusercontent.com/static/fonts/robotoslab/v3/y7lebkjgREBJK96VQi37ZrrIa-7acMAeDBVuclsi6Gc.woff) format('woff')}@font-face{font-family:'Roboto Slab';font-style:normal;font-weight:700;src:local('Roboto Slab Bold'),local('RobotoSlab-Bold'),url(http://themes.googleusercontent.com/static/fonts/robotoslab/v3/dazS1PrQQuCxC3iOAJFEJRbnBKKEOwRKgsHDreGcocg.woff) format('woff')}.wrapper{max-width:1024px;margin:auto}.editor-wrapper{max-width:700px;margin:auto}.title-container h1{text-align:left}.CodeMirror{height:550px !important}.sidebar{padding-left:.33em}body{background:#f8ecc2;font-family:'Roboto Slab'}.editor-wrapper{font-family:'Ubuntu Mono' !important}.editor-preview{font-family:'Lato' !important}.sidebar{border-left:1px solid rgba(41,41,41,.3);font-size:.82em}.sidebar a{text-decoration:none;color:#292929}.sidebar a:hover{color:#466482}.sidebar a.playing{color:#6e2828}.notes a{text-decoration:underline} \ No newline at end of file +@font-face{font-family:'Ubuntu Mono';font-style:normal;font-weight:400;src:local('Ubuntu Mono'),local('UbuntuMono-Regular'),url(https://themes.googleusercontent.com/static/fonts/ubuntumono/v4/ViZhet7Ak-LRXZMXzuAfkbrIa-7acMAeDBVuclsi6Gc.woff) format('woff')}@font-face{font-family:'Ubuntu Mono';font-style:normal;font-weight:700;src:local('Ubuntu Mono Bold'),local('UbuntuMono-Bold'),url(https://themes.googleusercontent.com/static/fonts/ubuntumono/v4/ceqTZGKHipo8pJj4molythbnBKKEOwRKgsHDreGcocg.woff) format('woff')}@font-face{font-family:'Ubuntu Mono';font-style:italic;font-weight:400;src:local('Ubuntu Mono Italic'),local('UbuntuMono-Italic'),url(https://themes.googleusercontent.com/static/fonts/ubuntumono/v4/KAKuHXAHZOeECOWAHsRKA4o3ZslTYfJv0R05CazkwN8.woff) format('woff')}@font-face{font-family:'Ubuntu Mono';font-style:italic;font-weight:700;src:local('Ubuntu Mono Bold Italic'),local('UbuntuMono-BoldItalic'),url(https://themes.googleusercontent.com/static/fonts/ubuntumono/v4/n_d8tv_JOIiYyMXR4eaV9SHgNb6vKVPdRA9LSAKGxzw.woff) format('woff')}@font-face{font-family:'Lato';font-style:normal;font-weight:400;src:local('Lato Regular'),local('Lato-Regular'),url(https://themes.googleusercontent.com/static/fonts/lato/v7/qIIYRU-oROkIk8vfvxw6QvesZW2xOQ-xsNqO47m55DA.woff) format('woff')}@font-face{font-family:'Lato';font-style:normal;font-weight:700;src:local('Lato Bold'),local('Lato-Bold'),url(https://themes.googleusercontent.com/static/fonts/lato/v7/qdgUG4U09HnJwhYI-uK18wLUuEpTyoUstqEm5AMlJo4.woff) format('woff')}@font-face{font-family:'Lato';font-style:italic;font-weight:400;src:local('Lato Italic'),local('Lato-Italic'),url(https://themes.googleusercontent.com/static/fonts/lato/v7/RYyZNoeFgb0l7W3Vu1aSWOvvDin1pK8aKteLpeZ5c0A.woff) format('woff')}@font-face{font-family:'Lato';font-style:italic;font-weight:700;src:local('Lato Bold Italic'),local('Lato-BoldItalic'),url(https://themes.googleusercontent.com/static/fonts/lato/v7/HkF_qI1x_noxlxhrhMQYELO3LdcAZYWl9Si6vvxL-qU.woff) format('woff')}@font-face{font-family:'Roboto Slab';font-style:normal;font-weight:400;src:local('Roboto Slab Regular'),local('RobotoSlab-Regular'),url(https://themes.googleusercontent.com/static/fonts/robotoslab/v3/y7lebkjgREBJK96VQi37ZrrIa-7acMAeDBVuclsi6Gc.woff) format('woff')}@font-face{font-family:'Roboto Slab';font-style:normal;font-weight:700;src:local('Roboto Slab Bold'),local('RobotoSlab-Bold'),url(https://themes.googleusercontent.com/static/fonts/robotoslab/v3/dazS1PrQQuCxC3iOAJFEJRbnBKKEOwRKgsHDreGcocg.woff) format('woff')}.wrapper{max-width:1024px;margin:auto}.editor-wrapper{max-width:700px;margin:auto}.title-container h1{text-align:left}.CodeMirror{height:550px !important}.sidebar{padding-left:.33em}body{background:#f8ecc2;font-family:'Roboto Slab'}.editor-wrapper{font-family:'Ubuntu Mono' !important}.editor-preview{font-family:'Lato' !important}.sidebar{border-left:1px solid rgba(41,41,41,.3);font-size:.82em}.sidebar a{text-decoration:none;color:#292929}.sidebar a:hover{color:#466482}.sidebar a.playing{color:#6e2828}.notes a{text-decoration:underline} \ No newline at end of file diff --git a/static/js/load.min.js b/static/js/load.min.js index 67c2f60..9e35f52 100644 --- a/static/js/load.min.js +++ b/static/js/load.min.js @@ -1 +1 @@ -$(document).ready(function(){$.getJSON("static/js/sounds.json",function(a){for(var b in a){obj=a[b];var c=$("").attr({href:"#","class":"play","data-mp3":b});c.html(" "+obj.label).addClass(obj.class),obj.data&&c.attr("data-"+obj.class,obj.data),$("#soundlinks").append(c).append("
"),$("body").append('
')}$(".player").jPlayer({ready:function(){var b=$(this).attr("id"),c=a[b];$(this).jPlayer("setMedia",{mp3:"./sounds/"+b+".mp3"}),c.volume&&$(this).jPlayer("volume",c.volume/100)},play:function(){console.log("playing "+$(this).attr("id"))},loop:!0,preload:!1,volume:.6}),$(".play").on("click",function(){var a=$(this).data("mp3");$(this).hasClass("playing")?$("#"+a).jPlayer("pause"):$("#"+a).jPlayer("play"),$(this).toggleClass("playing")})})}); \ No newline at end of file +$(document).ready(function(){$.getJSON("static/js/sounds.json",function(sounds){for(var key in sounds){obj=sounds[key];var link=$("
").attr({href:"#","class":"play","data-mp3":key});link.html(" "+obj.label).addClass(obj["class"]),obj.data&&link.attr("data-"+obj["class"],obj.data),$("#soundlinks").append(link).append("
"),$("body").append('
')}$(".player").jPlayer({ready:function(){var key=$(this).attr("id"),sound=sounds[key];$(this).jPlayer("setMedia",{mp3:"./sounds/"+key+".mp3"}),sound.volume&&$(this).jPlayer("volume",sound.volume/100)},play:function(){console.log("playing "+$(this).attr("id"))},loop:!0,preload:!1,volume:.6}),$(".play").on("click",function(){var player=$(this).data("mp3");$("#"+player).jPlayer($(this).hasClass("playing")?"pause":"play"),$(this).toggleClass("playing")})})}); \ No newline at end of file diff --git a/vendor/js/codemirror.min.js b/vendor/js/codemirror.min.js index 6006271..25657df 100644 --- a/vendor/js/codemirror.min.js +++ b/vendor/js/codemirror.min.js @@ -1,4 +1,6 @@ -window.CodeMirror=function(){function w(a,c){if(!(this instanceof w))return new w(a,c);this.options=c=c||{};for(var d in Xc)!c.hasOwnProperty(d)&&Xc.hasOwnProperty(d)&&(c[d]=Xc[d]);I(c);var e=typeof c.value=="string"?0:c.value.first,f=this.display=x(a,e);f.wrapper.CodeMirror=this,F(this),c.autofocus&&!o&&Lb(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,draggingText:!1,highlight:new Te},D(this),c.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap");var g=c.value;typeof g=="string"&&(g=new ce(c.value,c.mode)),Db(this,ge)(this,g),b&&setTimeout(bf(Kb,this,!0),20),Nb(this);var h;try{h=document.activeElement==f.input}catch(i){}h||c.autofocus&&!o?setTimeout(bf(ic,this),20):jc(this),Db(this,function(){for(var a in Wc)Wc.propertyIsEnumerable(a)&&Wc[a](this,c[a],Zc);for(var b=0;bb.maxLineLength&&(b.maxLineLength=d,b.maxLine=a)})}function I(a){var b=!1;for(var c=0;cb.scroller.clientWidth+1,g=e>b.scroller.clientHeight+1;g?(b.scrollbarV.style.display="block",b.scrollbarV.style.bottom=f?pf(b.measure)+"px":"0",b.scrollbarV.firstChild.style.height=e-b.scroller.clientHeight+b.scrollbarV.clientHeight+"px"):b.scrollbarV.style.display="",f?(b.scrollbarH.style.display="block",b.scrollbarH.style.right=g?pf(b.measure)+"px":"0",b.scrollbarH.firstChild.style.width=b.scroller.scrollWidth-b.scroller.clientWidth+b.scrollbarH.clientWidth+"px"):b.scrollbarH.style.display="",f&&g?(b.scrollbarFiller.style.display="block",b.scrollbarFiller.style.height=b.scrollbarFiller.style.width=pf(b.measure)+"px"):b.scrollbarFiller.style.display="",f&&a.options.coverGutterNextToScrollbar&&a.options.fixedGutter?(b.gutterFiller.style.display="block",b.gutterFiller.style.height=pf(b.measure)+"px",b.gutterFiller.style.width=b.gutters.offsetWidth+"px"):b.gutterFiller.style.display="",k&&pf(b.measure)===0&&(b.scrollbarV.style.minWidth=b.scrollbarH.style.minHeight=l?"18px":"12px")}function K(a,b,c){var d=a.scroller.scrollTop,e=a.wrapper.clientHeight;typeof c=="number"?d=c:c&&(d=c.top,e=c.bottom-c.top),d=Math.floor(d-eb(a));var f=Math.ceil(d+e);return{from:me(b,d),to:me(b,f)}}function L(a){var b=a.display;if(!b.alignWidgets&&(!b.gutters.firstChild||!a.options.fixedGutter))return;var c=O(b)-b.scroller.scrollLeft+a.doc.scrollLeft,d=b.gutters.offsetWidth,e=c+"px";for(var f=b.lineDiv.firstChild;f;f=f.nextSibling)if(f.alignable)for(var g=0,h=f.alignable;g=a.display.showingFrom&&h.to<=a.display.showingTo)break;b=[]}return g&&(Me(a,"update",a),(a.display.showingFrom!=e||a.display.showingTo!=f)&&Me(a,"viewportChange",a,a.display.showingFrom,a.display.showingTo)),g}function Q(a,b,c,d){var e=a.display,f=a.doc;if(!e.wrapper.clientWidth){e.showingFrom=e.showingTo=f.first,e.viewOffset=0;return}if(!d&&b.length==0&&c.from>e.showingFrom&&c.tol&&e.showingTo-l<20&&(l=Math.min(j,e.showingTo));if(v){k=le(Bd(f,he(f,k)));while(l=m[0].to?m=[]:m=T(m,b);if(v)for(var i=0;in.from)){m.splice(i--,1);break}n.to=p}}var q=0;for(var i=0;il&&(n.to=l),n.from>=n.to?m.splice(i--,1):q+=n.to-n.from}if(!d&&q==l-k&&k==e.showingFrom&&l==e.showingTo){S(a);return}m.sort(function(a,b){return a.from-b.from});try{var r=document.activeElement}catch(s){}q<(l-k)*.7&&(e.lineDiv.style.display="none"),V(a,k,l,m,h),e.lineDiv.style.display="",r&&document.activeElement!=r&&r.offsetHeight&&r.focus();var t=k!=e.showingFrom||l!=e.showingTo||e.lastSizeC!=e.wrapper.clientHeight;return t&&(e.lastSizeC=e.wrapper.clientHeight,ab(a,400)),e.showingFrom=k,e.showingTo=l,R(a),S(a),!0}function R(a){var b=a.display,d=b.lineDiv.offsetTop;for(var e=b.lineDiv.firstChild,f;e;e=e.nextSibling)if(e.lineObj){if(c){var g=e.offsetTop+e.offsetHeight;f=g-d,d=g}else{var h=lf(e);f=h.bottom-h.top}var i=e.lineObj.height-f;f<2&&(f=yb(b));if(i>.001||i<-0.001){ke(e.lineObj,f);var j=e.lineObj.widgets;if(j)for(var k=0;k=j.to?f.push(j):(e.from>j.from&&f.push({from:j.from,to:e.from}),e.ton){while(k.lineObj!=b)k=l(k);i&&f<=n&&k.lineNumber&&kf(k.lineNumber,N(a.options,n)),k=k.nextSibling}else{if(b.widgets)for(var q=0,r=k,s;r&&q<20;++q,r=r.nextSibling)if(r.lineObj==b&&/div/i.test(r.nodeName)){s=r;break}var t=W(a,b,n,g,s);if(t!=s)j.insertBefore(t,k);else{while(k!=s)k=l(k);k=k.nextSibling}t.lineObj=b}++n});while(k)k=l(k)}function W(a,b,d,e,f){var g=Td(a,b),h=b.gutterMarkers,i=a.display,j;if(!a.options.lineNumbers&&!h&&!b.bgClass&&!b.wrapClass&&!b.widgets)return g;if(f){f.alignable=null;var k=!0,l=0,m=null;for(var n=f.firstChild,o;n;n=o){o=n.nextSibling;if(!/\bCodeMirror-linewidget\b/.test(n.className))f.removeChild(n);else{for(var p=0;p3&&(h(o,i.top,null,i.bottom),o=g,i.bottoml.bottom||n.bottom==l.bottom&&n.right>l.right)l=n;o=a.display.showingTo)return;var c=+(new Date)+a.options.workTime,d=dd(b.mode,db(a,b.frontier)),e=[],f;b.iter(b.frontier,Math.min(b.first+b.size,a.display.showingTo+500),function(g){if(b.frontier>=a.display.showingFrom){var h=g.styles;g.styles=Od(a,g,d);var i=!h||h.length!=g.styles.length;for(var j=0;!i&&jc)return ab(a,a.options.workDelay),!0}),e.length&&Db(a,function(){for(var a=0;ah;--g){if(g<=f.first)return f.first;var i=he(f,g-1);if(i.stateAfter&&(!c||g<=f.frontier))return g;var j=Ue(i.text,null,a.options.tabSize);if(e==null||d>j)e=g-1,d=j}return e}function db(a,b,c){var d=a.doc,e=a.display;if(!d.mode.startState)return!0;var f=cb(a,b,c),g=f>d.first&&he(d,f-1).stateAfter;return g?g=dd(d.mode,g):g=ed(d.mode),d.iter(f,b,function(c){Qd(a,c,g);var h=f==b-1||f%5==0||f>=e.showingFrom&&fc?"left":gc?h.left:h.right,top:h.top,bottom:h.bottom}}function ib(a,b){var c=a.display.measureLineCache;for(var d=0;ds&&(c=s),b<0&&(b=0);for(var d=q.length-2;d>=0;d-=2){var e=q[d],f=q[d+1];if(e>c||f=c||b<=e&&c>=f||Math.min(c,f)-Math.max(b,e)>=c-b>>1){q[d]=Math.min(b,e),q[d+1]=Math.max(c,f);break}}return d<0&&(d=q.length,q.push(b,c)),{left:a.left-p.left,right:a.right-p.left,top:d,bottom:null}}function u(a){a.bottom=q[a.top+1],a.top=q[a.top]}var f=a.display,g=af(e.text.length),h=Td(a,e,g,!0);if(b&&!c&&!a.options.lineWrapping&&h.childNodes.length>100){var i=document.createDocumentFragment(),j=10,k=h.childNodes.length;for(var l=0,m=Math.ceil(k/j);l1&&(x=r[l]=t(y[0]),x.rightSide=t(y[y.length-1]))}x||(x=r[l]=t(lf(w))),v.measureRight&&(x.right=lf(v.measureRight).left),v.leftSide&&(x.leftSide=t(lf(v.leftSide)))}for(var l=0,v;lc.from?f(a-1):f(a,d)}d=d||he(a.doc,b.line),e||(e=kb(a,d));var h=oe(d),i=b.ch;if(!h)return f(i);var j=Ff(h,i),k=g(i,j);return Ef!=null&&(k.other=g(i,Ef)),k}function ub(a,b,c,d){var e=new xc(a,b);return e.xRel=d,c&&(e.outside=!0),e}function vb(a,b,c){var d=a.doc;c+=a.display.viewOffset;if(c<0)return ub(d.first,0,!0,-1);var e=me(d,c),f=d.first+d.size-1;if(e>f)return ub(d.first+d.size-1,he(d,f).text.length,!0,1);b<0&&(b=0);for(;;){var g=he(d,e),h=wb(a,g,e,b,c),i=Ad(g),j=i&&i.find();if(!i||!(h.ch>j.from.ch||h.ch==j.from.ch&&h.xRel>0))return h;e=j.to.line}}function wb(a,b,c,d,e){function j(d){var e=tb(a,xc(c,d),"line",b,i);return g=!0,f>e.bottom?e.left-h:fq)return ub(c,n,r,1);for(;;){if(k?n==m||n==Hf(b,m,1):n-m<=1){var s=dd){n=w,q=y;if(r=g)q+=1e3;l=v}else m=w,o=y,p=g,l-=v}}function yb(a){if(a.cachedTextHeight!=null)return a.cachedTextHeight;if(xb==null){xb=gf("pre");for(var b=0;b<49;++b)xb.appendChild(document.createTextNode("x")),xb.appendChild(gf("br"));xb.appendChild(document.createTextNode("x"))}jf(a.measure,xb);var c=xb.offsetHeight/50;return c>3&&(a.cachedTextHeight=c),hf(a.measure),c||1}function zb(a){if(a.cachedCharWidth!=null)return a.cachedCharWidth;var b=gf("span","x"),c=gf("pre",[b]);jf(a.measure,c);var d=b.offsetWidth;return d>2&&(a.cachedCharWidth=d),d||10}function Bb(a){a.curOp={changes:[],forceUpdate:!1,updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,cursorActivity:!1,updateMaxLine:!1,updateScrollPos:!1,id:++Ab},Le++||(Ke=[])}function Cb(a){var b=a.curOp,c=a.doc,d=a.display;a.curOp=null,b.updateMaxLine&&H(a);if(d.maxLineChanged&&!a.options.lineWrapping&&d.maxLine){var e=mb(a,d.maxLine);d.sizer.style.minWidth=Math.max(0,e+3+Re)+"px",d.maxLineChanged=!1;var f=Math.max(0,d.sizer.offsetLeft+d.sizer.offsetWidth-d.scroller.clientWidth);f1e3||h.indexOf("\n")>-1?c.value=a.display.prevInput="":a.display.prevInput=h,i&&Cb(a),a.state.pasteIncoming=!1,!0}function Kb(a,c){var e,f,g=a.doc;if(!yc(g.sel.from,g.sel.to)){a.display.prevInput="",e=uf&&(g.sel.to.line-g.sel.from.line>100||(f=a.getSelection()).length>1e3);var h=e?"-":f||a.getSelection();a.display.input.value=h,a.state.focused&&Ye(a.display.input),b&&!d&&(a.display.inputHasSelection=h)}else c&&(a.display.prevInput=a.display.input.value="",b&&!d&&(a.display.inputHasSelection=null));a.display.inaccurateSelection=e}function Lb(a){a.options.readOnly!="nocursor"&&(!o||document.activeElement!=a.display.input)&&a.display.input.focus()}function Mb(a){return a.options.readOnly||a.doc.cantEdit}function Nb(a){function d(){a.state.focused&&setTimeout(bf(Lb,a),0)}function f(){e==null&&(e=setTimeout(function(){e=null,c.cachedCharWidth=c.cachedTextHeight=of=null,nb(a),Fb(a,bf(Gb,a))},100))}function g(){for(var a=c.wrapper.parentNode;a&&a!=document.body;a=a.parentNode);a?setTimeout(g,5e3):Ie(window,"resize",f)}function h(b){if(Ne(a,b)||a.options.onDragEvent&&a.options.onDragEvent(a,Ae(b)))return;Ee(b)}function i(){c.inaccurateSelection&&(c.prevInput="",c.inaccurateSelection=!1,c.input.value=a.getSelection(),Ye(c.input))}var c=a.display;He(c.scroller,"mousedown",Db(a,Sb)),b?He(c.scroller,"dblclick",Db(a,function(b){if(Ne(a,b))return;var c=Pb(a,b);if(!c||Tb(a,b)||Ob(a.display,b))return;Be(b);var d=Uc(he(a.doc,c.line).text,c);Fc(a.doc,d.from,d.to)})):He(c.scroller,"dblclick",function(b){Ne(a,b)||Be(b)}),He(c.lineSpace,"selectstart",function(a){Ob(c,a)||Be(a)}),t||He(c.scroller,"contextmenu",function(b){lc(a,b)}),He(c.scroller,"scroll",function(){c.scroller.clientHeight&&(Xb(a,c.scroller.scrollTop),Yb(a,c.scroller.scrollLeft,!0),Je(a,"scroll",a))}),He(c.scrollbarV,"scroll",function(){c.scroller.clientHeight&&Xb(a,c.scrollbarV.scrollTop)}),He(c.scrollbarH,"scroll",function(){c.scroller.clientHeight&&Yb(a,c.scrollbarH.scrollLeft)}),He(c.scroller,"mousewheel",function(b){_b(a,b)}),He(c.scroller,"DOMMouseScroll",function(b){_b(a,b)}),He(c.scrollbarH,"mousedown",d),He(c.scrollbarV,"mousedown",d),He(c.wrapper,"scroll",function(){c.wrapper.scrollTop=c.wrapper.scrollLeft=0});var e;He(window,"resize",f),setTimeout(g,5e3),He(c.input,"keyup",Db(a,function(b){if(Ne(a,b)||a.options.onKeyEvent&&a.options.onKeyEvent(a,Ae(b)))return;b.keyCode==16&&(a.doc.sel.shift=!1)})),He(c.input,"input",bf(Ib,a)),He(c.input,"keydown",Db(a,gc)),He(c.input,"keypress",Db(a,hc)),He(c.input,"focus",bf(ic,a)),He(c.input,"blur",bf(jc,a)),a.options.dragDrop&&(He(c.scroller,"dragstart",function(b){Wb(a,b)}),He(c.scroller,"dragenter",h),He(c.scroller,"dragover",h),He(c.scroller,"drop",Db(a,Vb))),He(c.scroller,"paste",function(b){if(Ob(c,b))return;Lb(a),Ib(a)}),He(c.input,"paste",function(){a.state.pasteIncoming=!0,Ib(a)}),He(c.input,"cut",i),He(c.input,"copy",i),j&&He(c.sizer,"mouseup",function(){document.activeElement==c.input&&c.input.blur(),Lb(a)})}function Ob(a,b){for(var c=Fe(b);c!=a.wrapper;c=c.parentNode)if(!c||c.ignoreEvents||c.parentNode==a.sizer&&c!=a.mover)return!0}function Pb(a,b,c){var d=a.display;if(!c){var e=Fe(b);if(e==d.scrollbarH||e==d.scrollbarH.firstChild||e==d.scrollbarV||e==d.scrollbarV.firstChild||e==d.scrollbarFiller||e==d.gutterFiller)return null}var f,g,h=lf(d.lineSpace);try{f=b.clientX,g=b.clientY}catch(b){return null}return vb(a,f-h.left,g-h.top)}function Sb(a){function q(a){if(yc(p,a))return;p=a;if(j=="single"){Fc(c.doc,Cc(f,h),a);return}n=Cc(f,n),o=Cc(f,o);if(j=="double"){var b=Uc(he(f,a.line).text,a);zc(a,n)?Fc(c.doc,b.from,o):Fc(c.doc,n,b.to)}else j=="triple"&&(zc(a,n)?Fc(c.doc,o,Cc(f,xc(a.line,0))):Fc(c.doc,n,Cc(f,xc(a.line+1,0))))}function u(a){var b=++s,e=Pb(c,a,!0);if(!e)return;if(!yc(e,l)){c.state.focused||ic(c),l=e,q(e);var g=K(d,f);(e.line>=g.to||e.liner.bottom?20:0;h&&setTimeout(Db(c,function(){if(s!=b)return;d.scroller.scrollTop+=h,u(a)}),50)}}function v(a){s=Infinity,Be(a),Lb(c),Ie(document,"mousemove",w),Ie(document,"mouseup",x)}if(Ne(this,a))return;var c=this,d=c.display,f=c.doc,g=f.sel;g.shift=a.shiftKey;if(Ob(d,a)){e||(d.scroller.draggable=!1,setTimeout(function(){d.scroller.draggable=!0},100));return}if(Tb(c,a))return;var h=Pb(c,a);switch(Ge(a)){case 3:t&&lc.call(c,c,a);return;case 2:h&&Fc(c.doc,h),setTimeout(bf(Lb,c),20),Be(a);return}if(!h){Fe(a)==d.scroller&&Be(a);return}c.state.focused||ic(c);var i=+(new Date),j="single";if(Rb&&Rb.time>i-400&&yc(Rb.pos,h))j="triple",Be(a),setTimeout(bf(Lb,c),20),Vc(c,h.line);else if(Qb&&Qb.time>i-400&&yc(Qb.pos,h)){j="double",Rb={time:i,pos:h},Be(a);var k=Uc(he(f,h.line).text,h);Fc(c.doc,k.from,k.to)}else Qb={time:i,pos:h};var l=h;if(c.options.dragDrop&&mf&&!Mb(c)&&!yc(g.from,g.to)&&!zc(h,g.from)&&!zc(g.to,h)&&j=="single"){var m=Db(c,function(b){e&&(d.scroller.draggable=!1),c.state.draggingText=!1,Ie(document,"mouseup",m),Ie(d.scroller,"drop",m),Math.abs(a.clientX-b.clientX)+Math.abs(a.clientY-b.clientY)<10&&(Be(b),Fc(c.doc,h),Lb(c))});e&&(d.scroller.draggable=!0),c.state.draggingText=m,d.scroller.dragDrop&&d.scroller.dragDrop(),He(document,"mouseup",m),He(d.scroller,"drop",m);return}Be(a),j=="single"&&Fc(c.doc,Cc(f,h));var n=g.from,o=g.to,p=h,r=lf(d.wrapper),s=0,w=Db(c,function(a){!b&&!Ge(a)?v(a):u(a)}),x=Db(c,v);He(document,"mousemove",w),He(document,"mouseup",x)}function Tb(a,b){var c=a.display;try{var d=b.clientX,e=b.clientY}catch(b){return!1}if(d>=Math.floor(lf(c.gutters).right))return!1 -;Be(b);if(!Pe(a,"gutterClick"))return!0;var f=lf(c.lineDiv);if(e>f.bottom)return!0;e-=f.top-c.viewOffset;for(var g=0;g=d){var i=me(a.doc,e),j=a.options.gutters[g];Me(a,"gutterClick",a,i,j,b);break}}return!0}function Vb(a){var c=this;if(Ne(c,a)||Ob(c.display,a)||c.options.onDragEvent&&c.options.onDragEvent(c,Ae(a)))return;Be(a),b&&(Ub=+(new Date));var d=Pb(c,a,!0),e=a.dataTransfer.files;if(!d||Mb(c))return;if(e&&e.length&&window.FileReader&&window.File){var f=e.length,g=Array(f),h=0,i=function(a,b){var e=new FileReader;e.onload=function(){g[b]=e.result,++h==f&&(d=Cc(c.doc,d),qc(c.doc,{from:d,to:d,text:sf(g.join("\n")),origin:"paste"},"around"))},e.readAsText(a)};for(var j=0;ji.clientWidth||f&&i.scrollHeight>i.clientHeight))return;if(f&&p&&e)for(var j=c.target;j!=i;j=j.parentNode)if(j.lineObj){b.display.currentWheelTarget=j;break}if(d&&!a&&!h&&$b!=null){f&&Xb(b,Math.max(0,Math.min(i.scrollTop+f*$b,i.scrollHeight-i.clientHeight))),Yb(b,Math.max(0,Math.min(i.scrollLeft+d*$b,i.scrollWidth-i.clientWidth))),Be(c),g.wheelStartX=null;return}if(f&&$b!=null){var k=f*$b,l=b.doc.scrollTop,m=l+g.wrapper.clientHeight;k<0?l=Math.max(0,l+k-50):m=Math.min(b.doc.height,m+k+50),P(b,[],{top:l,bottom:m})}Zb<20&&(g.wheelStartX==null?(g.wheelStartX=i.scrollLeft,g.wheelStartY=i.scrollTop,g.wheelDX=d,g.wheelDY=f,setTimeout(function(){if(g.wheelStartX==null)return;var a=i.scrollLeft-g.wheelStartX,b=i.scrollTop-g.wheelStartY,c=b&&g.wheelDY&&b/g.wheelDY||a&&g.wheelDX&&a/g.wheelDX;g.wheelStartX=g.wheelStartY=null;if(!c)return;$b=($b*Zb+c)/(Zb+1),++Zb},200)):(g.wheelDX+=d,g.wheelDY+=f))}function ac(a,b,c){if(typeof b=="string"){b=fd[b];if(!b)return!1}a.display.pollingFast&&Jb(a)&&(a.display.pollingFast=!1);var d=a.doc,e=d.sel.shift,f=!1;try{Mb(a)&&(a.state.suppressEdits=!0),c&&(d.sel.shift=!1),f=b(a)!=Se}finally{d.sel.shift=e,a.state.suppressEdits=!1}return f}function bc(a){var b=a.state.keyMaps.slice(0);return a.options.extraKeys&&b.push(a.options.extraKeys),b.push(a.options.keyMap),b}function dc(a,b){var c=hd(a.options.keyMap),e=c.auto;clearTimeout(cc),e&&!jd(b)&&(cc=setTimeout(function(){hd(a.options.keyMap)==c&&(a.options.keyMap=e.call?e.call(null,a):e,C(a))},50));var f=kd(b,!0),g=!1;if(!f)return!1;var h=bc(a);return b.shiftKey?g=id("Shift-"+f,h,function(b){return ac(a,b,!0)})||id(f,h,function(b){if(typeof b=="string"?/^go[A-Z]/.test(b):b.motion)return ac(a,b)}):g=id(f,h,function(b){return ac(a,b)}),g&&(Be(b),_(a),d&&(b.oldKeyCode=b.keyCode,b.keyCode=0),Me(a,"keyHandled",a,f,b)),g}function ec(a,b,c){var d=id("'"+c+"'",bc(a),function(b){return ac(a,b,!0)});return d&&(Be(b),_(a),Me(a,"keyHandled",a,"'"+c+"'",b)),d}function gc(a){var c=this;c.state.focused||ic(c),b&&a.keyCode==27&&(a.returnValue=!1);if(Ne(c,a)||c.options.onKeyEvent&&c.options.onKeyEvent(c,Ae(a)))return;var d=a.keyCode;c.doc.sel.shift=d==16||a.shiftKey;var e=dc(c,a);h&&(fc=e?d:null,!e&&d==88&&!uf&&(p?a.metaKey:a.ctrlKey)&&c.replaceSelection(""))}function hc(a){var c=this;if(Ne(c,a)||c.options.onKeyEvent&&c.options.onKeyEvent(c,Ae(a)))return;var e=a.keyCode,f=a.charCode;if(h&&e==fc){fc=null,Be(a);return}if((h&&(!a.which||a.which<10)||j)&&dc(c,a))return;var g=String.fromCharCode(f==null?e:f);this.options.electricChars&&this.doc.mode.electricChars&&this.options.smartIndent&&!Mb(this)&&this.doc.mode.electricChars.indexOf(g)>-1&&setTimeout(Db(c,function(){Qc(c,c.doc.sel.to.line,"smart")}),75);if(ec(c,a,g))return;b&&!d&&(c.display.inputHasSelection=null),Ib(c)}function ic(a){if(a.options.readOnly=="nocursor")return;a.state.focused||(Je(a,"focus",a),a.state.focused=!0,a.display.wrapper.className.search(/\bCodeMirror-focused\b/)==-1&&(a.display.wrapper.className+=" CodeMirror-focused"),Kb(a,!0)),Hb(a),_(a)}function jc(a){a.state.focused&&(Je(a,"blur",a),a.state.focused=!1,a.display.wrapper.className=a.display.wrapper.className.replace(" CodeMirror-focused","")),clearInterval(a.display.blinker),setTimeout(function(){a.state.focused||(a.doc.sel.shift=!1)},150)}function lc(a,c){function k(){if(e.input.selectionStart!=null){var a=e.input.value=" "+(yc(f.from,f.to)?"":e.input.value);e.prevInput=" ",e.input.selectionStart=1,e.input.selectionEnd=a.length}}function l(){e.inputDiv.style.position="relative",e.input.style.cssText=j,d&&(e.scrollbarV.scrollTop=e.scroller.scrollTop=i),Hb(a);if(e.input.selectionStart!=null){(!b||d)&&k(),clearTimeout(kc);var c=0,f=function(){e.prevInput==" "&&e.input.selectionStart==0?Db(a,fd.selectAll)(a):c++<10?kc=setTimeout(f,500):Kb(a)};kc=setTimeout(f,200)}}if(Ne(a,c,"contextmenu"))return;var e=a.display,f=a.doc.sel;if(Ob(e,c))return;var g=Pb(a,c),i=e.scroller.scrollTop;if(!g||h)return;(yc(f.from,f.to)||zc(g,f.from)||!zc(g,f.to))&&Db(a,Hc)(a.doc,g,g);var j=e.input.style.cssText;e.inputDiv.style.position="absolute",e.input.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(c.clientY-5)+"px; left: "+(c.clientX-5)+"px; z-index: 1000; background: white; outline: none;"+"border-width: 0; outline: none; overflow: hidden; opacity: .05; -ms-opacity: .05; filter: alpha(opacity=5);",Lb(a),Kb(a,!0),yc(f.from,f.to)&&(e.input.value=e.prevInput=" "),b&&!d&&k();if(t){Ee(c);var m=function(){Ie(window,"mouseup",m),setTimeout(l,20)};He(window,"mouseup",m)}else setTimeout(l,50)}function nc(a,b,c){if(!zc(b.from,c))return Cc(a,c);var d=b.text.length-1-(b.to.line-b.from.line);if(c.line>b.to.line+d){var e=c.line-d,f=a.first+a.size-1;return e>f?xc(f,he(a,f).text.length):Dc(c,he(a,e).text.length)}if(c.line==b.to.line+d)return Dc(c,Xe(b.text).length+(b.text.length==1?b.from.ch:0)+he(a,b.to.line).text.length-b.to.ch);var g=c.line-b.from.line;return Dc(c,b.text[g].length+(g?0:b.from.ch))}function oc(a,b,c){if(c&&typeof c=="object")return{anchor:nc(a,b,c.anchor),head:nc(a,b,c.head)};if(c=="start")return{anchor:b.from,head:b.from};var d=mc(b);if(c=="around")return{anchor:b.from,head:d};if(c=="end")return{anchor:d,head:d};var e=function(a){if(zc(a,b.from))return a;if(!zc(b.to,a))return d;var c=a.line+b.text.length-(b.to.line-b.from.line)-1,e=a.ch;return a.line==b.to.line&&(e+=d.ch-b.to.ch),xc(c,e)};return{anchor:e(a.sel.anchor),head:e(a.sel.head)}}function pc(a,b,c){var d={canceled:!1,from:b.from,to:b.to,text:b.text,origin:b.origin,cancel:function(){this.canceled=!0}};return c&&(d.update=function(b,c,d,e){b&&(this.from=Cc(a,b)),c&&(this.to=Cc(a,c)),d&&(this.text=d),e!==undefined&&(this.origin=e)}),Je(a,"beforeChange",a,d),a.cm&&Je(a.cm,"beforeChange",a.cm,d),d.canceled?null:{from:d.from,to:d.to,text:d.text,origin:d.origin}}function qc(a,b,c,d){if(a.cm){if(!a.cm.curOp)return Db(a.cm,qc)(a,b,c,d);if(a.cm.state.suppressEdits)return}if(Pe(a,"beforeChange")||a.cm&&Pe(a.cm,"beforeChange")){b=pc(a,b,!0);if(!b)return}var e=u&&!d&&xd(a,b.from,b.to);if(e){for(var f=e.length-1;f>=1;--f)rc(a,{from:e[f].from,to:e[f].to,text:[""]});e.length&&rc(a,{from:e[0].from,to:e[0].to,text:b.text},c)}else rc(a,b,c)}function rc(a,b,c){var d=oc(a,b,c);se(a,b,d,a.cm?a.cm.curOp.id:NaN),uc(a,b,d,vd(a,b));var e=[];fe(a,function(a,c){!c&&Ze(e,a.history)==-1&&(ye(a.history,b),e.push(a.history)),uc(a,b,null,vd(a,b))})}function sc(a,b){if(a.cm&&a.cm.state.suppressEdits)return;var c=a.history,d=(b=="undo"?c.done:c.undone).pop();if(!d)return;var e={changes:[],anchorBefore:d.anchorAfter,headBefore:d.headAfter,anchorAfter:d.anchorBefore,headAfter:d.headBefore,generation:c.generation};(b=="undo"?c.undone:c.done).push(e),c.generation=d.generation||++c.maxGeneration;var f=Pe(a,"beforeChange")||a.cm&&Pe(a.cm,"beforeChange");for(var g=d.changes.length-1;g>=0;--g){var h=d.changes[g];h.origin=b;if(f&&!pc(a,h,!1)){(b=="undo"?c.done:c.undone).length=0;return}e.changes.push(re(a,h));var i=g?oc(a,h,null):{anchor:d.anchorBefore,head:d.headBefore};uc(a,h,i,wd(a,h));var j=[];fe(a,function(a,b){!b&&Ze(j,a.history)==-1&&(ye(a.history,h),j.push(a.history)),uc(a,h,null,wd(a,h))})}}function tc(a,b){function c(a){return xc(a.line+b,a.ch)}a.first+=b,a.cm&&Gb(a.cm,a.first,a.first,b),a.sel.head=c(a.sel.head),a.sel.anchor=c(a.sel.anchor),a.sel.from=c(a.sel.from),a.sel.to=c(a.sel.to)}function uc(a,b,c,d){if(a.cm&&!a.cm.curOp)return Db(a.cm,uc)(a,b,c,d);if(b.to.linea.lastLine())return;if(b.from.linef&&(b={from:b.from,to:xc(f,he(a,f).text.length),text:[b.text[0]],origin:b.origin}),b.removed=ie(a,b.from,b.to),c||(c=oc(a,b,null)),a.cm?vc(a.cm,b,d,c):$d(a,b,d,c)}function vc(a,b,c,d){var e=a.doc,f=a.display,g=b.from,h=b.to,i=!1,j=g.line;a.options.lineWrapping||(j=le(Bd(e,he(e,g.line))),e.iter(j,h.line+1,function(a){if(a==f.maxLine)return i=!0,!0})),!zc(e.sel.head,b.from)&&!zc(b.to,e.sel.head)&&(a.curOp.cursorActivity=!0),$d(e,b,c,d,A(a)),a.options.lineWrapping||(e.iter(j,g.line+b.text.length,function(a){var b=G(e,a);b>f.maxLineLength&&(f.maxLine=a,f.maxLineLength=b,f.maxLineChanged=!0,i=!1)}),i&&(a.curOp.updateMaxLine=!0)),e.frontier=Math.min(e.frontier,g.line),ab(a,400);var k=b.text.length-(h.line-g.line)-1;Gb(a,g.line,h.line+1,k);if(Pe(a,"change")){var l={from:g,to:h,text:b.text,removed:b.removed,origin:b.origin};if(a.curOp.textChanged){for(var m=a.curOp.textChanged;m.next;m=m.next);m.next=l}else a.curOp.textChanged=l}}function wc(a,b,c,d,e){d||(d=c);if(zc(d,c)){var f=d;d=c,c=f}typeof b=="string"&&(b=sf(b)),qc(a,{from:c,to:d,text:b,origin:e},null)}function xc(a,b){if(!(this instanceof xc))return new xc(a,b);this.line=a,this.ch=b}function yc(a,b){return a.line==b.line&&a.ch==b.ch}function zc(a,b){return a.linec?xc(c,he(a,c).text.length):Dc(b,he(a,b.line).text.length)}function Dc(a,b){var c=a.ch;return c==null||c>b?xc(a.line,b):c<0?xc(a.line,0):a}function Ec(a,b){return b>=a.first&&b=f.ch:j.to>f.ch))){if(d){Je(k,"beforeCursorEnter");if(k.explicitlyCleared){if(!h.markedSpans)break;--i;continue}}if(!k.atomic)continue;var l=k.find()[g<0?"from":"to"];if(yc(l,f)){l.ch+=g,l.ch<0?l.line>a.first?l=Cc(a,xc(l.line-1)):l=null:l.ch>h.text.length&&(l.line(window.innerHeight||document.documentElement.clientHeight)&&(e=!1);if(e!=null&&!m){var f=c.cursor.style.display=="none";f&&(c.cursor.style.display="",c.cursor.style.left=b.left+"px",c.cursor.style.top=b.top-c.viewOffset+"px"),c.cursor.scrollIntoView(e),f&&(c.cursor.style.display="none")}}function Lc(a,b,c){c==null&&(c=0);for(;;){var d=!1,e=tb(a,b),f=Nc(a,e.left,e.top-c,e.left,e.bottom+c),g=a.doc.scrollTop,h=a.doc.scrollLeft;f.scrollTop!=null&&(Xb(a,f.scrollTop),Math.abs(a.doc.scrollTop-g)>1&&(d=!0)),f.scrollLeft!=null&&(Yb(a,f.scrollLeft),Math.abs(a.doc.scrollLeft-h)>1&&(d=!0));if(!d)return e}}function Mc(a,b,c,d,e){var f=Nc(a,b,c,d,e);f.scrollTop!=null&&Xb(a,f.scrollTop),f.scrollLeft!=null&&Yb(a,f.scrollLeft)}function Nc(a,b,c,d,e){var f=a.display,g=yb(a.display);c<0&&(c=0);var h=f.scroller.clientHeight-Re,i=f.scroller.scrollTop,j={},k=a.doc.height+fb(f),l=ck-g;if(ci+h){var n=Math.min(c,(m?k:e)-h);n!=i&&(j.scrollTop=n)}var o=f.scroller.clientWidth-Re,p=f.scroller.scrollLeft;b+=f.gutters.offsetWidth,d+=f.gutters.offsetWidth;var q=f.gutters.offsetWidth,r=bo+p-3&&(j.scrollLeft=d+10-o),j}function Oc(a,b,c){a.curOp.updateScrollPos={scrollLeft:b==null?a.doc.scrollLeft:b,scrollTop:c==null?a.doc.scrollTop:c}}function Pc(a,b,c){var d=a.curOp.updateScrollPos||(a.curOp.updateScrollPos={scrollLeft:a.doc.scrollLeft,scrollTop:a.doc.scrollTop}),e=a.display.scroller;d.scrollTop=Math.max(0,Math.min(e.scrollHeight-e.clientHeight,d.scrollTop+c)),d.scrollLeft=Math.max(0,Math.min(e.scrollWidth-e.clientWidth,d.scrollLeft+b))}function Qc(a,b,c,d){var e=a.doc;c==null&&(c="add");if(c=="smart")if(!a.doc.mode.indent)c="prev";else var f=db(a,b);var g=a.options.tabSize,h=he(e,b),i=Ue(h.text,null,g),j=h.text.match(/^\s*/)[0],k;if(c=="smart"){k=a.doc.mode.indent(f,h.text.slice(j.length),h.text);if(k==Se){if(!d)return;c="prev"}}c=="prev"?b>e.first?k=Ue(he(e,b-1).text,null,g):k=0:c=="add"?k=i+a.options.indentUnit:c=="subtract"?k=i-a.options.indentUnit:typeof c=="number"&&(k=i+c),k=Math.max(0,k);var l="",m=0;if(a.options.indentWithTabs)for(var n=Math.floor(k/g);n;--n)m+=g,l+=" ";m=a.first+a.size?j=!1:(f=b,i=he(a,b))}function l(a){var b=(e?Hf:If)(i,g,c,!0);if(b==null){if(!!a||!k())return j=!1;e?g=(c<0?Af:zf)(i):g=c<0?i.text.length:0}else g=b;return!0}var f=b.line,g=b.ch,h=c,i=he(a,f),j=!0;if(d=="char")l();else if(d=="column")l(!0);else if(d=="word"||d=="group"){var m=null,n=d=="group";for(var o=!0;;o=!1){if(c<0&&!l(!o))break;var p=i.text.charAt(g)||"\n",q=df(p)?"w":n?/\s/.test(p)?null:"p":null;if(m&&m!=q){c<0&&(c=1,l());break}q&&(m=q);if(c>0&&!l(!o))break}}var r=Jc(a,xc(f,g),h,!0);return j||(r.hitSide=!0),r}function Tc(a,b,c,d){var e=a.doc,f=b.left,g;if(d=="page"){var h=Math.min(a.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);g=b.top+c*(h-(c<0?1.5:.5)*yb(a.display))}else d=="line"&&(g=c>0?b.bottom+3:b.top-3);for(;;){var i=vb(a,f,g);if(!i.outside)break;if(c<0?g<=0:g>=e.height){i.hitSide=!0;break}g+=c*5}return i}function Uc(a,b){var c=b.ch,d=b.ch;if(a){(b.xRel<0||d==a.length)&&c?--c:++d;var e=a.charAt(c),f=df(e)?df:/\s/.test(e)?function(a){return/\s/.test(a)}:function(a){return!/\s/.test(a)&&!df(a)};while(c>0&&f(a.charAt(c-1)))--c;while(d=b:f.to>b);(e||(e=[])).push({from:f.from,to:i?null:f.to,marker:g})}}return e}function ud(a,b,c){if(a)for(var d=0,e;d=b:f.to>b);if(h||g.type=="bookmark"&&f.from==b&&(!c||f.marker.insertLeft)){var i=f.from==null||(g.inclusiveLeft?f.from<=b:f.from0&&h)for(var l=0;lb)&&(!d||d.widtha.options.maxHighlightLength?(f=!1,i.pos=Math.min(b.length,i.start+5e4),j=null):j=c.token(i,d);if(!f||h!=j)ga&&d.splice(g,1,a,d[g+1],e),g+=2,h=Math.min(a,e)}if(!b)return;if(f.opaque)d.splice(c,g-c,a,b),g=c+2;else for(;c="�"&&i<"�"&&hi)?(t.to!=null&&l>t.to&&(l=t.to,n=""),u.className&&(m+=" "+u.className),u.startStyle&&t.from==i&&(o+=" "+u.startStyle),u.endStyle&&t.to==l&&(n+=" "+u.endStyle),u.title&&!p&&(p=u.title),u.collapsed&&(!q||q.marker.sizei&&l>t.from&&(l=t.from),u.type=="bookmark"&&t.from==i&&u.replacedWith&&(r=u)}if(q&&(q.from||0)==i){Yd(b,(q.to==null?h:q.to)-i,q.marker,q.from==null);if(q.to==null)return q.marker.find()}r&&!q&&Yd(b,0,r)}if(i>=h)break;var v=Math.min(h,l);for(;;){if(j){var w=i+j.length;if(!q){var x=w>v?j.slice(0,v-i):j;b.addToken(b,x,k?k+m:m,o,i+x.length==l?n:"",p)}if(w>=v){j=j.slice(v-i),i=v;break}i=w,o=""}j=e.slice(f,f=c[g++]),k=Sd(c[g++])}}}function $d(a,b,c,d,e){function f(a){return c?c[a]:null}function g(a,c,d){Ld(a,c,d,e),Me(a,"change",a,b)}var h=b.from,i=b.to,j=b.text,k=he(a,h.line),l=he(a,i.line),m=Xe(j),n=f(j.length-1),o=i.line-h.line;if(h.ch==0&&i.ch==0&&m==""){for(var p=0,q=j.length-1,r=[];p1&&a.remove(h.line+1,o-1),a.insert(h.line+1,r)}Me(a,"change",a,b),Hc(a,d.anchor,d.head,null,!0)}function _d(a){this.lines=a,this.parent=null;for(var b=0,c=a.length,d=0;bf-a.cm.options.historyEventDelay||b.origin.charAt(0)=="*"))){var h=Xe(g.changes);yc(b.from,b.to)&&yc(b.from,h.to)?h.to=mc(b):g.changes.push(re(a,b)),g.anchorAfter=c.anchor,g.headAfter=c.head}else{g={changes:[re(a,b)],generation:e.generation,anchorBefore:a.sel.anchor,headBefore:a.sel.head,anchorAfter:c.anchor,headAfter:c.head},e.done.push(g),e.generation=++e.maxGeneration;while(e.done.length>e.undoDepth)e.done.shift()}e.lastTime=f,e.lastOp=d,e.lastOrigin=b.origin}function te(a){if(!a)return null;for(var b=0,c;b-1&&(Xe(g)[k]=i[k],delete i[k])}}return d}function we(a,b,c,d){c0}function Qe(a){a.prototype.on=function(a,b){He(this,a,b)},a.prototype.off=function(a,b){Ie(this,a,b)}}function Te(){this.id=null}function Ue(a,b,c,d,e){b==null&&(b=a.search(/[^\s\u00a0]/),b==-1&&(b=a.length));for(var f=d||0,g=e||0;f"€"&&(a.toUpperCase()!=a.toLowerCase()||cf.test(a))}function ef(a){for(var b in a)if(a.hasOwnProperty(b)&&a[b])return!1;return!0}function gf(a,b,c,d){var e=document.createElement(a);c&&(e.className=c),d&&(e.style.cssText=d);if(typeof b=="string")kf(e,b);else if(b)for(var f=0;f0;--b)a.removeChild(a.firstChild);return a}function jf(a,b){return hf(a).appendChild(b)}function kf(a,b){d?(a.innerHTML="",a.appendChild(document.createTextNode(b))):a.textContent=b}function lf(a){return a.getBoundingClientRect()}function nf(){return!1}function pf(a){if(of!=null)return of;var b=gf("div",null,null,"width: 50px; height: 50px; overflow-x: scroll");return jf(a,b),b.offsetWidth&&(of=b.offsetHeight-b.clientHeight),of||0}function rf(a){if(qf==null){var b=gf("span","​");jf(a,gf("span",[b,document.createTextNode("x")])),a.firstChild.offsetHeight!=0&&(qf=b.offsetWidth<=1&&b.offsetHeight>2&&!c)}return qf?gf("span","​"):gf("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px")}function wf(a,b,c,d){if(!a)return d(b,c,"ltr");var e=!1;for(var f=0;fb||b==c&&g.to==b)d(Math.max(g.from,b),Math.min(g.to,c),g.level==1?"rtl":"ltr"),e=!0}e||d(b,c,"ltr")}function xf(a){return a.level%2?a.to:a.from}function yf(a){return a.level%2?a.from:a.to}function zf(a){var b=oe(a);return b?xf(b[0]):0}function Af(a){var b=oe(a);return b?yf(Xe(b)):a.text.length}function Bf(a,b){var c=he(a.doc,b),d=Bd(a.doc,c);d!=c&&(b=le(d));var e=oe(d),f=e?e[0].level%2?Af(d):zf(d):0;return xc(b,f)}function Cf(a,b){var c,d;while(c=Ad(d=he(a.doc,b)))b=c.find().to.line;var e=oe(d),f=e?e[0].level%2?zf(d):Af(d):d.text.length;return xc(b,f)}function Df(a,b,c){var d=a[0].level;return b==d?!0:c==d?!1:bb)return Ef=null,c;if(e.from==b||e.to==b){if(d!=null)return Df(a,e.level,a[d].level)?(Ef=d,c):(Ef=c,d);d=c}}return Ef=null,d}function Gf(a,b,c,d){if(!d)return b+c;do b+=c;while(b>0&&ff.test(a.text.charAt(b)));return b}function Hf(a,b,c,d){var e=oe(a);if(!e)return If(a,b,c,d);var f=Ff(e,b),g=e[f],h=Gf(a,b,g.level%2?-c:c,d);for(;;){if(h>g.from&&h0==g.level%2?g.to:g.from);g=e[f+=c];if(!g)return null;c>0==g.level%2?h=Gf(a,g.to,-1,d):h=Gf(a,g.from,1,d)}}function If(a,b,c,d){var e=b+c;if(d)while(e>0&&ff.test(a.text.charAt(e)))e+=c;return e<0||e>a.text.length?null:e}"use strict";var a=/gecko\/\d/i.test(navigator.userAgent),b=/MSIE \d/.test(navigator.userAgent),c=b&&(document.documentMode==null||document.documentMode<8),d=b&&(document.documentMode==null||document.documentMode<9),e=/WebKit\//.test(navigator.userAgent),f=e&&/Qt\/\d+\.\d+/.test(navigator.userAgent),g=/Chrome\//.test(navigator.userAgent),h=/Opera\//.test(navigator.userAgent),i=/Apple Computer/.test(navigator.vendor),j=/KHTML\//.test(navigator.userAgent),k=/Mac OS X 1\d\D([7-9]|\d\d)\D/.test(navigator.userAgent),l=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(navigator.userAgent),m=/PhantomJS/.test(navigator.userAgent),n=/AppleWebKit/.test(navigator.userAgent)&&/Mobile\/\w+/.test(navigator.userAgent),o=n||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(navigator.userAgent),p=n||/Mac/.test(navigator.platform),q=/windows/i.test(navigator.platform),r=h&&navigator.userAgent.match(/Version\/(\d*\.\d*)/);r&&(r=Number(r[1])),r&&r>=15&&(h=!1,e=!0);var s=p&&(f||h&&(r==null||r<12.11)),t=a||b&&!d,u=!1,v=!1,xb,Ab=0,Qb,Rb,Ub=0,Zb=0,$b=null;b?$b=-0.53:a?$b=15:g?$b=-0.7:i&&($b=-1/3);var cc,fc=null,kc,mc=w.changeEnd=function(a){return a.text?xc(a.from.line+a.text.length-1,Xe(a.text).length+(a.text.length==1?a.from.ch:0)):a.to};w.Pos=xc,w.prototype={constructor:w,focus:function(){window.focus(),Lb(this),ic(this),Ib(this)},setOption:function(a,b){var c=this.options,d=c[a];if(c[a]==b&&a!="mode")return;c[a]=b,Wc.hasOwnProperty(a)&&Db(this,Wc[a])(this,b,d)},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,b){this.state.keyMaps[b?"push":"unshift"](a)},removeKeyMap:function(a){var b=this.state.keyMaps;for(var c=0;c>1;if((f?b[f*2-1]:0)>=e)d=f;else{if(!(b[f*2+1]d&&(a=d,c=!0);var e=he(this.doc,a);return qb(this,he(this.doc,a),{top:0,left:0},b||"page").top+(c?e.height:0)},defaultTextHeight:function(){return yb(this.display)},defaultCharWidth:function(){return zb(this.display)},setGutterMarker:Db(null,function(a,b,c){return Rc(this,a,function(a){var d=a.gutterMarkers||(a.gutterMarkers={});return d[b]=c,!c&&ef(d)&&(a.gutterMarkers=null),!0})}),clearGutter:Db(null,function(a){var b=this,c=b.doc,d=c.first;c.iter(function(c){c.gutterMarkers&&c.gutterMarkers[a]&&(c.gutterMarkers[a]=null,Gb(b,d,d+1),ef(c.gutterMarkers)&&(c.gutterMarkers=null)),++d})}),addLineClass:Db(null,function(a,b,c){return Rc(this,a,function(a){var d=b=="text"?"textClass":b=="background"?"bgClass":"wrapClass";if(!a[d])a[d]=c;else{if((new RegExp("(?:^|\\s)"+c+"(?:$|\\s)")).test(a[d]))return!1;a[d]+=" "+c}return!0})}),removeLineClass:Db(null,function(a,b,c){return Rc(this,a,function(a){var d=b=="text"?"textClass":b=="background"?"bgClass":"wrapClass",e=a[d];if(!e)return!1;if(c==null)a[d]=null;else{var f=e.match(new RegExp("(?:^|\\s+)"+c+"(?:$|\\s+)"));if(!f)return!1;var g=f.index+f[0].length;a[d]=e.slice(0,f.index)+(!f.index||g==e.length?"":" ")+e.slice(g)||null}return!0})}),addLineWidget:Db(null,function(a,b,c){return Jd(this,a,b,c)}),removeLineWidget:function(a){a.clear()},lineInfo:function(a){if(typeof a=="number"){if(!Ec(this.doc,a))return null;var b=a;a=he(this.doc,a);if(!a)return null}else{var b=le(a);if(b==null)return null}return{line:b,handle:a,text:a.text,gutterMarkers:a.gutterMarkers,textClass:a.textClass,bgClass:a.bgClass,wrapClass:a.wrapClass,widgets:a.widgets}},getViewport:function(){return{from:this.display.showingFrom,to:this.display.showingTo}},addWidget:function(a,b,c,d,e){var f=this.display;a=tb(this,Cc(this.doc,a));var g=a.bottom,h=a.left;b.style.position="absolute",f.sizer.appendChild(b);if(d=="over")g=a.top;else if(d=="above"||d=="near"){var i=Math.max(f.wrapper.clientHeight,this.doc.height),j=Math.max(f.sizer.clientWidth,f.lineSpace.clientWidth);(d=="above"||a.bottom+b.offsetHeight>i)&&a.top>b.offsetHeight?g=a.top-b.offsetHeight:a.bottom+b.offsetHeight<=i&&(g=a.bottom),h+b.offsetWidth>j&&(h=j-b.offsetWidth)}b.style.top=g+"px",b.style.left=b.style.right="",e=="right"?(h=f.sizer.clientWidth-b.offsetWidth,b.style.right="0px"):(e=="left"?h=0:e=="middle"&&(h=(f.sizer.clientWidth-b.offsetWidth)/2),b.style.left=h+"px"),c&&Mc(this,h,g,h+b.offsetWidth,g+b.offsetHeight)},triggerOnKeyDown:Db(null,gc),execCommand:function(a){return fd[a](this)},findPosH:function(a,b,c,d){var e=1;b<0&&(e=-1,b=-b);for(var f=0,g=Cc(this.doc,a);f2){b.dependencies=[];for(var c=2;c0&&b.ch=this.string.length},sol:function(){return this.pos==0},peek:function(){return this.string.charAt(this.pos)||undefined},next:function(){if(this.posb},eatSpace:function(){var a=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>a},skipToEnd:function(){this.pos=this.string.length},skipTo:function(a){var b=this.string.indexOf(a,this.pos);if(b>-1)return this.pos=b,!0},backUp:function(a){this.pos-=a},column:function(){return this.lastColumnPos0?null:(f&&b!==!1&&(this.pos+=f[0].length),f)}var d=function(a){return c?a.toLowerCase():a},e=this.string.substr(this.pos,a.length);if(d(e)==d(a))return b!==!1&&(this.pos+=a.length),!0},current:function(){return this.string.slice(this.start,this.pos)}},w.StringStream=ld,w.TextMarker=md,Qe(md),md.prototype.clear=function(){if(this.explicitlyCleared)return;var a=this.doc.cm,b=a&&!a.curOp;b&&Bb(a);if(Pe(this,"clear")){var c=this.find();c&&Me(this,"clear",c.from,c.to)}var d=null,e=null;for(var f=0;fa.display.maxLineLength&&(a.display.maxLine=i,a.display.maxLineLength=j,a.display.maxLineChanged=!0)}d!=null&&a&&Gb(a,d,e+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,a&&Ic(a)),b&&Cb(a)},md.prototype.find=function(){var a,b;for(var c=0;c=b.display.showingFrom&&a.from.line50){while(f.lines.length>50){var h=f.lines.splice(f.lines.length-25,25),i=new _d(h);f.height-=i.height,this.children.splice(d+1,0,i),i.parent=this}this.maybeSpill()}break}a-=g}},maybeSpill:function(){if(this.children.length<=10)return;var a=this;do{var b=a.children.splice(a.children.length-5,5),c=new ae(b);if(!a.parent){var d=new ae(a.children);d.parent=a,a.children=[d,c],a=d}else{a.size-=c.size,a.height-=c.height;var e=Ze(a.parent.children,a);a.parent.children.splice(e+1,0,c)}c.parent=a.parent}while(a.children.length>10);a.parent.maybeSpill()},iterN:function(a,b,c){for(var d=0,e=this.children.length;d=a.ch)&&b.push(e.marker.parent||e.marker)}return b},getAllMarks:function(){var a=[];return this.iter(function(b){var c=b.markedSpans;if(c)for(var d=0;da)return b=a,!0;a-=e,++c}),Cc(this,xc(c,b))},indexFromPos:function(a){a=Cc(this,a);var b=a.ch;return a.lineb&&(b=a.from),a.to!=null&&a.to1&&a.charCodeAt(b-1)==45){if(/\w/.test(a.charAt(b-2))&&/[^\-?\.]/.test(a.charAt(b)))return!0;if(b>2&&/[\d\.,]/.test(a.charAt(b-2))&&/[\d\.,]/.test(a.charAt(b)))return!1}return/[~!#%&*)=+}\]|\"\.>,:;][({[<]|-[^\-?\.\u2010-\u201f\u2026]|\?[\w~`@#$%\^&*(_=+{[|><]|…[\w~`@#$%\^&*(_=+{[><]/.test(a.slice(b-1,b+1))});var of,qf,sf="\n\nb".split(/\n/).length!=3?function(a){var b=0,c=[],d=a.length;while(b<=d){var e=a.indexOf("\n",b);e==-1&&(e=a.length);var f=a.slice(b,a.charAt(e-1)=="\r"?e-1:e),g=f.indexOf("\r");g!=-1?(c.push(f.slice(0,g)),b+=g+1):(c.push(f),b=e+1)}return c}:function(a){return a.split(/\r\n?|\n/)};w.splitLines=sf;var tf=window.getSelection?function(a){try{return a.selectionStart!=a.selectionEnd}catch(b){return!1}}:function(a){try{var b=a.ownerDocument.selection.createRange()}catch(c){}return!b||b.parentElement()!=a?!1:b.compareEndPoints("StartToEnd",b)!=0},uf=function(){var a=gf("div");return"oncopy"in a?!0:(a.setAttribute("oncopy","return;"),typeof a.oncopy=="function")}(),vf={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",91:"Mod",92:"Mod",93:"Mod",109:"-",107:"=",127:"Delete",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63276:"PageUp",63277:"PageDown",63275:"End",63273:"Home",63234:"Left",63232:"Up",63235:"Right",63233:"Down",63302:"Insert",63272:"Delete"};w.keyNames=vf,function(){for(var a=0;a<10;a++)vf[a+48]=String(a);for(var a=65;a<=90;a++)vf[a]=String.fromCharCode(a);for(var a=1;a<=12;a++)vf[a+111]=vf[a+63235]="F"+a}();var Ef,Jf=function(){function c(c){return c<=255?a.charAt(c):1424<=c&&c<=1524?"R":1536<=c&&c<=1791?b.charAt(c-1536):1792<=c&&c<=2220?"r":"L"}var a="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL",b="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr",d=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,e=/[stwN]/,f=/[LRr]/,g=/[Lb1n]/,h=/[1n]/,i="L";return function(a){if(!d.test(a))return!1;var b=a.length,j=[];for(var k=0,l;kd.maxLineLength&&(d.maxLineLength=len,d.maxLine=line)})}function setGuttersForLineNumbers(options){for(var found=!1,i=0;id.scroller.clientWidth+1,needsV=scrollHeight>d.scroller.clientHeight+1;needsV?(d.scrollbarV.style.display="block",d.scrollbarV.style.bottom=needsH?scrollbarWidth(d.measure)+"px":"0",d.scrollbarV.firstChild.style.height=scrollHeight-d.scroller.clientHeight+d.scrollbarV.clientHeight+"px"):d.scrollbarV.style.display="",needsH?(d.scrollbarH.style.display="block",d.scrollbarH.style.right=needsV?scrollbarWidth(d.measure)+"px":"0",d.scrollbarH.firstChild.style.width=d.scroller.scrollWidth-d.scroller.clientWidth+d.scrollbarH.clientWidth+"px"):d.scrollbarH.style.display="",needsH&&needsV?(d.scrollbarFiller.style.display="block",d.scrollbarFiller.style.height=d.scrollbarFiller.style.width=scrollbarWidth(d.measure)+"px"):d.scrollbarFiller.style.display="",needsH&&cm.options.coverGutterNextToScrollbar&&cm.options.fixedGutter?(d.gutterFiller.style.display="block",d.gutterFiller.style.height=scrollbarWidth(d.measure)+"px",d.gutterFiller.style.width=d.gutters.offsetWidth+"px"):d.gutterFiller.style.display="",mac_geLion&&0===scrollbarWidth(d.measure)&&(d.scrollbarV.style.minWidth=d.scrollbarH.style.minHeight=mac_geMountainLion?"18px":"12px")}function visibleLines(display,doc,viewPort){var top=display.scroller.scrollTop,height=display.wrapper.clientHeight;"number"==typeof viewPort?top=viewPort:viewPort&&(top=viewPort.top,height=viewPort.bottom-viewPort.top),top=Math.floor(top-paddingTop(display));var bottom=Math.ceil(top+height);return{from:lineAtHeight(doc,top),to:lineAtHeight(doc,bottom)}}function alignHorizontally(cm){var display=cm.display;if(display.alignWidgets||display.gutters.firstChild&&cm.options.fixedGutter){for(var comp=compensateForHScroll(display)-display.scroller.scrollLeft+cm.doc.scrollLeft,gutterW=display.gutters.offsetWidth,l=comp+"px",n=display.lineDiv.firstChild;n;n=n.nextSibling)if(n.alignable)for(var i=0,a=n.alignable;i=cm.display.showingFrom&&visible.to<=cm.display.showingTo));)changes=[];return updated&&(signalLater(cm,"update",cm),(cm.display.showingFrom!=oldFrom||cm.display.showingTo!=oldTo)&&signalLater(cm,"viewportChange",cm,cm.display.showingFrom,cm.display.showingTo)),updated}function updateDisplayInner(cm,changes,visible,forced){var display=cm.display,doc=cm.doc;if(!display.wrapper.clientWidth)return display.showingFrom=display.showingTo=doc.first,void(display.viewOffset=0);if(!(!forced&&0==changes.length&&visible.from>display.showingFrom&&visible.toto&&display.showingTo-to<20&&(to=Math.min(end,display.showingTo)),sawCollapsedSpans)for(from=lineNo(visualLine(doc,getLine(doc,from)));end>to&&lineIsHidden(doc,getLine(doc,to));)++to;var intact=[{from:Math.max(display.showingFrom,doc.first),to:Math.min(display.showingTo,end)}];if(intact=intact[0].from>=intact[0].to?[]:computeIntact(intact,changes),sawCollapsedSpans)for(var i=0;irange.from)){intact.splice(i--,1);break}range.to=newTo}for(var intactLines=0,i=0;ito&&(range.to=to),range.from>=range.to?intact.splice(i--,1):intactLines+=range.to-range.from}if(!forced&&intactLines==to-from&&from==display.showingFrom&&to==display.showingTo)return void updateViewOffset(cm);intact.sort(function(a,b){return a.from-b.from});try{var focused=document.activeElement}catch(e){}.7*(to-from)>intactLines&&(display.lineDiv.style.display="none"),patchDisplay(cm,from,to,intact,positionsChangedFrom),display.lineDiv.style.display="",focused&&document.activeElement!=focused&&focused.offsetHeight&&focused.focus();var different=from!=display.showingFrom||to!=display.showingTo||display.lastSizeC!=display.wrapper.clientHeight;return different&&(display.lastSizeC=display.wrapper.clientHeight,startWorker(cm,400)),display.showingFrom=from,display.showingTo=to,updateHeightsInViewport(cm),updateViewOffset(cm),!0}}function updateHeightsInViewport(cm){for(var height,display=cm.display,prevBottom=display.lineDiv.offsetTop,node=display.lineDiv.firstChild;node;node=node.nextSibling)if(node.lineObj){if(ie_lt8){var bot=node.offsetTop+node.offsetHeight;height=bot-prevBottom,prevBottom=bot}else{var box=getRect(node);height=box.bottom-box.top}var diff=node.lineObj.height-height;if(2>height&&(height=textHeight(display)),diff>.001||-.001>diff){updateLineHeight(node.lineObj,height);var widgets=node.lineObj.widgets;if(widgets)for(var i=0;ii;++i){for(var change=changes[i],intact2=[],diff=change.diff||0,j=0,l2=intact.length;l2>j;++j){var range=intact[j];change.to<=range.from&&change.diff?intact2.push({from:range.from+diff,to:range.to+diff}):change.to<=range.from||change.from>=range.to?intact2.push(range):(change.from>range.from&&intact2.push({from:range.from,to:change.from}),change.tolineN){for(;cur.lineObj!=line;)cur=rm(cur);lineNumbers&&lineN>=updateNumbersFrom&&cur.lineNumber&&setTextContent(cur.lineNumber,lineNumberFor(cm.options,lineN)),cur=cur.nextSibling}else{if(line.widgets)for(var reuse,j=0,search=cur;search&&20>j;++j,search=search.nextSibling)if(search.lineObj==line&&/div/i.test(search.nodeName)){reuse=search;break}var lineNode=buildLineElement(cm,line,lineN,dims,reuse);if(lineNode!=reuse)container.insertBefore(lineNode,cur);else{for(;cur!=reuse;)cur=rm(cur);cur=cur.nextSibling}lineNode.lineObj=line}++lineN});cur;)cur=rm(cur)}function buildLineElement(cm,line,lineNo,dims,reuse){var wrap,lineElement=lineContent(cm,line),markers=line.gutterMarkers,display=cm.display;if(!(cm.options.lineNumbers||markers||line.bgClass||line.wrapClass||line.widgets))return lineElement;if(reuse){reuse.alignable=null;for(var next,isOk=!0,widgetsSeen=0,insertBefore=null,n=reuse.firstChild;n;n=next)if(next=n.nextSibling,/\bCodeMirror-linewidget\b/.test(n.className)){for(var i=0;itop&&(top=0),fragment.appendChild(elt("div",null,"CodeMirror-selected","position: absolute; left: "+left+"px; top: "+top+"px; width: "+(null==width?clientWidth-left:width)+"px; height: "+(bottom-top)+"px"))}function drawForLine(line,fromArg,toArg){function coords(ch,bias){return charCoords(cm,Pos(line,ch),"div",lineObj,bias)}var start,end,lineObj=getLine(doc,line),lineLen=lineObj.text.length;return iterateBidiSections(getOrder(lineObj),fromArg||0,null==toArg?lineLen:toArg,function(from,to,dir){var rightPos,left,right,leftPos=coords(from,"left");if(from==to)rightPos=leftPos,left=right=leftPos.left;else{if(rightPos=coords(to-1,"right"),"rtl"==dir){var tmp=leftPos;leftPos=rightPos,rightPos=tmp}left=leftPos.left,right=rightPos.right}null==fromArg&&0==from&&(left=pl),rightPos.top-leftPos.top>3&&(add(left,leftPos.top,null,leftPos.bottom),left=pl,leftPos.bottomend.bottom||rightPos.bottom==end.bottom&&rightPos.right>end.right)&&(end=rightPos),pl+1>left&&(left=pl),add(left,rightPos.top,right-left,rightPos.bottom)}),{start:start,end:end}}var display=cm.display,doc=cm.doc,sel=cm.doc.sel,fragment=document.createDocumentFragment(),clientWidth=display.lineSpace.offsetWidth,pl=paddingLeft(cm.display);if(sel.from.line==sel.to.line)drawForLine(sel.from.line,sel.from.ch,sel.to.ch);else{var fromLine=getLine(doc,sel.from.line),toLine=getLine(doc,sel.to.line),singleVLine=visualLine(doc,fromLine)==visualLine(doc,toLine),leftEnd=drawForLine(sel.from.line,sel.from.ch,singleVLine?fromLine.text.length:null).end,rightStart=drawForLine(sel.to.line,singleVLine?0:null,sel.to.ch).start;singleVLine&&(leftEnd.top=cm.display.showingTo)){var prevChange,end=+new Date+cm.options.workTime,state=copyState(doc.mode,getStateBefore(cm,doc.frontier)),changed=[];doc.iter(doc.frontier,Math.min(doc.first+doc.size,cm.display.showingTo+500),function(line){if(doc.frontier>=cm.display.showingFrom){var oldStyles=line.styles;line.styles=highlightLine(cm,line,state);for(var ischange=!oldStyles||oldStyles.length!=line.styles.length,i=0;!ischange&&iend?(startWorker(cm,cm.options.workDelay),!0):void 0}),changed.length&&operation(cm,function(){for(var i=0;ilim;--search){if(search<=doc.first)return doc.first;var line=getLine(doc,search-1);if(line.stateAfter&&(!precise||search<=doc.frontier))return search;var indented=countColumn(line.text,null,cm.options.tabSize);(null==minline||minindent>indented)&&(minline=search-1,minindent=indented)}return minline}function getStateBefore(cm,n,precise){var doc=cm.doc,display=cm.display;if(!doc.mode.startState)return!0;var pos=findStartLine(cm,n,precise),state=pos>doc.first&&getLine(doc,pos-1).stateAfter;return state=state?copyState(doc.mode,state):startState(doc.mode),doc.iter(pos,n,function(line){processLine(cm,line,state);var save=pos==n-1||pos%5==0||pos>=display.showingFrom&&posdir&&0==pos&&(dir=1)}return bias=pos>ch?"left":ch>pos?"right":bias,"left"==bias&&r.leftSide?r=r.leftSide:"right"==bias&&r.rightSide&&(r=r.rightSide),{left:ch>pos?r.right:r.left,right:pos>ch?r.left:r.right,top:r.top,bottom:r.bottom}}function findCachedMeasurement(cm,line){for(var cache=cm.display.measureLineCache,i=0;imaxBot&&(bot=maxBot),0>top&&(top=0);for(var i=vranges.length-2;i>=0;i-=2){var rtop=vranges[i],rbot=vranges[i+1];if(!(rtop>bot||top>rbot)&&(top>=rtop&&rbot>=bot||rtop>=top&&bot>=rbot||Math.min(bot,rbot)-Math.max(top,rtop)>=bot-top>>1)){vranges[i]=Math.min(top,rtop),vranges[i+1]=Math.max(bot,rbot);break}}return 0>i&&(i=vranges.length,vranges.push(top,bot)),{left:rect.left-outer.left,right:rect.right-outer.left,top:i,bottom:null}}function finishRect(rect){rect.bottom=vranges[rect.top+1],rect.top=vranges[rect.top]}var display=cm.display,measure=emptyArray(line.text.length),pre=lineContent(cm,line,measure,!0);if(ie&&!ie_lt8&&!cm.options.lineWrapping&&pre.childNodes.length>100){for(var fragment=document.createDocumentFragment(),chunk=10,n=pre.childNodes.length,i=0,chunks=Math.ceil(n/chunk);chunks>i;++i){for(var wrap=elt("div",null,null,"display: inline-block"),j=0;chunk>j&&n;++j)wrap.appendChild(pre.firstChild),--n;fragment.appendChild(wrap)}pre.appendChild(fragment)}removeChildrenAndAdd(display.measure,pre);var outer=getRect(display.lineDiv),vranges=[],data=emptyArray(line.text.length),maxBot=pre.offsetHeight;ie_lt9&&display.measure.first!=pre&&removeChildrenAndAdd(display.measure,pre);for(var cur,i=0;i1&&(rect=data[i]=measureRect(rects[0]),rect.rightSide=measureRect(rects[rects.length-1]))}rect||(rect=data[i]=measureRect(getRect(node))),cur.measureRight&&(rect.right=getRect(cur.measureRight).left),cur.leftSide&&(rect.leftSide=measureRect(getRect(cur.leftSide)))}for(var cur,i=0;ipart.from?get(ch-1):get(ch,right)}lineObj=lineObj||getLine(cm.doc,pos.line),measurement||(measurement=measureLine(cm,lineObj));var order=getOrder(lineObj),ch=pos.ch;if(!order)return get(ch);var partPos=getBidiPartAt(order,ch),val=getBidi(ch,partPos);return null!=bidiOther&&(val.other=getBidi(ch,bidiOther)), +val}function PosWithInfo(line,ch,outside,xRel){var pos=new Pos(line,ch);return pos.xRel=xRel,outside&&(pos.outside=!0),pos}function coordsChar(cm,x,y){var doc=cm.doc;if(y+=cm.display.viewOffset,0>y)return PosWithInfo(doc.first,0,!0,-1);var lineNo=lineAtHeight(doc,y),last=doc.first+doc.size-1;if(lineNo>last)return PosWithInfo(doc.first+doc.size-1,getLine(doc,last).text.length,!0,1);for(0>x&&(x=0);;){var lineObj=getLine(doc,lineNo),found=coordsCharInner(cm,lineObj,lineNo,x,y),merged=collapsedSpanAtEnd(lineObj),mergedPos=merged&&merged.find();if(!merged||!(found.ch>mergedPos.from.ch||found.ch==mergedPos.from.ch&&found.xRel>0))return found;lineNo=mergedPos.to.line}}function coordsCharInner(cm,lineObj,lineNo,x,y){function getX(ch){var sp=cursorCoords(cm,Pos(lineNo,ch),"line",lineObj,measurement);return wrongLine=!0,innerOff>sp.bottom?sp.left-adjust:innerOfftoX)return PosWithInfo(lineNo,to,toOutside,1);for(;;){if(bidi?to==from||to==moveVisually(lineObj,from,1):1>=to-from){for(var ch=fromX>x||toX-x>=x-fromX?from:to,xDiff=x-(ch==from?fromX:toX);isExtendingChar.test(lineObj.text.charAt(ch));)++ch;var pos=PosWithInfo(lineNo,ch,ch==from?fromOutside:toOutside,0>xDiff?-1:xDiff?1:0);return pos}var step=Math.ceil(dist/2),middle=from+step;if(bidi){middle=from;for(var i=0;step>i;++i)middle=moveVisually(lineObj,middle,1)}var middleX=getX(middle);middleX>x?(to=middle,toX=middleX,(toOutside=wrongLine)&&(toX+=1e3),dist=step):(from=middle,fromX=middleX,fromOutside=wrongLine,dist-=step)}}function textHeight(display){if(null!=display.cachedTextHeight)return display.cachedTextHeight;if(null==measureText){measureText=elt("pre");for(var i=0;49>i;++i)measureText.appendChild(document.createTextNode("x")),measureText.appendChild(elt("br"));measureText.appendChild(document.createTextNode("x"))}removeChildrenAndAdd(display.measure,measureText);var height=measureText.offsetHeight/50;return height>3&&(display.cachedTextHeight=height),removeChildren(display.measure),height||1}function charWidth(display){if(null!=display.cachedCharWidth)return display.cachedCharWidth;var anchor=elt("span","x"),pre=elt("pre",[anchor]);removeChildrenAndAdd(display.measure,pre);var width=anchor.offsetWidth;return width>2&&(display.cachedCharWidth=width),width||10}function startOperation(cm){cm.curOp={changes:[],forceUpdate:!1,updateInput:null,userSelChange:null,textChanged:null,selectionChanged:!1,cursorActivity:!1,updateMaxLine:!1,updateScrollPos:!1,id:++nextOpId},delayedCallbackDepth++||(delayedCallbacks=[])}function endOperation(cm){var op=cm.curOp,doc=cm.doc,display=cm.display;if(cm.curOp=null,op.updateMaxLine&&computeMaxLength(cm),display.maxLineChanged&&!cm.options.lineWrapping&&display.maxLine){var width=measureLineWidth(cm,display.maxLine);display.sizer.style.minWidth=Math.max(0,width+3+scrollerCutOff)+"px",display.maxLineChanged=!1;var maxScrollLeft=Math.max(0,display.sizer.offsetLeft+display.sizer.offsetWidth-display.scroller.clientWidth);maxScrollLeft
'+d+"";continue}if(g=this.rules.url.exec(a)){a=a.substring(g[0].length),d=f(g[1]),e=d,b+=''+d+"";continue}if(g=this.rules.tag.exec(a)){a=a.substring(g[0].length),b+=this.options.sanitize?f(g[0]):g[0];continue}if(g=this.rules.link.exec(a)){a=a.substring(g[0].length),b+=this.outputLink(g,{href:g[2],title:g[3]});continue}if((g=this.rules.reflink.exec(a))||(g=this.rules.nolink.exec(a))){a=a.substring(g[0].length),c=(g[2]||g[1]).replace(/\s+/g," "),c=this.links[c.toLowerCase()];if(!c||!c.href){b+=g[0].charAt(0),a=g[0].substring(1)+a;continue}b+=this.outputLink(g,c);continue}if(g=this.rules.strong.exec(a)){a=a.substring(g[0].length),b+=""+this.output(g[2]||g[1])+"";continue}if(g=this.rules.em.exec(a)){a=a.substring(g[0].length),b+=""+this.output(g[2]||g[1])+"";continue}if(g=this.rules.code.exec(a)){a=a.substring(g[0].length),b+=""+f(g[2],!0)+"";continue}if(g=this.rules.br.exec(a)){a=a.substring(g[0].length),b+="
";continue}if(g=this.rules.del.exec(a)){a=a.substring(g[0].length),b+=""+this.output(g[1])+"";continue}if(g=this.rules.text.exec(a)){a=a.substring(g[0].length),b+=f(this.smartypants(g[0]));continue}if(a)throw new Error("Infinite loop on byte: "+a.charCodeAt(0))}return b},d.prototype.outputLink=function(a,b){return a[0].charAt(0)!=="!"?'"+this.output(a[1])+"":''+f(a[1])+'"},d.prototype.smartypants=function(a){return this.options.smartypants?a.replace(/--/g,"—").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):a},d.prototype.mangle=function(a){var b="",c=a.length,d=0,e;for(;d.5&&(e="x"+e.toString(16)),b+="&#"+e+";";return b},e.parse=function(a,b){var c=new e(b);return c.parse(a)},e.prototype.parse=function(a){this.inline=new d(a.links,this.options),this.tokens=a.reverse();var b="";while(this.next())b+=this.tok();return b},e.prototype.next=function(){return this.token=this.tokens.pop()},e.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},e.prototype.parseText=function(){var a=this.token.text;while(this.peek().type==="text")a+="\n"+this.next().text;return this.inline.output(a)},e.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return"
\n";case"heading":return"'+this.inline.output(this.token.text)+"\n";case"code":if(this.options.highlight){var a=this.options.highlight(this.token.text,this.token.lang);a!=null&&a!==this.token.text&&(this.token.escaped=!0,this.token.text=a)}return this.token.escaped||(this.token.text=f(this.token.text,!0)),"
"+this.token.text+"
\n";case"table":var b="",c,d,e,g,h;b+="\n\n";for(d=0;d\n";b+="\n\n",b+="\n";for(d=0;d\n";for(h=0;h\n";b+="\n"}return b+="\n","\n"+b+"
\n";case"blockquote_start":var b="";while(this.next().type!=="blockquote_end")b+=this.tok();return"
\n"+b+"
\n";case"list_start":var i=this.token.ordered?"ol":"ul",b="";while(this.next().type!=="list_end")b+=this.tok();return"<"+i+">\n"+b+"\n";case"list_item_start":var b="";while(this.next().type!=="list_item_end")b+=this.token.type==="text"?this.parseText():this.tok();return"
  • "+b+"
  • \n";case"loose_item_start":var b="";while(this.next().type!=="list_item_end")b+=this.tok();return"
  • "+b+"
  • \n";case"html":return!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;case"paragraph":return"

    "+this.inline.output(this.token.text)+"

    \n";case"text":return"

    "+this.parseText()+"

    \n"}},h.exec=h,j.options=j.setOptions=function(a){return i(j.defaults,a),j},j.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1},j.Parser=e,j.parser=e.parse,j.Lexer=b,j.lexer=b.lex,j.InlineLexer=d,j.inlineLexer=d.output,j.parse=j,typeof exports=="object"?module.exports=j:typeof define=="function"&&define.amd?define(function(){return j}):this.marked=j}).call(function(){return this||(typeof window!="undefined"?window:global)}()); \ No newline at end of file +(function(){function Lexer(options){this.tokens=[],this.tokens.links={},this.options=options||marked.defaults,this.rules=block.normal,this.options.gfm&&(this.rules=this.options.tables?block.tables:block.gfm)}function InlineLexer(links,options){if(this.options=options||marked.defaults,this.links=links,this.rules=inline.normal,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.rules=this.options.breaks?inline.breaks:inline.gfm:this.options.pedantic&&(this.rules=inline.pedantic)}function Parser(options){this.tokens=[],this.token=null,this.options=options||marked.defaults}function escape(html,encode){return html.replace(encode?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function replace(regex,opt){return regex=regex.source,opt=opt||"",function self(name,val){return name?(val=val.source||val,val=val.replace(/(^|[^\[])\^/g,"$1"),regex=regex.replace(name,val),self):new RegExp(regex,opt)}}function noop(){}function merge(obj){for(var target,key,i=1;iAn error occured:

    "+escape(e.message+"",!0)+"
    ";throw e}}var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment|closed|closing) *(?:\n{2,}|\s*$)/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};block.bullet=/(?:[*+-]|\d+\.)/,block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,block.item=replace(block.item,"gm")(/bull/g,block.bullet)(),block.list=replace(block.list)(/bull/g,block.bullet)("hr",/\n+(?=(?: *[-*_]){3,} *(?:\n+|$))/)(),block._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|@)\\b",block.html=replace(block.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,block._tag)(),block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)(),block.normal=merge({},block),block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/}),block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")(),block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),Lexer.rules=block,Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)},Lexer.prototype.lex=function(src){return src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(src,!0)},Lexer.prototype.token=function(src,top){for(var next,loose,cap,bull,b,item,space,i,l,src=src.replace(/^ +$/gm,"");src;)if((cap=this.rules.newline.exec(src))&&(src=src.substring(cap[0].length),cap[0].length>1&&this.tokens.push({type:"space"})),cap=this.rules.code.exec(src))src=src.substring(cap[0].length),cap=cap[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?cap:cap.replace(/\n+$/,"")});else if(cap=this.rules.fences.exec(src))src=src.substring(cap[0].length),this.tokens.push({type:"code",lang:cap[2],text:cap[3]});else if(cap=this.rules.heading.exec(src))src=src.substring(cap[0].length),this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});else if(top&&(cap=this.rules.nptable.exec(src))){for(src=src.substring(cap[0].length),item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")},i=0;i ?/gm,""),this.token(cap,top),this.tokens.push({type:"blockquote_end"});else if(cap=this.rules.list.exec(src)){for(src=src.substring(cap[0].length),bull=cap[2],this.tokens.push({type:"list_start",ordered:bull.length>1}),cap=cap[0].match(this.rules.item),next=!1,l=cap.length,i=0;l>i;i++)item=cap[i],space=item.length,item=item.replace(/^ *([*+-]|\d+\.) +/,""),~item.indexOf("\n ")&&(space-=item.length,item=this.options.pedantic?item.replace(/^ {1,4}/gm,""):item.replace(new RegExp("^ {1,"+space+"}","gm"),"")),this.options.smartLists&&i!==l-1&&(b=block.bullet.exec(cap[i+1])[0],bull===b||bull.length>1&&b.length>1||(src=cap.slice(i+1).join("\n")+src,i=l-1)),loose=next||/\n\n(?!\s*$)/.test(item),i!==l-1&&(next="\n"===item.charAt(item.length-1),loose||(loose=next)),this.tokens.push({type:loose?"loose_item_start":"list_item_start"}),this.token(item,!1),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(cap=this.rules.html.exec(src))src=src.substring(cap[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:"pre"===cap[1]||"script"===cap[1]||"style"===cap[1],text:cap[0]});else if(top&&(cap=this.rules.def.exec(src)))src=src.substring(cap[0].length),this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};else if(top&&(cap=this.rules.table.exec(src))){for(src=src.substring(cap[0].length),item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")},i=0;i])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)(),inline.reflink=replace(inline.reflink)("inside",inline._inside)(),inline.normal=merge({},inline),inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()}),inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()}),InlineLexer.rules=inline,InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)},InlineLexer.prototype.output=function(src){for(var link,text,href,cap,out="";src;)if(cap=this.rules.escape.exec(src))src=src.substring(cap[0].length),out+=cap[1];else if(cap=this.rules.autolink.exec(src))src=src.substring(cap[0].length),"@"===cap[2]?(text=this.mangle(":"===cap[1].charAt(6)?cap[1].substring(7):cap[1]),href=this.mangle("mailto:")+text):(text=escape(cap[1]),href=text),out+=''+text+"";else if(cap=this.rules.url.exec(src))src=src.substring(cap[0].length),text=escape(cap[1]),href=text,out+=''+text+"";else if(cap=this.rules.tag.exec(src))src=src.substring(cap[0].length),out+=this.options.sanitize?escape(cap[0]):cap[0];else if(cap=this.rules.link.exec(src))src=src.substring(cap[0].length),out+=this.outputLink(cap,{href:cap[2],title:cap[3]});else if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){if(src=src.substring(cap[0].length),link=(cap[2]||cap[1]).replace(/\s+/g," "),link=this.links[link.toLowerCase()],!link||!link.href){out+=cap[0].charAt(0),src=cap[0].substring(1)+src;continue}out+=this.outputLink(cap,link)}else if(cap=this.rules.strong.exec(src))src=src.substring(cap[0].length),out+=""+this.output(cap[2]||cap[1])+"";else if(cap=this.rules.em.exec(src))src=src.substring(cap[0].length),out+=""+this.output(cap[2]||cap[1])+"";else if(cap=this.rules.code.exec(src))src=src.substring(cap[0].length),out+=""+escape(cap[2],!0)+"";else if(cap=this.rules.br.exec(src))src=src.substring(cap[0].length),out+="
    ";else if(cap=this.rules.del.exec(src))src=src.substring(cap[0].length),out+=""+this.output(cap[1])+"";else if(cap=this.rules.text.exec(src))src=src.substring(cap[0].length),out+=escape(this.smartypants(cap[0]));else if(src)throw new Error("Infinite loop on byte: "+src.charCodeAt(0));return out},InlineLexer.prototype.outputLink=function(cap,link){return"!"!==cap[0].charAt(0)?'"+this.output(cap[1])+"":''+escape(cap[1])+'"},InlineLexer.prototype.smartypants=function(text){return this.options.smartypants?text.replace(/--/g,"—").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):text},InlineLexer.prototype.mangle=function(text){for(var ch,out="",l=text.length,i=0;l>i;i++)ch=text.charCodeAt(i),Math.random()>.5&&(ch="x"+ch.toString(16)),out+="&#"+ch+";";return out},Parser.parse=function(src,options){var parser=new Parser(options);return parser.parse(src)},Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options),this.tokens=src.reverse();for(var out="";this.next();)out+=this.tok();return out},Parser.prototype.next=function(){return this.token=this.tokens.pop()},Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},Parser.prototype.parseText=function(){for(var body=this.token.text;"text"===this.peek().type;)body+="\n"+this.next().text;return this.inline.output(body)},Parser.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return"
    \n";case"heading":return"'+this.inline.output(this.token.text)+"\n";case"code":if(this.options.highlight){var code=this.options.highlight(this.token.text,this.token.lang);null!=code&&code!==this.token.text&&(this.token.escaped=!0,this.token.text=code)}return this.token.escaped||(this.token.text=escape(this.token.text,!0)),"
    "+this.token.text+"
    \n";case"table":var heading,i,row,cell,j,body="";for(body+="\n\n",i=0;i\n";for(body+="\n\n",body+="\n",i=0;i\n",j=0;j\n";body+="\n"}return body+="\n","\n"+body+"
    \n";case"blockquote_start":for(var body="";"blockquote_end"!==this.next().type;)body+=this.tok();return"
    \n"+body+"
    \n";case"list_start":for(var type=this.token.ordered?"ol":"ul",body="";"list_end"!==this.next().type;)body+=this.tok();return"<"+type+">\n"+body+"\n";case"list_item_start":for(var body="";"list_item_end"!==this.next().type;)body+="text"===this.token.type?this.parseText():this.tok();return"
  • "+body+"
  • \n";case"loose_item_start":for(var body="";"list_item_end"!==this.next().type;)body+=this.tok();return"
  • "+body+"
  • \n";case"html":return this.token.pre||this.options.pedantic?this.token.text:this.inline.output(this.token.text);case"paragraph":return"

    "+this.inline.output(this.token.text)+"

    \n";case"text":return"

    "+this.parseText()+"

    \n"}},noop.exec=noop,marked.options=marked.setOptions=function(opt){return merge(marked.defaults,opt),marked},marked.defaults={gfm:!0,tables:!0,breaks:!1,pedantic:!1,sanitize:!1,smartLists:!1,silent:!1,highlight:null,langPrefix:"lang-",smartypants:!1},marked.Parser=Parser,marked.parser=Parser.parse,marked.Lexer=Lexer,marked.lexer=Lexer.lex,marked.InlineLexer=InlineLexer,marked.inlineLexer=InlineLexer.output,marked.parse=marked,"object"==typeof exports?module.exports=marked:"function"==typeof define&&define.amd?define(function(){return marked}):this.marked=marked}).call(function(){return this||("undefined"!=typeof window?window:global)}()); \ No newline at end of file