function _typeof(n){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}
/**
 * easymde v2.15.0
 * Copyright Jeroen Akkerman
 * @link https://github.com/ionaru/easy-markdown-editor
 * @license MIT
 */
!function(n){"object"==("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EasyMDE=n()}(function(){return function n(t,i,r){function u(f,o){var h,c,s;if(!i[f]){if(!t[f]){if(h="function"==typeof require&&require,!o&&h)return h(f,!0);if(e)return e(f,!0);c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c;}s=i[f]={exports:{}};t[f][0].call(s.exports,function(n){return u(t[f][1][n]||n)},s,s.exports,n,t,i,r)}return i[f].exports}for(var e="function"==typeof require&&require,f=0;f<r.length;f++)u(r[f]);return u}({1:[function(){},{}],2:[function(n,t){"use strict";function i(n){"function"==typeof(n=n||{}).codeMirrorInstance&&"function"==typeof n.codeMirrorInstance.defineMode?(String.prototype.includes||(String.prototype.includes=function(){return-1!==String.prototype.indexOf.apply(this,arguments)}),n.codeMirrorInstance.defineMode("spell-checker",function(t){var u,f;i.aff_loading||(i.aff_loading=!0,u=new XMLHttpRequest,u.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),u.onload=function(){4===u.readyState&&200===u.status&&(i.aff_data=u.responseText,i.num_loaded++,2==i.num_loaded&&(i.typo=new r("en_US",i.aff_data,i.dic_data,{platform:"any"})))},u.send(null));i.dic_loading||(i.dic_loading=!0,f=new XMLHttpRequest,f.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),f.onload=function(){4===f.readyState&&200===f.status&&(i.dic_data=f.responseText,i.num_loaded++,2==i.num_loaded&&(i.typo=new r("en_US",i.aff_data,i.dic_data,{platform:"any"})))},f.send(null));var e='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',o={token:function(n){var t=n.peek(),r="";if(e.includes(t))return n.next(),null;for(;null!=(t=n.peek())&&!e.includes(t);)r+=t,n.next();return i.typo&&!i.typo.check(r)?"spell-error":null}},s=n.codeMirrorInstance.getMode(t,t.backdrop||"text/plain");return n.codeMirrorInstance.overlayMode(s,o,!0)})):console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`")}var r=n("typo-js");i.num_loaded=0;i.aff_loading=!1;i.dic_loading=!1;i.aff_data="";i.dic_data="";i.typo;t.exports=i},{"typo-js":16}],3:[function(n,t,i){!function(n){"use strict";function t(t,i){clearTimeout(i.timeout);n.off(window,"mouseup",i.hurry);n.off(window,"keyup",i.hurry)}n.defineOption("autoRefresh",!1,function(i,r){i.state.autoRefresh&&(t(0,i.state.autoRefresh),i.state.autoRefresh=null);r&&0==i.display.wrapper.offsetHeight&&function(i,r){function u(){i.display.wrapper.offsetHeight?(t(0,r),i.display.lastWrapHeight!=i.display.wrapper.clientHeight&&i.refresh()):r.timeout=setTimeout(u,r.delay)}r.timeout=setTimeout(u,r.delay);r.hurry=function(){clearTimeout(r.timeout);r.timeout=setTimeout(u,50)};n.on(window,"mouseup",r.hurry);n.on(window,"keyup",r.hurry)}(i,i.state.autoRefresh={delay:r.delay||250})})}("object"==_typeof(i)&&"object"==_typeof(t)?n("../../lib/codemirror"):CodeMirror)},{"../../lib/codemirror":10}],4:[function(n,t,i){!function(n){"use strict";n.defineOption("fullScreen",!1,function(t,i,r){r==n.Init&&(r=!1);!r!=!i&&(i?function(n){var t=n.getWrapperElement();n.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height};t.style.width="";t.style.height="auto";t.className+=" CodeMirror-fullscreen";document.documentElement.style.overflow="hidden";n.refresh()}(t):function(n){var i=n.getWrapperElement(),t;i.className=i.className.replace(/\s*CodeMirror-fullscreen\b/,"");document.documentElement.style.overflow="";t=n.state.fullScreenRestore;i.style.width=t.width;i.style.height=t.height;window.scrollTo(t.scrollLeft,t.scrollTop);n.refresh()}(t))})}("object"==_typeof(i)&&"object"==_typeof(t)?n("../../lib/codemirror"):CodeMirror)},{"../../lib/codemirror":10}],5:[function(n,t,i){!function(n){function i(n){n.state.placeholder&&(n.state.placeholder.parentNode.removeChild(n.state.placeholder),n.state.placeholder=null)}function r(n){var t,r;i(n);t=n.state.placeholder=document.createElement("pre");t.style.cssText="height: 0; overflow: visible";t.style.direction=n.getOption("direction");t.className="CodeMirror-placeholder CodeMirror-line-like";r=n.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r));t.appendChild(r);n.display.lineSpace.insertBefore(t,n.display.lineSpace.firstChild)}function u(n){f(n)&&r(n)}function t(n){var t=n.getWrapperElement(),u=f(n);t.className=t.className.replace(" CodeMirror-empty","")+(u?" CodeMirror-empty":"");u?r(n):i(n)}function f(n){return 1===n.lineCount()&&""===n.getLine(0)}n.defineOption("placeholder","",function(f,e,o){var h=o&&o!=n.Init,s;e&&!h?(f.on("blur",u),f.on("change",t),f.on("swapDoc",t),n.on(f.getInputField(),"compositionupdate",f.state.placeholderCompose=function(){!function(n){setTimeout(function(){var u=!1,t;1==n.lineCount()&&(t=n.getInputField(),u="TEXTAREA"==t.nodeName?!n.getLine(0).length:!/[^\u200b]/.test(t.querySelector(".CodeMirror-line").textContent));u?r(n):i(n)},20)}(f)}),t(f)):!e&&h&&(f.off("blur",u),f.off("change",t),f.off("swapDoc",t),n.off(f.getInputField(),"compositionupdate",f.state.placeholderCompose),i(f),s=f.getWrapperElement(),s.className=s.className.replace(" CodeMirror-empty",""));e&&!f.hasFocus()&&u(f)})}("object"==_typeof(i)&&"object"==_typeof(t)?n("../../lib/codemirror"):CodeMirror)},{"../../lib/codemirror":10}],6:[function(n,t,i){!function(n){"use strict";function u(n,i){var a=i.line,e=0,v=0,y=t.exec(n.getLine(a)),o=y[1];do{var s=a+(e+=1),h=n.getLine(s),r=t.exec(h);if(r){var f=r[1],c=parseInt(y[3],10)+e-v,u=parseInt(r[3],10),l=u;if(o!==f||isNaN(u)){if(o.length>f.length)return;if(o.length<f.length&&1===e)return;v+=1}else c===u&&(l=u+1),c>u&&(l=c+1),n.replaceRange(h.replace(t,f+l+r[4]+r[5]),{line:s,ch:0},{line:s,ch:h.length})}}while(r)}var t=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,i=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,r=/[*+-]\s/;n.commands.newlineAndIndentContinueMarkdownList=function(f){var p,w;if(f.getOption("disableInput"))return n.Pass;for(var c=f.listSelections(),l=[],s=0;s<c.length;s++){var o=c[s].head,a=f.getStateAfter(o.line),v=n.innerMode(f.getMode(),a);if("markdown"!==v.mode.name)return void f.execCommand("newlineAndIndent");var k=!1!==(a=v.state).list,y=0!==a.quote,h=f.getLine(o.line),e=t.exec(h),d=/^\s*$/.test(h.slice(0,o.ch));if(!c[s].empty()||!k&&!y||!e||d)return void f.execCommand("newlineAndIndent");if(i.test(h))p=y&&/>\s*$/.test(h),w=!/>\s*$/.test(h),(p||w)&&f.replaceRange("",{line:o.line,ch:0},{line:o.line,ch:o.ch+1}),l[s]="\n";else{var g=e[1],nt=e[5],b=!(r.test(e[2])||e[2].indexOf(">")>=0),tt=b?parseInt(e[3],10)+1+e[4]:e[2].replace("x"," ");l[s]="\n"+g+tt+nt;b&&u(f,o)}}f.replaceSelections(l)}}("object"==_typeof(i)&&"object"==_typeof(t)?n("../../lib/codemirror"):CodeMirror)},{"../../lib/codemirror":10}],7:[function(n,t,i){!function(n){"use strict";n.overlayMode=function(t,i,r){return{startState:function(){return{base:n.startState(t),overlay:n.startState(i),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(r){return{base:n.copyState(t,r.base),overlay:n.copyState(i,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(n,u){return(n!=u.streamSeen||Math.min(u.basePos,u.overlayPos)<n.start)&&(u.streamSeen=n,u.basePos=u.overlayPos=n.start),n.start==u.basePos&&(u.baseCur=t.token(n,u.base),u.basePos=n.pos),n.start==u.overlayPos&&(n.pos=n.start,u.overlayCur=i.token(n,u.overlay),u.overlayPos=n.pos),n.pos=Math.min(u.basePos,u.overlayPos),null==u.overlayCur?u.baseCur:null!=u.baseCur&&u.overlay.combineTokens||r&&null==u.overlay.combineTokens?u.baseCur+" "+u.overlayCur:u.overlayCur},indent:t.indent&&function(n,i,r){return t.indent(n.base,i,r)},electricChars:t.electricChars,innerMode:function(n){return{state:n.base,mode:t}},blankLine:function(n){var u,f;return t.blankLine&&(u=t.blankLine(n.base)),i.blankLine&&(f=i.blankLine(n.overlay)),null==f?u:r&&null!=u?u+" "+f:f}}}}("object"==_typeof(i)&&"object"==_typeof(t)?n("../../lib/codemirror"):CodeMirror)},{"../../lib/codemirror":10}],8:[function(n,t,i){!function(n){"use strict";function r(n,t){for(var u=function(n){var t=n.flags;return null!=t?t:(n.ignoreCase?"i":"")+(n.global?"g":"")+(n.multiline?"m":"")}(n),i=u,r=0;r<t.length;r++)-1==i.indexOf(t.charAt(r))&&(i+=t.charAt(r));return u==i?n:new RegExp(n.source,i)}function o(n){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(n.source)}function s(n,i,u){var s,f;i=r(i,"g");for(var e=u.line,o=u.ch,h=n.lastLine();e<=h;e++,o=0)if(i.lastIndex=o,s=n.getLine(e),f=i.exec(s),f)return{from:t(e,f.index),to:t(e,f.index+f[0].length),match:f}}function l(n,i,u){var l,a,e;if(!o(i))return s(n,i,u);i=r(i,"gm");for(var f,y=1,c=u.line,p=n.lastLine();c<=p;){for(l=0;l<y&&!(c>p);l++)a=n.getLine(c++),f=null==f?a:f+"\n"+a;if(y*=2,i.lastIndex=u.ch,e=i.exec(f),e){var v=f.slice(0,e.index).split("\n"),h=e[0].split("\n"),w=u.line+v.length-1,b=v[v.length-1].length;return{from:t(w,b),to:t(w+h.length-1,1==h.length?b+h[0].length:h[h.length-1].length),match:e}}}}function h(n,t,i){for(var u,r,e,f=0;f<=n.length;){if(t.lastIndex=f,r=t.exec(n),!r)break;if(e=r.index+r[0].length,e>n.length-i)break;(!u||e>u.index+u[0].length)&&(u=r);f=r.index+1}return u}function c(n,i,u){var s,f;i=r(i,"g");for(var e=u.line,o=u.ch,c=n.firstLine();e>=c;e--,o=-1)if(s=n.getLine(e),f=h(s,i,o<0?0:s.length-o),f)return{from:t(e,f.index),to:t(e,f.index+f[0].length),match:f}}function a(n,i,u){var a,v,e;if(!o(i))return c(n,i,u);i=r(i,"gm");for(var f,p=1,d=n.getLine(u.line).length-u.ch,l=u.line,w=n.firstLine();l>=w;){for(a=0;a<p&&l>=w;a++)v=n.getLine(l--),f=null==f?v:v+"\n"+f;if(p*=2,e=h(f,i,d),e){var y=f.slice(0,e.index).split("\n"),s=e[0].split("\n"),b=l+y.length,k=y[y.length-1].length;return{from:t(b,k),to:t(b+s.length-1,1==s.length?k+s[0].length:s[s.length-1].length),match:e}}}}function i(n,t,i,r){var u,e,f,o;if(n.length==t.length)return i;for(u=0,e=i+Math.max(0,n.length-t.length);;){if(u==e)return u;if(f=u+e>>1,o=r(n.slice(0,f)).length,o==i)return f;o>i?e=f:u=f+1}}function v(n,r,e,o){var h,s,v,l,y,w,p;if(!r.length)return null;h=o?u:f;s=h(r).split(/\r|\n\r?/);n:for(var c=e.line,a=e.ch,g=n.lastLine()+1-s.length;c<=g;c++,a=0){if(v=n.getLine(c).slice(a),l=h(v),1==s.length){if(y=l.indexOf(s[0]),-1==y)continue n;return e=i(v,l,y,h)+a,{from:t(c,i(v,l,y,h)+a),to:t(c,i(v,l,y+s[0].length,h)+a)}}if(w=l.length-s[0].length,l.slice(w)==s[0]){for(p=1;p<s.length-1;p++)if(h(n.getLine(c+p))!=s[p])continue n;var k=n.getLine(c+s.length-1),d=h(k),b=s[s.length-1];if(d.slice(0,b.length)==b)return{from:t(c,i(v,l,w,h)+a),to:t(c+s.length-1,i(k,d,b.length,h))}}}}function y(n,r,e,o){var h,s,l,a,y,p,v,w,b;if(!r.length)return null;h=o?u:f;s=h(r).split(/\r|\n\r?/);n:for(var c=e.line,k=e.ch,d=n.firstLine()-1+s.length;c>=d;c--,k=-1){if(l=n.getLine(c),k>-1&&(l=l.slice(0,k)),a=h(l),1==s.length){if(y=a.lastIndexOf(s[0]),-1==y)continue n;return{from:t(c,i(l,a,y,h)),to:t(c,i(l,a,y+s[0].length,h))}}if(p=s[s.length-1],a.slice(0,p.length)==p){for(v=1,e=c-s.length+1;v<s.length-1;v++)if(h(n.getLine(e+v))!=s[v])continue n;if(w=n.getLine(c+1-s.length),b=h(w),b.slice(b.length-s[0].length)==s[0])return{from:t(c+1-s.length,i(w,b,w.length-s[0].length,h)),to:t(c,i(l,a,p.length,h))}}}}function e(n,i,u,f){var e;this.atOccurrence=!1;this.doc=n;u=u?n.clipPos(u):t(0,0);this.pos={from:u,to:u};"object"==_typeof(f)?e=f.caseFold:(e=f,f=null);"string"==typeof i?(null==e&&(e=!1),this.matches=function(t,r){return(t?y:v)(n,i,r,e)}):(i=r(i,"gm"),this.matches=f&&!1===f.multiline?function(t,r){return(t?c:s)(n,i,r)}:function(t,r){return(t?a:l)(n,i,r)})}var u,f,t=n.Pos;String.prototype.normalize?(u=function(n){return n.normalize("NFD").toLowerCase()},f=function(n){return n.normalize("NFD")}):(u=function(n){return n.toLowerCase()},f=function(n){return n});e.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(i){for(var u,r=this.matches(i,this.doc.clipPos(i?this.pos.from:this.pos.to));r&&0==n.cmpPos(r.from,r.to);)i?r.from.ch?r.from=t(r.from.line,r.from.ch-1):r=r.from.line==this.doc.firstLine()?null:this.matches(i,this.doc.clipPos(t(r.from.line-1))):r.to.ch<this.doc.getLine(r.to.line).length?r.to=t(r.to.line,r.to.ch+1):r=r.to.line==this.doc.lastLine()?null:this.matches(i,t(r.to.line+1,0));return r?(this.pos=r,this.atOccurrence=!0,this.pos.match||!0):(u=t(i?this.doc.firstLine():this.doc.lastLine()+1,0),this.pos={from:u,to:u},this.atOccurrence=!1)},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(i,r){if(this.atOccurrence){var u=n.splitLines(i);this.doc.replaceRange(u,this.pos.from,this.pos.to,r);this.pos.to=t(this.pos.from.line+u.length-1,u[u.length-1].length+(1==u.length?this.pos.from.ch:0))}}};n.defineExtension("getSearchCursor",function(n,t,i){return new e(this.doc,n,t,i)});n.defineDocExtension("getSearchCursor",function(n,t,i){return new e(this,n,t,i)});n.defineExtension("selectMatches",function(t,i){for(var u=[],r=this.getSearchCursor(t,this.getCursor("from"),i);r.findNext()&&!(n.cmpPos(r.to(),this.getCursor("to"))>0);)u.push({anchor:r.from(),head:r.to()});u.length&&this.setSelections(u,0)})}("object"==_typeof(i)&&"object"==_typeof(t)?n("../../lib/codemirror"):CodeMirror)},{"../../lib/codemirror":10}],9:[function(n,t,i){!function(n){"use strict";function f(n){n.state.markedSelection&&n.operation(function(){!function(n){var e,o;if(!n.somethingSelected())return r(n);if(n.listSelections().length>1)return u(n);var s=n.getCursor("start"),h=n.getCursor("end"),f=n.state.markedSelection;if(!f.length)return i(n,s,h);if(e=f[0].find(),o=f[f.length-1].find(),!e||!o||h.line-s.line<=8||t(s,o.to)>=0||t(h,e.from)<=0)return u(n);for(;t(s,e.from)>0;)f.shift().clear(),e=f[0].find();for(t(s,e.from)<0&&(e.to.line-s.line<8?(f.shift().clear(),i(n,s,e.to,0)):i(n,s,e.from,0));t(h,o.to)<0;)f.pop().clear(),o=f[f.length-1].find();t(h,o.to)>0&&(h.line-o.from.line<8?(f.pop().clear(),i(n,o.from,h)):i(n,o.to,h))}(n)})}function e(n){n.state.markedSelection&&n.state.markedSelection.length&&n.operation(function(){r(n)})}function i(n,i,r,u){if(0!=t(i,r))for(var s=n.state.markedSelection,l=n.state.markedSelectionStyle,f=i.line;;){var a=f==i.line?i:o(f,0),e=f+8,h=e>=r.line,v=h?r:o(e,0),c=n.markText(a,v,{className:l});if(null==u?s.push(c):s.splice(u++,0,c),h)break;f=e}}function r(n){for(var t=n.state.markedSelection,i=0;i<t.length;++i)t[i].clear();t.length=0}function u(n){r(n);for(var u=n.listSelections(),t=0;t<u.length;t++)i(n,u[t].from(),u[t].to())}n.defineOption("styleSelectedText",!1,function(t,i,o){var s=o&&o!=n.Init;i&&!s?(t.state.markedSelection=[],t.state.markedSelectionStyle="string"==typeof i?i:"CodeMirror-selectedtext",u(t),t.on("cursorActivity",f),t.on("change",e)):!i&&s&&(t.off("cursorActivity",f),t.off("change",e),r(t),t.state.markedSelection=t.state.markedSelectionStyle=null)});var o=n.Pos,t=n.cmpPos}("object"==_typeof(i)&&"object"==_typeof(t)?n("../../lib/codemirror"):CodeMirror)},{"../../lib/codemirror":10}],10:[function(n,t,i){!function(n,r){"object"==_typeof(i)&&void 0!==t?t.exports=r():(n=n||self).CodeMirror=r()}(this,function(){"use strict";function dr(n){return new RegExp("(^|\\s)"+n+"(?:$|\\s)\\s*")}function pi(n){for(var t=n.childNodes.length;t>0;--t)n.removeChild(n.firstChild);return n}function ht(n,t){return pi(n).appendChild(t)}function i(n,t,i,r){var u=document.createElement(n),f;if(i&&(u.className=i),r&&(u.style.cssText=r),"string"==typeof t)u.appendChild(document.createTextNode(t));else if(t)for(f=0;f<t.length;++f)u.appendChild(t[f]);return u}function nu(n,t,r,u){var f=i(n,t,r,u);return f.setAttribute("role","presentation"),f}function wi(n,t){if(3==t.nodeType&&(t=t.parentNode),n.contains)return n.contains(t);do if(11==t.nodeType&&(t=t.host),t==n)return!0;while(t=t.parentNode)}function vt(){var n;try{n=document.activeElement}catch(t){n=document.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function ur(n,t){var i=n.className;dr(t).test(i)||(n.className+=(i?" ":"")+t)}function bs(n,t){for(var r=n.split(" "),i=0;i<r.length;i++)r[i]&&!dr(r[i]).test(t)&&(t+=" "+r[i]);return t}function ks(n){var t=Array.prototype.slice.call(arguments,1);return function(){return n.apply(null,t)}}function fr(n,t,i){for(var r in t||(t={}),n)!n.hasOwnProperty(r)||!1===i&&t.hasOwnProperty(r)||(t[r]=n[r]);return t}function yt(n,t,i,r,u){var f,e,o;for(null==t&&-1==(t=n.search(/[^\s\u00a0]/))&&(t=n.length),f=r||0,e=u||0;;){if(o=n.indexOf("\t",f),o<0||o>=t)return e+(t-f);e+=o-f;e+=i-e%i;f=o+1}}function nt(n,t){for(var i=0;i<n.length;++i)if(n[i]==t)return i;return-1}function gs(n,t,i){for(var u,e,r=0,f=0;;){if(u=n.indexOf("\t",r),-1==u&&(u=n.length),e=u-r,u==n.length||f+e>=t)return r+Math.min(e,t-f);if(f+=u-r,r=u+1,(f+=i-f%i)>=t)return r}}function nh(n){for(;cf.length<=n;)cf.push(s(cf)+" ");return cf[n]}function s(n){return n[n.length-1]}function uo(n,t){for(var r=[],i=0;i<n.length;i++)r[i]=t(n[i],i);return r}function oa(){}function sa(n,t){var i;return Object.create?i=Object.create(n):(oa.prototype=n,i=new oa),t&&fr(t,i),i}function th(n){return/\w/.test(n)||n>""&&(n.toUpperCase()!=n.toLowerCase()||ha.test(n))}function fo(n,t){return t?!!(t.source.indexOf("\\w")>-1&&th(n))||t.test(n):th(n)}function ca(n){for(var t in n)if(n.hasOwnProperty(t)&&n[t])return!1;return!0}function ih(n){return n.charCodeAt(0)>=768&&la.test(n)}function aa(n,t,i){for(;(i<0?t>0:t<n.length)&&ih(n.charAt(t));)t+=i;return t}function lf(n,t,i){for(var f,r,u=t>i?-1:1;;){if(t==i)return t;if(f=(t+i)/2,r=u<0?Math.ceil(f):Math.floor(f),r==t)return n(r)?t:i;n(r)?i=r:t=r+u}}function af(n,t,i){var f,r,u;for(iu=null,r=0;r<n.length;++r){if(u=n[r],u.from<t&&u.to>t)return r;u.to==t&&(u.from!=u.to&&"before"==i?f=r:iu=r);u.from==t&&(u.from!=u.to&&"before"!=i?f=r:iu=r)}return null!=f?f:iu}function hi(n,t){var i=n.order;return null==i&&(i=n.order=va(n.text,t)),i}function uh(n,t){return n._handlers&&n._handlers[t]||rh}function ct(n,t,i){var u,r,f;n.removeEventListener?n.removeEventListener(t,i,!1):n.detachEvent?n.detachEvent("on"+t,i):(u=n._handlers,r=u&&u[t],r&&(f=nt(r,i),f>-1&&(u[t]=r.slice(0,f).concat(r.slice(f+1)))))}function p(n,t){var r=uh(n,t),u,i;if(r.length)for(u=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,u)}function w(n,t,i){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),p(n,i||t.type,n,t),fh(t)||t.codemirrorIgnore}function ya(n){var i=n._handlers&&n._handlers.cursorActivity,r,t;if(i)for(r=n.curOp.cursorActivityHandlers||(n.curOp.cursorActivityHandlers=[]),t=0;t<i.length;++t)-1==nt(r,i[t])&&r.push(i[t])}function pt(n,t){return uh(n,t).length>0}function ru(n){n.prototype.on=function(n,t){r(this,n,t)};n.prototype.off=function(n,t){ct(this,n,t)}}function ut(n){n.preventDefault?n.preventDefault():n.returnValue=!1}function pa(n){n.stopPropagation?n.stopPropagation():n.cancelBubble=!0}function fh(n){return null!=n.defaultPrevented?n.defaultPrevented:0==n.returnValue}function vf(n){ut(n);pa(n)}function eh(n){return n.target||n.srcElement}function wa(n){var t=n.which;return null==t&&(1&n.button?t=1:2&n.button?t=3:4&n.button&&(t=2)),at&&n.ctrlKey&&1==t&&(t=3),t}function ek(n){var t,r;return null==oh&&(t=i("span","​"),ht(n,i("span",[t,document.createTextNode("x")])),0!=n.firstChild.offsetHeight&&(oh=t.offsetWidth<=1&&t.offsetHeight>2&&!(e&&l<8))),r=oh?i("span","​"):i("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px"),r.setAttribute("cm-text",""),r}function ok(n){if(null!=sh)return sh;var i=ht(n,document.createTextNode("AخA")),t=gr(i,0,1).getBoundingClientRect(),r=gr(i,1,2).getBoundingClientRect();return pi(n),!(!t||t.left==t.right)&&(sh=r.right-t.right<3)}function ck(n,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2));ah[n]=t}function eo(n){if("string"==typeof n&&uu.hasOwnProperty(n))n=uu[n];else if(n&&"string"==typeof n.name&&uu.hasOwnProperty(n.name)){var t=uu[n.name];"string"==typeof t&&(t={name:t});(n=sa(t,n)).name=t.name}else{if("string"==typeof n&&/^[\w\-]+\/[\w\-]+\+xml$/.test(n))return eo("application/xml");if("string"==typeof n&&/^[\w\-]+\/[\w\-]+\+json$/.test(n))return eo("application/json")}return"string"==typeof n?{name:n}:n||{name:"null"}}function vh(n,t){var f,i,u,r,e;if(t=eo(t),f=ah[t.name],!f)return vh(n,"text/plain");if(i=f(n,t),er.hasOwnProperty(t.name)){u=er[t.name];for(r in u)u.hasOwnProperty(r)&&(i.hasOwnProperty(r)&&(i["_"+r]=i[r]),i[r]=u[r])}if(i.name=t.name,t.helperType&&(i.helperType=t.helperType),t.modeProps)for(e in t.modeProps)i[e]=t.modeProps[e];return i}function lk(n,t){fr(t,er.hasOwnProperty(n)?er[n]:er[n]={})}function or(n,t){var r,u,i;if(!0===t)return t;if(n.copyState)return n.copyState(t);r={};for(u in t)i=t[u],i instanceof Array&&(i=i.concat([])),r[u]=i;return r}function yh(n,t){for(var i;n.innerMode&&(i=n.innerMode(t))&&i.mode!=n;)t=i.state,n=i.mode;return i||{mode:n,state:t}}function ka(n,t,i){return!n.startState||n.startState(t,i)}function t(n,t){var i,r,u,f;if((t-=n.first)<0||t>=n.size)throw new Error("There is no line "+(t+n.first)+" in the document.");for(i=n;!i.lines;)for(r=0;;++r){if(u=i.children[r],f=u.chunkSize(),t<f){i=u;break}t-=f}return i.lines[t]}function sr(n,t,i){var u=[],r=t.line;return n.iter(t.line,i.line+1,function(n){var f=n.text;r==i.line&&(f=f.slice(0,i.ch));r==t.line&&(f=f.slice(t.ch));u.push(f);++r}),u}function ph(n,t,i){var r=[];return n.iter(t,i,function(n){r.push(n.text)}),r}function ti(n,t){var r=t-n.height,i;if(r)for(i=n;i;i=i.parent)i.height+=r}function c(n){var r;if(null==n.parent)return null;for(var i=n.parent,u=nt(i.lines,n),t=i.parent;t;i=t,t=t.parent)for(r=0;t.children[r]!=i;++r)u+=t.children[r].chunkSize();return u+i.first}function hr(n,t){var f=n.first,r,u,e,i,o;n:do{for(r=0;r<n.children.length;++r){if(u=n.children[r],e=u.height,t<e){n=u;continue n}t-=e;f+=u.chunkSize()}return f}while(!n.lines);for(i=0;i<n.lines.length;++i){if(o=n.lines[i].height,t<o)break;t-=o}return f+i}function yf(n,t){return t>=n.first&&t<n.first+n.size}function wh(n,t){return String(n.lineNumberFormatter(t+n.firstLineNumber))}function n(t,i,r){if(void 0===r&&(r=null),!(this instanceof n))return new n(t,i,r);this.line=t;this.ch=i;this.sticky=r}function u(n,t){return n.line-t.line||n.ch-t.ch}function bh(n,t){return n.sticky==t.sticky&&0==u(n,t)}function kh(t){return n(t.line,t.ch)}function oo(n,t){return u(n,t)<0?t:n}function so(n,t){return u(n,t)<0?n:t}function da(n,t){return Math.max(n.first,Math.min(t,n.first+n.size-1))}function f(i,r){if(r.line<i.first)return n(i.first,0);var u=i.first+i.size-1;return r.line>u?n(u,t(i,u).text.length):function(t,i){var r=t.ch;return null==r||r>i?n(t.line,i):r<0?n(t.line,0):t}(r,t(i,r.line).text.length)}function ga(n,t){for(var r=[],i=0;i<t.length;i++)r[i]=f(n,t[i]);return r}function nv(n,t,i,r){var u=[n.state.modeGen],f={};fv(n,t.text,n.doc.mode,i,function(n,t){return u.push(n,t)},f,r);for(var o=i.state,s=function(r){i.baseTokens=u;var s=n.state.overlays[r],e=1,h=0;i.state=!0;fv(n,t.text,s.mode,i,function(n,t){for(var r,f,i=e;h<n;)r=u[e],r>n&&u.splice(e,1,n,u[e+1],r),e+=2,h=Math.min(n,r);if(t)if(s.opaque)u.splice(i,e-i,n,"overlay "+t),e=i+2;else for(;i<e;i+=2)f=u[i+1],u[i+1]=(f?f+" ":"")+"overlay "+t},f);i.state=o;i.baseTokens=null;i.baseTokenPos=1},e=0;e<n.state.overlays.length;++e)s(e);return{styles:u,classes:f.bgClass||f.textClass?f:null}}function tv(n,t,i){if(!t.styles||t.styles[0]!=n.state.modeGen){var r=wf(n,c(t)),u=t.text.length>n.options.maxHighlightLength&&or(n.doc.mode,r.state),f=nv(n,t,r);u&&(r.state=u);t.stateAfter=r.save(!u);t.styles=f.styles;f.classes?t.styleClasses=f.classes:t.styleClasses&&(t.styleClasses=null);i===n.doc.highlightFrontier&&(n.doc.modeFrontier=Math.max(n.doc.modeFrontier,++n.doc.highlightFrontier))}return t.styles}function wf(n,i,r){var u=n.doc,o=n.display;if(!u.mode.startState)return new kt(u,!0,i);var e=function(n,i,r){for(var s,e,h,c,o,f=n.doc,l=r?-1:i-(n.doc.mode.innerMode?1e3:100),u=i;u>l;--u){if(u<=f.first)return f.first;if(s=t(f,u-1),e=s.stateAfter,e&&(!r||u+(e instanceof pf?e.lookAhead:0)<=f.modeFrontier))return u;h=yt(s.text,null,n.options.tabSize);(null==o||c>h)&&(o=u-1,c=h)}return o}(n,i,r),s=e>u.first&&t(u,e-1).stateAfter,f=s?kt.fromSaved(u,s,e):new kt(u,ka(u.mode),e);return u.iter(e,i,function(t){dh(n,t.text,f);var r=f.line;t.stateAfter=r==i-1||r%5==0||r>=o.viewFrom&&r<o.viewTo?f.save():null;f.nextLine()}),r&&(u.modeFrontier=f.line),f}function dh(n,t,i,r){var f=n.doc.mode,u=new y(t,n.options.tabSize,i);for(u.start=u.pos=r||0,""==t&&iv(f,i.state);!u.eol();)gh(f,u,i.state),u.start=u.pos}function iv(n,t){if(n.blankLine)return n.blankLine(t);if(n.innerMode){var i=yh(n,t);return i.mode.blankLine?i.mode.blankLine(i.state):void 0}}function gh(n,t,i,r){for(var f,u=0;u<10;u++)if(r&&(r[0]=yh(n,i).mode),f=n.token(t,i),t.pos>t.start)return f;throw new Error("Mode "+n.name+" failed to advance stream.");}function rv(n,i,r,u){var h,c,o=n.doc,l=o.mode,a=t(o,(i=f(o,i)).line),s=wf(n,i.line,r),e=new y(a.text,n.options.tabSize,s);for(u&&(c=[]);(u||e.pos<i.ch)&&!e.eol();)e.start=e.pos,h=gh(l,e,s.state),u&&c.push(new nc(e,h,or(o.mode,s.state)));return u?c:new nc(e,h,s.state)}function uv(n,t){var i,r;if(n)for(;;){if(i=n.match(/(?:^|\s+)line-(background-)?(\S+)/),!i)break;n=n.slice(0,i.index)+n.slice(i.index+i[0].length);r=i[1]?"bgClass":"textClass";null==t[r]?t[r]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+i[2])}return n}function fv(n,t,i,r,u,f,e){var c=i.flattenSpans,a,p;null==c&&(c=n.options.flattenSpans);var s,h=0,l=null,o=new y(t,n.options.tabSize,r),v=n.options.addModeClass&&[null];for(""==t&&uv(iv(i,r.state),f);!o.eol();){if((o.pos>n.options.maxHighlightLength?(c=!1,e&&dh(n,t,r,o.pos),o.pos=t.length,s=null):s=uv(gh(i,o,r.state,v),f),v)&&(a=v[0].name,a&&(s="m-"+(s?a+" "+s:a))),!c||l!=s){for(;h<o.start;)u(h=Math.min(o.start,h+5e3),l);l=s}o.start=o.pos}for(;h<o.pos;)p=Math.min(o.pos,h+5e3),u(p,l),h=p}function ho(n,t,i){this.marker=n;this.from=t;this.to=i}function bf(n,t){var i,r;if(n)for(i=0;i<n.length;++i)if(r=n[i],r.marker==t)return r}function ak(n,t){for(var r,i=0;i<n.length;++i)n[i]!=t&&(r||(r=[])).push(n[i]);return r}function ic(n,i){var w,b,a,h,v,y,e,p,d,g,c,nt;if(i.full||(w=yf(n,i.from.line)&&t(n,i.from.line).markedSpans,b=yf(n,i.to.line)&&t(n,i.to.line).markedSpans,!w&&!b))return null;var k=i.from.ch,it=i.to.ch,tt=0==u(i.from,i.to),r=function(n,t,i){var e,f,r,u,o;if(n)for(f=0;f<n.length;++f)r=n[f],u=r.marker,null!=r.from&&!(u.inclusiveLeft?r.from<=t:r.from<t)&&(r.from!=t||"bookmark"!=u.type||i&&r.marker.insertLeft)||(o=null==r.to||(u.inclusiveRight?r.to>=t:r.to>t),(e||(e=[])).push(new ho(u,r.from,o?null:r.to)));return e}(w,k,tt),f=function(n,t,i){var e,f,r,u,o;if(n)for(f=0;f<n.length;++f)r=n[f],u=r.marker,(null==r.to||(u.inclusiveRight?r.to>=t:r.to>t)||r.from==t&&"bookmark"==u.type&&(!i||r.marker.insertLeft))&&(o=null==r.from||(u.inclusiveLeft?r.from<=t:r.from<t),(e||(e=[])).push(new ho(u,o?null:r.from-t,null==r.to?null:r.to-t)));return e}(b,it,tt),o=1==i.text.length,l=s(i.text).length+(o?k:0);if(r)for(a=0;a<r.length;++a)h=r[a],null==h.to&&(v=bf(f,h.marker),v?o&&(h.to=null==v.to?null:v.to+l):h.to=k);if(f)for(y=0;y<f.length;++y)e=f[y],null!=e.to&&(e.to+=l),null==e.from?bf(r,e.marker)||(e.from=l,o&&(r||(r=[])).push(e)):(e.from+=l,o&&(r||(r=[])).push(e));if(r&&(r=ev(r)),f&&f!=r&&(f=ev(f)),p=[r],!o){if(g=i.text.length-2,g>0&&r)for(c=0;c<r.length;++c)null==r[c].to&&(d||(d=[])).push(new ho(r[c].marker,null,null));for(nt=0;nt<g;++nt)p.push(d);p.push(f)}return p}function ev(n){for(var i,t=0;t<n.length;++t)i=n[t],null!=i.from&&i.from==i.to&&!1!==i.marker.clearWhenEmpty&&n.splice(t--,1);return n.length?n:null}function ov(n){var i=n.markedSpans,t;if(i){for(t=0;t<i.length;++t)i[t].marker.detachLine(n);n.markedSpans=null}}function sv(n,t){if(t){for(var i=0;i<t.length;++i)t[i].marker.attachLine(n);n.markedSpans=t}}function co(n){return n.inclusiveLeft?-1:0}function lo(n){return n.inclusiveRight?1:0}function rc(n,t){var i=n.lines.length-t.lines.length;if(0!=i)return i;var r=n.find(),f=t.find(),e=u(r.from,f.from)||co(n)-co(t);return e?-e:u(r.to,f.to)||lo(n)-lo(t)||t.id-n.id}function hv(n,t){var r,f=ii&&n.markedSpans,i,u;if(f)for(i=void 0,u=0;u<f.length;++u)(i=f[u]).marker.collapsed&&null==(t?i.from:i.to)&&(!r||rc(r,i.marker)<0)&&(r=i.marker);return r}function cv(n){return hv(n,!0)}function ao(n){return hv(n,!1)}function vk(n,t){var r,f=ii&&n.markedSpans,u,i;if(f)for(u=0;u<f.length;++u)i=f[u],i.marker.collapsed&&(null==i.from||i.from<t)&&(null==i.to||i.to>t)&&(!r||rc(r,i.marker)<0)&&(r=i.marker);return r}function lv(n,i,r,f,e){var v=t(n,i),l=ii&&v.markedSpans,h,o;if(l)for(h=0;h<l.length;++h)if(o=l[h],o.marker.collapsed){var s=o.marker.find(0),c=u(s.from,r)||co(o.marker)-co(e),a=u(s.to,f)||lo(o.marker)-lo(e);if(!(c>=0&&a<=0||c<=0&&a>=0)&&(c<=0&&(o.marker.inclusiveRight&&e.inclusiveLeft?u(s.to,r)>=0:u(s.to,r)>0)||c>=0&&(o.marker.inclusiveRight&&e.inclusiveLeft?u(s.from,f)<=0:u(s.from,f)<0)))return!0}}function ri(n){for(var t;t=cv(n);)n=t.find(-1,!0).line;return n}function uc(n,i){var r=t(n,i),u=ri(r);return r==u?i:c(u)}function av(n,i){if(i>n.lastLine())return i;var u,r=t(n,i);if(!bi(n,r))return i;for(;u=ao(r);)r=u.find(1,!0).line;return c(r)+1}function bi(n,t){var u=ii&&t.markedSpans,i,r;if(u)for(i=void 0,r=0;r<u.length;++r)if((i=u[r]).marker.collapsed&&(null==i.from||!i.marker.widgetNode&&0==i.from&&i.marker.inclusiveLeft&&fc(n,t,i)))return!0}function fc(n,t,i){var f,r,u;if(null==i.to)return f=i.marker.find(1,!0),fc(n,f.line,bf(f.line.markedSpans,i.marker));if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(r=void 0,u=0;u<t.markedSpans.length;++u)if((r=t.markedSpans[u]).marker.collapsed&&!r.marker.widgetNode&&r.from==i.to&&(null==r.to||r.to!=i.from)&&(r.marker.inclusiveLeft||i.marker.inclusiveRight)&&fc(n,t,r))return!0}function ci(n){for(var e,t,r,o,u=0,i=(n=ri(n)).parent,f=0;f<i.lines.length;++f){if(e=i.lines[f],e==n)break;u+=e.height}for(t=i.parent;t;t=(i=t).parent)for(r=0;r<t.children.length;++r){if(o=t.children[r],o==i)break;u+=o.height}return u}function vo(n){var r,i,t,u,f;if(0==n.height)return 0;for(i=n.text.length,t=n;r=cv(t);)u=r.find(0,!0),t=u.from.line,i+=u.from.ch-u.to.ch;for(t=n;r=ao(t);)f=r.find(0,!0),i-=t.text.length-f.from.ch,i+=(t=f.to.line).text.length-f.to.ch;return i}function ec(n){var i=n.display,r=n.doc;i.maxLine=t(r,r.first);i.maxLineLength=vo(i.maxLine);i.maxLineChanged=!0;r.iter(function(n){var t=vo(n);t>i.maxLineLength&&(i.maxLineLength=t,i.maxLine=n)})}function yk(n){n.parent=null;ov(n)}function pv(n,t){if(!n||/^\s*$/.test(n))return null;var i=t.addModeClass?yv:vv;return i[n]||(i[n]=n.replace(/\S+/g,"cm-$&"))}function wv(n,t){var o=nu("span",null,null,it?"padding-right: .1px":null),i={pre:nu("pre",[o],"CodeMirror-line"),content:o,col:0,pos:0,cm:n,trailingSpace:!1,splitSpaces:n.getOption("lineWrapping")},u,r,e,f;for(t.measure={},u=0;u<=(t.rest?t.rest.length:0);u++)r=u?t.rest[u-1]:t.line,e=void 0,i.pos=0,i.addToken=wk,ok(n.display.measure)&&(e=hi(r,n.doc.direction))&&(i.addToken=bk(i.addToken,e)),i.map=[],kk(r,i,tv(n,r,t!=n.display.externalMeasured&&c(r))),r.styleClasses&&(r.styleClasses.bgClass&&(i.bgClass=bs(r.styleClasses.bgClass,i.bgClass||"")),r.styleClasses.textClass&&(i.textClass=bs(r.styleClasses.textClass,i.textClass||""))),0==i.map.length&&i.map.push(0,0,i.content.appendChild(ek(n.display.measure))),0==u?(t.measure.map=i.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(i.map),(t.measure.caches||(t.measure.caches=[])).push({}));return it&&(f=i.content.lastChild,(/\bcm-tab\b/.test(f.className)||f.querySelector&&f.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")),p(n,"renderLine",n,t.line,i.pre),i.pre.className&&(i.textClass=bs(i.pre.className,i.textClass||"")),i}function pk(n){var t=i("span","•","cm-invalidchar");return t.title="\\u"+n.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function wk(n,t,r,u,f,o,s){var v,c,y,w,a,g,nt,b,tt,p;if(t){var h,k=n.splitSpaces?function(n,t){var r;if(n.length>1&&!/  /.test(n))return n;for(var u=t,f="",i=0;i<n.length;i++)r=n.charAt(i)," "==r&&u&&(i==n.length-1||32==n.charCodeAt(i+1))&&(r=" "),f+=r,u=" "==r;return f}(t,n.trailingSpace):t,d=n.cm.state.specialChars,it=!1;if(d.test(t))for(h=document.createDocumentFragment(),v=0;;){if(d.lastIndex=v,c=d.exec(t),y=c?c.index-v:t.length-v,y&&(w=document.createTextNode(k.slice(v,v+y)),e&&l<9?h.appendChild(i("span",[w])):h.appendChild(w),n.map.push(n.pos,n.pos+y,w),n.col+=y,n.pos+=y),!c)break;v+=y+1;a=void 0;"\t"==c[0]?(g=n.cm.options.tabSize,nt=g-n.col%g,(a=h.appendChild(i("span",nh(nt),"cm-tab"))).setAttribute("role","presentation"),a.setAttribute("cm-text","\t"),n.col+=nt):"\r"==c[0]||"\n"==c[0]?((a=h.appendChild(i("span","\r"==c[0]?"␍":"␤","cm-invalidchar"))).setAttribute("cm-text",c[0]),n.col+=1):((a=n.cm.options.specialCharPlaceholder(c[0])).setAttribute("cm-text",c[0]),e&&l<9?h.appendChild(i("span",[a])):h.appendChild(a),n.col+=1);n.map.push(n.pos,n.pos+1,a);n.pos++}else n.col+=t.length,h=document.createTextNode(k),n.map.push(n.pos,n.pos+t.length,h),e&&l<9&&(it=!0),n.pos+=t.length;if(n.trailingSpace=32==k.charCodeAt(t.length-1),r||u||f||it||o||s){if(b=r||"",u&&(b+=u),f&&(b+=f),tt=i("span",[h],b,o),s)for(p in s)s.hasOwnProperty(p)&&"style"!=p&&"class"!=p&&tt.setAttribute(p,s[p]);return n.content.appendChild(tt)}n.content.appendChild(h)}}function bk(n,t){return function(i,r,u,f,e,o,s){var h,a,c,l;for(u=u?u+" cm-force-border":"cm-force-border",h=i.pos,a=h+r.length;;){for(c=void 0,l=0;l<t.length&&!((c=t[l]).to>h&&c.from<=h);l++);if(c.to>=a)return n(i,r,u,f,e,o,s);n(i,r.slice(0,c.to-h),u,f,null,o,s);f=null;r=r.slice(c.to-h);h=c.to}}}function bv(n,t,i,r){var u=!r&&i.widgetNode;u&&n.map.push(n.pos,n.pos+t,u);!r&&n.cm.display.input.needsContentAttribute&&(u||(u=n.content.appendChild(document.createElement("span"))),u.setAttribute("cm-marker",i.id));u&&(n.cm.display.input.setUneditable(u),n.content.appendChild(u));n.pos+=t;n.trailingSpace=!1}function kk(n,t,i){var nt=n.markedSpans,tt=n.text,p=0,f,u,et,v,d,l,g,ot,y;if(nt)for(var it,a,w,b,k,e,h,rt=tt.length,r=0,st=1,s="",o=0;;){if(o==r){w=b=k=a="";h=null;e=null;o=1/0;for(var ut=[],c=void 0,ft=0;ft<nt.length;++ft)if(f=nt[ft],u=f.marker,"bookmark"==u.type&&f.from==r&&u.widgetNode)ut.push(u);else if(f.from<=r&&(null==f.to||f.to>r||u.collapsed&&f.to==r&&f.from==r)){if(null!=f.to&&f.to!=r&&o>f.to&&(o=f.to,b=""),u.className&&(w+=" "+u.className),u.css&&(a=(a?a+";":"")+u.css),u.startStyle&&f.from==r&&(k+=" "+u.startStyle),u.endStyle&&f.to==o&&(c||(c=[])).push(u.endStyle,f.to),u.title&&((h||(h={})).title=u.title),u.attributes)for(et in u.attributes)(h||(h={}))[et]=u.attributes[et];u.collapsed&&(!e||rc(e.marker,u)<0)&&(e=f)}else f.from>r&&o>f.from&&(o=f.from);if(c)for(v=0;v<c.length;v+=2)c[v+1]==o&&(b+=" "+c[v]);if(!e||e.from==r)for(d=0;d<ut.length;++d)bv(t,0,ut[d]);if(e&&(e.from||0)==r){if(bv(t,(null==e.to?rt+1:e.to)-r,e.marker,null==e.from),null==e.to)return;e.to==r&&(e=!1)}}if(r>=rt)break;for(l=Math.min(rt,o);;){if(s){if(g=r+s.length,e||(ot=g>l?s.slice(0,l-r):s,t.addToken(t,ot,it?it+w:w,k,r+ot.length==o?b:"",a,h)),g>=l){s=s.slice(l-r);r=l;break}r=g;k=""}s=tt.slice(p,p=i[st++]);it=pv(i[st++],t.cm.options)}}else for(y=1;y<i.length;y+=2)t.addToken(t,tt.slice(p,p=i[y]),pv(i[y+1],t.cm.options))}function kv(n,t,i){this.line=t;this.rest=function(n){for(var i,t;i=ao(n);)n=i.find(1,!0).line,(t||(t=[])).push(n);return t}(t);this.size=this.rest?c(s(this.rest))-i+1:1;this.node=this.text=null;this.hidden=bi(n,t)}function yo(n,i,r){for(var o,e,f=[],u=i;u<r;u=o)e=new kv(n.doc,t(n.doc,u),u),o=u+e.size,f.push(e);return f}function b(n,t){var u=uh(n,t),i,f,e,r;if(u.length)for(f=Array.prototype.slice.call(arguments,2),lr?i=lr.delayedCallbacks:fu?i=fu:(i=fu=[],setTimeout(dk,0)),e=function(n){i.push(function(){return u[n].apply(null,f)})},r=0;r<u.length;++r)e(r)}function dk(){var t=fu,n;for(fu=null,n=0;n<t.length;++n)t[n]()}function dv(n,t,i,r){for(var u,f=0;f<t.changes.length;f++)u=t.changes[f],"text"==u?gk(n,t):"gutter"==u?ny(n,t,i,r):"class"==u?oc(n,t):"widget"==u&&nd(n,t,r);t.changes=null}function kf(n){return n.node==n.text&&(n.node=i("div",null,null,"position: relative"),n.text.parentNode&&n.text.parentNode.replaceChild(n.node,n.text),n.node.appendChild(n.text),e&&l<8&&(n.node.style.zIndex=2)),n.node}function gv(n,t){var i=n.display.externalMeasured;return i&&i.line==t.line?(n.display.externalMeasured=null,t.measure=i.measure,i.built):wv(n,t)}function gk(n,t){var r=t.text.className,i=gv(n,t);t.text==t.node&&(t.node=i.pre);t.text.parentNode.replaceChild(i.pre,t.text);t.text=i.pre;i.bgClass!=t.bgClass||i.textClass!=t.textClass?(t.bgClass=i.bgClass,t.textClass=i.textClass,oc(n,t)):r&&(t.text.className=r)}function oc(n,t){!function(n,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass,u;(r&&(r+=" CodeMirror-linebackground"),t.background)?r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null):r&&(u=kf(t),t.background=u.insertBefore(i("div",null,r),u.firstChild),n.display.input.setUneditable(t.background))}(n,t);t.line.wrapClass?kf(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function ny(n,t,r,u){var c,f,l,e,s,o,h;if((t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass)&&(c=kf(t),t.gutterBackground=i("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(n.options.fixedGutter?u.fixedPos:-u.gutterTotalWidth)+"px; width: "+u.gutterTotalWidth+"px"),n.display.input.setUneditable(t.gutterBackground),c.insertBefore(t.gutterBackground,t.text)),f=t.line.gutterMarkers,(n.options.lineNumbers||f)&&(l=kf(t),e=t.gutter=i("div",null,"CodeMirror-gutter-wrapper","left: "+(n.options.fixedGutter?u.fixedPos:-u.gutterTotalWidth)+"px"),e.setAttribute("aria-hidden","true"),n.display.input.setUneditable(e),l.insertBefore(e,t.text),t.line.gutterClass&&(e.className+=" "+t.line.gutterClass),!n.options.lineNumbers||f&&f["CodeMirror-linenumbers"]||(t.lineNumber=e.appendChild(i("div",wh(n.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+u.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+n.display.lineNumInnerWidth+"px"))),f))for(s=0;s<n.display.gutterSpecs.length;++s)o=n.display.gutterSpecs[s].className,h=f.hasOwnProperty(o)&&f[o],h&&e.appendChild(i("div",[h],"CodeMirror-gutter-elt","left: "+u.gutterLeft[o]+"px; width: "+u.gutterWidth[o]+"px"))}function nd(n,t,i){t.alignable&&(t.alignable=null);for(var f=dr("CodeMirror-linewidget"),r=t.node.firstChild,u=void 0;r;r=u)u=r.nextSibling,f.test(r.className)&&t.node.removeChild(r);ty(n,t,i)}function td(n,t,i,r){var u=gv(n,t);return t.text=t.node=u.pre,u.bgClass&&(t.bgClass=u.bgClass),u.textClass&&(t.textClass=u.textClass),oc(n,t),ny(n,t,i,r),ty(n,t,r),t.node}function ty(n,t,i){if(iy(n,t.line,t,i,!0),t.rest)for(var r=0;r<t.rest.length;r++)iy(n,t.rest[r],t,i,!1)}function iy(n,t,r,u,f){var e,o;if(t.widgets)for(var h=kf(r),s=0,c=t.widgets;s<c.length;++s)e=c[s],o=i("div",[e.node],"CodeMirror-linewidget"+(e.className?" "+e.className:"")),e.handleMouseEvents||o.setAttribute("cm-ignore-events","true"),id(e,o,r,u),n.display.input.setUneditable(o),f&&e.above?h.insertBefore(o,r.gutter||r.text):h.appendChild(o),b(e,"redraw")}function id(n,t,i,r){if(n.noHScroll){(i.alignable||(i.alignable=[])).push(t);var u=r.wrapperWidth;t.style.left=r.fixedPos+"px";n.coverGutter||(u-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px");t.style.width=u+"px"}n.coverGutter&&(t.style.zIndex=5,t.style.position="relative",n.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function df(n){var t,r;return null!=n.height?n.height:(t=n.doc.cm,!t)?0:(wi(document.body,n.node)||(r="position: relative;",n.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),n.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),ht(t.display.measure,i("div",[n.node],null,r))),n.height=n.node.parentNode.offsetHeight)}function li(n,t){for(var i=eh(t);i!=n.wrapper;i=i.parentNode)if(!i||1==i.nodeType&&"true"==i.getAttribute("cm-ignore-events")||i.parentNode==n.sizer&&i!=n.mover)return!0}function po(n){return n.lineSpace.offsetTop}function sc(n){return n.mover.offsetHeight-n.lineSpace.offsetHeight}function ry(n){if(n.cachedPaddingH)return n.cachedPaddingH;var r=ht(n.measure,i("pre","x","CodeMirror-line-like")),u=window.getComputedStyle?window.getComputedStyle(r):r.currentStyle,t={left:parseInt(u.paddingLeft),right:parseInt(u.paddingRight)};return isNaN(t.left)||isNaN(t.right)||(n.cachedPaddingH=t),t}function ui(n){return 50-n.display.nativeBarWidth}function ar(n){return n.display.scroller.clientWidth-ui(n)-n.display.barWidth}function hc(n){return n.display.scroller.clientHeight-ui(n)-n.display.barHeight}function uy(n,t,i){var r,u;if(n.line==t)return{map:n.measure.map,cache:n.measure.cache};for(r=0;r<n.rest.length;r++)if(n.rest[r]==t)return{map:n.measure.maps[r],cache:n.measure.caches[r]};for(u=0;u<n.rest.length;u++)if(c(n.rest[u])>i)return{map:n.measure.maps[u],cache:n.measure.caches[u],before:!0}}function fy(n,t,i,r){return fi(n,eu(n,t),i,r)}function cc(n,t){if(t>=n.display.viewFrom&&t<n.display.viewTo)return n.display.view[pr(n,t)];var i=n.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function eu(n,t){var u=c(t),i=cc(n,u),r;return i&&!i.text?i=null:i&&i.changes&&(dv(n,i,u,bc(n)),n.curOp.forceUpdate=!0),i||(i=function(n,t){var u=c(t=ri(t)),i=n.display.externalMeasured=new kv(n.doc,t,u),r;return i.lineN=u,r=i.built=wv(n,i),i.text=r.pre,ht(n.display.lineMeasure,r.pre),i}(n,t)),r=uy(i,t,u),{line:t,view:i,rect:null,map:r.map,cache:r.cache,before:r.before,hasHeights:!1}}function fi(n,t,r,u,f){t.before&&(r=-1);var o,s=r+(u||"");return t.cache.hasOwnProperty(s)?o=t.cache[s]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(function(n,t,i){var f=n.options.lineWrapping,h=f&&ar(n),e,u,r,o,s;if(!t.measure.heights||f&&t.measure.width!=h){if(e=t.measure.heights=[],f)for(t.measure.width=h,u=t.text.firstChild.getClientRects(),r=0;r<u.length-1;r++)o=u[r],s=u[r+1],Math.abs(o.bottom-s.bottom)>2&&e.push((o.bottom+s.top)/2-i.top);e.push(i.bottom-i.top)}}(n,t.view,t.rect),t.hasHeights=!0),(o=function(n,t,r,u){var f,o=ey(t.map,r,u),h=o.node,s=o.start,c=o.end,y=o.collapse,b,k,a;if(3==h.nodeType){for(b=0;b<4;b++){for(;s&&ih(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+c<o.coverEnd&&ih(t.line.text.charAt(o.coverStart+c));)++c;if((f=e&&l<9&&0==s&&c==o.coverEnd-o.coverStart?h.parentNode.getBoundingClientRect():rd(gr(h,s,c).getClientRects(),u)).left||f.right||0==s)break;c=s;s-=1;y="right"}e&&l<11&&(f=function(n,t){if(!window.screen||null==screen.logicalXDPI||screen.logicalXDPI==screen.deviceXDPI||!function(n){if(null!=lh)return lh;var t=ht(n,i("span","x")),r=t.getBoundingClientRect(),u=gr(t,0,1).getBoundingClientRect();return lh=Math.abs(r.left-u.left)>1}(n))return t;var r=screen.logicalXDPI/screen.deviceXDPI,u=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*u,bottom:t.bottom*u}}(n.display.measure,f))}else s>0&&(y=u="right"),f=n.options.lineWrapping&&(k=h.getClientRects()).length>1?k["right"==u?k.length-1:0]:h.getBoundingClientRect();e&&l<9&&!s&&(!f||!f.left&&!f.right)&&(a=h.parentNode.getClientRects()[0],f=a?{left:a.left,right:a.left+su(n.display),top:a.top,bottom:a.bottom}:lc);for(var d=f.top-t.rect.top,g=f.bottom-t.rect.top,nt=(d+g)/2,p=t.view.measure.heights,v=0;v<p.length-1&&!(nt<p[v]);v++);var tt=v?p[v-1]:0,it=p[v],w={left:("right"==y?f.right:f.left)-t.rect.left,right:("left"==y?f.left:f.right)-t.rect.left,top:tt,bottom:it};return f.left||f.right||(w.bogus=!0),n.options.singleCursorHeightPerLine||(w.rtop=d,w.rbottom=g),w}(n,t,r,u)).bogus||(t.cache[s]=o)),{left:o.left,right:o.right,top:f?o.rtop:o.top,bottom:f?o.rbottom:o.bottom}}function ey(n,t,i){for(var s,f,h,o,e,u,r=0;r<n.length;r+=3)if(e=n[r],u=n[r+1],t<e?(f=0,h=1,o="left"):t<u?h=1+(f=t-e):(r==n.length-3||t==u&&n[r+3]>t)&&(f=(h=u-e)-1,t>=u&&(o="right")),null!=f){if(s=n[r+2],e==u&&i==(s.insertLeft?"left":"right")&&(o=i),"left"==i&&0==f)for(;r&&n[r-2]==n[r-3]&&n[r-1].insertLeft;)s=n[2+(r-=3)],o="left";if("right"==i&&f==u-e)for(;r<n.length-3&&n[r+3]==n[r+4]&&!n[r+5].insertLeft;)s=n[(r+=3)+2],o="right";break}return{node:s,start:f,end:h,collapse:o,coverStart:e,coverEnd:u}}function rd(n,t){var i=lc,r,u;if("left"==t)for(r=0;r<n.length&&(i=n[r]).left==i.right;r++);else for(u=n.length-1;u>=0&&(i=n[u]).left==i.right;u--);return i}function oy(n){if(n.measure&&(n.measure.cache={},n.measure.heights=null,n.rest))for(var t=0;t<n.rest.length;t++)n.measure.caches[t]={}}function sy(n){n.display.externalMeasure=null;pi(n.display.lineMeasure);for(var t=0;t<n.display.view.length;t++)oy(n.display.view[t])}function gf(n){sy(n);n.display.cachedCharWidth=n.display.cachedTextHeight=n.display.cachedPaddingH=null;n.options.lineWrapping||(n.display.maxLineChanged=!0);n.display.lineNumChars=null}function hy(){return ge&&to?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function cy(){return ge&&to?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ac(n){var i=0,t;if(n.widgets)for(t=0;t<n.widgets.length;++t)n.widgets[t].above&&(i+=df(n.widgets[t]));return i}function wo(n,t,i,r,u){var e,f,o,s;return(u||(e=ac(t),i.top+=e,i.bottom+=e),"line"==r)?i:(r||(r="local"),f=ci(t),("local"==r?f+=po(n.display):f-=n.display.viewOffset,"page"==r||"window"==r)&&(o=n.display.lineSpace.getBoundingClientRect(),f+=o.top+("window"==r?0:cy()),s=o.left+("window"==r?0:hy()),i.left+=s,i.right+=s),i.top+=f,i.bottom+=f,i)}function ly(n,t,i){var r,u,f,e;return"div"==i?t:(r=t.left,u=t.top,"page"==i?(r-=hy(),u-=cy()):"local"!=i&&i||(f=n.display.sizer.getBoundingClientRect(),r+=f.left,u+=f.top),e=n.display.lineSpace.getBoundingClientRect(),{left:r-e.left,top:u-e.top})}function vc(n,i,r,u,f){return u||(u=t(n.doc,i.line)),wo(n,u,fy(n,u,i.ch,f),r)}function dt(n,i,r,u,f,e){function c(t,i){var o=fi(n,f,t,i?"right":"left",e);return i?o.left=o.right:o.right=o.left,wo(n,u,o,r)}function l(n,t,i){return c(i?n-1:n,1==h[t].level!=i)}u=u||t(n.doc,i.line);f||(f=eu(n,u));var h=hi(u,n.doc.direction),o=i.ch,s=i.sticky;if(o>=u.text.length?(o=u.text.length,s="before"):o<=0&&(o=0,s="after"),!h)return c("before"==s?o-1:o,"before"==s);var y=af(h,o,s),a=iu,v=l(o,y,"before"==s);return null!=a&&(v.other=l(o,a,"before"!=s)),v}function ay(n,i){var r=0,u,e;return i=f(n.doc,i),n.options.lineWrapping||(r=su(n.display)*i.ch),u=t(n.doc,i.line),e=ci(u)+po(n.display),{left:r,right:r,top:e,bottom:e+u.height}}function yc(t,i,r,u,f){var e=n(t,i,r);return e.xRel=f,u&&(e.outside=u),e}function pc(n,i,r){var u=n.doc,f,h,o,e,c,s;if((r+=n.display.viewOffset)<0)return yc(u.first,0,null,-1,-1);if(f=hr(u,r),h=u.first+u.size-1,f>h)return yc(u.first+u.size-1,t(u,h).text.length,null,1,1);for(i<0&&(i=0),o=t(u,f);;){if(e=ud(n,o,f,i,r),c=vk(o,e.ch+(e.xRel>0||e.outside>0?1:0)),!c)return e;if(s=c.find(1),s.line==f)return s;o=t(u,f=s.line)}}function vy(n,t,i,r){r-=ac(t);var u=t.text.length,f=lf(function(t){return fi(n,i,t-1).bottom<=r},u,0);return{begin:f,end:u=lf(function(t){return fi(n,i,t).top>r},f,u)}}function yy(n,t,i,r){return i||(i=eu(n,t)),vy(n,t,i,wo(n,t,fi(n,i,r),"line").top)}function wc(n,t,i,r){return!(n.bottom<=i)&&(n.top>i||(r?n.left:n.right)>t)}function ud(t,i,r,u,f){var s,b,k,a;f-=ci(i);var c=eu(t,i),v=ac(i),y=0,p=i.text.length,o=!0,d=hi(i,t.doc.direction);d&&(s=(t.options.lineWrapping?ed:fd)(t,i,r,c,d,u,f),y=(o=1!=s.level)?s.from:s.to-1,p=o?s.to:s.from-1);var w,l,g=null,h=null,e=lf(function(n){var i=fi(t,c,n);return i.top+=v,i.bottom+=v,!!wc(i,u,f,!1)&&(i.top<=f&&i.left<=u&&(g=n,h=i),!0)},y,p),nt=!1;return h?(b=u-h.left<h.right-u,k=b==o,e=g+(k?0:1),l=k?"after":"before",w=b?h.left:h.right):(o||e!=p&&e!=y||e++,l=0==e?"after":e==i.text.length?"before":fi(t,c,e-(o?1:0)).bottom+v<=f==o?"after":"before",a=dt(t,n(r,e,l),"line",i,c),w=a.left,nt=f<a.top?-1:f>=a.bottom?1:0),yc(r,e=aa(i.text,e,1),l,nt,u-w)}function fd(t,i,r,u,f,e,o){var h=lf(function(s){var h=f[s],c=1!=h.level;return wc(dt(t,n(r,c?h.to:h.from,c?"before":"after"),"line",i,u),e,o,!0)},0,f.length-1),s=f[h],c,l;return h>0&&(c=1!=s.level,l=dt(t,n(r,c?s.from:s.to,c?"after":"before"),"line",i,u),wc(l,e,o,!0)&&l.top>o&&(s=f[h-1])),s}function ed(n,t,i,r,u,f,e){var y=vy(n,t,r,e),c=y.begin,h=y.end,s,l,v;/\s/.test(t.text.charAt(h-1))&&h--;for(var o=null,p=null,a=0;a<u.length;a++)s=u[a],s.from>=h||s.to<=c||(l=fi(n,r,1!=s.level?Math.min(h,s.to)-1:Math.max(c,s.from)).right,v=l<f?f-l+1e9:l-f,(!o||p>v)&&(o=s,p=v));return o||(o=u[u.length-1]),o.from<c&&(o={from:c,to:o.to,level:o.level}),o.to>h&&(o={from:o.from,to:h,level:o.level}),o}function ou(n){var r,t;if(null!=n.cachedTextHeight)return n.cachedTextHeight;if(null==vr){for(vr=i("pre",null,"CodeMirror-line-like"),r=0;r<49;++r)vr.appendChild(document.createTextNode("x")),vr.appendChild(i("br"));vr.appendChild(document.createTextNode("x"))}return ht(n.measure,vr),t=vr.offsetHeight/50,t>3&&(n.cachedTextHeight=t),pi(n.measure),t||1}function su(n){var r,f,u,t;return null!=n.cachedCharWidth?n.cachedCharWidth:(r=i("span","xxxxxxxxxx"),f=i("pre",[r],"CodeMirror-line-like"),ht(n.measure,f),u=r.getBoundingClientRect(),t=(u.right-u.left)/10,t>2&&(n.cachedCharWidth=t),t||10)}function bc(n){for(var r,i=n.display,u={},f={},o=i.gutters.clientLeft,t=i.gutters.firstChild,e=0;t;t=t.nextSibling,++e)r=n.display.gutterSpecs[e].className,u[r]=t.offsetLeft+t.clientLeft+o,f[r]=t.clientWidth;return{fixedPos:kc(i),gutterTotalWidth:i.gutters.offsetWidth,gutterLeft:u,gutterWidth:f,wrapperWidth:i.wrapper.clientWidth}}function kc(n){return n.scroller.getBoundingClientRect().left-n.sizer.getBoundingClientRect().left}function py(n){var t=ou(n.display),i=n.options.lineWrapping,r=i&&Math.max(5,n.display.scroller.clientWidth/su(n.display)-3);return function(u){var e,f;if(bi(n.doc,u))return 0;if(e=0,u.widgets)for(f=0;f<u.widgets.length;f++)u.widgets[f].height&&(e+=u.widgets[f].height);return i?e+(Math.ceil(u.text.length/r)||1)*t:e+t}}function dc(n){var t=n.doc,i=py(n);t.iter(function(n){var t=i(n);t!=n.height&&ti(n,t)})}function yr(i,r,u,f){var a=i.display,s,c,h,o,e,l;if(!u&&"true"==eh(r).getAttribute("cm-not-content"))return null;h=a.lineSpace.getBoundingClientRect();try{s=r.clientX-h.left;c=r.clientY-h.top}catch(i){return null}return e=pc(i,s,c),f&&e.xRel>0&&(o=t(i.doc,e.line).text).length==e.ch&&(l=yt(o,o.length,i.options.tabSize)-o.length,e=n(e.line,Math.max(0,Math.round((s-ry(i.display).left)/su(i.display))-l))),e}function pr(n,t){if(t>=n.display.viewTo||(t-=n.display.viewFrom)<0)return null;for(var r=n.display.view,i=0;i<r.length;i++)if((t-=r[i].size)<0)return i}function ft(n,t,i,r){var u,e,o,s,h,f;null==t&&(t=n.doc.first);null==i&&(i=n.doc.first+n.doc.size);r||(r=0);u=n.display;(r&&i<u.viewTo&&(null==u.updateLineNumbers||u.updateLineNumbers>t)&&(u.updateLineNumbers=t),n.curOp.viewChanged=!0,t>=u.viewTo)?ii&&uc(n.doc,t)<u.viewTo&&di(n):i<=u.viewFrom?ii&&av(n.doc,i+r)>u.viewFrom?di(n):(u.viewFrom+=r,u.viewTo+=r):t<=u.viewFrom&&i>=u.viewTo?di(n):t<=u.viewFrom?(e=bo(n,i,i+r,1),e?(u.view=u.view.slice(e.index),u.viewFrom=e.lineN,u.viewTo+=r):di(n)):i>=u.viewTo?(o=bo(n,t,t,-1),o?(u.view=u.view.slice(0,o.index),u.viewTo=o.lineN):di(n)):(s=bo(n,t,t,-1),h=bo(n,i,i+r,1),s&&h?(u.view=u.view.slice(0,s.index).concat(yo(n,s.lineN,h.lineN)).concat(u.view.slice(h.index)),u.viewTo+=r):di(n));f=u.externalMeasured;f&&(i<f.lineN?f.lineN+=r:t<f.lineN+f.size&&(u.externalMeasured=null))}function ki(n,t,i){var r,u,f,e;n.curOp.viewChanged=!0;r=n.display;u=n.display.externalMeasured;(u&&t>=u.lineN&&t<u.lineN+u.size&&(r.externalMeasured=null),t<r.viewFrom||t>=r.viewTo)||(f=r.view[pr(n,t)],null!=f.node&&(e=f.changes||(f.changes=[]),-1==nt(e,i)&&e.push(i)))}function di(n){n.display.viewFrom=n.display.viewTo=n.doc.first;n.display.view=[];n.display.viewOffset=0}function bo(n,t,i,r){var o,u=pr(n,t),f=n.display.view,e,s;if(!ii||i==n.doc.first+n.doc.size)return{index:u,lineN:i};for(e=n.display.viewFrom,s=0;s<u;s++)e+=f[s].size;if(e!=t){if(r>0){if(u==f.length-1)return null;o=e+f[u].size-t;u++}else o=e-t;t+=o;i+=o}for(;uc(n.doc,i)!=i;){if(u==(r<0?0:f.length-1))return null;i+=r*f[u-(r<0?1:0)].size;u+=r}return{index:u,lineN:i}}function wy(n){for(var t,r=n.display.view,u=0,i=0;i<r.length;i++)t=r[i],t.hidden||t.node&&!t.changes||++u;return u}function ne(n){n.display.input.showSelection(n.display.input.prepareSelection())}function by(n,t){var i,e;void 0===t&&(t=!0);for(var u=n.doc,f={},o=f.cursors=document.createDocumentFragment(),s=f.selection=document.createDocumentFragment(),r=0;r<u.sel.ranges.length;r++)(t||r!=u.sel.primIndex)&&(i=u.sel.ranges[r],i.from().line>=n.display.viewTo||i.to().line<n.display.viewFrom||(e=i.empty(),(e||n.options.showCursorWhenSelecting)&&ky(n,i.head,o),e||od(n,i,s)));return f}function ky(n,t,r){var u=dt(n,t,"div",null,null,!n.options.singleCursorHeightPerLine),e=r.appendChild(i("div"," ","CodeMirror-cursor")),f;(e.style.left=u.left+"px",e.style.top=u.top+"px",e.style.height=Math.max(0,u.bottom-u.top)*n.options.cursorHeight+"px",u.other)&&(f=r.appendChild(i("div"," ","CodeMirror-cursor CodeMirror-secondarycursor")),f.style.display="",f.style.left=u.other.left+"px",f.style.top=u.other.top+"px",f.style.height=.85*(u.other.bottom-u.other.top)+"px")}function ko(n,t){return n.top-t.top||n.left-t.left}function od(r,u,f){function h(n,t,r,u){t<0&&(t=0);t=Math.round(t);u=Math.round(u);k.appendChild(i("div",null,"CodeMirror-selected","position: absolute; left: "+n+"px;\n                             top: "+t+"px; width: "+(null==r?l-n:r)+"px;\n                             height: "+(u-t)+"px"))}function p(i,u,f){function p(t,u){return vc(r,n(i,t),"div",a,u)}function y(n,t,i){var u=yy(r,a,null,n),f="ltr"==t==("after"==i)?"left":"right";return p("after"==i?u.begin:u.end-(/\s/.test(a.text.charAt(u.end-1))?2:1),f)[f]}var o,c,a=t(v,i),b=a.text.length,w=hi(a,v.direction);return function(n,t,i,r){var e,f,u;if(!n)return r(t,i,"ltr",0);for(e=!1,f=0;f<n.length;++f)u=n[f],(u.from<i&&u.to>t||t==i&&u.to==t)&&(r(Math.max(u.from,t),Math.min(u.to,i),1==u.level?"rtl":"ltr",f),e=!0);e||r(t,i,"ltr")}(w,u||0,null==f?b:f,function(n,t,i,r){var k="ltr"==i,a=p(n,k?"left":"right"),v=p(t-1,k?"right":"left"),d=null==u&&0==n,g=null==f&&t==b,it=0==r,rt=!w||r==w.length-1,nt,ut,tt,ft;if(v.top-a.top<=3){var ot=(e?g:d)&&rt,et=(e?d:g)&&it?s:(k?a:v).left,st=ot?l:(k?v:a).right;h(et,a.top,st-et,a.bottom)}else k?(nt=e&&d&&it?s:a.left,ut=e?l:y(n,i,"before"),tt=e?s:y(t,i,"after"),ft=e&&g&&rt?l:v.right):(nt=e?y(n,i,"before"):s,ut=!e&&d&&it?l:a.right,tt=!e&&g&&rt?s:v.left,ft=e?y(t,i,"after"):l),h(nt,a.top,ut-nt,a.bottom),a.bottom<v.top&&h(s,a.bottom,null,v.top),h(tt,v.top,ft-tt,v.bottom);(!o||ko(a,o)<0)&&(o=a);ko(v,o)<0&&(o=v);(!c||ko(a,c)<0)&&(c=a);ko(v,c)<0&&(c=v)}),{start:o,end:c}}var b=r.display,v=r.doc,k=document.createDocumentFragment(),d=ry(r.display),s=d.left,l=Math.max(b.sizerWidth,ar(r)-b.sizer.offsetLeft)-d.right,e="ltr"==v.direction,a=u.from(),y=u.to();if(a.line==y.line)p(a.line,a.ch,y.ch);else{var g=t(v,a.line),nt=t(v,y.line),w=ri(g)==ri(nt),o=p(a.line,a.ch,w?g.text.length+1:null).end,c=p(y.line,w?0:null,y.ch).start;w&&(o.top<c.top-2?(h(o.right,o.top,null,o.bottom),h(s,c.top,c.left,c.bottom)):h(o.right,o.top,c.left-o.right,o.bottom));o.bottom<c.top&&h(s,o.bottom,null,c.top)}f.appendChild(k)}function gc(n){var t,i;n.state.focused&&(t=n.display,clearInterval(t.blinker),i=!0,t.cursorDiv.style.visibility="",n.options.cursorBlinkRate>0?t.blinker=setInterval(function(){n.hasFocus()||hu(n);t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},n.options.cursorBlinkRate):n.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden"))}function dy(n){n.hasFocus()||(n.display.input.focus(),n.state.focused||tl(n))}function nl(n){n.state.delayingBlurEvent=!0;setTimeout(function(){n.state.delayingBlurEvent&&(n.state.delayingBlurEvent=!1,n.state.focused&&hu(n))},100)}function tl(n,t){n.state.delayingBlurEvent&&!n.state.draggingText&&(n.state.delayingBlurEvent=!1);"nocursor"!=n.options.readOnly&&(n.state.focused||(p(n,"focus",n,t),n.state.focused=!0,ur(n.display.wrapper,"CodeMirror-focused"),n.curOp||n.display.selForContextMenu==n.doc.sel||(n.display.input.reset(),it&&setTimeout(function(){return n.display.input.reset(!0)},20)),n.display.input.receivedFocus()),gc(n))}function hu(n,t){n.state.delayingBlurEvent||(n.state.focused&&(p(n,"blur",n,t),n.state.focused=!1,yi(n.display.wrapper,"CodeMirror-focused")),clearInterval(n.display.blinker),setTimeout(function(){n.state.focused||(n.display.shift=!1)},150))}function go(n){for(var h,r,c,u,a,f=n.display,v=f.lineDiv.offsetTop,o=0;o<f.view.length;o++){var t=f.view[o],y=n.options.lineWrapping,i=void 0,s=0;if(!t.hidden){if(e&&l<8?(h=t.node.offsetTop+t.node.offsetHeight,i=h-v,v=h):(r=t.node.getBoundingClientRect(),i=r.bottom-r.top,!y&&t.text.firstChild&&(s=t.text.firstChild.getBoundingClientRect().right-r.left-1)),c=t.line.height-i,(c>.005||c<-.005)&&(ti(t.line,i),gy(t.line),t.rest))for(u=0;u<t.rest.length;u++)gy(t.rest[u]);s>n.display.sizerWidth&&(a=Math.ceil(s/su(n.display)),a>n.display.maxLineLength&&(n.display.maxLineLength=a,n.display.maxLine=t.line,n.display.maxLineChanged=!0))}}}function gy(n){var t,i,r;if(n.widgets)for(t=0;t<n.widgets.length;++t)i=n.widgets[t],r=i.node.parentNode,r&&(i.height=r.offsetHeight)}function ns(n,i,r){var f=r&&null!=r.top?Math.max(0,r.top):n.scroller.scrollTop,o,s;f=Math.floor(f-po(n));var h=r&&null!=r.bottom?r.bottom:f+n.wrapper.clientHeight,u=hr(i,f),e=hr(i,h);return r&&r.ensure&&(o=r.ensure.from.line,s=r.ensure.to.line,o<u?(u=o,e=hr(i,ci(t(i,o))+n.wrapper.clientHeight)):Math.min(s,i.lastLine())>=e&&(u=hr(i,ci(t(i,s))-n.wrapper.clientHeight),e=s)),{from:u,to:Math.max(e,u+1)}}function il(n,t){var r=n.display,h=ou(n.display),o;t.top<0&&(t.top=0);var e=n.curOp&&null!=n.curOp.scrollTop?n.curOp.scrollTop:r.scroller.scrollTop,u=hc(n),i={};t.bottom-t.top>u&&(t.bottom=t.top+u);var c=n.doc.height+sc(r),v=t.top<h,y=t.bottom>c-h;t.top<e?i.scrollTop=v?0:t.top:t.bottom>e+u&&(o=Math.min(t.top,(y?c:t.bottom)-u),o!=e&&(i.scrollTop=o));var l=n.options.fixedGutter?0:r.gutters.offsetWidth,a=n.curOp&&null!=n.curOp.scrollLeft?n.curOp.scrollLeft:r.scroller.scrollLeft-l,f=ar(n)-r.gutters.offsetWidth,s=t.right-t.left>f;return s&&(t.right=t.left+f),t.left<10?i.scrollLeft=0:t.left<a?i.scrollLeft=Math.max(0,t.left+l-(s?0:10)):t.right>f+a-3&&(i.scrollLeft=t.right+(s?0:10)-f),i}function rl(n,t){null!=t&&(ts(n),n.curOp.scrollTop=(null==n.curOp.scrollTop?n.doc.scrollTop:n.curOp.scrollTop)+t)}function cu(n){ts(n);var t=n.getCursor();n.curOp.scrollToPos={from:t,to:t,margin:n.options.cursorScrollMargin}}function te(n,t,i){null==t&&null==i||ts(n);null!=t&&(n.curOp.scrollLeft=t);null!=i&&(n.curOp.scrollTop=i)}function ts(n){var t=n.curOp.scrollToPos;t&&(n.curOp.scrollToPos=null,np(n,ay(n,t.from),ay(n,t.to),t.margin))}function np(n,t,i,r){var u=il(n,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});te(n,u.scrollLeft,u.scrollTop)}function ie(n,t){Math.abs(n.doc.scrollTop-t)<2||(oi||el(n,{top:t}),tp(n,t,!0),oi&&el(n),ue(n,100))}function tp(n,t,i){t=Math.max(0,Math.min(n.display.scroller.scrollHeight-n.display.scroller.clientHeight,t));(n.display.scroller.scrollTop!=t||i)&&(n.doc.scrollTop=t,n.display.scrollbars.setScrollTop(t),n.display.scroller.scrollTop!=t&&(n.display.scroller.scrollTop=t))}function wr(n,t,i,r){t=Math.max(0,Math.min(t,n.display.scroller.scrollWidth-n.display.scroller.clientWidth));(i?t==n.doc.scrollLeft:Math.abs(n.doc.scrollLeft-t)<2)&&!r||(n.doc.scrollLeft=t,ep(n),n.display.scroller.scrollLeft!=t&&(n.display.scroller.scrollLeft=t),n.display.scrollbars.setScrollLeft(t))}function re(n){var t=n.display,i=t.gutters.offsetWidth,r=Math.round(n.doc.height+sc(n.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:n.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+ui(n)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}function au(n,t){var i,r,u;for(t||(t=re(n)),i=n.display.barWidth,r=n.display.barHeight,ip(n,t),u=0;u<4&&i!=n.display.barWidth||r!=n.display.barHeight;u++)i!=n.display.barWidth&&n.options.lineWrapping&&go(n),ip(n,re(n)),i=n.display.barWidth,r=n.display.barHeight}function ip(n,t){var i=n.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px";i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px";i.heightForcer.style.borderBottom=r.bottom+"px solid transparent";r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="";r.bottom&&n.options.coverGutterNextToScrollbar&&n.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}function rp(n){n.display.scrollbars&&(n.display.scrollbars.clear(),n.display.scrollbars.addClass&&yi(n.display.wrapper,n.display.scrollbars.addClass));n.display.scrollbars=new ul[n.options.scrollbarStyle](function(t){n.display.wrapper.insertBefore(t,n.display.scrollbarFiller);r(t,"mousedown",function(){n.state.focused&&setTimeout(function(){return n.display.input.focus()},0)});t.setAttribute("cm-not-content","true")},function(t,i){"horizontal"==i?wr(n,t):ie(n,t)},n);n.display.scrollbars.addClass&&ur(n.display.wrapper,n.display.scrollbars.addClass)}function br(n){var t;n.curOp={cm:n,viewChanged:!1,startHeight:n.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++up};t=n.curOp;lr?lr.ops.push(t):t.ownsGroup=lr={ops:[t],delayedCallbacks:[]}}function kr(n){var t=n.curOp;t&&function(n){var t=n.ownsGroup;if(t)try{!function(n){var u=n.delayedCallbacks,i=0,r,t;do{for(;i<u.length;i++)u[i].call(null);for(r=0;r<n.ops.length;r++)if(t=n.ops[r],t.cursorActivityHandlers)for(;t.cursorActivityCalled<t.cursorActivityHandlers.length;)t.cursorActivityHandlers[t.cursorActivityCalled++].call(null,t.cm)}while(i<u.length)}(t)}finally{lr=null,function(n){for(var t=0;t<n.ops.length;t++)n.ops[t].cm.curOp=null;!function(n){for(var r,u,f,e,t=n.ops,i=0;i<t.length;i++)sd(t[i]);for(r=0;r<t.length;r++)hd(t[r]);for(u=0;u<t.length;u++)cd(t[u]);for(f=0;f<t.length;f++)ld(t[f]);for(e=0;e<t.length;e++)ad(t[e])}(n)}(t)}}(t)}function sd(n){var t=n.cm,i=t.display;!function(n){var t=n.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=ui(n)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=ui(n)+"px",t.scrollbarsClipped=!0)}(t);n.updateMaxLine&&ec(t);n.mustUpdate=n.viewChanged||n.forceUpdate||null!=n.scrollTop||n.scrollToPos&&(n.scrollToPos.from.line<i.viewFrom||n.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping;n.update=n.mustUpdate&&new fe(t,n.mustUpdate&&{top:n.scrollTop,ensure:n.scrollToPos},n.forceUpdate)}function hd(n){n.updatedDisplay=n.mustUpdate&&fl(n.cm,n.update)}function cd(n){var t=n.cm,i=t.display;n.updatedDisplay&&go(t);n.barMeasure=re(t);i.maxLineChanged&&!t.options.lineWrapping&&(n.adjustWidthTo=fy(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=n.adjustWidthTo,n.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+n.adjustWidthTo+ui(t)+t.display.barWidth),n.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+n.adjustWidthTo-ar(t)));(n.updatedDisplay||n.selectionChanged)&&(n.preparedSelection=i.input.prepareSelection())}function ld(n){var t=n.cm,i;null!=n.adjustWidthTo&&(t.display.sizer.style.minWidth=n.adjustWidthTo+"px",n.maxScrollLeft<t.doc.scrollLeft&&wr(t,Math.min(t.display.scroller.scrollLeft,n.maxScrollLeft),!0),t.display.maxLineChanged=!1);i=n.focus&&n.focus==vt();n.preparedSelection&&t.display.input.showSelection(n.preparedSelection,i);(n.updatedDisplay||n.startHeight!=t.doc.height)&&au(t,n.barMeasure);n.updatedDisplay&&sl(t,n.barMeasure);n.selectionChanged&&gc(t);t.state.focused&&n.updateInput&&t.display.input.reset(n.typing);i&&dy(n.cm)}function ad(t){var r=t.cm,h=r.display,c=r.doc,u,e,o,s;if(t.updatedDisplay&&fp(r,t.update),null==h.wheelStartX||null==t.scrollTop&&null==t.scrollLeft&&!t.scrollToPos||(h.wheelStartX=h.wheelStartY=null),null!=t.scrollTop&&tp(r,t.scrollTop,t.forceScroll),null!=t.scrollLeft&&wr(r,t.scrollLeft,!0,!0),t.scrollToPos&&function(n,t){var u;if(!w(n,"scrollCursorIntoView")){var f=n.display,e=f.sizer.getBoundingClientRect(),r=null;(t.top+e.top<0?r=!0:t.bottom+e.top>(window.innerHeight||document.documentElement.clientHeight)&&(r=!1),null==r||rk)||(u=i("div","​",null,"position: absolute;\n                         top: "+(t.top-f.viewOffset-po(n.display))+"px;\n                         height: "+(t.bottom-t.top+ui(n)+f.barHeight)+"px;\n                         left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;"),n.display.lineSpace.appendChild(u),u.scrollIntoView(r),n.display.lineSpace.removeChild(u))}}(r,function(t,i,r,u){var c,s;for(null==u&&(u=0),t.options.lineWrapping||i!=r||(r="before"==(i=i.ch?n(i.line,"before"==i.sticky?i.ch-1:i.ch,"after"):i).sticky?n(i.line,i.ch+1,"before"):i),s=0;s<5;s++){var h=!1,f=dt(t,i),e=r&&r!=i?dt(t,r):f,o=il(t,c={left:Math.min(f.left,e.left),top:Math.min(f.top,e.top)-u,right:Math.max(f.left,e.left),bottom:Math.max(f.bottom,e.bottom)+u}),l=t.doc.scrollTop,a=t.doc.scrollLeft;if(null!=o.scrollTop&&(ie(t,o.scrollTop),Math.abs(t.doc.scrollTop-l)>1&&(h=!0)),null!=o.scrollLeft&&(wr(t,o.scrollLeft),Math.abs(t.doc.scrollLeft-a)>1&&(h=!0)),!h)break}return c}(r,f(c,t.scrollToPos.from),f(c,t.scrollToPos.to),t.scrollToPos.margin)),u=t.maybeHiddenMarkers,e=t.maybeUnhiddenMarkers,u)for(o=0;o<u.length;++o)u[o].lines.length||p(u[o],"hide");if(e)for(s=0;s<e.length;++s)e[s].lines.length&&p(e[s],"unhide");h.wrapper.offsetHeight&&(c.scrollTop=r.display.scroller.scrollTop);t.changeObjs&&p(r,"changes",r,t.changeObjs);t.update&&t.update.finish()}function et(n,t){if(n.curOp)return t();br(n);try{return t()}finally{kr(n)}}function k(n,t){return function(){if(n.curOp)return t.apply(n,arguments);br(n);try{return t.apply(n,arguments)}finally{kr(n)}}}function rt(n){return function(){if(this.curOp)return n.apply(this,arguments);br(this);try{return n.apply(this,arguments)}finally{kr(this)}}}function d(n){return function(){var t=this.cm;if(!t||t.curOp)return n.apply(this,arguments);br(t);try{return n.apply(this,arguments)}finally{kr(t)}}}function ue(n,t){n.doc.highlightFrontier<n.display.viewTo&&n.state.highlight.set(t,ks(vd,n))}function vd(n){var i=n.doc;if(!(i.highlightFrontier>=n.display.viewTo)){var u=+new Date+n.options.workTime,t=wf(n,i.highlightFrontier),r=[];i.iter(t.line,Math.min(i.first+i.size,n.display.viewTo+500),function(f){var o,e,c,s;if(t.line>=n.display.viewFrom){var h=f.styles,l=f.text.length>n.options.maxHighlightLength?or(i.mode,t.state):null,a=nv(n,f,t,!0);for(l&&(t.state=l),f.styles=a.styles,o=f.styleClasses,e=a.classes,e?f.styleClasses=e:o&&(f.styleClasses=null),c=!h||h.length!=f.styles.length||o!=e&&(!o||!e||o.bgClass!=e.bgClass||o.textClass!=e.textClass),s=0;!c&&s<h.length;++s)c=h[s]!=f.styles[s];c&&r.push(t.line);f.stateAfter=t.save();t.nextLine()}else f.text.length<=n.options.maxHighlightLength&&dh(n,f.text,t),f.stateAfter=t.line%5==0?t.save():null,t.nextLine();if(+new Date>u)return ue(n,n.options.workDelay),!0});i.highlightFrontier=t.line;i.modeFrontier=Math.max(i.modeFrontier,t.line);r.length&&et(n,function(){for(var t=0;t<r.length;t++)ki(n,r[t],"text")})}}function fl(n,i){var r=n.display,e=n.doc,s,o,c;if(i.editorIsHidden)return di(n),!1;if(!i.force&&i.visible.from>=r.viewFrom&&i.visible.to<=r.viewTo&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&0==wy(n))return!1;op(n)&&(di(n),i.dims=bc(n));var h=e.first+e.size,u=Math.max(i.visible.from-n.options.viewportMargin,e.first),f=Math.min(h,i.visible.to+n.options.viewportMargin);return(r.viewFrom<u&&u-r.viewFrom<20&&(u=Math.max(e.first,r.viewFrom)),r.viewTo>f&&r.viewTo-f<20&&(f=Math.min(h,r.viewTo)),ii&&(u=uc(n.doc,u),f=av(n.doc,f)),s=u!=r.viewFrom||f!=r.viewTo||r.lastWrapHeight!=i.wrapperHeight||r.lastWrapWidth!=i.wrapperWidth,!function(n,t,i){var r=n.display;0==r.view.length||t>=r.viewTo||i<=r.viewFrom?(r.view=yo(n,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=yo(n,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(pr(n,t))),r.viewFrom=t,r.viewTo<i?r.view=r.view.concat(yo(n,r.viewTo,i)):r.viewTo>i&&(r.view=r.view.slice(0,pr(n,i))));r.viewTo=i}(n,u,f),r.viewOffset=ci(t(n.doc,r.viewFrom)),n.display.mover.style.top=r.viewOffset+"px",o=wy(n),!s&&0==o&&!i.force&&r.renderedView==r.view&&(null==r.updateLineNumbers||r.updateLineNumbers>=r.viewTo))?!1:(c=function(n){var r,i,t;return n.hasFocus()?null:(r=vt(),!r||!wi(n.display.lineDiv,r))?null:(i={activeElt:r},window.getSelection&&(t=window.getSelection(),t.anchorNode&&t.extend&&wi(n.display.lineDiv,t.anchorNode)&&(i.anchorNode=t.anchorNode,i.anchorOffset=t.anchorOffset,i.focusNode=t.focusNode,i.focusOffset=t.focusOffset)),i)}(n),o>4&&(r.lineDiv.style.display="none"),function(n,t,i){function c(t){var i=t.nextSibling;return it&&at&&n.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),i}for(var r,h,a,e=n.display,v=n.options.lineNumbers,o=e.lineDiv,u=o.firstChild,l=e.view,f=e.viewFrom,s=0;s<l.length;s++){if(r=l[s],!r.hidden)if(r.node&&r.node.parentNode==o){for(;u!=r.node;)u=c(u);h=v&&null!=t&&t<=f&&r.lineNumber;r.changes&&(nt(r.changes,"gutter")>-1&&(h=!1),dv(n,r,f,i));h&&(pi(r.lineNumber),r.lineNumber.appendChild(document.createTextNode(wh(n.options,f))));u=r.node.nextSibling}else a=td(n,r,f,i),o.insertBefore(a,u);f+=r.size}for(;u;)u=c(u)}(n,r.updateLineNumbers,i.dims),o>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,function(n){if(n&&n.activeElt&&n.activeElt!=vt()&&(n.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(n.activeElt.nodeName)&&n.anchorNode&&wi(document.body,n.anchorNode)&&wi(document.body,n.focusNode))){var t=window.getSelection(),i=document.createRange();i.setEnd(n.anchorNode,n.anchorOffset);i.collapse(!1);t.removeAllRanges();t.addRange(i);t.extend(n.focusNode,n.focusOffset)}}(c),pi(r.cursorDiv),pi(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=i.wrapperHeight,r.lastWrapWidth=i.wrapperWidth,ue(n,400)),r.updateLineNumbers=null,!0)}function fp(n,t){for(var u,i=t.viewport,r=!0;;r=!1){if(r&&n.options.lineWrapping&&t.oldDisplayWidth!=ar(n))r&&(t.visible=ns(n.display,n.doc,i));else if(i&&null!=i.top&&(i={top:Math.min(n.doc.height+sc(n.display)-hc(n),i.top)}),t.visible=ns(n.display,n.doc,i),t.visible.from>=n.display.viewFrom&&t.visible.to<=n.display.viewTo)break;if(!fl(n,t))break;go(n);u=re(n);ne(n);au(n,u);sl(n,u);t.force=!1}t.signal(n,"update",n);n.display.viewFrom==n.display.reportedViewFrom&&n.display.viewTo==n.display.reportedViewTo||(t.signal(n,"viewportChange",n,n.display.viewFrom,n.display.viewTo),n.display.reportedViewFrom=n.display.viewFrom,n.display.reportedViewTo=n.display.viewTo)}function el(n,t){var i=new fe(n,t),r;fl(n,i)&&(go(n),fp(n,i),r=re(n),ne(n),au(n,r),sl(n,r),i.finish())}function ol(n){var t=n.gutters.offsetWidth;n.sizer.style.marginLeft=t+"px";b(n,"gutterChanged",n)}function sl(n,t){n.display.sizer.style.minHeight=t.docHeight+"px";n.display.heightForcer.style.top=t.docHeight+"px";n.display.gutters.style.height=t.docHeight+n.display.barHeight+ui(n)+"px"}function ep(n){var i=n.display,r=i.view,u,f;if(i.alignWidgets||i.gutters.firstChild&&n.options.fixedGutter){for(var o=kc(i)-i.scroller.scrollLeft+n.doc.scrollLeft,s=i.gutters.offsetWidth,e=o+"px",t=0;t<r.length;t++)if(!r[t].hidden&&(n.options.fixedGutter&&(r[t].gutter&&(r[t].gutter.style.left=e),r[t].gutterBackground&&(r[t].gutterBackground.style.left=e)),u=r[t].alignable,u))for(f=0;f<u.length;f++)u[f].style.left=e;n.options.fixedGutter&&(i.gutters.style.left=o+s+"px")}}function op(n){if(!n.options.lineNumbers)return!1;var u=n.doc,r=wh(n.options,u.first+u.size-1),t=n.display;if(r.length!=t.lineNumChars){var f=t.measure.appendChild(i("div",[i("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),e=f.firstChild.offsetWidth,o=f.offsetWidth-e;return t.lineGutter.style.width="",t.lineNumInnerWidth=Math.max(e,t.lineGutter.offsetWidth-o)+1,t.lineNumWidth=t.lineNumInnerWidth+o,t.lineNumChars=t.lineNumInnerWidth?r.length:-1,t.lineGutter.style.width=t.lineNumWidth+"px",ol(n.display),!0}return!1}function hl(n,t){for(var i,f,r=[],e=!1,u=0;u<n.length;u++){if(i=n[u],f=null,"string"!=typeof i&&(f=i.style,i=i.className),"CodeMirror-linenumbers"==i){if(!t)continue;e=!0}r.push({className:i,style:f})}return t&&!e&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function sp(n){var r=n.gutters,u=n.gutterSpecs,t;for(pi(r),n.lineGutter=null,t=0;t<u.length;++t){var e=u[t],o=e.className,s=e.style,f=r.appendChild(i("div",null,"CodeMirror-gutter "+o));s&&(f.style.cssText=s);"CodeMirror-linenumbers"==o&&(n.lineGutter=f,f.style.width=(n.lineNumWidth||1)+"px")}r.style.display=u.length?"":"none";ol(n)}function ee(n){sp(n.display);ft(n);ep(n)}function yd(n,t,r,u){var f=this,o;this.input=r;f.scrollbarFiller=i("div",null,"CodeMirror-scrollbar-filler");f.scrollbarFiller.setAttribute("cm-not-content","true");f.gutterFiller=i("div",null,"CodeMirror-gutter-filler");f.gutterFiller.setAttribute("cm-not-content","true");f.lineDiv=nu("div",null,"CodeMirror-code");f.selectionDiv=i("div",null,null,"position: relative; z-index: 1");f.cursorDiv=i("div",null,"CodeMirror-cursors");f.measure=i("div",null,"CodeMirror-measure");f.lineMeasure=i("div",null,"CodeMirror-measure");f.lineSpace=nu("div",[f.measure,f.lineMeasure,f.selectionDiv,f.cursorDiv,f.lineDiv],null,"position: relative; outline: none");o=nu("div",[f.lineSpace],"CodeMirror-lines");f.mover=i("div",[o],null,"position: relative");f.sizer=i("div",[f.mover],"CodeMirror-sizer");f.sizerWidth=null;f.heightForcer=i("div",null,null,"position: absolute; height: 50px; width: 1px;");f.gutters=i("div",null,"CodeMirror-gutters");f.lineGutter=null;f.scroller=i("div",[f.sizer,f.heightForcer,f.gutters],"CodeMirror-scroll");f.scroller.setAttribute("tabIndex","-1");f.wrapper=i("div",[f.scrollbarFiller,f.gutterFiller,f.scroller],"CodeMirror");e&&l<8&&(f.gutters.style.zIndex=-1,f.scroller.style.paddingRight=0);it||oi&&sf||(f.scroller.draggable=!0);n&&(n.appendChild?n.appendChild(f.wrapper):n(f.wrapper));f.viewFrom=f.viewTo=t.first;f.reportedViewFrom=f.reportedViewTo=t.first;f.view=[];f.renderedView=null;f.externalMeasured=null;f.viewOffset=0;f.lastWrapHeight=f.lastWrapWidth=0;f.updateLineNumbers=null;f.nativeBarWidth=f.barHeight=f.barWidth=0;f.scrollbarsClipped=!1;f.lineNumWidth=f.lineNumInnerWidth=f.lineNumChars=null;f.alignWidgets=!1;f.cachedCharWidth=f.cachedTextHeight=f.cachedPaddingH=null;f.maxLine=null;f.maxLineLength=0;f.maxLineChanged=!1;f.wheelDX=f.wheelDY=f.wheelStartX=f.wheelStartY=null;f.shift=!1;f.selForContextMenu=null;f.activeTouch=null;f.gutterSpecs=hl(u.gutters,u.lineNumbers);sp(f);r.init(f)}function hp(n){var i=n.wheelDeltaX,t=n.wheelDeltaY;return null==i&&n.detail&&n.axis==n.HORIZONTAL_AXIS&&(i=n.detail),null==t&&n.detail&&n.axis==n.VERTICAL_AXIS?t=n.detail:null==t&&(t=n.wheelDelta),{x:i,y:t}}function pd(n){var t=hp(n);return t.x*=ot,t.y*=ot,t}function cp(n,t){var v=hp(t),e=v.x,u=v.y,i=n.display,r=i.scroller,y=r.scrollWidth>r.clientWidth,h=r.scrollHeight>r.clientHeight,f,c,o;if(e&&y||u&&h){if(u&&at&&it)n:for(f=t.target,c=i.view;f!=r;f=f.parentNode)for(o=0;o<c.length;o++)if(c[o].node==f){n.display.currentWheelTarget=f;break n}if(e&&!oi&&!bt&&null!=ot)return u&&h&&ie(n,Math.max(0,r.scrollTop+u*ot)),wr(n,Math.max(0,r.scrollLeft+e*ot)),(!u||u&&h)&&ut(t),void(i.wheelStartX=null);if(u&&null!=ot){var l=u*ot,s=n.doc.scrollTop,a=s+i.wrapper.clientHeight;l<0?s=Math.max(0,s+l-50):a=Math.min(n.doc.height,a+l+50);el(n,{top:s,bottom:a})}oe<20&&(null==i.wheelStartX?(i.wheelStartX=r.scrollLeft,i.wheelStartY=r.scrollTop,i.wheelDX=e,i.wheelDY=u,setTimeout(function(){if(null!=i.wheelStartX){var n=r.scrollLeft-i.wheelStartX,t=r.scrollTop-i.wheelStartY,u=t&&i.wheelDY&&t/i.wheelDY||n&&i.wheelDX&&n/i.wheelDX;i.wheelStartX=i.wheelStartY=null;u&&(ot=(ot*oe+u)/(oe+1),++oe)}},200)):(i.wheelDX+=e,i.wheelDY+=u))}}function gt(n,t,i){var a=n&&n.options.selectionsMayTouch,v=t[i],r;for(t.sort(function(n,t){return u(n.from(),t.from())}),i=nt(t,v),r=1;r<t.length;r++){var f=t[r],e=t[r-1],s=u(e.to(),f.from());if(a&&!f.empty()?s>0:s>=0){var h=so(e.from(),f.from()),c=oo(e.to(),f.to()),l=e.empty()?f.from()==f.head:e.from()==e.head;r<=i&&--i;t.splice(--r,2,new o(l?c:h,l?h:c))}}return new st(t,i)}function nr(n,t){return new st([new o(n,t||n)],0)}function tr(t){return t.text?n(t.from.line+t.text.length-1,s(t.text).length+(1==t.text.length?t.from.ch:0)):t.to}function lp(t,i){if(u(t,i.from)<0)return t;if(u(t,i.to)<=0)return tr(i);var f=t.line+i.text.length-(i.to.line-i.from.line)-1,r=t.ch;return t.line==i.to.line&&(r+=tr(i).ch-i.to.ch),n(f,r)}function cl(n,t){for(var u,r=[],i=0;i<n.sel.ranges.length;i++)u=n.sel.ranges[i],r.push(new o(lp(u.anchor,t),lp(u.head,t)));return gt(n.cm,r,n.sel.primIndex)}function ap(t,i,r){return t.line==i.line?n(r.line,t.ch-i.ch+r.ch):n(r.line+(t.line-i.line),t.ch)}function ll(n){n.doc.mode=vh(n.options,n.doc.modeOption);se(n)}function se(n){n.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null);n.styles&&(n.styles=null)});n.doc.modeFrontier=n.doc.highlightFrontier=n.doc.first;ue(n,100);n.state.modeGen++;n.curOp&&ft(n)}function vp(n,t){return 0==t.from.ch&&0==t.to.ch&&""==s(t.text)&&(!n.cm||n.cm.options.wholeLineUpdateBefore)}function al(n,i,r,u){function a(n){return r?r[n]:null}function h(n,t,r){!function(n,t,i,r){n.text=t;n.stateAfter&&(n.stateAfter=null);n.styles&&(n.styles=null);null!=n.order&&(n.order=null);ov(n);sv(n,i);var u=r?r(n):1;u!=n.height&&ti(n,u)}(n,t,r,u);b(n,"change",n,i)}function y(n,t){for(var r=[],i=n;i<t;++i)r.push(new cr(f[i],a(i),u));return r}var e=i.from,c=i.to,f=i.text,o=t(n,e.line),l=t(n,c.line),w=s(f),p=a(f.length-1),v=c.line-e.line,k,d,g;i.full?(n.insert(0,y(0,f.length)),n.remove(f.length,n.size-f.length)):vp(n,i)?(k=y(0,f.length-1),h(l,l.text,p),v&&n.remove(e.line,v),k.length&&n.insert(e.line,k)):o==l?1==f.length?h(o,o.text.slice(0,e.ch)+w+o.text.slice(c.ch),p):(d=y(1,f.length-1),d.push(new cr(w+o.text.slice(c.ch),p,u)),h(o,o.text.slice(0,e.ch)+f[0],a(0)),n.insert(e.line+1,d)):1==f.length?(h(o,o.text.slice(0,e.ch)+f[0]+l.text.slice(c.ch),a(0)),n.remove(e.line+1,v)):(h(o,o.text.slice(0,e.ch)+f[0],a(0)),h(l,w+l.text.slice(c.ch),p),g=y(1,f.length-1),v>1&&n.remove(e.line+1,v-1),n.insert(e.line+1,g));b(n,"change",n,i)}function ir(n,t,i){!function n(r,u,f){var o,e,s;if(r.linked)for(o=0;o<r.linked.length;++o)e=r.linked[o],e.doc!=u&&(s=f&&e.sharedHist,i&&!s||(t(e.doc,s),n(e.doc,r,s)))}(n,null,!0)}function yp(n,t){if(t.cm)throw new Error("This document is already in use.");n.doc=t;t.cm=n;dc(n);ll(n);pp(n);n.options.lineWrapping||ec(n);n.options.mode=t.modeOption;ft(n)}function pp(n){("rtl"==n.doc.direction?ur:yi)(n.display.lineDiv,"CodeMirror-rtl")}function is(n){this.done=[];this.undone=[];this.undoDepth=n?n.undoDepth:1/0;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=n?n.maxGeneration:1}function vl(n,t){var i={from:kh(t.from),to:tr(t),text:sr(n,t.from,t.to)};return kp(n,i,t.from.line,t.to.line+1),ir(n,function(n){return kp(n,i,t.from.line,t.to.line+1)},!0),i}function wp(n){for(;n.length&&s(n).ranges;)n.pop()}function bp(n,t,i,r){var f=n.history,e,o,h,c;if(f.undone.length=0,h=+new Date,(f.lastOp==r||f.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&f.lastModTime>h-(n.cm?n.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(e=function(n,t){return t?(wp(n.done),s(n.done)):n.done.length&&!s(n.done).ranges?s(n.done):n.done.length>1&&!n.done[n.done.length-2].ranges?(n.done.pop(),s(n.done)):void 0}(f,f.lastOp==r)))o=s(e.changes),0==u(t.from,t.to)&&0==u(t.from,o.to)?o.to=tr(t):e.changes.push(vl(n,t));else for(c=s(f.done),c&&c.ranges||rs(n.sel,f.done),e={changes:[vl(n,t)],generation:f.generation},f.done.push(e);f.done.length>f.undoDepth;)f.done.shift(),f.done[0].ranges||f.done.shift();f.done.push(i);f.generation=++f.maxGeneration;f.lastModTime=f.lastSelTime=h;f.lastOp=f.lastSelOp=r;f.lastOrigin=f.lastSelOrigin=t.origin;o||p(n,"historyAdded")}function rs(n,t){var i=s(t);i&&i.ranges&&i.equals(n)||t.push(n)}function kp(n,t,i,r){var u=t["spans_"+n.id],f=0;n.iter(Math.max(n.first,i),Math.min(n.first+n.size,r),function(i){i.markedSpans&&((u||(u=t["spans_"+n.id]={}))[f]=i.markedSpans);++f})}function wd(n){if(!n)return null;for(var t,i=0;i<n.length;++i)n[i].marker.explicitlyCleared?t||(t=n.slice(0,i)):t&&t.push(n[i]);return t?t.length?t:null:n}function dp(n,t){var i=function(n,t){var u=t["spans_"+n.id],r,i;if(!u)return null;for(r=[],i=0;i<t.text.length;++i)r.push(wd(u[i]));return r}(n,t),s=ic(n,t),r,f,u,e,h,o;if(!i)return s;if(!s)return i;for(r=0;r<i.length;++r)if(f=i[r],u=s[r],f&&u)n:for(e=0;e<u.length;++e){for(h=u[e],o=0;o<f.length;++o)if(f[o].marker==h.marker)continue n;f.push(h)}else u&&(i[r]=u);return i}function vu(n,t,i){for(var u,l,h,c,r,a,f,e=[],o=0;o<n.length;++o)if(u=n[o],u.ranges)e.push(i?st.prototype.deepCopy.call(u):u);else for(l=u.changes,h=[],e.push({changes:h}),c=0;c<l.length;++c)if(r=l[c],a=void 0,h.push({from:r.from,to:r.to,text:r.text}),t)for(f in r)(a=f.match(/^spans_(\d+)$/))&&nt(t,Number(a[1]))>-1&&(s(h)[f]=r[f],delete r[f]);return e}function yl(n,t,i,r){var f,e;return r?(f=n.anchor,i&&(e=u(t,f)<0,e!=u(i,f)<0?(f=t,t=i):e!=u(t,i)<0&&(t=i)),new o(f,t)):new o(i||t,t)}function us(n,t,i,r,u){null==u&&(u=n.cm&&(n.cm.display.shift||n.extend));tt(n,new st([yl(n.sel.primary(),t,i,u)],0),r)}function gp(n,t,i){for(var u=[],f=n.cm&&(n.cm.display.shift||n.extend),r=0;r<n.sel.ranges.length;r++)u[r]=yl(n.sel.ranges[r],t[r],null,f);tt(n,gt(n.cm,u,n.sel.primIndex),i)}function pl(n,t,i,r){var u=n.sel.ranges.slice(0);u[t]=i;tt(n,gt(n.cm,u,n.sel.primIndex),r)}function nw(n,t,i,r){tt(n,nr(t,i),r)}function tw(n,t,i){var r=n.history.done,u=s(r);u&&u.ranges?(r[r.length-1]=t,fs(n,t,i)):tt(n,t,i)}function tt(n,t,i){fs(n,t,i),function(n,t,i,r){var u=n.history,f=r&&r.origin;i==u.lastSelOp||f&&u.lastSelOrigin==f&&(u.lastModTime==u.lastSelTime&&u.lastOrigin==f||function(n,t,i,r){var u=t.charAt(0);return"*"==u||"+"==u&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-n.history.lastSelTime<=(n.cm?n.cm.options.historyEventDelay:500)}(n,f,s(u.done),t))?u.done[u.done.length-1]=t:rs(t,u.done);u.lastSelTime=+new Date;u.lastSelOrigin=f;u.lastSelOp=i;r&&!1!==r.clearRedo&&wp(u.undone)}(n,n.sel,n.cm?n.cm.curOp.id:NaN,i)}function fs(n,t,i){(pt(n,"beforeSelectionChange")||n.cm&&pt(n.cm,"beforeSelectionChange"))&&(t=function(n,t,i){var r={ranges:t.ranges,update:function(t){this.ranges=[];for(var i=0;i<t.length;i++)this.ranges[i]=new o(f(n,t[i].anchor),f(n,t[i].head))},origin:i&&i.origin};return p(n,"beforeSelectionChange",n,r),n.cm&&p(n.cm,"beforeSelectionChange",n.cm,r),r.ranges!=t.ranges?gt(n.cm,r.ranges,r.ranges.length-1):t}(n,t,i));var r=i&&i.bias||(u(t.primary().head,n.sel.primary().head)<0?-1:1);iw(n,uw(n,t,r,!0));i&&!1===i.scroll||!n.cm||"nocursor"==n.cm.getOption("readOnly")||cu(n.cm)}function iw(n,t){t.equals(n.sel)||(n.sel=t,n.cm&&(n.cm.curOp.updateInput=1,n.cm.curOp.selectionChanged=!0,ya(n.cm)),b(n,"cursorActivity",n))}function rw(n){iw(n,uw(n,n.sel,null,!1))}function uw(n,t,i,r){for(var f,u=0;u<t.ranges.length;u++){var e=t.ranges[u],s=t.ranges.length==n.sel.ranges.length&&n.sel.ranges[u],h=es(n,e.anchor,s&&s.anchor,i,r),c=es(n,e.head,s&&s.head,i,r);(f||h!=e.anchor||c!=e.head)&&(f||(f=t.ranges.slice(0,u)),f[u]=new o(h,c))}return f?gt(n.cm,f,t.primIndex):t}function yu(n,i,r,f,e){var c=t(n,i.line),a,s,v,l;if(c.markedSpans)for(a=0;a<c.markedSpans.length;++a){var h=c.markedSpans[a],o=h.marker,y="selectLeft"in o?!o.selectLeft:o.inclusiveLeft,w="selectRight"in o?!o.selectRight:o.inclusiveRight;if((null==h.from||(y?h.from<=i.ch:h.from<i.ch))&&(null==h.to||(w?h.to>=i.ch:h.to>i.ch))){if(e&&(p(o,"beforeCursorEnter"),o.explicitlyCleared)){if(c.markedSpans){--a;continue}break}if(!o.atomic)continue;return r&&(s=o.find(f<0?1:-1),v=void 0,(f<0?w:y)&&(s=fw(n,s,-f,s&&s.line==i.line?c:null)),s&&s.line==i.line&&(v=u(s,r))&&(f<0?v<0:v>0))?yu(n,s,i,f,e):(l=o.find(f<0?-1:1),(f<0?y:w)&&(l=fw(n,l,f,l.line==i.line?c:null)),l?yu(n,l,i,f,e):null)}}return i}function es(t,i,r,u,f){var e=u||1;return yu(t,i,r,e,f)||!f&&yu(t,i,r,e,!0)||yu(t,i,r,-e,f)||!f&&yu(t,i,r,-e,!0)||(t.cantEdit=!0,n(t.first,0))}function fw(i,r,u,e){return u<0&&0==r.ch?r.line>i.first?f(i,n(r.line-1)):null:u>0&&r.ch==(e||t(i,r.line)).text.length?r.line<i.first+i.size-1?n(r.line+1,0):null:new n(r.line,r.ch+u)}function ew(t){t.setSelection(n(t.firstLine(),0),n(t.lastLine()),ni)}function ow(n,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return i&&(r.update=function(t,i,u,e){t&&(r.from=f(n,t));i&&(r.to=f(n,i));u&&(r.text=u);void 0!==e&&(r.origin=e)}),p(n,"beforeChange",n,r),n.cm&&p(n.cm,"beforeChange",n.cm,r),r.canceled?(n.cm&&(n.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function pu(n,t,i){var f,r;if(n.cm){if(!n.cm.curOp)return k(n.cm,pu)(n,t,i);if(n.cm.state.suppressEdits)return}if(!(pt(n,"beforeChange")||n.cm&&pt(n.cm,"beforeChange"))||(t=ow(n,t,!0)))if(f=tc&&!i&&function(n,t,i){var r=null,e,h,f;if(n.iter(t.line,i.line+1,function(n){var t,i;if(n.markedSpans)for(t=0;t<n.markedSpans.length;++t)i=n.markedSpans[t].marker,!i.readOnly||r&&-1!=nt(r,i)||(r||(r=[])).push(i)}),!r)return null;for(e=[{from:t,to:i}],h=0;h<r.length;++h)for(var l=r[h],o=l.find(0),s=0;s<e.length;++s)if(f=e[s],!(u(f.to,o.from)<0||u(f.from,o.to)>0)){var c=[s,1],a=u(f.from,o.from),v=u(f.to,o.to);(a<0||!l.inclusiveLeft&&!a)&&c.push({from:f.from,to:o.from});(v>0||!l.inclusiveRight&&!v)&&c.push({from:o.to,to:f.to});e.splice.apply(e,c);s+=c.length-3}return e}(n,t.from,t.to),f)for(r=f.length-1;r>=0;--r)sw(n,{from:f[r].from,to:f[r].to,text:r?[""]:t.text,origin:t.origin});else sw(n,t)}function sw(n,t){var i,r;(1!=t.text.length||""!=t.text[0]||0!=u(t.from,t.to))&&(i=cl(n,t),bp(n,t,i,n.cm?n.cm.curOp.id:NaN),he(n,t,i,ic(n,t)),r=[],ir(n,function(n,i){i||-1!=nt(r,n.history)||(aw(n.history,t),r.push(n.history));he(n,t,null,ic(n,t))}))}function os(n,t,i){var a=n.cm&&n.cm.state.suppressEdits,h,l;if(!a||i){for(var r,u=n.history,v=n.sel,f="undo"==t?u.done:u.undone,o="undo"==t?u.undone:u.done,e=0;e<f.length&&(r=f[e],i?!r.ranges||r.equals(n.sel):r.ranges);e++);if(e!=f.length){for(u.lastOrigin=u.lastSelOrigin=null;;){if(!(r=f.pop()).ranges){if(a)return void f.push(r);break}if(rs(r,o),i&&!r.equals(n.sel))return void tt(n,r,{clearRedo:!1});v=r}h=[];rs(v,o);o.push({changes:h,generation:u.generation});u.generation=r.generation||++u.maxGeneration;for(var y=pt(n,"beforeChange")||n.cm&&pt(n.cm,"beforeChange"),p=function(i){var u=r.changes[i],o,e;if(u.origin=t,y&&!ow(n,u,!1))return f.length=0,{};h.push(vl(n,u));o=i?cl(n,u):s(f);he(n,u,o,dp(n,u));!i&&n.cm&&n.cm.scrollIntoView({from:u.from,to:tr(u)});e=[];ir(n,function(n,t){t||-1!=nt(e,n.history)||(aw(n.history,u),e.push(n.history));he(n,u,null,dp(n,u))})},c=r.changes.length-1;c>=0;--c)if(l=p(c),l)return l.v}}}function hw(t,i){if(0!=i&&(t.first+=i,t.sel=new st(uo(t.sel.ranges,function(t){return new o(n(t.anchor.line+i,t.anchor.ch),n(t.head.line+i,t.head.ch))}),t.sel.primIndex),t.cm)){ft(t.cm,t.first,t.first-i,i);for(var u=t.cm.display,r=u.viewFrom;r<u.viewTo;r++)ki(t.cm,r,"gutter")}}function he(i,r,u,f){var o,e;if(i.cm&&!i.cm.curOp)return k(i.cm,he)(i,r,u,f);r.to.line<i.first?hw(i,r.text.length-1-(r.to.line-r.from.line)):r.from.line>i.lastLine()||(r.from.line<i.first&&(o=r.text.length-1-(i.first-r.from.line),hw(i,o),r={from:n(i.first,0),to:n(r.to.line+o,r.to.ch),text:[s(r.text)],origin:r.origin}),e=i.lastLine(),r.to.line>e&&(r={from:r.from,to:n(e,t(i,e).text.length),text:[r.text[0]],origin:r.origin}),r.removed=sr(i,r.from,r.to),u||(u=cl(i,r)),i.cm?function(n,i,r){var f=n.doc,e=n.display,u=i.from,o=i.to,s=!1,h=u.line,y,l,a,v;n.options.lineWrapping||(h=c(ri(t(f,u.line))),f.iter(h,o.line+1,function(n){if(n==e.maxLine)return s=!0,!0}));f.sel.contains(i.from,i.to)>-1&&ya(n);al(f,i,r,py(n));n.options.lineWrapping||(f.iter(h,u.line+i.text.length,function(n){var t=vo(n);t>e.maxLineLength&&(e.maxLine=n,e.maxLineLength=t,e.maxLineChanged=!0,s=!1)}),s&&(n.curOp.updateMaxLine=!0)),function(n,i){var u,r,f;if(n.modeFrontier=Math.min(n.modeFrontier,i),!(n.highlightFrontier<i-10)){for(u=n.first,r=i-1;r>u;r--)if(f=t(n,r).stateAfter,f&&(!(f instanceof pf)||r+f.lookAhead<i)){u=r+1;break}n.highlightFrontier=Math.min(n.highlightFrontier,u)}}(f,u.line);ue(n,400);y=i.text.length-(o.line-u.line)-1;i.full?ft(n):u.line!=o.line||1!=i.text.length||vp(n.doc,i)?ft(n,u.line,o.line+1,y):ki(n,u.line,"text");l=pt(n,"changes");a=pt(n,"change");(a||l)&&(v={from:u,to:o,text:i.text,removed:i.removed,origin:i.origin},a&&b(n,"change",n,v),l&&(n.curOp.changeObjs||(n.curOp.changeObjs=[])).push(v));n.display.selForContextMenu=null}(i.cm,r,f):al(i,r,f),fs(i,u,ni),i.cantEdit&&es(i,n(i.firstLine(),0))&&(i.cantEdit=!1))}function wu(n,t,i,r,f){var e;r||(r=i);u(r,i)<0&&(i=(e=[r,i])[0],r=e[1]);"string"==typeof t&&(t=n.splitLines(t));pu(n,{from:i,to:r,text:t,origin:f})}function cw(n,t,i,r){i<n.line?n.line+=r:t<n.line&&(n.line=t,n.ch=0)}function lw(t,i,r,u){for(var f,c,s,h,e,o=0;o<t.length;++o)if(f=t[o],c=!0,f.ranges)for(f.copied||((f=t[o]=f.deepCopy()).copied=!0),s=0;s<f.ranges.length;s++)cw(f.ranges[s].anchor,i,r,u),cw(f.ranges[s].head,i,r,u);else{for(h=0;h<f.changes.length;++h)if(e=f.changes[h],r<e.from.line)e.from=n(e.from.line+u,e.from.ch),e.to=n(e.to.line+u,e.to.ch);else if(i<=e.to.line){c=!1;break}c||(t.splice(0,o+1),o=0)}}function aw(n,t){var i=t.from.line,r=t.to.line,u=t.text.length-(r-i)-1;lw(n.done,i,r,u);lw(n.undone,i,r,u)}function ce(n,i,r,u){var f=i,e=i;return"number"==typeof i?e=t(n,da(n,i)):f=c(i),null==f?null:(u(e,f)&&n.cm&&ki(n.cm,f,r),e)}function le(n){this.lines=n;this.parent=null;for(var i=0,t=0;t<n.length;++t)n[t].parent=this,i+=n[t].height;this.height=i}function ae(n){var t;this.children=n;for(var r=0,u=0,i=0;i<n.length;++i)t=n[i],r+=t.chunkSize(),u+=t.height,t.parent=this;this.size=r;this.height=u;this.parent=null}function vw(n,t,i){ci(t)<(n.curOp&&n.curOp.scrollTop||n.doc.scrollTop)&&rl(n,i)}function ku(n,t,i,e,o){var h,v,y,l,c,a;if(e&&e.shared)return function(n,t,i,r,u){(r=fr(r)).shared=!1;var e=[ku(n,t,i,r,u)],o=e[0],h=r.widgetNode;return ir(n,function(n){h&&(r.widgetNode=h.cloneNode(!0));e.push(ku(n,f(n,t),f(n,i),r,u));for(var c=0;c<n.linked.length;++c)if(n.linked[c].isParent)return;o=s(e)}),new du(e,o)}(n,t,i,e,o);if(n.cm&&!n.cm.curOp)return k(n.cm,ku)(n,t,i,e,o);if(h=new ai(n,o),v=u(t,i),e&&fr(e,h,!1),v>0||0==v&&!1!==h.clearWhenEmpty)return h;if(h.replacedWith&&(h.collapsed=!0,h.widgetNode=nu("span",[h.replacedWith],"CodeMirror-widget"),e.handleMouseEvents||h.widgetNode.setAttribute("cm-ignore-events","true"),e.insertLeft&&(h.widgetNode.insertLeft=!0)),h.collapsed){if(lv(n,t.line,t,i,h)||t.line!=i.line&&lv(n,i.line,t,i,h))throw new Error("Inserting collapsed marker partially overlapping an existing one");ii=!0}if(h.addToHistory&&bp(n,{from:t,to:i,origin:"markText"},n.sel,NaN),l=t.line,c=n.cm,n.iter(l,i.line+1,function(n){c&&h.collapsed&&!c.options.lineWrapping&&ri(n)==c.display.maxLine&&(y=!0);h.collapsed&&l!=t.line&&ti(n,0),function(n,t){n.markedSpans=n.markedSpans?n.markedSpans.concat([t]):[t];t.marker.attachLine(n)}(n,new ho(h,l==t.line?t.ch:null,l==i.line?i.ch:null));++l}),h.collapsed&&n.iter(t.line,i.line+1,function(t){bi(n,t)&&ti(t,0)}),h.clearOnEnter&&r(h,"beforeCursorEnter",function(){return h.clear()}),h.readOnly&&(tc=!0,(n.history.done.length||n.history.undone.length)&&n.clearHistory()),h.collapsed&&(h.id=++wl,h.atomic=!0),c){if(y&&(c.curOp.updateMaxLine=!0),h.collapsed)ft(c,t.line,i.line+1);else if(h.className||h.startStyle||h.endStyle||h.css||h.attributes||h.title)for(a=t.line;a<=i.line;a++)ki(c,a,"text");h.atomic&&rw(c.doc);b(c,"markerAdded",c,h)}return h}function yw(t){return t.findMarks(n(t.first,0),t.clipPos(n(t.lastLine())),function(n){return n.parent})}function bd(n){for(var i=function(t){var i=n[t],f=[i.primary.doc],r,u;for(ir(i.primary.doc,function(n){return f.push(n)}),r=0;r<i.markers.length;r++)u=i.markers[r],-1==nt(f,u.doc)&&(u.parent=null,i.markers.splice(r--,1))},t=0;t<n.length;t++)i(t)}function kd(n){var t=this,i,r,c,u,o;if((ww(t),!w(t,n)&&!li(t.display,n))&&(ut(n),e&&(bl=+new Date),i=yr(t,n,!0),r=n.dataTransfer.files,i&&!t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var l=r.length,a=Array(l),v=0,h=function(){++v==l&&k(t,function(){var n={from:i=f(t.doc,i),to:i,text:t.doc.splitLines(a.filter(function(n){return null!=n}).join(t.doc.lineSeparator())),origin:"paste"};pu(t.doc,n);tw(t.doc,nr(f(t.doc,i),f(t.doc,tr(n))))})()},y=function(n,i){if(t.options.allowDropFileTypes&&-1==nt(t.options.allowDropFileTypes,n.type))h();else{var r=new FileReader;r.onerror=function(){return h()};r.onload=function(){var n=r.result;/[\x00-\x08\x0e-\x1f]{2}/.test(n)||(a[i]=n);h()};r.readAsText(n)}},s=0;s<r.length;s++)y(r[s],s);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1)return t.state.draggingText(n),void setTimeout(function(){return t.display.input.focus()},20);try{if(c=n.dataTransfer.getData("Text"),c){if(t.state.draggingText&&!t.state.draggingText.copy&&(u=t.listSelections()),fs(t.doc,nr(i,i)),u)for(o=0;o<u.length;++o)wu(t.doc,"",u[o].anchor,u[o].head,"drag");t.replaceSelection(c,"around","paste");t.display.input.focus()}}catch(n){}}}function ww(n){n.display.dragCursor&&(n.display.lineSpace.removeChild(n.display.dragCursor),n.display.dragCursor=null)}function bw(n){var r;if(document.getElementsByClassName){for(var u=document.getElementsByClassName("CodeMirror"),t=[],i=0;i<u.length;i++)r=u[i].CodeMirror,r&&t.push(r);t.length&&t[0].operation(function(){for(var i=0;i<t.length;i++)n(t[i])})}}function dd(n){var t=n.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null;t.scrollbarsClipped=!1;n.setSize()}function gd(n){var u,f,e,o,i=n.split(/-(?!$)/),r,t;for(n=i[i.length-1],r=0;r<i.length-1;r++)if(t=i[r],/^(cmd|meta|m)$/i.test(t))o=!0;else if(/^a(lt)?$/i.test(t))u=!0;else if(/^(c|ctrl|control)$/i.test(t))f=!0;else{if(!/^s(hift)?$/i.test(t))throw new Error("Unrecognized modifier name: "+t);e=!0}return u&&(n="Alt-"+n),f&&(n="Ctrl-"+n),o&&(n="Cmd-"+n),e&&(n="Shift-"+n),n}function ng(n){var e={},t,o,r,u,f,i,s,h;for(t in n)if(n.hasOwnProperty(t)){if(o=n[t],/^(name|fallthrough|(de|at)tach)$/.test(t))continue;if("..."==o){delete n[t];continue}for(r=uo(t.split(" "),gd),u=0;u<r.length;u++)if(f=void 0,i=void 0,u==r.length-1?(i=r.join(" "),f=o):(i=r.slice(0,u+1).join(" "),f="..."),s=e[i],s){if(s!=f)throw new Error("Inconsistent bindings for "+i);}else e[i]=f;delete n[t]}for(h in e)n[h]=e[h];return n}function tf(n,t,i,r){var u=(t=ss(t)).call?t.call(n,r):t[n],f,e;if(!1===u)return"nothing";if("..."===u)return"multi";if(null!=u&&i(u))return"handled";if(t.fallthrough){if("[object Array]"!=Object.prototype.toString.call(t.fallthrough))return tf(n,t.fallthrough,i,r);for(f=0;f<t.fallthrough.length;f++)if(e=tf(n,t.fallthrough[f],i,r),e)return e}}function kw(n){var t="string"==typeof n?n:vi[n.keyCode];return"Ctrl"==t||"Alt"==t||"Shift"==t||"Mod"==t}function dw(n,t,i){var r=n;return t.altKey&&"Alt"!=r&&(n="Alt-"+n),(ws?t.metaKey:t.ctrlKey)&&"Ctrl"!=r&&(n="Ctrl-"+n),(ws?t.ctrlKey:t.metaKey)&&"Mod"!=r&&(n="Cmd-"+n),!i&&t.shiftKey&&"Shift"!=r&&(n="Shift-"+n),n}function gw(n,t){if(bt&&34==n.keyCode&&n.char)return!1;var i=vi[n.keyCode];return null!=i&&!n.altGraphKey&&(3==n.keyCode&&n.code&&(i=n.code),dw(i,n,t))}function ss(n){return"string"==typeof n?ei[n]:n}function rf(n,t){for(var r,e,o=n.doc.sel.ranges,i=[],f=0;f<o.length;f++){for(r=t(o[f]);i.length&&u(r.from,s(i).to)<=0;)if(e=i.pop(),u(e.from,r.from)<0){r.from=e.from;break}i.push(r)}et(n,function(){for(var t=i.length-1;t>=0;t--)wu(n.doc,"",i[t].from,i[t].to,"+delete");cu(n)})}function dl(n,t,i){var r=aa(n.text,t+i,i);return r<0||r>n.text.length?null:r}function gl(t,i,r){var u=dl(t,i.ch,r);return null==u?null:new n(i.line,u,r<0?"after":"before")}function na(t,i,r,u,f){var h,e,o,c,l,a;return t&&("rtl"==i.doc.direction&&(f=-f),h=hi(r,i.doc.direction),h)?(o=f<0?s(h):h[0],c=f<0==(1==o.level)?"after":"before",o.level>0||"rtl"==i.doc.direction?(l=eu(i,r),e=f<0?r.text.length-1:0,a=fi(i,l,e).top,e=lf(function(n){return fi(i,l,n).top==a},f<0==(1==o.level)?o.from:o.to-1,e),"before"==c&&(e=dl(r,e,1))):e=f<0?o.to:o.from,new n(u,e,c)):new n(u,f<0?r.text.length:0,f<0?"before":"after")}function nb(n,i){var u=t(n.doc,i),r=ri(u);return r!=u&&(i=c(r)),na(!0,n,r,i,1)}function tb(i,r){var u=nb(i,r.line),e=t(i.doc,u.line),o=hi(e,i.doc.direction),f,s;return!o||0==o[0].level?(f=Math.max(u.ch,e.text.search(/\S/)),s=r.line==u.line&&r.ch<=f&&r.ch,n(u.line,s?0:f,u.sticky)):u}function hs(n,t,i){if("string"==typeof t&&!(t=uf[t]))return!1;n.display.input.ensurePolled();var u=n.display.shift,r=!1;try{n.isReadOnly()&&(n.state.suppressEdits=!0);i&&(n.display.shift=!1);r=t(n)!=ro}finally{n.display.shift=u;n.state.suppressEdits=!1}return r}function ye(n,t,i,r){var u=n.state.keySeq;if(u){if(kw(t))return"handled";if(/\'$/.test(t)?n.state.keySeq=null:ib.set(50,function(){n.state.keySeq==u&&(n.state.keySeq=null,n.display.input.reset())}),rb(n,u+" "+t,i,r))return!0}return rb(n,t,i,r)}function rb(n,t,i,r){var u=function(n,t,i){for(var u,r=0;r<n.state.keyMaps.length;r++)if(u=tf(t,n.state.keyMaps[r],i,n),u)return u;return n.options.extraKeys&&tf(t,n.options.extraKeys,i,n)||tf(t,n.options.keyMap,i,n)}(n,t,r);return"multi"==u&&(n.state.keySeq=t),"handled"==u&&b(n,"keyHandled",n,t,i),"handled"!=u&&"multi"!=u||(ut(i),gc(n)),!!u}function ub(n,t){var i=gw(t,!0);return!!i&&(t.shiftKey&&!n.state.keySeq?ye(n,"Shift-"+i,t,function(t){return hs(n,t,!0)})||ye(n,i,t,function(t){if("string"==typeof t?/^go[A-Z]/.test(t):t.motion)return hs(n,t)}):ye(n,i,t,function(t){return hs(n,t)}))}function fb(n){var t=this,i,u;n.target&&n.target!=t.display.input.getField()||(t.curOp.focus=vt(),w(t,n))||(e&&l<11&&27==n.keyCode&&(n.returnValue=!1),i=n.keyCode,t.display.shift=16==i||n.shiftKey,u=ub(t,n),bt&&(cs=u?i:null,u||88!=i||hk||!(at?n.metaKey:n.ctrlKey)||t.replaceSelection("",null,"cut")),oi&&!at&&!u&&46==i&&n.shiftKey&&!n.ctrlKey&&document.execCommand&&document.execCommand("cut"),18!=i||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||function(n){function t(n){18!=n.keyCode&&n.altKey||(yi(i,"CodeMirror-crosshair"),ct(document,"keyup",t),ct(document,"mouseover",t))}var i=n.display.lineDiv;ur(i,"CodeMirror-crosshair");r(document,"keyup",t);r(document,"mouseover",t)}(t))}function eb(n){16==n.keyCode&&(this.doc.sel.shift=!1);w(this,n)}function ob(n){var t=this,i,r,u;if(!(n.target&&n.target!=t.display.input.getField()||li(t.display,n)||w(t,n)||n.ctrlKey&&!n.altKey||at&&n.metaKey)){if(i=n.keyCode,r=n.charCode,bt&&i==cs)return cs=null,void ut(n);bt&&(!n.which||n.which<10)&&ub(t,n)||(u=String.fromCharCode(null==r?i:r),"\b"!=u&&(function(n,t,i){return ye(n,"'"+i+"'",t,function(t){return hs(n,t,!0)})}(t,n,u)||t.display.input.onKeyPress(n)))}}function sb(i){var s=this,h=s.display;if(!(w(s,i)||h.activeTouch&&h.input.supportsTouch()))if(h.input.ensurePolled(),h.shift=i.shiftKey,li(h,i))it||(h.scroller.draggable=!1,setTimeout(function(){return h.scroller.draggable=!0},100));else if(!ta(s,i)){var c=yr(s,i),a=wa(i),v=c?function(n,t){var i=+new Date;return we&&we.compare(i,n,t)?(pe=we=null,"triple"):pe&&pe.compare(i,n,t)?(we=new ls(i,n,t),pe=null,"double"):(pe=new ls(i,n,t),we=null,"single")}(c,a):"single";window.focus();1==a&&s.state.selectingText&&s.state.selectingText(i);c&&function(n,t,i,r,u){var f="Click";return"double"==r?f="Double"+f:"triple"==r&&(f="Triple"+f),ye(n,dw(f=(1==t?"Left":2==t?"Middle":"Right")+f,u),u,function(t){if("string"==typeof t&&(t=uf[t]),!t)return!1;var r=!1;try{n.isReadOnly()&&(n.state.suppressEdits=!0);r=t(n,i)!=ro}finally{n.state.suppressEdits=!1}return r})}(s,a,c,v,i)||(1==a?c?function(i,s,h,c){e?setTimeout(ks(dy,i),0):i.curOp.focus=vt();var a,v=function(n,t,i){var u=n.getOption("configureMouse"),r=u?u(n,t,i):{},f;return null==r.unit&&(f=uk?i.shiftKey&&i.metaKey:i.altKey,r.unit=f?"rectangle":"single"==t?"char":"double"==t?"word":"line"),(null==r.extend||n.doc.extend)&&(r.extend=n.doc.extend||i.shiftKey),null==r.addNew&&(r.addNew=at?i.metaKey:i.ctrlKey),null==r.moveOnDrag&&(r.moveOnDrag=!(at?i.altKey:i.ctrlKey)),r}(i,h,c),y=i.doc.sel;i.options.dragDrop&&ba&&!i.isReadOnly()&&"single"==h&&(a=y.contains(s))>-1&&(u((a=y.ranges[a]).from(),s)<0||s.xRel>0)&&(u(a.to(),s)>0||s.xRel<0)?function(n,t,i,u){var f=n.display,s=!1,o=k(n,function(t){it&&(f.scroller.draggable=!1);n.state.draggingText=!1;n.state.delayingBlurEvent&&(n.hasFocus()?n.state.delayingBlurEvent=!1:nl(n));ct(f.wrapper.ownerDocument,"mouseup",o);ct(f.wrapper.ownerDocument,"mousemove",h);ct(f.scroller,"dragstart",c);ct(f.scroller,"drop",o);s||(ut(t),u.addNew||us(n.doc,i,null,null,u.extend),it&&!no||e&&9==l?setTimeout(function(){f.wrapper.ownerDocument.body.focus({preventScroll:!0});f.input.focus()},20):f.input.focus())}),h=function(n){s=s||Math.abs(t.clientX-n.clientX)+Math.abs(t.clientY-n.clientY)>=10},c=function(){return s=!0};it&&(f.scroller.draggable=!0);n.state.draggingText=o;o.copy=!u.moveOnDrag;r(f.wrapper.ownerDocument,"mouseup",o);r(f.wrapper.ownerDocument,"mousemove",h);r(f.scroller,"dragstart",c);r(f.scroller,"drop",o);n.state.delayingBlurEvent=!0;setTimeout(function(){return f.input.focus()},20);f.scroller.dragDrop&&f.scroller.dragDrop()}(i,c,s,v):function(i,s,h,c){function ot(r){var k,v,rt;if(0!=u(g,r))if(g=r,"rectangle"==c.unit){for(var s=[],b=i.options.tabSize,ut=yt(t(l,h.line).text,h.ch,b),ft=yt(t(l,r.line).text,r.ch,b),et=Math.min(ut,ft),ot=Math.max(ut,ft),e=Math.min(h.line,r.line),st=Math.min(i.lastLine(),Math.max(h.line,r.line));e<=st;e++)k=t(l,e).text,v=gs(k,et,b),et==ot?s.push(new o(n(e,v),n(e,v))):k.length>v&&s.push(new o(n(e,v),n(e,gs(k,ot,b))));s.length||s.push(new o(h,h));tt(l,gt(i,w.ranges.slice(0,a).concat(s),a),{origin:"*mouse",scroll:!1});i.scrollIntoView(r)}else{var nt,it=y,p=hb(i,r,c.unit),d=it.anchor;u(p.anchor,d)>0?(nt=p.head,d=so(it.from(),p.anchor)):(nt=p.anchor,d=oo(it.to(),p.head));rt=w.ranges.slice(0);rt[a]=function(i,r){var f=r.anchor,e=r.head,d=t(i.doc,f.line),s,l,h,a,c,v,y;if(0==u(f,e)&&f.sticky==e.sticky||(s=hi(d),!s)||(l=af(s,f.ch,f.sticky),h=s[l],h.from!=f.ch&&h.to!=f.ch)||(c=l+(h.from==f.ch==(1!=h.level)?0:1),0==c||c==s.length))return r;e.line!=f.line?a=(e.line-f.line)*("ltr"==i.doc.direction?1:-1)>0:(v=af(s,e.ch,e.sticky),y=v-l||(e.ch-f.ch)*(1==h.level?-1:1),a=v==c-1||v==c?y<0:y>0);var p=s[c+(a?-1:0)],w=a==(1==p.level),b=w?p.from:p.to,k=w?"after":"before";return f.ch==b&&f.sticky==k?r:new o(new n(f.line,b,k),e)}(i,new o(f(l,d),nt));tt(l,gt(i,rt,a),ds)}}function rt(n){var e=++b,t=yr(i,n,!0,"rectangle"==c.unit),r,f;t&&(0!=u(t,g)?(i.curOp.focus=vt(),ot(t),r=ns(v,l),(t.line>=r.to||t.line<r.from)&&setTimeout(k(i,function(){b==e&&rt(n)}),150)):(f=n.clientY<it.top?-20:n.clientY>it.bottom?20:0,f&&setTimeout(k(i,function(){b==e&&(v.scroller.scrollTop+=f,rt(n))}),50)))}function et(n){i.state.selectingText=!1;b=1/0;n&&(ut(n),v.input.focus());ct(v.wrapper.ownerDocument,"mousemove",ft);ct(v.wrapper.ownerDocument,"mouseup",nt);l.history.lastSelOrigin=null}var v,l,y,a,w,p,d,g,it,b,ft,nt;e&&nl(i);v=i.display;l=i.doc;ut(s);w=l.sel;p=w.ranges;(c.addNew&&!c.extend?(a=l.sel.contains(h),y=a>-1?p[a]:new o(h,h)):(y=l.sel.primary(),a=l.sel.primIndex),"rectangle"==c.unit)?(c.addNew||(y=new o(h,h)),h=yr(i,s,!0,!0),a=-1):(d=hb(i,h,c.unit),y=c.extend?yl(y,d.anchor,d.head,c.extend):d);c.addNew?-1==a?(a=p.length,tt(l,gt(i,p.concat([y]),a),{scroll:!1,origin:"*mouse"})):p.length>1&&p[a].empty()&&"char"==c.unit&&!c.extend?(tt(l,gt(i,p.slice(0,a).concat(p.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),w=l.sel):pl(l,a,y,ds):(a=0,tt(l,new st([y],0),ds),w=l.sel);g=h;it=v.wrapper.getBoundingClientRect();b=0;ft=k(i,function(n){0!==n.buttons&&wa(n)?rt(n):et(n)});nt=k(i,et);i.state.selectingText=nt;r(v.wrapper.ownerDocument,"mousemove",ft);r(v.wrapper.ownerDocument,"mouseup",nt)}(i,c,s,v)}(s,c,v,i):eh(i)==h.scroller&&ut(i):2==a?(c&&us(s.doc,c),setTimeout(function(){return h.input.focus()},20)):3==a&&(io?s.display.input.onContextMenu(i):nl(s)))}}function hb(t,i,r){if("char"==r)return new o(i,i);if("word"==r)return t.findWordAt(i);if("line"==r)return new o(n(i.line,0),f(t.doc,n(i.line+1,0)));var u=r(t,i);return new o(u.from,u.to)}function cb(n,t,i,r){var e,u,o,s,f,h;if(t.touches)e=t.touches[0].clientX,u=t.touches[0].clientY;else try{e=t.clientX;u=t.clientY}catch(n){return!1}if(e>=Math.floor(n.display.gutters.getBoundingClientRect().right))return!1;if(r&&ut(t),o=n.display,s=o.lineDiv.getBoundingClientRect(),u>s.bottom||!pt(n,i))return fh(t);for(u-=s.top-o.viewOffset,f=0;f<n.display.gutterSpecs.length;++f)if(h=o.gutters.childNodes[f],h&&h.getBoundingClientRect().right>=e)return p(n,i,n,hr(n.doc,u),n.display.gutterSpecs[f].className,t),fh(t)}function ta(n,t){return cb(n,t,"gutterClick",!0)}function lb(n,t){li(n.display,t)||function(n,t){return!!pt(n,"gutterContextMenu")&&cb(n,t,"gutterContextMenu",!1)}(n,t)||w(n,t,"contextmenu")||io||n.display.input.onContextMenu(t)}function ab(n){n.display.wrapper.className=n.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+n.options.theme.replace(/(^|\s)\s*/g," cm-s-");gf(n)}function tg(n,t,i){if(!t!=!(i&&i!=ff)){var u=n.display.dragFunctions,f=t?r:ct;f(n.display.scroller,"dragstart",u.start);f(n.display.scroller,"dragenter",u.enter);f(n.display.scroller,"dragover",u.over);f(n.display.scroller,"dragleave",u.leave);f(n.display.scroller,"drop",u.drop)}}function ig(n){n.options.lineWrapping?(ur(n.display.wrapper,"CodeMirror-wrap"),n.display.sizer.style.minWidth="",n.display.sizerWidth=null):(yi(n.display.wrapper,"CodeMirror-wrap"),ec(n));dc(n);ft(n);gf(n);setTimeout(function(){return au(n)},100)}function a(t,u){var c=this,s,b,h,v,y;if(!(this instanceof a))return new a(t,u);this.options=u=u?fr(u):{};fr(vb,u,!1);s=u.value;"string"==typeof s?s=new lt(s,u.mode,null,u.lineSeparator,u.direction):u.mode&&(s.modeOption=u.mode);this.doc=s;b=new a.inputStyles[u.inputStyle](this);h=this.display=new yd(t,s,b,u);for(v in h.wrapper.CodeMirror=this,ab(this),u.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),rp(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 si,keySeq:null,specialChars:null},u.autofocus&&!sf&&h.input.focus(),e&&l<11&&setTimeout(function(){return c.display.input.reset(!0)},20),function(t){function a(){u.activeTouch&&(c=setTimeout(function(){return u.activeTouch=null},1e3),(h=u.activeTouch).end=+new Date)}function v(n,t){if(null==t.left)return!0;var i=t.left-n.left,r=t.top-n.top;return i*i+r*r>400}var u=t.display,c,h,s;r(u.scroller,"mousedown",k(t,sb));r(u.scroller,"dblclick",e&&l<11?k(t,function(n){var i,r;w(t,n)||(i=yr(t,n),!i||ta(t,n)||li(t.display,n)||(ut(n),r=t.findWordAt(i),us(t.doc,r.anchor,r.head)))}):function(n){return w(t,n)||ut(n)});r(u.scroller,"contextmenu",function(n){return lb(t,n)});r(u.input.getField(),"contextmenu",function(n){u.scroller.contains(n.target)||lb(t,n)});h={end:0};r(u.scroller,"touchstart",function(n){if(!w(t,n)&&!function(n){if(1!=n.touches.length)return!1;var t=n.touches[0];return t.radiusX<=1&&t.radiusY<=1}(n)&&!ta(t,n)){u.input.ensurePolled();clearTimeout(c);var i=+new Date;u.activeTouch={start:i,moved:!1,prev:i-h.end<=300?h:null};1==n.touches.length&&(u.activeTouch.left=n.touches[0].pageX,u.activeTouch.top=n.touches[0].pageY)}});r(u.scroller,"touchmove",function(){u.activeTouch&&(u.activeTouch.moved=!0)});r(u.scroller,"touchend",function(i){var r=u.activeTouch,s,e;r&&!li(u,i)&&null!=r.left&&!r.moved&&new Date-r.start<300&&(e=t.coordsChar(u.activeTouch,"page"),s=!r.prev||v(r,r.prev)?new o(e,e):!r.prev.prev||v(r,r.prev.prev)?t.findWordAt(e):new o(n(e.line,0),f(t.doc,n(e.line+1,0))),t.setSelection(s.anchor,s.head),t.focus(),ut(i));a()});r(u.scroller,"touchcancel",a);r(u.scroller,"scroll",function(){u.scroller.clientHeight&&(ie(t,u.scroller.scrollTop),wr(t,u.scroller.scrollLeft,!0),p(t,"scroll",t))});r(u.scroller,"mousewheel",function(n){return cp(t,n)});r(u.scroller,"DOMMouseScroll",function(n){return cp(t,n)});r(u.wrapper,"scroll",function(){return u.wrapper.scrollTop=u.wrapper.scrollLeft=0});u.dragFunctions={enter:function(n){w(t,n)||vf(n)},over:function(n){w(t,n)||(function(n,t){var u=yr(n,t),r;u&&(r=document.createDocumentFragment(),ky(n,u,r),n.display.dragCursor||(n.display.dragCursor=i("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),n.display.lineSpace.insertBefore(n.display.dragCursor,n.display.cursorDiv)),ht(n.display.dragCursor,r))}(t,n),vf(n))},start:function(n){return function(n,t){if(e&&(!n.state.draggingText||+new Date-bl<100))vf(t);else if(!w(n,t)&&!li(n.display,t)&&(t.dataTransfer.setData("Text",n.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!no)){var r=i("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";bt&&(r.width=r.height=1,n.display.wrapper.appendChild(r),r._top=r.offsetTop);t.dataTransfer.setDragImage(r,0,0);bt&&r.parentNode.removeChild(r)}}(t,n)},drop:k(t,kd),leave:function(n){w(t,n)||ww(t)}};s=u.input.getField();r(s,"keyup",function(n){return eb.call(t,n)});r(s,"keydown",k(t,fb));r(s,"keypress",k(t,ob));r(s,"focus",function(n){return tl(t,n)});r(s,"blur",function(n){return hu(t,n)})}(this),function(){var n;kl||(r(window,"resize",function(){null==n&&(n=setTimeout(function(){n=null;bw(dd)},100))}),r(window,"blur",function(){return bw(hu)}),kl=!0)}(),br(this),this.curOp.forceUpdate=!0,yp(this,s),u.autofocus&&!sf||this.hasFocus()?setTimeout(function(){c.hasFocus()&&!c.state.focused&&tl(c)},20):hu(this),as)as.hasOwnProperty(v)&&as[v](this,u[v],ff);for(op(this),u.finishInit&&u.finishInit(this),y=0;y<vs.length;++y)vs[y](this);kr(this);it&&u.lineWrapping&&"optimizelegibility"==getComputedStyle(h.lineDiv).textRendering&&(h.lineDiv.style.textRendering="auto")}function be(i,r,u,f){var d,s=i.doc,e,c,l,y,w,a,b,k;null==u&&(u="add");"smart"==u&&(s.mode.indent?d=wf(i,r).state:u="prev");var v=i.options.tabSize,h=t(s,r),p=yt(h.text,null,v);if(h.stateAfter&&(h.stateAfter=null),c=h.text.match(/^\s*/)[0],f||/\S/.test(h.text)){if("smart"==u&&((e=s.mode.indent(d,h.text.slice(c.length),h.text))==ro||e>150)){if(!f)return;u="prev"}}else e=0,u="not";if("prev"==u?e=r>s.first?yt(t(s,r-1).text,null,v):0:"add"==u?e=p+i.options.indentUnit:"subtract"==u?e=p-i.options.indentUnit:"number"==typeof u&&(e=p+u),e=Math.max(0,e),l="",y=0,i.options.indentWithTabs)for(w=Math.floor(e/v);w;--w)y+=v,l+="\t";if(y<e&&(l+=nh(e-y)),l!=c)return wu(s,l,n(r,0),n(r,c.length),"+input"),h.stateAfter=null,!0;for(a=0;a<s.sel.ranges.length;a++)if(b=s.sel.ranges[a],b.head.line==r&&b.head.ch<c.length){k=n(r,c.length);pl(s,a,new o(k,k));break}}function ys(n){wt=n}function ia(i,r,u,f,e){var p=i.doc,y,g,v,k;i.display.shift=!1;f||(f=p.sel);var d=+new Date-200,l="paste"==e||i.state.pasteIncoming>d,a=ch(r),o=null;if(l&&f.ranges.length>1)if(wt&&wt.text.join("\n")==r){if(f.ranges.length%wt.text.length==0)for(o=[],y=0;y<wt.text.length;y++)o.push(p.splitLines(wt.text[y]))}else a.length==f.ranges.length&&i.options.pasteLinesPerSelection&&(o=uo(a,function(n){return[n]}));for(g=i.curOp.updateInput,v=f.ranges.length-1;v>=0;v--){var w=f.ranges[v],h=w.from(),c=w.to();w.empty()&&(u&&u>0?h=n(h.line,h.ch-u):i.state.overwrite&&!l?c=n(c.line,Math.min(t(p,c.line).text.length,c.ch+s(a).length)):l&&wt&&wt.lineWise&&wt.text.join("\n")==a.join("\n")&&(h=c=n(h.line,0)));k={from:h,to:c,text:o?o[v%o.length]:a,origin:e||(l?"paste":i.state.cutIncoming>d?"cut":"+input")};pu(i.doc,k);b(i,"inputRead",i,k)}r&&!l&&pb(i,r);cu(i);i.curOp.updateInput<2&&(i.curOp.updateInput=g);i.curOp.typing=!0;i.state.pasteIncoming=i.state.cutIncoming=-1}function yb(n,t){var i=n.clipboardData&&n.clipboardData.getData("Text");if(i)return n.preventDefault(),t.isReadOnly()||t.options.disableInput||et(t,function(){return ia(t,i,0,null,"paste")}),!0}function pb(n,i){var e,u,r,f,o,s;if(n.options.electricChars&&n.options.smartIndent)for(e=n.doc.sel,u=e.ranges.length-1;u>=0;u--)if(r=e.ranges[u],!(r.head.ch>100||u&&e.ranges[u-1].head.line==r.head.line)){if(f=n.getModeAt(r.head),o=!1,f.electricChars){for(s=0;s<f.electricChars.length;s++)if(i.indexOf(f.electricChars.charAt(s))>-1){o=be(n,r.head.line,"smart");break}}else f.electricInput&&f.electricInput.test(t(n.doc,r.head.line).text.slice(0,r.head.ch))&&(o=be(n,r.head.line,"smart"));o&&b(n,"electricInput",n,r.head.line)}}function wb(t){for(var u,i,f=[],e=[],r=0;r<t.doc.sel.ranges.length;r++)u=t.doc.sel.ranges[r].head.line,i={anchor:n(u,0),head:n(u+1,0)},e.push(i),f.push(t.getRange(i.anchor,i.head));return{text:f,ranges:e}}function bb(n,t,i,r){n.setAttribute("autocorrect",i?"":"off");n.setAttribute("autocapitalize",r?"":"off");n.setAttribute("spellcheck",!!t)}function kb(){var n=i("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=i("div",[n],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return it?n.style.width="1000px":n.setAttribute("wrap","off"),of&&(n.style.border="1px solid black"),bb(n),t}function ra(i,r,u,f,e){function h(s){var c,l,h,a;if("codepoint"==f?(h=o.text.charCodeAt(r.ch+(u>0?0:-1)),isNaN(h)?c=null:(a=u>0?h>=55296&&h<56320:h>=56320&&h<57343,c=new n(r.line,Math.max(0,Math.min(o.text.length,r.ch+u*(a?2:1))),-u))):c=e?function(t,i,r,u){var o=hi(i,t.doc.direction),v,f,l,e,b,p,c,a;if(!o||(r.ch>=i.text.length?(r.ch=i.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after"),v=af(o,r.ch,r.sticky),f=o[v],"ltr"==t.doc.direction&&f.level%2==0&&(u>0?f.to>r.ch:f.from<r.ch)))return gl(i,r,u);var y,s=function(t,r){return dl(i,t instanceof n?t.ch:t,r)},w=function(n){return t.options.lineWrapping?(y=y||eu(t,i),yy(t,i,y,n)):{begin:0,end:i.text.length}},h=w("before"==r.sticky?s(r,-1):r.ch);return("rtl"==t.doc.direction||1==f.level)&&(l=1==f.level==u<0,e=s(r,l?1:-1),null!=e&&(l?e<=f.to&&e<=h.end:e>=f.from&&e>=h.begin))?(b=l?"before":"after",new n(r.line,e,b)):(p=function(t,i,u){for(var c=function(t,i){return i?new n(r.line,s(t,1),"before"):new n(r.line,t,"after")};t>=0&&t<o.length;t+=i){var e=o[t],h=i>0==(1!=e.level),f=h?u.begin:s(u.end,-1);if(e.from<=f&&f<e.to||(f=h?e.from:s(e.to,-1),u.begin<=f&&f<u.end))return c(f,h)}},c=p(v+u,u,h),c)?c:(a=u>0?h.end:s(h.begin,-1),null==a||u>0&&a==i.text.length||!(c=p(u>0?0:o.length-1,u,w(a)))?null:c)}(i.cm,o,r,u):gl(o,r,u),null==c){if(s||(l=r.line+w)<i.first||l>=i.first+i.size||(r=new n(l,r.ch,r.sticky),!(o=t(i,l))))return!1;r=na(e,i.cm,o,r.line,w)}else r=c;return!0}var p=r,b=u,o=t(i,r.line),w=e&&"rtl"==i.direction?-u:u,l,s,a;if("char"==f||"codepoint"==f)h();else if("column"==f)h(!0);else if("word"==f||"group"==f)for(var v=null,y="group"==f,k=i.cm&&i.cm.getHelper(r,"wordChars"),c=!0;!(u<0)||h(!c);c=!1){if(l=o.text.charAt(r.ch)||"\n",s=fo(l,k)?"w":y&&"\n"==l?"n":!y||/\s/.test(l)?null:"p",!y||c||s||(s="s"),v&&v!=s){u<0&&(u=1,h(),r.sticky="after");break}if(s&&(v=s),u>0&&!h(!c))break}return a=es(i,r,p,b,!0),bh(p,a)&&(a.hitSide=!0),a}function db(n,t,i,r){var u,f,s=n.doc,h=t.left,e,o;for("page"==r?(e=Math.min(n.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),o=Math.max(e-.5*ou(n.display),3),u=(i>0?t.bottom:t.top)+i*o):"line"==r&&(u=i>0?t.bottom+3:t.top-3);(f=pc(n,h,u)).outside;){if(i<0?u<=0:u>=s.height){f.hitSide=!0;break}u+=5*i}return f}function gb(n,i){var u=cc(n,i.line),r;if(!u||u.hidden)return null;var f=t(n.doc,i.line),s=uy(u,f,i.line),e=hi(f,n.doc.direction),o="left";return e&&(o=af(e,i.ch)%2?"right":"left"),r=ey(s.map,i.ch,o),r.offset="right"==r.collapse?r.end:r.start,r}function ef(n,t){return t&&(n.bad=!0),n}function ps(t,i,r){var u,f,e;if(i==t.display.lineDiv){if(!(u=t.display.lineDiv.childNodes[r]))return ef(t.clipPos(n(t.display.viewTo-1)),!0);i=null;r=0}else for(u=i;;u=u.parentNode){if(!u||u==t.display.lineDiv)return null;if(u.parentNode&&u.parentNode==t.display.lineDiv)break}for(f=0;f<t.display.view.length;f++)if(e=t.display.view[f],e.node==u)return rg(e,i,r)}function rg(t,i,r){function w(i,r,u){for(var o,e,s,l,h,f=-1;f<(v?v.length:0);f++)for(o=f<0?p.map:v[f],e=0;e<o.length;e+=3)if(s=o[e+2],s==i||s==r)return l=c(f<0?t.line:t.rest[f]),h=o[e]+u,(u<0||s!=i)&&(h=o[e+(u?1:0)]),n(l,h)}var a=t.text.firstChild,l=!1,y,f,e,p,v,u,o,b,h,k;if(!i||!wi(a,i))return ef(n(c(t.line),0),!0);if(i==a&&(l=!0,i=a.childNodes[r],r=0,!i))return y=t.rest?s(t.rest):t.line,ef(n(c(y),y.text.length),l);for(f=3==i.nodeType?i:null,e=i,f||1!=i.childNodes.length||3!=i.firstChild.nodeType||(f=i.firstChild,r&&(r=f.nodeValue.length));e.parentNode!=a;)e=e.parentNode;if(p=t.measure,v=p.maps,u=w(f,e,r),u)return ef(u,l);for(o=e.nextSibling,b=f?f.nodeValue.length-r:0;o;o=o.nextSibling){if(u=w(o,o.firstChild,0))return ef(n(u.line,u.ch-b),l);b+=o.textContent.length}for(h=e.previousSibling,k=r;h;h=h.previousSibling){if(u=w(h,h.firstChild,-1))return ef(n(u.line,u.ch+k),l);k+=h.textContent.length}}var g=navigator.userAgent,ua=navigator.platform,oi=/gecko\/\d/i.test(g),fa=/MSIE \d/.test(g),ea=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(g),de=/Edge\/(\d+)/.exec(g),e=fa||ea||de,l=e&&(fa?document.documentMode||6:+(de||ea)[1]),it=!de&&/WebKit\//.test(g),tk=it&&/Qt\/\d+\.\d+/.test(g),ge=!de&&/Chrome\//.test(g),bt=/Opera\//.test(g),no=/Apple Computer/.test(navigator.vendor),ik=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(g),rk=/PhantomJS/.test(g),of=no&&(/Mobile\/\w+/.test(g)||navigator.maxTouchPoints>2),to=/Android/.test(g),sf=of||to||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(g),at=of||/Mac/.test(ua),uk=/\bCrOS\b/.test(g),fk=/win/i.test(ua),rr=bt&&g.match(/Version\/(\d*\.\d*)/),ws,io,gr,yi,tu,si,cf,ha,la,iu,va,rh,r,oh,sh,ba,er,y,pf,kt,nc,tc,ii,cr,vv,yv,lr,fu,vr,lc,gi,lu,ul,up,fe,oe,ot,st,o,bu,wl,ai,du,pw,lt,bl,kl,vi,gu,ve,nf,ei,uf,ib,cs,pe,we,ls,vs,wt,h,v,nk,ke;rr&&(rr=Number(rr[1]));rr&&rr>=15&&(bt=!1,it=!0);ws=at&&(tk||bt&&(null==rr||rr<12.11));io=oi||e&&l>=9;yi=function(n,t){var r=n.className,i=dr(t).exec(r),u;i&&(u=r.slice(i.index+i[0].length),n.className=r.slice(0,i.index)+(u?i[1]+u:""))};gr=document.createRange?function(n,t,i,r){var u=document.createRange();return u.setEnd(r||n,i),u.setStart(n,t),u}:function(n,t,i){var r=document.body.createTextRange();try{r.moveToElementText(n.parentNode)}catch(n){return r}return r.collapse(!0),r.moveEnd("character",i),r.moveStart("character",t),r};tu=function(n){n.select()};of?tu=function(n){n.selectionStart=0;n.selectionEnd=n.value.length}:e&&(tu=function(n){try{n.select()}catch(n){}});si=function(){this.id=null;this.f=null;this.time=0;this.handler=ks(this.onTimeout,this)};si.prototype.onTimeout=function(n){n.id=0;n.time<=+new Date?n.f():setTimeout(n.handler,n.time-+new Date)};si.prototype.set=function(n,t){this.f=t;var i=+new Date+n;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,n),this.time=i)};var ro={toString:function(){return"CodeMirror.Pass"}},ni={scroll:!1},ds={origin:"*mouse"},hf={origin:"+move"};cf=[""];ha=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;la=/[\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]/;iu=null;va=function(){function n(n,t,i){this.level=n;this.from=t;this.to=i}var f=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,i=/[LRr]/,r=/[Lb1n]/,u=/[1n]/;return function(e,o){var nt="ltr"==o?"L":"R",ut,at,vt,tt,yt,ft,d,g,st,p,pt,w,kt,ht,et,wt,ct,b,k,it,a,c,gt,v,ti;if(0==e.length||"ltr"==o&&!f.test(e))return!1;for(var y,l=e.length,h=[],lt=0;lt<l;++lt)h.push((y=e.charCodeAt(lt))<=247?"bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN".charAt(y):1424<=y&&y<=1524?"R":1536<=y&&y<=1785?"nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111".charAt(y-1536):1774<=y&&y<=2220?"r":8192<=y&&y<=8203?"w":8204==y?"b":"L");for(ut=0,at=nt;ut<l;++ut)vt=h[ut],"m"==vt?h[ut]=at:at=vt;for(tt=0,yt=nt;tt<l;++tt)ft=h[tt],"1"==ft&&"r"==yt?h[tt]="n":i.test(ft)&&(yt=ft,"r"==ft&&(h[tt]="R"));for(d=1,g=h[0];d<l-1;++d)st=h[d],"+"==st&&"1"==g&&"1"==h[d+1]?h[d]="1":","!=st||g!=h[d+1]||"1"!=g&&"n"!=g||(h[d]=g),g=st;for(p=0;p<l;++p)if(pt=h[p],","==pt)h[p]="N";else if("%"==pt){for(w=void 0,w=p+1;w<l&&"%"==h[w];++w);for(kt=p&&"!"==h[p-1]||w<l&&"1"==h[w]?"1":"N",ht=p;ht<w;++ht)h[ht]=kt;p=w-1}for(et=0,wt=nt;et<l;++et)ct=h[et],"L"==wt&&"1"==ct?h[et]="L":i.test(ct)&&(wt=ct);for(b=0;b<l;++b)if(t.test(h[b])){for(k=void 0,k=b+1;k<l&&t.test(h[k]);++k);for(var dt="L"==(b?h[b-1]:nt),ii=dt==("L"==(k<l?h[k]:nt))?dt?"L":"R":nt,bt=b;bt<k;++bt)h[bt]=ii;b=k-1}for(a=[],c=0;c<l;)if(r.test(h[c])){for(gt=c,++c;c<l&&r.test(h[c]);++c);a.push(new n(0,gt,c))}else{var rt=c,ot=a.length,ni="rtl"==o?1:0;for(++c;c<l&&"L"!=h[c];++c);for(v=rt;v<c;)if(u.test(h[v])){for(rt<v&&(a.splice(ot,0,new n(1,rt,v)),ot+=ni),ti=v,++v;v<c&&u.test(h[v]);++v);a.splice(ot,0,new n(2,ti,v));ot+=ni;rt=v}else++v;rt<c&&a.splice(ot,0,new n(1,rt,c))}return"ltr"==o&&(1==a[0].level&&(it=e.match(/^\s+/))&&(a[0].from=it[0].length,a.unshift(new n(0,0,it[0].length))),1==s(a).level&&(it=e.match(/\s+$/))&&(s(a).to-=it[0].length,a.push(new n(0,l-it[0].length,l)))),"rtl"==o?a.reverse():a}}();rh=[];r=function(n,t,i){if(n.addEventListener)n.addEventListener(t,i,!1);else if(n.attachEvent)n.attachEvent("on"+t,i);else{var r=n._handlers||(n._handlers={});r[t]=(r[t]||rh).concat(i)}};ba=function(){if(e&&l<9)return!1;var n=i("div");return"draggable"in n||"dragDrop"in n}();var hh,ch=3!="\n\nb".split(/\n/).length?function(n){for(var t,r,u,i=0,f=[],e=n.length;i<=e;)t=n.indexOf("\n",i),-1==t&&(t=n.length),r=n.slice(i,"\r"==n.charAt(t-1)?t-1:t),u=r.indexOf("\r"),-1!=u?(f.push(r.slice(0,u)),i+=u+1):(f.push(r),i=t+1);return f}:function(n){return n.split(/\r\n?|\n/)},sk=window.getSelection?function(n){try{return n.selectionStart!=n.selectionEnd}catch(n){return!1}}:function(n){var t;try{t=n.ownerDocument.selection.createRange()}catch(n){}return!(!t||t.parentElement()!=n)&&0!=t.compareEndPoints("StartToEnd",t)},hk="oncopy"in(hh=i("div"))||(hh.setAttribute("oncopy","return;"),"function"==typeof hh.oncopy),lh=null,ah={},uu={};for(er={},y=function(n,t,i){this.pos=this.start=0;this.string=n;this.tabSize=t||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0;this.lineOracle=i},y.prototype.eol=function(){return this.pos>=this.string.length},y.prototype.sol=function(){return this.pos==this.lineStart},y.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},y.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},y.prototype.eat=function(n){var t=this.string.charAt(this.pos);if("string"==typeof n?t==n:t&&(n.test?n.test(t):n(t)))return++this.pos,t},y.prototype.eatWhile=function(n){for(var t=this.pos;this.eat(n););return this.pos>t},y.prototype.eatSpace=function(){for(var n=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>n},y.prototype.skipToEnd=function(){this.pos=this.string.length},y.prototype.skipTo=function(n){var t=this.string.indexOf(n,this.pos);if(t>-1)return this.pos=t,!0},y.prototype.backUp=function(n){this.pos-=n},y.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=yt(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?yt(this.string,this.lineStart,this.tabSize):0)},y.prototype.indentation=function(){return yt(this.string,null,this.tabSize)-(this.lineStart?yt(this.string,this.lineStart,this.tabSize):0)},y.prototype.match=function(n,t,i){var r,u;return"string"!=typeof n?(r=this.string.slice(this.pos).match(n),r&&r.index>0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)):(u=function(n){return i?n.toLowerCase():n},u(this.string.substr(this.pos,n.length))==u(n)?(!1!==t&&(this.pos+=n.length),!0):void 0)},y.prototype.current=function(){return this.string.slice(this.start,this.pos)},y.prototype.hideFirstChars=function(n,t){this.lineStart+=n;try{return t()}finally{this.lineStart-=n}},y.prototype.lookAhead=function(n){var t=this.lineOracle;return t&&t.lookAhead(n)},y.prototype.baseToken=function(){var n=this.lineOracle;return n&&n.baseToken(this.pos)},pf=function(n,t){this.state=n;this.lookAhead=t},kt=function(n,t,i,r){this.state=t;this.doc=n;this.line=i;this.maxLookAhead=r||0;this.baseTokens=null;this.baseTokenPos=1},kt.prototype.lookAhead=function(n){var t=this.doc.getLine(this.line+n);return null!=t&&n>this.maxLookAhead&&(this.maxLookAhead=n),t},kt.prototype.baseToken=function(n){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=n;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-n}},kt.prototype.nextLine=function(){this.line++;this.maxLookAhead>0&&this.maxLookAhead--},kt.fromSaved=function(n,t,i){return t instanceof pf?new kt(n,or(n.mode,t.state),i,t.lookAhead):new kt(n,or(n.mode,t),i)},kt.prototype.save=function(n){var t=!1!==n?or(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new pf(t,this.maxLookAhead):t},nc=function(n,t,i){this.start=n.start;this.end=n.pos;this.string=n.current();this.type=t||null;this.state=i},tc=!1,ii=!1,cr=function(n,t,i){this.text=n;sv(this,t);this.height=i?i(this):1},cr.prototype.lineNo=function(){return c(this)},ru(cr),vv={},yv={},lr=null,fu=null,lc={left:0,right:0,top:0,bottom:0},gi=function(n,t,u){this.cm=u;var f=this.vert=i("div",[i("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=i("div",[i("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");f.tabIndex=o.tabIndex=-1;n(f);n(o);r(f,"scroll",function(){f.clientHeight&&t(f.scrollTop,"vertical")});r(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")});this.checkedZeroWidth=!1;e&&l<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")},gi.prototype.update=function(n){var i=n.scrollWidth>n.clientWidth+1,r=n.scrollHeight>n.clientHeight+1,t=n.nativeBarWidth,u,f;return r?(this.vert.style.display="block",this.vert.style.bottom=i?t+"px":"0",u=n.viewHeight-(i?t:0),this.vert.firstChild.style.height=Math.max(0,n.scrollHeight-n.clientHeight+u)+"px"):(this.vert.style.display="",this.vert.firstChild.style.height="0"),i?(this.horiz.style.display="block",this.horiz.style.right=r?t+"px":"0",this.horiz.style.left=n.barLeft+"px",f=n.viewWidth-n.barLeft-(r?t:0),this.horiz.firstChild.style.width=Math.max(0,n.scrollWidth-n.clientWidth+f)+"px"):(this.horiz.style.display="",this.horiz.firstChild.style.width="0"),!this.checkedZeroWidth&&n.clientHeight>0&&(0==t&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?t:0,bottom:i?t:0}},gi.prototype.setScrollLeft=function(n){this.horiz.scrollLeft!=n&&(this.horiz.scrollLeft=n);this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},gi.prototype.setScrollTop=function(n){this.vert.scrollTop!=n&&(this.vert.scrollTop=n);this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},gi.prototype.zeroWidthHack=function(){var n=at&&!ik?"12px":"18px";this.horiz.style.height=this.vert.style.width=n;this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none";this.disableHoriz=new si;this.disableVert=new si},gi.prototype.enableZeroWidthBar=function(n,t,i){n.style.pointerEvents="auto";t.set(1e3,function r(){var u=n.getBoundingClientRect();("vert"==i?document.elementFromPoint(u.right-1,(u.top+u.bottom)/2):document.elementFromPoint((u.right+u.left)/2,u.bottom-1))!=n?n.style.pointerEvents="none":t.set(1e3,r)})},gi.prototype.clear=function(){var n=this.horiz.parentNode;n.removeChild(this.horiz);n.removeChild(this.vert)},lu=function(){},lu.prototype.update=function(){return{bottom:0,right:0}},lu.prototype.setScrollLeft=function(){},lu.prototype.setScrollTop=function(){},lu.prototype.clear=function(){},ul={"native":gi,"null":lu},up=0,fe=function(n,t,i){var r=n.display;this.viewport=t;this.visible=ns(r,n.doc,t);this.editorIsHidden=!r.wrapper.offsetWidth;this.wrapperHeight=r.wrapper.clientHeight;this.wrapperWidth=r.wrapper.clientWidth;this.oldDisplayWidth=ar(n);this.force=i;this.dims=bc(n);this.events=[]},fe.prototype.signal=function(n,t){pt(n,t)&&this.events.push(arguments)},fe.prototype.finish=function(){for(var n=0;n<this.events.length;n++)p.apply(null,this.events[n])},oe=0,ot=null,e?ot=-.53:oi?ot=15:ge?ot=-.7:no&&(ot=-1/3),st=function(n,t){this.ranges=n;this.primIndex=t},st.prototype.primary=function(){return this.ranges[this.primIndex]},st.prototype.equals=function(n){var t,i,r;if(n==this)return!0;if(n.primIndex!=this.primIndex||n.ranges.length!=this.ranges.length)return!1;for(t=0;t<this.ranges.length;t++)if(i=this.ranges[t],r=n.ranges[t],!bh(i.anchor,r.anchor)||!bh(i.head,r.head))return!1;return!0},st.prototype.deepCopy=function(){for(var t=[],n=0;n<this.ranges.length;n++)t[n]=new o(kh(this.ranges[n].anchor),kh(this.ranges[n].head));return new st(t,this.primIndex)},st.prototype.somethingSelected=function(){for(var n=0;n<this.ranges.length;n++)if(!this.ranges[n].empty())return!0;return!1},st.prototype.contains=function(n,t){var i,r;for(t||(t=n),i=0;i<this.ranges.length;i++)if(r=this.ranges[i],u(t,r.from())>=0&&u(n,r.to())<=0)return i;return-1},o=function(n,t){this.anchor=n;this.head=t},o.prototype.from=function(){return so(this.anchor,this.head)},o.prototype.to=function(){return oo(this.anchor,this.head)},o.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch},le.prototype={chunkSize:function(){return this.lines.length},removeInner:function(n,t){for(var r,i=n,u=n+t;i<u;++i)r=this.lines[i],this.height-=r.height,yk(r),b(r,"delete");this.lines.splice(n,t)},collapse:function(n){n.push.apply(n,this.lines)},insertInner:function(n,t,i){this.height+=i;this.lines=this.lines.slice(0,n).concat(t).concat(this.lines.slice(n));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(n,t,i){for(var r=n+t;n<r;++n)if(i(this.lines[n]))return!0}},ae.prototype={chunkSize:function(){return this.size},removeInner:function(n,t){var r,i,u,f,o,e;for(this.size-=t,r=0;r<this.children.length;++r)if(i=this.children[r],u=i.chunkSize(),n<u){if(f=Math.min(t,u-n),o=i.height,i.removeInner(n,f),this.height-=o-i.height,u==f&&(this.children.splice(r--,1),i.parent=null),0==(t-=f))break;n=0}else n-=u;this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof le))&&(e=[],this.collapse(e),this.children=[new le(e)],this.children[0].parent=this)},collapse:function(n){for(var t=0;t<this.children.length;++t)this.children[t].collapse(n)},insertInner:function(n,t,i){var u,r,o,s,f,e;for(this.size+=t.length,this.height+=i,u=0;u<this.children.length;++u){if(r=this.children[u],o=r.chunkSize(),n<=o){if(r.insertInner(n,t,i),r.lines&&r.lines.length>50){for(s=r.lines.length%25+25,f=s;f<r.lines.length;)e=new le(r.lines.slice(f,f+=25)),r.height-=e.height,this.children.splice(++u,0,e),e.parent=this;r.lines=r.lines.slice(0,s);this.maybeSpill()}break}n-=o}},maybeSpill:function(){var n,t,r,i;if(!(this.children.length<=10)){n=this;do t=new ae(n.children.splice(n.children.length-5,5)),n.parent?(n.size-=t.size,n.height-=t.height,r=nt(n.parent.children,n),n.parent.children.splice(r+1,0,t)):(i=new ae(n.children),i.parent=n,n.children=[i,t],n=i),t.parent=n.parent;while(n.children.length>10);n.parent.maybeSpill()}},iterN:function(n,t,i){for(var f,u,e,r=0;r<this.children.length;++r)if(f=this.children[r],u=f.chunkSize(),n<u){if(e=Math.min(t,u-n),f.iterN(n,e,i))return!0;if(0==(t-=e))break;n=0}else n-=u}},bu=function(n,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.doc=n;this.node=t},bu.prototype.clear=function(){var n=this.doc.cm,t=this.line.widgets,i=this.line,u=c(i),r,f;if(null!=u&&t){for(r=0;r<t.length;++r)t[r]==this&&t.splice(r--,1);t.length||(i.widgets=null);f=df(this);ti(i,Math.max(0,i.height-f));n&&(et(n,function(){vw(n,i,-f);ki(n,u,"widget")}),b(n,"lineWidgetCleared",n,this,u))}},bu.prototype.changed=function(){var r=this,u=this.height,n=this.doc.cm,t=this.line,i;this.height=null;i=df(this)-u;i&&(bi(this.doc,t)||ti(t,t.height+i),n&&et(n,function(){n.curOp.forceUpdate=!0;vw(n,t,i);b(n,"lineWidgetChanged",n,r,c(t))}))},ru(bu),wl=0,ai=function(n,t){this.lines=[];this.type=t;this.doc=n;this.id=++wl},ai.prototype.clear=function(){var n,e,r,t,i,f,h,l;if(!this.explicitlyCleared){n=this.doc.cm;e=n&&!n.curOp;(e&&br(n),pt(this,"clear"))&&(r=this.find(),r&&b(this,"clear",r.from,r.to));for(var u=null,o=null,s=0;s<this.lines.length;++s)t=this.lines[s],i=bf(t.markedSpans,this),n&&!this.collapsed?ki(n,c(t),"text"):n&&(null!=i.to&&(o=c(t)),null!=i.from&&(u=c(t))),t.markedSpans=ak(t.markedSpans,i),null==i.from&&this.collapsed&&!bi(this.doc,t)&&n&&ti(t,ou(n.display));if(n&&this.collapsed&&!n.options.lineWrapping)for(f=0;f<this.lines.length;++f)h=ri(this.lines[f]),l=vo(h),l>n.display.maxLineLength&&(n.display.maxLine=h,n.display.maxLineLength=l,n.display.maxLineChanged=!0);null!=u&&n&&this.collapsed&&ft(n,u,o+1);this.lines.length=0;this.explicitlyCleared=!0;this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,n&&rw(n.doc));n&&b(n,"markerCleared",n,this,u,o);e&&kr(n);this.parent&&this.parent.clear()}},ai.prototype.find=function(t,i){var f,o,e,r,u;for(null==t&&"bookmark"==this.type&&(t=1),e=0;e<this.lines.length;++e){if(r=this.lines[e],u=bf(r.markedSpans,this),null!=u.from&&(f=n(i?r:c(r),u.from),-1==t))return f;if(null!=u.to&&(o=n(i?r:c(r),u.to),1==t))return o}return f&&{from:f,to:o}},ai.prototype.changed=function(){var r=this,i=this.find(-1,!0),t=this,n=this.doc.cm;i&&n&&et(n,function(){var u=i.line,s=c(i.line),e=cc(n,s),o,f;(e&&(oy(e),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,bi(t.doc,u)||null==t.height)||(o=t.height,t.height=null,f=df(t)-o,f&&ti(u,u.height+f));b(n,"markerChanged",n,r)})},ai.prototype.attachLine=function(n){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;t.maybeHiddenMarkers&&-1!=nt(t.maybeHiddenMarkers,this)||(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(n)},ai.prototype.detachLine=function(n){if(this.lines.splice(nt(this.lines,n),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},ru(ai),du=function(n,t){this.markers=n;this.primary=t;for(var i=0;i<n.length;++i)n[i].parent=this},du.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var n=0;n<this.markers.length;++n)this.markers[n].clear();b(this,"clear")}},du.prototype.find=function(n,t){return this.primary.find(n,t)},ru(du),pw=0,lt=function g(t,i,r,u,f){if(!(this instanceof g))return new g(t,i,r,u,f);null==r&&(r=0);ae.call(this,[new le([new cr("",null)])]);this.first=r;this.scrollTop=this.scrollLeft=0;this.cantEdit=!1;this.cleanGeneration=1;this.modeFrontier=this.highlightFrontier=r;var e=n(r,0);this.sel=nr(e);this.history=new is(null);this.id=++pw;this.modeOption=i;this.lineSep=u;this.direction="rtl"==f?"rtl":"ltr";this.extend=!1;"string"==typeof t&&(t=this.splitLines(t));al(this,{from:e,to:e,text:t});tt(this,nr(e),ni)},(lt.prototype=sa(ae.prototype,{constructor:lt,iter:function(n,t,i){i?this.iterN(n-this.first,t-n,i):this.iterN(this.first,this.first+this.size,n)},insert:function(n,t){for(var r=0,i=0;i<t.length;++i)r+=t[i].height;this.insertInner(n-this.first,t,r)},remove:function(n,t){this.removeInner(n-this.first,t)},getValue:function(n){var t=ph(this,this.first,this.first+this.size);return!1===n?t:t.join(n||this.lineSeparator())},setValue:d(function(i){var r=n(this.first,0),u=this.first+this.size-1;pu(this,{from:r,to:n(u,t(this,u).text.length),text:this.splitLines(i),origin:"setValue",full:!0},!0);this.cm&&te(this.cm,0,0);tt(this,nr(r),ni)}),replaceRange:function(n,t,i,r){wu(this,n,t=f(this,t),i=i?f(this,i):t,r)},getRange:function(n,t,i){var r=sr(this,f(this,n),f(this,t));return!1===i?r:r.join(i||this.lineSeparator())},getLine:function(n){var t=this.getLineHandle(n);return t&&t.text},getLineHandle:function(n){if(yf(this,n))return t(this,n)},getLineNumber:function(n){return c(n)},getLineHandleVisualStart:function(n){return"number"==typeof n&&(n=t(this,n)),ri(n)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(n){return f(this,n)},getCursor:function(n){var t=this.sel.primary();return null==n||"head"==n?t.head:"anchor"==n?t.anchor:"end"==n||"to"==n||!1===n?t.to():t.from()},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:d(function(t,i,r){nw(this,f(this,"number"==typeof t?n(t,i||0):t),null,r)}),setSelection:d(function(n,t,i){nw(this,f(this,n),f(this,t||n),i)}),extendSelection:d(function(n,t,i){us(this,f(this,n),t&&f(this,t),i)}),extendSelections:d(function(n,t){gp(this,ga(this,n),t)}),extendSelectionsBy:d(function(n,t){gp(this,ga(this,uo(this.sel.ranges,n)),t)}),setSelections:d(function(n,t,i){if(n.length){for(var u=[],r=0;r<n.length;r++)u[r]=new o(f(this,n[r].anchor),f(this,n[r].head||n[r].anchor));null==t&&(t=Math.min(n.length-1,this.sel.primIndex));tt(this,gt(this.cm,u,t),i)}}),addSelection:d(function(n,t,i){var r=this.sel.ranges.slice(0);r.push(new o(f(this,n),f(this,t||n)));tt(this,gt(this.cm,r,r.length-1),i)}),getSelection:function(n){for(var t,u,r=this.sel.ranges,i=0;i<r.length;i++)u=sr(this,r[i].from(),r[i].to()),t=t?t.concat(u):u;return!1===n?t:t.join(n||this.lineSeparator())},getSelections:function(n){for(var i,u=[],r=this.sel.ranges,t=0;t<r.length;t++)i=sr(this,r[t].from(),r[t].to()),!1!==n&&(i=i.join(n||this.lineSeparator())),u[t]=i;return u},replaceSelection:function(n,t,i){for(var u=[],r=0;r<this.sel.ranges.length;r++)u[r]=n;this.replaceSelections(u,t,i||"+input")},replaceSelections:d(function(t,i,r){for(var h,c,s,e=[],l=this.sel,f=0;f<l.ranges.length;f++)h=l.ranges[f],e[f]={from:h.from(),to:h.to(),text:this.splitLines(t[f]),origin:r};for(c=i&&"end"!=i&&function(t,i,r){for(var v,y,h=[],e=n(t.first,0),c=e,f=0;f<i.length;f++){var l=i[f],s=ap(l.from,e,c),a=ap(tr(l),e,c);(e=l.to,c=a,"around"==r)?(v=t.sel.ranges[f],y=u(v.head,v.anchor)<0,h[f]=new o(y?a:s,y?s:a)):h[f]=new o(s,s)}return new st(h,t.sel.primIndex)}(this,e,i),s=e.length-1;s>=0;s--)pu(this,e[s]);c?tw(this,c):this.cm&&cu(this.cm)}),undo:d(function(){os(this,"undo")}),redo:d(function(){os(this,"redo")}),undoSelection:d(function(){os(this,"undo",!0)}),redoSelection:d(function(){os(this,"redo",!0)}),setExtending:function(n){this.extend=n},getExtending:function(){return this.extend},historySize:function(){for(var t,n=this.history,r=0,u=0,i=0;i<n.done.length;i++)n.done[i].ranges||++r;for(t=0;t<n.undone.length;t++)n.undone[t].ranges||++u;return{undo:r,redo:u}},clearHistory:function(){var n=this;this.history=new is(this.history);ir(this,function(t){return t.history=n.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(n){return n&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(n){return this.history.generation==(n||this.cleanGeneration)},getHistory:function(){return{done:vu(this.history.done),undone:vu(this.history.undone)}},setHistory:function(n){var t=this.history=new is(this.history);t.done=vu(n.done.slice(0),null,!0);t.undone=vu(n.undone.slice(0),null,!0)},setGutterMarker:d(function(n,t,i){return ce(this,n,"gutter",function(n){var r=n.gutterMarkers||(n.gutterMarkers={});return r[t]=i,!i&&ca(r)&&(n.gutterMarkers=null),!0})}),clearGutter:d(function(n){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[n]&&ce(t,i,"gutter",function(){return i.gutterMarkers[n]=null,ca(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(n){var i;if("number"==typeof n){if(!yf(this,n)||(i=n,!(n=t(this,n))))return null}else if(null==(i=c(n)))return null;return{line:i,handle:n,text:n.text,gutterMarkers:n.gutterMarkers,textClass:n.textClass,bgClass:n.bgClass,wrapClass:n.wrapClass,widgets:n.widgets}},addLineClass:d(function(n,t,i){return ce(this,n,"gutter"==t?"gutter":"class",function(n){var r="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass";if(n[r]){if(dr(i).test(n[r]))return!1;n[r]+=" "+i}else n[r]=i;return!0})}),removeLineClass:d(function(n,t,i){return ce(this,n,"gutter"==t?"gutter":"class",function(n){var f="text"==t?"textClass":"background"==t?"bgClass":"gutter"==t?"gutterClass":"wrapClass",u=n[f],r,e;if(!u)return!1;if(null==i)n[f]=null;else{if(r=u.match(dr(i)),!r)return!1;e=r.index+r[0].length;n[f]=u.slice(0,r.index)+(r.index&&e!=u.length?" ":"")+u.slice(e)||null}return!0})}),addLineWidget:d(function(n,t,i){return function(n,t,i,r){var u=new bu(n,i,r),f=n.cm;return f&&u.noHScroll&&(f.display.alignWidgets=!0),ce(n,t,"widget",function(t){var i=t.widgets||(t.widgets=[]),r;return(null==u.insertAt?i.push(u):i.splice(Math.min(i.length,Math.max(0,u.insertAt)),0,u),u.line=t,f&&!bi(n,t))&&(r=ci(t)<n.scrollTop,ti(t,t.height+df(u)),r&&rl(f,u.height),f.curOp.forceUpdate=!0),!0}),f&&b(f,"lineWidgetAdded",f,u,"number"==typeof t?t:c(t)),u}(this,n,t,i)}),removeLineWidget:function(n){n.clear()},markText:function(n,t,i){return ku(this,f(this,n),f(this,t),i,i&&i.type||"range")},setBookmark:function(n,t){var i={replacedWith:t&&(null==t.nodeType?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return ku(this,n=f(this,n),n,i,"bookmark")},findMarksAt:function(n){var e=[],u=t(this,(n=f(this,n)).line).markedSpans,r,i;if(u)for(r=0;r<u.length;++r)i=u[r],(null==i.from||i.from<=n.ch)&&(null==i.to||i.to>=n.ch)&&e.push(i.marker.parent||i.marker);return e},findMarks:function(n,t,i){n=f(this,n);t=f(this,t);var u=[],r=n.line;return this.iter(n.line,t.line+1,function(f){var s=f.markedSpans,o,e;if(s)for(o=0;o<s.length;o++)e=s[o],null!=e.to&&r==n.line&&n.ch>=e.to||null==e.from&&r!=n.line||null!=e.from&&r==t.line&&e.from>=t.ch||i&&!i(e.marker)||u.push(e.marker.parent||e.marker);++r}),u},getAllMarks:function(){var n=[];return this.iter(function(t){var r=t.markedSpans,i;if(r)for(i=0;i<r.length;++i)null!=r[i].from&&n.push(r[i].marker)}),n},posFromIndex:function(t){var i,r=this.first,u=this.lineSeparator().length;return this.iter(function(n){var f=n.text.length+u;if(f>t)return i=t,!0;t-=f;++r}),f(this,n(r,i))},indexFromPos:function(n){var t=(n=f(this,n)).ch,i;return n.line<this.first||n.ch<0?0:(i=this.lineSeparator().length,this.iter(this.first,n.line,function(n){t+=n.text.length+i}),t)},copy:function(n){var t=new lt(ph(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,n&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(n){var i,r,t;return n||(n={}),i=this.first,r=this.first+this.size,null!=n.from&&n.from>i&&(i=n.from),null!=n.to&&n.to<r&&(r=n.to),t=new lt(ph(this,i,r),n.mode||this.modeOption,i,this.lineSep,this.direction),n.sharedHist&&(t.history=this.history),(this.linked||(this.linked=[])).push({doc:t,sharedHist:n.sharedHist}),t.linked=[{doc:this,isParent:!0,sharedHist:n.sharedHist}],function(n,t){for(var f,r=0;r<t.length;r++){var i=t[r],e=i.find(),o=n.clipPos(e.from),s=n.clipPos(e.to);u(o,s)&&(f=ku(n,o,s,i.primary,i.primary.type),i.markers.push(f),f.parent=i)}}(t,yw(this)),t},unlinkDoc:function(n){var t,i;if(n instanceof a&&(n=n.doc),this.linked)for(t=0;t<this.linked.length;++t)if(this.linked[t].doc==n){this.linked.splice(t,1);n.unlinkDoc(this);bd(yw(this));break}n.history==this.history&&(i=[n.id],ir(n,function(n){return i.push(n.id)},!0),n.history=new is(null),n.history.done=vu(this.history.done,i),n.history.undone=vu(this.history.undone,i))},iterLinkedDocs:function(n){ir(this,n)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(n){return this.lineSep?n.split(this.lineSep):ch(n)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:d(function(n){var t;"rtl"!=n&&(n="ltr");n!=this.direction&&(this.direction=n,this.iter(function(n){return n.order=null}),this.cm&&et(t=this.cm,function(){pp(t);ft(t)}))})})).eachLine=lt.prototype.iter,bl=0,kl=!1,vi={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},gu=0;gu<10;gu++)vi[gu+48]=vi[gu+96]=String(gu);for(ve=65;ve<=90;ve++)vi[ve]=String.fromCharCode(ve);for(nf=1;nf<=12;nf++)vi[nf+111]=vi[nf+63235]="F"+nf;ei={};ei.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"};ei.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"};ei.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"};ei.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]};ei.default=at?ei.macDefault:ei.pcDefault;uf={selectAll:ew,singleSelection:function(n){return n.setSelection(n.getCursor("anchor"),n.getCursor("head"),ni)},killLine:function(i){return rf(i,function(r){if(r.empty()){var u=t(i.doc,r.head.line).text.length;return r.head.ch==u&&r.head.line<i.lastLine()?{from:r.head,to:n(r.head.line+1,0)}:{from:r.head,to:n(r.head.line,u)}}return{from:r.from(),to:r.to()}})},deleteLine:function(t){return rf(t,function(i){return{from:n(i.from().line,0),to:f(t.doc,n(i.to().line+1,0))}})},delLineLeft:function(t){return rf(t,function(t){return{from:n(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(n){return rf(n,function(t){var i=n.charCoords(t.head,"div").top+5;return{from:n.coordsChar({left:0,top:i},"div"),to:t.from()}})},delWrappedLineRight:function(n){return rf(n,function(t){var i=n.charCoords(t.head,"div").top+5,r=n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:r}})},undo:function(n){return n.undo()},redo:function(n){return n.redo()},undoSelection:function(n){return n.undoSelection()},redoSelection:function(n){return n.redoSelection()},goDocStart:function(t){return t.extendSelection(n(t.firstLine(),0))},goDocEnd:function(t){return t.extendSelection(n(t.lastLine()))},goLineStart:function(n){return n.extendSelectionsBy(function(t){return nb(n,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(n){return n.extendSelectionsBy(function(t){return tb(n,t.head)},{origin:"+move",bias:1})},goLineEnd:function(n){return n.extendSelectionsBy(function(i){return function(n,i){var r=t(n.doc,i),u=function(n){for(var t;t=ao(n);)n=t.find(1,!0).line;return n}(r);return u!=r&&(i=c(u)),na(!0,n,r,i,-1)}(n,i.head.line)},{origin:"+move",bias:-1})},goLineRight:function(n){return n.extendSelectionsBy(function(t){var i=n.cursorCoords(t.head,"div").top+5;return n.coordsChar({left:n.display.lineDiv.offsetWidth+100,top:i},"div")},hf)},goLineLeft:function(n){return n.extendSelectionsBy(function(t){var i=n.cursorCoords(t.head,"div").top+5;return n.coordsChar({left:0,top:i},"div")},hf)},goLineLeftSmart:function(n){return n.extendSelectionsBy(function(t){var r=n.cursorCoords(t.head,"div").top+5,i=n.coordsChar({left:0,top:r},"div");return i.ch<n.getLine(i.line).search(/\S/)?tb(n,t.head):i},hf)},goLineUp:function(n){return n.moveV(-1,"line")},goLineDown:function(n){return n.moveV(1,"line")},goPageUp:function(n){return n.moveV(-1,"page")},goPageDown:function(n){return n.moveV(1,"page")},goCharLeft:function(n){return n.moveH(-1,"char")},goCharRight:function(n){return n.moveH(1,"char")},goColumnLeft:function(n){return n.moveH(-1,"column")},goColumnRight:function(n){return n.moveH(1,"column")},goWordLeft:function(n){return n.moveH(-1,"word")},goGroupRight:function(n){return n.moveH(1,"group")},goGroupLeft:function(n){return n.moveH(-1,"group")},goWordRight:function(n){return n.moveH(1,"word")},delCharBefore:function(n){return n.deleteH(-1,"codepoint")},delCharAfter:function(n){return n.deleteH(1,"char")},delWordBefore:function(n){return n.deleteH(-1,"word")},delWordAfter:function(n){return n.deleteH(1,"word")},delGroupBefore:function(n){return n.deleteH(-1,"group")},delGroupAfter:function(n){return n.deleteH(1,"group")},indentAuto:function(n){return n.indentSelection("smart")},indentMore:function(n){return n.indentSelection("add")},indentLess:function(n){return n.indentSelection("subtract")},insertTab:function(n){return n.replaceSelection("\t")},insertSoftTab:function(n){for(var r,e,u=[],f=n.listSelections(),t=n.options.tabSize,i=0;i<f.length;i++)r=f[i].from(),e=yt(n.getLine(r.line),r.ch,t),u.push(nh(t-e%t));n.replaceSelections(u)},defaultTab:function(n){n.somethingSelected()?n.indentSelection("add"):n.execCommand("insertTab")},transposeChars:function(i){return et(i,function(){for(var r,u,f,s=i.listSelections(),h=[],e=0;e<s.length;e++)s[e].empty()&&(r=s[e].head,u=t(i.doc,r.line).text,u&&((r.ch==u.length&&(r=new n(r.line,r.ch-1)),r.ch>0)?(r=new n(r.line,r.ch+1),i.replaceRange(u.charAt(r.ch-1)+u.charAt(r.ch-2),n(r.line,r.ch-2),r,"+transpose")):r.line>i.doc.first&&(f=t(i.doc,r.line-1).text,f&&(r=new n(r.line,1),i.replaceRange(u.charAt(0)+i.doc.lineSeparator()+f.charAt(f.length-1),n(r.line-1,f.length-1),r,"+transpose")))),h.push(new o(r,r)));i.setSelections(h)})},newlineAndIndent:function(n){return et(n,function(){for(var r,t=n.listSelections(),i=t.length-1;i>=0;i--)n.replaceRange(n.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");for(t=n.listSelections(),r=0;r<t.length;r++)n.indentLine(t[r].from().line,null,!0);cu(n)})},openLine:function(n){return n.replaceSelection("\n","start")},toggleOverwrite:function(n){return n.toggleOverwrite()}};ib=new si;cs=null;ls=function(n,t,i){this.time=n;this.pos=t;this.button=i};ls.prototype.compare=function(n,t,i){return this.time+400>n&&0==u(t,this.pos)&&i==this.button};var ff={toString:function(){return"CodeMirror.Init"}},vb={},as={};a.defaults=vb;a.optionHandlers=as;vs=[];a.defineInitHook=function(n){return vs.push(n)};wt=null;h=function(n){this.cm=n;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new si;this.composing=null;this.gracePeriod=!1;this.readDOMTimeout=null};h.prototype.init=function(n){function e(n){for(var t=n.target;t;t=t.parentNode){if(t==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(t.className))break}return!1}function o(n){var u,o,r,s,h;if(e(n)&&!w(t,n)){if(t.somethingSelected())ys({lineWise:!1,text:t.getSelections()}),"cut"==n.type&&t.replaceSelection("",null,"cut");else{if(!t.options.lineWiseCopyCut)return;u=wb(t);ys({lineWise:!0,text:u.text});"cut"==n.type&&t.operation(function(){t.setSelections(u.ranges,0,ni);t.replaceSelection("",null,"cut")})}if(n.clipboardData&&(n.clipboardData.clearData(),o=wt.text.join("\n"),n.clipboardData.setData("Text",o),n.clipboardData.getData("Text")==o))return void n.preventDefault();r=kb();s=r.firstChild;t.display.lineSpace.insertBefore(r,t.display.lineSpace.firstChild);s.value=wt.text.join("\n");h=vt();tu(s);setTimeout(function(){t.display.lineSpace.removeChild(r);h.focus();h==i&&f.showPrimarySelection()},50)}}var u=this,f=this,t=f.cm,i=f.div=n.lineDiv;i.contentEditable=!0;bb(i,t.options.spellcheck,t.options.autocorrect,t.options.autocapitalize);r(i,"paste",function(n){!e(n)||w(t,n)||yb(n,t)||l<=11&&setTimeout(k(t,function(){return u.updateFromDOM()}),20)});r(i,"compositionstart",function(n){u.composing={data:n.data,done:!1}});r(i,"compositionupdate",function(n){u.composing||(u.composing={data:n.data,done:!1})});r(i,"compositionend",function(n){u.composing&&(n.data!=u.composing.data&&u.readFromDOMSoon(),u.composing.done=!0)});r(i,"touchstart",function(){return f.forceCompositionEnd()});r(i,"input",function(){u.composing||u.readFromDOMSoon()});r(i,"copy",o);r(i,"cut",o)};h.prototype.screenReaderLabelChanged=function(n){n?this.div.setAttribute("aria-label",n):this.div.removeAttribute("aria-label")};h.prototype.prepareSelection=function(){var n=by(this.cm,!1);return n.focus=vt()==this.div,n};h.prototype.showSelection=function(n,t){n&&this.cm.display.view.length&&((n.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(n))};h.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()};h.prototype.showPrimarySelection=function(){var n=this.getSelection(),t=this.cm,y=t.doc.sel.primary(),c=y.from(),l=y.to(),r,f,s,i,h,v;if(t.display.viewTo==t.display.viewFrom||c.line>=t.display.viewTo||l.line<t.display.viewFrom)n.removeAllRanges();else if(r=ps(t,n.anchorNode,n.anchorOffset),f=ps(t,n.focusNode,n.focusOffset),!r||r.bad||!f||f.bad||0!=u(so(r,f),c)||0!=u(oo(r,f),l)){var a=t.display.view,e=c.line>=t.display.viewFrom&&gb(t,c)||{node:a[0].measure.map[2],offset:0},o=l.line<t.display.viewTo&&gb(t,l);if(o||(s=a[a.length-1].measure,i=s.maps?s.maps[s.maps.length-1]:s.map,o={node:i[i.length-1],offset:i[i.length-2]-i[i.length-3]}),e&&o){v=n.rangeCount&&n.getRangeAt(0);try{h=gr(e.node,e.offset,o.offset,o.node)}catch(n){}h&&(!oi&&t.state.focused?(n.collapse(e.node,e.offset),h.collapsed||(n.removeAllRanges(),n.addRange(h))):(n.removeAllRanges(),n.addRange(h)),v&&null==n.anchorNode?n.addRange(v):oi&&this.startGracePeriod());this.rememberSelection()}else n.removeAllRanges()}};h.prototype.startGracePeriod=function(){var n=this;clearTimeout(this.gracePeriod);this.gracePeriod=setTimeout(function(){n.gracePeriod=!1;n.selectionChanged()&&n.cm.operation(function(){return n.cm.curOp.selectionChanged=!0})},20)};h.prototype.showMultipleSelections=function(n){ht(this.cm.display.cursorDiv,n.cursors);ht(this.cm.display.selectionDiv,n.selection)};h.prototype.rememberSelection=function(){var n=this.getSelection();this.lastAnchorNode=n.anchorNode;this.lastAnchorOffset=n.anchorOffset;this.lastFocusNode=n.focusNode;this.lastFocusOffset=n.focusOffset};h.prototype.selectionInEditor=function(){var n=this.getSelection(),t;return n.rangeCount?(t=n.getRangeAt(0).commonAncestorContainer,wi(this.div,t)):!1};h.prototype.focus=function(){"nocursor"!=this.cm.options.readOnly&&(this.selectionInEditor()&&vt()==this.div||this.showSelection(this.prepareSelection(),!0),this.div.focus())};h.prototype.blur=function(){this.div.blur()};h.prototype.getField=function(){return this.div};h.prototype.supportsTouch=function(){return!0};h.prototype.receivedFocus=function(){var n=this;this.selectionInEditor()?this.pollSelection():et(this.cm,function(){return n.cm.curOp.selectionChanged=!0});this.polling.set(this.cm.options.pollInterval,function t(){n.cm.state.focused&&(n.pollSelection(),n.polling.set(n.cm.options.pollInterval,t))})};h.prototype.selectionChanged=function(){var n=this.getSelection();return n.anchorNode!=this.lastAnchorNode||n.anchorOffset!=this.lastAnchorOffset||n.focusNode!=this.lastFocusNode||n.focusOffset!=this.lastFocusOffset};h.prototype.pollSelection=function(){var n,t,i,r;if(null==this.readDOMTimeout&&!this.gracePeriod&&this.selectionChanged()){if(n=this.getSelection(),t=this.cm,to&&ge&&this.cm.display.gutterSpecs.length&&function(n){for(var t=n;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}(n.anchorNode))return this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),void this.focus();this.composing||(this.rememberSelection(),i=ps(t,n.anchorNode,n.anchorOffset),r=ps(t,n.focusNode,n.focusOffset),i&&r&&et(t,function(){tt(t.doc,nr(i,r),ni);(i.bad||r.bad)&&(t.curOp.selectionChanged=!0)}))}};h.prototype.pollContent=function(){var y,g,k,i,e,nt,tt;null!=this.readDOMTimeout&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var d,a,b,r=this.cm,f=r.display,it=r.doc.sel.primary(),h=it.from(),v=it.to();if((0==h.ch&&h.line>r.firstLine()&&(h=n(h.line-1,t(r.doc,h.line-1).length)),v.ch==t(r.doc,v.line).text.length&&v.line<r.lastLine()&&(v=n(v.line+1,0)),h.line<f.viewFrom||v.line>f.viewTo-1)||(h.line==f.viewFrom||0==(d=pr(r,h.line))?(a=c(f.view[0].line),b=f.view[0].node):(a=c(f.view[d].line),b=f.view[d-1].node.nextSibling),k=pr(r,v.line),k==f.view.length-1?(y=f.viewTo-1,g=f.lineDiv.lastChild):(y=c(f.view[k+1].line)-1,g=f.view[k+1].node.previousSibling),!b))return!1;for(i=r.doc.splitLines(function(t,i,r,u,f){function l(){s&&(e+=h,o&&(e+=h),s=o=!1)}function c(n){n&&(l(),e+=n)}function a(i){var e,v,y,p,w,r;if(1==i.nodeType){if(e=i.getAttribute("cm-text"),e)return void c(e);if(y=i.getAttribute("cm-marker"),y)return p=t.findMarks(n(u,0),n(f+1,0),function(n){return function(t){return t.id==n}}(+y)),void(p.length&&(v=p[0].find(0))&&c(sr(t.doc,v.from,v.to).join(h)));if("false"==i.getAttribute("contenteditable"))return;if(w=/^(pre|div|p|li|table|br)$/i.test(i.nodeName),!/^br$/i.test(i.nodeName)&&0==i.textContent.length)return;for(w&&l(),r=0;r<i.childNodes.length;r++)a(i.childNodes[r]);/^(pre|p)$/i.test(i.nodeName)&&(o=!0);w&&(s=!0)}else 3==i.nodeType&&c(i.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(var e="",s=!1,h=t.doc.lineSeparator(),o=!1;a(i),i!=r;)i=i.nextSibling,o=!1;return e}(r,b,g,a,y)),e=sr(r.doc,n(a,0),n(y,t(r.doc,y).text.length));i.length>1&&e.length>1;)if(s(i)==s(e))i.pop(),e.pop(),y--;else{if(i[0]!=e[0])break;i.shift();e.shift();a++}for(var o=0,l=0,rt=i[0],ut=e[0],ft=Math.min(rt.length,ut.length);o<ft&&rt.charCodeAt(o)==ut.charCodeAt(o);)++o;for(var p=s(i),w=s(e),et=Math.min(p.length-(1==i.length?o:0),w.length-(1==e.length?o:0));l<et&&p.charCodeAt(p.length-l-1)==w.charCodeAt(w.length-l-1);)++l;if(1==i.length&&1==e.length&&a==h.line)for(;o&&o>h.ch&&p.charCodeAt(p.length-l-1)==w.charCodeAt(w.length-l-1);)o--,l++;return i[i.length-1]=p.slice(0,p.length-l).replace(/^\u200b+/,""),i[0]=i[0].slice(o).replace(/\u200b+$/,""),nt=n(a,o),tt=n(y,e.length?s(e).length-l:0),i.length>1||i[0]||u(nt,tt)?(wu(r.doc,i,nt,tt,"+input"),!0):void 0};h.prototype.ensurePolled=function(){this.forceCompositionEnd()};h.prototype.reset=function(){this.forceCompositionEnd()};h.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())};h.prototype.readFromDOMSoon=function(){var n=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout(function(){if(n.readDOMTimeout=null,n.composing){if(!n.composing.done)return;n.composing=null}n.updateFromDOM()},80))};h.prototype.updateFromDOM=function(){var n=this;!this.cm.isReadOnly()&&this.pollContent()||et(this.cm,function(){return ft(n.cm)})};h.prototype.setUneditable=function(n){n.contentEditable="false"};h.prototype.onKeyPress=function(n){0==n.charCode||this.composing||(n.preventDefault(),this.cm.isReadOnly()||k(this.cm,ia)(this.cm,String.fromCharCode(null==n.charCode?n.keyCode:n.charCode),0))};h.prototype.readOnlyChanged=function(n){this.div.contentEditable=String("nocursor"!=n)};h.prototype.onContextMenu=function(){};h.prototype.resetPosition=function(){};h.prototype.needsContentAttribute=!0;v=function(n){this.cm=n;this.prevInput="";this.pollingFast=!1;this.polling=new si;this.hasSelection=!1;this.composing=null};v.prototype.init=function(n){function o(n){if(!w(t,n)){if(t.somethingSelected())ys({lineWise:!1,text:t.getSelections()});else{if(!t.options.lineWiseCopyCut)return;var r=wb(t);ys({lineWise:!0,text:r.text});"cut"==n.type?t.setSelections(r.ranges,null,ni):(u.prevInput="",i.value=r.text.join("\n"),tu(i))}"cut"==n.type&&(t.state.cutIncoming=+new Date)}}var f=this,u=this,t=this.cm,i;this.createField(n);i=this.textarea;n.wrapper.insertBefore(this.wrapper,n.wrapper.firstChild);of&&(i.style.width="0px");r(i,"input",function(){e&&l>=9&&f.hasSelection&&(f.hasSelection=null);u.poll()});r(i,"paste",function(n){w(t,n)||yb(n,t)||(t.state.pasteIncoming=+new Date,u.fastPoll())});r(i,"cut",o);r(i,"copy",o);r(n.scroller,"paste",function(r){if(!li(n,r)&&!w(t,r)){if(!i.dispatchEvent)return t.state.pasteIncoming=+new Date,void u.focus();var f=new Event("paste");f.clipboardData=r.clipboardData;i.dispatchEvent(f)}});r(n.lineSpace,"selectstart",function(t){li(n,t)||ut(t)});r(i,"compositionstart",function(){var n=t.getCursor("from");u.composing&&u.composing.range.clear();u.composing={start:n,range:t.markText(n,t.getCursor("to"),{className:"CodeMirror-composing"})}});r(i,"compositionend",function(){u.composing&&(u.poll(),u.composing.range.clear(),u.composing=null)})};v.prototype.createField=function(){this.wrapper=kb();this.textarea=this.wrapper.firstChild};v.prototype.screenReaderLabelChanged=function(n){n?this.textarea.setAttribute("aria-label",n):this.textarea.removeAttribute("aria-label")};v.prototype.prepareSelection=function(){var n=this.cm,t=n.display,e=n.doc,i=by(n);if(n.options.moveInputWithCursor){var r=dt(n,e.sel.primary().head,"div"),u=t.wrapper.getBoundingClientRect(),f=t.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,r.top+f.top-u.top));i.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,r.left+f.left-u.left))}return i};v.prototype.showSelection=function(n){var t=this.cm.display;ht(t.cursorDiv,n.cursors);ht(t.selectionDiv,n.selection);null!=n.teTop&&(this.wrapper.style.top=n.teTop+"px",this.wrapper.style.left=n.teLeft+"px")};v.prototype.reset=function(n){var t,i;this.contextMenuPending||this.composing||(t=this.cm,t.somethingSelected()?(this.prevInput="",i=t.getSelection(),this.textarea.value=i,t.state.focused&&tu(this.textarea),e&&l>=9&&(this.hasSelection=i)):n||(this.prevInput=this.textarea.value="",e&&l>=9&&(this.hasSelection=null)))};v.prototype.getField=function(){return this.textarea};v.prototype.supportsTouch=function(){return!1};v.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!sf||vt()!=this.textarea))try{this.textarea.focus()}catch(n){}};v.prototype.blur=function(){this.textarea.blur()};v.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};v.prototype.receivedFocus=function(){this.slowPoll()};v.prototype.slowPoll=function(){var n=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){n.poll();n.cm.state.focused&&n.slowPoll()})};v.prototype.fastPoll=function(){var t=!1,n=this;n.pollingFast=!0;n.polling.set(20,function i(){n.poll()||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,i))})};v.prototype.poll=function(){var i=this,n=this.cm,f=this.textarea,r=this.prevInput,t,o,u,s;if(this.contextMenuPending||!n.state.focused||sk(f)&&!r&&!this.composing||n.isReadOnly()||n.options.disableInput||n.state.keySeq||(t=f.value,t==r&&!n.somethingSelected()))return!1;if(e&&l>=9&&this.hasSelection===t||at&&/[\uf700-\uf7ff]/.test(t))return n.display.input.reset(),!1;if(n.doc.sel==n.display.selForContextMenu&&(o=t.charCodeAt(0),8203!=o||r||(r="​"),8666==o))return this.reset(),this.cm.execCommand("undo");for(u=0,s=Math.min(r.length,t.length);u<s&&r.charCodeAt(u)==t.charCodeAt(u);)++u;return et(n,function(){ia(n,t.slice(u),r.length-u,null,i.composing?"*compose":null);t.length>1e3||t.indexOf("\n")>-1?f.value=i.prevInput="":i.prevInput=t;i.composing&&(i.composing.range.clear(),i.composing.range=n.markText(i.composing.start,n.getCursor("to"),{className:"CodeMirror-composing"}))}),!0};v.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)};v.prototype.onKeyPress=function(){e&&l>=9&&(this.hasSelection=null);this.fastPoll()};v.prototype.onContextMenu=function(n){function v(){if(null!=f.selectionStart){var n=i.somethingSelected(),r="​"+(n?f.value:"");f.value="⇚";f.value=r;t.prevInput=n?"":"​";f.selectionStart=1;f.selectionEnd=r.length;u.selForContextMenu=i.doc.sel}}function s(){if(t.contextMenuPending==s&&(t.contextMenuPending=!1,t.wrapper.style.cssText=p,f.style.cssText=y,e&&l<9&&u.scrollbars.setScrollTop(u.scroller.scrollTop=h),null!=f.selectionStart)){(!e||e&&l<9)&&v();var n=0;u.detectingSelectAll=setTimeout(function r(){u.selForContextMenu==i.doc.sel&&0==f.selectionStart&&f.selectionEnd>0&&"​"==t.prevInput?k(i,ew)(i):n++<10?u.detectingSelectAll=setTimeout(r,500):(u.selForContextMenu=null,u.input.reset())},200)}}var t=this,i=t.cm,u=i.display,f=t.textarea,o,h;if(t.contextMenuPending&&t.contextMenuPending(),o=yr(i,n),h=u.scroller.scrollTop,o&&!bt){i.options.resetSelectionOnContextMenu&&-1==i.doc.sel.contains(o)&&k(i,tt)(i.doc,nr(o),ni);var c,y=f.style.cssText,p=t.wrapper.style.cssText,a=t.wrapper.offsetParent.getBoundingClientRect();(t.wrapper.style.cssText="position: static",f.style.cssText="position: absolute; width: 30px; height: 30px;\n      top: "+(n.clientY-a.top-5)+"px; left: "+(n.clientX-a.left-5)+"px;\n      z-index: 1000; background: "+(e?"rgba(255, 255, 255, .05)":"transparent")+";\n      outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",it&&(c=window.scrollY),u.input.focus(),it&&window.scrollTo(null,c),u.input.reset(),i.somethingSelected()||(f.value=t.prevInput=" "),t.contextMenuPending=s,u.selForContextMenu=i.doc.sel,clearTimeout(u.detectingSelectAll),e&&l>=9&&v(),io)?(vf(n),r(window,"mouseup",function n(){ct(window,"mouseup",n);setTimeout(s,20)})):setTimeout(s,50)}};v.prototype.readOnlyChanged=function(n){n||this.reset();this.textarea.disabled="nocursor"==n;this.textarea.readOnly=!!n};v.prototype.setUneditable=function(){};v.prototype.needsContentAttribute=!1,function(t){function i(n,i,u,f){t.defaults[n]=i;u&&(r[n]=f?function(n,t,i){i!=ff&&u(n,t,i)}:u)}var r=t.optionHandlers;t.defineOption=i;t.Init=ff;i("value","",function(n,t){return n.setValue(t)},!0);i("mode",null,function(n,t){n.doc.modeOption=t;ll(n)},!0);i("indentUnit",2,ll,!0);i("indentWithTabs",!1);i("smartIndent",!0);i("tabSize",4,function(n){se(n);gf(n);ft(n)},!0);i("lineSeparator",null,function(t,i){var r,f,u;if(t.doc.lineSep=i,i)for(r=[],f=t.doc.first,t.doc.iter(function(t){for(var u,e=0;;){if(u=t.text.indexOf(i,e),-1==u)break;e=u+i.length;r.push(n(f,u))}f++}),u=r.length-1;u>=0;u--)wu(t.doc,i,r[u],n(r[u].line,r[u].ch+i.length))});i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,t,i){n.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g");i!=ff&&n.refresh()});i("specialCharPlaceholder",pk,function(n){return n.refresh()},!0);i("electricChars",!0);i("inputStyle",sf?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor");},!0);i("spellcheck",!1,function(n,t){return n.getInputField().spellcheck=t},!0);i("autocorrect",!1,function(n,t){return n.getInputField().autocorrect=t},!0);i("autocapitalize",!1,function(n,t){return n.getInputField().autocapitalize=t},!0);i("rtlMoveVisually",!fk);i("wholeLineUpdateBefore",!0);i("theme","default",function(n){ab(n);ee(n)},!0);i("keyMap","default",function(n,t,i){var u=ss(t),r=i!=ff&&ss(i);r&&r.detach&&r.detach(n,u);u.attach&&u.attach(n,r||null)});i("extraKeys",null);i("configureMouse",null);i("lineWrapping",!1,ig,!0);i("gutters",[],function(n,t){n.display.gutterSpecs=hl(t,n.options.lineNumbers);ee(n)},!0);i("fixedGutter",!0,function(n,t){n.display.gutters.style.left=t?kc(n.display)+"px":"0";n.refresh()},!0);i("coverGutterNextToScrollbar",!1,function(n){return au(n)},!0);i("scrollbarStyle","native",function(n){rp(n);au(n);n.display.scrollbars.setScrollTop(n.doc.scrollTop);n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0);i("lineNumbers",!1,function(n,t){n.display.gutterSpecs=hl(n.options.gutters,t);ee(n)},!0);i("firstLineNumber",1,ee,!0);i("lineNumberFormatter",function(n){return n},ee,!0);i("showCursorWhenSelecting",!1,ne,!0);i("resetSelectionOnContextMenu",!0);i("lineWiseCopyCut",!0);i("pasteLinesPerSelection",!0);i("selectionsMayTouch",!1);i("readOnly",!1,function(n,t){"nocursor"==t&&(hu(n),n.display.input.blur());n.display.input.readOnlyChanged(t)});i("screenReaderLabel",null,function(n,t){t=""===t?null:t;n.display.input.screenReaderLabelChanged(t)});i("disableInput",!1,function(n,t){t||n.display.input.reset()},!0);i("dragDrop",!0,tg);i("allowDropFileTypes",null);i("cursorBlinkRate",530);i("cursorScrollMargin",0);i("cursorHeight",1,ne,!0);i("singleCursorHeightPerLine",!0,ne,!0);i("workTime",100);i("workDelay",100);i("flattenSpans",!0,se,!0);i("addModeClass",!1,se,!0);i("pollInterval",100);i("undoDepth",200,function(n,t){return n.doc.history.undoDepth=t});i("historyEventDelay",1250);i("viewportMargin",10,function(n){return n.refresh()},!0);i("maxHighlightLength",1e4,se,!0);i("moveInputWithCursor",!0,function(n,t){t||n.display.input.resetPosition()});i("tabindex",null,function(n,t){return n.display.input.getField().tabIndex=t||""});i("autofocus",null);i("direction","ltr",function(n,t){return n.doc.setDirection(t)},!0);i("phrases",null)}(a),function(i){var u=i.optionHandlers,r=i.helpers={};i.prototype={constructor:i,focus:function(){window.focus();this.display.input.focus()},setOption:function(n,t){var i=this.options,r=i[n];i[n]==t&&"mode"!=n||(i[n]=t,u.hasOwnProperty(n)&&k(this,u[n])(this,t,r),p(this,"optionChange",this,n))},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,t){this.state.keyMaps[t?"push":"unshift"](ss(n))},removeKeyMap:function(n){for(var i=this.state.keyMaps,t=0;t<i.length;++t)if(i[t]==n||i[t].name==n)return i.splice(t,1),!0},addOverlay:rt(function(n,t){var r=n.token?n:i.getMode(this.options,n);if(r.startState)throw new Error("Overlays may not be stateful.");!function(n,t,i){for(var r=0,u=i(t);r<n.length&&i(n[r])<=u;)r++;n.splice(r,0,t)}(this.state.overlays,{mode:r,modeSpec:n,opaque:t&&t.opaque,priority:t&&t.priority||0},function(n){return n.priority});this.state.modeGen++;ft(this)}),removeOverlay:rt(function(n){for(var r,i=this.state.overlays,t=0;t<i.length;++t)if(r=i[t].modeSpec,r==n||"string"==typeof n&&r.name==n)return i.splice(t,1),this.state.modeGen++,void ft(this)}),indentLine:rt(function(n,t,i){"string"!=typeof t&&"number"!=typeof t&&(t=null==t?this.options.smartIndent?"smart":"prev":t?"add":"subtract");yf(this.doc,n)&&be(this,n,t,i)}),indentSelection:rt(function(n){for(var i,u,f,e=this.doc.sel.ranges,r=-1,t=0;t<e.length;t++)if(i=e[t],i.empty())i.head.line>r&&(be(this,i.head.line,n,!0),r=i.head.line,t==this.doc.sel.primIndex&&cu(this));else{var s=i.from(),h=i.to(),c=Math.max(r,s.line);for(r=Math.min(this.lastLine(),h.line-(h.ch?0:1))+1,u=c;u<r;++u)be(this,u,n);f=this.doc.sel.ranges;0==s.ch&&e.length==f.length&&f[t].from().ch>0&&pl(this.doc,t,new o(s,f[t].to()),ni)}}),getTokenAt:function(n,t){return rv(this,n,t)},getLineTokens:function(t,i){return rv(this,n(t),i,!0)},getTokenTypeAt:function(n){var i,e;n=f(this.doc,n);var r,u=tv(this,t(this.doc,n.line)),s=0,h=(u.length-1)/2,o=n.ch;if(0==o)r=u[2];else for(;;)if(i=s+h>>1,(i?u[2*i-1]:0)>=o)h=i;else{if(!(u[2*i+1]<o)){r=u[2*i+2];break}s=i+1}return e=r?r.indexOf("overlay "):-1,e<0?r:0==e?null:r.slice(0,e-1)},getModeAt:function(n){var t=this.doc.mode;return t.innerMode?i.innerMode(t,this.getTokenAt(n).state).mode:t},getHelper:function(n,t){return this.getHelpers(n,t)[0]},getHelpers:function(n,t){var f=[],u,i,e,h,o,s;if(!r.hasOwnProperty(t))return f;if(u=r[t],i=this.getModeAt(n),"string"==typeof i[t])u[i[t]]&&f.push(u[i[t]]);else if(i[t])for(e=0;e<i[t].length;e++)h=u[i[t][e]],h&&f.push(h);else i.helperType&&u[i.helperType]?f.push(u[i.helperType]):u[i.name]&&f.push(u[i.name]);for(o=0;o<u._global.length;o++)s=u._global[o],s.pred(i,this)&&-1==nt(f,s.val)&&f.push(s.val);return f},getStateAfter:function(n,t){var i=this.doc;return wf(this,(n=da(i,null==n?i.first+i.size-1:n))+1,t).state},cursorCoords:function(n,t){var i=this.doc.sel.primary();return dt(this,null==n?i.head:"object"==_typeof(n)?f(this.doc,n):n?i.from():i.to(),t||"page")},charCoords:function(n,t){return vc(this,f(this.doc,n),t||"page")},coordsChar:function(n,t){return pc(this,(n=ly(this,n,t||"page")).left,n.top)},lineAtHeight:function(n,t){return n=ly(this,{top:n,left:0},t||"page").top,hr(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,i,r){var u,f=!1,e;return"number"==typeof n?(e=this.doc.first+this.doc.size-1,n<this.doc.first?n=this.doc.first:n>e&&(n=e,f=!0),u=t(this.doc,n)):u=n,wo(this,u,{top:0,left:0},i||"page",r||f).top+(f?this.doc.height-ci(u):0)},defaultTextHeight:function(){return ou(this.display)},defaultCharWidth:function(){return su(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,t,i,r,u){var c,h,o=this.display,s=(n=dt(this,f(this.doc,n))).bottom,e=n.left,l,a;(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)?s=n.top:("above"==r||"near"==r)&&(l=Math.max(o.wrapper.clientHeight,this.doc.height),a=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth),("above"==r||n.bottom+t.offsetHeight>l)&&n.top>t.offsetHeight?s=n.top-t.offsetHeight:n.bottom+t.offsetHeight<=l&&(s=n.bottom),e+t.offsetWidth>a&&(e=a-t.offsetWidth));t.style.top=s+"px";t.style.left=t.style.right="";"right"==u?(e=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==u?e=0:"middle"==u&&(e=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=e+"px");i&&(null!=(h=il(c=this,{left:e,top:s,right:e+t.offsetWidth,bottom:s+t.offsetHeight})).scrollTop&&ie(c,h.scrollTop),null!=h.scrollLeft&&wr(c,h.scrollLeft))},triggerOnKeyDown:rt(fb),triggerOnKeyPress:rt(ob),triggerOnKeyUp:eb,triggerOnMouseDown:rt(sb),execCommand:function(n){if(uf.hasOwnProperty(n))return uf[n].call(null,this)},triggerElectric:rt(function(n){pb(this,n)}),findPosH:function(n,t,i,r){var o=1,u,e;for(t<0&&(o=-1,t=-t),u=f(this.doc,n),e=0;e<t&&!(u=ra(this.doc,u,o,i,r)).hitSide;++e);return u},moveH:rt(function(n,t){var i=this;this.extendSelectionsBy(function(r){return i.display.shift||i.doc.extend||r.empty()?ra(i.doc,r.head,n,t,i.options.rtlMoveVisually):n<0?r.from():r.to()},hf)}),deleteH:rt(function(n,t){var r=this.doc.sel,i=this.doc;r.somethingSelected()?i.replaceSelection("",null,"+delete"):rf(this,function(r){var u=ra(i,r.head,n,t,!1);return n<0?{from:u,to:r.head}:{from:r.head,to:u}})}),findPosV:function(n,t,i,r){var h=1,o=r,u,s,e;for(t<0&&(h=-1,t=-t),u=f(this.doc,n),s=0;s<t;++s)if(e=dt(this,u,"div"),null==o?o=e.left:e.left=o,(u=db(this,e,h,i)).hitSide)break;return u},moveV:rt(function(n,t){var u=this,i=this.doc,f=[],e=!this.display.shift&&!i.extend&&i.sel.somethingSelected(),r;if(i.extendSelectionsBy(function(r){var o,s;return e?n<0?r.from():r.to():(o=dt(u,r.head,"div"),null!=r.goalColumn&&(o.left=r.goalColumn),f.push(o.left),s=db(u,o,n,t),"page"==t&&r==i.sel.primary()&&rl(u,vc(u,s,"div").top-o.top),s)},hf),f.length)for(r=0;r<i.sel.ranges.length;r++)i.sel.ranges[r].goalColumn=f[r]}),findWordAt:function(i){var u=t(this.doc,i.line).text,r=i.ch,f=i.ch,e,s,h;if(u){for(e=this.getHelper(i,"wordChars"),"before"!=i.sticky&&f!=u.length||!r?++f:--r,s=u.charAt(r),h=fo(s,e)?function(n){return fo(n,e)}:/\s/.test(s)?function(n){return/\s/.test(n)}:function(n){return!/\s/.test(n)&&!fo(n)};r>0&&h(u.charAt(r-1));)--r;for(;f<u.length&&h(u.charAt(f));)++f}return new o(n(i.line,r),n(i.line,f))},toggleOverwrite:function(n){null!=n&&n==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?ur(this.display.cursorDiv,"CodeMirror-overwrite"):yi(this.display.cursorDiv,"CodeMirror-overwrite"),p(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==vt()},isReadOnly:function(){return!(!this.options.readOnly&&!this.doc.cantEdit)},scrollTo:rt(function(n,t){te(this,n,t)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-ui(this)-this.display.barHeight,width:n.scrollWidth-ui(this)-this.display.barWidth,clientHeight:hc(this),clientWidth:ar(this)}},scrollIntoView:rt(function(t,i){null==t?(t={from:this.doc.sel.primary().head,to:null},null==i&&(i=this.options.cursorScrollMargin)):"number"==typeof t?t={from:n(t,0),to:null}:null==t.from&&(t={from:t,to:null});t.to||(t.to=t.from);t.margin=i||0;null!=t.from.line?function(n,t){ts(n);n.curOp.scrollToPos=t}(this,t):np(this,t.from,t.to,t.margin)}),setSize:rt(function(n,t){var u=this,r=function(n){return"number"==typeof n||/^\d+$/.test(String(n))?n+"px":n},i;null!=n&&(this.display.wrapper.style.width=r(n));null!=t&&(this.display.wrapper.style.height=r(t));this.options.lineWrapping&&sy(this);i=this.display.viewFrom;this.doc.iter(i,this.display.viewTo,function(n){if(n.widgets)for(var t=0;t<n.widgets.length;t++)if(n.widgets[t].noHScroll){ki(u,i,"widget");break}++i});this.curOp.forceUpdate=!0;p(this,"refresh",this)}),operation:function(n){return et(this,n)},startOperation:function(){return br(this)},endOperation:function(){return kr(this)},refresh:rt(function(){var n=this.display.cachedTextHeight;ft(this);this.curOp.forceUpdate=!0;gf(this);te(this,this.doc.scrollLeft,this.doc.scrollTop);ol(this.display);(null==n||Math.abs(n-ou(this.display))>.5||this.options.lineWrapping)&&dc(this);p(this,"refresh",this)}),swapDoc:rt(function(n){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),yp(this,n),gf(this),this.display.input.reset(),te(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,b(this,"swapDoc",this,t),t}),phrase:function(n){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,n)?t[n]:n},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}};ru(i);i.registerHelper=function(n,t,u){r.hasOwnProperty(n)||(r[n]=i[n]={_global:[]});r[n][t]=u};i.registerGlobalHelper=function(n,t,u,f){i.registerHelper(n,t,f);r[n]._global.push({pred:u,val:f})}}(a);nk="iter insert remove copy getEditor constructor".split(" ");for(ke in lt.prototype)lt.prototype.hasOwnProperty(ke)&&nt(nk,ke)<0&&(a.prototype[ke]=function(n){return function(){return n.apply(this.doc,arguments)}}(lt.prototype[ke]));return ru(lt),a.inputStyles={textarea:v,contenteditable:h},a.defineMode=function(n){a.defaults.mode||"null"==n||(a.defaults.mode=n);ck.apply(this,arguments)},a.defineMIME=function(n,t){uu[n]=t},a.defineMode("null",function(){return{token:function(n){return n.skipToEnd()}}}),a.defineMIME("text/plain","null"),a.defineExtension=function(n,t){a.prototype[n]=t},a.defineDocExtension=function(n,t){lt.prototype[n]=t},a.fromTextArea=function(n,t){function u(){n.value=s.getValue()}var f,e,i,o,s;if(((t=t?fr(t):{}).value=n.value,!t.tabindex&&n.tabIndex&&(t.tabindex=n.tabIndex),!t.placeholder&&n.placeholder&&(t.placeholder=n.placeholder),null==t.autofocus)&&(f=vt(),t.autofocus=f==n||null!=n.getAttribute("autofocus")&&f==document.body),n.form&&(r(n.form,"submit",u),!t.leaveSubmitMethodAlone)){i=n.form;e=i.submit;try{o=i.submit=function(){u();i.submit=e;i.submit();i.submit=o}}catch(n){}}return t.finishInit=function(i){i.save=u;i.getTextArea=function(){return n};i.toTextArea=function(){i.toTextArea=isNaN;u();n.parentNode.removeChild(i.getWrapperElement());n.style.display="";n.form&&(ct(n.form,"submit",u),t.leaveSubmitMethodAlone||"function"!=typeof n.form.submit||(n.form.submit=e))}},n.style.display="none",s=a(function(t){return n.parentNode.insertBefore(t,n.nextSibling)},t)},function(t){t.off=ct;t.on=r;t.wheelEventPixels=pd;t.Doc=lt;t.splitLines=ch;t.countColumn=yt;t.findColumn=gs;t.isWordChar=th;t.Pass=ro;t.signal=p;t.Line=cr;t.changeEnd=tr;t.scrollbarModel=ul;t.Pos=n;t.cmpPos=u;t.modes=ah;t.mimeModes=uu;t.resolveMode=eo;t.getMode=vh;t.modeExtensions=er;t.extendMode=lk;t.copyState=or;t.startState=ka;t.innerMode=yh;t.commands=uf;t.keyMap=ei;t.keyName=gw;t.isModifierKey=kw;t.lookupKey=tf;t.normalizeKeyMap=ng;t.StringStream=y;t.SharedTextMarker=du;t.TextMarker=ai;t.LineWidget=bu;t.e_preventDefault=ut;t.e_stopPropagation=pa;t.e_stop=vf;t.addClass=ur;t.contains=wi;t.rmClass=yi;t.keyNames=vi}(a),a.version="5.61.0",a})},{}],11:[function(n,t,i){var r;r=function(n){"use strict";var t=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;n.defineMode("gfm",function(i,r){var f=0,o={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(n){return{code:n.code,codeBlock:n.codeBlock,ateSpace:n.ateSpace}},token:function(n,i){var e,u;return(i.combineTokens=null,i.codeBlock)?n.match(/^```+/)?(i.codeBlock=!1,null):(n.skipToEnd(),null):(n.sol()&&(i.code=!1),n.sol()&&n.match(/^```+/))?(n.skipToEnd(),i.codeBlock=!0,null):"`"===n.peek()?(n.next(),e=n.pos,n.eatWhile("`"),u=1+n.pos-e,i.code?u===f&&(i.code=!1):(f=u,i.code=!0),null):i.code?(n.next(),null):n.eatSpace()?(i.ateSpace=!0,null):(n.sol()||i.ateSpace)&&(i.ateSpace=!1,!1!==r.gitHubSpice)&&(n.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/)||n.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))?(i.combineTokens=!0,"link"):n.match(t)&&"]("!=n.string.slice(n.start-2,n.start)&&(0==n.start||/\W/.test(n.string.charAt(n.start-1)))?(i.combineTokens=!0,"link"):(n.next(),null)},blankLine:function(n){return n.code=!1,null}},u={taskLists:!0,strikethrough:!0,emoji:!0};for(var e in r)u[e]=r[e];return u.name="markdown",n.overlayMode(n.getMode(i,u),o)},"markdown");n.defineMIME("text/x-gfm","gfm")};"object"==_typeof(i)&&"object"==_typeof(t)?r(n("../../lib/codemirror"),n("../markdown/markdown"),n("../../addon/mode/overlay")):r(CodeMirror)},{"../../addon/mode/overlay":7,"../../lib/codemirror":10,"../markdown/markdown":12}],12:[function(n,t,i){var r;r=function(n){"use strict";n.defineMode("markdown",function(t,i){function l(n,t,i){return t.f=t.inline=i,i(n,t)}function y(n,t,i){return t.f=t.block=i,i(n,t)}function p(t){var r,i;return(t.linkTitle=!1,t.linkHref=!1,t.linkText=!1,t.em=!1,t.strong=!1,t.strikethrough=!1,t.quote=0,t.indentedCode=!1,t.f==c)&&(r=a,r||(i=n.innerMode(f,t.htmlState),r="xml"==i.mode.name&&null===i.state.tagStart&&!i.state.context&&i.state.tokenize.isInText),r&&(t.f=e,t.block=h,t.htmlState=null)),t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.prevLine=t.thisLine,t.thisLine={stream:null},null}function h(f,e){var w,h=f.column()===e.indentation,a=!(w=e.prevLine.stream)||!/\S/.test(w.string),b=e.indentedCode,k=e.prevLine.hr,y=!1!==e.list,s=(e.listStack[e.listStack.length-1]||0)+3,c,d;if(e.indentedCode=!1,c=e.indentation,null===e.indentationDiff&&(e.indentationDiff=e.indentation,y)){for(e.list=null;c<e.listStack[e.listStack.length-1];)e.listStack.pop(),e.listStack.length?e.indentation=e.listStack[e.listStack.length-1]:e.list=!1;!1!==e.list&&(e.indentationDiff=c-e.listStack[e.listStack.length-1])}var rt=!(a||k||e.prevLine.header||y&&b||e.prevLine.fencedCodeEnd),p=(!1===e.list||k||a)&&e.indentation<=s&&f.match(g),o=null;return e.indentationDiff>=4&&(b||e.prevLine.fencedCodeEnd||e.prevLine.header||a)?(f.skipToEnd(),e.indentedCode=!0,r.code):f.eatSpace()?null:h&&e.indentation<=s&&(o=f.match(tt))&&o[1].length<=6?(e.quote=0,e.header=o[1].length,e.thisLine.header=!0,i.highlightFormatting&&(e.formatting="header"),e.f=e.inline,u(e)):e.indentation<=s&&f.eat(">")?(e.quote=h?1:e.quote+1,i.highlightFormatting&&(e.formatting="quote"),f.eatSpace(),u(e)):!p&&!e.setext&&h&&e.indentation<=s&&(o=f.match(nt))?(d=o[1]?"ol":"ul",e.indentation=c+f.current().length,e.list=!0,e.quote=0,e.listStack.push(e.indentation),e.em=!1,e.strong=!1,e.code=!1,e.strikethrough=!1,i.taskLists&&f.match(v,!1)&&(e.taskList=!0),e.f=e.inline,i.highlightFormatting&&(e.formatting=["list","list-"+d]),u(e)):h&&e.indentation<=s&&(o=f.match(ut,!0))?(e.quote=0,e.fencedEndRE=new RegExp(o[1]+"+ *$"),e.localMode=i.fencedCodeBlockHighlighting&&function(i){var r,u;return n.findModeByName&&(r=n.findModeByName(i),r&&(i=r.mime||r.mimes[0])),u=n.getMode(t,i),"null"==u.name?null:u}(o[2]||i.fencedCodeBlockDefaultMode),e.localMode&&(e.localState=n.startState(e.localMode)),e.f=e.block=et,i.highlightFormatting&&(e.formatting="code-block"),e.code=-1,u(e)):e.setext||!(rt&&y||e.quote||!1!==e.list||e.code||p||ft.test(f.string))&&(o=f.lookAhead(1))&&(o=o.match(it))?(e.setext?(e.header=e.setext,e.setext=0,f.skipToEnd(),i.highlightFormatting&&(e.formatting="header")):(e.header="="==o[0].charAt(0)?1:2,e.setext=e.header),e.thisLine.header=!0,e.f=e.inline,u(e)):p?(f.skipToEnd(),e.hr=!0,e.thisLine.hr=!0,r.hr):"["===f.peek()?l(f,e,st):l(f,e,e.inline)}function c(t,i){var u=f.token(t,i.htmlState),r;return a||(r=n.innerMode(f,i.htmlState),("xml"==r.mode.name&&null===r.state.tagStart&&!r.state.context&&r.state.tokenize.isInText||i.md_inside&&t.current().indexOf(">")>-1)&&(i.f=e,i.block=h,i.htmlState=null)),u}function et(n,t){var o,s=t.listStack[t.listStack.length-1]||0,f=t.indentation<s,c=s+3;return t.fencedEndRE&&t.indentation<=c&&(f||n.match(t.fencedEndRE))?(i.highlightFormatting&&(t.formatting="code-block"),f||(o=u(t)),t.localMode=t.localState=null,t.block=h,t.f=e,t.fencedEndRE=null,t.code=0,t.thisLine.fencedCodeEnd=!0,f?y(n,t,t.block):o):t.localMode?t.localMode.token(n,t.localState):(n.skipToEnd(),r.code)}function u(n){var t=[],u,f;if(n.formatting)for(t.push(r.formatting),"string"==typeof n.formatting&&(n.formatting=[n.formatting]),u=0;u<n.formatting.length;u++)t.push(r.formatting+"-"+n.formatting[u]),"header"===n.formatting[u]&&t.push(r.formatting+"-"+n.formatting[u]+"-"+n.header),"quote"===n.formatting[u]&&(!i.maxBlockquoteDepth||i.maxBlockquoteDepth>=n.quote?t.push(r.formatting+"-"+n.formatting[u]+"-"+n.quote):t.push("error"));return n.taskOpen?(t.push("meta"),t.length?t.join(" "):null):n.taskClosed?(t.push("property"),t.length?t.join(" "):null):((n.linkHref?t.push(r.linkHref,"url"):(n.strong&&t.push(r.strong),n.em&&t.push(r.em),n.strikethrough&&t.push(r.strikethrough),n.emoji&&t.push(r.emoji),n.linkText&&t.push(r.linkText),n.code&&t.push(r.code),n.image&&t.push(r.image),n.imageAltText&&t.push(r.imageAltText,"link"),n.imageMarker&&t.push(r.imageMarker)),n.header&&t.push(r.header,r.header+"-"+n.header),n.quote&&(t.push(r.quote),!i.maxBlockquoteDepth||i.maxBlockquoteDepth>=n.quote?t.push(r.quote+"-"+n.quote):t.push(r.quote+"-"+i.maxBlockquoteDepth)),!1!==n.list)&&(f=(n.listStack.length-1)%3,f?1===f?t.push(r.list2):t.push(r.list3):t.push(r.list1)),n.trailingSpaceNewLine?t.push("trailing-space-new-line"):n.trailingSpace&&t.push("trailing-space-"+(n.trailingSpace%2?"a":"b")),t.length?t.join(" "):null)}function ot(n,t){if(n.match(rt,!0))return u(t)}function e(t,s){var ot=s.text(t,s),h,nt,st,ht,it,p,l,ft,et,ct,tt,a,lt;if(void 0!==ot)return ot;if(s.list)return s.list=null,u(s);if(s.taskList)return" "===t.match(v,!0)[1]?s.taskOpen=!0:s.taskClosed=!0,i.highlightFormatting&&(s.formatting="task"),s.taskList=!1,u(s);if(s.taskOpen=!1,s.taskClosed=!1,s.header&&t.match(/^#+$/,!0))return i.highlightFormatting&&(s.formatting="header"),u(s);if(h=t.next(),s.linkTitle&&(s.linkTitle=!1,nt=h,"("===h&&(nt=")"),st="^\\s*(?:[^"+(nt=(nt+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1"))+"\\\\]+|\\\\\\\\|\\\\.)"+nt,t.match(new RegExp(st),!0)))return r.linkHref;if("`"===h)return(ht=s.formatting,i.highlightFormatting&&(s.formatting="code"),t.eatWhile("`"),it=t.current().length,0!=s.code||s.quote&&1!=it)?it==s.code?(p=u(s),s.code=0,p):(s.formatting=ht,u(s)):(s.code=it,u(s));if(s.code)return u(s);if("\\"===h&&(t.next(),i.highlightFormatting))return l=u(s),ft=r.formatting+"-escape",l?l+" "+ft:ft;if("!"===h&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return s.imageMarker=!0,s.image=!0,i.highlightFormatting&&(s.formatting="image"),u(s);if("["===h&&s.imageMarker&&t.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return s.imageMarker=!1,s.imageAltText=!0,i.highlightFormatting&&(s.formatting="image"),u(s);if("]"===h&&s.imageAltText)return i.highlightFormatting&&(s.formatting="image"),l=u(s),s.imageAltText=!1,s.image=!1,s.inline=s.f=b,l;if("["===h&&!s.image)return s.linkText&&t.match(/^.*?\]/)||(s.linkText=!0,i.highlightFormatting&&(s.formatting="link")),u(s);if("]"===h&&s.linkText)return i.highlightFormatting&&(s.formatting="link"),l=u(s),s.linkText=!1,s.inline=s.f=t.match(/\(.*?\)| ?\[.*?\]/,!1)?b:e,l;if("<"===h&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1))return s.f=s.inline=w,i.highlightFormatting&&(s.formatting="link"),(l=u(s))?l+=" ":l="",l+r.linkInline;if("<"===h&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1))return s.f=s.inline=w,i.highlightFormatting&&(s.formatting="link"),(l=u(s))?l+=" ":l="",l+r.linkEmail;if(i.xml&&"<"===h&&t.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1))return et=t.string.indexOf(">",t.pos),-1!=et&&(ct=t.string.substring(t.start,et),/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ct)&&(s.md_inside=!0)),t.backUp(1),s.htmlState=n.startState(f),y(t,s,c);if(i.xml&&"<"===h&&t.match(/^\/\w*?>/))return s.md_inside=!1,"tag";if("*"===h||"_"===h){for(tt=1,a=1==t.pos?" ":t.string.charAt(t.pos-2);tt<3&&t.eat(h);)tt++;var k=t.peek()||" ",rt=!/\s/.test(k)&&(!o.test(k)||/\s/.test(a)||o.test(a)),ut=!/\s/.test(a)&&(!o.test(a)||/\s/.test(k)||o.test(k)),d=null,g=null;if(tt%2&&(s.em||!rt||"*"!==h&&ut&&!o.test(a)?s.em!=h||!ut||"*"!==h&&rt&&!o.test(k)||(d=!1):d=!0),tt>1&&(s.strong||!rt||"*"!==h&&ut&&!o.test(a)?s.strong!=h||!ut||"*"!==h&&rt&&!o.test(k)||(g=!1):g=!0),null!=g||null!=d)return i.highlightFormatting&&(s.formatting=null==d?"strong":null==g?"em":"strong em"),!0===d&&(s.em=h),!0===g&&(s.strong=h),p=u(s),!1===d&&(s.em=!1),!1===g&&(s.strong=!1),p}else if(" "===h&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return u(s);t.backUp(1)}if(i.strikethrough)if("~"===h&&t.eatWhile(h)){if(s.strikethrough)return i.highlightFormatting&&(s.formatting="strikethrough"),p=u(s),s.strikethrough=!1,p;if(t.match(/^[^\s]/,!1))return s.strikethrough=!0,i.highlightFormatting&&(s.formatting="strikethrough"),u(s)}else if(" "===h&&t.match("~~",!0)){if(" "===t.peek())return u(s);t.backUp(2)}return i.emoji&&":"===h&&t.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)?(s.emoji=!0,i.highlightFormatting&&(s.formatting="emoji"),lt=u(s),s.emoji=!1,lt):(" "===h&&(t.match(/^ +$/,!1)?s.trailingSpace++:s.trailingSpace&&(s.trailingSpaceNewLine=!0)),u(s))}function w(n,t){if(">"===n.next()){t.f=t.inline=e;i.highlightFormatting&&(t.formatting="link");var f=u(t);return f?f+=" ":f="",f+r.linkInline}return n.match(/^[^>]+/,!0),r.linkInline}function b(n,t){if(n.eatSpace())return null;var r,f=n.next();return"("===f||"["===f?(t.f=t.inline=(r="("===f?")":"]",function(n,t){if(n.next()===r){t.f=t.inline=e;i.highlightFormatting&&(t.formatting="link-string");var f=u(t);return t.linkHref=!1,f}return n.match(k[r]),t.linkHref=!0,u(t)}),i.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,u(t)):"error"}function st(n,t){return n.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=ht,n.next(),i.highlightFormatting&&(t.formatting="link"),t.linkText=!0,u(t)):l(n,t,e)}function ht(n,t){if(n.match("]:",!0)){t.f=t.inline=ct;i.highlightFormatting&&(t.formatting="link");var f=u(t);return t.linkText=!1,f}return n.match(/^([^\]\\]|\\.)+/,!0),r.linkText}function ct(n,t){return n.eatSpace()?null:(n.match(/^[^\s]+/,!0),void 0===n.peek()?t.linkTitle=!0:n.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),t.f=t.inline=e,r.linkHref+" url")}var f=n.getMode(t,"text/html"),a="null"==f.name,r,s,k,d;void 0===i.highlightFormatting&&(i.highlightFormatting=!1);void 0===i.maxBlockquoteDepth&&(i.maxBlockquoteDepth=0);void 0===i.taskLists&&(i.taskLists=!1);void 0===i.strikethrough&&(i.strikethrough=!1);void 0===i.emoji&&(i.emoji=!1);void 0===i.fencedCodeBlockHighlighting&&(i.fencedCodeBlockHighlighting=!0);void 0===i.fencedCodeBlockDefaultMode&&(i.fencedCodeBlockDefaultMode="text/plain");void 0===i.xml&&(i.xml=!0);void 0===i.tokenTypeOverrides&&(i.tokenTypeOverrides={});r={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(s in r)r.hasOwnProperty(s)&&i.tokenTypeOverrides[s]&&(r[s]=i.tokenTypeOverrides[s]);var g=/^([*\-_])(?:\s*\1){2,}\s*$/,nt=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,v=/^\[(x| )\](?=\s)/i,tt=i.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,it=/^ {0,3}(?:\={1,}|-{2,})\s*$/,rt=/^[^#!\[\]*_\\<>` "'(~:]+/,ut=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,ft=/^\s*\[[^\]]+?\]:.*$/,o=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/;return k={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/},d={startState:function(){return{f:h,prevLine:{stream:null},thisLine:{stream:null},block:h,htmlState:null,indentation:0,inline:e,text:ot,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&n.copyState(f,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?n.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkText:t.linkText,linkTitle:t.linkTitle,linkHref:t.linkHref,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,emoji:t.emoji,header:t.header,setext:t.setext,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedEndRE:t.fencedEndRE}},token:function(n,t){if(t.formatting=!1,n!=t.thisLine.stream){if(t.header=0,t.hr=!1,n.match(/^\s*$/,!0))return p(t),null;if(t.prevLine=t.thisLine,t.thisLine={stream:n},t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,!t.localState&&(t.f=t.block,t.f!=c)){var i=n.match(/^\s*/,!0)[0].replace(/\t/g,"    ").length;if(t.indentation=i,t.indentationDiff=null,i>0)return null}}return t.f(n,t)},innerMode:function(n){return n.block==c?{state:n.htmlState,mode:f}:n.localState?{state:n.localState,mode:n.localMode}:{state:n,mode:d}},indent:function(t,i,r){return t.block==c&&f.indent?f.indent(t.htmlState,i,r):t.localState&&t.localMode.indent?t.localMode.indent(t.localState,i,r):n.Pass},blankLine:p,getType:u,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"}},"xml");n.defineMIME("text/markdown","markdown");n.defineMIME("text/x-markdown","markdown")};"object"==_typeof(i)&&"object"==_typeof(t)?r(n("../../lib/codemirror"),n("../xml/xml"),n("../meta")):r(CodeMirror)},{"../../lib/codemirror":10,"../meta":13,"../xml/xml":14}],13:[function(n,t,i){!function(n){"use strict";var t,i;for(n.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded JavaScript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"],alias:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}],t=0;t<n.modeInfo.length;t++)i=n.modeInfo[t],i.mimes&&(i.mime=i.mimes[0]);n.findModeByMIME=function(t){var r,i,u;for(t=t.toLowerCase(),r=0;r<n.modeInfo.length;r++){if(i=n.modeInfo[r],i.mime==t)return i;if(i.mimes)for(u=0;u<i.mimes.length;u++)if(i.mimes[u]==t)return i}return/\+xml$/.test(t)?n.findModeByMIME("application/xml"):/\+json$/.test(t)?n.findModeByMIME("application/json"):void 0};n.findModeByExtension=function(t){var r,i,u;for(t=t.toLowerCase(),r=0;r<n.modeInfo.length;r++)if(i=n.modeInfo[r],i.ext)for(u=0;u<i.ext.length;u++)if(i.ext[u]==t)return i};n.findModeByFileName=function(t){for(var r,u,f,i=0;i<n.modeInfo.length;i++)if(r=n.modeInfo[i],r.file&&r.file.test(t))return r;return u=t.lastIndexOf("."),f=u>-1&&t.substring(u+1,t.length),f?n.findModeByExtension(f):void 0};n.findModeByName=function(t){var r,i,u;for(t=t.toLowerCase(),r=0;r<n.modeInfo.length;r++){if(i=n.modeInfo[r],i.name.toLowerCase()==t)return i;if(i.alias)for(u=0;u<i.alias.length;u++)if(i.alias[u].toLowerCase()==t)return i}}}("object"==_typeof(i)&&"object"==_typeof(t)?n("../lib/codemirror"):CodeMirror)},{"../lib/codemirror":10}],14:[function(n,t,i){!function(n){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},i={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};n.defineMode("xml",function(r,u){function s(n,t){function i(i){return t.tokenize=i,i(n,t)}var r=n.next();return"<"==r?n.eat("!")?n.eat("[")?n.match("CDATA[")?i(p("atom","]\]>")):null:n.match("--")?i(p("comment","-->")):n.match("DOCTYPE",!0,!0)?(n.eatWhile(/[\w\._\-]/),i(function n(t){return function(i,r){for(var u;null!=(u=i.next());){if("<"==u)return r.tokenize=n(t+1),r.tokenize(i,r);if(">"==u){if(1==t){r.tokenize=s;break}return r.tokenize=n(t-1),r.tokenize(i,r)}}return"meta"}}(1))):null:n.eat("?")?(n.eatWhile(/[\w\._\-]/),t.tokenize=p("meta","?>"),"meta"):(h=n.eat("/")?"closeTag":"openTag",t.tokenize=y,"tag bracket"):"&"==r?(n.eat("#")?n.eat("x")?n.eatWhile(/[a-fA-F\d]/)&&n.eat(";"):n.eatWhile(/[\d]/)&&n.eat(";"):n.eatWhile(/[\w\.\-:]/)&&n.eat(";"))?"atom":"error":(n.eatWhile(/[^&<]/),null)}function y(n,t){var u,f,i=n.next(),r;return">"==i||"/"==i&&n.eat(">")?(t.tokenize=s,h=">"==i?"endTag":"selfcloseTag","tag bracket"):"="==i?(h="equals",null):"<"==i?(t.tokenize=s,t.state=l,t.tagName=t.tagStart=null,r=t.tokenize(n,t),r?r+" tag error":"tag error"):/[\'\"]/.test(i)?(t.tokenize=(u=i,(f=function(n,t){for(;!n.eol();)if(n.next()==u){t.tokenize=y;break}return"string"}).isInAttribute=!0,f),t.stringStartCol=n.column(),t.tokenize(n,t)):(n.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function p(n,t){return function(i,r){for(;!i.eol();){if(i.match(t)){r.tokenize=s;break}i.next()}return n}}function it(n,t,i){this.prev=n.context;this.tagName=t||"";this.indent=n.indented;this.startOfLine=i;(f.doNotIndent.hasOwnProperty(t)||n.context&&n.context.noIndent)&&(this.noIndent=!0)}function w(n){n.context&&(n.context=n.context.prev)}function k(n,t){for(var i;;){if(!n.context)return;if(i=n.context.tagName,!f.contextGrabbers.hasOwnProperty(i)||!f.contextGrabbers[i].hasOwnProperty(t))return;w(n)}}function l(n,t,i){return"openTag"==n?(i.tagStart=t.column(),d):"closeTag"==n?rt:l}function d(n,t,i){return"word"==n?(i.tagName=t.current(),e="tag",o):f.allowMissingTagName&&"endTag"==n?(e="tag bracket",o(n,0,i)):(e="error",d)}function rt(n,t,i){if("word"==n){var r=t.current();return i.context&&i.context.tagName!=r&&f.implicitlyClosed.hasOwnProperty(i.context.tagName)&&w(i),i.context&&i.context.tagName==r||!1===f.matchClosing?(e="tag",a):(e="tag error",g)}return f.allowMissingTagName&&"endTag"==n?(e="tag bracket",a(n,0,i)):(e="error",g)}function a(n,t,i){return"endTag"!=n?(e="error",a):(w(i),l)}function g(n,t,i){return e="error",a(n,0,i)}function o(n,t,i){if("word"==n)return e="attribute",ut;if("endTag"==n||"selfcloseTag"==n){var r=i.tagName,u=i.tagStart;return i.tagName=i.tagStart=null,"selfcloseTag"==n||f.autoSelfClosers.hasOwnProperty(r)?k(i,r):(k(i,r),i.context=new it(i,r,u==i.indented)),l}return e="error",o}function ut(n,t,i){return"equals"==n?nt:(f.allowMissing||(e="error"),o(n,0,i))}function nt(n,t,i){return"string"==n?tt:"word"==n&&f.allowUnquoted?(e="string",o):(e="error",o(n,0,i))}function tt(n,t,i){return"string"==n?tt:o(n,0,i)}var h,e,v=r.indentUnit,f={},b=u.htmlMode?t:i;for(var c in b)f[c]=b[c];for(c in u)f[c]=u[c];return s.isInText=!0,{startState:function(n){var t={tokenize:s,state:l,indented:n||0,tagName:null,tagStart:null,context:null};return null!=n&&(t.baseIndent=n),t},token:function(n,t){if(!t.tagName&&n.sol()&&(t.indented=n.indentation()),n.eatSpace())return null;h=null;var i=t.tokenize(n,t);return(i||h)&&"comment"!=i&&(e=null,t.state=t.state(h||i,n,t),e&&(i="error"==e?i+" error":e)),i},indent:function(t,i,r){var u=t.context,e,o;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+v;if(u&&u.noIndent)return n.Pass;if(t.tokenize!=y&&t.tokenize!=s)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return!1!==f.multilineTagIndentPastTag?t.tagStart+t.tagName.length+2:t.tagStart+v*(f.multilineTagIndentFactor||1);if(f.alignCDATA&&/<!\[CDATA\[/.test(i))return 0;if(e=i&&/^<(\/)?([\w_:\.-]*)/.exec(i),e&&e[1])for(;u;){if(u.tagName==e[2]){u=u.prev;break}if(!f.implicitlyClosed.hasOwnProperty(u.tagName))break;u=u.prev}else if(e)for(;u;){if(o=f.contextGrabbers[u.tagName],!o||!o.hasOwnProperty(e[2]))break;u=u.prev}for(;u&&u.prev&&!u.startOfLine;)u=u.prev;return u?u.indent+v:t.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:f.htmlMode?"html":"xml",helperType:f.htmlMode?"html":"xml",skipAttribute:function(n){n.state==nt&&(n.state=o)},xmlCurrentTag:function(n){return n.tagName?{name:n.tagName,close:"closeTag"==n.type}:null},xmlCurrentContext:function(n){for(var i=[],t=n.context;t;t=t.prev)i.push(t.tagName);return i.reverse()}}});n.defineMIME("text/xml","xml");n.defineMIME("application/xml","xml");n.mimeModes.hasOwnProperty("text/html")||n.defineMIME("text/html",{name:"xml",htmlMode:!0})}("object"==_typeof(i)&&"object"==_typeof(t)?n("../../lib/codemirror"):CodeMirror)},{"../../lib/codemirror":10}],15:[function(n,t,i){!function(n,r){"object"==_typeof(i)&&void 0!==t?t.exports=r():(n="undefined"!=typeof globalThis?globalThis:n||self).marked=r()}(this,function(){"use strict";function nt(n,t){for(var i,r=0;r<t.length;r++)i=t[r],i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(n,i.key,i)}function tt(n,t){(null==t||t>n.length)&&(t=n.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=n[i];return r}function l(n,t){var i,r;if("undefined"==typeof Symbol||null==n[Symbol.iterator]){if(Array.isArray(n)||(i=function(n,t){if(n){if("string"==typeof n)return tt(n,t);var i=Object.prototype.toString.call(n).slice(8,-1);return"Object"===i&&n.constructor&&(i=n.constructor.name),"Map"===i||"Set"===i?Array.from(n):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?tt(n,t):void 0}}(n))||t&&n&&"number"==typeof n.length)return i&&(n=i),r=0,function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");}return(i=n[Symbol.iterator]()).next.bind(i)}function rt(n){return n.replace(gt,function(n,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function ut(n,t,i){var u=n.length,r,f;if(0===u)return"";for(r=0;r<u;)if(f=n.charAt(u-r-1),f!==t||i){if(f===t||!i)break;r++}else r++;return n.substr(0,u-r)}function et(n,t,i){var r=t.href,f=t.title?u(t.title):null,e=n[1].replace(/\\([\[\]])/g,"$1");return"!"!==n[0].charAt(0)?{type:"link",raw:i,href:r,title:f,text:e}:{type:"image",raw:i,href:r,title:f,text:u(e)}}function li(n){return n.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function ht(n){for(var i,r="",u=n.length,t=0;t<u;t++)i=n.charCodeAt(t),Math.random()>.5&&(i="x"+i.toString(16)),r+="&#"+i+";";return r}function i(n,t,r){var e,f,u,o,s;if(null==n)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof n)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected");if("function"==typeof t&&(r=t,t=null),t=b({},i.defaults,t||{}),vt(t),r){f=t.highlight;try{e=h.lex(n,t)}catch(n){return r(n)}return(u=function(n){var i;if(!n)try{i=c.parse(e,t)}catch(t){n=t}return t.highlight=f,n?r(n):r(null,i)},!f||f.length<3)?u():(delete t.highlight,!e.length)?u():(o=0,i.walkTokens(e,function(n){"code"===n.type&&(o++,setTimeout(function(){f(n.text,n.lang,function(t,i){if(t)return u(t);null!=i&&i!==n.text&&(n.text=i,n.escaped=!0);0==--o&&u()})},0))}),void(0===o&&u()))}try{return s=h.lex(n,t),t.walkTokens&&i.walkTokens(s,t.walkTokens),c.parse(s,t)}catch(n){if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:<\/p><pre>"+yt(n.message+"",!0)+"<\/pre>";throw n;}}var f=function(){var n={exports:{}};return function(n){n.exports={defaults:{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1},getDefaults:function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}},changeDefaults:function(t){n.exports.defaults=t}}}(n),n.exports}(),pt=/[&<>"']/,wt=/[&<>"']/g,bt=/[<>"']|&(?!#?\w+;)/,kt=/[<>"']|&(?!#?\w+;)/g,dt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},it=function(n){return dt[n]},gt=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,ni=/(^|[^\[])\^/g,ti=/[^\w:]/g,ii=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,a={},ri=/^[^:]+:\/*[^/]*$/,ui=/^([^:]+:)[\s\S]*$/,fi=/^([^:]+:\/*[^/]*)[\s\S]*$/,k=function(n,t){if(t){if(pt.test(n))return n.replace(wt,it)}else if(bt.test(n))return n.replace(kt,it);return n},ei=rt,ft=function(n){for(var i,t,r=1;r<arguments.length;r++)for(t in i=arguments[r])Object.prototype.hasOwnProperty.call(i,t)&&(n[t]=i[t]);return n},oi=ut,si=f.defaults,v=oi,y=function(n,t){var i=n.replace(/\|/g,function(n,t,i){for(var r=!1,u=t;--u>=0&&"\\"===i[u];)r=!r;return r?"|":" |"}).split(/ \|/),r=0;if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(/\\\|/g,"|");return i},u=k,hi=function(n,t){if(-1===n.indexOf(t[1]))return-1;for(var u=n.length,r=0,i=0;i<u;i++)if("\\"===n[i])i++;else if(n[i]===t[0])r++;else if(n[i]===t[1]&&--r<0)return i;return-1},d=function(){function t(n){this.options=n||si}var n=t.prototype;return n.space=function(n){var t=this.rules.block.newline.exec(n);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}},n.code=function(n){var t=this.rules.block.code.exec(n),i;if(t)return i=t[0].replace(/^ {1,4}/gm,""),{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:v(i,"\n")}},n.fences=function(n){var t=this.rules.block.fences.exec(n),i,r;if(t)return i=t[0],r=function(n,t){var r=n.match(/^(\s+)(?:```)/),i;return null===r?t:(i=r[1],t.split("\n").map(function(n){var t=n.match(/^\s+/);return null===t?n:t[0].length>=i.length?n.slice(i.length):n}).join("\n"))}(i,t[3]||""),{type:"code",raw:i,lang:t[2]?t[2].trim():t[2],text:r}},n.heading=function(n){var r=this.rules.block.heading.exec(n),t,i;if(r)return t=r[2].trim(),/#$/.test(t)&&(i=v(t,"#"),this.options.pedantic?t=i.trim():i&&!/ $/.test(i)||(t=i.trim())),{type:"heading",raw:r[0],depth:r[1].length,text:t}},n.nptable=function(n){var r=this.rules.block.nptable.exec(n),t,i,u;if(r&&(t={type:"table",header:y(r[1].replace(/^ *| *\| *$/g,"")),align:r[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:r[3]?r[3].replace(/\n$/,"").split("\n"):[],raw:r[0]},t.header.length===t.align.length)){for(u=t.align.length,i=0;i<u;i++)t.align[i]=/^ *-+: *$/.test(t.align[i])?"right":/^ *:-+: *$/.test(t.align[i])?"center":/^ *:-+ *$/.test(t.align[i])?"left":null;for(u=t.cells.length,i=0;i<u;i++)t.cells[i]=y(t.cells[i],t.header.length);return t}},n.hr=function(n){var t=this.rules.block.hr.exec(n);if(t)return{type:"hr",raw:t[0]}},n.blockquote=function(n){var t=this.rules.block.blockquote.exec(n),i;if(t)return i=t[0].replace(/^ *> ?/gm,""),{type:"blockquote",raw:t[0],text:i}},n.list=function(n){var c=this.rules.block.list.exec(n),i;if(c){var t,y,s,u,l,h,d,p,w,e=c[0],a=c[2],b=a.length>1,f={type:"list",raw:e,ordered:b,start:b?+a.slice(0,-1):"",loose:!1,items:[]},r=c[0].match(this.rules.block.item),k=!1,o=r.length;for(s=this.rules.block.listItemStart.exec(r[0]),i=0;i<o;i++){if(e=t=r[i],this.options.pedantic||(w=t.match(new RegExp("\\n\\s*\\n {0,"+(s[0].length-1)+"}\\S")))&&(l=t.length-w.index+r.slice(i+1).join("\n").length,f.raw=f.raw.substring(0,f.raw.length-l),e=t=t.substring(0,w.index),o=i+1),i!==o-1){if(u=this.rules.block.listItemStart.exec(r[i+1]),this.options.pedantic?u[1].length>s[1].length:u[1].length>=s[0].length||u[1].length>3){r.splice(i,2,r[i]+(!this.options.pedantic&&u[1].length<s[0].length&&!r[i].match(/\n$/)?"":"\n")+r[i+1]);i--;o--;continue}(!this.options.pedantic||this.options.smartLists?u[2][u[2].length-1]!==a[a.length-1]:b===(1===u[2].length))&&(l=r.slice(i+1).join("\n").length,f.raw=f.raw.substring(0,f.raw.length-l),i=o-1);s=u}y=t.length;~(t=t.replace(/^ *([*+-]|\d+[.)]) ?/,"")).indexOf("\n ")&&(y-=t.length,t=this.options.pedantic?t.replace(/^ {1,4}/gm,""):t.replace(new RegExp("^ {1,"+y+"}","gm"),""));t=v(t,"\n");i!==o-1&&(e+="\n");h=k||/\n\n(?!\s*$)/.test(e);i!==o-1&&(k="\n\n"===e.slice(-2),h||(h=k));h&&(f.loose=!0);this.options.gfm&&(p=void 0,(d=/^\[[ xX]\] /.test(t))&&(p=" "!==t[1],t=t.replace(/^\[[ xX]\] +/,"")));f.items.push({type:"list_item",raw:e,task:d,checked:p,loose:h,text:t})}return f}},n.html=function(n){var t=this.rules.block.html.exec(n);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):u(t[0]):t[0]}},n.def=function(n){var t=this.rules.block.def.exec(n);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}},n.table=function(n){var r=this.rules.block.table.exec(n),t,i,u;if(r&&(t={type:"table",header:y(r[1].replace(/^ *| *\| *$/g,"")),align:r[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:r[3]?r[3].replace(/\n$/,"").split("\n"):[]},t.header.length===t.align.length)){for(t.raw=r[0],u=t.align.length,i=0;i<u;i++)t.align[i]=/^ *-+: *$/.test(t.align[i])?"right":/^ *:-+: *$/.test(t.align[i])?"center":/^ *:-+ *$/.test(t.align[i])?"left":null;for(u=t.cells.length,i=0;i<u;i++)t.cells[i]=y(t.cells[i].replace(/^ *\| *| *\| *$/g,""),t.header.length);return t}},n.lheading=function(n){var t=this.rules.block.lheading.exec(n);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1]}},n.paragraph=function(n){var t=this.rules.block.paragraph.exec(n);if(t)return{type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1]}},n.text=function(n){var t=this.rules.block.text.exec(n);if(t)return{type:"text",raw:t[0],text:t[0]}},n.escape=function(n){var t=this.rules.inline.escape.exec(n);if(t)return{type:"escape",raw:t[0],text:u(t[1])}},n.tag=function(n,t,i){var r=this.rules.inline.tag.exec(n);if(r)return!t&&/^<a /i.test(r[0])?t=!0:t&&/^<\/a>/i.test(r[0])&&(t=!1),!i&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?i=!0:i&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(i=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:t,inRawBlock:i,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):u(r[0]):r[0]}},n.link=function(n){var t=this.rules.inline.link.exec(n),r,o,f,s,i,u,e;if(t){if(r=t[2].trim(),!this.options.pedantic&&/^</.test(r)){if(!/>$/.test(r))return;if(o=v(r.slice(0,-1),"\\"),(r.length-o.length)%2==0)return}else f=hi(t[2],"()"),f>-1&&(s=(0===t[0].indexOf("!")?5:4)+t[1].length+f,t[2]=t[2].substring(0,f),t[0]=t[0].substring(0,s).trim(),t[3]="");return i=t[2],u="",this.options.pedantic?(e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i),e&&(i=e[1],u=e[3])):u=t[3]?t[3].slice(1,-1):"",i=i.trim(),/^</.test(i)&&(i=this.options.pedantic&&!/>$/.test(r)?i.slice(1):i.slice(1,-1)),et(t,{href:i?i.replace(this.rules.inline._escapes,"$1"):i,title:u?u.replace(this.rules.inline._escapes,"$1"):u},t[0])}},n.reflink=function(n,t){var i,r,u;if((i=this.rules.inline.reflink.exec(n))||(i=this.rules.inline.nolink.exec(n)))return(r=(i[2]||i[1]).replace(/\s+/g," "),!(r=t[r.toLowerCase()])||!r.href)?(u=i[0].charAt(0),{type:"text",raw:u,text:u}):et(i,r,i[0])},n.emStrong=function(n,t,i){var r,s;if(void 0===i&&(i=""),r=this.rules.inline.emStrong.lDelim.exec(n),r&&(!r[3]||!i.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))&&(s=r[1]||r[2]||"",!s||s&&(""===i||this.rules.inline.punctuation.exec(i)))){var c,u,f=r[0].length-1,e=f,h=0,o="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(o.lastIndex=0,t=t.slice(-1*n.length+f);null!=(r=o.exec(t));)if(c=r[1]||r[2]||r[3]||r[4]||r[5]||r[6])if(u=c.length,r[3]||r[4])e+=u;else if(!((r[5]||r[6])&&f%3)||(f+u)%3){if(!((e-=u)>0)){if(e+h-u<=0&&!t.slice(o.lastIndex).match(o)&&(u=Math.min(u,u+e+h)),Math.min(f,u)%2)return{type:"em",raw:n.slice(0,f+r.index+u+1),text:n.slice(1,f+r.index+u)};if(Math.min(f,u)%2==0)return{type:"strong",raw:n.slice(0,f+r.index+u+1),text:n.slice(2,f+r.index+u-1)}}}else h+=u}},n.codespan=function(n){var i=this.rules.inline.code.exec(n);if(i){var t=i[2].replace(/\n/g," "),r=/[^ ]/.test(t),f=/^ /.test(t)&&/ $/.test(t);return r&&f&&(t=t.substring(1,t.length-1)),t=u(t,!0),{type:"codespan",raw:i[0],text:t}}},n.br=function(n){var t=this.rules.inline.br.exec(n);if(t)return{type:"br",raw:t[0]}},n.del=function(n){var t=this.rules.inline.del.exec(n);if(t)return{type:"del",raw:t[0],text:t[2]}},n.autolink=function(n,t){var r,f,i=this.rules.inline.autolink.exec(n);if(i)return f="@"===i[2]?"mailto:"+(r=u(this.options.mangle?t(i[1]):i[1])):r=u(i[1]),{type:"link",raw:i[0],text:r,href:f,tokens:[{type:"text",raw:r,text:r}]}},n.url=function(n,t){var i,r,f,e;if(i=this.rules.inline.url.exec(n)){if("@"===i[2])f="mailto:"+(r=u(this.options.mangle?t(i[0]):i[0]));else{do e=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(e!==i[0]);r=u(i[0]);f="www."===i[1]?"http://"+r:r}return{type:"link",raw:i[0],text:r,href:f,tokens:[{type:"text",raw:r,text:r}]}}},n.inlineText=function(n,t,i){var f,r=this.rules.inline.text.exec(n);if(r)return f=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):u(r[0]):r[0]:u(this.options.smartypants?i(r[0]):r[0]),{type:"text",raw:r[0],text:f}},t}(),o={exec:function(){}},r=function(n,t){n=n.source||n;t=t||"";var i={replace:function(t,r){return r=(r=r.source||r).replace(ni,"$1"),n=n.replace(t,r),i},getRegex:function(){return new RegExp(n,t)}};return i},e=ft,t={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:<\/\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|<\/?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|<\/(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:o,table:o,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/},n;t.def=r(t.def).replace("label",t._label).replace("title",t._title).getRegex();t.bullet=/(?:[*+-]|\d{1,9}[.)])/;t.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/;t.item=r(t.item,"gm").replace(/bull/g,t.bullet).getRegex();t.listItemStart=r(/^( *)(bull) */).replace("bull",t.bullet).getRegex();t.list=r(t.list).replace(/bull/g,t.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+t.def.source+")").getRegex();t._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";t._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;t.html=r(t.html,"i").replace("comment",t._comment).replace("tag",t._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();t.paragraph=r(t._paragraph).replace("hr",t.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","<\/?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",t._tag).getRegex();t.blockquote=r(t.blockquote).replace("paragraph",t.paragraph).getRegex();t.normal=e({},t);t.gfm=e({},t.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});t.gfm.nptable=r(t.gfm.nptable).replace("hr",t.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","<\/?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",t._tag).getRegex();t.gfm.table=r(t.gfm.table).replace("hr",t.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","<\/?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",t._tag).getRegex();t.pedantic=e({},t.normal,{html:r("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?<\/\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",t._comment).replace(/tag/g,"(?!(?: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+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:o,paragraph:r(t.normal._paragraph).replace("hr",t.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",t.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});n={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:o,tag:"^comment|^<\/[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_]*?\*[^_]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^*]*?\_[^*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:o,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/,_punctuation:"!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~"};n.punctuation=r(n.punctuation).replace(/punctuation/g,n._punctuation).getRegex();n.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;n.escapedEmSt=/\\\*|\\_/g;n._comment=r(t._comment).replace("(?:-->|$)","-->").getRegex();n.emStrong.lDelim=r(n.emStrong.lDelim).replace(/punct/g,n._punctuation).getRegex();n.emStrong.rDelimAst=r(n.emStrong.rDelimAst,"g").replace(/punct/g,n._punctuation).getRegex();n.emStrong.rDelimUnd=r(n.emStrong.rDelimUnd,"g").replace(/punct/g,n._punctuation).getRegex();n._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;n._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;n._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/;n.autolink=r(n.autolink).replace("scheme",n._scheme).replace("email",n._email).getRegex();n._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;n.tag=r(n.tag).replace("comment",n._comment).replace("attribute",n._attribute).getRegex();n._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;n._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;n._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;n.link=r(n.link).replace("label",n._label).replace("href",n._href).replace("title",n._title).getRegex();n.reflink=r(n.reflink).replace("label",n._label).getRegex();n.reflinkSearch=r(n.reflinkSearch,"g").replace("reflink",n.reflink).replace("nolink",n.nolink).getRegex();n.normal=e({},n);n.pedantic=e({},n.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:r(/^!?\[(label)\]\((.*?)\)/).replace("label",n._label).getRegex(),reflink:r(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",n._label).getRegex()});n.gfm=e({},n.normal,{escape:r(n.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/});n.gfm.url=r(n.gfm.url,"i").replace("email",n.gfm._extended_email).getRegex();n.breaks=e({},n.gfm,{br:r(n.br).replace("{2,}","*").getRegex(),text:r(n.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ot={block:t,inline:n},ci=f.defaults,p=ot.block,s=ot.inline,st=function(n,t){if(t<1)return"";for(var i="";t>1;)1&t&&(i+=n),t>>=1,n+=n;return i+n};var h=function(){function n(n){this.tokens=[];this.tokens.links=Object.create(null);this.options=n||ci;this.options.tokenizer=this.options.tokenizer||new d;this.tokenizer=this.options.tokenizer;this.tokenizer.options=this.options;var t={block:p.normal,inline:s.normal};this.options.pedantic?(t.block=p.pedantic,t.inline=s.pedantic):this.options.gfm&&(t.block=p.gfm,t.inline=this.options.breaks?s.breaks:s.gfm);this.tokenizer.rules=t}n.lex=function(t,i){return new n(i).lex(t)};n.lexInline=function(t,i){return new n(i).inlineTokens(t)};var i,r,t=n.prototype;return t.lex=function(n){return n=n.replace(/\r\n|\r/g,"\n").replace(/\t/g,"    "),this.blockTokens(n,this.tokens,!0),this.inline(this.tokens),this.tokens},t.blockTokens=function(n,t,i){var r,f,o,u,e;for(void 0===t&&(t=[]),void 0===i&&(i=!0),this.options.pedantic&&(n=n.replace(/^ +$/gm,""));n;)if(r=this.tokenizer.space(n))n=n.substring(r.raw.length),r.type&&t.push(r);else if(r=this.tokenizer.code(n))n=n.substring(r.raw.length),(u=t[t.length-1])&&"paragraph"===u.type?(u.raw+="\n"+r.raw,u.text+="\n"+r.text):t.push(r);else if(r=this.tokenizer.fences(n))n=n.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(n))n=n.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.nptable(n))n=n.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(n))n=n.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(n))n=n.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],i),t.push(r);else if(r=this.tokenizer.list(n)){for(n=n.substring(r.raw.length),o=r.items.length,f=0;f<o;f++)r.items[f].tokens=this.blockTokens(r.items[f].text,[],!1);t.push(r)}else if(r=this.tokenizer.html(n))n=n.substring(r.raw.length),t.push(r);else if(i&&(r=this.tokenizer.def(n)))n=n.substring(r.raw.length),this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});else if(r=this.tokenizer.table(n))n=n.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.lheading(n))n=n.substring(r.raw.length),t.push(r);else if(i&&(r=this.tokenizer.paragraph(n)))n=n.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.text(n))n=n.substring(r.raw.length),(u=t[t.length-1])&&"text"===u.type?(u.raw+="\n"+r.raw,u.text+="\n"+r.text):t.push(r);else if(n){if(e="Infinite loop on byte: "+n.charCodeAt(0),this.options.silent){console.error(e);break}throw new Error(e);}return t},t.inline=function(n){for(var t,r,u,e,i,o=n.length,f=0;f<o;f++)switch((i=n[f]).type){case"paragraph":case"text":case"heading":i.tokens=[];this.inlineTokens(i.text,i.tokens);break;case"table":for(i.tokens={header:[],cells:[]},u=i.header.length,t=0;t<u;t++)i.tokens.header[t]=[],this.inlineTokens(i.header[t],i.tokens.header[t]);for(u=i.cells.length,t=0;t<u;t++)for(e=i.cells[t],i.tokens.cells[t]=[],r=0;r<e.length;r++)i.tokens.cells[t][r]=[],this.inlineTokens(e[r],i.tokens.cells[t][r]);break;case"blockquote":this.inline(i.tokens);break;case"list":for(u=i.items.length,t=0;t<u;t++)this.inline(i.items[t].tokens)}return n},t.inlineTokens=function(n,t,i,r){var u,h,e,c,l,f,a,o,s,v;if(void 0===t&&(t=[]),void 0===i&&(i=!1),void 0===r&&(r=!1),f=n,this.tokens.links&&(a=Object.keys(this.tokens.links),a.length>0))for(;null!=(e=this.tokenizer.rules.inline.reflinkSearch.exec(f));)a.includes(e[0].slice(e[0].lastIndexOf("[")+1,-1))&&(f=f.slice(0,e.index)+"["+st("a",e[0].length-2)+"]"+f.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));for(;null!=(e=this.tokenizer.rules.inline.blockSkip.exec(f));)f=f.slice(0,e.index)+"["+st("a",e[0].length-2)+"]"+f.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(e=this.tokenizer.rules.inline.escapedEmSt.exec(f));)f=f.slice(0,e.index)+"++"+f.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;n;)if(c||(l=""),c=!1,u=this.tokenizer.escape(n))n=n.substring(u.raw.length),t.push(u);else if(u=this.tokenizer.tag(n,i,r))n=n.substring(u.raw.length),i=u.inLink,r=u.inRawBlock,o=t[t.length-1],o&&"text"===u.type&&"text"===o.type?(o.raw+=u.raw,o.text+=u.text):t.push(u);else if(u=this.tokenizer.link(n))n=n.substring(u.raw.length),"link"===u.type&&(u.tokens=this.inlineTokens(u.text,[],!0,r)),t.push(u);else if(u=this.tokenizer.reflink(n,this.tokens.links))n=n.substring(u.raw.length),s=t[t.length-1],"link"===u.type?(u.tokens=this.inlineTokens(u.text,[],!0,r),t.push(u)):s&&"text"===u.type&&"text"===s.type?(s.raw+=u.raw,s.text+=u.text):t.push(u);else if(u=this.tokenizer.emStrong(n,f,l))n=n.substring(u.raw.length),u.tokens=this.inlineTokens(u.text,[],i,r),t.push(u);else if(u=this.tokenizer.codespan(n))n=n.substring(u.raw.length),t.push(u);else if(u=this.tokenizer.br(n))n=n.substring(u.raw.length),t.push(u);else if(u=this.tokenizer.del(n))n=n.substring(u.raw.length),u.tokens=this.inlineTokens(u.text,[],i,r),t.push(u);else if(u=this.tokenizer.autolink(n,ht))n=n.substring(u.raw.length),t.push(u);else if(!i&&(u=this.tokenizer.url(n,ht)))n=n.substring(u.raw.length),t.push(u);else if(u=this.tokenizer.inlineText(n,r,li))n=n.substring(u.raw.length),"_"!==u.raw.slice(-1)&&(l=u.raw.slice(-1)),c=!0,(h=t[t.length-1])&&"text"===h.type?(h.raw+=u.raw,h.text+=u.text):t.push(u);else if(n){if(v="Infinite loop on byte: "+n.charCodeAt(0),this.options.silent){console.error(v);break}throw new Error(v);}return t},i=n,r=[{key:"rules",get:function(){return{block:p,inline:s}}}],null&&nt(i.prototype,null),r&&nt(i,r),n}(),ai=f.defaults,ct=function(n,t,i){if(n){var r;try{r=decodeURIComponent(rt(i)).replace(ti,"").toLowerCase()}catch(n){return null}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:")||0===r.indexOf("data:"))return null}t&&!ii.test(i)&&(i=function(n,t){a[" "+n]||(a[" "+n]=ri.test(n)?n+"/":ut(n,"/",!0));var i=-1===(n=a[" "+n]).indexOf(":");return"//"===t.substring(0,2)?i?t:n.replace(ui,"$1")+t:"/"===t.charAt(0)?i?t:n.replace(fi,"$1")+t:n+t}(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(n){return null}return i},w=k,g=function(){function t(n){this.options=n||ai}var n=t.prototype;return n.code=function(n,t,i){var u=(t||"").match(/\S*/)[0],r;return this.options.highlight&&(r=this.options.highlight(n,u),null!=r&&r!==n&&(i=!0,n=r)),n=n.replace(/\n$/,"")+"\n",u?'<pre><code class="'+this.options.langPrefix+w(u,!0)+'">'+(i?n:w(n,!0))+"<\/code><\/pre>\n":"<pre><code>"+(i?n:w(n,!0))+"<\/code><\/pre>\n"},n.blockquote=function(n){return"<blockquote>\n"+n+"<\/blockquote>\n"},n.html=function(n){return n},n.heading=function(n,t,i,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(i)+'">'+n+"<\/h"+t+">\n":"<h"+t+">"+n+"<\/h"+t+">\n"},n.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"},n.list=function(n,t,i){var r=t?"ol":"ul";return"<"+r+(t&&1!==i?' start="'+i+'"':"")+">\n"+n+"<\/"+r+">\n"},n.listitem=function(n){return"<li>"+n+"<\/li>\n"},n.checkbox=function(n){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},n.paragraph=function(n){return"<p>"+n+"<\/p>\n"},n.table=function(n,t){return t&&(t="<tbody>"+t+"<\/tbody>"),"<table>\n<thead>\n"+n+"<\/thead>\n"+t+"<\/table>\n"},n.tablerow=function(n){return"<tr>\n"+n+"<\/tr>\n"},n.tablecell=function(n,t){var i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+n+"<\/"+i+">\n"},n.strong=function(n){return"<strong>"+n+"<\/strong>"},n.em=function(n){return"<em>"+n+"<\/em>"},n.codespan=function(n){return"<code>"+n+"<\/code>"},n.br=function(){return this.options.xhtml?"<br/>":"<br>"},n.del=function(n){return"<del>"+n+"<\/del>"},n.link=function(n,t,i){if(null===(n=ct(this.options.sanitize,this.options.baseUrl,n)))return i;var r='<a href="'+w(n)+'"';return t&&(r+=' title="'+t+'"'),r+">"+i+"<\/a>"},n.image=function(n,t,i){if(null===(n=ct(this.options.sanitize,this.options.baseUrl,n)))return i;var r='<img src="'+n+'" alt="'+i+'"';return t&&(r+=' title="'+t+'"'),r+(this.options.xhtml?"/>":">")},n.text=function(n){return n},t}(),lt=function(){function t(){}var n=t.prototype;return n.strong=function(n){return n},n.em=function(n){return n},n.codespan=function(n){return n},n.del=function(n){return n},n.html=function(n){return n},n.text=function(n){return n},n.link=function(n,t,i){return""+i},n.image=function(n,t,i){return""+i},n.br=function(){return""},t}(),at=function(){function t(){this.seen={}}var n=t.prototype;return n.serialize=function(n){return n.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},n.getNextSafeSlug=function(n,t){var i=n,r=0;if(this.seen.hasOwnProperty(i)){r=this.seen[n];do i=n+"-"+ ++r;while(this.seen.hasOwnProperty(i))}return t||(this.seen[n]=r,this.seen[i]=0),i},n.slug=function(n,t){void 0===t&&(t={});var i=this.serialize(n);return this.getNextSafeSlug(i,t.dryrun)},t}(),vi=f.defaults,yi=ei,c=function(){function n(n){this.options=n||vi;this.options.renderer=this.options.renderer||new g;this.renderer=this.options.renderer;this.renderer.options=this.options;this.textRenderer=new lt;this.slugger=new at}n.parse=function(t,i){return new n(i).parse(t)};n.parseInline=function(t,i){return new n(i).parseInline(t)};var t=n.prototype;return t.parse=function(n,t){var o,u,c,s,k,d,h,v,f,i,g,nt,y,a,r,p,tt,l,e,w,b;for(void 0===t&&(t=!0),e="",w=n.length,o=0;o<w;o++)switch((i=n[o]).type){case"space":continue;case"hr":e+=this.renderer.hr();continue;case"heading":e+=this.renderer.heading(this.parseInline(i.tokens),i.depth,yi(this.parseInline(i.tokens,this.textRenderer)),this.slugger);continue;case"code":e+=this.renderer.code(i.text,i.lang,i.escaped);continue;case"table":for(v="",h="",s=i.header.length,u=0;u<s;u++)h+=this.renderer.tablecell(this.parseInline(i.tokens.header[u]),{header:!0,align:i.align[u]});for(v+=this.renderer.tablerow(h),f="",s=i.cells.length,u=0;u<s;u++){for(h="",k=(d=i.tokens.cells[u]).length,c=0;c<k;c++)h+=this.renderer.tablecell(this.parseInline(d[c]),{header:!1,align:i.align[c]});f+=this.renderer.tablerow(h)}e+=this.renderer.table(v,f);continue;case"blockquote":f=this.parse(i.tokens);e+=this.renderer.blockquote(f);continue;case"list":for(g=i.ordered,nt=i.start,y=i.loose,s=i.items.length,f="",u=0;u<s;u++)p=(r=i.items[u]).checked,tt=r.task,a="",r.task&&(l=this.renderer.checkbox(p),y?r.tokens.length>0&&"text"===r.tokens[0].type?(r.tokens[0].text=l+" "+r.tokens[0].text,r.tokens[0].tokens&&r.tokens[0].tokens.length>0&&"text"===r.tokens[0].tokens[0].type&&(r.tokens[0].tokens[0].text=l+" "+r.tokens[0].tokens[0].text)):r.tokens.unshift({type:"text",text:l}):a+=l),a+=this.parse(r.tokens,y),f+=this.renderer.listitem(a,tt,p);e+=this.renderer.list(f,g,nt);continue;case"html":e+=this.renderer.html(i.text);continue;case"paragraph":e+=this.renderer.paragraph(this.parseInline(i.tokens));continue;case"text":for(f=i.tokens?this.parseInline(i.tokens):i.text;o+1<w&&"text"===n[o+1].type;)f+="\n"+((i=n[++o]).tokens?this.parseInline(i.tokens):i.text);e+=t?this.renderer.paragraph(f):f;continue;default:if(b='Token with "'+i.type+'" type was not found.',this.options.silent)return void console.error(b);throw new Error(b);}return e},t.parseInline=function(n,t){var u,i,r,e,f;for(t=t||this.renderer,r="",e=n.length,u=0;u<e;u++)switch((i=n[u]).type){case"escape":r+=t.text(i.text);break;case"html":r+=t.html(i.text);break;case"link":r+=t.link(i.href,i.title,this.parseInline(i.tokens,t));break;case"image":r+=t.image(i.href,i.title,i.text);break;case"strong":r+=t.strong(this.parseInline(i.tokens,t));break;case"em":r+=t.em(this.parseInline(i.tokens,t));break;case"codespan":r+=t.codespan(i.text);break;case"br":r+=t.br();break;case"del":r+=t.del(this.parseInline(i.tokens,t));break;case"text":r+=t.text(i.text);break;default:if(f='Token with "'+i.type+'" type was not found.',this.options.silent)return void console.error(f);throw new Error(f);}return r},n}(),b=ft,vt=function(n){n&&n.sanitize&&!n.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")},yt=k,pi=f.getDefaults,wi=f.changeDefaults,bi=f.defaults;return i.options=i.setOptions=function(n){return b(i.defaults,n),wi(i.defaults),i},i.getDefaults=pi,i.defaults=bi,i.use=function(n){var t=b({},n),r;(n.renderer&&function(){var r=i.defaults.renderer||new g,u=function(t){var i=r[t];r[t]=function(){for(var f,o=arguments.length,e=new Array(o),u=0;u<o;u++)e[u]=arguments[u];return f=n.renderer[t].apply(r,e),!1===f&&(f=i.apply(r,e)),f}};for(var f in n.renderer)u(f);t.renderer=r}(),n.tokenizer&&function(){var r=i.defaults.tokenizer||new d,u=function(t){var i=r[t];r[t]=function(){for(var f,o=arguments.length,e=new Array(o),u=0;u<o;u++)e[u]=arguments[u];return f=n.tokenizer[t].apply(r,e),!1===f&&(f=i.apply(r,e)),f}};for(var f in n.tokenizer)u(f);t.tokenizer=r}(),n.walkTokens)&&(r=i.defaults.walkTokens,t.walkTokens=function(t){n.walkTokens(t);r&&r(t)});i.setOptions(t)},i.walkTokens=function(n,t){for(var u,r,e,o,s,h,c,a,v,y,f=l(n);!(u=f()).done;){r=u.value;switch(t(r),r.type){case"table":for(o=l(r.tokens.header);!(e=o()).done;)s=e.value,i.walkTokens(s,t);for(c=l(r.tokens.cells);!(h=c()).done;)for(v=l(h.value);!(a=v()).done;)y=a.value,i.walkTokens(y,t);break;case"list":i.walkTokens(r.items,t);break;default:r.tokens&&i.walkTokens(r.tokens,t)}}},i.parseInline=function(n,t){if(null==n)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof n)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected");t=b({},i.defaults,t||{});vt(t);try{var r=h.lexInline(n,t);return t.walkTokens&&i.walkTokens(r,t.walkTokens),c.parseInline(r,t)}catch(n){if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:<\/p><pre>"+yt(n.message+"",!0)+"<\/pre>";throw n;}},i.Parser=c,i.parser=c.parse,i.Renderer=g,i.TextRenderer=lt,i.Lexer=h,i.lexer=h.lex,i.Tokenizer=d,i.Slugger=at,i.parse=i,i})},{}],16:[function(n,t){(function(i){(function(){var r;!function(){"use strict";(r=function(n,t,r,u){function l(n,t){var i=f._readFile(n,null,u.asyncLoad);u.asyncLoad?i.then(function(n){t(n)}):t(i)}function v(n){t=n;r&&a()}function y(n){r=n;t&&a()}function a(){var i,s,l,n;for(f.rules=f._parseAFF(t),f.compoundRuleCodes={},e=0,h=f.compoundRules.length;e<h;e++)for(i=f.compoundRules[e],o=0,c=i.length;o<c;o++)f.compoundRuleCodes[i[o]]=[];for(e in"ONLYINCOMPOUND"in f.flags&&(f.compoundRuleCodes[f.flags.ONLYINCOMPOUND]=[]),f.dictionaryTable=f._parseDIC(r),f.compoundRuleCodes)0===f.compoundRuleCodes[e].length&&delete f.compoundRuleCodes[e];for(e=0,h=f.compoundRules.length;e<h;e++){for(s=f.compoundRules[e],l="",o=0,c=s.length;o<c;o++)n=s[o],l+=n in f.compoundRuleCodes?"("+f.compoundRuleCodes[n].join("|")+")":n;f.compoundRules[e]=new RegExp(l,"i")}f.loaded=!0;u.asyncLoad&&u.loadedCallback&&u.loadedCallback(f)}u=u||{};this.dictionary=null;this.rules={};this.dictionaryTable={};this.compoundRules=[];this.compoundRuleCodes={};this.replacementTable=[];this.flags=u.flags||{};this.memoized={};this.loaded=!1;var s,e,o,h,c,f=this;return n&&(f.dictionary=n,t&&r?a():"undefined"!=typeof window&&"chrome"in window&&"extension"in window.chrome&&"getURL"in window.chrome.extension?(s=u.dictionaryPath?u.dictionaryPath:"typo/dictionaries",t||l(chrome.extension.getURL(s+"/"+n+"/"+n+".aff"),v),r||l(chrome.extension.getURL(s+"/"+n+"/"+n+".dic"),y)):(s=u.dictionaryPath?u.dictionaryPath:void 0!==i?i+"/dictionaries":"./dictionaries",t||l(s+"/"+n+"/"+n+".aff",v),r||l(s+"/"+n+"/"+n+".dic",y))),this}).prototype={load:function(n){for(var t in n)n.hasOwnProperty(t)&&(this[t]=n[t]);return this},_readFile:function(t,i,r){var e,u,f;if(i=i||"utf8","undefined"!=typeof XMLHttpRequest)return u=new XMLHttpRequest,u.open("GET",t,r),r&&(e=new Promise(function(n,t){u.onload=function(){200===u.status?n(u.responseText):t(u.statusText)};u.onerror=function(){t(u.statusText)}})),u.overrideMimeType&&u.overrideMimeType("text/plain; charset="+i),u.send(null),r?e:u.responseText;if(void 0!==n){f=n("fs");try{if(f.existsSync(t))return f.readFileSync(t,i);console.log("Path "+t+" does not exist.")}catch(n){return console.log(n),""}}},_parseAFF:function(n){for(var c,o,r,u,s,p={},h=(n=this._removeAffixComments(n)).split(/\r?\n/),f,i,t=0,y=h.length;t<y;t++)if(f=(c=h[t]).split(/\s+/),i=f[0],"PFX"==i||"SFX"==i){var d=f[1],g=f[2],w=[];for(u=t+1,s=t+1+(o=parseInt(f[3],10));u<s;u++){var l=(r=h[u].split(/\s+/))[2],b=r[3].split("/"),a=b[0];"0"===a&&(a="");var k=this.parseRuleCodes(b[1]),v=r[4],e={};e.add=a;k.length>0&&(e.continuationClasses=k);"."!==v&&(e.match="SFX"===i?new RegExp(v+"$"):new RegExp("^"+v));"0"!=l&&(e.remove="SFX"===i?new RegExp(l+"$"):l);w.push(e)}p[d]={type:i,combineable:"Y"==g,entries:w};t+=o}else if("COMPOUNDRULE"===i){for(u=t+1,s=t+1+(o=parseInt(f[1],10));u<s;u++)r=(c=h[u]).split(/\s+/),this.compoundRules.push(r[1]);t+=o}else"REP"===i?3===(r=c.split(/\s+/)).length&&this.replacementTable.push([r[1],r[2]]):this.flags[i]=f[1];return p},_removeAffixComments:function(n){return(n=(n=(n=n.replace(/^\s*#.*$/gm,"")).replace(/^\s\s*/m,"").replace(/\s\s*$/m,"")).replace(/\n{2,}/g,"\n")).replace(/^\s\s*/,"").replace(/\s\s*$/,"")},_parseDIC:function(n){function o(n,i){t.hasOwnProperty(n)||(t[n]=null);i.length>0&&(null===t[n]&&(t[n]=[]),t[n].push(i))}for(var a,s,r,i,u,v,h,f,p,c,d,e,b=(n=this._removeDicComments(n)).split(/\r?\n/),t={},l=1,nt=b.length;l<nt;l++)if(a=b[l],a)if(s=a.split("/",2),r=s[0],s.length>1)for(i=this.parseRuleCodes(s[1]),("NEEDAFFIX"in this.flags)&&-1!=i.indexOf(this.flags.NEEDAFFIX)||o(r,i),u=0,v=i.length;u<v;u++){if(h=i[u],f=this.rules[h],f)for(var k=this._applyRule(r,f),y=0,tt=k.length;y<tt;y++)if(p=k[y],o(p,[]),f.combineable)for(c=u+1;c<v;c++)if(d=i[c],e=this.rules[d],e&&e.combineable&&f.type!=e.type)for(var g=this._applyRule(p,e),w=0,it=g.length;w<it;w++)o(g[w],[]);h in this.compoundRuleCodes&&this.compoundRuleCodes[h].push(r)}else o(r.trim(),[]);return t},_removeDicComments:function(n){return n.replace(/^\t.*$/gm,"")},parseRuleCodes:function(n){if(!n)return[];if(!("FLAG"in this.flags))return n.split("");if("long"===this.flags.FLAG){for(var i=[],t=0,r=n.length;t<r;t+=2)i.push(n.substr(t,2));return i}if("num"===this.flags.FLAG)return n.split(",")},_applyRule:function(n,t){for(var i,r,f,h,o,s=t.entries,u=[],e=0,c=s.length;e<c;e++)if(i=s[e],(!i.match||n.match(i.match))&&(r=n,i.remove&&(r=r.replace(i.remove,"")),"SFX"===t.type?r+=i.add:r=i.add+r,u.push(r),"continuationClasses"in i))for(f=0,h=i.continuationClasses.length;f<h;f++)o=this.rules[i.continuationClasses[f]],o&&(u=u.concat(this._applyRule(r,o)));return u},check:function(n){var t,r,i;if(!this.loaded)throw"Dictionary not loaded.";if(t=n.replace(/^\s\s*/,"").replace(/\s\s*$/,""),this.checkExact(t))return!0;if(t.toUpperCase()===t){if(r=t[0]+t.substring(1).toLowerCase(),this.hasFlag(r,"KEEPCASE"))return!1;if(this.checkExact(r)||this.checkExact(t.toLowerCase()))return!0}if(i=t[0].toLowerCase()+t.substring(1),i!==t){if(this.hasFlag(i,"KEEPCASE"))return!1;if(this.checkExact(i))return!0}return!1},checkExact:function(n){if(!this.loaded)throw"Dictionary not loaded.";var t,r,i=this.dictionaryTable[n];if(void 0===i){if("COMPOUNDMIN"in this.flags&&n.length>=this.flags.COMPOUNDMIN)for(t=0,r=this.compoundRules.length;t<r;t++)if(n.match(this.compoundRules[t]))return!0}else{if(null===i)return!0;if("object"==_typeof(i))for(t=0,r=i.length;t<r;t++)if(!this.hasFlag(n,"ONLYINCOMPOUND",i[t]))return!0}return!1},hasFlag:function(n,t,i){if(!this.loaded)throw"Dictionary not loaded.";return!(!(t in this.flags)||(void 0===i&&(i=Array.prototype.concat.apply([],this.dictionaryTable[n])),!i||-1===i.indexOf(this.flags[t])))},alphabet:"",suggest:function(n,t){function s(n,t){var h,o,l,u,f={},a=i.alphabet.length,s,r,c,e;"string"==typeof n&&(s=n,(n={})[s]=!0);for(s in n)for(h=0,l=s.length+1;h<l;h++){if(r=[s.substring(0,h),s.substring(h)],r[1]&&(u=r[0]+r[1].substring(1),t&&!i.check(u)||(u in f?f[u]+=1:f[u]=1)),r[1].length>1&&r[1][1]!==r[1][0]&&(u=r[0]+r[1][1]+r[1][0]+r[1].substring(2),t&&!i.check(u)||(u in f?f[u]+=1:f[u]=1)),r[1])for(c=r[1].substring(0,1).toUpperCase()===r[1].substring(0,1)?"uppercase":"lowercase",o=0;o<a;o++)e=i.alphabet[o],"uppercase"===c&&(e=e.toUpperCase()),e!=r[1].substring(0,1)&&(u=r[0]+e+r[1].substring(1),t&&!i.check(u)||(u in f?f[u]+=1:f[u]=1));if(r[1])for(o=0;o<a;o++)c=r[0].substring(-1).toUpperCase()===r[0].substring(-1)&&r[1].substring(0,1).toUpperCase()===r[1].substring(0,1)?"uppercase":"lowercase",e=i.alphabet[o],"uppercase"===c&&(e=e.toUpperCase()),u=r[0]+e+r[1],t&&!i.check(u)||(u in f?f[u]+=1:f[u]=1)}return f}var f,r,o,u,e,i;if(!this.loaded)throw"Dictionary not loaded.";if((t=t||5,this.memoized.hasOwnProperty(n))&&(f=this.memoized[n].limit,t<=f||this.memoized[n].suggestions.length<f))return this.memoized[n].suggestions.slice(0,t);if(this.check(n))return[];for(r=0,o=this.replacementTable.length;r<o;r++)if(u=this.replacementTable[r],-1!==n.indexOf(u[0])&&(e=n.replace(u[0],u[1]),this.check(e)))return[e];return i=this,i.alphabet="abcdefghijklmnopqrstuvwxyz",this.memoized[n]={suggestions:function(n){var r,h=s(n),e=s(h,!0),f,u,c,o,l;for(f in h)i.check(f)&&(f in e?e[f]+=h[f]:e[f]=h[f]);u=[];for(r in e)e.hasOwnProperty(r)&&u.push([r,e[r]]);for(u.sort(function(n,t){var i=n[1],r=t[1];return i<r?-1:i>r?1:t[0].localeCompare(n[0])}).reverse(),c=[],o="lowercase",n.toUpperCase()===n?o="uppercase":n.substr(0,1).toUpperCase()+n.substr(1).toLowerCase()===n&&(o="capitalized"),l=t,r=0;r<Math.min(l,u.length);r++)"uppercase"===o?u[r][0]=u[r][0].toUpperCase():"capitalized"===o&&(u[r][0]=u[r][0].substr(0,1).toUpperCase()+u[r][0].substr(1)),i.hasFlag(u[r][0],"NOSUGGEST")||-1!=c.indexOf(u[r][0])?l++:c.push(u[r][0]);return c}(n),limit:t},this.memoized[n].suggestions}}}();void 0!==t&&(t.exports=r)}).call(this)}).call(this,"/node_modules/typo-js")},{fs:1}],17:[function(n){var t=n("codemirror");t.commands.tabAndIndentMarkdownList=function(n){var i=n.listSelections()[0].head,t;!1!==n.getStateAfter(i.line).list?n.execCommand("indentMore"):n.options.indentWithTabs?n.execCommand("insertTab"):(t=Array(n.options.tabSize+1).join(" "),n.replaceSelection(t))};t.commands.shiftTabAndUnindentMarkdownList=function(n){var i=n.listSelections()[0].head,t;!1!==n.getStateAfter(i.line).list?n.execCommand("indentLess"):n.options.indentWithTabs?n.execCommand("insertTab"):(t=Array(n.options.tabSize+1).join(" "),n.replaceSelection(t))}},{codemirror:10}],18:[function(n,t){"use strict";function ni(n){return gt?n.replace("Ctrl","Cmd"):n.replace("Cmd","Ctrl")}function ti(n){return yt[n]||(yt[n]=new RegExp("\\s*"+n+"(\\s*)","g"))}function ii(n,t){if(n&&t){var i=ti(t);n.className.match(i)||(n.className+=" "+t)}}function ri(n,t){if(n&&t){var i=ti(t);n.className.match(i)&&(n.className=n.className.replace(i,"$1"))}}function li(n,t,i,r){var s=pt(n,!1,t,i,"button",r),f,e,h,u;for(s.className+=" easymde-dropdown",f=document.createElement("div"),f.className="easymde-dropdown-content",e=0;e<n.children.length;e++)u=n.children[e],h=pt("string"==typeof u&&u in o?o[u]:u,!0,t,i,"button",r),f.appendChild(h);return s.appendChild(f),s}function pt(n,t,i,r,u,f){var e,o,s,h,l,v,a,y;for(n=n||{},e=document.createElement(u),e.className=n.name,e.setAttribute("type",u),i=null==i||i,n.name&&(n.name in r)&&(c[n.name]=n.action),n.title&&i&&(e.title=function(n,t,i){var r,u=n;return t&&i[r=function(n){for(var t in c)if(c[t]===n)return t;return null}(t)]&&(u+=" ("+ni(i[r])+")"),u}(n.title,n.action,r),gt&&(e.title=e.title.replace("Ctrl","⌘"),e.title=e.title.replace("Alt","⌥"))),n.noDisable&&e.classList.add("no-disable"),n.noMobile&&e.classList.add("no-mobile"),o=[],void 0!==n.className&&(o=n.className.split(" ")),s=[],h=0;h<o.length;h++)l=o[h],l.match(/^fa([srlb]|(-[\w-]*)|$)/)?s.push(l):e.classList.add(l);for(e.tabIndex=-1,v=document.createElement("i"),a=0;a<s.length;a++)y=s[a],v.classList.add(y);return e.appendChild(v),void 0!==n.icon&&(e.innerHTML=n.icon),n.action&&t&&("function"==typeof n.action?e.onclick=function(t){t.preventDefault();n.action(f)}:"string"==typeof n.action&&(e.onclick=function(t){t.preventDefault();window.open(n.action,"_blank")})),e}function ai(){var n=document.createElement("i");return n.className="separator",n.innerHTML="|",n}function r(n,t){var u;if(t=t||n.getCursor("start"),u=n.getTokenAt(t),!u.type)return{};for(var r,e,o=u.type.split(" "),i={},f=0;f<o.length;f++)"strong"===(r=o[f])?i.bold=!0:"variable-2"===r?(e=n.getLine(t.line),/^\s*\d+\.\s/.test(e)?i["ordered-list"]=!0:i["unordered-list"]=!0):"atom"===r?i.quote=!0:"em"===r?i.italic=!0:"quote"===r?i.quote=!0:"strikethrough"===r?i.strikethrough=!0:"comment"===r?i.code=!0:"link"===r?i.link=!0:"tag"===r?i.image=!0:r.match(/^header(-[1-6])?$/)&&(i[r.replace("header","heading")]=!0);return i}function e(n){var t=n.codemirror,r,u,f,i;t.setOption("fullScreen",!t.getOption("fullScreen"));t.getOption("fullScreen")?(wt=document.body.style.overflow,document.body.style.overflow="hidden"):document.body.style.overflow=wt;r=t.getWrapperElement();u=r.nextSibling;/editor-preview-active-side/.test(u.className)&&(!1===n.options.sideBySideFullscreen?(f=r.parentNode,t.getOption("fullScreen")?ri(f,"sided--no-fullscreen"):ii(f,"sided--no-fullscreen")):s(n));(n.options.onToggleFullScreen&&n.options.onToggleFullScreen(t.getOption("fullScreen")||!1),void 0!==n.options.maxHeight&&(t.getOption("fullScreen")?(t.getScrollerElement().style.removeProperty("height"),u.style.removeProperty("height")):(t.getScrollerElement().style.height=n.options.maxHeight,n.setPreviewMaxHeight())),/fullscreen/.test(n.toolbar_div.className)?n.toolbar_div.className=n.toolbar_div.className.replace(/\s*fullscreen\b/,""):n.toolbar_div.className+=" fullscreen",n.toolbarElements&&n.toolbarElements.fullscreen)&&(i=n.toolbarElements.fullscreen,/active/.test(i.className)?i.className=i.className.replace(/\s*active\s*/g,""):i.className+=" active")}function v(n){dt(n,"bold",n.options.blockStyles.bold)}function y(n){dt(n,"italic",n.options.blockStyles.italic)}function p(n){dt(n,"strikethrough","~~")}function w(n){function s(n){if("object"!=_typeof(n))throw"fencing_line() takes a 'line' object (not a line number, or line text).  Got: "+_typeof(n)+": "+n;return n.styles&&n.styles[2]&&-1!==n.styles[2].indexOf("formatting-code-block")}function a(n){return n.state.base.base||n.state.base}function p(n,t,i,r,u){i=i||n.getLineHandle(t);r=r||n.getTokenAt({line:t,ch:1});u=u||!!i.text&&n.getTokenAt({line:t,ch:i.text.length-1});var f=r.type?r.type.split(" "):[];return u&&a(u).indentedCode?"indented":-1!==f.indexOf("comment")&&(a(r).fencedChars||a(u).fencedChars||s(i)?"fenced":"single")}var ft=n.options.blockStyles.code,r,e,w,t=n.codemirror,i=t.getCursor("start"),f=t.getCursor("end"),et=t.getTokenAt({line:i.line,ch:i.ch||1}),o=t.getLineHandle(i.line),k=p(t,i.line,o,et),tt,it,c,l,v,h,d,y,g,nt,b,rt,ut;if("single"===k)tt=o.text.slice(0,i.ch).replace("`",""),it=o.text.slice(i.ch).replace("`",""),t.replaceRange(tt+it,{line:i.line,ch:0},{line:i.line,ch:99999999999999}),i.ch--,i!==f&&f.ch--,t.setSelection(i,f),t.focus();else if("fenced"===k)if(i.line!==f.line||i.ch!==f.ch){for(r=i.line;r>=0&&!s(o=t.getLineHandle(r));r--);d=a(t.getTokenAt({line:r,ch:1})).fencedChars;s(t.getLineHandle(i.line))?(c="",l=i.line):s(t.getLineHandle(i.line-1))?(c="",l=i.line-1):(c=d+"\n",l=i.line);s(t.getLineHandle(f.line))?(v="",h=f.line,0===f.ch&&(h+=1)):0!==f.ch&&s(t.getLineHandle(f.line+1))?(v="",h=f.line+1):(v=d+"\n",h=f.line+1);0===f.ch&&(h-=1);t.operation(function(){t.replaceRange(v,{line:h,ch:0},{line:h+(v?0:1),ch:0});t.replaceRange(c,{line:l,ch:0},{line:l+(c?0:1),ch:0})});t.setSelection({line:l+(c?1:0),ch:0},{line:h+(c?1:-1),ch:0});t.focus()}else{if(y=i.line,s(t.getLineHandle(i.line))&&("fenced"===p(t,i.line+1)?(r=i.line,y=i.line+1):(e=i.line,y=i.line-1)),void 0===r)for(r=y;r>=0&&!s(o=t.getLineHandle(r));r--);if(void 0===e)for(w=t.lineCount(),e=y;e<w&&!s(o=t.getLineHandle(e));e++);t.operation(function(){t.replaceRange("",{line:r,ch:0},{line:r+1,ch:0});t.replaceRange("",{line:e-1,ch:0},{line:e,ch:0})});t.focus()}else if("indented"===k){if(i.line!==f.line||i.ch!==f.ch)r=i.line,e=f.line,0===f.ch&&e--;else{for(r=i.line;r>=0;r--)if(!(o=t.getLineHandle(r)).text.match(/^\s*$/)&&"indented"!==p(t,r,o)){r+=1;break}for(w=t.lineCount(),e=i.line;e<w;e++)if(!(o=t.getLineHandle(e)).text.match(/^\s*$/)&&"indented"!==p(t,e,o)){e-=1;break}}for(g=t.getLineHandle(e+1),nt=g&&t.getTokenAt({line:e+1,ch:g.text.length-1}),nt&&a(nt).indentedCode&&t.replaceRange("\n",{line:e+1,ch:0}),b=r;b<=e;b++)t.indentLine(b,"subtract");t.focus()}else rt=i.line===f.line&&i.ch===f.ch&&0===i.ch,ut=i.line!==f.line,rt||ut?function(n,t,i,r){var s=t.line+1,f=i.line+1,e=t.line!==i.line,h=r+"\n",o="\n"+r;e&&f++;e&&0===i.ch&&(o=r+"\n",f--);u(n,!1,[h,o]);n.setSelection({line:s,ch:0},{line:f,ch:0})}(t,i,f,ft):u(t,!1,["`","`"])}function b(n){kt(n.codemirror,"quote")}function l(n){a(n.codemirror,"smaller")}function k(n){a(n.codemirror,"bigger")}function d(n){a(n.codemirror,void 0,1)}function g(n){a(n.codemirror,void 0,2)}function nt(n){a(n.codemirror,void 0,3)}function tt(n){kt(n.codemirror,"unordered-list")}function it(n){kt(n.codemirror,"ordered-list")}function rt(n){!function(n){if(!/editor-preview-active/.test(n.getWrapperElement().lastChild.className))for(var i,r=n.getCursor("start"),u=n.getCursor("end"),t=r.line;t<=u.line;t++)i=(i=n.getLine(t)).replace(/^[ ]*([# ]+|\*|-|[> ]+|[0-9]+(.|\)))[ ]*/,""),n.replaceRange(i,{line:t,ch:0},{line:t,ch:99999999999999})}(n.codemirror)}function ut(n){var i=n.codemirror,e=r(i),t=n.options,f="https://";if(t.promptURLs&&!(f=prompt(t.promptTexts.link,"https://")))return!1;u(i,e.link,t.insertTexts.link,f)}function ft(n){var i=n.codemirror,e=r(i),t=n.options,f="https://";if(t.promptURLs&&!(f=prompt(t.promptTexts.image,"https://")))return!1;u(i,e.image,t.insertTexts.image,f)}function bt(n){n.openBrowseFileWindow()}function ui(n,t){var f=n.codemirror,o=r(f),s=n.options,i=t.substr(t.lastIndexOf("/")+1),h=i.substring(i.lastIndexOf(".")+1).replace(/\?.*$/,""),e;["png","jpg","jpeg","gif","svg"].includes(h)?u(f,o.image,s.insertTexts.uploadedImage,t):(e=s.insertTexts.link,e[0]="["+i,u(f,o.link,e,t));n.updateStatusBar("upload-image",n.options.imageTexts.sbOnUploaded.replace("#image_name#",i));setTimeout(function(){n.updateStatusBar("upload-image",n.options.imageTexts.sbInit)},1e3)}function et(n){var t=n.codemirror,i=r(t),f=n.options;u(t,i.table,f.insertTexts.table)}function ot(n){var t=n.codemirror,i=r(t),f=n.options;u(t,i.image,f.insertTexts.horizontalRule)}function st(n){var t=n.codemirror;t.undo();t.focus()}function ht(n){var t=n.codemirror;t.redo();t.focus()}function s(n){var t=n.codemirror,r=t.getWrapperElement(),i=r.nextSibling,u=n.toolbarElements&&n.toolbarElements["side-by-side"],c=!1,l=r.parentNode,f,o,s,h;/editor-preview-active-side/.test(i.className)?(!1===n.options.sideBySideFullscreen&&ri(l,"sided--no-fullscreen"),i.className=i.className.replace(/\s*editor-preview-active-side\s*/g,""),u&&(u.className=u.className.replace(/\s*active\s*/g,"")),r.className=r.className.replace(/\s*CodeMirror-sided\s*/g," ")):(setTimeout(function(){t.getOption("fullScreen")||(!1===n.options.sideBySideFullscreen?ii(l,"sided--no-fullscreen"):e(n));i.className+=" editor-preview-active-side"},1),u&&(u.className+=" active"),r.className+=" CodeMirror-sided",c=!0);f=r.lastChild;/editor-preview-active/.test(f.className)&&(f.className=f.className.replace(/\s*editor-preview-active\s*/g,""),o=n.toolbarElements.preview,s=n.toolbar_div,o.className=o.className.replace(/\s*active\s*/g,""),s.className=s.className.replace(/\s*disabled-for-preview*/g,""));(t.sideBySideRenderingFunction||(t.sideBySideRenderingFunction=function(){var t=n.options.previewRender(n.value(),i);null!=t&&(i.innerHTML=t)}),c)?(h=n.options.previewRender(n.value(),i),null!=h&&(i.innerHTML=h),t.on("update",t.sideBySideRenderingFunction)):t.off("update",t.sideBySideRenderingFunction);t.refresh()}function ct(n){var f=n.codemirror,e=f.getWrapperElement(),u=n.toolbar_div,i=!!n.options.toolbar&&n.toolbarElements.preview,t=e.lastChild,o=f.getWrapperElement().nextSibling,r;if(/editor-preview-active-side/.test(o.className)&&s(n),!t||!/editor-preview-full/.test(t.className)){if((t=document.createElement("div")).className="editor-preview-full",n.options.previewClass)if(Array.isArray(n.options.previewClass))for(r=0;r<n.options.previewClass.length;r++)t.className+=" "+n.options.previewClass[r];else"string"==typeof n.options.previewClass&&(t.className+=" "+n.options.previewClass);e.appendChild(t)}/editor-preview-active/.test(t.className)?(t.className=t.className.replace(/\s*editor-preview-active\s*/g,""),i&&(i.className=i.className.replace(/\s*active\s*/g,""),u.className=u.className.replace(/\s*disabled-for-preview*/g,""))):(setTimeout(function(){t.className+=" editor-preview-active"},1),i&&(i.className+=" active",u.className+=" disabled-for-preview"));t.innerHTML=n.options.previewRender(n.value(),t)}function u(n,t,i,r){if(!/editor-preview-active/.test(n.getWrapperElement().lastChild.className)){var o,f=i[0],e=i[1],u={},s={};Object.assign(u,n.getCursor("start"));Object.assign(s,n.getCursor("end"));r&&(f=f.replace("#url#",r),e=e.replace("#url#",r));t?(f=(o=n.getLine(u.line)).slice(0,u.ch),e=o.slice(u.ch),n.replaceRange(f+e,{line:u.line,ch:0})):(o=n.getSelection(),n.replaceSelection(f+o+e),u.ch+=f.length,u!==s&&(s.ch+=f.length));n.setSelection(u,s);n.focus()}}function a(n,t,i){if(!/editor-preview-active/.test(n.getWrapperElement().lastChild.className)){for(var u=n.getCursor("start"),f=n.getCursor("end"),r=u.line;r<=f.line;r++)!function(r){var u=n.getLine(r),f=u.search(/[^#]/);u=void 0!==t?f<=0?"bigger"==t?"###### "+u:"# "+u:6==f&&"smaller"==t?u.substr(7):1==f&&"bigger"==t?u.substr(2):"bigger"==t?u.substr(1):"#"+u:1==i?f<=0?"# "+u:f==i?u.substr(f+1):"# "+u.substr(f+1):2==i?f<=0?"## "+u:f==i?u.substr(f+1):"## "+u.substr(f+1):f<=0?"### "+u:f==i?u.substr(f+1):"### "+u.substr(f+1);n.replaceRange(u,{line:r,ch:0},{line:r,ch:99999999999999})}(r);n.focus()}}function kt(n,t){if(!/editor-preview-active/.test(n.getWrapperElement().lastChild.className)){for(var i=/^(\s*)(\*|-|\+|\d*\.)(\s+)/,s=/^\s*/,h=r(n),c=n.getCursor("start"),l=n.getCursor("end"),f={quote:/^(\s*)>\s+/,"unordered-list":i,"ordered-list":i},e=function(n,t,r){var u=i.exec(t),e=function(n,t){return{quote:">","unordered-list":"*","ordered-list":"%%i."}[n].replace("%%i",t)}(n,o);return null!==u?(function(n,t){var i=new RegExp({quote:">","unordered-list":"*","ordered-list":"\\d+."}[n]);return t&&i.test(t)}(n,u[2])&&(e=""),t=u[1]+e+u[3]+t.replace(s,"").replace(f[n],"$1")):0==r&&(t=e+" "+t),t},o=1,u=c.line;u<=l.line;u++)!function(i){var r=n.getLine(i);h[t]?r=r.replace(f[t],"$1"):("unordered-list"==t&&(r=e("ordered-list",r,!0)),r=e(t,r,!1),o+=1);n.replaceRange(r,{line:i,ch:0},{line:i,ch:99999999999999})}(u);n.focus()}}function dt(n,t,i,u){if(!/editor-preview-active/.test(n.codemirror.getWrapperElement().lastChild.className)){u=void 0===u?i:u;var f,o=n.codemirror,l=r(o),s=i,h=u,e=o.getCursor("start"),c=o.getCursor("end");l[t]?(s=(f=o.getLine(e.line)).slice(0,e.ch),h=f.slice(e.ch),"bold"==t?(s=s.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),h=h.replace(/(\*\*|__)/,"")):"italic"==t?(s=s.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),h=h.replace(/(\*|_)/,"")):"strikethrough"==t&&(s=s.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),h=h.replace(/(\*\*|~~)/,"")),o.replaceRange(s+h,{line:e.line,ch:0},{line:e.line,ch:99999999999999}),"bold"==t||"strikethrough"==t?(e.ch-=2,e!==c&&(c.ch-=2)):"italic"==t&&(e.ch-=1,e!==c&&(c.ch-=1))):(f=o.getSelection(),"bold"==t?f=(f=f.split("**").join("")).split("__").join(""):"italic"==t?f=(f=f.split("*").join("")).split("_").join(""):"strikethrough"==t&&(f=f.split("~~").join("")),o.replaceSelection(s+f+h),e.ch+=i.length,c.ch=e.ch+f.length);o.setSelection(e,c);o.focus()}}function lt(n,t){if(Math.abs(n)<1024)return""+n+t[0];var i=0;do n/=1024,++i;while(Math.abs(n)>=1024&&i<t.length);return""+n.toFixed(1)+t[i]}function fi(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]instanceof Array?t[i].concat(n[i]instanceof Array?n[i]:[]):null!==t[i]&&"object"==_typeof(t[i])&&t[i].constructor===Object?fi(n[i]||{},t[i]):t[i]);return n}function f(n){for(var t=1;t<arguments.length;t++)n=fi(n,arguments[t]);return n}function ei(n){var i=n.match(/[a-zA-Z0-9_\u00A0-\u02AF\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g),r=0,t;if(null===i)return r;for(t=0;t<i.length;t++)r+=i[t].charCodeAt(0)>=19968?i[t].length:1;return r}function i(n){var u,e,r,s,i,t;if((n=n||{}).parent=this,u=!0,!1===n.autoDownloadFontAwesome&&(u=!1),!0!==n.autoDownloadFontAwesome)for(e=document.styleSheets,r=0;r<e.length;r++)e[r].href&&e[r].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")>-1&&(u=!1);if(u&&(s=document.createElement("link"),s.rel="stylesheet",s.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(s)),n.element)this.element=n.element;else if(null===n.element)return void console.log("EasyMDE: Error. No element was found.");if(void 0===n.toolbar)for(i in n.toolbar=[],o)Object.prototype.hasOwnProperty.call(o,i)&&(-1!=i.indexOf("separator-")&&n.toolbar.push("|"),(!0===o[i].default||n.showIcons&&n.showIcons.constructor===Array&&-1!=n.showIcons.indexOf(i))&&n.toolbar.push(i));(Object.prototype.hasOwnProperty.call(n,"previewClass")||(n.previewClass="editor-preview"),Object.prototype.hasOwnProperty.call(n,"status")||(n.status=["autosave","lines","words","cursor"],n.uploadImage&&n.status.unshift("upload-image")),n.previewRender||(n.previewRender=function(n){return this.parent.markdown(n)}),n.parsingConfig=f({highlightFormatting:!0},n.parsingConfig||{}),n.insertTexts=f({},vi,n.insertTexts||{}),n.promptTexts=f({},yi,n.promptTexts||{}),n.blockStyles=f({},wi,n.blockStyles||{}),null!=n.autosave&&(n.autosave.timeFormat=f({},pi,n.autosave.timeFormat||{})),n.shortcuts=f({},ci,n.shortcuts||{}),n.maxHeight=n.maxHeight||void 0,n.minHeight=void 0!==n.maxHeight?n.maxHeight:n.minHeight||"300px",n.errorCallback=n.errorCallback||function(n){alert(n)},n.uploadImage=n.uploadImage||!1,n.imageMaxSize=n.imageMaxSize||2097152,n.imageAccept=n.imageAccept||"image/png, image/jpeg",n.imageTexts=f({},bi,n.imageTexts||{}),n.errorMessages=f({},ki,n.errorMessages||{}),null!=n.autosave&&null!=n.autosave.unique_id&&""!=n.autosave.unique_id&&(n.autosave.uniqueId=n.autosave.unique_id),n.overlayMode&&void 0===n.overlayMode.combine&&(n.overlayMode.combine=!0),this.options=n,this.render(),!n.initialValue||this.options.autosave&&!0===this.options.autosave.foundSavedValue||this.value(n.initialValue),n.uploadImage)&&(t=this,this.codemirror.on("dragenter",function(n,i){t.updateStatusBar("upload-image",t.options.imageTexts.sbOnDragEnter);i.stopPropagation();i.preventDefault()}),this.codemirror.on("dragend",function(n,i){t.updateStatusBar("upload-image",t.options.imageTexts.sbInit);i.stopPropagation();i.preventDefault()}),this.codemirror.on("dragleave",function(n,i){t.updateStatusBar("upload-image",t.options.imageTexts.sbInit);i.stopPropagation();i.preventDefault()}),this.codemirror.on("dragover",function(n,i){t.updateStatusBar("upload-image",t.options.imageTexts.sbOnDragEnter);i.stopPropagation();i.preventDefault()}),this.codemirror.on("drop",function(i,r){r.stopPropagation();r.preventDefault();n.imageUploadFunction?t.uploadImagesUsingCustomFunction(n.imageUploadFunction,r.dataTransfer.files):t.uploadImages(r.dataTransfer.files)}),this.codemirror.on("paste",function(i,r){n.imageUploadFunction?t.uploadImagesUsingCustomFunction(n.imageUploadFunction,r.clipboardData.files):t.uploadImages(r.clipboardData.files)}))}function oi(){if("object"!=("undefined"==typeof localStorage?"undefined":_typeof(localStorage)))return!1;try{localStorage.setItem("smde_localStorage",1);localStorage.removeItem("smde_localStorage")}catch(n){return!1}return!0}var h=n("codemirror"),yt,wt;n("codemirror/addon/edit/continuelist.js");n("./codemirror/tablist");n("codemirror/addon/display/fullscreen.js");n("codemirror/mode/markdown/markdown.js");n("codemirror/addon/mode/overlay.js");n("codemirror/addon/display/placeholder.js");n("codemirror/addon/display/autorefresh.js");n("codemirror/addon/selection/mark-selection.js");n("codemirror/addon/search/searchcursor.js");n("codemirror/mode/gfm/gfm.js");n("codemirror/mode/xml/xml.js");var si=n("codemirror-spell-checker"),at=n("marked/lib/marked"),gt=/Mac/.test(navigator.platform),hi=new RegExp(/(<a.*?https?:\/\/.*?[^a]>)+?/g),c={toggleBold:v,toggleItalic:y,drawLink:ut,toggleHeadingSmaller:l,toggleHeadingBigger:k,drawImage:ft,toggleBlockquote:b,toggleOrderedList:it,toggleUnorderedList:tt,toggleCodeBlock:w,togglePreview:ct,toggleStrikethrough:p,toggleHeading1:d,toggleHeading2:g,toggleHeading3:nt,cleanBlock:rt,drawTable:et,drawHorizontalRule:ot,undo:st,redo:ht,toggleSideBySide:s,toggleFullScreen:e},ci={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",cleanBlock:"Cmd-E",drawImage:"Cmd-Alt-I",toggleBlockquote:"Cmd-'",toggleOrderedList:"Cmd-Alt-L",toggleUnorderedList:"Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},vt=function(){var n,t=!1;return n=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(n)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(n.substr(0,4)))&&(t=!0),t};yt={};wt="";var o={bold:{name:"bold",action:v,className:"fa fa-bold",title:"Bold","default":!0},italic:{name:"italic",action:y,className:"fa fa-italic",title:"Italic","default":!0},strikethrough:{name:"strikethrough",action:p,className:"fa fa-strikethrough",title:"Strikethrough"},heading:{name:"heading",action:l,className:"fa fa-header fa-heading",title:"Heading","default":!0},"heading-smaller":{name:"heading-smaller",action:l,className:"fa fa-header fa-heading header-smaller",title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:k,className:"fa fa-header fa-heading header-bigger",title:"Bigger Heading"},"heading-1":{name:"heading-1",action:d,className:"fa fa-header fa-heading header-1",title:"Big Heading"},"heading-2":{name:"heading-2",action:g,className:"fa fa-header fa-heading header-2",title:"Medium Heading"},"heading-3":{name:"heading-3",action:nt,className:"fa fa-header fa-heading header-3",title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:w,className:"fa fa-code",title:"Code"},quote:{name:"quote",action:b,className:"fa fa-quote-left",title:"Quote","default":!0},"unordered-list":{name:"unordered-list",action:tt,className:"fa fa-list-ul",title:"Generic List","default":!0},"ordered-list":{name:"ordered-list",action:it,className:"fa fa-list-ol",title:"Numbered List","default":!0},"clean-block":{name:"clean-block",action:rt,className:"fa fa-eraser",title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:ut,className:"fa fa-link",title:"Create Link","default":!0},image:{name:"image",action:ft,className:"fa fa-image",title:"Insert Image","default":!0},"upload-image":{name:"upload-image",action:bt,className:"fa fa-image",title:"Import an image"},table:{name:"table",action:et,className:"fa fa-table",title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:ot,className:"fa fa-minus",title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:ct,className:"fa fa-eye",noDisable:!0,title:"Toggle Preview","default":!0},"side-by-side":{name:"side-by-side",action:s,className:"fa fa-columns",noDisable:!0,noMobile:!0,title:"Toggle Side by Side","default":!0},fullscreen:{name:"fullscreen",action:e,className:"fa fa-arrows-alt",noDisable:!0,noMobile:!0,title:"Toggle Fullscreen","default":!0},"separator-4":{name:"separator-4"},guide:{name:"guide",action:"https://www.markdownguide.org/basic-syntax/",className:"fa fa-question-circle",noDisable:!0,title:"Markdown Guide","default":!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:st,className:"fa fa-undo",noDisable:!0,title:"Undo"},redo:{name:"redo",action:ht,className:"fa fa-repeat fa-redo",noDisable:!0,title:"Redo"}},vi={link:["[","](#url#)"],image:["![](","#url#)"],uploadedImage:["![](#url#)",""],table:["","\n\n| Column 1 | Column 2 | Column 3 |\n| -------- | -------- | -------- |\n| Text     | Text     | Text     |\n\n"],horizontalRule:["","\n\n-----\n\n"]},yi={link:"URL for the link:",image:"URL of the image:"},pi={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},wi={bold:"**",code:"```",italic:"*"},bi={sbInit:"Attach files by drag and dropping or pasting from clipboard.",sbOnDragEnter:"Drop image to upload it.",sbOnDrop:"Uploading image #images_names#...",sbProgress:"Uploading #file_name#: #progress#%",sbOnUploaded:"Uploaded #image_name#",sizeUnits:" B, KB, MB"},ki={noFileGiven:"You must select a file.",typeNotAllowed:"This image type is not allowed.",fileTooLarge:"Image #image_name# is too big (#image_size#).\nMaximum file size is #image_max_size#.",importError:"Something went wrong when uploading the image #image_name#."};i.prototype.uploadImages=function(n,t,i){if(0!==n.length){for(var u=[],r=0;r<n.length;r++)u.push(n[r].name),this.uploadImage(n[r],t,i);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",u.join(", ")))}};i.prototype.uploadImagesUsingCustomFunction=function(n,t){if(0!==t.length){for(var r=[],i=0;i<t.length;i++)r.push(t[i].name),this.uploadImageUsingCustomFunction(n,t[i]);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",r.join(", ")))}};i.prototype.updateStatusBar=function(n,t){if(this.gui.statusbar){var i=this.gui.statusbar.getElementsByClassName(n);1===i.length?this.gui.statusbar.getElementsByClassName(n)[0].textContent=t:0===i.length?console.log("EasyMDE: status bar item "+n+" was not found."):console.log("EasyMDE: Several status bar items named "+n+" was found.")}};i.prototype.markdown=function(n){var r,t,i;if(at)return(r=this.options&&this.options.renderingConfig&&this.options.renderingConfig.markedOptions?this.options.renderingConfig.markedOptions:{},r.breaks=this.options&&this.options.renderingConfig&&!1===this.options.renderingConfig.singleLineBreaks?!1:!0,this.options&&this.options.renderingConfig&&!0===this.options.renderingConfig.codeSyntaxHighlighting)&&(t=this.options.renderingConfig.hljs||window.hljs,t&&(r.highlight=function(n,i){return i&&t.getLanguage(i)?t.highlight(i,n).value:t.highlightAuto(n).value})),at.setOptions(r),i=at(n),this.options.renderingConfig&&"function"==typeof this.options.renderingConfig.sanitizerFunction&&(i=this.options.renderingConfig.sanitizerFunction.call(this,i)),function(n){for(var t,i,u,f=(new DOMParser).parseFromString(n,"text/html"),e=f.getElementsByTagName("li"),r=0;r<e.length;r++)for(t=e[r],i=0;i<t.children.length;i++)u=t.children[i],u instanceof HTMLInputElement&&"checkbox"===u.type&&(t.style.marginLeft="-1.5em",t.style.listStyleType="none");return f.documentElement.innerHTML}(i=function(n){for(var i,t,r;null!==(i=hi.exec(n));)t=i[0],-1===t.indexOf("target=")&&(r=t.replace(/>$/,' target="_blank">'),n=n.replace(t,r));return n}(i))};i.prototype.render=function(n){function p(n,t){var i,r;n.setAttribute("data-img-src",t.url);n.setAttribute("style","--bg-image:url("+t.url+");--width:"+t.naturalWidth+"px;--height:"+(i=t.naturalWidth,r=t.naturalHeight,i<window.getComputedStyle(document.querySelector(".CodeMirror-sizer")).width.replace("px","")?r+"px":r/i*100+"%"));y.codemirror.setSize()}var s,a,f,l,y,v;if(n||(n=this.element||document.getElementsByTagName("textarea")[0]),!this._rendered||this._rendered!==n){this.element=n;var u,o,t=this.options,i=this,r={};for(s in t.shortcuts)null!==t.shortcuts[s]&&null!==c[s]&&function(n){r[ni(t.shortcuts[n])]=function(){var t=c[n];"function"==typeof t?t(i):"string"==typeof t&&window.open(t,"_blank")}}(s);if(r.Enter="newlineAndIndentContinueMarkdownList",r.Tab="tabAndIndentMarkdownList",r["Shift-Tab"]="shiftTabAndUnindentMarkdownList",r.Esc=function(n){n.getOption("fullScreen")&&e(i)},this.documentOnKeyDown=function(n){27==(n=n||window.event).keyCode&&i.codemirror.getOption("fullScreen")&&e(i)},document.addEventListener("keydown",this.documentOnKeyDown,!1),t.overlayMode?(h.defineMode("overlay-mode",function(n){return h.overlayMode(h.getMode(n,!1!==t.spellChecker?"spell-checker":"gfm"),t.overlayMode.mode,t.overlayMode.combine)}),u="overlay-mode",(o=t.parsingConfig).gitHubSpice=!1):((u=t.parsingConfig).name="gfm",u.gitHubSpice=!1),!1!==t.spellChecker&&(u="spell-checker",(o=t.parsingConfig).name="gfm",o.gitHubSpice=!1,si({codeMirrorInstance:h})),this.codemirror=h.fromTextArea(n,{mode:u,backdrop:o,theme:null!=t.theme?t.theme:"easymde",tabSize:null!=t.tabSize?t.tabSize:2,indentUnit:null!=t.tabSize?t.tabSize:2,indentWithTabs:!1!==t.indentWithTabs,lineNumbers:!0===t.lineNumbers,autofocus:!0===t.autofocus,extraKeys:r,lineWrapping:!1!==t.lineWrapping,allowDropFileTypes:["text/plain"],placeholder:t.placeholder||n.getAttribute("placeholder")||"",styleSelectedText:null!=t.styleSelectedText?t.styleSelectedText:!vt(),scrollbarStyle:null!=t.scrollbarStyle?t.scrollbarStyle:"native",configureMouse:function(){return{addNew:!1}},inputStyle:null!=t.inputStyle?t.inputStyle:vt()?"contenteditable":"textarea",spellcheck:null==t.nativeSpellcheck||t.nativeSpellcheck,autoRefresh:null!=t.autoRefresh&&t.autoRefresh}),this.codemirror.getScrollerElement().style.minHeight=t.minHeight,void 0!==t.maxHeight&&(this.codemirror.getScrollerElement().style.height=t.maxHeight),!0===t.forceSync){a=this.codemirror;a.on("change",function(){a.save()})}this.gui={};f=document.createElement("div");f.classList.add("EasyMDEContainer");l=this.codemirror.getWrapperElement();l.parentNode.insertBefore(f,l);f.appendChild(l);!1!==t.toolbar&&(this.gui.toolbar=this.createToolbar());!1!==t.status&&(this.gui.statusbar=this.createStatusbar());null!=t.autosave&&!0===t.autosave.enabled&&(this.autosave(),this.codemirror.on("change",function(){clearTimeout(i._autosave_timeout);i._autosave_timeout=setTimeout(function(){i.autosave()},i.options.autosave.submit_delay||i.options.autosave.delay||1e3)}));y=this;this.codemirror.on("update",function(){t.previewImagesInEditor&&f.querySelectorAll(".cm-image-marker").forEach(function(n){var i=n.parentElement,u,t,r;i.innerText.match(/^!\[.*?\]\(.*\)/g)&&!i.hasAttribute("data-img-src")&&(u=i.innerText.match("\\((.*)\\)"),(window.EMDEimagesCache||(window.EMDEimagesCache={}),u&&u.length>=2)&&(t=u[1],window.EMDEimagesCache[t]?p(i,window.EMDEimagesCache[t]):(r=document.createElement("img"),r.onload=function(){window.EMDEimagesCache[t]={naturalWidth:r.naturalWidth,naturalHeight:r.naturalHeight,url:t};p(i,window.EMDEimagesCache[t])},r.src=t)))})});this.gui.sideBySide=this.createSideBySide();this._rendered=this.element;v=this.codemirror;setTimeout(function(){v.refresh()}.bind(v),0)}};i.prototype.cleanup=function(){document.removeEventListener("keydown",this.documentOnKeyDown)};i.prototype.autosave=function(){var n,i,t;if(oi()){if(n=this,null==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("EasyMDE: You must set a uniqueId to use the autosave feature");if(!0!==this.options.autosave.binded&&(null!=n.element.form&&null!=n.element.form&&n.element.form.addEventListener("submit",function(){clearTimeout(n.autosaveTimeoutId);n.autosaveTimeoutId=void 0;localStorage.removeItem("smde_"+n.options.autosave.uniqueId)}),this.options.autosave.binded=!0),!0!==this.options.autosave.loaded&&("string"==typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&""!=localStorage.getItem("smde_"+this.options.autosave.uniqueId)&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0),i=n.value(),""!==i?localStorage.setItem("smde_"+this.options.autosave.uniqueId,i):localStorage.removeItem("smde_"+this.options.autosave.uniqueId),t=document.getElementById("autosaved"),null!=t&&null!=t&&""!=t){var r=new Date,u=new Intl.DateTimeFormat([this.options.autosave.timeFormat.locale,"en-US"],this.options.autosave.timeFormat.format).format(r),f=null==this.options.autosave.text?"Autosaved: ":this.options.autosave.text;t.innerHTML=f+u}}else console.log("EasyMDE: localStorage not available, cannot autosave")};i.prototype.clearAutosavedValue=function(){if(oi()){if(null==this.options.autosave||null==this.options.autosave.uniqueId||""==this.options.autosave.uniqueId)return void console.log("EasyMDE: You must set a uniqueId to clear the autosave value");localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("EasyMDE: localStorage not available, cannot autosave")};i.prototype.openBrowseFileWindow=function(n,t){var i=this,r=this.gui.toolbar.getElementsByClassName("imageInput")[0];r.click();r.addEventListener("change",function u(f){i.options.imageUploadFunction?i.uploadImagesUsingCustomFunction(i.options.imageUploadFunction,f.target.files):i.uploadImages(f.target.files,n,t);r.removeEventListener("change",u)})};i.prototype.uploadImage=function(n,t,i){function u(n){r.updateStatusBar("upload-image",n);setTimeout(function(){r.updateStatusBar("upload-image",r.options.imageTexts.sbInit)},1e4);i&&"function"==typeof i&&i(n);r.options.errorCallback(n)}function e(t){var i=r.options.imageTexts.sizeUnits.split(",");return t.replace("#image_name#",n.name).replace("#image_size#",lt(n.size,i)).replace("#image_max_size#",lt(r.options.imageMaxSize,i))}var r=this,o,f;(t=t||function(n){ui(r,n)},n.size>this.options.imageMaxSize)?u(e(this.options.errorMessages.fileTooLarge)):(o=new FormData,o.append("image",n),r.options.imageCSRFToken&&o.append("csrfmiddlewaretoken",r.options.imageCSRFToken),f=new XMLHttpRequest,f.upload.onprogress=function(t){if(t.lengthComputable){var i=""+Math.round(100*t.loaded/t.total);r.updateStatusBar("upload-image",r.options.imageTexts.sbProgress.replace("#file_name#",n.name).replace("#progress#",i))}},f.open("POST",this.options.imageUploadEndpoint),f.onload=function(){try{var n=JSON.parse(this.responseText)}catch(n){return console.error("EasyMDE: The server did not return a valid json."),void u(e(r.options.errorMessages.importError))}200===this.status&&n&&!n.error&&n.data&&n.data.filePath?t((r.options.imagePathAbsolute?"":window.location.origin+"/")+n.data.filePath):n.error&&n.error in r.options.errorMessages?u(e(r.options.errorMessages[n.error])):n.error?u(e(n.error)):(console.error("EasyMDE: Received an unexpected response after uploading the image."+this.status+" ("+this.statusText+")"),u(e(r.options.errorMessages.importError)))},f.onerror=function(n){console.error("EasyMDE: An unexpected error occurred when trying to upload the image."+n.target.status+" ("+n.target.statusText+")");u(r.options.errorMessages.importError)},f.send(o))};i.prototype.uploadImageUsingCustomFunction=function(n,t){var i=this;n.apply(this,[t,function(n){ui(i,n)},function(n){var r=function(n){var r=i.options.imageTexts.sizeUnits.split(",");return n.replace("#image_name#",t.name).replace("#image_size#",lt(t.size,r)).replace("#image_max_size#",lt(i.options.imageMaxSize,r))}(n);i.updateStatusBar("upload-image",r);setTimeout(function(){i.updateStatusBar("upload-image",i.options.imageTexts.sbInit)},1e4);i.options.errorCallback(r)}])};i.prototype.setPreviewMaxHeight=function(){var n=this.codemirror.getWrapperElement(),t=n.nextSibling,i=parseInt(window.getComputedStyle(n).paddingTop),r=parseInt(window.getComputedStyle(n).borderTopWidth),u=(parseInt(this.options.maxHeight)+2*i+2*r).toString()+"px";t.style.height=u};i.prototype.createSideBySide=function(){var t=this.codemirror,f=t.getWrapperElement(),n=f.nextSibling,i,r,u;if(!n||!/editor-preview-side/.test(n.className)){if((n=document.createElement("div")).className="editor-preview-side",this.options.previewClass)if(Array.isArray(this.options.previewClass))for(i=0;i<this.options.previewClass.length;i++)n.className+=" "+this.options.previewClass[i];else"string"==typeof this.options.previewClass&&(n.className+=" "+this.options.previewClass);f.parentNode.insertBefore(n,f.nextSibling)}return(void 0!==this.options.maxHeight&&this.setPreviewMaxHeight(),!1===this.options.syncSideBySidePreviewScroll)?n:(r=!1,u=!1,t.on("scroll",function(t){if(r)r=!1;else{u=!0;var i=t.getScrollInfo().height-t.getScrollInfo().clientHeight,f=parseFloat(t.getScrollInfo().top)/i,e=(n.scrollHeight-n.clientHeight)*f;n.scrollTop=e}}),n.onscroll=function(){if(u)u=!1;else{r=!0;var i=n.scrollHeight-n.clientHeight,f=parseFloat(n.scrollTop)/i,e=(t.getScrollInfo().height-t.getScrollInfo().clientHeight)*f;t.scrollTo(0,e)}},n)};i.prototype.createToolbar=function(n){var t,u,i,f,h,e,s,c;if((n=n||this.options.toolbar)&&0!==n.length){for(t=0;t<n.length;t++)null!=o[n[t]]&&(n[t]=o[n[t]]);for(u=document.createElement("div"),u.className="editor-toolbar",i=this,f={},i.toolbar=n,t=0;t<n.length;t++)if(("guide"!=n[t].name||!1!==i.options.toolbarGuideIcon)&&!(i.options.hideIcons&&-1!=i.options.hideIcons.indexOf(n[t].name)||("fullscreen"==n[t].name||"side-by-side"==n[t].name)&&vt())){if("|"===n[t]){for(h=!1,e=t+1;e<n.length;e++)"|"===n[e]||i.options.hideIcons&&-1!=i.options.hideIcons.indexOf(n[e].name)||(h=!0);if(!h)continue}!function(n){var r,t;(r="|"===n?ai():n.children?li(n,i.options.toolbarTips,i.options.shortcuts,i):pt(n,!0,i.options.toolbarTips,i.options.shortcuts,"button",i),f[n.name||n]=r,u.appendChild(r),"upload-image"===n.name)&&(t=document.createElement("input"),t.className="imageInput",t.type="file",t.multiple=!0,t.name="image",t.accept=i.options.imageAccept,t.style.display="none",t.style.opacity=0,u.appendChild(t))}(n[t])}i.toolbar_div=u;i.toolbarElements=f;s=this.codemirror;s.on("cursorActivity",function(){var n=r(s);for(var t in f)!function(t){var i=f[t];n[t]?i.className+=" active":"fullscreen"!=t&&"side-by-side"!=t&&(i.className=i.className.replace(/\s*active\s*/g,""))}(t)});return c=s.getWrapperElement(),c.parentNode.insertBefore(u,c),u}};i.prototype.createStatusbar=function(n){var h,f,t,c,l,r,o,u,s,i,e,a;if(n=n||this.options.status,h=this.options,f=this.codemirror,n&&0!==n.length){for(o=[],t=0;t<n.length;t++)(c=void 0,l=void 0,r=void 0,"object"==_typeof(n[t]))?o.push({className:n[t].className,defaultValue:n[t].defaultValue,onUpdate:n[t].onUpdate,onActivity:n[t].onActivity}):(u=n[t],"words"===u?(r=function(n){n.innerHTML=ei(f.getValue())},c=function(n){n.innerHTML=ei(f.getValue())}):"lines"===u?(r=function(n){n.innerHTML=f.lineCount()},c=function(n){n.innerHTML=f.lineCount()}):"cursor"===u?(r=function(n){n.innerHTML="0:0"},l=function(n){var t=f.getCursor();n.innerHTML=t.line+":"+t.ch}):"autosave"===u?r=function(n){null!=h.autosave&&!0===h.autosave.enabled&&n.setAttribute("id","autosaved")}:"upload-image"===u&&(r=function(n){n.innerHTML=h.imageTexts.sbInit}),o.push({className:u,defaultValue:r,onUpdate:c,onActivity:l}));for(s=document.createElement("div"),s.className="editor-statusbar",t=0;t<o.length;t++)i=o[t],e=document.createElement("span"),e.className=i.className,"function"==typeof i.defaultValue&&i.defaultValue(e),"function"==typeof i.onUpdate&&this.codemirror.on("update",function(n,t){return function(){t.onUpdate(n)}}(e,i)),"function"==typeof i.onActivity&&this.codemirror.on("cursorActivity",function(n,t){return function(){t.onActivity(n)}}(e,i)),s.appendChild(e);return a=this.codemirror.getWrapperElement(),a.parentNode.insertBefore(s,a.nextSibling),s}};i.prototype.value=function(n){var t=this.codemirror,i;return void 0===n?t.getValue():((t.getDoc().setValue(n),this.isPreviewActive())&&(i=t.getWrapperElement().lastChild,i.innerHTML=this.options.previewRender(n,i)),this)};i.toggleBold=v;i.toggleItalic=y;i.toggleStrikethrough=p;i.toggleBlockquote=b;i.toggleHeadingSmaller=l;i.toggleHeadingBigger=k;i.toggleHeading1=d;i.toggleHeading2=g;i.toggleHeading3=nt;i.toggleCodeBlock=w;i.toggleUnorderedList=tt;i.toggleOrderedList=it;i.cleanBlock=rt;i.drawLink=ut;i.drawImage=ft;i.drawUploadedImage=bt;i.drawTable=et;i.drawHorizontalRule=ot;i.undo=st;i.redo=ht;i.togglePreview=ct;i.toggleSideBySide=s;i.toggleFullScreen=e;i.prototype.toggleBold=function(){v(this)};i.prototype.toggleItalic=function(){y(this)};i.prototype.toggleStrikethrough=function(){p(this)};i.prototype.toggleBlockquote=function(){b(this)};i.prototype.toggleHeadingSmaller=function(){l(this)};i.prototype.toggleHeadingBigger=function(){k(this)};i.prototype.toggleHeading1=function(){d(this)};i.prototype.toggleHeading2=function(){g(this)};i.prototype.toggleHeading3=function(){nt(this)};i.prototype.toggleCodeBlock=function(){w(this)};i.prototype.toggleUnorderedList=function(){tt(this)};i.prototype.toggleOrderedList=function(){it(this)};i.prototype.cleanBlock=function(){rt(this)};i.prototype.drawLink=function(){ut(this)};i.prototype.drawImage=function(){ft(this)};i.prototype.drawUploadedImage=function(){bt(this)};i.prototype.drawTable=function(){et(this)};i.prototype.drawHorizontalRule=function(){ot(this)};i.prototype.undo=function(){st(this)};i.prototype.redo=function(){ht(this)};i.prototype.togglePreview=function(){ct(this)};i.prototype.toggleSideBySide=function(){s(this)};i.prototype.toggleFullScreen=function(){e(this)};i.prototype.isPreviewActive=function(){var n=this.codemirror.getWrapperElement().lastChild;return/editor-preview-active/.test(n.className)};i.prototype.isSideBySideActive=function(){var n=this.codemirror.getWrapperElement().nextSibling;return/editor-preview-active-side/.test(n.className)};i.prototype.isFullscreenActive=function(){return this.codemirror.getOption("fullScreen")};i.prototype.getState=function(){return r(this.codemirror)};i.prototype.toTextArea=function(){var t=this.codemirror,i=t.getWrapperElement(),n=i.parentNode;n&&(this.gui.toolbar&&n.removeChild(this.gui.toolbar),this.gui.statusbar&&n.removeChild(this.gui.statusbar),this.gui.sideBySide&&n.removeChild(this.gui.sideBySide));n.parentNode.insertBefore(i,n);n.remove();t.toTextArea();this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())};t.exports=i},{"./codemirror/tablist":17,codemirror:10,"codemirror-spell-checker":2,"codemirror/addon/display/autorefresh.js":3,"codemirror/addon/display/fullscreen.js":4,"codemirror/addon/display/placeholder.js":5,"codemirror/addon/edit/continuelist.js":6,"codemirror/addon/mode/overlay.js":7,"codemirror/addon/search/searchcursor.js":8,"codemirror/addon/selection/mark-selection.js":9,"codemirror/mode/gfm/gfm.js":11,"codemirror/mode/markdown/markdown.js":12,"codemirror/mode/xml/xml.js":14,"marked/lib/marked":15}]},{},[18])(18)}),function(){var t=jQuery("#preferenceGridView"),u=getCookie("preferenceGridView"),i=jQuery("#preferenceModView"),f=getCookie("preferenceModView"),n,r;getCookie("chocolatey_hide_packages_disclaimer")||(n=document.getElementById("package-disclaimer"),(Modal.getInstance(n)?Modal.getInstance(n):new Modal(n,{keyboard:!1,backdrop:"static"})).show(),n.addEventListener("hidden.bs.modal",function(){document.cookie="chocolatey_hide_packages_disclaimer=true;"+setCookieExpirationNever()+"path=/;"}));u&&t.prop("checked",!0);f&&i.prop("checked",!0);jQuery(".btn-preferences").click(function(){1==t.prop("checked")?document.cookie="preferenceGridView=true":0==t.prop("checked")&&(document.cookie="preferenceGridView=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;");1==i.prop("checked")?document.cookie="preferenceModView=true":0==i.prop("checked")&&(document.cookie="preferenceModView=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;");location.reload()});jQuery('#callout-package-warning a[data-bs-toggle="collapse"]').click(function(){document.cookie="chocolatey_hide_packages_warning=true"});jQuery("#sortOrder,#prerelease,#moderatorQueue,#moderationStatus").change(function(){jQuery(this).closest("form").submit()});jQuery("#description pre").length&&(jQuery("#description").find("pre").addClass("line-numbers border").wrapInner('<code class="language-powershell"><\/code>'),Prism.highlightAllUnder(jQuery("#description")[0]));jQuery(".comments-list").each(function(){var n=jQuery(this),t,i;n.find("h4:contains('(maintainer)')").addClass("comment-title comment-maintainer");n.find("h4:contains('(reviewer)')").addClass("comment-title comment-reviewer");n.children().not(".comment-title").addClass("comment-body");jQuery(".comments-list pre").contents().unwrap().wrap("<p><\/p>");n.find(".comment-title").each(function(){var n=jQuery(this),t=n.text().split(" on");n.nextUntil(".comment-title").addBack().wrapAll('<span class="comment-group"><\/span>');2==t.length&&n.text(t[0]).after('<h6 class="comment-date">on '+t[1]+"<\/h6>")});t=n.find(".comment-maintainer").parent();i=n.find(".comment-reviewer").parent();n.hasClass("user-unknown")&&(t.addClass("chat-left"),i.addClass("chat-right"));n.hasClass("user-maintainer")&&(t.addClass("chat-right"),i.addClass("chat-left"));n.hasClass("user-moderator")&&(t.addClass("chat-left"),i.addClass("chat-right"));n.parent().scrollTop(n.parent()[0].scrollHeight-n.parent()[0].clientHeight)});r=jQuery('.moderation-view [class*="file-path-"]');jQuery('[class*="file-path-"]').on("show.bs.collapse",function(){if(!jQuery(this).find("pre").hasClass("line-numbers")){var n=jQuery(this).parent().find("span").first().text();switch(n.indexOf("\\")>=0&&(n=n.substr(n.lastIndexOf("\\")+1)),n=n.substring(n.indexOf(".")+1)){case"ps1":case"psm1":n="powershell";break;case"xml":case"config":case"nuspec":case"nuspec.template":n="xml";break;case"js":case"json":n="js";break;default:n="none"}jQuery(this).find("pre").addClass("line-numbers").find("code").addClass("language-"+n);Prism.highlightElement(jQuery(this).find("code")[0])}});jQuery("#files .btn-collapse-files").click(function(){var n=jQuery(this),t=n.text();n.hasClass("btn-success")?(n.text(t.replace("Expand","Collapse")),n.removeClass("btn-success").addClass("btn-danger"),jQuery('#files .btn:contains("Show")').html("Hide"),r.collapse("show")):n.hasClass("btn-danger")&&(n.text(t.replace("Collapse","Expand")),n.removeClass("btn-danger").addClass("btn-success"),jQuery('#files .btn:contains("Hide")').html("Show"),r.collapse("hide"))});jQuery(".text-editor").each(function(){var n="",t;jQuery(this).is("#NewReviewComments")?n="Add to Review Comments":jQuery(this).is("#ExemptedFromVerificationReason")?n="Verification Exempted Reason":jQuery(this).is("#ExemptedFromScannerReason")?n="Scanner Exempted Reason":jQuery(this).is("#ExemptedFromValidatorReason")&&(n="Validator Exempted Reason");t=new EasyMDE({element:this,autoDownloadFontAwesome:!1,placeholder:n,toolbar:["bold","italic","heading","strikethrough","|","quote","unordered-list","ordered-list","code","|","link","image","|","side-by-side","fullscreen","|","preview"]});t.render();jQuery('<span class="ms-1"> Preview<\/span>').insertAfter(jQuery(this).next().find(".fa-eye")).parent().addClass("fw-bold text-primary").attr("style","width:90px");t.element.cmirror=t.codemirror});jQuery(".text-editor-refresh").each(function(){jQuery(this).on("shown.bs.collapse",function(){if(!jQuery(this).hasClass("text-editor-refreshed")){var n=jQuery(this).attr("id");jQuery("#"+n+" textarea")[0].cmirror.refresh();jQuery("#"+n).addClass("text-editor-refreshed")}})});jQuery("#instructions").on("hidden.bs.collapse",function(){getCookie("chocolatey_hide_comment_instructions")||(document.cookie="chocolatey_hide_comment_instructions=true;path=/")});jQuery("#instructions").on("shown.bs.collapse",function(){getCookie("chocolatey_hide_comment_instructions")&&(document.cookie="chocolatey_hide_comment_instructions=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;")})}()