!function(e){if("object"==typeofexports&&"undefined"!=typeofmodule)module.exports=e();elseif("function"==typeofdefine&&define.amd)define([],e);else{vart;t="undefined"!=typeofwindow?window:"undefined"!=typeofglobal?global:"undefined"!=typeofself?self:this,t.SimpleMDE=e()}}(function(){vare;returnfunctione(t,n,r){functioni(a,l){if(!n[a]){if(!t[a]){vars="function"==typeofrequire&&require;if(!l&&s)returns(a,!0);if(o)returno(a,!0);varc=newError("Cannot find module '"+a+"'");throwc.code="MODULE_NOT_FOUND",c}varu=n[a]={exports:{}};t[a][0].call(u.exports,function(e){varn=t[a][1][e];returni(n?n:e)},u,u.exports,e,t,n,r)}returnn[a].exports}for(varo="function"==typeofrequire&&require,a=0;a<r.length;a++)i(r[a]);returni}({1:[function(e,t,n){"use strict";functionr(e){vart=e.length;if(t%4>0)thrownewError("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}functioni(e){return3*e.length/4-r(e)}functiono(e){vart,n,i,o,a,l,s=e.length;a=r(e),l=newf(3*s/4-a),i=a>0?s-4:s;varc=0;for(t=0,n=0;t<i;t+=4,n+=3)o=u[e.charCodeAt(t)]<<18|u[e.charCodeAt(t+1)]<<12|u[e.charCodeAt(t+2)]<<6|u[e.charCodeAt(t+3)],l[c++]=o>>16&255,l[c++]=o>>8&255,l[c++]=255&o;return2===a?(o=u[e.charCodeAt(t)]<<2|u[e.charCodeAt(t+1)]>>4,l[c++]=255&o):1===a&&(o=u[e.charCodeAt(t)]<<10|u[e.charCodeAt(t+1)]<<4|u[e.charCodeAt(t+2)]>>2,l[c++]=o>>8&255,l[c++]=255&o),l}functiona(e){returnc[e>>18&63]+c[e>>12&63]+c[e>>6&63]+c[63&e]}functionl(e,t,n){for(varr,i=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(a(r));returni.join("")}functions(e){for(vart,n=e.length,r=n%3,i="",o=[],a=16383,s=0,u=n-r;s<u;s+=a)o.push(l(e,s,s+a>u?u:s+a));return1===r?(t=e[n-1],i+=c[t>>2],i+=c[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=c[t>>10],i+=c[t>>4&63],i+=c[t<<2&63],i+="="),o.push(i),o.join("")}n.byteLength=i,n.toByteArray=o,n.fromByteArray=s;for(varc=[],u=[],f="undefined"!=typeofUint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,p=h.length;d<p;++d)c[d]=h[d],u[h.charCodeAt(d)]=d;u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],2:[function(e,t,n){},{}],3:[function(e,t,n){"use strict";functionr(){try{vare=newUint8Array(1);returne.__proto__={__proto__:Uint8Array.prototype,foo:function(){return42}},42===e.foo()}catch(e){return!1}}functioni(e){if(e>Y)thrownewRangeError("Invalid typed array length");vart=newUint8Array(e);returnt.__proto__=o.prototype,t}functiono(e,t,n){if("number"==typeofe){if("string"==typeoft)thrownewError("If encoding is specified then the first argument must be a string");returnc(e)}returna(e,t,n)}functiona(e,t,n){if("number"==typeofe)thrownewTypeError('"value" argument must not be a number');returneinstanceofArrayBuffer?h(e,t,n):"string"==typeofe?u(e,t):d(e)}functionl(e){if("number"!=typeofe)thrownewTypeError('"size" argument must be a number');if(e<0)thrownewRangeError('"size" argument must not be negative')}functions(e,t,n){returnl(e),e<=0?i(e):void0!==t?"string"==typeofn?i(e).fill(t,n):i(e).fill(t):i(e)}functionc(e){returnl(e),i(e<0?0:0|p(e))}functionu(e,t){if("string"==typeoft&&""!==t||(t="utf8"),!o.isEncoding(t))thrownewTypeError('"encoding" must be a valid string encoding');varn=0|g(e,t),r=i(n),a=r.write(e,t);returna!==n&&(r=r.slice(0,a)),r}functionf(e){for(vart=e.length<0?0:0|p(e.length),n=i(t),r=0;r<t;r+=1)n[r]=255&e[r];returnn}functionh(e,t,n){if(t<0||e.byteLength<t)thrownewRangeError("'offset' is out of bounds");if(e.byteLength<t+(n||0))thrownewRangeError("'length' is out of bounds");varr;returnr=void0===t&&void0===n?newUint8Array(e):void0===n?newUint8Array(e,t):newUint8Array(e,t,n),r.__proto__=o.prototype,r}functiond(e){if(o.isBuffer(e)){vart=0|p(e.length),n=i(t);return0===n.length?n:(e.copy(n,0,0,t),n)}if(e){if(ArrayBuffer.isView(e)||"length"ine)return"number"!=typeofe.length||V(e.length)?i(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))returnf(e.data)}thrownewTypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}functio
i.sizer=r("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=r("div",null,null,"position: absolute; height: "+xa+"px; width: 1px;"),i.gutters=r("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=r("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=r("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),Yo&&Zo<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),Jo||$o&&aa||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,n.init(i)}functionT(e,t){if(t-=e.first,t<0||t>=e.size)thrownewError("There is no line "+(t+e.first)+" in the document.");for(varn=e;!n.lines;)for(varr=0;;++r){vari=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}returnn.lines[t]}functionM(e,t,n){varr=[],i=t.line;returne.iter(t.line,n.line+1,function(e){varo=e.text;i==n.line&&(o=o.slice(0,n.ch)),i==t.line&&(o=o.slice(t.ch)),r.push(o),++i}),r}functionN(e,t,n){varr=[];returne.iter(t,n,function(e){r.push(e.text)}),r}functionA(e,t){varn=t-e.height;if(n)for(varr=e;r;r=r.parent)r.height+=n}functionE(e){if(null==e.parent)returnnull;for(vart=e.parent,n=f(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(vari=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();returnn+t.first}functionO(e,t){varn=e.first;e:do{for(varr=0;r<e.children.length;++r){vari=e.children[r],o=i.height;if(t<o){e=i;continuee}t-=o,n+=i.chunkSize()}returnn}while(!e.lines);for(vara=0;a<e.lines.length;++a){varl=e.lines[a],s=l.height;if(t<s)break;t-=s}returnn+a}functionI(e,t){returnt>=e.first&&t<e.first+e.size}functionH(e,t){returnString(e.lineNumberFormatter(t+e.firstLineNumber))}functionD(e,t,n){returnvoid0===n&&(n=null),thisinstanceofD?(this.line=e,this.ch=t,void(this.sticky=n)):newD(e,t,n)}functionW(e,t){returne.line-t.line||e.ch-t.ch}functionB(e,t){returne.sticky==t.sticky&&0==W(e,t)}functionP(e){returnD(e.line,e.ch)}functionR(e,t){returnW(e,t)<0?t:e}functionF(e,t){returnW(e,t)<0?e:t}functionz(e,t){returnMath.max(e.first,Math.min(t,e.first+e.size-1))}function_(e,t){if(t.line<e.first)returnD(e.first,0);varn=e.first+e.size-1;returnt.line>n?D(n,T(e,n).text.length):j(t,T(e,t.line).text.length)}functionj(e,t){varn=e.ch;returnnull==n||n>t?D(e.line,t):n<0?D(e.line,0):e}functionq(e,t){for(varn=[],r=0;r<t.length;r++)n[r]=_(e,t[r]);returnn}functionU(){Ma=!0}functionG(){Na=!0}function$(e,t,n){this.marker=e,this.from=t,this.to=n}functionV(e,t){if(e)for(varn=0;n<e.length;++n){varr=e[n];if(r.marker==t)returnr}}functionK(e,t){for(varn,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);returnn}functionX(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}functionY(e,t,n){varr;if(e)for(vari=0;i<e.length;++i){varo=e[i],a=o.marker,l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&"bookmark"==a.type&&(!n||!o.marker.insertLeft)){vars=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new$(a,o.from,s?null:o.to))}}returnr}functionZ(e,t,n){varr;if(e)for(vari=0;i<e.length;++i){varo=e[i],a=o.marker,l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){vars=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new$(a,s?null:o.from-t,null==o.to?null:o.to-t))}}returnr}functionJ(e,t){if(t.full)returnnull;varn=I(e,t.from.line)&&T(e,t.from.line).markedSpans,r=I(e,t.to.line)&&T(e,t.to.line).markedSpans;if(!n&&!
i-=an();elseif("local"==n||!n){varo=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}vara=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}functioncn(e,t,n,r,i){returnr||(r=T(e.doc,t.line)),ln(e,r,Vt(e,r,t.ch,i),n)}functionun(e,t,n,r,i,o){functiona(t,a){varl=Yt(e,i,t,a?"right":"left",o);returna?l.left=l.right:l.right=l.left,ln(e,r,l,n)}functionl(e,t,n){varr=s[t],i=r.level%2!=0;returna(n?e-1:e,i!=n)}r=r||T(e.doc,t.line),i||(i=Xt(e,r));vars=ke(r),c=t.ch,u=t.sticky;if(c>=r.text.length?(c=r.text.length,u="before"):c<=0&&(c=0,u="after"),!s)returna("before"==u?c-1:c,"before"==u);varf=we(s,c,u),h=Aa,d=l(c,f,"before"==u);returnnull!=h&&(d.other=l(c,h,"before"!=u)),d}functionfn(e,t){varn=0;t=_(e.doc,t),e.options.lineWrapping||(n=yn(e.display)*t.ch);varr=T(e.doc,t.line),i=ve(r)+Rt(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}functionhn(e,t,n,r,i){varo=D(e,t,n);returno.xRel=i,r&&(o.outside=!0),o}functiondn(e,t,n){varr=e.doc;if(n+=e.display.viewOffset,n<0)returnhn(r.first,0,null,!0,-1);vari=O(r,n),o=r.first+r.size-1;if(i>o)returnhn(r.first+r.size-1,T(r,o).text.length,null,!0,1);t<0&&(t=0);for(vara=T(r,i);;){varl=gn(e,a,i,t,n),s=se(a),c=s&&s.find(0,!0);if(!s||!(l.ch>c.from.ch||l.ch==c.from.ch&&l.xRel>0))returnl;i=E(a=c.to.line)}}functionpn(e,t,n,r){vari=function(r){returnln(e,t,Yt(e,n,r),"line")},o=t.text.length,a=S(function(e){returni(e-1).bottom<=r},o,0);returno=S(function(e){returni(e).top>r},a,o),{begin:a,end:o}}functionmn(e,t,n,r){vari=ln(e,t,Yt(e,n,r),"line").top;returnpn(e,t,n,i)}functiongn(e,t,n,r,i){i-=ve(t);varo,a=0,l=t.text.length,s=Xt(e,t),c=ke(t);if(c){if(e.options.lineWrapping){varu;u=pn(e,t,s,i),a=u.begin,l=u.end,u}o=newD(n,a);varf,h,d=un(e,o,"line",t,s).left,p=d<r?1:-1,m=d-r;do{if(f=m,h=o,o=Te(e,t,o,p),null==o||o.ch<a||l<=("before"==o.sticky?o.ch-1:o.ch)){o=h;break}m=un(e,o,"line",t,s).left-r}while(p<0!=m<0&&Math.abs(m)<=Math.abs(f));if(Math.abs(m)>Math.abs(f)){if(m<0==f<0)thrownewError("Broke out of infinite loop in coordsCharInner");o=h}}else{varg=S(function(n){varo=ln(e,t,Yt(e,s,n),"line");returno.top>i?(l=Math.min(n,l),!0):!(o.bottom<=i)&&(o.left>r||!(o.right<r)&&r-o.left<o.right-r)},a,l);g=C(t.text,g,1),o=newD(n,g,g==l?"before":"after")}varv=un(e,o,"line",t,s);return(i<v.top||v.bottom<i)&&(o.outside=!0),o.xRel=r<v.left?-1:r>v.right?1:0,o}functionvn(e){if(null!=e.cachedTextHeight)returne.cachedTextHeight;if(null==qa){qa=r("pre");for(vari=0;i<49;++i)qa.appendChild(document.createTextNode("x")),qa.appendChild(r("br"));qa.appendChild(document.createTextNode("x"))}n(e.measure,qa);varo=qa.offsetHeight/50;returno>3&&(e.cachedTextHeight=o),t(e.measure),o||1}functionyn(e){if(null!=e.cachedCharWidth)returne.cachedCharWidth;vart=r("span","xxxxxxxxxx"),i=r("pre",[t]);n(e.measure,i);varo=t.getBoundingClientRect(),a=(o.right-o.left)/10;returna>2&&(e.cachedCharWidth=a),a||10}functionxn(e){for(vart=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a)n[e.options.gutters[a]]=o.offsetLeft+o.clientLeft+i,r[e.options.gutters[a]]=o.clientWidth;return{fixedPos:bn(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}functionbn(e){returne.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}functionwn(e){vart=vn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/yn(e.display)-3);returnfunction(i){if(me(e.doc,i))return0;varo=0;if(i.widgets)for(vara=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);returnn?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}functionkn(e){vart=e.doc,n=wn(e);t.iter(function(e){vart=n(e);t!=e.height&&A(e,t)})}functionCn(e,t,n,r){vari=e.display;if(!n&&"true"==Re(t).getAttribute("cm-not-content"))returnnull;varo,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch(e){returnnull}vars,c=dn(e,o,a);if(r&&1==c.xRel&&(s=T(e.doc,c.line).text).length==c.ch){varf=u(s,s.length,e.options.tabSize)-s.leng
varl=n.exec(a),h=c(t,f);null!==l?(u(t,l[2])&&(h=""),a=l[1]+h+l[3]+a.replace(r,"").replace(s[t],"$1")):a=h+" "+a,f+=1}e.replaceRange(a,{line:o,ch:0},{line:o,ch:99999999999999})}(h);e.focus()}}functionH(e,t,n,r){if(!/editor-preview-active/.test(e.codemirror.getWrapperElement().lastChild.className)){r="undefined"==typeofr?n:r;vari,o=e.codemirror,a=l(o),s=n,c=r,u=o.getCursor("start"),f=o.getCursor("end");a[t]?(i=o.getLine(u.line),s=i.slice(0,u.ch),c=i.slice(u.ch),"bold"==t?(s=s.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),c=c.replace(/(\*\*|__)/,"")):"italic"==t?(s=s.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),c=c.replace(/(\*|_)/,"")):"strikethrough"==t&&(s=s.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),c=c.replace(/(\*\*|~~)/,"")),o.replaceRange(s+c,{line:u.line,ch:0},{line:u.line,ch:99999999999999}),"bold"==t||"strikethrough"==t?(u.ch-=2,u!==f&&(f.ch-=2)):"italic"==t&&(u.ch-=1,u!==f&&(f.ch-=1))):(i=o.getSelection(),"bold"==t?(i=i.split("**").join(""),i=i.split("__").join("")):"italic"==t?(i=i.split("*").join(""),i=i.split("_").join("")):"strikethrough"==t&&(i=i.split("~~").join("")),o.replaceSelection(s+i+c),u.ch+=n.length,f.ch=u.ch+i.length),o.setSelection(u,f),o.focus()}}functionD(e){if(!/editor-preview-active/.test(e.getWrapperElement().lastChild.className))for(vart,n=e.getCursor("start"),r=e.getCursor("end"),i=n.line;i<=r.line;i++)t=e.getLine(i),t=t.replace(/^[ ]*([# ]+|\*|\-|[> ]+|[0-9]+(.|\)))[ ]*/,""),e.replaceRange(t,{line:i,ch:0},{line:i,ch:99999999999999})}functionW(e,t){for(varnint)t.hasOwnProperty(n)&&(t[n]instanceofArray?e[n]=t[n].concat(e[n]instanceofArray?e[n]:[]):null!==t[n]&&"object"==typeoft[n]&&t[n].constructor===Object?e[n]=W(e[n]||{},t[n]):e[n]=t[n]);returne}functionB(e){for(vart=1;t<arguments.length;t++)e=W(e,arguments[t]);returne}functionP(e){vart=/[a-zA-Z0-9_\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g,n=e.match(t),r=0;if(null===n)returnr;for(vari=0;i<n.length;i++)r+=n[i].charCodeAt(0)>=19968?n[i].length:1;returnr}functionR(e){e=e||{},e.parent=this;vart=!0;if(e.autoDownloadFontAwesome===!1&&(t=!1),e.autoDownloadFontAwesome!==!0)for(varn=document.styleSheets,r=0;r<n.length;r++)n[r].href&&n[r].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")>-1&&(t=!1);if(t){vari=document.createElement("link");i.rel="stylesheet",i.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(i)}if(e.element)this.element=e.element;elseif(null===e.element)returnvoidconsole.log("SimpleMDE: Error. No element was found.");if(void0===e.toolbar){e.toolbar=[];for(varoinX)X.hasOwnProperty(o)&&(o.indexOf("separator-")!=-1&&e.toolbar.push("|"),(X[o].default===!0||e.showIcons&&e.showIcons.constructor===Array&&e.showIcons.indexOf(o)!=-1)&&e.toolbar.push(o))}e.hasOwnProperty("status")||(e.status=["autosave","lines","words","cursor"]),e.previewRender||(e.previewRender=function(e){returnthis.parent.markdown(e)}),e.parsingConfig=B({highlightFormatting:!0},e.parsingConfig||{}),e.insertTexts=B({},Y,e.insertTexts||{}),e.promptTexts=Z,e.blockStyles=B({},J,e.blockStyles||{}),e.shortcuts=B({},G,e.shortcuts||{}),e.minHeight=e.minHeight||"300px",void0!=e.autosave&&void0!=e.autosave.unique_id&&""!=e.autosave.unique_id&&(e.autosave.uniqueId=e.autosave.unique_id),this.options=e,this.render(),!e.initialValue||this.options.autosave&&this.options.autosave.foundSavedValue===!0||this.value(e.initialValue)}functionF(){if("object"!=typeoflocalStorage)return!1;try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch(e){return!1}return!0}varz=e("codemirror");e("codemirror/addon/edit/continuelist.js"),e("./codemirror/tablist"),e("codemirror/addon/display/fullscreen.js"),e("codemirror/mode/markdown/markdown.js"),e("codemirror/addon/mode/overlay.js"),e("codemirror/addon/display/placeholder.js"),e("codemirror/addon/selection/mark-selection.js"),e("codemirror/mode/gfm/gfm.js"),e("codemirror/mode/xml/xml.js");var_=e("codemirror-spell-checker"),j=e("ma