@yannelli/live-markdown-vue 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,151 @@
1
+ (function(an,Ke){typeof exports=="object"&&typeof module<"u"?Ke(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],Ke):(an=typeof globalThis<"u"?globalThis:an||self,Ke(an.LiveMarkdownVue={},an.Vue))})(this,(function(an,Ke){"use strict";var nd=Object.defineProperty;var rd=(an,Ke,ur)=>Ke in an?nd(an,Ke,{enumerable:!0,configurable:!0,writable:!0,value:ur}):an[Ke]=ur;var dt=(an,Ke,ur)=>rd(an,typeof Ke!="symbol"?Ke+"":Ke,ur);var Sa;function ur(y){return y&&y.__esModule&&Object.prototype.hasOwnProperty.call(y,"default")?y.default:y}function Mu(y){if(Object.prototype.hasOwnProperty.call(y,"__esModule"))return y;var c=y.default;if(typeof c=="function"){var f=function p(){return this instanceof p?Reflect.construct(c,arguments,this.constructor):c.apply(this,arguments)};f.prototype=c.prototype}else f={};return Object.defineProperty(f,"__esModule",{value:!0}),Object.keys(y).forEach(function(p){var x=Object.getOwnPropertyDescriptor(y,p);Object.defineProperty(f,p,x.get?x:{enumerable:!0,get:function(){return y[p]}})}),f}var di={exports:{}},Bu=di.exports,Cl;function un(){return Cl||(Cl=1,(function(y,c){(function(f,p){y.exports=p()})(Bu,(function(){var f=navigator.userAgent,p=navigator.platform,x=/gecko\/\d/i.test(f),b=/MSIE \d/.test(f),A=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(f),D=/Edge\/(\d+)/.exec(f),k=b||A||D,S=k&&(b?document.documentMode||6:+(D||A)[1]),z=!D&&/WebKit\//.test(f),Z=z&&/Qt\/\d+\.\d+/.test(f),H=!D&&/Chrome\/(\d+)/.exec(f),ie=H&&+H[1],ee=/Opera\//.test(f),ye=/Apple Computer/.test(navigator.vendor),re=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(f),te=/PhantomJS/.test(f),X=ye&&(/Mobile\/\w+/.test(f)||navigator.maxTouchPoints>2),Q=/Android/.test(f),j=X||Q||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(f),K=X||/Mac/.test(p),se=/\bCrOS\b/.test(f),V=/win/i.test(p),pe=ee&&f.match(/Version\/(\d*\.\d*)/);pe&&(pe=Number(pe[1])),pe&&pe>=15&&(ee=!1,z=!0);var xe=K&&(Z||ee&&(pe==null||pe<12.11)),Xe=x||k&&S>=9;function le(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Oe=function(e,t){var r=e.className,n=le(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function Re(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Pe(e,t){return Re(e).appendChild(t)}function P(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var a=0;a<t.length;++a)i.appendChild(t[a]);return i}function ce(e,t,r,n){var i=P(e,t,r,n);return i.setAttribute("role","presentation"),i}var ae;document.createRange?ae=function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:ae=function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch{return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};function Ee(e,t){if(t.nodeType==3&&(t=t.parentNode),e.contains)return e.contains(t);do if(t.nodeType==11&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function $e(e){var t=e.ownerDocument||e,r;try{r=e.activeElement}catch{r=t.body||null}for(;r&&r.shadowRoot&&r.shadowRoot.activeElement;)r=r.shadowRoot.activeElement;return r}function pt(e,t){var r=e.className;le(t).test(r)||(e.className+=(r?" ":"")+t)}function lt(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!le(r[n]).test(t)&&(t+=" "+r[n]);return t}var M=function(e){e.select()};X?M=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:k&&(M=function(e){try{e.select()}catch{}});function g(e){return e.display.wrapper.ownerDocument}function J(e){return Fe(e.display.wrapper)}function Fe(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function Ie(e){return g(e).defaultView}function tt(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Ze(e,t,r){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(r!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function Qe(e,t,r,n,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var a=n||0,l=i||0;;){var s=e.indexOf(" ",a);if(s<0||s>=t)return l+(t-a);l+=s-a,l+=r-l%r,a=s+1}}var Je=function(){this.id=null,this.f=null,this.time=0,this.handler=tt(this.onTimeout,this)};Je.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Je.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};function Ue(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var je=50,Ve={toString:function(){return"CodeMirror.Pass"}},ht={scroll:!1},Ce={origin:"*mouse"},Ct={origin:"+move"};function Lt(e,t,r){for(var n=0,i=0;;){var a=e.indexOf(" ",n);a==-1&&(a=e.length);var l=a-n;if(a==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=a-n,i+=r-i%r,n=a+1,i>=t)return n}}var ot=[""];function Nt(e){for(;ot.length<=e;)ot.push(we(ot)+" ");return ot[e]}function we(e){return e[e.length-1]}function xt(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Jt(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function wn(){}function G(e,t){var r;return Object.create?r=Object.create(e):(wn.prototype=e,r=new wn),t&&Ze(t,r),r}var $=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function I(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||$.test(e))}function v(e,t){return t?t.source.indexOf("\\w")>-1&&I(e)?!0:t.test(e):I(e)}function m(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var B=/[\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]/;function o(e){return e.charCodeAt(0)>=768&&B.test(e)}function h(e,t,r){for(;(r<0?t>0:t<e.length)&&o(e.charAt(t));)t+=r;return t}function w(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var i=(t+r)/2,a=n<0?Math.ceil(i):Math.floor(i);if(a==t)return e(a)?t:r;e(a)?r=a:t=a+n}}function T(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,a=0;a<e.length;++a){var l=e[a];(l.from<r&&l.to>t||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),l.level==1?"rtl":"ltr",a),i=!0)}i||n(t,r,"ltr")}var L=null;function W(e,t,r){var n;L=null;for(var i=0;i<e.length;++i){var a=e[i];if(a.from<t&&a.to>t)return i;a.to==t&&(a.from!=a.to&&r=="before"?n=i:L=i),a.from==t&&(a.from!=a.to&&r!="before"?n=i:L=i)}return n??L}var R=(function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(d){return d<=247?e.charAt(d):1424<=d&&d<=1524?"R":1536<=d&&d<=1785?t.charAt(d-1536):1774<=d&&d<=2220?"r":8192<=d&&d<=8203?"w":d==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,a=/[LRr]/,l=/[Lb1n]/,s=/[1n]/;function u(d,C,E){this.level=d,this.from=C,this.to=E}return function(d,C){var E=C=="ltr"?"L":"R";if(d.length==0||C=="ltr"&&!n.test(d))return!1;for(var U=d.length,O=[],Y=0;Y<U;++Y)O.push(r(d.charCodeAt(Y)));for(var ne=0,fe=E;ne<U;++ne){var ge=O[ne];ge=="m"?O[ne]=fe:fe=ge}for(var me=0,ve=E;me<U;++me){var De=O[me];De=="1"&&ve=="r"?O[me]="n":a.test(De)&&(ve=De,De=="r"&&(O[me]="R"))}for(var _e=1,Be=O[0];_e<U-1;++_e){var qe=O[_e];qe=="+"&&Be=="1"&&O[_e+1]=="1"?O[_e]="1":qe==","&&Be==O[_e+1]&&(Be=="1"||Be=="n")&&(O[_e]=Be),Be=qe}for(var ct=0;ct<U;++ct){var It=O[ct];if(It==",")O[ct]="N";else if(It=="%"){var kt=void 0;for(kt=ct+1;kt<U&&O[kt]=="%";++kt);for(var sn=ct&&O[ct-1]=="!"||kt<U&&O[kt]=="1"?"1":"N",tn=ct;tn<kt;++tn)O[tn]=sn;ct=kt-1}}for(var At=0,nn=E;At<U;++At){var Pt=O[At];nn=="L"&&Pt=="1"?O[At]="L":a.test(Pt)&&(nn=Pt)}for(var Ft=0;Ft<U;++Ft)if(i.test(O[Ft])){var Et=void 0;for(Et=Ft+1;Et<U&&i.test(O[Et]);++Et);for(var Dt=(Ft?O[Ft-1]:E)=="L",rn=(Et<U?O[Et]:E)=="L",Tr=Dt==rn?Dt?"L":"R":E,Yn=Ft;Yn<Et;++Yn)O[Yn]=Tr;Ft=Et-1}for(var Gt=[],En,Ot=0;Ot<U;)if(l.test(O[Ot])){var bl=Ot;for(++Ot;Ot<U&&l.test(O[Ot]);++Ot);Gt.push(new u(0,bl,Ot))}else{var Nn=Ot,or=Gt.length,sr=C=="rtl"?1:0;for(++Ot;Ot<U&&O[Ot]!="L";++Ot);for(var Xt=Nn;Xt<Ot;)if(s.test(O[Xt])){Nn<Xt&&(Gt.splice(or,0,new u(1,Nn,Xt)),or+=sr);var Fr=Xt;for(++Xt;Xt<Ot&&s.test(O[Xt]);++Xt);Gt.splice(or,0,new u(2,Fr,Xt)),or+=sr,Nn=Xt}else++Xt;Nn<Ot&&Gt.splice(or,0,new u(1,Nn,Ot))}return C=="ltr"&&(Gt[0].level==1&&(En=d.match(/^\s+/))&&(Gt[0].from=En[0].length,Gt.unshift(new u(0,0,En[0].length))),we(Gt).level==1&&(En=d.match(/\s+$/))&&(we(Gt).to-=En[0].length,Gt.push(new u(0,U-En[0].length,U)))),C=="rtl"?Gt.reverse():Gt}})();function F(e,t){var r=e.order;return r==null&&(r=e.order=R(e.text,t)),r}var q=[],N=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||q).concat(r)}};function de(e,t){return e._handlers&&e._handlers[t]||q}function be(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var a=Ue(i,r);a>-1&&(n[t]=i.slice(0,a).concat(i.slice(a+1)))}}}function ke(e,t){var r=de(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function ue(e,t,r){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),ke(e,r||t.type,e,t),rt(t)||t.codemirrorIgnore}function Ne(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)Ue(r,t[n])==-1&&r.push(t[n])}function ze(e,t){return de(e,t).length>0}function Te(e){e.prototype.on=function(t,r){N(this,t,r)},e.prototype.off=function(t,r){be(this,t,r)}}function Le(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function nt(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function rt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function vt(e){Le(e),nt(e)}function Mt(e){return e.target||e.srcElement}function Tt(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),K&&e.ctrlKey&&t==1&&(t=3),t}var Pn=(function(){if(k&&S<9)return!1;var e=P("div");return"draggable"in e||"dragDrop"in e})(),Ht;function pn(e){if(Ht==null){var t=P("span","​");Pe(e,P("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ht=t.offsetWidth<=1&&t.offsetHeight>2&&!(k&&S<8))}var r=Ht?P("span","​"):P("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var zn;function Hn(e){if(zn!=null)return zn;var t=Pe(e,document.createTextNode("AخA")),r=ae(t,0,1).getBoundingClientRect(),n=ae(t,1,2).getBoundingClientRect();return Re(e),!r||r.left==r.right?!1:zn=n.right-r.right<3}var Ln=`
2
+
3
+ b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf(`
4
+ `,t);i==-1&&(i=e.length);var a=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),l=a.indexOf("\r");l!=-1?(r.push(a.slice(0,l)),t+=l+1):(r.push(a),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},fr=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch{return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch{}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},ft=(function(){var e=P("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")})(),fn=null;function ln(e){if(fn!=null)return fn;var t=Pe(e,P("span","x")),r=t.getBoundingClientRect(),n=ae(t,0,1).getBoundingClientRect();return fn=Math.abs(r.left-n.left)>1}var $t={},Wt={};function Mn(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),$t[e]=t}function Me(e,t){Wt[e]=t}function _(e){if(typeof e=="string"&&Wt.hasOwnProperty(e))e=Wt[e];else if(e&&typeof e.name=="string"&&Wt.hasOwnProperty(e.name)){var t=Wt[e.name];typeof t=="string"&&(t={name:t}),e=G(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return _("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return _("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function he(e,t){t=_(t);var r=$t[t.name];if(!r)return he(e,"text/plain");var n=r(e,t);if(Se.hasOwnProperty(t.name)){var i=Se[t.name];for(var a in i)i.hasOwnProperty(a)&&(n.hasOwnProperty(a)&&(n["_"+a]=n[a]),n[a]=i[a])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var Se={};function gt(e,t){var r=Se.hasOwnProperty(e)?Se[e]:Se[e]={};Ze(t,r)}function yt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function bt(e,t){for(var r;e.innerMode&&(r=e.innerMode(t),!(!r||r.mode==e));)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Ut(e,t,r){return e.startState?e.startState(t,r):!0}var it=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};it.prototype.eol=function(){return this.pos>=this.string.length},it.prototype.sol=function(){return this.pos==this.lineStart},it.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},it.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},it.prototype.eat=function(e){var t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e.test?e.test(t):e(t)),r)return++this.pos,t},it.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},it.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},it.prototype.skipToEnd=function(){this.pos=this.string.length},it.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},it.prototype.backUp=function(e){this.pos-=e},it.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Qe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Qe(this.string,this.lineStart,this.tabSize):0)},it.prototype.indentation=function(){return Qe(this.string,null,this.tabSize)-(this.lineStart?Qe(this.string,this.lineStart,this.tabSize):0)},it.prototype.match=function(e,t,r){if(typeof e=="string"){var n=function(l){return r?l.toLowerCase():l},i=this.string.substr(this.pos,e.length);if(n(i)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var a=this.string.slice(this.pos).match(e);return a&&a.index>0?null:(a&&t!==!1&&(this.pos+=a[0].length),a)}},it.prototype.current=function(){return this.string.slice(this.start,this.pos)},it.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},it.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},it.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Ae(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],a=i.chunkSize();if(t<a){r=i;break}t-=a}return r.lines[t]}function vn(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(a){var l=a.text;i==r.line&&(l=l.slice(0,r.ch)),i==t.line&&(l=l.slice(t.ch)),n.push(l),++i}),n}function St(e,t,r){var n=[];return e.iter(t,r,function(i){n.push(i.text)}),n}function cn(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function Ye(e){if(e.parent==null)return null;for(var t=e.parent,r=Ue(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function Jn(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],a=i.height;if(t<a){e=i;continue e}t-=a,r+=i.chunkSize()}return r}while(!e.lines);for(var l=0;l<e.lines.length;++l){var s=e.lines[l],u=s.height;if(t<u)break;t-=u}return r+l}function zr(e,t){return t>=e.first&&t<e.first+e.size}function Aa(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function oe(e,t,r){if(r===void 0&&(r=null),!(this instanceof oe))return new oe(e,t,r);this.line=e,this.ch=t,this.sticky=r}function He(e,t){return e.line-t.line||e.ch-t.ch}function Ea(e,t){return e.sticky==t.sticky&&He(e,t)==0}function Ta(e){return oe(e.line,e.ch)}function Ci(e,t){return He(e,t)<0?t:e}function Si(e,t){return He(e,t)<0?e:t}function Bo(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function We(e,t){if(t.line<e.first)return oe(e.first,0);var r=e.first+e.size-1;return t.line>r?oe(r,Ae(e,r).text.length):rc(t,Ae(e,t.line).text.length)}function rc(e,t){var r=e.ch;return r==null||r>t?oe(e.line,t):r<0?oe(e.line,0):e}function Ro(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=We(e,t[n]);return r}var Ai=function(e,t){this.state=e,this.lookAhead=t},Cn=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};Cn.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Cn.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Cn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Cn.fromSaved=function(e,t,r){return t instanceof Ai?new Cn(e,yt(e.mode,t.state),r,t.lookAhead):new Cn(e,yt(e.mode,t),r)},Cn.prototype.save=function(e){var t=e!==!1?yt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Ai(t,this.maxLookAhead):t};function _o(e,t,r,n){var i=[e.state.modeGen],a={};Ho(e,t.text,e.doc.mode,r,function(d,C){return i.push(d,C)},a,n);for(var l=r.state,s=function(d){r.baseTokens=i;var C=e.state.overlays[d],E=1,U=0;r.state=!0,Ho(e,t.text,C.mode,r,function(O,Y){for(var ne=E;U<O;){var fe=i[E];fe>O&&i.splice(E,1,O,i[E+1],fe),E+=2,U=Math.min(O,fe)}if(Y)if(C.opaque)i.splice(ne,E-ne,O,"overlay "+Y),E=ne+2;else for(;ne<E;ne+=2){var ge=i[ne+1];i[ne+1]=(ge?ge+" ":"")+"overlay "+Y}},a),r.state=l,r.baseTokens=null,r.baseTokenPos=1},u=0;u<e.state.overlays.length;++u)s(u);return{styles:i,classes:a.bgClass||a.textClass?a:null}}function Io(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Hr(e,Ye(t)),i=t.text.length>e.options.maxHighlightLength&&yt(e.doc.mode,n.state),a=_o(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=a.styles,a.classes?t.styleClasses=a.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Hr(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new Cn(n,!0,t);var a=ic(e,t,r),l=a>n.first&&Ae(n,a-1).stateAfter,s=l?Cn.fromSaved(n,l,a):new Cn(n,Ut(n.mode),a);return n.iter(a,t,function(u){Fa(e,u.text,s);var d=s.line;u.stateAfter=d==t-1||d%5==0||d>=i.viewFrom&&d<i.viewTo?s.save():null,s.nextLine()}),r&&(n.modeFrontier=s.line),s}function Fa(e,t,r,n){var i=e.doc.mode,a=new it(t,e.options.tabSize,r);for(a.start=a.pos=n||0,t==""&&Oo(i,r.state);!a.eol();)La(i,a,r.state),a.start=a.pos}function Oo(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=bt(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}}function La(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=bt(e,r).mode);var a=e.token(t,r);if(t.pos>t.start)return a}throw new Error("Mode "+e.name+" failed to advance stream.")}var No=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Po(e,t,r,n){var i=e.doc,a=i.mode,l;t=We(i,t);var s=Ae(i,t.line),u=Hr(e,t.line,r),d=new it(s.text,e.options.tabSize,u),C;for(n&&(C=[]);(n||d.pos<t.ch)&&!d.eol();)d.start=d.pos,l=La(a,d,u.state),n&&C.push(new No(d,l,yt(i.mode,u.state)));return n?C:new No(d,l,u.state)}function zo(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";t[n]==null?t[n]=r[2]:new RegExp("(?:^|\\s)"+r[2]+"(?:$|\\s)").test(t[n])||(t[n]+=" "+r[2])}return e}function Ho(e,t,r,n,i,a,l){var s=r.flattenSpans;s==null&&(s=e.options.flattenSpans);var u=0,d=null,C=new it(t,e.options.tabSize,n),E,U=e.options.addModeClass&&[null];for(t==""&&zo(Oo(r,n.state),a);!C.eol();){if(C.pos>e.options.maxHighlightLength?(s=!1,l&&Fa(e,t,n,C.pos),C.pos=t.length,E=null):E=zo(La(r,C,n.state,U),a),U){var O=U[0].name;O&&(E="m-"+(E?O+" "+E:O))}if(!s||d!=E){for(;u<C.start;)u=Math.min(C.start,u+5e3),i(u,d);d=E}C.start=C.pos}for(;u<C.pos;){var Y=Math.min(C.pos,u+5e3);i(Y,d),u=Y}}function ic(e,t,r){for(var n,i,a=e.doc,l=r?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>l;--s){if(s<=a.first)return a.first;var u=Ae(a,s-1),d=u.stateAfter;if(d&&(!r||s+(d instanceof Ai?d.lookAhead:0)<=a.modeFrontier))return s;var C=Qe(u.text,null,e.options.tabSize);(i==null||n>C)&&(i=s-1,n=C)}return i}function ac(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;n>r;n--){var i=Ae(e,n).stateAfter;if(i&&(!(i instanceof Ai)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}var Wo=!1,Bn=!1;function lc(){Wo=!0}function oc(){Bn=!0}function Ei(e,t,r){this.marker=e,this.from=t,this.to=r}function Wr(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function sc(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function uc(e,t,r){var n=r&&window.WeakSet&&(r.markedSpans||(r.markedSpans=new WeakSet));n&&e.markedSpans&&n.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],n&&n.add(e.markedSpans)),t.marker.attachLine(e)}function fc(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var a=e[i],l=a.marker,s=a.from==null||(l.inclusiveLeft?a.from<=t:a.from<t);if(s||a.from==t&&l.type=="bookmark"&&(!r||!a.marker.insertLeft)){var u=a.to==null||(l.inclusiveRight?a.to>=t:a.to>t);(n||(n=[])).push(new Ei(l,a.from,u?null:a.to))}}return n}function cc(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var a=e[i],l=a.marker,s=a.to==null||(l.inclusiveRight?a.to>=t:a.to>t);if(s||a.from==t&&l.type=="bookmark"&&(!r||a.marker.insertLeft)){var u=a.from==null||(l.inclusiveLeft?a.from<=t:a.from<t);(n||(n=[])).push(new Ei(l,u?null:a.from-t,a.to==null?null:a.to-t))}}return n}function Ma(e,t){if(t.full)return null;var r=zr(e,t.from.line)&&Ae(e,t.from.line).markedSpans,n=zr(e,t.to.line)&&Ae(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,a=t.to.ch,l=He(t.from,t.to)==0,s=fc(r,i,l),u=cc(n,a,l),d=t.text.length==1,C=we(t.text).length+(d?i:0);if(s)for(var E=0;E<s.length;++E){var U=s[E];if(U.to==null){var O=Wr(u,U.marker);O?d&&(U.to=O.to==null?null:O.to+C):U.to=i}}if(u)for(var Y=0;Y<u.length;++Y){var ne=u[Y];if(ne.to!=null&&(ne.to+=C),ne.from==null){var fe=Wr(s,ne.marker);fe||(ne.from=C,d&&(s||(s=[])).push(ne))}else ne.from+=C,d&&(s||(s=[])).push(ne)}s&&(s=Uo(s)),u&&u!=s&&(u=Uo(u));var ge=[s];if(!d){var me=t.text.length-2,ve;if(me>0&&s)for(var De=0;De<s.length;++De)s[De].to==null&&(ve||(ve=[])).push(new Ei(s[De].marker,null,null));for(var _e=0;_e<me;++_e)ge.push(ve);ge.push(u)}return ge}function Uo(e){for(var t=0;t<e.length;++t){var r=e[t];r.from!=null&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function hc(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(O){if(O.markedSpans)for(var Y=0;Y<O.markedSpans.length;++Y){var ne=O.markedSpans[Y].marker;ne.readOnly&&(!n||Ue(n,ne)==-1)&&(n||(n=[])).push(ne)}}),!n)return null;for(var i=[{from:t,to:r}],a=0;a<n.length;++a)for(var l=n[a],s=l.find(0),u=0;u<i.length;++u){var d=i[u];if(!(He(d.to,s.from)<0||He(d.from,s.to)>0)){var C=[u,1],E=He(d.from,s.from),U=He(d.to,s.to);(E<0||!l.inclusiveLeft&&!E)&&C.push({from:d.from,to:s.from}),(U>0||!l.inclusiveRight&&!U)&&C.push({from:s.to,to:d.to}),i.splice.apply(i,C),u+=C.length-3}}return i}function qo(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function Go(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Ti(e){return e.inclusiveLeft?-1:0}function Fi(e){return e.inclusiveRight?1:0}function Ba(e,t){var r=e.lines.length-t.lines.length;if(r!=0)return r;var n=e.find(),i=t.find(),a=He(n.from,i.from)||Ti(e)-Ti(t);if(a)return-a;var l=He(n.to,i.to)||Fi(e)-Fi(t);return l||t.id-e.id}function $o(e,t){var r=Bn&&e.markedSpans,n;if(r)for(var i=void 0,a=0;a<r.length;++a)i=r[a],i.marker.collapsed&&(t?i.from:i.to)==null&&(!n||Ba(n,i.marker)<0)&&(n=i.marker);return n}function jo(e){return $o(e,!0)}function Li(e){return $o(e,!1)}function dc(e,t){var r=Bn&&e.markedSpans,n;if(r)for(var i=0;i<r.length;++i){var a=r[i];a.marker.collapsed&&(a.from==null||a.from<t)&&(a.to==null||a.to>t)&&(!n||Ba(n,a.marker)<0)&&(n=a.marker)}return n}function Xo(e,t,r,n,i){var a=Ae(e,t),l=Bn&&a.markedSpans;if(l)for(var s=0;s<l.length;++s){var u=l[s];if(u.marker.collapsed){var d=u.marker.find(0),C=He(d.from,r)||Ti(u.marker)-Ti(i),E=He(d.to,n)||Fi(u.marker)-Fi(i);if(!(C>=0&&E<=0||C<=0&&E>=0)&&(C<=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?He(d.to,r)>=0:He(d.to,r)>0)||C>=0&&(u.marker.inclusiveRight&&i.inclusiveLeft?He(d.from,n)<=0:He(d.from,n)<0)))return!0}}}function mn(e){for(var t;t=jo(e);)e=t.find(-1,!0).line;return e}function pc(e){for(var t;t=Li(e);)e=t.find(1,!0).line;return e}function gc(e){for(var t,r;t=Li(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function Ra(e,t){var r=Ae(e,t),n=mn(r);return r==n?t:Ye(n)}function Ko(e,t){if(t>e.lastLine())return t;var r=Ae(e,t),n;if(!Wn(e,r))return t;for(;n=Li(r);)r=n.find(1,!0).line;return Ye(r)+1}function Wn(e,t){var r=Bn&&t.markedSpans;if(r){for(var n=void 0,i=0;i<r.length;++i)if(n=r[i],!!n.marker.collapsed){if(n.from==null)return!0;if(!n.marker.widgetNode&&n.from==0&&n.marker.inclusiveLeft&&_a(e,t,n))return!0}}}function _a(e,t,r){if(r.to==null){var n=r.marker.find(1,!0);return _a(e,n.line,Wr(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,a=0;a<t.markedSpans.length;++a)if(i=t.markedSpans[a],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(i.to==null||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&_a(e,t,i))return!0}function Rn(e){e=mn(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var a=r.parent;a;r=a,a=r.parent)for(var l=0;l<a.children.length;++l){var s=a.children[l];if(s==r)break;t+=s.height}return t}function Mi(e){if(e.height==0)return 0;for(var t=e.text.length,r,n=e;r=jo(n);){var i=r.find(0,!0);n=i.from.line,t+=i.from.ch-i.to.ch}for(n=e;r=Li(n);){var a=r.find(0,!0);t-=n.text.length-a.from.ch,n=a.to.line,t+=n.text.length-a.to.ch}return t}function Ia(e){var t=e.display,r=e.doc;t.maxLine=Ae(r,r.first),t.maxLineLength=Mi(t.maxLine),t.maxLineChanged=!0,r.iter(function(n){var i=Mi(n);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=n)})}var cr=function(e,t,r){this.text=e,Go(this,t),this.height=r?r(this):1};cr.prototype.lineNo=function(){return Ye(this)},Te(cr);function vc(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),qo(e),Go(e,r);var i=n?n(e):1;i!=e.height&&cn(e,i)}function mc(e){e.parent=null,qo(e)}var xc={},yc={};function Yo(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?yc:xc;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Zo(e,t){var r=ce("span",null,null,z?"padding-right: .1px":null),n={pre:ce("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var a=i?t.rest[i-1]:t.line,l=void 0;n.pos=0,n.addToken=kc,Hn(e.display.measure)&&(l=F(a,e.doc.direction))&&(n.addToken=wc(n.addToken,l)),n.map=[];var s=t!=e.display.externalMeasured&&Ye(a);Cc(a,n,Io(e,a,s)),a.styleClasses&&(a.styleClasses.bgClass&&(n.bgClass=lt(a.styleClasses.bgClass,n.bgClass||"")),a.styleClasses.textClass&&(n.textClass=lt(a.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(pn(e.display.measure))),i==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(z){var u=n.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return ke(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=lt(n.pre.className,n.textClass||"")),n}function bc(e){var t=P("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function kc(e,t,r,n,i,a,l){if(t){var s=e.splitSpaces?Dc(t,e.trailingSpace):t,u=e.cm.state.specialChars,d=!1,C;if(!u.test(t))e.col+=t.length,C=document.createTextNode(s),e.map.push(e.pos,e.pos+t.length,C),k&&S<9&&(d=!0),e.pos+=t.length;else{C=document.createDocumentFragment();for(var E=0;;){u.lastIndex=E;var U=u.exec(t),O=U?U.index-E:t.length-E;if(O){var Y=document.createTextNode(s.slice(E,E+O));k&&S<9?C.appendChild(P("span",[Y])):C.appendChild(Y),e.map.push(e.pos,e.pos+O,Y),e.col+=O,e.pos+=O}if(!U)break;E+=O+1;var ne=void 0;if(U[0]==" "){var fe=e.cm.options.tabSize,ge=fe-e.col%fe;ne=C.appendChild(P("span",Nt(ge),"cm-tab")),ne.setAttribute("role","presentation"),ne.setAttribute("cm-text"," "),e.col+=ge}else U[0]=="\r"||U[0]==`
5
+ `?(ne=C.appendChild(P("span",U[0]=="\r"?"␍":"␤","cm-invalidchar")),ne.setAttribute("cm-text",U[0]),e.col+=1):(ne=e.cm.options.specialCharPlaceholder(U[0]),ne.setAttribute("cm-text",U[0]),k&&S<9?C.appendChild(P("span",[ne])):C.appendChild(ne),e.col+=1);e.map.push(e.pos,e.pos+1,ne),e.pos++}}if(e.trailingSpace=s.charCodeAt(t.length-1)==32,r||n||i||d||a||l){var me=r||"";n&&(me+=n),i&&(me+=i);var ve=P("span",[C],me,a);if(l)for(var De in l)l.hasOwnProperty(De)&&De!="style"&&De!="class"&&ve.setAttribute(De,l[De]);return e.content.appendChild(ve)}e.content.appendChild(C)}}function Dc(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var a=e.charAt(i);a==" "&&r&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(a=" "),n+=a,r=a==" "}return n}function wc(e,t){return function(r,n,i,a,l,s,u){i=i?i+" cm-force-border":"cm-force-border";for(var d=r.pos,C=d+n.length;;){for(var E=void 0,U=0;U<t.length&&(E=t[U],!(E.to>d&&E.from<=d));U++);if(E.to>=C)return e(r,n,i,a,l,s,u);e(r,n.slice(0,E.to-d),i,a,null,s,u),a=null,n=n.slice(E.to-d),d=E.to}}}function Qo(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Cc(e,t,r){var n=e.markedSpans,i=e.text,a=0;if(!n){for(var l=1;l<r.length;l+=2)t.addToken(t,i.slice(a,a=r[l]),Yo(r[l+1],t.cm.options));return}for(var s=i.length,u=0,d=1,C="",E,U,O=0,Y,ne,fe,ge,me;;){if(O==u){Y=ne=fe=U="",me=null,ge=null,O=1/0;for(var ve=[],De=void 0,_e=0;_e<n.length;++_e){var Be=n[_e],qe=Be.marker;if(qe.type=="bookmark"&&Be.from==u&&qe.widgetNode)ve.push(qe);else if(Be.from<=u&&(Be.to==null||Be.to>u||qe.collapsed&&Be.to==u&&Be.from==u)){if(Be.to!=null&&Be.to!=u&&O>Be.to&&(O=Be.to,ne=""),qe.className&&(Y+=" "+qe.className),qe.css&&(U=(U?U+";":"")+qe.css),qe.startStyle&&Be.from==u&&(fe+=" "+qe.startStyle),qe.endStyle&&Be.to==O&&(De||(De=[])).push(qe.endStyle,Be.to),qe.title&&((me||(me={})).title=qe.title),qe.attributes)for(var ct in qe.attributes)(me||(me={}))[ct]=qe.attributes[ct];qe.collapsed&&(!ge||Ba(ge.marker,qe)<0)&&(ge=Be)}else Be.from>u&&O>Be.from&&(O=Be.from)}if(De)for(var It=0;It<De.length;It+=2)De[It+1]==O&&(ne+=" "+De[It]);if(!ge||ge.from==u)for(var kt=0;kt<ve.length;++kt)Qo(t,0,ve[kt]);if(ge&&(ge.from||0)==u){if(Qo(t,(ge.to==null?s+1:ge.to)-u,ge.marker,ge.from==null),ge.to==null)return;ge.to==u&&(ge=!1)}}if(u>=s)break;for(var sn=Math.min(s,O);;){if(C){var tn=u+C.length;if(!ge){var At=tn>sn?C.slice(0,sn-u):C;t.addToken(t,At,E?E+Y:Y,fe,u+At.length==O?ne:"",U,me)}if(tn>=sn){C=C.slice(sn-u),u=sn;break}u=tn,fe=""}C=i.slice(a,a=r[d++]),E=Yo(r[d++],t.cm.options)}}}function Jo(e,t,r){this.line=t,this.rest=gc(t),this.size=this.rest?Ye(we(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Wn(e,t)}function Bi(e,t,r){for(var n=[],i,a=t;a<r;a=i){var l=new Jo(e.doc,Ae(e.doc,a),a);i=a+l.size,n.push(l)}return n}var hr=null;function Sc(e){hr?hr.ops.push(e):e.ownsGroup=hr={ops:[e],delayedCallbacks:[]}}function Ac(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}function Ec(e,t){var r=e.ownsGroup;if(r)try{Ac(r)}finally{hr=null,t(r)}}var Ur=null;function Bt(e,t){var r=de(e,t);if(r.length){var n=Array.prototype.slice.call(arguments,2),i;hr?i=hr.delayedCallbacks:Ur?i=Ur:(i=Ur=[],setTimeout(Tc,0));for(var a=function(s){i.push(function(){return r[s].apply(null,n)})},l=0;l<r.length;++l)a(l)}}function Tc(){var e=Ur;Ur=null;for(var t=0;t<e.length;++t)e[t]()}function Vo(e,t,r,n){for(var i=0;i<t.changes.length;i++){var a=t.changes[i];a=="text"?Lc(e,t):a=="gutter"?ts(e,t,r,n):a=="class"?Oa(e,t):a=="widget"&&Mc(e,t,n)}t.changes=null}function qr(e){return e.node==e.text&&(e.node=P("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),k&&S<8&&(e.node.style.zIndex=2)),e.node}function Fc(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=qr(t);t.background=n.insertBefore(P("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function es(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):Zo(e,t)}function Lc(e,t){var r=t.text.className,n=es(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,Oa(e,t)):r&&(t.text.className=r)}function Oa(e,t){Fc(e,t),t.line.wrapClass?qr(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 ts(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=qr(t);t.gutterBackground=P("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var a=t.line.gutterMarkers;if(e.options.lineNumbers||a){var l=qr(t),s=t.gutter=P("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(s.setAttribute("aria-hidden","true"),e.display.input.setUneditable(s),l.insertBefore(s,t.text),t.line.gutterClass&&(s.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!a||!a["CodeMirror-linenumbers"])&&(t.lineNumber=s.appendChild(P("div",Aa(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),a)for(var u=0;u<e.display.gutterSpecs.length;++u){var d=e.display.gutterSpecs[u].className,C=a.hasOwnProperty(d)&&a[d];C&&s.appendChild(P("div",[C],"CodeMirror-gutter-elt","left: "+n.gutterLeft[d]+"px; width: "+n.gutterWidth[d]+"px"))}}}function Mc(e,t,r){t.alignable&&(t.alignable=null);for(var n=le("CodeMirror-linewidget"),i=t.node.firstChild,a=void 0;i;i=a)a=i.nextSibling,n.test(i.className)&&t.node.removeChild(i);ns(e,t,r)}function Bc(e,t,r,n){var i=es(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Oa(e,t),ts(e,t,r,n),ns(e,t,n),t.node}function ns(e,t,r){if(rs(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)rs(e,t.rest[n],t,r,!1)}function rs(e,t,r,n,i){if(t.widgets)for(var a=qr(r),l=0,s=t.widgets;l<s.length;++l){var u=s[l],d=P("div",[u.node],"CodeMirror-linewidget"+(u.className?" "+u.className:""));u.handleMouseEvents||d.setAttribute("cm-ignore-events","true"),Rc(u,d,r,n),e.display.input.setUneditable(d),i&&u.above?a.insertBefore(d,r.gutter||r.text):a.appendChild(d),Bt(u,"redraw")}}function Rc(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Gr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!Ee(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),Pe(t.display.measure,P("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function _n(e,t){for(var r=Mt(t);r!=e.wrapper;r=r.parentNode)if(!r||r.nodeType==1&&r.getAttribute("cm-ignore-events")=="true"||r.parentNode==e.sizer&&r!=e.mover)return!0}function Ri(e){return e.lineSpace.offsetTop}function Na(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function is(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Pe(e.measure,P("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function Sn(e){return je-e.display.nativeBarWidth}function Vn(e){return e.display.scroller.clientWidth-Sn(e)-e.display.barWidth}function Pa(e){return e.display.scroller.clientHeight-Sn(e)-e.display.barHeight}function _c(e,t,r){var n=e.options.lineWrapping,i=n&&Vn(e);if(!t.measure.heights||n&&t.measure.width!=i){var a=t.measure.heights=[];if(n){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),s=0;s<l.length-1;s++){var u=l[s],d=l[s+1];Math.abs(u.bottom-d.bottom)>2&&a.push((u.bottom+d.top)/2-r.top)}}a.push(r.bottom-r.top)}}function as(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(Ye(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Ic(e,t){t=mn(t);var r=Ye(t),n=e.display.externalMeasured=new Jo(e.doc,t,r);n.lineN=r;var i=n.built=Zo(e,n);return n.text=i.pre,Pe(e.display.lineMeasure,i.pre),n}function ls(e,t,r,n){return An(e,dr(e,t),r,n)}function za(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[nr(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function dr(e,t){var r=Ye(t),n=za(e,r);n&&!n.text?n=null:n&&n.changes&&(Vo(e,n,r,Ga(e)),e.curOp.forceUpdate=!0),n||(n=Ic(e,t));var i=as(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function An(e,t,r,n,i){t.before&&(r=-1);var a=r+(n||""),l;return t.cache.hasOwnProperty(a)?l=t.cache[a]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(_c(e,t.view,t.rect),t.hasHeights=!0),l=Nc(e,t,r,n),l.bogus||(t.cache[a]=l)),{left:l.left,right:l.right,top:i?l.rtop:l.top,bottom:i?l.rbottom:l.bottom}}var os={left:0,right:0,top:0,bottom:0};function ss(e,t,r){for(var n,i,a,l,s,u,d=0;d<e.length;d+=3)if(s=e[d],u=e[d+1],t<s?(i=0,a=1,l="left"):t<u?(i=t-s,a=i+1):(d==e.length-3||t==u&&e[d+3]>t)&&(a=u-s,i=a-1,t>=u&&(l="right")),i!=null){if(n=e[d+2],s==u&&r==(n.insertLeft?"left":"right")&&(l=r),r=="left"&&i==0)for(;d&&e[d-2]==e[d-3]&&e[d-1].insertLeft;)n=e[(d-=3)+2],l="left";if(r=="right"&&i==u-s)for(;d<e.length-3&&e[d+3]==e[d+4]&&!e[d+5].insertLeft;)n=e[(d+=3)+2],l="right";break}return{node:n,start:i,end:a,collapse:l,coverStart:s,coverEnd:u}}function Oc(e,t){var r=os;if(t=="left")for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function Nc(e,t,r,n){var i=ss(t.map,r,n),a=i.node,l=i.start,s=i.end,u=i.collapse,d;if(a.nodeType==3){for(var C=0;C<4;C++){for(;l&&o(t.line.text.charAt(i.coverStart+l));)--l;for(;i.coverStart+s<i.coverEnd&&o(t.line.text.charAt(i.coverStart+s));)++s;if(k&&S<9&&l==0&&s==i.coverEnd-i.coverStart?d=a.parentNode.getBoundingClientRect():d=Oc(ae(a,l,s).getClientRects(),n),d.left||d.right||l==0)break;s=l,l=l-1,u="right"}k&&S<11&&(d=Pc(e.display.measure,d))}else{l>0&&(u=n="right");var E;e.options.lineWrapping&&(E=a.getClientRects()).length>1?d=E[n=="right"?E.length-1:0]:d=a.getBoundingClientRect()}if(k&&S<9&&!l&&(!d||!d.left&&!d.right)){var U=a.parentNode.getClientRects()[0];U?d={left:U.left,right:U.left+gr(e.display),top:U.top,bottom:U.bottom}:d=os}for(var O=d.top-t.rect.top,Y=d.bottom-t.rect.top,ne=(O+Y)/2,fe=t.view.measure.heights,ge=0;ge<fe.length-1&&!(ne<fe[ge]);ge++);var me=ge?fe[ge-1]:0,ve=fe[ge],De={left:(u=="right"?d.right:d.left)-t.rect.left,right:(u=="left"?d.left:d.right)-t.rect.left,top:me,bottom:ve};return!d.left&&!d.right&&(De.bogus=!0),e.options.singleCursorHeightPerLine||(De.rtop=O,De.rbottom=Y),De}function Pc(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!ln(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function us(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t<e.rest.length;t++)e.measure.caches[t]={}}function fs(e){e.display.externalMeasure=null,Re(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)us(e.display.view[t])}function $r(e){fs(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function cs(e){return H&&Q?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function hs(e){return H&&Q?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function Ha(e){var t=mn(e),r=t.widgets,n=0;if(r)for(var i=0;i<r.length;++i)r[i].above&&(n+=Gr(r[i]));return n}function _i(e,t,r,n,i){if(!i){var a=Ha(t);r.top+=a,r.bottom+=a}if(n=="line")return r;n||(n="local");var l=Rn(t);if(n=="local"?l+=Ri(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var s=e.display.lineSpace.getBoundingClientRect();l+=s.top+(n=="window"?0:hs(g(e)));var u=s.left+(n=="window"?0:cs(g(e)));r.left+=u,r.right+=u}return r.top+=l,r.bottom+=l,r}function ds(e,t,r){if(r=="div")return t;var n=t.left,i=t.top;if(r=="page")n-=cs(g(e)),i-=hs(g(e));else if(r=="local"||!r){var a=e.display.sizer.getBoundingClientRect();n+=a.left,i+=a.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:i-l.top}}function Ii(e,t,r,n,i){return n||(n=Ae(e.doc,t.line)),_i(e,n,ls(e,n,t.ch,i),r)}function xn(e,t,r,n,i,a){n=n||Ae(e.doc,t.line),i||(i=dr(e,n));function l(Y,ne){var fe=An(e,i,Y,ne?"right":"left",a);return ne?fe.left=fe.right:fe.right=fe.left,_i(e,n,fe,r)}var s=F(n,e.doc.direction),u=t.ch,d=t.sticky;if(u>=n.text.length?(u=n.text.length,d="before"):u<=0&&(u=0,d="after"),!s)return l(d=="before"?u-1:u,d=="before");function C(Y,ne,fe){var ge=s[ne],me=ge.level==1;return l(fe?Y-1:Y,me!=fe)}var E=W(s,u,d),U=L,O=C(u,E,d=="before");return U!=null&&(O.other=C(u,U,d!="before")),O}function ps(e,t){var r=0;t=We(e.doc,t),e.options.lineWrapping||(r=gr(e.display)*t.ch);var n=Ae(e.doc,t.line),i=Rn(n)+Ri(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function Wa(e,t,r,n,i){var a=oe(e,t,r);return a.xRel=i,n&&(a.outside=n),a}function Ua(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return Wa(n.first,0,null,-1,-1);var i=Jn(n,r),a=n.first+n.size-1;if(i>a)return Wa(n.first+n.size-1,Ae(n,a).text.length,null,1,1);t<0&&(t=0);for(var l=Ae(n,i);;){var s=zc(e,l,i,t,r),u=dc(l,s.ch+(s.xRel>0||s.outside>0?1:0));if(!u)return s;var d=u.find(1);if(d.line==i)return d;l=Ae(n,i=d.line)}}function gs(e,t,r,n){n-=Ha(t);var i=t.text.length,a=w(function(l){return An(e,r,l-1).bottom<=n},i,0);return i=w(function(l){return An(e,r,l).top>n},a,i),{begin:a,end:i}}function vs(e,t,r,n){r||(r=dr(e,t));var i=_i(e,t,An(e,r,n),"line").top;return gs(e,t,r,i)}function qa(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function zc(e,t,r,n,i){i-=Rn(t);var a=dr(e,t),l=Ha(t),s=0,u=t.text.length,d=!0,C=F(t,e.doc.direction);if(C){var E=(e.options.lineWrapping?Wc:Hc)(e,t,r,a,C,n,i);d=E.level!=1,s=d?E.from:E.to-1,u=d?E.to:E.from-1}var U=null,O=null,Y=w(function(_e){var Be=An(e,a,_e);return Be.top+=l,Be.bottom+=l,qa(Be,n,i,!1)?(Be.top<=i&&Be.left<=n&&(U=_e,O=Be),!0):!1},s,u),ne,fe,ge=!1;if(O){var me=n-O.left<O.right-n,ve=me==d;Y=U+(ve?0:1),fe=ve?"after":"before",ne=me?O.left:O.right}else{!d&&(Y==u||Y==s)&&Y++,fe=Y==0?"after":Y==t.text.length?"before":An(e,a,Y-(d?1:0)).bottom+l<=i==d?"after":"before";var De=xn(e,oe(r,Y,fe),"line",t,a);ne=De.left,ge=i<De.top?-1:i>=De.bottom?1:0}return Y=h(t.text,Y,1),Wa(r,Y,fe,ge,n-ne)}function Hc(e,t,r,n,i,a,l){var s=w(function(E){var U=i[E],O=U.level!=1;return qa(xn(e,oe(r,O?U.to:U.from,O?"before":"after"),"line",t,n),a,l,!0)},0,i.length-1),u=i[s];if(s>0){var d=u.level!=1,C=xn(e,oe(r,d?u.from:u.to,d?"after":"before"),"line",t,n);qa(C,a,l,!0)&&C.top>l&&(u=i[s-1])}return u}function Wc(e,t,r,n,i,a,l){var s=gs(e,t,n,l),u=s.begin,d=s.end;/\s/.test(t.text.charAt(d-1))&&d--;for(var C=null,E=null,U=0;U<i.length;U++){var O=i[U];if(!(O.from>=d||O.to<=u)){var Y=O.level!=1,ne=An(e,n,Y?Math.min(d,O.to)-1:Math.max(u,O.from)).right,fe=ne<a?a-ne+1e9:ne-a;(!C||E>fe)&&(C=O,E=fe)}}return C||(C=i[i.length-1]),C.from<u&&(C={from:u,to:C.to,level:C.level}),C.to>d&&(C={from:C.from,to:d,level:C.level}),C}var er;function pr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(er==null){er=P("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)er.appendChild(document.createTextNode("x")),er.appendChild(P("br"));er.appendChild(document.createTextNode("x"))}Pe(e.measure,er);var r=er.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),Re(e.measure),r||1}function gr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=P("span","xxxxxxxxxx"),r=P("pre",[t],"CodeMirror-line-like");Pe(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Ga(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,a=t.gutters.firstChild,l=0;a;a=a.nextSibling,++l){var s=e.display.gutterSpecs[l].className;r[s]=a.offsetLeft+a.clientLeft+i,n[s]=a.clientWidth}return{fixedPos:$a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function $a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ms(e){var t=pr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/gr(e.display)-3);return function(i){if(Wn(e.doc,i))return 0;var a=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(a+=i.widgets[l].height);return r?a+(Math.ceil(i.text.length/n)||1)*t:a+t}}function ja(e){var t=e.doc,r=ms(e);t.iter(function(n){var i=r(n);i!=n.height&&cn(n,i)})}function tr(e,t,r,n){var i=e.display;if(!r&&Mt(t).getAttribute("cm-not-content")=="true")return null;var a,l,s=i.lineSpace.getBoundingClientRect();try{a=t.clientX-s.left,l=t.clientY-s.top}catch{return null}var u=Ua(e,a,l),d;if(n&&u.xRel>0&&(d=Ae(e.doc,u.line).text).length==u.ch){var C=Qe(d,d.length,e.options.tabSize)-d.length;u=oe(u.line,Math.max(0,Math.round((a-is(e.display).left)/gr(e.display))-C))}return u}function nr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,t<0)return n}function Vt(e,t,r,n){t==null&&(t=e.doc.first),r==null&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Bn&&Ra(e.doc,t)<i.viewTo&&qn(e);else if(r<=i.viewFrom)Bn&&Ko(e.doc,r+n)>i.viewFrom?qn(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)qn(e);else if(t<=i.viewFrom){var a=Oi(e,r,r+n,1);a?(i.view=i.view.slice(a.index),i.viewFrom=a.lineN,i.viewTo+=n):qn(e)}else if(r>=i.viewTo){var l=Oi(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):qn(e)}else{var s=Oi(e,t,t,-1),u=Oi(e,r,r+n,1);s&&u?(i.view=i.view.slice(0,s.index).concat(Bi(e,s.lineN,u.lineN)).concat(i.view.slice(u.index)),i.viewTo+=n):qn(e)}var d=i.externalMeasured;d&&(r<d.lineN?d.lineN+=n:t<d.lineN+d.size&&(i.externalMeasured=null))}function Un(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var a=n.view[nr(e,t)];if(a.node!=null){var l=a.changes||(a.changes=[]);Ue(l,r)==-1&&l.push(r)}}}function qn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Oi(e,t,r,n){var i=nr(e,t),a,l=e.display.view;if(!Bn||r==e.doc.first+e.doc.size)return{index:i,lineN:r};for(var s=e.display.viewFrom,u=0;u<i;u++)s+=l[u].size;if(s!=t){if(n>0){if(i==l.length-1)return null;a=s+l[i].size-t,i++}else a=s-t;t+=a,r+=a}for(;Ra(e.doc,r)!=r;){if(i==(n<0?0:l.length-1))return null;r+=n*l[i-(n<0?1:0)].size,i+=n}return{index:i,lineN:r}}function Uc(e,t,r){var n=e.display,i=n.view;i.length==0||t>=n.viewTo||r<=n.viewFrom?(n.view=Bi(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Bi(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(nr(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(Bi(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,nr(e,r)))),n.viewTo=r}function xs(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];!i.hidden&&(!i.node||i.changes)&&++r}return r}function jr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ys(e,t){t===void 0&&(t=!0);var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),a=n.selection=document.createDocumentFragment(),l=e.options.$customCursor;l&&(t=!0);for(var s=0;s<r.sel.ranges.length;s++)if(!(!t&&s==r.sel.primIndex)){var u=r.sel.ranges[s];if(!(u.from().line>=e.display.viewTo||u.to().line<e.display.viewFrom)){var d=u.empty();if(l){var C=l(e,u);C&&Xa(e,C,i)}else(d||e.options.showCursorWhenSelecting)&&Xa(e,u.head,i);d||qc(e,u,a)}}return n}function Xa(e,t,r){var n=xn(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(P("div"," ","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var a=Ii(e,t,"div",null,null),l=a.right-a.left;i.style.width=(l>0?l:e.defaultCharWidth())+"px"}if(n.other){var s=r.appendChild(P("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=n.other.left+"px",s.style.top=n.other.top+"px",s.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function Ni(e,t){return e.top-t.top||e.left-t.left}function qc(e,t,r){var n=e.display,i=e.doc,a=document.createDocumentFragment(),l=is(e.display),s=l.left,u=Math.max(n.sizerWidth,Vn(e)-n.sizer.offsetLeft)-l.right,d=i.direction=="ltr";function C(ve,De,_e,Be){De<0&&(De=0),De=Math.round(De),Be=Math.round(Be),a.appendChild(P("div",null,"CodeMirror-selected","position: absolute; left: "+ve+`px;
6
+ top: `+De+"px; width: "+(_e??u-ve)+`px;
7
+ height: `+(Be-De)+"px"))}function E(ve,De,_e){var Be=Ae(i,ve),qe=Be.text.length,ct,It;function kt(At,nn){return Ii(e,oe(ve,At),"div",Be,nn)}function sn(At,nn,Pt){var Ft=vs(e,Be,null,At),Et=nn=="ltr"==(Pt=="after")?"left":"right",Dt=Pt=="after"?Ft.begin:Ft.end-(/\s/.test(Be.text.charAt(Ft.end-1))?2:1);return kt(Dt,Et)[Et]}var tn=F(Be,i.direction);return T(tn,De||0,_e??qe,function(At,nn,Pt,Ft){var Et=Pt=="ltr",Dt=kt(At,Et?"left":"right"),rn=kt(nn-1,Et?"right":"left"),Tr=De==null&&At==0,Yn=_e==null&&nn==qe,Gt=Ft==0,En=!tn||Ft==tn.length-1;if(rn.top-Dt.top<=3){var Ot=(d?Tr:Yn)&&Gt,bl=(d?Yn:Tr)&&En,Nn=Ot?s:(Et?Dt:rn).left,or=bl?u:(Et?rn:Dt).right;C(Nn,Dt.top,or-Nn,Dt.bottom)}else{var sr,Xt,Fr,kl;Et?(sr=d&&Tr&&Gt?s:Dt.left,Xt=d?u:sn(At,Pt,"before"),Fr=d?s:sn(nn,Pt,"after"),kl=d&&Yn&&En?u:rn.right):(sr=d?sn(At,Pt,"before"):s,Xt=!d&&Tr&&Gt?u:Dt.right,Fr=!d&&Yn&&En?s:rn.left,kl=d?sn(nn,Pt,"after"):u),C(sr,Dt.top,Xt-sr,Dt.bottom),Dt.bottom<rn.top&&C(s,Dt.bottom,null,rn.top),C(Fr,rn.top,kl-Fr,rn.bottom)}(!ct||Ni(Dt,ct)<0)&&(ct=Dt),Ni(rn,ct)<0&&(ct=rn),(!It||Ni(Dt,It)<0)&&(It=Dt),Ni(rn,It)<0&&(It=rn)}),{start:ct,end:It}}var U=t.from(),O=t.to();if(U.line==O.line)E(U.line,U.ch,O.ch);else{var Y=Ae(i,U.line),ne=Ae(i,O.line),fe=mn(Y)==mn(ne),ge=E(U.line,U.ch,fe?Y.text.length+1:null).end,me=E(O.line,fe?0:null,O.ch).start;fe&&(ge.top<me.top-2?(C(ge.right,ge.top,null,ge.bottom),C(s,me.top,me.left,me.bottom)):C(ge.right,ge.top,me.left-ge.right,ge.bottom)),ge.bottom<me.top&&C(s,ge.bottom,null,me.top)}r.appendChild(a)}function Ka(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||vr(e),t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function bs(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Za(e))}function Ya(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&vr(e))},100)}function Za(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(ke(e,"focus",e,t),e.state.focused=!0,pt(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),z&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Ka(e))}function vr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(ke(e,"blur",e,t),e.state.focused=!1,Oe(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Pi(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,a=0,l=0;l<t.view.length;l++){var s=t.view[l],u=e.options.lineWrapping,d=void 0,C=0;if(!s.hidden){if(i+=s.line.height,k&&S<8){var E=s.node.offsetTop+s.node.offsetHeight;d=E-r,r=E}else{var U=s.node.getBoundingClientRect();d=U.bottom-U.top,!u&&s.text.firstChild&&(C=s.text.firstChild.getBoundingClientRect().right-U.left-1)}var O=s.line.height-d;if((O>.005||O<-.005)&&(i<n&&(a-=O),cn(s.line,d),ks(s.line),s.rest))for(var Y=0;Y<s.rest.length;Y++)ks(s.rest[Y]);if(C>e.display.sizerWidth){var ne=Math.ceil(C/gr(e.display));ne>e.display.maxLineLength&&(e.display.maxLineLength=ne,e.display.maxLine=s.line,e.display.maxLineChanged=!0)}}}Math.abs(a)>2&&(t.scroller.scrollTop+=a)}function ks(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function zi(e,t,r){var n=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Ri(e));var i=r&&r.bottom!=null?r.bottom:n+e.wrapper.clientHeight,a=Jn(t,n),l=Jn(t,i);if(r&&r.ensure){var s=r.ensure.from.line,u=r.ensure.to.line;s<a?(a=s,l=Jn(t,Rn(Ae(t,s))+e.wrapper.clientHeight)):Math.min(u,t.lastLine())>=l&&(a=Jn(t,Rn(Ae(t,u))-e.wrapper.clientHeight),l=u)}return{from:a,to:Math.max(l,a+1)}}function Gc(e,t){if(!ue(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null,a=r.wrapper.ownerDocument;if(t.top+n.top<0?i=!0:t.bottom+n.top>(a.defaultView.innerHeight||a.documentElement.clientHeight)&&(i=!1),i!=null&&!te){var l=P("div","​",null,`position: absolute;
8
+ top: `+(t.top-r.viewOffset-Ri(e.display))+`px;
9
+ height: `+(t.bottom-t.top+Sn(e)+r.barHeight)+`px;
10
+ left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(l),l.scrollIntoView(i),e.display.lineSpace.removeChild(l)}}}function $c(e,t,r,n){n==null&&(n=0);var i;!e.options.lineWrapping&&t==r&&(r=t.sticky=="before"?oe(t.line,t.ch+1,"before"):t,t=t.ch?oe(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var a=0;a<5;a++){var l=!1,s=xn(e,t),u=!r||r==t?s:xn(e,r);i={left:Math.min(s.left,u.left),top:Math.min(s.top,u.top)-n,right:Math.max(s.left,u.left),bottom:Math.max(s.bottom,u.bottom)+n};var d=Qa(e,i),C=e.doc.scrollTop,E=e.doc.scrollLeft;if(d.scrollTop!=null&&(Kr(e,d.scrollTop),Math.abs(e.doc.scrollTop-C)>1&&(l=!0)),d.scrollLeft!=null&&(rr(e,d.scrollLeft),Math.abs(e.doc.scrollLeft-E)>1&&(l=!0)),!l)break}return i}function jc(e,t){var r=Qa(e,t);r.scrollTop!=null&&Kr(e,r.scrollTop),r.scrollLeft!=null&&rr(e,r.scrollLeft)}function Qa(e,t){var r=e.display,n=pr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,a=Pa(e),l={};t.bottom-t.top>a&&(t.bottom=t.top+a);var s=e.doc.height+Na(r),u=t.top<n,d=t.bottom>s-n;if(t.top<i)l.scrollTop=u?0:t.top;else if(t.bottom>i+a){var C=Math.min(t.top,(d?s:t.bottom)-a);C!=i&&(l.scrollTop=C)}var E=e.options.fixedGutter?0:r.gutters.offsetWidth,U=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-E,O=Vn(e)-r.gutters.offsetWidth,Y=t.right-t.left>O;return Y&&(t.right=t.left+O),t.left<10?l.scrollLeft=0:t.left<U?l.scrollLeft=Math.max(0,t.left+E-(Y?0:10)):t.right>O+U-3&&(l.scrollLeft=t.right+(Y?0:10)-O),l}function Ja(e,t){t!=null&&(Hi(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function mr(e){Hi(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Xr(e,t,r){(t!=null||r!=null)&&Hi(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function Xc(e,t){Hi(e),e.curOp.scrollToPos=t}function Hi(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=ps(e,t.from),n=ps(e,t.to);Ds(e,r,n,t.margin)}}function Ds(e,t,r,n){var i=Qa(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Xr(e,i.scrollLeft,i.scrollTop)}function Kr(e,t){Math.abs(e.doc.scrollTop-t)<2||(x||el(e,{top:t}),ws(e,t,!0),x&&el(e),Qr(e,100))}function ws(e,t,r){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function rr(e,t,r,n){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)&&(e.doc.scrollLeft=t,Ts(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Yr(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Na(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Sn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var ir=function(e,t,r){this.cm=r;var n=this.vert=P("div",[P("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=P("div",[P("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),N(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),N(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,k&&S<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ir.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var a=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+a)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},ir.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ir.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ir.prototype.zeroWidthHack=function(){var e=K&&!re?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Je,this.disableVert=new Je},ir.prototype.enableZeroWidthBar=function(e,t,r){e.style.visibility="";function n(){var i=e.getBoundingClientRect(),a=r=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);a!=e?e.style.visibility="hidden":t.set(1e3,n)}t.set(1e3,n)},ir.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Zr=function(){};Zr.prototype.update=function(){return{bottom:0,right:0}},Zr.prototype.setScrollLeft=function(){},Zr.prototype.setScrollTop=function(){},Zr.prototype.clear=function(){};function xr(e,t){t||(t=Yr(e));var r=e.display.barWidth,n=e.display.barHeight;Cs(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Pi(e),Cs(e,Yr(e)),r=e.display.barWidth,n=e.display.barHeight}function Cs(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var Ss={native:ir,null:Zr};function As(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Oe(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ss[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),N(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?rr(e,t):Kr(e,t)},e),e.display.scrollbars.addClass&&pt(e.display.wrapper,e.display.scrollbars.addClass)}var Kc=0;function ar(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.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:++Kc,markArrays:null},Sc(e.curOp)}function lr(e){var t=e.curOp;t&&Ec(t,function(r){for(var n=0;n<r.ops.length;n++)r.ops[n].cm.curOp=null;Yc(r)})}function Yc(e){for(var t=e.ops,r=0;r<t.length;r++)Zc(t[r]);for(var n=0;n<t.length;n++)Qc(t[n]);for(var i=0;i<t.length;i++)Jc(t[i]);for(var a=0;a<t.length;a++)Vc(t[a]);for(var l=0;l<t.length;l++)eh(t[l])}function Zc(e){var t=e.cm,r=t.display;nh(t),e.updateMaxLine&&Ia(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Wi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Qc(e){e.updatedDisplay=e.mustUpdate&&Va(e.cm,e.update)}function Jc(e){var t=e.cm,r=t.display;e.updatedDisplay&&Pi(t),e.barMeasure=Yr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ls(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Sn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Vn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Vc(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&rr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==$e(J(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&xr(t,e.barMeasure),e.updatedDisplay&&nl(t,e.barMeasure),e.selectionChanged&&Ka(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&bs(e.cm)}function eh(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&Es(t,e.update),r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),e.scrollTop!=null&&ws(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&rr(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=$c(t,We(n,e.scrollToPos.from),We(n,e.scrollToPos.to),e.scrollToPos.margin);Gc(t,i)}var a=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(a)for(var s=0;s<a.length;++s)a[s].lines.length||ke(a[s],"hide");if(l)for(var u=0;u<l.length;++u)l[u].lines.length&&ke(l[u],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&ke(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function on(e,t){if(e.curOp)return t();ar(e);try{return t()}finally{lr(e)}}function Rt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);ar(e);try{return t.apply(e,arguments)}finally{lr(e)}}}function jt(e){return function(){if(this.curOp)return e.apply(this,arguments);ar(this);try{return e.apply(this,arguments)}finally{lr(this)}}}function _t(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);ar(t);try{return e.apply(this,arguments)}finally{lr(t)}}}function Qr(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,tt(th,e))}function th(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=Hr(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(a){if(n.line>=e.display.viewFrom){var l=a.styles,s=a.text.length>e.options.maxHighlightLength?yt(t.mode,n.state):null,u=_o(e,a,n,!0);s&&(n.state=s),a.styles=u.styles;var d=a.styleClasses,C=u.classes;C?a.styleClasses=C:d&&(a.styleClasses=null);for(var E=!l||l.length!=a.styles.length||d!=C&&(!d||!C||d.bgClass!=C.bgClass||d.textClass!=C.textClass),U=0;!E&&U<l.length;++U)E=l[U]!=a.styles[U];E&&i.push(n.line),a.stateAfter=n.save(),n.nextLine()}else a.text.length<=e.options.maxHighlightLength&&Fa(e,a.text,n),a.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return Qr(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&on(e,function(){for(var a=0;a<i.length;a++)Un(e,i[a],"text")})}}var Wi=function(e,t,r){var n=e.display;this.viewport=t,this.visible=zi(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Vn(e),this.force=r,this.dims=Ga(e),this.events=[]};Wi.prototype.signal=function(e,t){ze(e,t)&&this.events.push(arguments)},Wi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ke.apply(null,this.events[e])};function nh(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Sn(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Sn(e)+"px",t.scrollbarsClipped=!0)}function rh(e){if(e.hasFocus())return null;var t=$e(J(e));if(!t||!Ee(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=Ie(e).getSelection();n.anchorNode&&n.extend&&Ee(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}function ih(e){if(!(!e||!e.activeElt||e.activeElt==$e(Fe(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&Ee(document.body,e.anchorNode)&&Ee(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,r=t.defaultView.getSelection(),n=t.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),r.removeAllRanges(),r.addRange(n),r.extend(e.focusNode,e.focusOffset)}}function Va(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return qn(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&xs(e)==0)return!1;Fs(e)&&(qn(e),t.dims=Ga(e));var i=n.first+n.size,a=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<a&&a-r.viewFrom<20&&(a=Math.max(n.first,r.viewFrom)),r.viewTo>l&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),Bn&&(a=Ra(e.doc,a),l=Ko(e.doc,l));var s=a!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Uc(e,a,l),r.viewOffset=Rn(Ae(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var u=xs(e);if(!s&&u==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var d=rh(e);return u>4&&(r.lineDiv.style.display="none"),ah(e,r.updateLineNumbers,t.dims),u>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,ih(d),Re(r.cursorDiv),Re(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,s&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,Qr(e,400)),r.updateLineNumbers=null,!0}function Es(e,t){for(var r=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Vn(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+Na(e.display)-Pa(e),r.top)}),t.visible=zi(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=zi(e.display,e.doc,r));if(!Va(e,t))break;Pi(e);var i=Yr(e);jr(e),xr(e,i),nl(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function el(e,t){var r=new Wi(e,t);if(Va(e,r)){Pi(e),Es(e,r);var n=Yr(e);jr(e),xr(e,n),nl(e,n),r.finish()}}function ah(e,t,r){var n=e.display,i=e.options.lineNumbers,a=n.lineDiv,l=a.firstChild;function s(Y){var ne=Y.nextSibling;return z&&K&&e.display.currentWheelTarget==Y?Y.style.display="none":Y.parentNode.removeChild(Y),ne}for(var u=n.view,d=n.viewFrom,C=0;C<u.length;C++){var E=u[C];if(!E.hidden)if(!E.node||E.node.parentNode!=a){var U=Bc(e,E,d,r);a.insertBefore(U,l)}else{for(;l!=E.node;)l=s(l);var O=i&&t!=null&&t<=d&&E.lineNumber;E.changes&&(Ue(E.changes,"gutter")>-1&&(O=!1),Vo(e,E,d,r)),O&&(Re(E.lineNumber),E.lineNumber.appendChild(document.createTextNode(Aa(e.options,d)))),l=E.node.nextSibling}d+=E.size}for(;l;)l=s(l)}function tl(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Bt(e,"gutterChanged",e)}function nl(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Sn(e)+"px"}function Ts(e){var t=e.display,r=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var n=$a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,a=n+"px",l=0;l<r.length;l++)if(!r[l].hidden){e.options.fixedGutter&&(r[l].gutter&&(r[l].gutter.style.left=a),r[l].gutterBackground&&(r[l].gutterBackground.style.left=a));var s=r[l].alignable;if(s)for(var u=0;u<s.length;u++)s[u].style.left=a}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function Fs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=Aa(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(P("div",[P("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),a=i.firstChild.offsetWidth,l=i.offsetWidth-a;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(a,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",tl(e.display),!0}return!1}function rl(e,t){for(var r=[],n=!1,i=0;i<e.length;i++){var a=e[i],l=null;if(typeof a!="string"&&(l=a.style,a=a.className),a=="CodeMirror-linenumbers")if(t)n=!0;else continue;r.push({className:a,style:l})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function Ls(e){var t=e.gutters,r=e.gutterSpecs;Re(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var i=r[n],a=i.className,l=i.style,s=t.appendChild(P("div",null,"CodeMirror-gutter "+a));l&&(s.style.cssText=l),a=="CodeMirror-linenumbers"&&(e.lineGutter=s,s.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",tl(e)}function Jr(e){Ls(e.display),Vt(e),Ts(e)}function lh(e,t,r,n){var i=this;this.input=r,i.scrollbarFiller=P("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=P("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=ce("div",null,"CodeMirror-code"),i.selectionDiv=P("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=P("div",null,"CodeMirror-cursors"),i.measure=P("div",null,"CodeMirror-measure"),i.lineMeasure=P("div",null,"CodeMirror-measure"),i.lineSpace=ce("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var a=ce("div",[i.lineSpace],"CodeMirror-lines");i.mover=P("div",[a],null,"position: relative"),i.sizer=P("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=P("div",null,null,"position: absolute; height: "+je+"px; width: 1px;"),i.gutters=P("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=P("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=P("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),H&&ie===105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),k&&S<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!z&&!(x&&j)&&(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,i.gutterSpecs=rl(n.gutters,n.lineNumbers),Ls(i),r.init(i)}var Ui=0,In=null;k?In=-.53:x?In=15:H?In=-.7:ye&&(In=-1/3);function Ms(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),r==null&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:r==null&&(r=e.wheelDelta),{x:t,y:r}}function oh(e){var t=Ms(e);return t.x*=In,t.y*=In,t}function Bs(e,t){H&&ie==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var r=Ms(t),n=r.x,i=r.y,a=In;t.deltaMode===0&&(n=t.deltaX,i=t.deltaY,a=1);var l=e.display,s=l.scroller,u=s.scrollWidth>s.clientWidth,d=s.scrollHeight>s.clientHeight;if(n&&u||i&&d){if(i&&K&&z){e:for(var C=t.target,E=l.view;C!=s;C=C.parentNode)for(var U=0;U<E.length;U++)if(E[U].node==C){e.display.currentWheelTarget=C;break e}}if(n&&!x&&!ee&&a!=null){i&&d&&Kr(e,Math.max(0,s.scrollTop+i*a)),rr(e,Math.max(0,s.scrollLeft+n*a)),(!i||i&&d)&&Le(t),l.wheelStartX=null;return}if(i&&a!=null){var O=i*a,Y=e.doc.scrollTop,ne=Y+l.wrapper.clientHeight;O<0?Y=Math.max(0,Y+O-50):ne=Math.min(e.doc.height,ne+O+50),el(e,{top:Y,bottom:ne})}Ui<20&&t.deltaMode!==0&&(l.wheelStartX==null?(l.wheelStartX=s.scrollLeft,l.wheelStartY=s.scrollTop,l.wheelDX=n,l.wheelDY=i,setTimeout(function(){if(l.wheelStartX!=null){var fe=s.scrollLeft-l.wheelStartX,ge=s.scrollTop-l.wheelStartY,me=ge&&l.wheelDY&&ge/l.wheelDY||fe&&l.wheelDX&&fe/l.wheelDX;l.wheelStartX=l.wheelStartY=null,me&&(In=(In*Ui+me)/(Ui+1),++Ui)}},200)):(l.wheelDX+=n,l.wheelDY+=i))}}var hn=function(e,t){this.ranges=e,this.primIndex=t};hn.prototype.primary=function(){return this.ranges[this.primIndex]},hn.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var r=this.ranges[t],n=e.ranges[t];if(!Ea(r.anchor,n.anchor)||!Ea(r.head,n.head))return!1}return!0},hn.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new et(Ta(this.ranges[t].anchor),Ta(this.ranges[t].head));return new hn(e,this.primIndex)},hn.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},hn.prototype.contains=function(e,t){t||(t=e);for(var r=0;r<this.ranges.length;r++){var n=this.ranges[r];if(He(t,n.from())>=0&&He(e,n.to())<=0)return r}return-1};var et=function(e,t){this.anchor=e,this.head=t};et.prototype.from=function(){return Si(this.anchor,this.head)},et.prototype.to=function(){return Ci(this.anchor,this.head)},et.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function yn(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(U,O){return He(U.from(),O.from())}),r=Ue(t,i);for(var a=1;a<t.length;a++){var l=t[a],s=t[a-1],u=He(s.to(),l.from());if(n&&!l.empty()?u>0:u>=0){var d=Si(s.from(),l.from()),C=Ci(s.to(),l.to()),E=s.empty()?l.from()==l.head:s.from()==s.head;a<=r&&--r,t.splice(--a,2,new et(E?C:d,E?d:C))}}return new hn(t,r)}function Gn(e,t){return new hn([new et(e,t||e)],0)}function $n(e){return e.text?oe(e.from.line+e.text.length-1,we(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Rs(e,t){if(He(e,t.from)<0)return e;if(He(e,t.to)<=0)return $n(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=$n(t).ch-t.to.ch),oe(r,n)}function il(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new et(Rs(i.anchor,t),Rs(i.head,t)))}return yn(e.cm,r,e.sel.primIndex)}function _s(e,t,r){return e.line==t.line?oe(r.line,e.ch-t.ch+r.ch):oe(r.line+(e.line-t.line),e.ch)}function sh(e,t,r){for(var n=[],i=oe(e.first,0),a=i,l=0;l<t.length;l++){var s=t[l],u=_s(s.from,i,a),d=_s($n(s),i,a);if(i=s.to,a=d,r=="around"){var C=e.sel.ranges[l],E=He(C.head,C.anchor)<0;n[l]=new et(E?d:u,E?u:d)}else n[l]=new et(u,u)}return new hn(n,e.sel.primIndex)}function al(e){e.doc.mode=he(e.options,e.doc.modeOption),Vr(e)}function Vr(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,Qr(e,100),e.state.modeGen++,e.curOp&&Vt(e)}function Is(e,t){return t.from.ch==0&&t.to.ch==0&&we(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ll(e,t,r,n){function i(me){return r?r[me]:null}function a(me,ve,De){vc(me,ve,De,n),Bt(me,"change",me,t)}function l(me,ve){for(var De=[],_e=me;_e<ve;++_e)De.push(new cr(d[_e],i(_e),n));return De}var s=t.from,u=t.to,d=t.text,C=Ae(e,s.line),E=Ae(e,u.line),U=we(d),O=i(d.length-1),Y=u.line-s.line;if(t.full)e.insert(0,l(0,d.length)),e.remove(d.length,e.size-d.length);else if(Is(e,t)){var ne=l(0,d.length-1);a(E,E.text,O),Y&&e.remove(s.line,Y),ne.length&&e.insert(s.line,ne)}else if(C==E)if(d.length==1)a(C,C.text.slice(0,s.ch)+U+C.text.slice(u.ch),O);else{var fe=l(1,d.length-1);fe.push(new cr(U+C.text.slice(u.ch),O,n)),a(C,C.text.slice(0,s.ch)+d[0],i(0)),e.insert(s.line+1,fe)}else if(d.length==1)a(C,C.text.slice(0,s.ch)+d[0]+E.text.slice(u.ch),i(0)),e.remove(s.line+1,Y);else{a(C,C.text.slice(0,s.ch)+d[0],i(0)),a(E,U+E.text.slice(u.ch),O);var ge=l(1,d.length-1);Y>1&&e.remove(s.line+1,Y-1),e.insert(s.line+1,ge)}Bt(e,"change",e,t)}function jn(e,t,r){function n(i,a,l){if(i.linked)for(var s=0;s<i.linked.length;++s){var u=i.linked[s];if(u.doc!=a){var d=l&&u.sharedHist;r&&!d||(t(u.doc,d),n(u.doc,i,d))}}}n(e,null,!0)}function Os(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ja(e),al(e),Ns(e),e.options.direction=t.direction,e.options.lineWrapping||Ia(e),e.options.mode=t.modeOption,Vt(e)}function Ns(e){(e.doc.direction=="rtl"?pt:Oe)(e.display.lineDiv,"CodeMirror-rtl")}function uh(e){on(e,function(){Ns(e),Vt(e)})}function qi(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function ol(e,t){var r={from:Ta(t.from),to:$n(t),text:vn(e,t.from,t.to)};return Hs(e,r,t.from.line,t.to.line+1),jn(e,function(n){return Hs(n,r,t.from.line,t.to.line+1)},!0),r}function Ps(e){for(;e.length;){var t=we(e);if(t.ranges)e.pop();else break}}function fh(e,t){if(t)return Ps(e.done),we(e.done);if(e.done.length&&!we(e.done).ranges)return we(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),we(e.done)}function zs(e,t,r,n){var i=e.history;i.undone.length=0;var a=+new Date,l,s;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>a-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=fh(i,i.lastOp==n)))s=we(l.changes),He(t.from,t.to)==0&&He(t.from,s.to)==0?s.to=$n(t):l.changes.push(ol(e,t));else{var u=we(i.done);for((!u||!u.ranges)&&Gi(e.sel,i.done),l={changes:[ol(e,t)],generation:i.generation},i.done.push(l);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,s||ke(e,"historyAdded")}function ch(e,t,r,n){var i=t.charAt(0);return i=="*"||i=="+"&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function hh(e,t,r,n){var i=e.history,a=n&&n.origin;r==i.lastSelOp||a&&i.lastSelOrigin==a&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==a||ch(e,a,we(i.done),t))?i.done[i.done.length-1]=t:Gi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=a,i.lastSelOp=r,n&&n.clearRedo!==!1&&Ps(i.undone)}function Gi(e,t){var r=we(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Hs(e,t,r,n){var i=t["spans_"+e.id],a=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(l){l.markedSpans&&((i||(i=t["spans_"+e.id]={}))[a]=l.markedSpans),++a})}function dh(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function ph(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(dh(r[i]));return n}function Ws(e,t){var r=ph(e,t),n=Ma(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var a=r[i],l=n[i];if(a&&l)e:for(var s=0;s<l.length;++s){for(var u=l[s],d=0;d<a.length;++d)if(a[d].marker==u.marker)continue e;a.push(u)}else l&&(r[i]=l)}return r}function yr(e,t,r){for(var n=[],i=0;i<e.length;++i){var a=e[i];if(a.ranges){n.push(r?hn.prototype.deepCopy.call(a):a);continue}var l=a.changes,s=[];n.push({changes:s});for(var u=0;u<l.length;++u){var d=l[u],C=void 0;if(s.push({from:d.from,to:d.to,text:d.text}),t)for(var E in d)(C=E.match(/^spans_(\d+)$/))&&Ue(t,Number(C[1]))>-1&&(we(s)[E]=d[E],delete d[E])}}return n}function sl(e,t,r,n){if(n){var i=e.anchor;if(r){var a=He(t,i)<0;a!=He(r,i)<0?(i=t,t=r):a!=He(t,r)<0&&(t=r)}return new et(i,t)}else return new et(r||t,t)}function $i(e,t,r,n,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),qt(e,new hn([sl(e.sel.primary(),t,r,i)],0),n)}function Us(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),a=0;a<e.sel.ranges.length;a++)n[a]=sl(e.sel.ranges[a],t[a],null,i);var l=yn(e.cm,n,e.sel.primIndex);qt(e,l,r)}function ul(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,qt(e,yn(e.cm,i,e.sel.primIndex),n)}function qs(e,t,r,n){qt(e,Gn(t,r),n)}function gh(e,t,r){var n={ranges:t.ranges,update:function(i){this.ranges=[];for(var a=0;a<i.length;a++)this.ranges[a]=new et(We(e,i[a].anchor),We(e,i[a].head))},origin:r&&r.origin};return ke(e,"beforeSelectionChange",e,n),e.cm&&ke(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?yn(e.cm,n.ranges,n.ranges.length-1):t}function Gs(e,t,r){var n=e.history.done,i=we(n);i&&i.ranges?(n[n.length-1]=t,ji(e,t,r)):qt(e,t,r)}function qt(e,t,r){ji(e,t,r),hh(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function ji(e,t,r){(ze(e,"beforeSelectionChange")||e.cm&&ze(e.cm,"beforeSelectionChange"))&&(t=gh(e,t,r));var n=r&&r.bias||(He(t.primary().head,e.sel.primary().head)<0?-1:1);$s(e,Xs(e,t,n,!0)),!(r&&r.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&mr(e.cm)}function $s(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ne(e.cm)),Bt(e,"cursorActivity",e))}function js(e){$s(e,Xs(e,e.sel,null,!1))}function Xs(e,t,r,n){for(var i,a=0;a<t.ranges.length;a++){var l=t.ranges[a],s=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[a],u=Xi(e,l.anchor,s&&s.anchor,r,n),d=l.head==l.anchor?u:Xi(e,l.head,s&&s.head,r,n);(i||u!=l.anchor||d!=l.head)&&(i||(i=t.ranges.slice(0,a)),i[a]=new et(u,d))}return i?yn(e.cm,i,t.primIndex):t}function br(e,t,r,n,i){var a=Ae(e,t.line);if(a.markedSpans)for(var l=0;l<a.markedSpans.length;++l){var s=a.markedSpans[l],u=s.marker,d="selectLeft"in u?!u.selectLeft:u.inclusiveLeft,C="selectRight"in u?!u.selectRight:u.inclusiveRight;if((s.from==null||(d?s.from<=t.ch:s.from<t.ch))&&(s.to==null||(C?s.to>=t.ch:s.to>t.ch))){if(i&&(ke(u,"beforeCursorEnter"),u.explicitlyCleared))if(a.markedSpans){--l;continue}else break;if(!u.atomic)continue;if(r){var E=u.find(n<0?1:-1),U=void 0;if((n<0?C:d)&&(E=Ks(e,E,-n,E&&E.line==t.line?a:null)),E&&E.line==t.line&&(U=He(E,r))&&(n<0?U<0:U>0))return br(e,E,t,n,i)}var O=u.find(n<0?-1:1);return(n<0?d:C)&&(O=Ks(e,O,n,O.line==t.line?a:null)),O?br(e,O,t,n,i):null}}return t}function Xi(e,t,r,n,i){var a=n||1,l=br(e,t,r,a,i)||!i&&br(e,t,r,a,!0)||br(e,t,r,-a,i)||!i&&br(e,t,r,-a,!0);return l||(e.cantEdit=!0,oe(e.first,0))}function Ks(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?We(e,oe(t.line-1)):null:r>0&&t.ch==(n||Ae(e,t.line)).text.length?t.line<e.first+e.size-1?oe(t.line+1,0):null:new oe(t.line,t.ch+r)}function Ys(e){e.setSelection(oe(e.firstLine(),0),oe(e.lastLine()),ht)}function Zs(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(i,a,l,s){i&&(n.from=We(e,i)),a&&(n.to=We(e,a)),l&&(n.text=l),s!==void 0&&(n.origin=s)}),ke(e,"beforeChange",e,n),e.cm&&ke(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function kr(e,t,r){if(e.cm){if(!e.cm.curOp)return Rt(e.cm,kr)(e,t,r);if(e.cm.state.suppressEdits)return}if(!((ze(e,"beforeChange")||e.cm&&ze(e.cm,"beforeChange"))&&(t=Zs(e,t,!0),!t))){var n=Wo&&!r&&hc(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)Qs(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else Qs(e,t)}}function Qs(e,t){if(!(t.text.length==1&&t.text[0]==""&&He(t.from,t.to)==0)){var r=il(e,t);zs(e,t,r,e.cm?e.cm.curOp.id:NaN),ei(e,t,r,Ma(e,t));var n=[];jn(e,function(i,a){!a&&Ue(n,i.history)==-1&&(tu(i.history,t),n.push(i.history)),ei(i,t,null,Ma(i,t))})}}function Ki(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!(n&&!r)){for(var i=e.history,a,l=e.sel,s=t=="undo"?i.done:i.undone,u=t=="undo"?i.undone:i.done,d=0;d<s.length&&(a=s[d],!(r?a.ranges&&!a.equals(e.sel):!a.ranges));d++);if(d!=s.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(a=s.pop(),a.ranges){if(Gi(a,u),r&&!a.equals(e.sel)){qt(e,a,{clearRedo:!1});return}l=a}else if(n){s.push(a);return}else break;var C=[];Gi(l,u),u.push({changes:C,generation:i.generation}),i.generation=a.generation||++i.maxGeneration;for(var E=ze(e,"beforeChange")||e.cm&&ze(e.cm,"beforeChange"),U=function(ne){var fe=a.changes[ne];if(fe.origin=t,E&&!Zs(e,fe,!1))return s.length=0,{};C.push(ol(e,fe));var ge=ne?il(e,fe):we(s);ei(e,fe,ge,Ws(e,fe)),!ne&&e.cm&&e.cm.scrollIntoView({from:fe.from,to:$n(fe)});var me=[];jn(e,function(ve,De){!De&&Ue(me,ve.history)==-1&&(tu(ve.history,fe),me.push(ve.history)),ei(ve,fe,null,Ws(ve,fe))})},O=a.changes.length-1;O>=0;--O){var Y=U(O);if(Y)return Y.v}}}}function Js(e,t){if(t!=0&&(e.first+=t,e.sel=new hn(xt(e.sel.ranges,function(i){return new et(oe(i.anchor.line+t,i.anchor.ch),oe(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){Vt(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)Un(e.cm,n,"gutter")}}function ei(e,t,r,n){if(e.cm&&!e.cm.curOp)return Rt(e.cm,ei)(e,t,r,n);if(t.to.line<e.first){Js(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);Js(e,i),t={from:oe(e.first,0),to:oe(t.to.line+i,t.to.ch),text:[we(t.text)],origin:t.origin}}var a=e.lastLine();t.to.line>a&&(t={from:t.from,to:oe(a,Ae(e,a).text.length),text:[t.text[0]],origin:t.origin}),t.removed=vn(e,t.from,t.to),r||(r=il(e,t)),e.cm?vh(e.cm,t,n):ll(e,t,n),ji(e,r,ht),e.cantEdit&&Xi(e,oe(e.firstLine(),0))&&(e.cantEdit=!1)}}function vh(e,t,r){var n=e.doc,i=e.display,a=t.from,l=t.to,s=!1,u=a.line;e.options.lineWrapping||(u=Ye(mn(Ae(n,a.line))),n.iter(u,l.line+1,function(O){if(O==i.maxLine)return s=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Ne(e),ll(n,t,r,ms(e)),e.options.lineWrapping||(n.iter(u,a.line+t.text.length,function(O){var Y=Mi(O);Y>i.maxLineLength&&(i.maxLine=O,i.maxLineLength=Y,i.maxLineChanged=!0,s=!1)}),s&&(e.curOp.updateMaxLine=!0)),ac(n,a.line),Qr(e,400);var d=t.text.length-(l.line-a.line)-1;t.full?Vt(e):a.line==l.line&&t.text.length==1&&!Is(e.doc,t)?Un(e,a.line,"text"):Vt(e,a.line,l.line+1,d);var C=ze(e,"changes"),E=ze(e,"change");if(E||C){var U={from:a,to:l,text:t.text,removed:t.removed,origin:t.origin};E&&Bt(e,"change",e,U),C&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(U)}e.display.selForContextMenu=null}function Dr(e,t,r,n,i){var a;n||(n=r),He(n,r)<0&&(a=[n,r],r=a[0],n=a[1]),typeof t=="string"&&(t=e.splitLines(t)),kr(e,{from:r,to:n,text:t,origin:i})}function Vs(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function eu(e,t,r,n){for(var i=0;i<e.length;++i){var a=e[i],l=!0;if(a.ranges){a.copied||(a=e[i]=a.deepCopy(),a.copied=!0);for(var s=0;s<a.ranges.length;s++)Vs(a.ranges[s].anchor,t,r,n),Vs(a.ranges[s].head,t,r,n);continue}for(var u=0;u<a.changes.length;++u){var d=a.changes[u];if(r<d.from.line)d.from=oe(d.from.line+n,d.from.ch),d.to=oe(d.to.line+n,d.to.ch);else if(t<=d.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}function tu(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;eu(e.done,r,n,i),eu(e.undone,r,n,i)}function ti(e,t,r,n){var i=t,a=t;return typeof t=="number"?a=Ae(e,Bo(e,t)):i=Ye(t),i==null?null:(n(a,i)&&e.cm&&Un(e.cm,i,r),a)}function ni(e){this.lines=e,this.parent=null;for(var t=0,r=0;r<e.length;++r)e[r].parent=this,t+=e[r].height;this.height=t}ni.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=e,n=e+t;r<n;++r){var i=this.lines[r];this.height-=i.height,mc(i),Bt(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var n=0;n<t.length;++n)t[n].parent=this},iterN:function(e,t,r){for(var n=e+t;e<n;++e)if(r(this.lines[e]))return!0}};function ri(e){this.children=e;for(var t=0,r=0,n=0;n<e.length;++n){var i=e[n];t+=i.chunkSize(),r+=i.height,i.parent=this}this.size=t,this.height=r,this.parent=null}ri.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var r=0;r<this.children.length;++r){var n=this.children[r],i=n.chunkSize();if(e<i){var a=Math.min(t,i-e),l=n.height;if(n.removeInner(e,a),this.height-=l-n.height,i==a&&(this.children.splice(r--,1),n.parent=null),(t-=a)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ni))){var s=[];this.collapse(s),this.children=[new ni(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,r){this.size+=t.length,this.height+=r;for(var n=0;n<this.children.length;++n){var i=this.children[n],a=i.chunkSize();if(e<=a){if(i.insertInner(e,t,r),i.lines&&i.lines.length>50){for(var l=i.lines.length%25+25,s=l;s<i.lines.length;){var u=new ni(i.lines.slice(s,s+=25));i.height-=u.height,this.children.splice(++n,0,u),u.parent=this}i.lines=i.lines.slice(0,l),this.maybeSpill()}break}e-=a}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new ri(t);if(e.parent){e.size-=r.size,e.height-=r.height;var i=Ue(e.parent.children,e);e.parent.children.splice(i+1,0,r)}else{var n=new ri(e.children);n.parent=e,e.children=[n,r],e=n}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=0;n<this.children.length;++n){var i=this.children[n],a=i.chunkSize();if(e<a){var l=Math.min(t,a-e);if(i.iterN(e,l,r))return!0;if((t-=l)==0)break;e=0}else e-=a}}};var ii=function(e,t,r){if(r)for(var n in r)r.hasOwnProperty(n)&&(this[n]=r[n]);this.doc=e,this.node=t};ii.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,r=this.line,n=Ye(r);if(!(n==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(r.widgets=null);var a=Gr(this);cn(r,Math.max(0,r.height-a)),e&&(on(e,function(){nu(e,r,-a),Un(e,n,"widget")}),Bt(e,"lineWidgetCleared",e,this,n))}},ii.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=Gr(this)-t;i&&(Wn(this.doc,n)||cn(n,n.height+i),r&&on(r,function(){r.curOp.forceUpdate=!0,nu(r,n,i),Bt(r,"lineWidgetChanged",r,e,Ye(n))}))},Te(ii);function nu(e,t,r){Rn(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Ja(e,r)}function mh(e,t,r,n){var i=new ii(e,r,n),a=e.cm;return a&&i.noHScroll&&(a.display.alignWidgets=!0),ti(e,t,"widget",function(l){var s=l.widgets||(l.widgets=[]);if(i.insertAt==null?s.push(i):s.splice(Math.min(s.length,Math.max(0,i.insertAt)),0,i),i.line=l,a&&!Wn(e,l)){var u=Rn(l)<e.scrollTop;cn(l,l.height+Gr(i)),u&&Ja(a,i.height),a.curOp.forceUpdate=!0}return!0}),a&&Bt(a,"lineWidgetAdded",a,i,typeof t=="number"?t:Ye(t)),i}var ru=0,Xn=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ru};Xn.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&ar(e),ze(this,"clear")){var r=this.find();r&&Bt(this,"clear",r.from,r.to)}for(var n=null,i=null,a=0;a<this.lines.length;++a){var l=this.lines[a],s=Wr(l.markedSpans,this);e&&!this.collapsed?Un(e,Ye(l),"text"):e&&(s.to!=null&&(i=Ye(l)),s.from!=null&&(n=Ye(l))),l.markedSpans=sc(l.markedSpans,s),s.from==null&&this.collapsed&&!Wn(this.doc,l)&&e&&cn(l,pr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var u=0;u<this.lines.length;++u){var d=mn(this.lines[u]),C=Mi(d);C>e.display.maxLineLength&&(e.display.maxLine=d,e.display.maxLineLength=C,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Vt(e,n,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&js(e.doc)),e&&Bt(e,"markerCleared",e,this,n,i),t&&lr(e),this.parent&&this.parent.clear()}},Xn.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,n,i=0;i<this.lines.length;++i){var a=this.lines[i],l=Wr(a.markedSpans,this);if(l.from!=null&&(r=oe(t?a:Ye(a),l.from),e==-1))return r;if(l.to!=null&&(n=oe(t?a:Ye(a),l.to),e==1))return n}return r&&{from:r,to:n}},Xn.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;!t||!n||on(n,function(){var i=t.line,a=Ye(t.line),l=za(n,a);if(l&&(us(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Wn(r.doc,i)&&r.height!=null){var s=r.height;r.height=null;var u=Gr(r)-s;u&&cn(i,i.height+u)}Bt(n,"markerChanged",n,e)})},Xn.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Ue(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Xn.prototype.detachLine=function(e){if(this.lines.splice(Ue(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Te(Xn);function wr(e,t,r,n,i){if(n&&n.shared)return xh(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return Rt(e.cm,wr)(e,t,r,n,i);var a=new Xn(e,i),l=He(t,r);if(n&&Ze(n,a,!1),l>0||l==0&&a.clearWhenEmpty!==!1)return a;if(a.replacedWith&&(a.collapsed=!0,a.widgetNode=ce("span",[a.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||a.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(a.widgetNode.insertLeft=!0)),a.collapsed){if(Xo(e,t.line,t,r,a)||t.line!=r.line&&Xo(e,r.line,t,r,a))throw new Error("Inserting collapsed marker partially overlapping an existing one");oc()}a.addToHistory&&zs(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var s=t.line,u=e.cm,d;if(e.iter(s,r.line+1,function(E){u&&a.collapsed&&!u.options.lineWrapping&&mn(E)==u.display.maxLine&&(d=!0),a.collapsed&&s!=t.line&&cn(E,0),uc(E,new Ei(a,s==t.line?t.ch:null,s==r.line?r.ch:null),e.cm&&e.cm.curOp),++s}),a.collapsed&&e.iter(t.line,r.line+1,function(E){Wn(e,E)&&cn(E,0)}),a.clearOnEnter&&N(a,"beforeCursorEnter",function(){return a.clear()}),a.readOnly&&(lc(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),a.collapsed&&(a.id=++ru,a.atomic=!0),u){if(d&&(u.curOp.updateMaxLine=!0),a.collapsed)Vt(u,t.line,r.line+1);else if(a.className||a.startStyle||a.endStyle||a.css||a.attributes||a.title)for(var C=t.line;C<=r.line;C++)Un(u,C,"text");a.atomic&&js(u.doc),Bt(u,"markerAdded",u,a)}return a}var ai=function(e,t){this.markers=e,this.primary=t;for(var r=0;r<e.length;++r)e[r].parent=this};ai.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Bt(this,"clear")}},ai.prototype.find=function(e,t){return this.primary.find(e,t)},Te(ai);function xh(e,t,r,n,i){n=Ze(n),n.shared=!1;var a=[wr(e,t,r,n,i)],l=a[0],s=n.widgetNode;return jn(e,function(u){s&&(n.widgetNode=s.cloneNode(!0)),a.push(wr(u,We(u,t),We(u,r),n,i));for(var d=0;d<u.linked.length;++d)if(u.linked[d].isParent)return;l=we(a)}),new ai(a,l)}function iu(e){return e.findMarks(oe(e.first,0),e.clipPos(oe(e.lastLine())),function(t){return t.parent})}function yh(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),a=e.clipPos(i.from),l=e.clipPos(i.to);if(He(a,l)){var s=wr(e,a,l,n.primary,n.primary.type);n.markers.push(s),s.parent=n}}}function bh(e){for(var t=function(n){var i=e[n],a=[i.primary.doc];jn(i.primary.doc,function(u){return a.push(u)});for(var l=0;l<i.markers.length;l++){var s=i.markers[l];Ue(a,s.doc)==-1&&(s.parent=null,i.markers.splice(l--,1))}},r=0;r<e.length;r++)t(r)}var kh=0,en=function(e,t,r,n,i){if(!(this instanceof en))return new en(e,t,r,n,i);r==null&&(r=0),ri.call(this,[new ni([new cr("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var a=oe(r,0);this.sel=Gn(a),this.history=new qi(null),this.id=++kh,this.modeOption=t,this.lineSep=n,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ll(this,{from:a,to:a,text:e}),qt(this,Gn(a),ht)};en.prototype=G(ri.prototype,{constructor:en,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=St(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:_t(function(e){var t=oe(this.first,0),r=this.first+this.size-1;kr(this,{from:t,to:oe(r,Ae(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Xr(this.cm,0,0),qt(this,Gn(t),ht)}),replaceRange:function(e,t,r,n){t=We(this,t),r=r?We(this,r):t,Dr(this,e,t,r,n)},getRange:function(e,t,r){var n=vn(this,We(this,e),We(this,t));return r===!1?n:r===""?n.join(""):n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(zr(this,e))return Ae(this,e)},getLineNumber:function(e){return Ye(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=Ae(this,e)),mn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return We(this,e)},getCursor:function(e){var t=this.sel.primary(),r;return e==null||e=="head"?r=t.head:e=="anchor"?r=t.anchor:e=="end"||e=="to"||e===!1?r=t.to():r=t.from(),r},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:_t(function(e,t,r){qs(this,We(this,typeof e=="number"?oe(e,t||0):e),null,r)}),setSelection:_t(function(e,t,r){qs(this,We(this,e),We(this,t||e),r)}),extendSelection:_t(function(e,t,r){$i(this,We(this,e),t&&We(this,t),r)}),extendSelections:_t(function(e,t){Us(this,Ro(this,e),t)}),extendSelectionsBy:_t(function(e,t){var r=xt(this.sel.ranges,e);Us(this,Ro(this,r),t)}),setSelections:_t(function(e,t,r){if(e.length){for(var n=[],i=0;i<e.length;i++)n[i]=new et(We(this,e[i].anchor),We(this,e[i].head||e[i].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),qt(this,yn(this.cm,n,t),r)}}),addSelection:_t(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new et(We(this,e),We(this,t||e))),qt(this,yn(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t=this.sel.ranges,r,n=0;n<t.length;n++){var i=vn(this,t[n].from(),t[n].to());r=r?r.concat(i):i}return e===!1?r:r.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],r=this.sel.ranges,n=0;n<r.length;n++){var i=vn(this,r[n].from(),r[n].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[n]=i}return t},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:_t(function(e,t,r){for(var n=[],i=this.sel,a=0;a<i.ranges.length;a++){var l=i.ranges[a];n[a]={from:l.from(),to:l.to(),text:this.splitLines(e[a]),origin:r}}for(var s=t&&t!="end"&&sh(this,n,t),u=n.length-1;u>=0;u--)kr(this,n[u]);s?Gs(this,s):this.cm&&mr(this.cm)}),undo:_t(function(){Ki(this,"undo")}),redo:_t(function(){Ki(this,"redo")}),undoSelection:_t(function(){Ki(this,"undo",!0)}),redoSelection:_t(function(){Ki(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){var e=this;this.history=new qi(this.history),jn(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:yr(this.history.done),undone:yr(this.history.undone)}},setHistory:function(e){var t=this.history=new qi(this.history);t.done=yr(e.done.slice(0),null,!0),t.undone=yr(e.undone.slice(0),null,!0)},setGutterMarker:_t(function(e,t,r){return ti(this,e,"gutter",function(n){var i=n.gutterMarkers||(n.gutterMarkers={});return i[t]=r,!r&&m(i)&&(n.gutterMarkers=null),!0})}),clearGutter:_t(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&ti(t,r,"gutter",function(){return r.gutterMarkers[e]=null,m(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!zr(this,e)||(t=e,e=Ae(this,e),!e))return null}else if(t=Ye(e),t==null)return null;return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:_t(function(e,t,r){return ti(this,e,t=="gutter"?"gutter":"class",function(n){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[i])n[i]=r;else{if(le(r).test(n[i]))return!1;n[i]+=" "+r}return!0})}),removeLineClass:_t(function(e,t,r){return ti(this,e,t=="gutter"?"gutter":"class",function(n){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",a=n[i];if(a)if(r==null)n[i]=null;else{var l=a.match(le(r));if(!l)return!1;var s=l.index+l[0].length;n[i]=a.slice(0,l.index)+(!l.index||s==a.length?"":" ")+a.slice(s)||null}else return!1;return!0})}),addLineWidget:_t(function(e,t,r){return mh(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return wr(this,We(this,e),We(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=We(this,e),wr(this,e,e,r,"bookmark")},findMarksAt:function(e){e=We(this,e);var t=[],r=Ae(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=We(this,e),t=We(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(a){var l=a.markedSpans;if(l)for(var s=0;s<l.length;s++){var u=l[s];!(u.to!=null&&i==e.line&&e.ch>=u.to||u.from==null&&i!=e.line||u.from!=null&&i==t.line&&u.from>=t.ch)&&(!r||r(u.marker))&&n.push(u.marker.parent||u.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)r[n].from!=null&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(i){var a=i.text.length+n;if(a>e)return t=e,!0;e-=a,++r}),We(this,oe(r,t))},indexFromPos:function(e){e=We(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+r}),t},copy:function(e){var t=new en(St(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,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<r&&(r=e.to);var n=new en(St(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],yh(n,iu(this)),n},unlinkDoc:function(e){if(e instanceof mt&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var r=this.linked[t];if(r.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),bh(iu(this));break}}if(e.history==this.history){var n=[e.id];jn(e,function(i){return n.push(i.id)},!0),e.history=new qi(null),e.history.done=yr(this.history.done,n),e.history.undone=yr(this.history.undone,n)}},iterLinkedDocs:function(e){jn(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Ln(e)},lineSeparator:function(){return this.lineSep||`
11
+ `},setDirection:_t(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&uh(this.cm))})}),en.prototype.eachLine=en.prototype.iter;var au=0;function Dh(e){var t=this;if(lu(t),!(ue(t,e)||_n(t.display,e))){Le(e),k&&(au=+new Date);var r=tr(t,e,!0),n=e.dataTransfer.files;if(!(!r||t.isReadOnly()))if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,a=Array(i),l=0,s=function(){++l==i&&Rt(t,function(){r=We(t.doc,r);var O={from:r,to:r,text:t.doc.splitLines(a.filter(function(Y){return Y!=null}).join(t.doc.lineSeparator())),origin:"paste"};kr(t.doc,O),Gs(t.doc,Gn(We(t.doc,r),We(t.doc,$n(O))))})()},u=function(O,Y){if(t.options.allowDropFileTypes&&Ue(t.options.allowDropFileTypes,O.type)==-1){s();return}var ne=new FileReader;ne.onerror=function(){return s()},ne.onload=function(){var fe=ne.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(fe)){s();return}a[Y]=fe,s()},ne.readAsText(O)},d=0;d<n.length;d++)u(n[d],d);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var C=e.dataTransfer.getData("Text");if(C){var E;if(t.state.draggingText&&!t.state.draggingText.copy&&(E=t.listSelections()),ji(t.doc,Gn(r,r)),E)for(var U=0;U<E.length;++U)Dr(t.doc,"",E[U].anchor,E[U].head,"drag");t.replaceSelection(C,"around","paste"),t.display.input.focus()}}catch{}}}}function wh(e,t){if(k&&(!e.state.draggingText||+new Date-au<100)){vt(t);return}if(!(ue(e,t)||_n(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!ye)){var r=P("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",ee&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),ee&&r.parentNode.removeChild(r)}}function Ch(e,t){var r=tr(e,t);if(r){var n=document.createDocumentFragment();Xa(e,r,n),e.display.dragCursor||(e.display.dragCursor=P("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),Pe(e.display.dragCursor,n)}}function lu(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ou(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var i=t[n].CodeMirror;i&&r.push(i)}r.length&&r[0].operation(function(){for(var a=0;a<r.length;a++)e(r[a])})}}var su=!1;function Sh(){su||(Ah(),su=!0)}function Ah(){var e;N(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ou(Eh)},100))}),N(window,"blur",function(){return ou(vr)})}function Eh(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Kn={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"},li=0;li<10;li++)Kn[li+48]=Kn[li+96]=String(li);for(var Yi=65;Yi<=90;Yi++)Kn[Yi]=String.fromCharCode(Yi);for(var oi=1;oi<=12;oi++)Kn[oi+111]=Kn[oi+63235]="F"+oi;var On={};On.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"},On.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"},On.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"},On.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"]},On.default=K?On.macDefault:On.pcDefault;function Th(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,i,a,l=0;l<t.length-1;l++){var s=t[l];if(/^(cmd|meta|m)$/i.test(s))a=!0;else if(/^a(lt)?$/i.test(s))r=!0;else if(/^(c|ctrl|control)$/i.test(s))n=!0;else if(/^s(hift)?$/i.test(s))i=!0;else throw new Error("Unrecognized modifier name: "+s)}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),a&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function Fh(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if(n=="..."){delete e[r];continue}for(var i=xt(r.split(" "),Th),a=0;a<i.length;a++){var l=void 0,s=void 0;a==i.length-1?(s=i.join(" "),l=n):(s=i.slice(0,a+1).join(" "),l="...");var u=t[s];if(!u)t[s]=l;else if(u!=l)throw new Error("Inconsistent bindings for "+s)}delete e[r]}for(var d in t)e[d]=t[d];return e}function Cr(e,t,r,n){t=Zi(t);var i=t.call?t.call(e,n):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&r(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Cr(e,t.fallthrough,r,n);for(var a=0;a<t.fallthrough.length;a++){var l=Cr(e,t.fallthrough[a],r,n);if(l)return l}}}function uu(e){var t=typeof e=="string"?e:Kn[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function fu(e,t,r){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(xe?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(xe?t.ctrlKey:t.metaKey)&&n!="Mod"&&(e="Cmd-"+e),!r&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function cu(e,t){if(ee&&e.keyCode==34&&e.char)return!1;var r=Kn[e.keyCode];return r==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(r=e.code),fu(r,e,t))}function Zi(e){return typeof e=="string"?On[e]:e}function Sr(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var a=t(r[i]);n.length&&He(a.from,we(n).to)<=0;){var l=n.pop();if(He(l.from,a.from)<0){a.from=l.from;break}}n.push(a)}on(e,function(){for(var s=n.length-1;s>=0;s--)Dr(e.doc,"",n[s].from,n[s].to,"+delete");mr(e)})}function fl(e,t,r){var n=h(e.text,t+r,r);return n<0||n>e.text.length?null:n}function cl(e,t,r){var n=fl(e,t.ch,r);return n==null?null:new oe(t.line,n,r<0?"after":"before")}function hl(e,t,r,n,i){if(e){t.doc.direction=="rtl"&&(i=-i);var a=F(r,t.doc.direction);if(a){var l=i<0?we(a):a[0],s=i<0==(l.level==1),u=s?"after":"before",d;if(l.level>0||t.doc.direction=="rtl"){var C=dr(t,r);d=i<0?r.text.length-1:0;var E=An(t,C,d).top;d=w(function(U){return An(t,C,U).top==E},i<0==(l.level==1)?l.from:l.to-1,d),u=="before"&&(d=fl(r,d,1))}else d=i<0?l.to:l.from;return new oe(n,d,u)}}return new oe(n,i<0?r.text.length:0,i<0?"before":"after")}function Lh(e,t,r,n){var i=F(t,e.doc.direction);if(!i)return cl(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var a=W(i,r.ch,r.sticky),l=i[a];if(e.doc.direction=="ltr"&&l.level%2==0&&(n>0?l.to>r.ch:l.from<r.ch))return cl(t,r,n);var s=function(ge,me){return fl(t,ge instanceof oe?ge.ch:ge,me)},u,d=function(ge){return e.options.lineWrapping?(u=u||dr(e,t),vs(e,t,u,ge)):{begin:0,end:t.text.length}},C=d(r.sticky=="before"?s(r,-1):r.ch);if(e.doc.direction=="rtl"||l.level==1){var E=l.level==1==n<0,U=s(r,E?1:-1);if(U!=null&&(E?U<=l.to&&U<=C.end:U>=l.from&&U>=C.begin)){var O=E?"before":"after";return new oe(r.line,U,O)}}var Y=function(ge,me,ve){for(var De=function(ct,It){return It?new oe(r.line,s(ct,1),"before"):new oe(r.line,ct,"after")};ge>=0&&ge<i.length;ge+=me){var _e=i[ge],Be=me>0==(_e.level!=1),qe=Be?ve.begin:s(ve.end,-1);if(_e.from<=qe&&qe<_e.to||(qe=Be?_e.from:s(_e.to,-1),ve.begin<=qe&&qe<ve.end))return De(qe,Be)}},ne=Y(a+n,n,C);if(ne)return ne;var fe=n>0?C.end:s(C.begin,-1);return fe!=null&&!(n>0&&fe==t.text.length)&&(ne=Y(n>0?0:i.length-1,n,d(fe)),ne)?ne:null}var si={selectAll:Ys,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ht)},killLine:function(e){return Sr(e,function(t){if(t.empty()){var r=Ae(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:oe(t.head.line+1,0)}:{from:t.head,to:oe(t.head.line,r)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Sr(e,function(t){return{from:oe(t.from().line,0),to:We(e.doc,oe(t.to().line+1,0))}})},delLineLeft:function(e){return Sr(e,function(t){return{from:oe(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Sr(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return Sr(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(oe(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(oe(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return hu(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return du(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return Mh(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Ct)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Ct)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?du(e,t.head):n},Ct)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var a=r[i].from(),l=Qe(e.getLine(a.line),a.ch,n);t.push(Nt(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return on(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(t[n].empty()){var i=t[n].head,a=Ae(e.doc,i.line).text;if(a){if(i.ch==a.length&&(i=new oe(i.line,i.ch-1)),i.ch>0)i=new oe(i.line,i.ch+1),e.replaceRange(a.charAt(i.ch-1)+a.charAt(i.ch-2),oe(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=Ae(e.doc,i.line-1).text;l&&(i=new oe(i.line,1),e.replaceRange(a.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),oe(i.line-1,l.length-1),i,"+transpose"))}}r.push(new et(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return on(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);mr(e)})},openLine:function(e){return e.replaceSelection(`
12
+ `,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function hu(e,t){var r=Ae(e.doc,t),n=mn(r);return n!=r&&(t=Ye(n)),hl(!0,e,n,t,1)}function Mh(e,t){var r=Ae(e.doc,t),n=pc(r);return n!=r&&(t=Ye(n)),hl(!0,e,r,t,-1)}function du(e,t){var r=hu(e,t.line),n=Ae(e.doc,r.line),i=F(n,e.doc.direction);if(!i||i[0].level==0){var a=Math.max(r.ch,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=a&&t.ch;return oe(r.line,l?0:a,r.sticky)}return r}function Qi(e,t,r){if(typeof t=="string"&&(t=si[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=Ve}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function Bh(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=Cr(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&Cr(t,e.options.extraKeys,r,e)||Cr(t,e.options.keyMap,r,e)}var Rh=new Je;function ui(e,t,r,n){var i=e.state.keySeq;if(i){if(uu(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Rh.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),pu(e,i+" "+t,r,n))return!0}return pu(e,t,r,n)}function pu(e,t,r,n){var i=Bh(e,t,n);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&Bt(e,"keyHandled",e,t,r),(i=="handled"||i=="multi")&&(Le(r),Ka(e)),!!i}function gu(e,t){var r=cu(t,!0);return r?t.shiftKey&&!e.state.keySeq?ui(e,"Shift-"+r,t,function(n){return Qi(e,n,!0)})||ui(e,r,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return Qi(e,n)}):ui(e,r,t,function(n){return Qi(e,n)}):!1}function _h(e,t,r){return ui(e,"'"+r+"'",t,function(n){return Qi(e,n,!0)})}var dl=null;function vu(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=$e(J(t)),!ue(t,e))){k&&S<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var n=gu(t,e);ee&&(dl=n?r:null,!n&&r==88&&!ft&&(K?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),x&&!K&&!n&&r==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Ih(t)}}function Ih(e){var t=e.display.lineDiv;pt(t,"CodeMirror-crosshair");function r(n){(n.keyCode==18||!n.altKey)&&(Oe(t,"CodeMirror-crosshair"),be(document,"keyup",r),be(document,"mouseover",r))}N(document,"keyup",r),N(document,"mouseover",r)}function mu(e){e.keyCode==16&&(this.doc.sel.shift=!1),ue(this,e)}function xu(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(_n(t.display,e)||ue(t,e)||e.ctrlKey&&!e.altKey||K&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(ee&&r==dl){dl=null,Le(e);return}if(!(ee&&(!e.which||e.which<10)&&gu(t,e))){var i=String.fromCharCode(n??r);i!="\b"&&(_h(t,e,i)||t.display.input.onKeyPress(e))}}}var Oh=400,pl=function(e,t,r){this.time=e,this.pos=t,this.button=r};pl.prototype.compare=function(e,t,r){return this.time+Oh>e&&He(t,this.pos)==0&&r==this.button};var fi,ci;function Nh(e,t){var r=+new Date;return ci&&ci.compare(r,e,t)?(fi=ci=null,"triple"):fi&&fi.compare(r,e,t)?(ci=new pl(r,e,t),fi=null,"double"):(fi=new pl(r,e,t),ci=null,"single")}function yu(e){var t=this,r=t.display;if(!(ue(t,e)||r.activeTouch&&r.input.supportsTouch())){if(r.input.ensurePolled(),r.shift=e.shiftKey,_n(r,e)){z||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(!gl(t,e)){var n=tr(t,e),i=Tt(e),a=n?Nh(n,i):"single";Ie(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(n&&Ph(t,i,n,a,e))&&(i==1?n?Hh(t,n,a,e):Mt(e)==r.scroller&&Le(e):i==2?(n&&$i(t.doc,n),setTimeout(function(){return r.input.focus()},20)):i==3&&(Xe?t.display.input.onContextMenu(e):Ya(t)))}}}function Ph(e,t,r,n,i){var a="Click";return n=="double"?a="Double"+a:n=="triple"&&(a="Triple"+a),a=(t==1?"Left":t==2?"Middle":"Right")+a,ui(e,fu(a,i),i,function(l){if(typeof l=="string"&&(l=si[l]),!l)return!1;var s=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),s=l(e,r)!=Ve}finally{e.state.suppressEdits=!1}return s})}function zh(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(i.unit==null){var a=se?r.shiftKey&&r.metaKey:r.altKey;i.unit=a?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey),i.addNew==null&&(i.addNew=K?r.metaKey:r.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(K?r.altKey:r.ctrlKey)),i}function Hh(e,t,r,n){k?setTimeout(tt(bs,e),0):e.curOp.focus=$e(J(e));var i=zh(e,r,n),a=e.doc.sel,l;e.options.dragDrop&&Pn&&!e.isReadOnly()&&r=="single"&&(l=a.contains(t))>-1&&(He((l=a.ranges[l]).from(),t)<0||t.xRel>0)&&(He(l.to(),t)>0||t.xRel<0)?Wh(e,n,t,i):Uh(e,n,t,i)}function Wh(e,t,r,n){var i=e.display,a=!1,l=Rt(e,function(d){z&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Ya(e)),be(i.wrapper.ownerDocument,"mouseup",l),be(i.wrapper.ownerDocument,"mousemove",s),be(i.scroller,"dragstart",u),be(i.scroller,"drop",l),a||(Le(d),n.addNew||$i(e.doc,r,null,null,n.extend),z&&!ye||k&&S==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),s=function(d){a=a||Math.abs(t.clientX-d.clientX)+Math.abs(t.clientY-d.clientY)>=10},u=function(){return a=!0};z&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,N(i.wrapper.ownerDocument,"mouseup",l),N(i.wrapper.ownerDocument,"mousemove",s),N(i.scroller,"dragstart",u),N(i.scroller,"drop",l),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function bu(e,t,r){if(r=="char")return new et(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new et(oe(t.line,0),We(e.doc,oe(t.line+1,0)));var n=r(e,t);return new et(n.from,n.to)}function Uh(e,t,r,n){k&&Ya(e);var i=e.display,a=e.doc;Le(t);var l,s,u=a.sel,d=u.ranges;if(n.addNew&&!n.extend?(s=a.sel.contains(r),s>-1?l=d[s]:l=new et(r,r)):(l=a.sel.primary(),s=a.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new et(r,r)),r=tr(e,t,!0,!0),s=-1;else{var C=bu(e,r,n.unit);n.extend?l=sl(l,C.anchor,C.head,n.extend):l=C}n.addNew?s==-1?(s=d.length,qt(a,yn(e,d.concat([l]),s),{scroll:!1,origin:"*mouse"})):d.length>1&&d[s].empty()&&n.unit=="char"&&!n.extend?(qt(a,yn(e,d.slice(0,s).concat(d.slice(s+1)),0),{scroll:!1,origin:"*mouse"}),u=a.sel):ul(a,s,l,Ce):(s=0,qt(a,new hn([l],0),Ce),u=a.sel);var E=r;function U(ve){if(He(E,ve)!=0)if(E=ve,n.unit=="rectangle"){for(var De=[],_e=e.options.tabSize,Be=Qe(Ae(a,r.line).text,r.ch,_e),qe=Qe(Ae(a,ve.line).text,ve.ch,_e),ct=Math.min(Be,qe),It=Math.max(Be,qe),kt=Math.min(r.line,ve.line),sn=Math.min(e.lastLine(),Math.max(r.line,ve.line));kt<=sn;kt++){var tn=Ae(a,kt).text,At=Lt(tn,ct,_e);ct==It?De.push(new et(oe(kt,At),oe(kt,At))):tn.length>At&&De.push(new et(oe(kt,At),oe(kt,Lt(tn,It,_e))))}De.length||De.push(new et(r,r)),qt(a,yn(e,u.ranges.slice(0,s).concat(De),s),{origin:"*mouse",scroll:!1}),e.scrollIntoView(ve)}else{var nn=l,Pt=bu(e,ve,n.unit),Ft=nn.anchor,Et;He(Pt.anchor,Ft)>0?(Et=Pt.head,Ft=Si(nn.from(),Pt.anchor)):(Et=Pt.anchor,Ft=Ci(nn.to(),Pt.head));var Dt=u.ranges.slice(0);Dt[s]=qh(e,new et(We(a,Ft),Et)),qt(a,yn(e,Dt,s),Ce)}}var O=i.wrapper.getBoundingClientRect(),Y=0;function ne(ve){var De=++Y,_e=tr(e,ve,!0,n.unit=="rectangle");if(_e)if(He(_e,E)!=0){e.curOp.focus=$e(J(e)),U(_e);var Be=zi(i,a);(_e.line>=Be.to||_e.line<Be.from)&&setTimeout(Rt(e,function(){Y==De&&ne(ve)}),150)}else{var qe=ve.clientY<O.top?-20:ve.clientY>O.bottom?20:0;qe&&setTimeout(Rt(e,function(){Y==De&&(i.scroller.scrollTop+=qe,ne(ve))}),50)}}function fe(ve){e.state.selectingText=!1,Y=1/0,ve&&(Le(ve),i.input.focus()),be(i.wrapper.ownerDocument,"mousemove",ge),be(i.wrapper.ownerDocument,"mouseup",me),a.history.lastSelOrigin=null}var ge=Rt(e,function(ve){ve.buttons===0||!Tt(ve)?fe(ve):ne(ve)}),me=Rt(e,fe);e.state.selectingText=me,N(i.wrapper.ownerDocument,"mousemove",ge),N(i.wrapper.ownerDocument,"mouseup",me)}function qh(e,t){var r=t.anchor,n=t.head,i=Ae(e.doc,r.line);if(He(r,n)==0&&r.sticky==n.sticky)return t;var a=F(i);if(!a)return t;var l=W(a,r.ch,r.sticky),s=a[l];if(s.from!=r.ch&&s.to!=r.ch)return t;var u=l+(s.from==r.ch==(s.level!=1)?0:1);if(u==0||u==a.length)return t;var d;if(n.line!=r.line)d=(n.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var C=W(a,n.ch,n.sticky),E=C-l||(n.ch-r.ch)*(s.level==1?-1:1);C==u-1||C==u?d=E<0:d=E>0}var U=a[u+(d?-1:0)],O=d==(U.level==1),Y=O?U.from:U.to,ne=O?"after":"before";return r.ch==Y&&r.sticky==ne?t:new et(new oe(r.line,Y,ne),n)}function ku(e,t,r,n){var i,a;if(t.touches)i=t.touches[0].clientX,a=t.touches[0].clientY;else try{i=t.clientX,a=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Le(t);var l=e.display,s=l.lineDiv.getBoundingClientRect();if(a>s.bottom||!ze(e,r))return rt(t);a-=s.top-l.viewOffset;for(var u=0;u<e.display.gutterSpecs.length;++u){var d=l.gutters.childNodes[u];if(d&&d.getBoundingClientRect().right>=i){var C=Jn(e.doc,a),E=e.display.gutterSpecs[u];return ke(e,r,e,C,E.className,t),rt(t)}}}function gl(e,t){return ku(e,t,"gutterClick",!0)}function Du(e,t){_n(e.display,t)||Gh(e,t)||ue(e,t,"contextmenu")||Xe||e.display.input.onContextMenu(t)}function Gh(e,t){return ze(e,"gutterContextMenu")?ku(e,t,"gutterContextMenu",!1):!1}function wu(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),$r(e)}var Ar={toString:function(){return"CodeMirror.Init"}},Cu={},Ji={};function $h(e){var t=e.optionHandlers;function r(n,i,a,l){e.defaults[n]=i,a&&(t[n]=l?function(s,u,d){d!=Ar&&a(s,u,d)}:a)}e.defineOption=r,e.Init=Ar,r("value","",function(n,i){return n.setValue(i)},!0),r("mode",null,function(n,i){n.doc.modeOption=i,al(n)},!0),r("indentUnit",2,al,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){Vr(n),$r(n),Vt(n)},!0),r("lineSeparator",null,function(n,i){if(n.doc.lineSep=i,!!i){var a=[],l=n.doc.first;n.doc.iter(function(u){for(var d=0;;){var C=u.text.indexOf(i,d);if(C==-1)break;d=C+i.length,a.push(oe(l,C))}l++});for(var s=a.length-1;s>=0;s--)Dr(n.doc,i,a[s],oe(a[s].line,a[s].ch+i.length))}}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(n,i,a){n.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),a!=Ar&&n.refresh()}),r("specialCharPlaceholder",bc,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",j?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(n,i){return n.getInputField().spellcheck=i},!0),r("autocorrect",!1,function(n,i){return n.getInputField().autocorrect=i},!0),r("autocapitalize",!1,function(n,i){return n.getInputField().autocapitalize=i},!0),r("rtlMoveVisually",!V),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){wu(n),Jr(n)},!0),r("keyMap","default",function(n,i,a){var l=Zi(i),s=a!=Ar&&Zi(a);s&&s.detach&&s.detach(n,l),l.attach&&l.attach(n,s||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Xh,!0),r("gutters",[],function(n,i){n.display.gutterSpecs=rl(i,n.options.lineNumbers),Jr(n)},!0),r("fixedGutter",!0,function(n,i){n.display.gutters.style.left=i?$a(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return xr(n)},!0),r("scrollbarStyle","native",function(n){As(n),xr(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),r("lineNumbers",!1,function(n,i){n.display.gutterSpecs=rl(n.options.gutters,i),Jr(n)},!0),r("firstLineNumber",1,Jr,!0),r("lineNumberFormatter",function(n){return n},Jr,!0),r("showCursorWhenSelecting",!1,jr,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,i){i=="nocursor"&&(vr(n),n.display.input.blur()),n.display.input.readOnlyChanged(i)}),r("screenReaderLabel",null,function(n,i){i=i===""?null:i,n.display.input.screenReaderLabelChanged(i)}),r("disableInput",!1,function(n,i){i||n.display.input.reset()},!0),r("dragDrop",!0,jh),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,jr,!0),r("singleCursorHeightPerLine",!0,jr,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Vr,!0),r("addModeClass",!1,Vr,!0),r("pollInterval",100),r("undoDepth",200,function(n,i){return n.doc.history.undoDepth=i}),r("historyEventDelay",1250),r("viewportMargin",10,function(n){return n.refresh()},!0),r("maxHighlightLength",1e4,Vr,!0),r("moveInputWithCursor",!0,function(n,i){i||n.display.input.resetPosition()}),r("tabindex",null,function(n,i){return n.display.input.getField().tabIndex=i||""}),r("autofocus",null),r("direction","ltr",function(n,i){return n.doc.setDirection(i)},!0),r("phrases",null)}function jh(e,t,r){var n=r&&r!=Ar;if(!t!=!n){var i=e.display.dragFunctions,a=t?N:be;a(e.display.scroller,"dragstart",i.start),a(e.display.scroller,"dragenter",i.enter),a(e.display.scroller,"dragover",i.over),a(e.display.scroller,"dragleave",i.leave),a(e.display.scroller,"drop",i.drop)}}function Xh(e){e.options.lineWrapping?(pt(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Oe(e.display.wrapper,"CodeMirror-wrap"),Ia(e)),ja(e),Vt(e),$r(e),setTimeout(function(){return xr(e)},100)}function mt(e,t){var r=this;if(!(this instanceof mt))return new mt(e,t);this.options=t=t?Ze(t):{},Ze(Cu,t,!1);var n=t.value;typeof n=="string"?n=new en(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new mt.inputStyles[t.inputStyle](this),a=this.display=new lh(e,n,i,t);a.wrapper.CodeMirror=this,wu(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),As(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 Je,keySeq:null,specialChars:null},t.autofocus&&!j&&a.input.focus(),k&&S<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Kh(this),Sh(),ar(this),this.curOp.forceUpdate=!0,Os(this,n),t.autofocus&&!j||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&Za(r)},20):vr(this);for(var l in Ji)Ji.hasOwnProperty(l)&&Ji[l](this,t[l],Ar);Fs(this),t.finishInit&&t.finishInit(this);for(var s=0;s<vl.length;++s)vl[s](this);lr(this),z&&t.lineWrapping&&getComputedStyle(a.lineDiv).textRendering=="optimizelegibility"&&(a.lineDiv.style.textRendering="auto")}mt.defaults=Cu,mt.optionHandlers=Ji;function Kh(e){var t=e.display;N(t.scroller,"mousedown",Rt(e,yu)),k&&S<11?N(t.scroller,"dblclick",Rt(e,function(u){if(!ue(e,u)){var d=tr(e,u);if(!(!d||gl(e,u)||_n(e.display,u))){Le(u);var C=e.findWordAt(d);$i(e.doc,C.anchor,C.head)}}})):N(t.scroller,"dblclick",function(u){return ue(e,u)||Le(u)}),N(t.scroller,"contextmenu",function(u){return Du(e,u)}),N(t.input.getField(),"contextmenu",function(u){t.scroller.contains(u.target)||Du(e,u)});var r,n={end:0};function i(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function a(u){if(u.touches.length!=1)return!1;var d=u.touches[0];return d.radiusX<=1&&d.radiusY<=1}function l(u,d){if(d.left==null)return!0;var C=d.left-u.left,E=d.top-u.top;return C*C+E*E>400}N(t.scroller,"touchstart",function(u){if(!ue(e,u)&&!a(u)&&!gl(e,u)){t.input.ensurePolled(),clearTimeout(r);var d=+new Date;t.activeTouch={start:d,moved:!1,prev:d-n.end<=300?n:null},u.touches.length==1&&(t.activeTouch.left=u.touches[0].pageX,t.activeTouch.top=u.touches[0].pageY)}}),N(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),N(t.scroller,"touchend",function(u){var d=t.activeTouch;if(d&&!_n(t,u)&&d.left!=null&&!d.moved&&new Date-d.start<300){var C=e.coordsChar(t.activeTouch,"page"),E;!d.prev||l(d,d.prev)?E=new et(C,C):!d.prev.prev||l(d,d.prev.prev)?E=e.findWordAt(C):E=new et(oe(C.line,0),We(e.doc,oe(C.line+1,0))),e.setSelection(E.anchor,E.head),e.focus(),Le(u)}i()}),N(t.scroller,"touchcancel",i),N(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Kr(e,t.scroller.scrollTop),rr(e,t.scroller.scrollLeft,!0),ke(e,"scroll",e))}),N(t.scroller,"mousewheel",function(u){return Bs(e,u)}),N(t.scroller,"DOMMouseScroll",function(u){return Bs(e,u)}),N(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(u){ue(e,u)||vt(u)},over:function(u){ue(e,u)||(Ch(e,u),vt(u))},start:function(u){return wh(e,u)},drop:Rt(e,Dh),leave:function(u){ue(e,u)||lu(e)}};var s=t.input.getField();N(s,"keyup",function(u){return mu.call(e,u)}),N(s,"keydown",Rt(e,vu)),N(s,"keypress",Rt(e,xu)),N(s,"focus",function(u){return Za(e,u)}),N(s,"blur",function(u){return vr(e,u)})}var vl=[];mt.defineInitHook=function(e){return vl.push(e)};function hi(e,t,r,n){var i=e.doc,a;r==null&&(r="add"),r=="smart"&&(i.mode.indent?a=Hr(e,t).state:r="prev");var l=e.options.tabSize,s=Ae(i,t),u=Qe(s.text,null,l);s.stateAfter&&(s.stateAfter=null);var d=s.text.match(/^\s*/)[0],C;if(!n&&!/\S/.test(s.text))C=0,r="not";else if(r=="smart"&&(C=i.mode.indent(a,s.text.slice(d.length),s.text),C==Ve||C>150)){if(!n)return;r="prev"}r=="prev"?t>i.first?C=Qe(Ae(i,t-1).text,null,l):C=0:r=="add"?C=u+e.options.indentUnit:r=="subtract"?C=u-e.options.indentUnit:typeof r=="number"&&(C=u+r),C=Math.max(0,C);var E="",U=0;if(e.options.indentWithTabs)for(var O=Math.floor(C/l);O;--O)U+=l,E+=" ";if(U<C&&(E+=Nt(C-U)),E!=d)return Dr(i,E,oe(t,0),oe(t,d.length),"+input"),s.stateAfter=null,!0;for(var Y=0;Y<i.sel.ranges.length;Y++){var ne=i.sel.ranges[Y];if(ne.head.line==t&&ne.head.ch<d.length){var fe=oe(t,d.length);ul(i,Y,new et(fe,fe));break}}}var bn=null;function Vi(e){bn=e}function ml(e,t,r,n,i){var a=e.doc;e.display.shift=!1,n||(n=a.sel);var l=+new Date-200,s=i=="paste"||e.state.pasteIncoming>l,u=Ln(t),d=null;if(s&&n.ranges.length>1)if(bn&&bn.text.join(`
13
+ `)==t){if(n.ranges.length%bn.text.length==0){d=[];for(var C=0;C<bn.text.length;C++)d.push(a.splitLines(bn.text[C]))}}else u.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(d=xt(u,function(ge){return[ge]}));for(var E=e.curOp.updateInput,U=n.ranges.length-1;U>=0;U--){var O=n.ranges[U],Y=O.from(),ne=O.to();O.empty()&&(r&&r>0?Y=oe(Y.line,Y.ch-r):e.state.overwrite&&!s?ne=oe(ne.line,Math.min(Ae(a,ne.line).text.length,ne.ch+we(u).length)):s&&bn&&bn.lineWise&&bn.text.join(`
14
+ `)==u.join(`
15
+ `)&&(Y=ne=oe(Y.line,0)));var fe={from:Y,to:ne,text:d?d[U%d.length]:u,origin:i||(s?"paste":e.state.cutIncoming>l?"cut":"+input")};kr(e.doc,fe),Bt(e,"inputRead",e,fe)}t&&!s&&Au(e,t),mr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=E),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Su(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&on(t,function(){return ml(t,r,0,null,"paste")}),!0}function Au(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var a=e.getModeAt(i.head),l=!1;if(a.electricChars){for(var s=0;s<a.electricChars.length;s++)if(t.indexOf(a.electricChars.charAt(s))>-1){l=hi(e,i.head.line,"smart");break}}else a.electricInput&&a.electricInput.test(Ae(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=hi(e,i.head.line,"smart"));l&&Bt(e,"electricInput",e,i.head.line)}}}function Eu(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,a={anchor:oe(i,0),head:oe(i+1,0)};r.push(a),t.push(e.getRange(a.anchor,a.head))}return{text:t,ranges:r}}function xl(e,t,r,n){e.setAttribute("autocorrect",r?"on":"off"),e.setAttribute("autocapitalize",n?"on":"off"),e.setAttribute("spellcheck",!!t)}function Tu(){var e=P("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=P("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return z?e.style.width="1000px":e.setAttribute("wrap","off"),X&&(e.style.border="1px solid black"),t}function Yh(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){Ie(this).focus(),this.display.input.focus()},setOption:function(n,i){var a=this.options,l=a[n];a[n]==i&&n!="mode"||(a[n]=i,t.hasOwnProperty(n)&&Rt(this,t[n])(this,i,l),ke(this,"optionChange",this,n))},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,i){this.state.keyMaps[i?"push":"unshift"](Zi(n))},removeKeyMap:function(n){for(var i=this.state.keyMaps,a=0;a<i.length;++a)if(i[a]==n||i[a].name==n)return i.splice(a,1),!0},addOverlay:jt(function(n,i){var a=n.token?n:e.getMode(this.options,n);if(a.startState)throw new Error("Overlays may not be stateful.");Jt(this.state.overlays,{mode:a,modeSpec:n,opaque:i&&i.opaque,priority:i&&i.priority||0},function(l){return l.priority}),this.state.modeGen++,Vt(this)}),removeOverlay:jt(function(n){for(var i=this.state.overlays,a=0;a<i.length;++a){var l=i[a].modeSpec;if(l==n||typeof n=="string"&&l.name==n){i.splice(a,1),this.state.modeGen++,Vt(this);return}}}),indentLine:jt(function(n,i,a){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),zr(this.doc,n)&&hi(this,n,i,a)}),indentSelection:jt(function(n){for(var i=this.doc.sel.ranges,a=-1,l=0;l<i.length;l++){var s=i[l];if(s.empty())s.head.line>a&&(hi(this,s.head.line,n,!0),a=s.head.line,l==this.doc.sel.primIndex&&mr(this));else{var u=s.from(),d=s.to(),C=Math.max(a,u.line);a=Math.min(this.lastLine(),d.line-(d.ch?0:1))+1;for(var E=C;E<a;++E)hi(this,E,n);var U=this.doc.sel.ranges;u.ch==0&&i.length==U.length&&U[l].from().ch>0&&ul(this.doc,l,new et(u,U[l].to()),ht)}}}),getTokenAt:function(n,i){return Po(this,n,i)},getLineTokens:function(n,i){return Po(this,oe(n),i,!0)},getTokenTypeAt:function(n){n=We(this.doc,n);var i=Io(this,Ae(this.doc,n.line)),a=0,l=(i.length-1)/2,s=n.ch,u;if(s==0)u=i[2];else for(;;){var d=a+l>>1;if((d?i[d*2-1]:0)>=s)l=d;else if(i[d*2+1]<s)a=d+1;else{u=i[d*2+2];break}}var C=u?u.indexOf("overlay "):-1;return C<0?u:C==0?null:u.slice(0,C-1)},getModeAt:function(n){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(n).state).mode:i},getHelper:function(n,i){return this.getHelpers(n,i)[0]},getHelpers:function(n,i){var a=[];if(!r.hasOwnProperty(i))return a;var l=r[i],s=this.getModeAt(n);if(typeof s[i]=="string")l[s[i]]&&a.push(l[s[i]]);else if(s[i])for(var u=0;u<s[i].length;u++){var d=l[s[i][u]];d&&a.push(d)}else s.helperType&&l[s.helperType]?a.push(l[s.helperType]):l[s.name]&&a.push(l[s.name]);for(var C=0;C<l._global.length;C++){var E=l._global[C];E.pred(s,this)&&Ue(a,E.val)==-1&&a.push(E.val)}return a},getStateAfter:function(n,i){var a=this.doc;return n=Bo(a,n??a.first+a.size-1),Hr(this,n+1,i).state},cursorCoords:function(n,i){var a,l=this.doc.sel.primary();return n==null?a=l.head:typeof n=="object"?a=We(this.doc,n):a=n?l.from():l.to(),xn(this,a,i||"page")},charCoords:function(n,i){return Ii(this,We(this.doc,n),i||"page")},coordsChar:function(n,i){return n=ds(this,n,i||"page"),Ua(this,n.left,n.top)},lineAtHeight:function(n,i){return n=ds(this,{top:n,left:0},i||"page").top,Jn(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,i,a){var l=!1,s;if(typeof n=="number"){var u=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>u&&(n=u,l=!0),s=Ae(this.doc,n)}else s=n;return _i(this,s,{top:0,left:0},i||"page",a||l).top+(l?this.doc.height-Rn(s):0)},defaultTextHeight:function(){return pr(this.display)},defaultCharWidth:function(){return gr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,i,a,l,s){var u=this.display;n=xn(this,We(this.doc,n));var d=n.bottom,C=n.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),u.sizer.appendChild(i),l=="over")d=n.top;else if(l=="above"||l=="near"){var E=Math.max(u.wrapper.clientHeight,this.doc.height),U=Math.max(u.sizer.clientWidth,u.lineSpace.clientWidth);(l=="above"||n.bottom+i.offsetHeight>E)&&n.top>i.offsetHeight?d=n.top-i.offsetHeight:n.bottom+i.offsetHeight<=E&&(d=n.bottom),C+i.offsetWidth>U&&(C=U-i.offsetWidth)}i.style.top=d+"px",i.style.left=i.style.right="",s=="right"?(C=u.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(s=="left"?C=0:s=="middle"&&(C=(u.sizer.clientWidth-i.offsetWidth)/2),i.style.left=C+"px"),a&&jc(this,{left:C,top:d,right:C+i.offsetWidth,bottom:d+i.offsetHeight})},triggerOnKeyDown:jt(vu),triggerOnKeyPress:jt(xu),triggerOnKeyUp:mu,triggerOnMouseDown:jt(yu),execCommand:function(n){if(si.hasOwnProperty(n))return si[n].call(null,this)},triggerElectric:jt(function(n){Au(this,n)}),findPosH:function(n,i,a,l){var s=1;i<0&&(s=-1,i=-i);for(var u=We(this.doc,n),d=0;d<i&&(u=yl(this.doc,u,s,a,l),!u.hitSide);++d);return u},moveH:jt(function(n,i){var a=this;this.extendSelectionsBy(function(l){return a.display.shift||a.doc.extend||l.empty()?yl(a.doc,l.head,n,i,a.options.rtlMoveVisually):n<0?l.from():l.to()},Ct)}),deleteH:jt(function(n,i){var a=this.doc.sel,l=this.doc;a.somethingSelected()?l.replaceSelection("",null,"+delete"):Sr(this,function(s){var u=yl(l,s.head,n,i,!1);return n<0?{from:u,to:s.head}:{from:s.head,to:u}})}),findPosV:function(n,i,a,l){var s=1,u=l;i<0&&(s=-1,i=-i);for(var d=We(this.doc,n),C=0;C<i;++C){var E=xn(this,d,"div");if(u==null?u=E.left:E.left=u,d=Fu(this,E,s,a),d.hitSide)break}return d},moveV:jt(function(n,i){var a=this,l=this.doc,s=[],u=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(C){if(u)return n<0?C.from():C.to();var E=xn(a,C.head,"div");C.goalColumn!=null&&(E.left=C.goalColumn),s.push(E.left);var U=Fu(a,E,n,i);return i=="page"&&C==l.sel.primary()&&Ja(a,Ii(a,U,"div").top-E.top),U},Ct),s.length)for(var d=0;d<l.sel.ranges.length;d++)l.sel.ranges[d].goalColumn=s[d]}),findWordAt:function(n){var i=this.doc,a=Ae(i,n.line).text,l=n.ch,s=n.ch;if(a){var u=this.getHelper(n,"wordChars");(n.sticky=="before"||s==a.length)&&l?--l:++s;for(var d=a.charAt(l),C=v(d,u)?function(E){return v(E,u)}:/\s/.test(d)?function(E){return/\s/.test(E)}:function(E){return!/\s/.test(E)&&!v(E)};l>0&&C(a.charAt(l-1));)--l;for(;s<a.length&&C(a.charAt(s));)++s}return new et(oe(n.line,l),oe(n.line,s))},toggleOverwrite:function(n){n!=null&&n==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?pt(this.display.cursorDiv,"CodeMirror-overwrite"):Oe(this.display.cursorDiv,"CodeMirror-overwrite"),ke(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==$e(J(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:jt(function(n,i){Xr(this,n,i)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-Sn(this)-this.display.barHeight,width:n.scrollWidth-Sn(this)-this.display.barWidth,clientHeight:Pa(this),clientWidth:Vn(this)}},scrollIntoView:jt(function(n,i){n==null?(n={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof n=="number"?n={from:oe(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=i||0,n.from.line!=null?Xc(this,n):Ds(this,n.from,n.to,n.margin)}),setSize:jt(function(n,i){var a=this,l=function(u){return typeof u=="number"||/^\d+$/.test(String(u))?u+"px":u};n!=null&&(this.display.wrapper.style.width=l(n)),i!=null&&(this.display.wrapper.style.height=l(i)),this.options.lineWrapping&&fs(this);var s=this.display.viewFrom;this.doc.iter(s,this.display.viewTo,function(u){if(u.widgets){for(var d=0;d<u.widgets.length;d++)if(u.widgets[d].noHScroll){Un(a,s,"widget");break}}++s}),this.curOp.forceUpdate=!0,ke(this,"refresh",this)}),operation:function(n){return on(this,n)},startOperation:function(){return ar(this)},endOperation:function(){return lr(this)},refresh:jt(function(){var n=this.display.cachedTextHeight;Vt(this),this.curOp.forceUpdate=!0,$r(this),Xr(this,this.doc.scrollLeft,this.doc.scrollTop),tl(this.display),(n==null||Math.abs(n-pr(this.display))>.5||this.options.lineWrapping)&&ja(this),ke(this,"refresh",this)}),swapDoc:jt(function(n){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),Os(this,n),$r(this),this.display.input.reset(),Xr(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,Bt(this,"swapDoc",this,i),i}),phrase:function(n){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,n)?i[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}},Te(e),e.registerHelper=function(n,i,a){r.hasOwnProperty(n)||(r[n]=e[n]={_global:[]}),r[n][i]=a},e.registerGlobalHelper=function(n,i,a,l){e.registerHelper(n,i,l),r[n]._global.push({pred:a,val:l})}}function yl(e,t,r,n,i){var a=t,l=r,s=Ae(e,t.line),u=i&&e.direction=="rtl"?-r:r;function d(){var me=t.line+u;return me<e.first||me>=e.first+e.size?!1:(t=new oe(me,t.ch,t.sticky),s=Ae(e,me))}function C(me){var ve;if(n=="codepoint"){var De=s.text.charCodeAt(t.ch+(r>0?0:-1));if(isNaN(De))ve=null;else{var _e=r>0?De>=55296&&De<56320:De>=56320&&De<57343;ve=new oe(t.line,Math.max(0,Math.min(s.text.length,t.ch+r*(_e?2:1))),-r)}}else i?ve=Lh(e.cm,s,t,r):ve=cl(s,t,r);if(ve==null)if(!me&&d())t=hl(i,e.cm,s,t.line,u);else return!1;else t=ve;return!0}if(n=="char"||n=="codepoint")C();else if(n=="column")C(!0);else if(n=="word"||n=="group")for(var E=null,U=n=="group",O=e.cm&&e.cm.getHelper(t,"wordChars"),Y=!0;!(r<0&&!C(!Y));Y=!1){var ne=s.text.charAt(t.ch)||`
16
+ `,fe=v(ne,O)?"w":U&&ne==`
17
+ `?"n":!U||/\s/.test(ne)?null:"p";if(U&&!Y&&!fe&&(fe="s"),E&&E!=fe){r<0&&(r=1,C(),t.sticky="after");break}if(fe&&(E=fe),r>0&&!C(!Y))break}var ge=Xi(e,t,a,l,!0);return Ea(a,ge)&&(ge.hitSide=!0),ge}function Fu(e,t,r,n){var i=e.doc,a=t.left,l;if(n=="page"){var s=Math.min(e.display.wrapper.clientHeight,Ie(e).innerHeight||i(e).documentElement.clientHeight),u=Math.max(s-.5*pr(e.display),3);l=(r>0?t.bottom:t.top)+r*u}else n=="line"&&(l=r>0?t.bottom+3:t.top-3);for(var d;d=Ua(e,a,l),!!d.outside;){if(r<0?l<=0:l>=i.height){d.hitSide=!0;break}l+=r*5}return d}var st=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Je,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};st.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;i.contentEditable=!0,xl(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function a(s){for(var u=s.target;u;u=u.parentNode){if(u==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(u.className))break}return!1}N(i,"paste",function(s){!a(s)||ue(n,s)||Su(s,n)||S<=11&&setTimeout(Rt(n,function(){return t.updateFromDOM()}),20)}),N(i,"compositionstart",function(s){t.composing={data:s.data,done:!1}}),N(i,"compositionupdate",function(s){t.composing||(t.composing={data:s.data,done:!1})}),N(i,"compositionend",function(s){t.composing&&(s.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),N(i,"touchstart",function(){return r.forceCompositionEnd()}),N(i,"input",function(){t.composing||t.readFromDOMSoon()});function l(s){if(!(!a(s)||ue(n,s))){if(n.somethingSelected())Vi({lineWise:!1,text:n.getSelections()}),s.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var u=Eu(n);Vi({lineWise:!0,text:u.text}),s.type=="cut"&&n.operation(function(){n.setSelections(u.ranges,0,ht),n.replaceSelection("",null,"cut")})}else return;if(s.clipboardData){s.clipboardData.clearData();var d=bn.text.join(`
18
+ `);if(s.clipboardData.setData("Text",d),s.clipboardData.getData("Text")==d){s.preventDefault();return}}var C=Tu(),E=C.firstChild;xl(E),n.display.lineSpace.insertBefore(C,n.display.lineSpace.firstChild),E.value=bn.text.join(`
19
+ `);var U=$e(Fe(i));M(E),setTimeout(function(){n.display.lineSpace.removeChild(C),U.focus(),U==i&&r.showPrimarySelection()},50)}}N(i,"copy",l),N(i,"cut",l)},st.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},st.prototype.prepareSelection=function(){var e=ys(this.cm,!1);return e.focus=$e(Fe(this.div))==this.div,e},st.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},st.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},st.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var a=ea(t,e.anchorNode,e.anchorOffset),l=ea(t,e.focusNode,e.focusOffset);if(!(a&&!a.bad&&l&&!l.bad&&He(Si(a,l),n)==0&&He(Ci(a,l),i)==0)){var s=t.display.view,u=n.line>=t.display.viewFrom&&Lu(t,n)||{node:s[0].measure.map[2],offset:0},d=i.line<t.display.viewTo&&Lu(t,i);if(!d){var C=s[s.length-1].measure,E=C.maps?C.maps[C.maps.length-1]:C.map;d={node:E[E.length-1],offset:E[E.length-2]-E[E.length-3]}}if(!u||!d){e.removeAllRanges();return}var U=e.rangeCount&&e.getRangeAt(0),O;try{O=ae(u.node,u.offset,d.offset,d.node)}catch{}O&&(!x&&t.state.focused?(e.collapse(u.node,u.offset),O.collapsed||(e.removeAllRanges(),e.addRange(O))):(e.removeAllRanges(),e.addRange(O)),U&&e.anchorNode==null?e.addRange(U):x&&this.startGracePeriod()),this.rememberSelection()}},st.prototype.startGracePeriod=function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){return e.cm.curOp.selectionChanged=!0})},20)},st.prototype.showMultipleSelections=function(e){Pe(this.cm.display.cursorDiv,e.cursors),Pe(this.cm.display.selectionDiv,e.selection)},st.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},st.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Ee(this.div,t)},st.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||$e(Fe(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},st.prototype.blur=function(){this.div.blur()},st.prototype.getField=function(){return this.div},st.prototype.supportsTouch=function(){return!0},st.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):on(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function r(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,r))}this.polling.set(this.cm.options.pollInterval,r)},st.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},st.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(Q&&H&&this.cm.display.gutterSpecs.length&&Zh(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var r=ea(t,e.anchorNode,e.anchorOffset),n=ea(t,e.focusNode,e.focusOffset);r&&n&&on(t,function(){qt(t.doc,Gn(r,n),ht),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}},st.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(n.ch==0&&n.line>e.firstLine()&&(n=oe(n.line-1,Ae(e.doc,n.line-1).length)),i.ch==Ae(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=oe(i.line+1,0)),n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var a,l,s;n.line==t.viewFrom||(a=nr(e,n.line))==0?(l=Ye(t.view[0].line),s=t.view[0].node):(l=Ye(t.view[a].line),s=t.view[a-1].node.nextSibling);var u=nr(e,i.line),d,C;if(u==t.view.length-1?(d=t.viewTo-1,C=t.lineDiv.lastChild):(d=Ye(t.view[u+1].line)-1,C=t.view[u+1].node.previousSibling),!s)return!1;for(var E=e.doc.splitLines(Qh(e,s,C,l,d)),U=vn(e.doc,oe(l,0),oe(d,Ae(e.doc,d).text.length));E.length>1&&U.length>1;)if(we(E)==we(U))E.pop(),U.pop(),d--;else if(E[0]==U[0])E.shift(),U.shift(),l++;else break;for(var O=0,Y=0,ne=E[0],fe=U[0],ge=Math.min(ne.length,fe.length);O<ge&&ne.charCodeAt(O)==fe.charCodeAt(O);)++O;for(var me=we(E),ve=we(U),De=Math.min(me.length-(E.length==1?O:0),ve.length-(U.length==1?O:0));Y<De&&me.charCodeAt(me.length-Y-1)==ve.charCodeAt(ve.length-Y-1);)++Y;if(E.length==1&&U.length==1&&l==n.line)for(;O&&O>n.ch&&me.charCodeAt(me.length-Y-1)==ve.charCodeAt(ve.length-Y-1);)O--,Y++;E[E.length-1]=me.slice(0,me.length-Y).replace(/^\u200b+/,""),E[0]=E[0].slice(O).replace(/\u200b+$/,"");var _e=oe(l,O),Be=oe(d,U.length?we(U).length-Y:0);if(E.length>1||E[0]||He(_e,Be))return Dr(e.doc,E,_e,Be,"+input"),!0},st.prototype.ensurePolled=function(){this.forceCompositionEnd()},st.prototype.reset=function(){this.forceCompositionEnd()},st.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},st.prototype.readFromDOMSoon=function(){var e=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(e.readDOMTimeout=null,e.composing)if(e.composing.done)e.composing=null;else return;e.updateFromDOM()},80))},st.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&on(this.cm,function(){return Vt(e.cm)})},st.prototype.setUneditable=function(e){e.contentEditable="false"},st.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Rt(this.cm,ml)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},st.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},st.prototype.onContextMenu=function(){},st.prototype.resetPosition=function(){},st.prototype.needsContentAttribute=!0;function Lu(e,t){var r=za(e,t.line);if(!r||r.hidden)return null;var n=Ae(e.doc,t.line),i=as(r,n,t.line),a=F(n,e.doc.direction),l="left";if(a){var s=W(a,t.ch);l=s%2?"right":"left"}var u=ss(i.map,t.ch,l);return u.offset=u.collapse=="right"?u.end:u.start,u}function Zh(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Er(e,t){return t&&(e.bad=!0),e}function Qh(e,t,r,n,i){var a="",l=!1,s=e.doc.lineSeparator(),u=!1;function d(O){return function(Y){return Y.id==O}}function C(){l&&(a+=s,u&&(a+=s),l=u=!1)}function E(O){O&&(C(),a+=O)}function U(O){if(O.nodeType==1){var Y=O.getAttribute("cm-text");if(Y){E(Y);return}var ne=O.getAttribute("cm-marker"),fe;if(ne){var ge=e.findMarks(oe(n,0),oe(i+1,0),d(+ne));ge.length&&(fe=ge[0].find(0))&&E(vn(e.doc,fe.from,fe.to).join(s));return}if(O.getAttribute("contenteditable")=="false")return;var me=/^(pre|div|p|li|table|br)$/i.test(O.nodeName);if(!/^br$/i.test(O.nodeName)&&O.textContent.length==0)return;me&&C();for(var ve=0;ve<O.childNodes.length;ve++)U(O.childNodes[ve]);/^(pre|p)$/i.test(O.nodeName)&&(u=!0),me&&(l=!0)}else O.nodeType==3&&E(O.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;U(t),t!=r;)t=t.nextSibling,u=!1;return a}function ea(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return Er(e.clipPos(oe(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var a=e.display.view[i];if(a.node==n)return Jh(a,t,r)}}function Jh(e,t,r){var n=e.text.firstChild,i=!1;if(!t||!Ee(n,t))return Er(oe(Ye(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var a=e.rest?we(e.rest):e.line;return Er(oe(Ye(a),a.text.length),i)}var l=t.nodeType==3?t:null,s=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,r&&(r=l.nodeValue.length));s.parentNode!=n;)s=s.parentNode;var u=e.measure,d=u.maps;function C(fe,ge,me){for(var ve=-1;ve<(d?d.length:0);ve++)for(var De=ve<0?u.map:d[ve],_e=0;_e<De.length;_e+=3){var Be=De[_e+2];if(Be==fe||Be==ge){var qe=Ye(ve<0?e.line:e.rest[ve]),ct=De[_e]+me;return(me<0||Be!=fe)&&(ct=De[_e+(me?1:0)]),oe(qe,ct)}}}var E=C(l,s,r);if(E)return Er(E,i);for(var U=s.nextSibling,O=l?l.nodeValue.length-r:0;U;U=U.nextSibling){if(E=C(U,U.firstChild,0),E)return Er(oe(E.line,E.ch-O),i);O+=U.textContent.length}for(var Y=s.previousSibling,ne=r;Y;Y=Y.previousSibling){if(E=C(Y,Y.firstChild,-1),E)return Er(oe(E.line,E.ch+ne),i);ne+=Y.textContent.length}}var wt=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Je,this.hasSelection=!1,this.composing=null,this.resetting=!1};wt.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),X&&(i.style.width="0px"),N(i,"input",function(){k&&S>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),N(i,"paste",function(l){ue(n,l)||Su(l,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())});function a(l){if(!ue(n,l)){if(n.somethingSelected())Vi({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var s=Eu(n);Vi({lineWise:!0,text:s.text}),l.type=="cut"?n.setSelections(s.ranges,null,ht):(r.prevInput="",i.value=s.text.join(`
20
+ `),M(i))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}}N(i,"cut",a),N(i,"copy",a),N(e.scroller,"paste",function(l){if(!(_n(e,l)||ue(n,l))){if(!i.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var s=new Event("paste");s.clipboardData=l.clipboardData,i.dispatchEvent(s)}}),N(e.lineSpace,"selectstart",function(l){_n(e,l)||Le(l)}),N(i,"compositionstart",function(){var l=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:l,range:n.markText(l,n.getCursor("to"),{className:"CodeMirror-composing"})}}),N(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},wt.prototype.createField=function(e){this.wrapper=Tu(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;xl(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},wt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},wt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=ys(e);if(e.options.moveInputWithCursor){var i=xn(e,r.sel.primary().head,"div"),a=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-a.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-a.left))}return n},wt.prototype.showSelection=function(e){var t=this.cm,r=t.display;Pe(r.cursorDiv,e.cursors),Pe(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},wt.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&M(this.textarea),k&&S>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",k&&S>=9&&(this.hasSelection=null));this.resetting=!1}},wt.prototype.getField=function(){return this.textarea},wt.prototype.supportsTouch=function(){return!1},wt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!j||$e(Fe(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},wt.prototype.blur=function(){this.textarea.blur()},wt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},wt.prototype.receivedFocus=function(){this.slowPoll()},wt.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},wt.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},wt.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||fr(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(k&&S>=9&&this.hasSelection===i||K&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var a=i.charCodeAt(0);if(a==8203&&!n&&(n="​"),a==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,s=Math.min(n.length,i.length);l<s&&n.charCodeAt(l)==i.charCodeAt(l);)++l;return on(t,function(){ml(t,i.slice(l),n.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
21
+ `)>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},wt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},wt.prototype.onKeyPress=function(){k&&S>=9&&(this.hasSelection=null),this.fastPoll()},wt.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var a=tr(r,e),l=n.scroller.scrollTop;if(!a||ee)return;var s=r.options.resetSelectionOnContextMenu;s&&r.doc.sel.contains(a)==-1&&Rt(r,qt)(r.doc,Gn(a),ht);var u=i.style.cssText,d=t.wrapper.style.cssText,C=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
22
+ top: `+(e.clientY-C.top-5)+"px; left: "+(e.clientX-C.left-5)+`px;
23
+ z-index: 1000; background: `+(k?"rgba(255, 255, 255, .05)":"transparent")+`;
24
+ outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var E;z&&(E=i.ownerDocument.defaultView.scrollY),n.input.focus(),z&&i.ownerDocument.defaultView.scrollTo(null,E),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=O,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function U(){if(i.selectionStart!=null){var ne=r.somethingSelected(),fe="​"+(ne?i.value:"");i.value="⇚",i.value=fe,t.prevInput=ne?"":"​",i.selectionStart=1,i.selectionEnd=fe.length,n.selForContextMenu=r.doc.sel}}function O(){if(t.contextMenuPending==O&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=u,k&&S<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),i.selectionStart!=null)){(!k||k&&S<9)&&U();var ne=0,fe=function(){n.selForContextMenu==r.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="​"?Rt(r,Ys)(r):ne++<10?n.detectingSelectAll=setTimeout(fe,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(fe,200)}}if(k&&S>=9&&U(),Xe){vt(e);var Y=function(){be(window,"mouseup",Y),setTimeout(O,20)};N(window,"mouseup",Y)}else setTimeout(O,50)},wt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},wt.prototype.setUneditable=function(){},wt.prototype.needsContentAttribute=!1;function Vh(e,t){if(t=t?Ze(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var r=$e(Fe(e));t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=s.getValue()}var i;if(e.form&&(N(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var a=e.form;i=a.submit;try{var l=a.submit=function(){n(),a.submit=i,a.submit(),a.submit=l}}catch{}}t.finishInit=function(u){u.save=n,u.getTextArea=function(){return e},u.toTextArea=function(){u.toTextArea=isNaN,n(),e.parentNode.removeChild(u.getWrapperElement()),e.style.display="",e.form&&(be(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var s=mt(function(u){return e.parentNode.insertBefore(u,e.nextSibling)},t);return s}function ed(e){e.off=be,e.on=N,e.wheelEventPixels=oh,e.Doc=en,e.splitLines=Ln,e.countColumn=Qe,e.findColumn=Lt,e.isWordChar=I,e.Pass=Ve,e.signal=ke,e.Line=cr,e.changeEnd=$n,e.scrollbarModel=Ss,e.Pos=oe,e.cmpPos=He,e.modes=$t,e.mimeModes=Wt,e.resolveMode=_,e.getMode=he,e.modeExtensions=Se,e.extendMode=gt,e.copyState=yt,e.startState=Ut,e.innerMode=bt,e.commands=si,e.keyMap=On,e.keyName=cu,e.isModifierKey=uu,e.lookupKey=Cr,e.normalizeKeyMap=Fh,e.StringStream=it,e.SharedTextMarker=ai,e.TextMarker=Xn,e.LineWidget=ii,e.e_preventDefault=Le,e.e_stopPropagation=nt,e.e_stop=vt,e.addClass=pt,e.contains=Ee,e.rmClass=Oe,e.keyNames=Kn}$h(mt),Yh(mt);var td="iter insert remove copy getEditor constructor".split(" ");for(var ta in en.prototype)en.prototype.hasOwnProperty(ta)&&Ue(td,ta)<0&&(mt.prototype[ta]=(function(e){return function(){return e.apply(this.doc,arguments)}})(en.prototype[ta]));return Te(en),mt.inputStyles={textarea:wt,contenteditable:st},mt.defineMode=function(e){!mt.defaults.mode&&e!="null"&&(mt.defaults.mode=e),Mn.apply(this,arguments)},mt.defineMIME=Me,mt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),mt.defineMIME("text/plain","null"),mt.defineExtension=function(e,t){mt.prototype[e]=t},mt.defineDocExtension=function(e,t){en.prototype[e]=t},mt.fromTextArea=Vh,ed(mt),mt.version="5.65.20",mt}))})(di)),di.exports}var Sl={exports:{}},Al;function Ru(){return Al||(Al=1,(function(y,c){(function(f){f(un())})(function(f){var p=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,x=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,b=/[*+-]\s/;f.commands.newlineAndIndentContinueMarkdownList=function(D){if(D.getOption("disableInput"))return f.Pass;for(var k=D.listSelections(),S=[],z=0;z<k.length;z++){var Z=k[z].head,H=D.getStateAfter(Z.line),ie=f.innerMode(D.getMode(),H);if(ie.mode.name!=="markdown"&&ie.mode.helperType!=="markdown"){D.execCommand("newlineAndIndent");return}else H=ie.state;var ee=H.list!==!1,ye=H.quote!==0,re=D.getLine(Z.line),te=p.exec(re),X=/^\s*$/.test(re.slice(0,Z.ch));if(!k[z].empty()||!ee&&!ye||!te||X){D.execCommand("newlineAndIndent");return}if(x.test(re)){var Q=ye&&/>\s*$/.test(re),j=!/>\s*$/.test(re);(Q||j)&&D.replaceRange("",{line:Z.line,ch:0},{line:Z.line,ch:Z.ch+1}),S[z]=`
25
+ `}else{var K=te[1],se=te[5],V=!(b.test(te[2])||te[2].indexOf(">")>=0),pe=V?parseInt(te[3],10)+1+te[4]:te[2].replace("x"," ");S[z]=`
26
+ `+K+pe+se,V&&A(D,Z)}}D.replaceSelections(S)};function A(D,k){var S=k.line,z=0,Z=0,H=p.exec(D.getLine(S)),ie=H[1];do{z+=1;var ee=S+z,ye=D.getLine(ee),re=p.exec(ye);if(re){var te=re[1],X=parseInt(H[3],10)+z-Z,Q=parseInt(re[3],10),j=Q;if(ie===te&&!isNaN(Q))X===Q&&(j=Q+1),X>Q&&(j=X+1),D.replaceRange(ye.replace(p,te+j+re[4]+re[5]),{line:ee,ch:0},{line:ee,ch:ye.length});else{if(ie.length>te.length||ie.length<te.length&&z===1)return;Z+=1}}}while(re)}})})()),Sl.exports}var El={},Tl;function _u(){if(Tl)return El;Tl=1;var y=un();return y.commands.tabAndIndentMarkdownList=function(c){var f=c.listSelections(),p=f[0].head,x=c.getStateAfter(p.line),b=x.list!==!1;if(b){c.execCommand("indentMore");return}if(c.options.indentWithTabs)c.execCommand("insertTab");else{var A=Array(c.options.tabSize+1).join(" ");c.replaceSelection(A)}},y.commands.shiftTabAndUnindentMarkdownList=function(c){var f=c.listSelections(),p=f[0].head,x=c.getStateAfter(p.line),b=x.list!==!1;if(b){c.execCommand("indentLess");return}if(c.options.indentWithTabs)c.execCommand("insertTab");else{var A=Array(c.options.tabSize+1).join(" ");c.replaceSelection(A)}},El}var Fl={exports:{}},Ll;function Iu(){return Ll||(Ll=1,(function(y,c){(function(f){f(un())})(function(f){f.defineOption("fullScreen",!1,function(b,A,D){D==f.Init&&(D=!1),!D!=!A&&(A?p(b):x(b))});function p(b){var A=b.getWrapperElement();b.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:A.style.width,height:A.style.height},A.style.width="",A.style.height="auto",A.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",b.refresh()}function x(b){var A=b.getWrapperElement();A.className=A.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var D=b.state.fullScreenRestore;A.style.width=D.width,A.style.height=D.height,window.scrollTo(D.scrollLeft,D.scrollTop),b.refresh()}})})()),Fl.exports}var Ml={exports:{}},Bl={exports:{}},Rl;function _l(){return Rl||(Rl=1,(function(y,c){(function(f){f(un())})(function(f){var p={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},x={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};f.defineMode("xml",function(b,A){var D=b.indentUnit,k={},S=A.htmlMode?p:x;for(var z in S)k[z]=S[z];for(var z in A)k[z]=A[z];var Z,H;function ie(P,ce){function ae(pt){return ce.tokenize=pt,pt(P,ce)}var Ee=P.next();if(Ee=="<")return P.eat("!")?P.eat("[")?P.match("CDATA[")?ae(re("atom","]]>")):null:P.match("--")?ae(re("comment","-->")):P.match("DOCTYPE",!0,!0)?(P.eatWhile(/[\w\._\-]/),ae(te(1))):null:P.eat("?")?(P.eatWhile(/[\w\._\-]/),ce.tokenize=re("meta","?>"),"meta"):(Z=P.eat("/")?"closeTag":"openTag",ce.tokenize=ee,"tag bracket");if(Ee=="&"){var $e;return P.eat("#")?P.eat("x")?$e=P.eatWhile(/[a-fA-F\d]/)&&P.eat(";"):$e=P.eatWhile(/[\d]/)&&P.eat(";"):$e=P.eatWhile(/[\w\.\-:]/)&&P.eat(";"),$e?"atom":"error"}else return P.eatWhile(/[^&<]/),null}ie.isInText=!0;function ee(P,ce){var ae=P.next();if(ae==">"||ae=="/"&&P.eat(">"))return ce.tokenize=ie,Z=ae==">"?"endTag":"selfcloseTag","tag bracket";if(ae=="=")return Z="equals",null;if(ae=="<"){ce.tokenize=ie,ce.state=se,ce.tagName=ce.tagStart=null;var Ee=ce.tokenize(P,ce);return Ee?Ee+" tag error":"tag error"}else return/[\'\"]/.test(ae)?(ce.tokenize=ye(ae),ce.stringStartCol=P.column(),ce.tokenize(P,ce)):(P.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function ye(P){var ce=function(ae,Ee){for(;!ae.eol();)if(ae.next()==P){Ee.tokenize=ee;break}return"string"};return ce.isInAttribute=!0,ce}function re(P,ce){return function(ae,Ee){for(;!ae.eol();){if(ae.match(ce)){Ee.tokenize=ie;break}ae.next()}return P}}function te(P){return function(ce,ae){for(var Ee;(Ee=ce.next())!=null;){if(Ee=="<")return ae.tokenize=te(P+1),ae.tokenize(ce,ae);if(Ee==">")if(P==1){ae.tokenize=ie;break}else return ae.tokenize=te(P-1),ae.tokenize(ce,ae)}return"meta"}}function X(P){return P&&P.toLowerCase()}function Q(P,ce,ae){this.prev=P.context,this.tagName=ce||"",this.indent=P.indented,this.startOfLine=ae,(k.doNotIndent.hasOwnProperty(ce)||P.context&&P.context.noIndent)&&(this.noIndent=!0)}function j(P){P.context&&(P.context=P.context.prev)}function K(P,ce){for(var ae;;){if(!P.context||(ae=P.context.tagName,!k.contextGrabbers.hasOwnProperty(X(ae))||!k.contextGrabbers[X(ae)].hasOwnProperty(X(ce))))return;j(P)}}function se(P,ce,ae){return P=="openTag"?(ae.tagStart=ce.column(),V):P=="closeTag"?pe:se}function V(P,ce,ae){return P=="word"?(ae.tagName=ce.current(),H="tag",le):k.allowMissingTagName&&P=="endTag"?(H="tag bracket",le(P,ce,ae)):(H="error",V)}function pe(P,ce,ae){if(P=="word"){var Ee=ce.current();return ae.context&&ae.context.tagName!=Ee&&k.implicitlyClosed.hasOwnProperty(X(ae.context.tagName))&&j(ae),ae.context&&ae.context.tagName==Ee||k.matchClosing===!1?(H="tag",xe):(H="tag error",Xe)}else return k.allowMissingTagName&&P=="endTag"?(H="tag bracket",xe(P,ce,ae)):(H="error",Xe)}function xe(P,ce,ae){return P!="endTag"?(H="error",xe):(j(ae),se)}function Xe(P,ce,ae){return H="error",xe(P,ce,ae)}function le(P,ce,ae){if(P=="word")return H="attribute",Oe;if(P=="endTag"||P=="selfcloseTag"){var Ee=ae.tagName,$e=ae.tagStart;return ae.tagName=ae.tagStart=null,P=="selfcloseTag"||k.autoSelfClosers.hasOwnProperty(X(Ee))?K(ae,Ee):(K(ae,Ee),ae.context=new Q(ae,Ee,$e==ae.indented)),se}return H="error",le}function Oe(P,ce,ae){return P=="equals"?Re:(k.allowMissing||(H="error"),le(P,ce,ae))}function Re(P,ce,ae){return P=="string"?Pe:P=="word"&&k.allowUnquoted?(H="string",le):(H="error",le(P,ce,ae))}function Pe(P,ce,ae){return P=="string"?Pe:le(P,ce,ae)}return{startState:function(P){var ce={tokenize:ie,state:se,indented:P||0,tagName:null,tagStart:null,context:null};return P!=null&&(ce.baseIndent=P),ce},token:function(P,ce){if(!ce.tagName&&P.sol()&&(ce.indented=P.indentation()),P.eatSpace())return null;Z=null;var ae=ce.tokenize(P,ce);return(ae||Z)&&ae!="comment"&&(H=null,ce.state=ce.state(Z||ae,P,ce),H&&(ae=H=="error"?ae+" error":H)),ae},indent:function(P,ce,ae){var Ee=P.context;if(P.tokenize.isInAttribute)return P.tagStart==P.indented?P.stringStartCol+1:P.indented+D;if(Ee&&Ee.noIndent)return f.Pass;if(P.tokenize!=ee&&P.tokenize!=ie)return ae?ae.match(/^(\s*)/)[0].length:0;if(P.tagName)return k.multilineTagIndentPastTag!==!1?P.tagStart+P.tagName.length+2:P.tagStart+D*(k.multilineTagIndentFactor||1);if(k.alignCDATA&&/<!\[CDATA\[/.test(ce))return 0;var $e=ce&&/^<(\/)?([\w_:\.-]*)/.exec(ce);if($e&&$e[1])for(;Ee;)if(Ee.tagName==$e[2]){Ee=Ee.prev;break}else if(k.implicitlyClosed.hasOwnProperty(X(Ee.tagName)))Ee=Ee.prev;else break;else if($e)for(;Ee;){var pt=k.contextGrabbers[X(Ee.tagName)];if(pt&&pt.hasOwnProperty(X($e[2])))Ee=Ee.prev;else break}for(;Ee&&Ee.prev&&!Ee.startOfLine;)Ee=Ee.prev;return Ee?Ee.indent+D:P.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:k.htmlMode?"html":"xml",helperType:k.htmlMode?"html":"xml",skipAttribute:function(P){P.state==Re&&(P.state=le)},xmlCurrentTag:function(P){return P.tagName?{name:P.tagName,close:P.type=="closeTag"}:null},xmlCurrentContext:function(P){for(var ce=[],ae=P.context;ae;ae=ae.prev)ce.push(ae.tagName);return ce.reverse()}}}),f.defineMIME("text/xml","xml"),f.defineMIME("application/xml","xml"),f.mimeModes.hasOwnProperty("text/html")||f.defineMIME("text/html",{name:"xml",htmlMode:!0})})})()),Bl.exports}var Il={exports:{}},Ol;function Ou(){return Ol||(Ol=1,(function(y,c){(function(f){f(un())})(function(f){f.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","cbl"]},{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"]}];for(var p=0;p<f.modeInfo.length;p++){var x=f.modeInfo[p];x.mimes&&(x.mime=x.mimes[0])}f.findModeByMIME=function(b){b=b.toLowerCase();for(var A=0;A<f.modeInfo.length;A++){var D=f.modeInfo[A];if(D.mime==b)return D;if(D.mimes){for(var k=0;k<D.mimes.length;k++)if(D.mimes[k]==b)return D}}if(/\+xml$/.test(b))return f.findModeByMIME("application/xml");if(/\+json$/.test(b))return f.findModeByMIME("application/json")},f.findModeByExtension=function(b){b=b.toLowerCase();for(var A=0;A<f.modeInfo.length;A++){var D=f.modeInfo[A];if(D.ext){for(var k=0;k<D.ext.length;k++)if(D.ext[k]==b)return D}}},f.findModeByFileName=function(b){for(var A=0;A<f.modeInfo.length;A++){var D=f.modeInfo[A];if(D.file&&D.file.test(b))return D}var k=b.lastIndexOf("."),S=k>-1&&b.substring(k+1,b.length);if(S)return f.findModeByExtension(S)},f.findModeByName=function(b){b=b.toLowerCase();for(var A=0;A<f.modeInfo.length;A++){var D=f.modeInfo[A];if(D.name.toLowerCase()==b)return D;if(D.alias){for(var k=0;k<D.alias.length;k++)if(D.alias[k].toLowerCase()==b)return D}}}})})()),Il.exports}var Nl;function Pl(){return Nl||(Nl=1,(function(y,c){(function(f){f(un(),_l(),Ou())})(function(f){f.defineMode("markdown",function(p,x){var b=f.getMode(p,"text/html"),A=b.name=="null";function D(M){if(f.findModeByName){var g=f.findModeByName(M);g&&(M=g.mime||g.mimes[0])}var J=f.getMode(p,M);return J.name=="null"?null:J}x.highlightFormatting===void 0&&(x.highlightFormatting=!1),x.maxBlockquoteDepth===void 0&&(x.maxBlockquoteDepth=0),x.taskLists===void 0&&(x.taskLists=!1),x.strikethrough===void 0&&(x.strikethrough=!1),x.emoji===void 0&&(x.emoji=!1),x.fencedCodeBlockHighlighting===void 0&&(x.fencedCodeBlockHighlighting=!0),x.fencedCodeBlockDefaultMode===void 0&&(x.fencedCodeBlockDefaultMode="text/plain"),x.xml===void 0&&(x.xml=!0),x.tokenTypeOverrides===void 0&&(x.tokenTypeOverrides={});var k={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(var S in k)k.hasOwnProperty(S)&&x.tokenTypeOverrides[S]&&(k[S]=x.tokenTypeOverrides[S]);var z=/^([*\-_])(?:\s*\1){2,}\s*$/,Z=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,H=/^\[(x| )\](?=\s)/i,ie=x.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,ee=/^ {0,3}(?:\={1,}|-{2,})\s*$/,ye=/^[^#!\[\]*_\\<>` "'(~:]+/,re=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,te=/^\s*\[[^\]]+?\]:.*$/,X=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,Q=" ";function j(M,g,J){return g.f=g.inline=J,J(M,g)}function K(M,g,J){return g.f=g.block=J,J(M,g)}function se(M){return!M||!/\S/.test(M.string)}function V(M){if(M.linkTitle=!1,M.linkHref=!1,M.linkText=!1,M.em=!1,M.strong=!1,M.strikethrough=!1,M.quote=0,M.indentedCode=!1,M.f==xe){var g=A;if(!g){var J=f.innerMode(b,M.htmlState);g=J.mode.name=="xml"&&J.state.tagStart===null&&!J.state.context&&J.state.tokenize.isInText}g&&(M.f=Re,M.block=pe,M.htmlState=null)}return M.trailingSpace=0,M.trailingSpaceNewLine=!1,M.prevLine=M.thisLine,M.thisLine={stream:null},null}function pe(M,g){var J=M.column()===g.indentation,Fe=se(g.prevLine.stream),Ie=g.indentedCode,tt=g.prevLine.hr,Ze=g.list!==!1,Qe=(g.listStack[g.listStack.length-1]||0)+3;g.indentedCode=!1;var Je=g.indentation;if(g.indentationDiff===null&&(g.indentationDiff=g.indentation,Ze)){for(g.list=null;Je<g.listStack[g.listStack.length-1];)g.listStack.pop(),g.listStack.length?g.indentation=g.listStack[g.listStack.length-1]:g.list=!1;g.list!==!1&&(g.indentationDiff=Je-g.listStack[g.listStack.length-1])}var Ue=!Fe&&!tt&&!g.prevLine.header&&(!Ze||!Ie)&&!g.prevLine.fencedCodeEnd,je=(g.list===!1||tt||Fe)&&g.indentation<=Qe&&M.match(z),Ve=null;if(g.indentationDiff>=4&&(Ie||g.prevLine.fencedCodeEnd||g.prevLine.header||Fe))return M.skipToEnd(),g.indentedCode=!0,k.code;if(M.eatSpace())return null;if(J&&g.indentation<=Qe&&(Ve=M.match(ie))&&Ve[1].length<=6)return g.quote=0,g.header=Ve[1].length,g.thisLine.header=!0,x.highlightFormatting&&(g.formatting="header"),g.f=g.inline,le(g);if(g.indentation<=Qe&&M.eat(">"))return g.quote=J?1:g.quote+1,x.highlightFormatting&&(g.formatting="quote"),M.eatSpace(),le(g);if(!je&&!g.setext&&J&&g.indentation<=Qe&&(Ve=M.match(Z))){var ht=Ve[1]?"ol":"ul";return g.indentation=Je+M.current().length,g.list=!0,g.quote=0,g.listStack.push(g.indentation),g.em=!1,g.strong=!1,g.code=!1,g.strikethrough=!1,x.taskLists&&M.match(H,!1)&&(g.taskList=!0),g.f=g.inline,x.highlightFormatting&&(g.formatting=["list","list-"+ht]),le(g)}else{if(J&&g.indentation<=Qe&&(Ve=M.match(re,!0)))return g.quote=0,g.fencedEndRE=new RegExp(Ve[1]+"+ *$"),g.localMode=x.fencedCodeBlockHighlighting&&D(Ve[2]||x.fencedCodeBlockDefaultMode),g.localMode&&(g.localState=f.startState(g.localMode)),g.f=g.block=Xe,x.highlightFormatting&&(g.formatting="code-block"),g.code=-1,le(g);if(g.setext||(!Ue||!Ze)&&!g.quote&&g.list===!1&&!g.code&&!je&&!te.test(M.string)&&(Ve=M.lookAhead(1))&&(Ve=Ve.match(ee)))return g.setext?(g.header=g.setext,g.setext=0,M.skipToEnd(),x.highlightFormatting&&(g.formatting="header")):(g.header=Ve[0].charAt(0)=="="?1:2,g.setext=g.header),g.thisLine.header=!0,g.f=g.inline,le(g);if(je)return M.skipToEnd(),g.hr=!0,g.thisLine.hr=!0,k.hr;if(M.peek()==="[")return j(M,g,Ee)}return j(M,g,g.inline)}function xe(M,g){var J=b.token(M,g.htmlState);if(!A){var Fe=f.innerMode(b,g.htmlState);(Fe.mode.name=="xml"&&Fe.state.tagStart===null&&!Fe.state.context&&Fe.state.tokenize.isInText||g.md_inside&&M.current().indexOf(">")>-1)&&(g.f=Re,g.block=pe,g.htmlState=null)}return J}function Xe(M,g){var J=g.listStack[g.listStack.length-1]||0,Fe=g.indentation<J,Ie=J+3;if(g.fencedEndRE&&g.indentation<=Ie&&(Fe||M.match(g.fencedEndRE))){x.highlightFormatting&&(g.formatting="code-block");var tt;return Fe||(tt=le(g)),g.localMode=g.localState=null,g.block=pe,g.f=Re,g.fencedEndRE=null,g.code=0,g.thisLine.fencedCodeEnd=!0,Fe?K(M,g,g.block):tt}else return g.localMode?g.localMode.token(M,g.localState):(M.skipToEnd(),k.code)}function le(M){var g=[];if(M.formatting){g.push(k.formatting),typeof M.formatting=="string"&&(M.formatting=[M.formatting]);for(var J=0;J<M.formatting.length;J++)g.push(k.formatting+"-"+M.formatting[J]),M.formatting[J]==="header"&&g.push(k.formatting+"-"+M.formatting[J]+"-"+M.header),M.formatting[J]==="quote"&&(!x.maxBlockquoteDepth||x.maxBlockquoteDepth>=M.quote?g.push(k.formatting+"-"+M.formatting[J]+"-"+M.quote):g.push("error"))}if(M.taskOpen)return g.push("meta"),g.length?g.join(" "):null;if(M.taskClosed)return g.push("property"),g.length?g.join(" "):null;if(M.linkHref?g.push(k.linkHref,"url"):(M.strong&&g.push(k.strong),M.em&&g.push(k.em),M.strikethrough&&g.push(k.strikethrough),M.emoji&&g.push(k.emoji),M.linkText&&g.push(k.linkText),M.code&&g.push(k.code),M.image&&g.push(k.image),M.imageAltText&&g.push(k.imageAltText,"link"),M.imageMarker&&g.push(k.imageMarker)),M.header&&g.push(k.header,k.header+"-"+M.header),M.quote&&(g.push(k.quote),!x.maxBlockquoteDepth||x.maxBlockquoteDepth>=M.quote?g.push(k.quote+"-"+M.quote):g.push(k.quote+"-"+x.maxBlockquoteDepth)),M.list!==!1){var Fe=(M.listStack.length-1)%3;Fe?Fe===1?g.push(k.list2):g.push(k.list3):g.push(k.list1)}return M.trailingSpaceNewLine?g.push("trailing-space-new-line"):M.trailingSpace&&g.push("trailing-space-"+(M.trailingSpace%2?"a":"b")),g.length?g.join(" "):null}function Oe(M,g){if(M.match(ye,!0))return le(g)}function Re(M,g){var J=g.text(M,g);if(typeof J<"u")return J;if(g.list)return g.list=null,le(g);if(g.taskList){var Fe=M.match(H,!0)[1]===" ";return Fe?g.taskOpen=!0:g.taskClosed=!0,x.highlightFormatting&&(g.formatting="task"),g.taskList=!1,le(g)}if(g.taskOpen=!1,g.taskClosed=!1,g.header&&M.match(/^#+$/,!0))return x.highlightFormatting&&(g.formatting="header"),le(g);var Ie=M.next();if(g.linkTitle){g.linkTitle=!1;var tt=Ie;Ie==="("&&(tt=")"),tt=(tt+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Ze="^\\s*(?:[^"+tt+"\\\\]+|\\\\\\\\|\\\\.)"+tt;if(M.match(new RegExp(Ze),!0))return k.linkHref}if(Ie==="`"){var Qe=g.formatting;x.highlightFormatting&&(g.formatting="code"),M.eatWhile("`");var Je=M.current().length;if(g.code==0&&(!g.quote||Je==1))return g.code=Je,le(g);if(Je==g.code){var Ue=le(g);return g.code=0,Ue}else return g.formatting=Qe,le(g)}else if(g.code)return le(g);if(Ie==="\\"&&(M.next(),x.highlightFormatting)){var je=le(g),Ve=k.formatting+"-escape";return je?je+" "+Ve:Ve}if(Ie==="!"&&M.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return g.imageMarker=!0,g.image=!0,x.highlightFormatting&&(g.formatting="image"),le(g);if(Ie==="["&&g.imageMarker&&M.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return g.imageMarker=!1,g.imageAltText=!0,x.highlightFormatting&&(g.formatting="image"),le(g);if(Ie==="]"&&g.imageAltText){x.highlightFormatting&&(g.formatting="image");var je=le(g);return g.imageAltText=!1,g.image=!1,g.inline=g.f=P,je}if(Ie==="["&&!g.image)return g.linkText&&M.match(/^.*?\]/)||(g.linkText=!0,x.highlightFormatting&&(g.formatting="link")),le(g);if(Ie==="]"&&g.linkText){x.highlightFormatting&&(g.formatting="link");var je=le(g);return g.linkText=!1,g.inline=g.f=M.match(/\(.*?\)| ?\[.*?\]/,!1)?P:Re,je}if(Ie==="<"&&M.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=Pe,x.highlightFormatting&&(g.formatting="link");var je=le(g);return je?je+=" ":je="",je+k.linkInline}if(Ie==="<"&&M.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){g.f=g.inline=Pe,x.highlightFormatting&&(g.formatting="link");var je=le(g);return je?je+=" ":je="",je+k.linkEmail}if(x.xml&&Ie==="<"&&M.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ht=M.string.indexOf(">",M.pos);if(ht!=-1){var Ce=M.string.substring(M.start,ht);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ce)&&(g.md_inside=!0)}return M.backUp(1),g.htmlState=f.startState(b),K(M,g,xe)}if(x.xml&&Ie==="<"&&M.match(/^\/\w*?>/))return g.md_inside=!1,"tag";if(Ie==="*"||Ie==="_"){for(var Ct=1,Lt=M.pos==1?" ":M.string.charAt(M.pos-2);Ct<3&&M.eat(Ie);)Ct++;var ot=M.peek()||" ",Nt=!/\s/.test(ot)&&(!X.test(ot)||/\s/.test(Lt)||X.test(Lt)),we=!/\s/.test(Lt)&&(!X.test(Lt)||/\s/.test(ot)||X.test(ot)),xt=null,Jt=null;if(Ct%2&&(!g.em&&Nt&&(Ie==="*"||!we||X.test(Lt))?xt=!0:g.em==Ie&&we&&(Ie==="*"||!Nt||X.test(ot))&&(xt=!1)),Ct>1&&(!g.strong&&Nt&&(Ie==="*"||!we||X.test(Lt))?Jt=!0:g.strong==Ie&&we&&(Ie==="*"||!Nt||X.test(ot))&&(Jt=!1)),Jt!=null||xt!=null){x.highlightFormatting&&(g.formatting=xt==null?"strong":Jt==null?"em":"strong em"),xt===!0&&(g.em=Ie),Jt===!0&&(g.strong=Ie);var Ue=le(g);return xt===!1&&(g.em=!1),Jt===!1&&(g.strong=!1),Ue}}else if(Ie===" "&&(M.eat("*")||M.eat("_"))){if(M.peek()===" ")return le(g);M.backUp(1)}if(x.strikethrough){if(Ie==="~"&&M.eatWhile(Ie)){if(g.strikethrough){x.highlightFormatting&&(g.formatting="strikethrough");var Ue=le(g);return g.strikethrough=!1,Ue}else if(M.match(/^[^\s]/,!1))return g.strikethrough=!0,x.highlightFormatting&&(g.formatting="strikethrough"),le(g)}else if(Ie===" "&&M.match("~~",!0)){if(M.peek()===" ")return le(g);M.backUp(2)}}if(x.emoji&&Ie===":"&&M.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){g.emoji=!0,x.highlightFormatting&&(g.formatting="emoji");var wn=le(g);return g.emoji=!1,wn}return Ie===" "&&(M.match(/^ +$/,!1)?g.trailingSpace++:g.trailingSpace&&(g.trailingSpaceNewLine=!0)),le(g)}function Pe(M,g){var J=M.next();if(J===">"){g.f=g.inline=Re,x.highlightFormatting&&(g.formatting="link");var Fe=le(g);return Fe?Fe+=" ":Fe="",Fe+k.linkInline}return M.match(/^[^>]+/,!0),k.linkInline}function P(M,g){if(M.eatSpace())return null;var J=M.next();return J==="("||J==="["?(g.f=g.inline=ae(J==="("?")":"]"),x.highlightFormatting&&(g.formatting="link-string"),g.linkHref=!0,le(g)):"error"}var ce={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function ae(M){return function(g,J){var Fe=g.next();if(Fe===M){J.f=J.inline=Re,x.highlightFormatting&&(J.formatting="link-string");var Ie=le(J);return J.linkHref=!1,Ie}return g.match(ce[M]),J.linkHref=!0,le(J)}}function Ee(M,g){return M.match(/^([^\]\\]|\\.)*\]:/,!1)?(g.f=$e,M.next(),x.highlightFormatting&&(g.formatting="link"),g.linkText=!0,le(g)):j(M,g,Re)}function $e(M,g){if(M.match("]:",!0)){g.f=g.inline=pt,x.highlightFormatting&&(g.formatting="link");var J=le(g);return g.linkText=!1,J}return M.match(/^([^\]\\]|\\.)+/,!0),k.linkText}function pt(M,g){return M.eatSpace()?null:(M.match(/^[^\s]+/,!0),M.peek()===void 0?g.linkTitle=!0:M.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),g.f=g.inline=Re,k.linkHref+" url")}var lt={startState:function(){return{f:pe,prevLine:{stream:null},thisLine:{stream:null},block:pe,htmlState:null,indentation:0,inline:Re,text:Oe,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(M){return{f:M.f,prevLine:M.prevLine,thisLine:M.thisLine,block:M.block,htmlState:M.htmlState&&f.copyState(b,M.htmlState),indentation:M.indentation,localMode:M.localMode,localState:M.localMode?f.copyState(M.localMode,M.localState):null,inline:M.inline,text:M.text,formatting:!1,linkText:M.linkText,linkTitle:M.linkTitle,linkHref:M.linkHref,code:M.code,em:M.em,strong:M.strong,strikethrough:M.strikethrough,emoji:M.emoji,header:M.header,setext:M.setext,hr:M.hr,taskList:M.taskList,list:M.list,listStack:M.listStack.slice(0),quote:M.quote,indentedCode:M.indentedCode,trailingSpace:M.trailingSpace,trailingSpaceNewLine:M.trailingSpaceNewLine,md_inside:M.md_inside,fencedEndRE:M.fencedEndRE}},token:function(M,g){if(g.formatting=!1,M!=g.thisLine.stream){if(g.header=0,g.hr=!1,M.match(/^\s*$/,!0))return V(g),null;if(g.prevLine=g.thisLine,g.thisLine={stream:M},g.taskList=!1,g.trailingSpace=0,g.trailingSpaceNewLine=!1,!g.localState&&(g.f=g.block,g.f!=xe)){var J=M.match(/^\s*/,!0)[0].replace(/\t/g,Q).length;if(g.indentation=J,g.indentationDiff=null,J>0)return null}}return g.f(M,g)},innerMode:function(M){return M.block==xe?{state:M.htmlState,mode:b}:M.localState?{state:M.localState,mode:M.localMode}:{state:M,mode:lt}},indent:function(M,g,J){return M.block==xe&&b.indent?b.indent(M.htmlState,g,J):M.localState&&M.localMode.indent?M.localMode.indent(M.localState,g,J):f.Pass},blankLine:V,getType:le,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return lt},"xml"),f.defineMIME("text/markdown","markdown"),f.defineMIME("text/x-markdown","markdown")})})()),Ml.exports}var zl={exports:{}},Hl;function Wl(){return Hl||(Hl=1,(function(y,c){(function(f){f(un())})(function(f){f.overlayMode=function(p,x,b){return{startState:function(){return{base:f.startState(p),overlay:f.startState(x),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(A){return{base:f.copyState(p,A.base),overlay:f.copyState(x,A.overlay),basePos:A.basePos,baseCur:null,overlayPos:A.overlayPos,overlayCur:null}},token:function(A,D){return(A!=D.streamSeen||Math.min(D.basePos,D.overlayPos)<A.start)&&(D.streamSeen=A,D.basePos=D.overlayPos=A.start),A.start==D.basePos&&(D.baseCur=p.token(A,D.base),D.basePos=A.pos),A.start==D.overlayPos&&(A.pos=A.start,D.overlayCur=x.token(A,D.overlay),D.overlayPos=A.pos),A.pos=Math.min(D.basePos,D.overlayPos),D.overlayCur==null?D.baseCur:D.baseCur!=null&&D.overlay.combineTokens||b&&D.overlay.combineTokens==null?D.baseCur+" "+D.overlayCur:D.overlayCur},indent:p.indent&&function(A,D,k){return p.indent(A.base,D,k)},electricChars:p.electricChars,innerMode:function(A){return{state:A.base,mode:p}},blankLine:function(A){var D,k;return p.blankLine&&(D=p.blankLine(A.base)),x.blankLine&&(k=x.blankLine(A.overlay)),k==null?D:b&&D!=null?D+" "+k:k}}}})})()),zl.exports}var Ul={exports:{}},ql;function Nu(){return ql||(ql=1,(function(y,c){(function(f){f(un())})(function(f){f.defineOption("placeholder","",function(S,z,Z){var H=Z&&Z!=f.Init;if(z&&!H)S.on("blur",A),S.on("change",D),S.on("swapDoc",D),f.on(S.getInputField(),"compositionupdate",S.state.placeholderCompose=function(){b(S)}),D(S);else if(!z&&H){S.off("blur",A),S.off("change",D),S.off("swapDoc",D),f.off(S.getInputField(),"compositionupdate",S.state.placeholderCompose),p(S);var ie=S.getWrapperElement();ie.className=ie.className.replace(" CodeMirror-empty","")}z&&!S.hasFocus()&&A(S)});function p(S){S.state.placeholder&&(S.state.placeholder.parentNode.removeChild(S.state.placeholder),S.state.placeholder=null)}function x(S){p(S);var z=S.state.placeholder=document.createElement("pre");z.style.cssText="height: 0; overflow: visible",z.style.direction=S.getOption("direction"),z.className="CodeMirror-placeholder CodeMirror-line-like";var Z=S.getOption("placeholder");typeof Z=="string"&&(Z=document.createTextNode(Z)),z.appendChild(Z),S.display.lineSpace.insertBefore(z,S.display.lineSpace.firstChild)}function b(S){setTimeout(function(){var z=!1;if(S.lineCount()==1){var Z=S.getInputField();z=Z.nodeName=="TEXTAREA"?!S.getLine(0).length:!/[^\u200b]/.test(Z.querySelector(".CodeMirror-line").textContent)}z?x(S):p(S)},20)}function A(S){k(S)&&x(S)}function D(S){var z=S.getWrapperElement(),Z=k(S);z.className=z.className.replace(" CodeMirror-empty","")+(Z?" CodeMirror-empty":""),Z?x(S):p(S)}function k(S){return S.lineCount()===1&&S.getLine(0)===""}})})()),Ul.exports}var Gl={exports:{}},$l;function Pu(){return $l||($l=1,(function(y,c){(function(f){f(un())})(function(f){f.defineOption("autoRefresh",!1,function(b,A){b.state.autoRefresh&&(x(b,b.state.autoRefresh),b.state.autoRefresh=null),A&&b.display.wrapper.offsetHeight==0&&p(b,b.state.autoRefresh={delay:A.delay||250})});function p(b,A){function D(){b.display.wrapper.offsetHeight?(x(b,A),b.display.lastWrapHeight!=b.display.wrapper.clientHeight&&b.refresh()):A.timeout=setTimeout(D,A.delay)}A.timeout=setTimeout(D,A.delay),A.hurry=function(){clearTimeout(A.timeout),A.timeout=setTimeout(D,50)},f.on(window,"mouseup",A.hurry),f.on(window,"keyup",A.hurry)}function x(b,A){clearTimeout(A.timeout),f.off(window,"mouseup",A.hurry),f.off(window,"keyup",A.hurry)}})})()),Gl.exports}var jl={exports:{}},Xl;function zu(){return Xl||(Xl=1,(function(y,c){(function(f){f(un())})(function(f){f.defineOption("styleSelectedText",!1,function(H,ie,ee){var ye=ee&&ee!=f.Init;ie&&!ye?(H.state.markedSelection=[],H.state.markedSelectionStyle=typeof ie=="string"?ie:"CodeMirror-selectedtext",z(H),H.on("cursorActivity",p),H.on("change",x)):!ie&&ye&&(H.off("cursorActivity",p),H.off("change",x),S(H),H.state.markedSelection=H.state.markedSelectionStyle=null)});function p(H){H.state.markedSelection&&H.operation(function(){Z(H)})}function x(H){H.state.markedSelection&&H.state.markedSelection.length&&H.operation(function(){S(H)})}var b=8,A=f.Pos,D=f.cmpPos;function k(H,ie,ee,ye){if(D(ie,ee)!=0)for(var re=H.state.markedSelection,te=H.state.markedSelectionStyle,X=ie.line;;){var Q=X==ie.line?ie:A(X,0),j=X+b,K=j>=ee.line,se=K?ee:A(j,0),V=H.markText(Q,se,{className:te});if(ye==null?re.push(V):re.splice(ye++,0,V),K)break;X=j}}function S(H){for(var ie=H.state.markedSelection,ee=0;ee<ie.length;++ee)ie[ee].clear();ie.length=0}function z(H){S(H);for(var ie=H.listSelections(),ee=0;ee<ie.length;ee++)k(H,ie[ee].from(),ie[ee].to())}function Z(H){if(!H.somethingSelected())return S(H);if(H.listSelections().length>1)return z(H);var ie=H.getCursor("start"),ee=H.getCursor("end"),ye=H.state.markedSelection;if(!ye.length)return k(H,ie,ee);var re=ye[0].find(),te=ye[ye.length-1].find();if(!re||!te||ee.line-ie.line<=b||D(ie,te.to)>=0||D(ee,re.from)<=0)return z(H);for(;D(ie,re.from)>0;)ye.shift().clear(),re=ye[0].find();for(D(ie,re.from)<0&&(re.to.line-ie.line<b?(ye.shift().clear(),k(H,ie,re.to,0)):k(H,ie,re.from,0));D(ee,te.to)<0;)ye.pop().clear(),te=ye[ye.length-1].find();D(ee,te.to)>0&&(ee.line-te.from.line<b?(ye.pop().clear(),k(H,te.from,ee)):k(H,te.to,ee))}})})()),jl.exports}var Kl={exports:{}},Yl;function Hu(){return Yl||(Yl=1,(function(y,c){(function(f){f(un())})(function(f){var p=f.Pos;function x(X){var Q=X.flags;return Q??(X.ignoreCase?"i":"")+(X.global?"g":"")+(X.multiline?"m":"")}function b(X,Q){for(var j=x(X),K=j,se=0;se<Q.length;se++)K.indexOf(Q.charAt(se))==-1&&(K+=Q.charAt(se));return j==K?X:new RegExp(X.source,K)}function A(X){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(X.source)}function D(X,Q,j){Q=b(Q,"g");for(var K=j.line,se=j.ch,V=X.lastLine();K<=V;K++,se=0){Q.lastIndex=se;var pe=X.getLine(K),xe=Q.exec(pe);if(xe)return{from:p(K,xe.index),to:p(K,xe.index+xe[0].length),match:xe}}}function k(X,Q,j){if(!A(Q))return D(X,Q,j);Q=b(Q,"gm");for(var K,se=1,V=j.line,pe=X.lastLine();V<=pe;){for(var xe=0;xe<se&&!(V>pe);xe++){var Xe=X.getLine(V++);K=K==null?Xe:K+`
27
+ `+Xe}se=se*2,Q.lastIndex=j.ch;var le=Q.exec(K);if(le){var Oe=K.slice(0,le.index).split(`
28
+ `),Re=le[0].split(`
29
+ `),Pe=j.line+Oe.length-1,P=Oe[Oe.length-1].length;return{from:p(Pe,P),to:p(Pe+Re.length-1,Re.length==1?P+Re[0].length:Re[Re.length-1].length),match:le}}}}function S(X,Q,j){for(var K,se=0;se<=X.length;){Q.lastIndex=se;var V=Q.exec(X);if(!V)break;var pe=V.index+V[0].length;if(pe>X.length-j)break;(!K||pe>K.index+K[0].length)&&(K=V),se=V.index+1}return K}function z(X,Q,j){Q=b(Q,"g");for(var K=j.line,se=j.ch,V=X.firstLine();K>=V;K--,se=-1){var pe=X.getLine(K),xe=S(pe,Q,se<0?0:pe.length-se);if(xe)return{from:p(K,xe.index),to:p(K,xe.index+xe[0].length),match:xe}}}function Z(X,Q,j){if(!A(Q))return z(X,Q,j);Q=b(Q,"gm");for(var K,se=1,V=X.getLine(j.line).length-j.ch,pe=j.line,xe=X.firstLine();pe>=xe;){for(var Xe=0;Xe<se&&pe>=xe;Xe++){var le=X.getLine(pe--);K=K==null?le:le+`
30
+ `+K}se*=2;var Oe=S(K,Q,V);if(Oe){var Re=K.slice(0,Oe.index).split(`
31
+ `),Pe=Oe[0].split(`
32
+ `),P=pe+Re.length,ce=Re[Re.length-1].length;return{from:p(P,ce),to:p(P+Pe.length-1,Pe.length==1?ce+Pe[0].length:Pe[Pe.length-1].length),match:Oe}}}}var H,ie;String.prototype.normalize?(H=function(X){return X.normalize("NFD").toLowerCase()},ie=function(X){return X.normalize("NFD")}):(H=function(X){return X.toLowerCase()},ie=function(X){return X});function ee(X,Q,j,K){if(X.length==Q.length)return j;for(var se=0,V=j+Math.max(0,X.length-Q.length);;){if(se==V)return se;var pe=se+V>>1,xe=K(X.slice(0,pe)).length;if(xe==j)return pe;xe>j?V=pe:se=pe+1}}function ye(X,Q,j,K){if(!Q.length)return null;var se=K?H:ie,V=se(Q).split(/\r|\n\r?/);e:for(var pe=j.line,xe=j.ch,Xe=X.lastLine()+1-V.length;pe<=Xe;pe++,xe=0){var le=X.getLine(pe).slice(xe),Oe=se(le);if(V.length==1){var Re=Oe.indexOf(V[0]);if(Re==-1)continue e;var j=ee(le,Oe,Re,se)+xe;return{from:p(pe,ee(le,Oe,Re,se)+xe),to:p(pe,ee(le,Oe,Re+V[0].length,se)+xe)}}else{var Pe=Oe.length-V[0].length;if(Oe.slice(Pe)!=V[0])continue e;for(var P=1;P<V.length-1;P++)if(se(X.getLine(pe+P))!=V[P])continue e;var ce=X.getLine(pe+V.length-1),ae=se(ce),Ee=V[V.length-1];if(ae.slice(0,Ee.length)!=Ee)continue e;return{from:p(pe,ee(le,Oe,Pe,se)+xe),to:p(pe+V.length-1,ee(ce,ae,Ee.length,se))}}}}function re(X,Q,j,K){if(!Q.length)return null;var se=K?H:ie,V=se(Q).split(/\r|\n\r?/);e:for(var pe=j.line,xe=j.ch,Xe=X.firstLine()-1+V.length;pe>=Xe;pe--,xe=-1){var le=X.getLine(pe);xe>-1&&(le=le.slice(0,xe));var Oe=se(le);if(V.length==1){var Re=Oe.lastIndexOf(V[0]);if(Re==-1)continue e;return{from:p(pe,ee(le,Oe,Re,se)),to:p(pe,ee(le,Oe,Re+V[0].length,se))}}else{var Pe=V[V.length-1];if(Oe.slice(0,Pe.length)!=Pe)continue e;for(var P=1,j=pe-V.length+1;P<V.length-1;P++)if(se(X.getLine(j+P))!=V[P])continue e;var ce=X.getLine(pe+1-V.length),ae=se(ce);if(ae.slice(ae.length-V[0].length)!=V[0])continue e;return{from:p(pe+1-V.length,ee(ce,ae,ce.length-V[0].length,se)),to:p(pe,ee(le,Oe,Pe.length,se))}}}}function te(X,Q,j,K){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=X,j=j?X.clipPos(j):p(0,0),this.pos={from:j,to:j};var se;typeof K=="object"?se=K.caseFold:(se=K,K=null),typeof Q=="string"?(se==null&&(se=!1),this.matches=function(V,pe){return(V?re:ye)(X,Q,pe,se)}):(Q=b(Q,"gm"),!K||K.multiline!==!1?this.matches=function(V,pe){return(V?Z:k)(X,Q,pe)}:this.matches=function(V,pe){return(V?z:D)(X,Q,pe)})}te.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(X){var Q=this.doc.clipPos(X?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(Q=p(Q.line,Q.ch),X?(Q.ch--,Q.ch<0&&(Q.line--,Q.ch=(this.doc.getLine(Q.line)||"").length)):(Q.ch++,Q.ch>(this.doc.getLine(Q.line)||"").length&&(Q.ch=0,Q.line++)),f.cmpPos(Q,this.doc.clipPos(Q))!=0))return this.atOccurrence=!1;var j=this.matches(X,Q);if(this.afterEmptyMatch=j&&f.cmpPos(j.from,j.to)==0,j)return this.pos=j,this.atOccurrence=!0,this.pos.match||!0;var K=p(X?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:K,to:K},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(X,Q){if(this.atOccurrence){var j=f.splitLines(X);this.doc.replaceRange(j,this.pos.from,this.pos.to,Q),this.pos.to=p(this.pos.from.line+j.length-1,j[j.length-1].length+(j.length==1?this.pos.from.ch:0))}}},f.defineExtension("getSearchCursor",function(X,Q,j){return new te(this.doc,X,Q,j)}),f.defineDocExtension("getSearchCursor",function(X,Q,j){return new te(this,X,Q,j)}),f.defineExtension("selectMatches",function(X,Q){for(var j=[],K=this.getSearchCursor(X,this.getCursor("from"),Q);K.findNext()&&!(f.cmpPos(K.to(),this.getCursor("to"))>0);)j.push({anchor:K.from(),head:K.to()});j.length&&this.setSelections(j,0)})})})()),Kl.exports}var Zl={exports:{}},Ql;function Wu(){return Ql||(Ql=1,(function(y,c){(function(f){f(un(),Pl(),Wl())})(function(f){var p=/^((?:(?: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;f.defineMode("gfm",function(x,b){var A=0;function D(Z){return Z.code=!1,null}var k={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(Z){return{code:Z.code,codeBlock:Z.codeBlock,ateSpace:Z.ateSpace}},token:function(Z,H){if(H.combineTokens=null,H.codeBlock)return Z.match(/^```+/)?(H.codeBlock=!1,null):(Z.skipToEnd(),null);if(Z.sol()&&(H.code=!1),Z.sol()&&Z.match(/^```+/))return Z.skipToEnd(),H.codeBlock=!0,null;if(Z.peek()==="`"){Z.next();var ie=Z.pos;Z.eatWhile("`");var ee=1+Z.pos-ie;return H.code?ee===A&&(H.code=!1):(A=ee,H.code=!0),null}else if(H.code)return Z.next(),null;if(Z.eatSpace())return H.ateSpace=!0,null;if((Z.sol()||H.ateSpace)&&(H.ateSpace=!1,b.gitHubSpice!==!1)){if(Z.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return H.combineTokens=!0,"link";if(Z.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return H.combineTokens=!0,"link"}return Z.match(p)&&Z.string.slice(Z.start-2,Z.start)!="]("&&(Z.start==0||/\W/.test(Z.string.charAt(Z.start-1)))?(H.combineTokens=!0,"link"):(Z.next(),null)},blankLine:D},S={taskLists:!0,strikethrough:!0,emoji:!0};for(var z in b)S[z]=b[z];return S.name="markdown",f.overlayMode(f.getMode(x,S),k)},"markdown"),f.defineMIME("text/x-gfm","gfm")})})()),Zl.exports}function Uu(y){throw new Error('Could not dynamically require "'+y+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var na={exports:{}};const qu=Mu(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Jl;function Gu(){return Jl||(Jl=1,(function(y){var c;(function(){c=function(f,p,x,b){b=b||{},this.dictionary=null,this.rules={},this.dictionaryTable={},this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=b.flags||{},this.memoized={},this.loaded=!1;var A=this,D,k,S,z,Z;if(f)if(A.dictionary=f,p&&x)re();else if(typeof window<"u"&&(window.chrome&&window.chrome.runtime||window.browser&&window.browser.runtime)){var H=window.chrome&&window.chrome.runtime?window.chrome.runtime:window.browser.runtime;b.dictionaryPath?D=b.dictionaryPath:D="typo/dictionaries",p||ie(H.getURL(D+"/"+f+"/"+f+".aff"),ee),x||ie(H.getURL(D+"/"+f+"/"+f+".dic"),ye)}else b.dictionaryPath?D=b.dictionaryPath:typeof __dirname<"u"?D=__dirname+"/dictionaries":D="./dictionaries",p||ie(D+"/"+f+"/"+f+".aff",ee),x||ie(D+"/"+f+"/"+f+".dic",ye);function ie(te,X){var Q=A._readFile(te,null,b==null?void 0:b.asyncLoad);b!=null&&b.asyncLoad?Q.then(function(j){X(j)}):X(Q)}function ee(te){p=te,x&&re()}function ye(te){x=te,p&&re()}function re(){for(A.rules=A._parseAFF(p),A.compoundRuleCodes={},k=0,z=A.compoundRules.length;k<z;k++){var te=A.compoundRules[k];for(S=0,Z=te.length;S<Z;S++)A.compoundRuleCodes[te[S]]=[]}"ONLYINCOMPOUND"in A.flags&&(A.compoundRuleCodes[A.flags.ONLYINCOMPOUND]=[]),A.dictionaryTable=A._parseDIC(x);for(k in A.compoundRuleCodes)A.compoundRuleCodes[k].length===0&&delete A.compoundRuleCodes[k];for(k=0,z=A.compoundRules.length;k<z;k++){var X=A.compoundRules[k],Q="";for(S=0,Z=X.length;S<Z;S++){var j=X[S];j in A.compoundRuleCodes?Q+="("+A.compoundRuleCodes[j].join("|")+")":Q+=j}A.compoundRules[k]=new RegExp("^"+Q+"$","i")}A.loaded=!0,b!=null&&b.asyncLoad&&(b!=null&&b.loadedCallback)&&b.loadedCallback(A)}return this},c.prototype={load:function(f){for(var p in f)f.hasOwnProperty(p)&&(this[p]=f[p]);return this},_readFile:function(f,p,x){var b;if(p=p||"utf8",typeof XMLHttpRequest<"u"){var A=new XMLHttpRequest;if(A.open("GET",f,!!x),(b=A.overrideMimeType)===null||b===void 0||b.call(A,"text/plain; charset="+p),x){var D=new Promise(function(S,z){A.onload=function(){A.status===200?S(A.responseText):z(A.statusText)},A.onerror=function(){z(A.statusText)}});return A.send(null),D}else return A.send(null),A.responseText}else if(typeof Uu<"u"){var k=qu;try{if(k.existsSync(f))return k.readFileSync(f,p);console.log("Path "+f+" does not exist.")}catch(S){console.log(S)}return""}return""},_parseAFF:function(f){var p={},x,b,A,D,k,S,z,Z,H=f.split(/\r?\n/);for(k=0,z=H.length;k<z;k++)if(x=this._removeAffixComments(H[k]),x=x.trim(),!!x){var ie=x.split(/\s+/),ee=ie[0];if(ee==="PFX"||ee==="SFX"){var ye=ie[1],re=ie[2];A=parseInt(ie[3],10);var te=[];for(S=k+1,Z=k+1+A;S<Z;S++){b=H[S],D=b.split(/\s+/);var X=D[2],Q=D[3].split("/"),j=Q[0];j==="0"&&(j="");var K=this.parseRuleCodes(Q[1]),se=D[4],V={add:j};K.length>0&&(V.continuationClasses=K),se!=="."&&(ee==="SFX"?V.match=new RegExp(se+"$"):V.match=new RegExp("^"+se)),X!="0"&&(ee==="SFX"?V.remove=new RegExp(X+"$"):V.remove=X),te.push(V)}p[ye]={type:ee,combineable:re==="Y",entries:te},k+=A}else if(ee==="COMPOUNDRULE"){for(A=parseInt(ie[1],10),S=k+1,Z=k+1+A;S<Z;S++)x=H[S],D=x.split(/\s+/),this.compoundRules.push(D[1]);k+=A}else ee==="REP"?(D=x.split(/\s+/),D.length===3&&this.replacementTable.push([D[1],D[2]])):this.flags[ee]=ie[1]}return p},_removeAffixComments:function(f){return f.match(/^\s*#/)?"":f},_parseDIC:function(f){f=this._removeDicComments(f);var p=f.split(/\r?\n/),x={};function b(Oe,Re){x.hasOwnProperty(Oe)||(x[Oe]=null),Re.length>0&&(x[Oe]===null&&(x[Oe]=[]),x[Oe].push(Re))}for(var A=1,D=p.length;A<D;A++){var k=p[A];if(k){var S=k.replace(/\s.*$/,""),z=S.split("/",2),Z=z[0];if(z.length>1){var H=this.parseRuleCodes(z[1]);(!("NEEDAFFIX"in this.flags)||H.indexOf(this.flags.NEEDAFFIX)===-1)&&b(Z,H);for(var ie=0,ee=H.length;ie<ee;ie++){var ye=H[ie],re=this.rules[ye];if(re)for(var te=this._applyRule(Z,re),X=0,Q=te.length;X<Q;X++){var j=te[X];if(b(j,[]),re.combineable)for(var K=ie+1;K<ee;K++){var se=H[K],V=this.rules[se];if(V&&V.combineable&&re.type!=V.type)for(var pe=this._applyRule(j,V),xe=0,Xe=pe.length;xe<Xe;xe++){var le=pe[xe];b(le,[])}}}ye in this.compoundRuleCodes&&this.compoundRuleCodes[ye].push(Z)}}else b(Z.trim(),[])}}return x},_removeDicComments:function(f){return f=f.replace(/^\t.*$/mg,""),f},parseRuleCodes:function(f){if(f)if("FLAG"in this.flags)if(this.flags.FLAG==="long"){for(var p=[],x=0,b=f.length;x<b;x+=2)p.push(f.substr(x,2));return p}else return this.flags.FLAG==="num"?f.split(","):this.flags.FLAG==="UTF-8"?Array.from(f):f.split("");else return f.split("");else return[]},_applyRule:function(f,p){for(var x=p.entries,b=[],A=0,D=x.length;A<D;A++){var k=x[A];if(!k.match||f.match(k.match)){var S=f;if(k.remove&&(S=S.replace(k.remove,"")),p.type==="SFX"?S=S+k.add:S=k.add+S,b.push(S),"continuationClasses"in k)for(var z=0,Z=k.continuationClasses.length;z<Z;z++){var H=this.rules[k.continuationClasses[z]];H&&(b=b.concat(this._applyRule(S,H)))}}}return b},check:function(f){if(!this.loaded)throw"Dictionary not loaded.";if(!f)return!1;var p=f.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.checkExact(p))return!0;if(p.toUpperCase()===p){var x=p[0]+p.substring(1).toLowerCase();if(this.hasFlag(x,"KEEPCASE"))return!1;if(this.checkExact(x)||this.checkExact(p.toLowerCase()))return!0}var b=p[0].toLowerCase()+p.substring(1);if(b!==p){if(this.hasFlag(b,"KEEPCASE"))return!1;if(this.checkExact(b))return!0}return!1},checkExact:function(f){if(!this.loaded)throw"Dictionary not loaded.";var p=this.dictionaryTable[f],x,b;if(typeof p>"u"){if("COMPOUNDMIN"in this.flags&&f.length>=this.flags.COMPOUNDMIN){for(x=0,b=this.compoundRules.length;x<b;x++)if(f.match(this.compoundRules[x]))return!0}}else{if(p===null)return!0;if(typeof p=="object"){for(x=0,b=p.length;x<b;x++)if(!this.hasFlag(f,"ONLYINCOMPOUND",p[x]))return!0}}return!1},hasFlag:function(f,p,x){if(!this.loaded)throw"Dictionary not loaded.";return!!(p in this.flags&&(typeof x>"u"&&(x=Array.prototype.concat.apply([],this.dictionaryTable[f])),x&&x.indexOf(this.flags[p])!==-1))},alphabet:"",suggest:function(f,p){if(!this.loaded)throw"Dictionary not loaded.";if(p=p||5,this.memoized.hasOwnProperty(f)){var x=this.memoized[f].limit;if(p<=x||this.memoized[f].suggestions.length<x)return this.memoized[f].suggestions.slice(0,p)}if(this.check(f))return[];for(var b=0,A=this.replacementTable.length;b<A;b++){var D=this.replacementTable[b];if(f.indexOf(D[0])!==-1){var k=f.replace(D[0],D[1]);if(this.check(k))return[k]}}if(!this.alphabet){this.alphabet="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ","TRY"in this.flags&&(this.alphabet+=this.flags.TRY),"WORDCHARS"in this.flags&&(this.alphabet+=this.flags.WORDCHARS);var S=this.alphabet.split("");S.sort();for(var z={},b=0;b<S.length;b++)z[S[b]]=!0;this.alphabet="";for(var b in z)this.alphabet+=b}var Z=this;function H(ee,ye){var re={},te,X,Q,j,K=Z.alphabet.length;for(var se in ee)for(te=0,Q=se.length+1;te<Q;te++){var V=[se.substring(0,te),se.substring(te)];if(V[1]&&(j=V[0]+V[1].substring(1),(!ye||Z.check(j))&&(j in re?re[j]+=1:re[j]=1)),V[1].length>1&&V[1][1]!==V[1][0]&&(j=V[0]+V[1][1]+V[1][0]+V[1].substring(2),(!ye||Z.check(j))&&(j in re?re[j]+=1:re[j]=1)),V[1]){var pe=V[1].substring(0,1).toUpperCase()===V[1].substring(0,1)?"uppercase":"lowercase";for(X=0;X<K;X++){var xe=Z.alphabet[X];pe==="uppercase"&&(xe=xe.toUpperCase()),xe!=V[1].substring(0,1)&&(j=V[0]+xe+V[1].substring(1),(!ye||Z.check(j))&&(j in re?re[j]+=1:re[j]=1))}}if(V[1])for(X=0;X<K;X++){var pe=V[0].substring(-1).toUpperCase()===V[0].substring(-1)&&V[1].substring(0,1).toUpperCase()===V[1].substring(0,1)?"uppercase":"lowercase",xe=Z.alphabet[X];pe==="uppercase"&&(xe=xe.toUpperCase()),j=V[0]+xe+V[1],(!ye||Z.check(j))&&(j in re?re[j]+=1:re[j]=1)}}return re}function ie(ee){var ye,re=H((ye={},ye[ee]=!0,ye)),te=H(re,!0),X=te;for(var Q in re)Z.check(Q)&&(Q in X?X[Q]+=re[Q]:X[Q]=re[Q]);var j,K=[];for(j in X)X.hasOwnProperty(j)&&(Z.hasFlag(j,"PRIORITYSUGGEST")&&(X[j]+=1e3),K.push([j,X[j]]));function se(Xe,le){var Oe=Xe[1],Re=le[1];return Oe<Re?-1:Oe>Re?1:le[0].localeCompare(Xe[0])}K.sort(se).reverse();var V=[],pe="lowercase";ee.toUpperCase()===ee?pe="uppercase":ee.substr(0,1).toUpperCase()+ee.substr(1).toLowerCase()===ee&&(pe="capitalized");var xe=p;for(j=0;j<Math.min(xe,K.length);j++)pe==="uppercase"?K[j][0]=K[j][0].toUpperCase():pe==="capitalized"&&(K[j][0]=K[j][0].substr(0,1).toUpperCase()+K[j][0].substr(1)),!Z.hasFlag(K[j][0],"NOSUGGEST")&&V.indexOf(K[j][0])===-1?V.push(K[j][0]):xe++;return V}return this.memoized[f]={suggestions:ie(f),limit:p},this.memoized[f].suggestions}}})(),y.exports=c})(na)),na.exports}var ra,Vl;function $u(){if(Vl)return ra;Vl=1;var y=Gu();function c(f){if(f=f||{},typeof f.codeMirrorInstance!="function"||typeof f.codeMirrorInstance.defineMode!="function"){console.log("CodeMirror Spell Checker: You must provide an instance of CodeMirror via the option `codeMirrorInstance`");return}String.prototype.includes||(String.prototype.includes=function(){return String.prototype.indexOf.apply(this,arguments)!==-1}),f.codeMirrorInstance.defineMode("spell-checker",function(p){if(!c.aff_loading){c.aff_loading=!0;var x=new XMLHttpRequest;x.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),x.onload=function(){x.readyState===4&&x.status===200&&(c.aff_data=x.responseText,c.num_loaded++,c.num_loaded==2&&(c.typo=new y("en_US",c.aff_data,c.dic_data,{platform:"any"})))},x.send(null)}if(!c.dic_loading){c.dic_loading=!0;var b=new XMLHttpRequest;b.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),b.onload=function(){b.readyState===4&&b.status===200&&(c.dic_data=b.responseText,c.num_loaded++,c.num_loaded==2&&(c.typo=new y("en_US",c.aff_data,c.dic_data,{platform:"any"})))},b.send(null)}var A='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',D={token:function(S){var z=S.peek(),Z="";if(A.includes(z))return S.next(),null;for(;(z=S.peek())!=null&&!A.includes(z);)Z+=z,S.next();return c.typo&&!c.typo.check(Z)?"spell-error":null}},k=f.codeMirrorInstance.getMode(p,p.backdrop||"text/plain");return f.codeMirrorInstance.overlayMode(k,D,!0)})}return c.num_loaded=0,c.aff_loading=!1,c.dic_loading=!1,c.aff_data="",c.dic_data="",c.typo,ra=c,ra}var ia={},eo;function ju(){return eo||(eo=1,(function(y){function c(G,$){for(var I=0;I<$.length;I++){var v=$[I];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(G,k(v.key),v)}}function f(G,$,I){return I&&c(G,I),Object.defineProperty(G,"prototype",{writable:!1}),G}function p(){return p=Object.assign?Object.assign.bind():function(G){for(var $=1;$<arguments.length;$++){var I=arguments[$];for(var v in I)Object.prototype.hasOwnProperty.call(I,v)&&(G[v]=I[v])}return G},p.apply(this,arguments)}function x(G,$){if(G){if(typeof G=="string")return b(G,$);var I=Object.prototype.toString.call(G).slice(8,-1);if(I==="Object"&&G.constructor&&(I=G.constructor.name),I==="Map"||I==="Set")return Array.from(G);if(I==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(I))return b(G,$)}}function b(G,$){($==null||$>G.length)&&($=G.length);for(var I=0,v=new Array($);I<$;I++)v[I]=G[I];return v}function A(G,$){var I=typeof Symbol<"u"&&G[Symbol.iterator]||G["@@iterator"];if(I)return(I=I.call(G)).next.bind(I);if(Array.isArray(G)||(I=x(G))||$){I&&(G=I);var v=0;return function(){return v>=G.length?{done:!0}:{done:!1,value:G[v++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
33
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D(G,$){if(typeof G!="object"||G===null)return G;var I=G[Symbol.toPrimitive];if(I!==void 0){var v=I.call(G,$);if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(G)}function k(G){var $=D(G,"string");return typeof $=="symbol"?$:String($)}function S(){return{async:!1,baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,hooks:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}y.defaults=S();function z(G){y.defaults=G}var Z=/[&<>"']/,H=new RegExp(Z.source,"g"),ie=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,ee=new RegExp(ie.source,"g"),ye={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},re=function($){return ye[$]};function te(G,$){if($){if(Z.test(G))return G.replace(H,re)}else if(ie.test(G))return G.replace(ee,re);return G}var X=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Q(G){return G.replace(X,function($,I){return I=I.toLowerCase(),I==="colon"?":":I.charAt(0)==="#"?I.charAt(1)==="x"?String.fromCharCode(parseInt(I.substring(2),16)):String.fromCharCode(+I.substring(1)):""})}var j=/(^|[^\[])\^/g;function K(G,$){G=typeof G=="string"?G:G.source,$=$||"";var I={replace:function(m,B){return B=B.source||B,B=B.replace(j,"$1"),G=G.replace(m,B),I},getRegex:function(){return new RegExp(G,$)}};return I}var se=/[^\w:]/g,V=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function pe(G,$,I){if(G){var v;try{v=decodeURIComponent(Q(I)).replace(se,"").toLowerCase()}catch{return null}if(v.indexOf("javascript:")===0||v.indexOf("vbscript:")===0||v.indexOf("data:")===0)return null}$&&!V.test(I)&&(I=Re($,I));try{I=encodeURI(I).replace(/%25/g,"%")}catch{return null}return I}var xe={},Xe=/^[^:]+:\/*[^/]*$/,le=/^([^:]+:)[\s\S]*$/,Oe=/^([^:]+:\/*[^/]*)[\s\S]*$/;function Re(G,$){xe[" "+G]||(Xe.test(G)?xe[" "+G]=G+"/":xe[" "+G]=ce(G,"/",!0)),G=xe[" "+G];var I=G.indexOf(":")===-1;return $.substring(0,2)==="//"?I?$:G.replace(le,"$1")+$:$.charAt(0)==="/"?I?$:G.replace(Oe,"$1")+$:G+$}var Pe={exec:function(){}};function P(G,$){var I=G.replace(/\|/g,function(B,o,h){for(var w=!1,T=o;--T>=0&&h[T]==="\\";)w=!w;return w?"|":" |"}),v=I.split(/ \|/),m=0;if(v[0].trim()||v.shift(),v.length>0&&!v[v.length-1].trim()&&v.pop(),v.length>$)v.splice($);else for(;v.length<$;)v.push("");for(;m<v.length;m++)v[m]=v[m].trim().replace(/\\\|/g,"|");return v}function ce(G,$,I){var v=G.length;if(v===0)return"";for(var m=0;m<v;){var B=G.charAt(v-m-1);if(B===$&&!I)m++;else if(B!==$&&I)m++;else break}return G.slice(0,v-m)}function ae(G,$){if(G.indexOf($[1])===-1)return-1;for(var I=G.length,v=0,m=0;m<I;m++)if(G[m]==="\\")m++;else if(G[m]===$[0])v++;else if(G[m]===$[1]&&(v--,v<0))return m;return-1}function Ee(G){G&&G.sanitize&&!G.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")}function $e(G,$){if($<1)return"";for(var I="";$>1;)$&1&&(I+=G),$>>=1,G+=G;return I+G}function pt(G,$,I,v){var m=$.href,B=$.title?te($.title):null,o=G[1].replace(/\\([\[\]])/g,"$1");if(G[0].charAt(0)!=="!"){v.state.inLink=!0;var h={type:"link",raw:I,href:m,title:B,text:o,tokens:v.inlineTokens(o)};return v.state.inLink=!1,h}return{type:"image",raw:I,href:m,title:B,text:te(o)}}function lt(G,$){var I=G.match(/^(\s+)(?:```)/);if(I===null)return $;var v=I[1];return $.split(`
34
+ `).map(function(m){var B=m.match(/^\s+/);if(B===null)return m;var o=B[0];return o.length>=v.length?m.slice(v.length):m}).join(`
35
+ `)}var M=(function(){function G(I){this.options=I||y.defaults}var $=G.prototype;return $.space=function(v){var m=this.rules.block.newline.exec(v);if(m&&m[0].length>0)return{type:"space",raw:m[0]}},$.code=function(v){var m=this.rules.block.code.exec(v);if(m){var B=m[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:m[0],codeBlockStyle:"indented",text:this.options.pedantic?B:ce(B,`
36
+ `)}}},$.fences=function(v){var m=this.rules.block.fences.exec(v);if(m){var B=m[0],o=lt(B,m[3]||"");return{type:"code",raw:B,lang:m[2]?m[2].trim().replace(this.rules.inline._escapes,"$1"):m[2],text:o}}},$.heading=function(v){var m=this.rules.block.heading.exec(v);if(m){var B=m[2].trim();if(/#$/.test(B)){var o=ce(B,"#");(this.options.pedantic||!o||/ $/.test(o))&&(B=o.trim())}return{type:"heading",raw:m[0],depth:m[1].length,text:B,tokens:this.lexer.inline(B)}}},$.hr=function(v){var m=this.rules.block.hr.exec(v);if(m)return{type:"hr",raw:m[0]}},$.blockquote=function(v){var m=this.rules.block.blockquote.exec(v);if(m){var B=m[0].replace(/^ *>[ \t]?/gm,""),o=this.lexer.state.top;this.lexer.state.top=!0;var h=this.lexer.blockTokens(B);return this.lexer.state.top=o,{type:"blockquote",raw:m[0],tokens:h,text:B}}},$.list=function(v){var m=this.rules.block.list.exec(v);if(m){var B,o,h,w,T,L,W,R,F,q,N,de,be=m[1].trim(),ke=be.length>1,ue={type:"list",raw:"",ordered:ke,start:ke?+be.slice(0,-1):"",loose:!1,items:[]};be=ke?"\\d{1,9}\\"+be.slice(-1):"\\"+be,this.options.pedantic&&(be=ke?be:"[*+-]");for(var Ne=new RegExp("^( {0,3}"+be+")((?:[ ][^\\n]*)?(?:\\n|$))");v&&(de=!1,!(!(m=Ne.exec(v))||this.rules.block.hr.test(v)));){if(B=m[0],v=v.substring(B.length),R=m[2].split(`
37
+ `,1)[0].replace(/^\t+/,function(Tt){return" ".repeat(3*Tt.length)}),F=v.split(`
38
+ `,1)[0],this.options.pedantic?(w=2,N=R.trimLeft()):(w=m[2].search(/[^ ]/),w=w>4?1:w,N=R.slice(w),w+=m[1].length),L=!1,!R&&/^ *$/.test(F)&&(B+=F+`
39
+ `,v=v.substring(F.length+1),de=!0),!de)for(var ze=new RegExp("^ {0,"+Math.min(3,w-1)+"}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))"),Te=new RegExp("^ {0,"+Math.min(3,w-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),Le=new RegExp("^ {0,"+Math.min(3,w-1)+"}(?:```|~~~)"),nt=new RegExp("^ {0,"+Math.min(3,w-1)+"}#");v&&(q=v.split(`
40
+ `,1)[0],F=q,this.options.pedantic&&(F=F.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(Le.test(F)||nt.test(F)||ze.test(F)||Te.test(v)));){if(F.search(/[^ ]/)>=w||!F.trim())N+=`
41
+ `+F.slice(w);else{if(L||R.search(/[^ ]/)>=4||Le.test(R)||nt.test(R)||Te.test(R))break;N+=`
42
+ `+F}!L&&!F.trim()&&(L=!0),B+=q+`
43
+ `,v=v.substring(q.length+1),R=F.slice(w)}ue.loose||(W?ue.loose=!0:/\n *\n *$/.test(B)&&(W=!0)),this.options.gfm&&(o=/^\[[ xX]\] /.exec(N),o&&(h=o[0]!=="[ ] ",N=N.replace(/^\[[ xX]\] +/,""))),ue.items.push({type:"list_item",raw:B,task:!!o,checked:h,loose:!1,text:N}),ue.raw+=B}ue.items[ue.items.length-1].raw=B.trimRight(),ue.items[ue.items.length-1].text=N.trimRight(),ue.raw=ue.raw.trimRight();var rt=ue.items.length;for(T=0;T<rt;T++)if(this.lexer.state.top=!1,ue.items[T].tokens=this.lexer.blockTokens(ue.items[T].text,[]),!ue.loose){var vt=ue.items[T].tokens.filter(function(Tt){return Tt.type==="space"}),Mt=vt.length>0&&vt.some(function(Tt){return/\n.*\n/.test(Tt.raw)});ue.loose=Mt}if(ue.loose)for(T=0;T<rt;T++)ue.items[T].loose=!0;return ue}},$.html=function(v){var m=this.rules.block.html.exec(v);if(m){var B={type:"html",raw:m[0],pre:!this.options.sanitizer&&(m[1]==="pre"||m[1]==="script"||m[1]==="style"),text:m[0]};if(this.options.sanitize){var o=this.options.sanitizer?this.options.sanitizer(m[0]):te(m[0]);B.type="paragraph",B.text=o,B.tokens=this.lexer.inline(o)}return B}},$.def=function(v){var m=this.rules.block.def.exec(v);if(m){var B=m[1].toLowerCase().replace(/\s+/g," "),o=m[2]?m[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",h=m[3]?m[3].substring(1,m[3].length-1).replace(this.rules.inline._escapes,"$1"):m[3];return{type:"def",tag:B,raw:m[0],href:o,title:h}}},$.table=function(v){var m=this.rules.block.table.exec(v);if(m){var B={type:"table",header:P(m[1]).map(function(W){return{text:W}}),align:m[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:m[3]&&m[3].trim()?m[3].replace(/\n[ \t]*$/,"").split(`
44
+ `):[]};if(B.header.length===B.align.length){B.raw=m[0];var o=B.align.length,h,w,T,L;for(h=0;h<o;h++)/^ *-+: *$/.test(B.align[h])?B.align[h]="right":/^ *:-+: *$/.test(B.align[h])?B.align[h]="center":/^ *:-+ *$/.test(B.align[h])?B.align[h]="left":B.align[h]=null;for(o=B.rows.length,h=0;h<o;h++)B.rows[h]=P(B.rows[h],B.header.length).map(function(W){return{text:W}});for(o=B.header.length,w=0;w<o;w++)B.header[w].tokens=this.lexer.inline(B.header[w].text);for(o=B.rows.length,w=0;w<o;w++)for(L=B.rows[w],T=0;T<L.length;T++)L[T].tokens=this.lexer.inline(L[T].text);return B}}},$.lheading=function(v){var m=this.rules.block.lheading.exec(v);if(m)return{type:"heading",raw:m[0],depth:m[2].charAt(0)==="="?1:2,text:m[1],tokens:this.lexer.inline(m[1])}},$.paragraph=function(v){var m=this.rules.block.paragraph.exec(v);if(m){var B=m[1].charAt(m[1].length-1)===`
45
+ `?m[1].slice(0,-1):m[1];return{type:"paragraph",raw:m[0],text:B,tokens:this.lexer.inline(B)}}},$.text=function(v){var m=this.rules.block.text.exec(v);if(m)return{type:"text",raw:m[0],text:m[0],tokens:this.lexer.inline(m[0])}},$.escape=function(v){var m=this.rules.inline.escape.exec(v);if(m)return{type:"escape",raw:m[0],text:te(m[1])}},$.tag=function(v){var m=this.rules.inline.tag.exec(v);if(m)return!this.lexer.state.inLink&&/^<a /i.test(m[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(m[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(m[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(m[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:m[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(m[0]):te(m[0]):m[0]}},$.link=function(v){var m=this.rules.inline.link.exec(v);if(m){var B=m[2].trim();if(!this.options.pedantic&&/^</.test(B)){if(!/>$/.test(B))return;var o=ce(B.slice(0,-1),"\\");if((B.length-o.length)%2===0)return}else{var h=ae(m[2],"()");if(h>-1){var w=m[0].indexOf("!")===0?5:4,T=w+m[1].length+h;m[2]=m[2].substring(0,h),m[0]=m[0].substring(0,T).trim(),m[3]=""}}var L=m[2],W="";if(this.options.pedantic){var R=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(L);R&&(L=R[1],W=R[3])}else W=m[3]?m[3].slice(1,-1):"";return L=L.trim(),/^</.test(L)&&(this.options.pedantic&&!/>$/.test(B)?L=L.slice(1):L=L.slice(1,-1)),pt(m,{href:L&&L.replace(this.rules.inline._escapes,"$1"),title:W&&W.replace(this.rules.inline._escapes,"$1")},m[0],this.lexer)}},$.reflink=function(v,m){var B;if((B=this.rules.inline.reflink.exec(v))||(B=this.rules.inline.nolink.exec(v))){var o=(B[2]||B[1]).replace(/\s+/g," ");if(o=m[o.toLowerCase()],!o){var h=B[0].charAt(0);return{type:"text",raw:h,text:h}}return pt(B,o,B[0],this.lexer)}},$.emStrong=function(v,m,B){B===void 0&&(B="");var o=this.rules.inline.emStrong.lDelim.exec(v);if(o&&!(o[3]&&B.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\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\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\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\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-\u1711\u171F-\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-\u1B4C\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-\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-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\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\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\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\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\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\uDF40-\uDF46]|\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\uDEB0-\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]|\uD80B[\uDF90-\uDFF0]|[\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\uDE70-\uDEBE\uDEC0-\uDEC9\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]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\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]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\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-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var h=o[1]||o[2]||"";if(!h||h&&(B===""||this.rules.inline.punctuation.exec(B))){var w=o[0].length-1,T,L,W=w,R=0,F=o[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(F.lastIndex=0,m=m.slice(-1*v.length+w);(o=F.exec(m))!=null;)if(T=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!!T){if(L=T.length,o[3]||o[4]){W+=L;continue}else if((o[5]||o[6])&&w%3&&!((w+L)%3)){R+=L;continue}if(W-=L,!(W>0)){L=Math.min(L,L+W+R);var q=v.slice(0,w+o.index+(o[0].length-T.length)+L);if(Math.min(w,L)%2){var N=q.slice(1,-1);return{type:"em",raw:q,text:N,tokens:this.lexer.inlineTokens(N)}}var de=q.slice(2,-2);return{type:"strong",raw:q,text:de,tokens:this.lexer.inlineTokens(de)}}}}}},$.codespan=function(v){var m=this.rules.inline.code.exec(v);if(m){var B=m[2].replace(/\n/g," "),o=/[^ ]/.test(B),h=/^ /.test(B)&&/ $/.test(B);return o&&h&&(B=B.substring(1,B.length-1)),B=te(B,!0),{type:"codespan",raw:m[0],text:B}}},$.br=function(v){var m=this.rules.inline.br.exec(v);if(m)return{type:"br",raw:m[0]}},$.del=function(v){var m=this.rules.inline.del.exec(v);if(m)return{type:"del",raw:m[0],text:m[2],tokens:this.lexer.inlineTokens(m[2])}},$.autolink=function(v,m){var B=this.rules.inline.autolink.exec(v);if(B){var o,h;return B[2]==="@"?(o=te(this.options.mangle?m(B[1]):B[1]),h="mailto:"+o):(o=te(B[1]),h=o),{type:"link",raw:B[0],text:o,href:h,tokens:[{type:"text",raw:o,text:o}]}}},$.url=function(v,m){var B;if(B=this.rules.inline.url.exec(v)){var o,h;if(B[2]==="@")o=te(this.options.mangle?m(B[0]):B[0]),h="mailto:"+o;else{var w;do w=B[0],B[0]=this.rules.inline._backpedal.exec(B[0])[0];while(w!==B[0]);o=te(B[0]),B[1]==="www."?h="http://"+B[0]:h=B[0]}return{type:"link",raw:B[0],text:o,href:h,tokens:[{type:"text",raw:o,text:o}]}}},$.inlineText=function(v,m){var B=this.rules.inline.text.exec(v);if(B){var o;return this.lexer.state.inRawBlock?o=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(B[0]):te(B[0]):B[0]:o=te(this.options.smartypants?m(B[0]):B[0]),{type:"text",raw:B[0],text:o}}},G})(),g={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}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\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 *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:Pe,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};g._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/,g._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,g.def=K(g.def).replace("label",g._label).replace("title",g._title).getRegex(),g.bullet=/(?:[*+-]|\d{1,9}[.)])/,g.listItemStart=K(/^( *)(bull) */).replace("bull",g.bullet).getRegex(),g.list=K(g.list).replace(/bull/g,g.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+g.def.source+")").getRegex(),g._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",g._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,g.html=K(g.html,"i").replace("comment",g._comment).replace("tag",g._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),g.paragraph=K(g._paragraph).replace("hr",g.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").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|textarea|!--)").replace("tag",g._tag).getRegex(),g.blockquote=K(g.blockquote).replace("paragraph",g.paragraph).getRegex(),g.normal=p({},g),g.gfm=p({},g.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),g.gfm.table=K(g.gfm.table).replace("hr",g.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|textarea|!--)").replace("tag",g._tag).getRegex(),g.gfm.paragraph=K(g._paragraph).replace("hr",g.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",g.gfm.table).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|textarea|!--)").replace("tag",g._tag).getRegex(),g.pedantic=p({},g.normal,{html:K(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",g._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:Pe,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:K(g.normal._paragraph).replace("hr",g.hr).replace("heading",` *#{1,6} *[^
46
+ ]`).replace("lheading",g.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var J={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Pe,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)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,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:Pe,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};J._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",J.punctuation=K(J.punctuation).replace(/punctuation/g,J._punctuation).getRegex(),J.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,J.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g,J._comment=K(g._comment).replace("(?:-->|$)","-->").getRegex(),J.emStrong.lDelim=K(J.emStrong.lDelim).replace(/punct/g,J._punctuation).getRegex(),J.emStrong.rDelimAst=K(J.emStrong.rDelimAst,"g").replace(/punct/g,J._punctuation).getRegex(),J.emStrong.rDelimUnd=K(J.emStrong.rDelimUnd,"g").replace(/punct/g,J._punctuation).getRegex(),J._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,J._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,J._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])?)+(?![-_])/,J.autolink=K(J.autolink).replace("scheme",J._scheme).replace("email",J._email).getRegex(),J._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,J.tag=K(J.tag).replace("comment",J._comment).replace("attribute",J._attribute).getRegex(),J._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,J._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,J._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,J.link=K(J.link).replace("label",J._label).replace("href",J._href).replace("title",J._title).getRegex(),J.reflink=K(J.reflink).replace("label",J._label).replace("ref",g._label).getRegex(),J.nolink=K(J.nolink).replace("ref",g._label).getRegex(),J.reflinkSearch=K(J.reflinkSearch,"g").replace("reflink",J.reflink).replace("nolink",J.nolink).getRegex(),J.normal=p({},J),J.pedantic=p({},J.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:K(/^!?\[(label)\]\((.*?)\)/).replace("label",J._label).getRegex(),reflink:K(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",J._label).getRegex()}),J.gfm=p({},J.normal,{escape:K(J.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)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),J.gfm.url=K(J.gfm.url,"i").replace("email",J.gfm._extended_email).getRegex(),J.breaks=p({},J.gfm,{br:K(J.br).replace("{2,}","*").getRegex(),text:K(J.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});function Fe(G){return G.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function Ie(G){var $="",I,v,m=G.length;for(I=0;I<m;I++)v=G.charCodeAt(I),Math.random()>.5&&(v="x"+v.toString(16)),$+="&#"+v+";";return $}var tt=(function(){function G(I){this.tokens=[],this.tokens.links=Object.create(null),this.options=I||y.defaults,this.options.tokenizer=this.options.tokenizer||new M,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};var v={block:g.normal,inline:J.normal};this.options.pedantic?(v.block=g.pedantic,v.inline=J.pedantic):this.options.gfm&&(v.block=g.gfm,this.options.breaks?v.inline=J.breaks:v.inline=J.gfm),this.tokenizer.rules=v}G.lex=function(v,m){var B=new G(m);return B.lex(v)},G.lexInline=function(v,m){var B=new G(m);return B.inlineTokens(v)};var $=G.prototype;return $.lex=function(v){v=v.replace(/\r\n|\r/g,`
47
+ `),this.blockTokens(v,this.tokens);for(var m;m=this.inlineQueue.shift();)this.inlineTokens(m.src,m.tokens);return this.tokens},$.blockTokens=function(v,m){var B=this;m===void 0&&(m=[]),this.options.pedantic?v=v.replace(/\t/g," ").replace(/^ +$/gm,""):v=v.replace(/^( *)(\t+)/gm,function(W,R,F){return R+" ".repeat(F.length)});for(var o,h,w,T;v;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(W){return(o=W.call({lexer:B},v,m))?(v=v.substring(o.raw.length),m.push(o),!0):!1}))){if(o=this.tokenizer.space(v)){v=v.substring(o.raw.length),o.raw.length===1&&m.length>0?m[m.length-1].raw+=`
48
+ `:m.push(o);continue}if(o=this.tokenizer.code(v)){v=v.substring(o.raw.length),h=m[m.length-1],h&&(h.type==="paragraph"||h.type==="text")?(h.raw+=`
49
+ `+o.raw,h.text+=`
50
+ `+o.text,this.inlineQueue[this.inlineQueue.length-1].src=h.text):m.push(o);continue}if(o=this.tokenizer.fences(v)){v=v.substring(o.raw.length),m.push(o);continue}if(o=this.tokenizer.heading(v)){v=v.substring(o.raw.length),m.push(o);continue}if(o=this.tokenizer.hr(v)){v=v.substring(o.raw.length),m.push(o);continue}if(o=this.tokenizer.blockquote(v)){v=v.substring(o.raw.length),m.push(o);continue}if(o=this.tokenizer.list(v)){v=v.substring(o.raw.length),m.push(o);continue}if(o=this.tokenizer.html(v)){v=v.substring(o.raw.length),m.push(o);continue}if(o=this.tokenizer.def(v)){v=v.substring(o.raw.length),h=m[m.length-1],h&&(h.type==="paragraph"||h.type==="text")?(h.raw+=`
51
+ `+o.raw,h.text+=`
52
+ `+o.raw,this.inlineQueue[this.inlineQueue.length-1].src=h.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title});continue}if(o=this.tokenizer.table(v)){v=v.substring(o.raw.length),m.push(o);continue}if(o=this.tokenizer.lheading(v)){v=v.substring(o.raw.length),m.push(o);continue}if(w=v,this.options.extensions&&this.options.extensions.startBlock&&(function(){var W=1/0,R=v.slice(1),F=void 0;B.options.extensions.startBlock.forEach(function(q){F=q.call({lexer:this},R),typeof F=="number"&&F>=0&&(W=Math.min(W,F))}),W<1/0&&W>=0&&(w=v.substring(0,W+1))})(),this.state.top&&(o=this.tokenizer.paragraph(w))){h=m[m.length-1],T&&h.type==="paragraph"?(h.raw+=`
53
+ `+o.raw,h.text+=`
54
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=h.text):m.push(o),T=w.length!==v.length,v=v.substring(o.raw.length);continue}if(o=this.tokenizer.text(v)){v=v.substring(o.raw.length),h=m[m.length-1],h&&h.type==="text"?(h.raw+=`
55
+ `+o.raw,h.text+=`
56
+ `+o.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=h.text):m.push(o);continue}if(v){var L="Infinite loop on byte: "+v.charCodeAt(0);if(this.options.silent){console.error(L);break}else throw new Error(L)}}return this.state.top=!0,m},$.inline=function(v,m){return m===void 0&&(m=[]),this.inlineQueue.push({src:v,tokens:m}),m},$.inlineTokens=function(v,m){var B=this;m===void 0&&(m=[]);var o,h,w,T=v,L,W,R;if(this.tokens.links){var F=Object.keys(this.tokens.links);if(F.length>0)for(;(L=this.tokenizer.rules.inline.reflinkSearch.exec(T))!=null;)F.includes(L[0].slice(L[0].lastIndexOf("[")+1,-1))&&(T=T.slice(0,L.index)+"["+$e("a",L[0].length-2)+"]"+T.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(L=this.tokenizer.rules.inline.blockSkip.exec(T))!=null;)T=T.slice(0,L.index)+"["+$e("a",L[0].length-2)+"]"+T.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(L=this.tokenizer.rules.inline.escapedEmSt.exec(T))!=null;)T=T.slice(0,L.index+L[0].length-2)+"++"+T.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;v;)if(W||(R=""),W=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(N){return(o=N.call({lexer:B},v,m))?(v=v.substring(o.raw.length),m.push(o),!0):!1}))){if(o=this.tokenizer.escape(v)){v=v.substring(o.raw.length),m.push(o);continue}if(o=this.tokenizer.tag(v)){v=v.substring(o.raw.length),h=m[m.length-1],h&&o.type==="text"&&h.type==="text"?(h.raw+=o.raw,h.text+=o.text):m.push(o);continue}if(o=this.tokenizer.link(v)){v=v.substring(o.raw.length),m.push(o);continue}if(o=this.tokenizer.reflink(v,this.tokens.links)){v=v.substring(o.raw.length),h=m[m.length-1],h&&o.type==="text"&&h.type==="text"?(h.raw+=o.raw,h.text+=o.text):m.push(o);continue}if(o=this.tokenizer.emStrong(v,T,R)){v=v.substring(o.raw.length),m.push(o);continue}if(o=this.tokenizer.codespan(v)){v=v.substring(o.raw.length),m.push(o);continue}if(o=this.tokenizer.br(v)){v=v.substring(o.raw.length),m.push(o);continue}if(o=this.tokenizer.del(v)){v=v.substring(o.raw.length),m.push(o);continue}if(o=this.tokenizer.autolink(v,Ie)){v=v.substring(o.raw.length),m.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(v,Ie))){v=v.substring(o.raw.length),m.push(o);continue}if(w=v,this.options.extensions&&this.options.extensions.startInline&&(function(){var N=1/0,de=v.slice(1),be=void 0;B.options.extensions.startInline.forEach(function(ke){be=ke.call({lexer:this},de),typeof be=="number"&&be>=0&&(N=Math.min(N,be))}),N<1/0&&N>=0&&(w=v.substring(0,N+1))})(),o=this.tokenizer.inlineText(w,Fe)){v=v.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(R=o.raw.slice(-1)),W=!0,h=m[m.length-1],h&&h.type==="text"?(h.raw+=o.raw,h.text+=o.text):m.push(o);continue}if(v){var q="Infinite loop on byte: "+v.charCodeAt(0);if(this.options.silent){console.error(q);break}else throw new Error(q)}}return m},f(G,null,[{key:"rules",get:function(){return{block:g,inline:J}}}]),G})(),Ze=(function(){function G(I){this.options=I||y.defaults}var $=G.prototype;return $.code=function(v,m,B){var o=(m||"").match(/\S*/)[0];if(this.options.highlight){var h=this.options.highlight(v,o);h!=null&&h!==v&&(B=!0,v=h)}return v=v.replace(/\n$/,"")+`
57
+ `,o?'<pre><code class="'+this.options.langPrefix+te(o)+'">'+(B?v:te(v,!0))+`</code></pre>
58
+ `:"<pre><code>"+(B?v:te(v,!0))+`</code></pre>
59
+ `},$.blockquote=function(v){return`<blockquote>
60
+ `+v+`</blockquote>
61
+ `},$.html=function(v){return v},$.heading=function(v,m,B,o){if(this.options.headerIds){var h=this.options.headerPrefix+o.slug(B);return"<h"+m+' id="'+h+'">'+v+"</h"+m+`>
62
+ `}return"<h"+m+">"+v+"</h"+m+`>
63
+ `},$.hr=function(){return this.options.xhtml?`<hr/>
64
+ `:`<hr>
65
+ `},$.list=function(v,m,B){var o=m?"ol":"ul",h=m&&B!==1?' start="'+B+'"':"";return"<"+o+h+`>
66
+ `+v+"</"+o+`>
67
+ `},$.listitem=function(v){return"<li>"+v+`</li>
68
+ `},$.checkbox=function(v){return"<input "+(v?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},$.paragraph=function(v){return"<p>"+v+`</p>
69
+ `},$.table=function(v,m){return m&&(m="<tbody>"+m+"</tbody>"),`<table>
70
+ <thead>
71
+ `+v+`</thead>
72
+ `+m+`</table>
73
+ `},$.tablerow=function(v){return`<tr>
74
+ `+v+`</tr>
75
+ `},$.tablecell=function(v,m){var B=m.header?"th":"td",o=m.align?"<"+B+' align="'+m.align+'">':"<"+B+">";return o+v+("</"+B+`>
76
+ `)},$.strong=function(v){return"<strong>"+v+"</strong>"},$.em=function(v){return"<em>"+v+"</em>"},$.codespan=function(v){return"<code>"+v+"</code>"},$.br=function(){return this.options.xhtml?"<br/>":"<br>"},$.del=function(v){return"<del>"+v+"</del>"},$.link=function(v,m,B){if(v=pe(this.options.sanitize,this.options.baseUrl,v),v===null)return B;var o='<a href="'+v+'"';return m&&(o+=' title="'+m+'"'),o+=">"+B+"</a>",o},$.image=function(v,m,B){if(v=pe(this.options.sanitize,this.options.baseUrl,v),v===null)return B;var o='<img src="'+v+'" alt="'+B+'"';return m&&(o+=' title="'+m+'"'),o+=this.options.xhtml?"/>":">",o},$.text=function(v){return v},G})(),Qe=(function(){function G(){}var $=G.prototype;return $.strong=function(v){return v},$.em=function(v){return v},$.codespan=function(v){return v},$.del=function(v){return v},$.html=function(v){return v},$.text=function(v){return v},$.link=function(v,m,B){return""+B},$.image=function(v,m,B){return""+B},$.br=function(){return""},G})(),Je=(function(){function G(){this.seen={}}var $=G.prototype;return $.serialize=function(v){return v.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},$.getNextSafeSlug=function(v,m){var B=v,o=0;if(this.seen.hasOwnProperty(B)){o=this.seen[v];do o++,B=v+"-"+o;while(this.seen.hasOwnProperty(B))}return m||(this.seen[v]=o,this.seen[B]=0),B},$.slug=function(v,m){m===void 0&&(m={});var B=this.serialize(v);return this.getNextSafeSlug(B,m.dryrun)},G})(),Ue=(function(){function G(I){this.options=I||y.defaults,this.options.renderer=this.options.renderer||new Ze,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Qe,this.slugger=new Je}G.parse=function(v,m){var B=new G(m);return B.parse(v)},G.parseInline=function(v,m){var B=new G(m);return B.parseInline(v)};var $=G.prototype;return $.parse=function(v,m){m===void 0&&(m=!0);var B="",o,h,w,T,L,W,R,F,q,N,de,be,ke,ue,Ne,ze,Te,Le,nt,rt=v.length;for(o=0;o<rt;o++){if(N=v[o],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[N.type]&&(nt=this.options.extensions.renderers[N.type].call({parser:this},N),nt!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(N.type))){B+=nt||"";continue}switch(N.type){case"space":continue;case"hr":{B+=this.renderer.hr();continue}case"heading":{B+=this.renderer.heading(this.parseInline(N.tokens),N.depth,Q(this.parseInline(N.tokens,this.textRenderer)),this.slugger);continue}case"code":{B+=this.renderer.code(N.text,N.lang,N.escaped);continue}case"table":{for(F="",R="",T=N.header.length,h=0;h<T;h++)R+=this.renderer.tablecell(this.parseInline(N.header[h].tokens),{header:!0,align:N.align[h]});for(F+=this.renderer.tablerow(R),q="",T=N.rows.length,h=0;h<T;h++){for(W=N.rows[h],R="",L=W.length,w=0;w<L;w++)R+=this.renderer.tablecell(this.parseInline(W[w].tokens),{header:!1,align:N.align[w]});q+=this.renderer.tablerow(R)}B+=this.renderer.table(F,q);continue}case"blockquote":{q=this.parse(N.tokens),B+=this.renderer.blockquote(q);continue}case"list":{for(de=N.ordered,be=N.start,ke=N.loose,T=N.items.length,q="",h=0;h<T;h++)Ne=N.items[h],ze=Ne.checked,Te=Ne.task,ue="",Ne.task&&(Le=this.renderer.checkbox(ze),ke?Ne.tokens.length>0&&Ne.tokens[0].type==="paragraph"?(Ne.tokens[0].text=Le+" "+Ne.tokens[0].text,Ne.tokens[0].tokens&&Ne.tokens[0].tokens.length>0&&Ne.tokens[0].tokens[0].type==="text"&&(Ne.tokens[0].tokens[0].text=Le+" "+Ne.tokens[0].tokens[0].text)):Ne.tokens.unshift({type:"text",text:Le}):ue+=Le),ue+=this.parse(Ne.tokens,ke),q+=this.renderer.listitem(ue,Te,ze);B+=this.renderer.list(q,de,be);continue}case"html":{B+=this.renderer.html(N.text);continue}case"paragraph":{B+=this.renderer.paragraph(this.parseInline(N.tokens));continue}case"text":{for(q=N.tokens?this.parseInline(N.tokens):N.text;o+1<rt&&v[o+1].type==="text";)N=v[++o],q+=`
77
+ `+(N.tokens?this.parseInline(N.tokens):N.text);B+=m?this.renderer.paragraph(q):q;continue}default:{var vt='Token with "'+N.type+'" type was not found.';if(this.options.silent){console.error(vt);return}else throw new Error(vt)}}}return B},$.parseInline=function(v,m){m=m||this.renderer;var B="",o,h,w,T=v.length;for(o=0;o<T;o++){if(h=v[o],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[h.type]&&(w=this.options.extensions.renderers[h.type].call({parser:this},h),w!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(h.type))){B+=w||"";continue}switch(h.type){case"escape":{B+=m.text(h.text);break}case"html":{B+=m.html(h.text);break}case"link":{B+=m.link(h.href,h.title,this.parseInline(h.tokens,m));break}case"image":{B+=m.image(h.href,h.title,h.text);break}case"strong":{B+=m.strong(this.parseInline(h.tokens,m));break}case"em":{B+=m.em(this.parseInline(h.tokens,m));break}case"codespan":{B+=m.codespan(h.text);break}case"br":{B+=m.br();break}case"del":{B+=m.del(this.parseInline(h.tokens,m));break}case"text":{B+=m.text(h.text);break}default:{var L='Token with "'+h.type+'" type was not found.';if(this.options.silent){console.error(L);return}else throw new Error(L)}}}return B},G})(),je=(function(){function G(I){this.options=I||y.defaults}var $=G.prototype;return $.preprocess=function(v){return v},$.postprocess=function(v){return v},G})();je.passThroughHooks=new Set(["preprocess","postprocess"]);function Ve(G,$,I){return function(v){if(v.message+=`
78
+ Please report this to https://github.com/markedjs/marked.`,G){var m="<p>An error occurred:</p><pre>"+te(v.message+"",!0)+"</pre>";if($)return Promise.resolve(m);if(I){I(null,m);return}return m}if($)return Promise.reject(v);if(I){I(v);return}throw v}}function ht(G,$){return function(I,v,m){typeof v=="function"&&(m=v,v=null);var B=p({},v);v=p({},Ce.defaults,B);var o=Ve(v.silent,v.async,m);if(typeof I>"u"||I===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof I!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(I)+", string expected"));if(Ee(v),v.hooks&&(v.hooks.options=v),m){var h=v.highlight,w;try{v.hooks&&(I=v.hooks.preprocess(I)),w=G(I,v)}catch(F){return o(F)}var T=function(q){var N;if(!q)try{v.walkTokens&&Ce.walkTokens(w,v.walkTokens),N=$(w,v),v.hooks&&(N=v.hooks.postprocess(N))}catch(de){q=de}return v.highlight=h,q?o(q):m(null,N)};if(!h||h.length<3||(delete v.highlight,!w.length))return T();var L=0;Ce.walkTokens(w,function(F){F.type==="code"&&(L++,setTimeout(function(){h(F.text,F.lang,function(q,N){if(q)return T(q);N!=null&&N!==F.text&&(F.text=N,F.escaped=!0),L--,L===0&&T()})},0))}),L===0&&T();return}if(v.async)return Promise.resolve(v.hooks?v.hooks.preprocess(I):I).then(function(F){return G(F,v)}).then(function(F){return v.walkTokens?Promise.all(Ce.walkTokens(F,v.walkTokens)).then(function(){return F}):F}).then(function(F){return $(F,v)}).then(function(F){return v.hooks?v.hooks.postprocess(F):F}).catch(o);try{v.hooks&&(I=v.hooks.preprocess(I));var W=G(I,v);v.walkTokens&&Ce.walkTokens(W,v.walkTokens);var R=$(W,v);return v.hooks&&(R=v.hooks.postprocess(R)),R}catch(F){return o(F)}}}function Ce(G,$,I){return ht(tt.lex,Ue.parse)(G,$,I)}Ce.options=Ce.setOptions=function(G){return Ce.defaults=p({},Ce.defaults,G),z(Ce.defaults),Ce},Ce.getDefaults=S,Ce.defaults=y.defaults,Ce.use=function(){for(var G=Ce.defaults.extensions||{renderers:{},childTokens:{}},$=arguments.length,I=new Array($),v=0;v<$;v++)I[v]=arguments[v];I.forEach(function(m){var B=p({},m);if(B.async=Ce.defaults.async||B.async||!1,m.extensions&&(m.extensions.forEach(function(h){if(!h.name)throw new Error("extension name required");if(h.renderer){var w=G.renderers[h.name];w?G.renderers[h.name]=function(){for(var T=arguments.length,L=new Array(T),W=0;W<T;W++)L[W]=arguments[W];var R=h.renderer.apply(this,L);return R===!1&&(R=w.apply(this,L)),R}:G.renderers[h.name]=h.renderer}if(h.tokenizer){if(!h.level||h.level!=="block"&&h.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");G[h.level]?G[h.level].unshift(h.tokenizer):G[h.level]=[h.tokenizer],h.start&&(h.level==="block"?G.startBlock?G.startBlock.push(h.start):G.startBlock=[h.start]:h.level==="inline"&&(G.startInline?G.startInline.push(h.start):G.startInline=[h.start]))}h.childTokens&&(G.childTokens[h.name]=h.childTokens)}),B.extensions=G),m.renderer&&(function(){var h=Ce.defaults.renderer||new Ze,w=function(W){var R=h[W];h[W]=function(){for(var F=arguments.length,q=new Array(F),N=0;N<F;N++)q[N]=arguments[N];var de=m.renderer[W].apply(h,q);return de===!1&&(de=R.apply(h,q)),de}};for(var T in m.renderer)w(T);B.renderer=h})(),m.tokenizer&&(function(){var h=Ce.defaults.tokenizer||new M,w=function(W){var R=h[W];h[W]=function(){for(var F=arguments.length,q=new Array(F),N=0;N<F;N++)q[N]=arguments[N];var de=m.tokenizer[W].apply(h,q);return de===!1&&(de=R.apply(h,q)),de}};for(var T in m.tokenizer)w(T);B.tokenizer=h})(),m.hooks&&(function(){var h=Ce.defaults.hooks||new je,w=function(W){var R=h[W];je.passThroughHooks.has(W)?h[W]=function(F){if(Ce.defaults.async)return Promise.resolve(m.hooks[W].call(h,F)).then(function(N){return R.call(h,N)});var q=m.hooks[W].call(h,F);return R.call(h,q)}:h[W]=function(){for(var F=arguments.length,q=new Array(F),N=0;N<F;N++)q[N]=arguments[N];var de=m.hooks[W].apply(h,q);return de===!1&&(de=R.apply(h,q)),de}};for(var T in m.hooks)w(T);B.hooks=h})(),m.walkTokens){var o=Ce.defaults.walkTokens;B.walkTokens=function(h){var w=[];return w.push(m.walkTokens.call(this,h)),o&&(w=w.concat(o.call(this,h))),w}}Ce.setOptions(B)})},Ce.walkTokens=function(G,$){for(var I=[],v=function(){var h=B.value;switch(I=I.concat($.call(Ce,h)),h.type){case"table":{for(var w=A(h.header),T;!(T=w()).done;){var L=T.value;I=I.concat(Ce.walkTokens(L.tokens,$))}for(var W=A(h.rows),R;!(R=W()).done;)for(var F=R.value,q=A(F),N;!(N=q()).done;){var de=N.value;I=I.concat(Ce.walkTokens(de.tokens,$))}break}case"list":{I=I.concat(Ce.walkTokens(h.items,$));break}default:Ce.defaults.extensions&&Ce.defaults.extensions.childTokens&&Ce.defaults.extensions.childTokens[h.type]?Ce.defaults.extensions.childTokens[h.type].forEach(function(be){I=I.concat(Ce.walkTokens(h[be],$))}):h.tokens&&(I=I.concat(Ce.walkTokens(h.tokens,$)))}},m=A(G),B;!(B=m()).done;)v();return I},Ce.parseInline=ht(tt.lexInline,Ue.parseInline),Ce.Parser=Ue,Ce.parser=Ue.parse,Ce.Renderer=Ze,Ce.TextRenderer=Qe,Ce.Lexer=tt,Ce.lexer=tt.lex,Ce.Tokenizer=M,Ce.Slugger=Je,Ce.Hooks=je,Ce.parse=Ce;var Ct=Ce.options,Lt=Ce.setOptions,ot=Ce.use,Nt=Ce.walkTokens,we=Ce.parseInline,xt=Ce,Jt=Ue.parse,wn=tt.lex;y.Hooks=je,y.Lexer=tt,y.Parser=Ue,y.Renderer=Ze,y.Slugger=Je,y.TextRenderer=Qe,y.Tokenizer=M,y.getDefaults=S,y.lexer=wn,y.marked=Ce,y.options=Ct,y.parse=xt,y.parseInline=we,y.parser=Jt,y.setOptions=Lt,y.use=ot,y.walkTokens=Nt})(ia)),ia}var aa,to;function Xu(){if(to)return aa;to=1;var y=un();Ru(),_u(),Iu(),Pl(),Wl(),Nu(),Pu(),zu(),Hu(),Wu(),_l();var c=$u(),f=ju().marked,p=/Mac/.test(navigator.platform),x=new RegExp(/(<a.*?https?:\/\/.*?[^a]>)+?/g),b={toggleBold:Q,toggleItalic:j,drawLink:$e,toggleHeadingSmaller:pe,toggleHeadingBigger:xe,drawImage:pt,toggleBlockquote:V,toggleOrderedList:ae,toggleUnorderedList:ce,toggleCodeBlock:se,togglePreview:Qe,toggleStrikethrough:K,toggleHeading1:Xe,toggleHeading2:le,toggleHeading3:Oe,toggleHeading4:Re,toggleHeading5:Pe,toggleHeading6:P,cleanBlock:Ee,drawTable:J,drawHorizontalRule:Fe,undo:Ie,redo:tt,toggleSideBySide:Ze,toggleFullScreen:X},A={toggleBold:"Cmd-B",toggleItalic:"Cmd-I",drawLink:"Cmd-K",toggleHeadingSmaller:"Cmd-H",toggleHeadingBigger:"Shift-Cmd-H",toggleHeading1:"Ctrl+Alt+1",toggleHeading2:"Ctrl+Alt+2",toggleHeading3:"Ctrl+Alt+3",toggleHeading4:"Ctrl+Alt+4",toggleHeading5:"Ctrl+Alt+5",toggleHeading6:"Ctrl+Alt+6",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"},D=function(o){for(var h in b)if(b[h]===o)return h;return null},k=function(){var o=!1;return(function(h){(/(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(h)||/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(h.substr(0,4)))&&(o=!0)})(navigator.userAgent||navigator.vendor||window.opera),o};function S(o){for(var h;(h=x.exec(o))!==null;){var w=h[0];if(w.indexOf("target=")===-1){var T=w.replace(/>$/,' target="_blank">');o=o.replace(w,T)}}return o}function z(o){for(var h=new DOMParser,w=h.parseFromString(o,"text/html"),T=w.getElementsByTagName("li"),L=0;L<T.length;L++)for(var W=T[L],R=0;R<W.children.length;R++){var F=W.children[R];F instanceof HTMLInputElement&&F.type==="checkbox"&&(W.style.marginLeft="-1.5em",W.style.listStyleType="none")}return w.documentElement.innerHTML}function Z(o){return p?o=o.replace("Ctrl","Cmd"):o=o.replace("Cmd","Ctrl"),o}function H(o,h,w,T){var L=ie(o,!1,h,w,"button",T);L.classList.add("easymde-dropdown"),L.onclick=function(){L.focus()};var W=document.createElement("div");W.className="easymde-dropdown-content";for(var R=0;R<o.children.length;R++){var F=o.children[R],q;typeof F=="string"&&F in xt?q=ie(xt[F],!0,h,w,"button",T):q=ie(F,!0,h,w,"button",T),q.addEventListener("click",function(N){N.stopPropagation()},!1),W.appendChild(q)}return L.appendChild(W),L}function ie(o,h,w,T,L,W){o=o||{};var R=document.createElement(L);if(o.attributes)for(var F in o.attributes)Object.prototype.hasOwnProperty.call(o.attributes,F)&&R.setAttribute(F,o.attributes[F]);var q=W.options.toolbarButtonClassPrefix?W.options.toolbarButtonClassPrefix+"-":"";R.className=q+o.name,R.setAttribute("type",L),w=w??!0,o.text&&(R.innerText=o.text),o.name&&o.name in T&&(b[o.name]=o.action),o.title&&w&&(R.title=ye(o.title,o.action,T),p&&(R.title=R.title.replace("Ctrl","⌘"),R.title=R.title.replace("Alt","⌥"))),o.title&&R.setAttribute("aria-label",o.title),o.noDisable&&R.classList.add("no-disable"),o.noMobile&&R.classList.add("no-mobile");var N=[];typeof o.className<"u"&&(N=o.className.split(" "));for(var de=[],be=0;be<N.length;be++){var ke=N[be];ke.match(/^fa([srlb]|(-[\w-]*)|$)/)?de.push(ke):R.classList.add(ke)}if(R.tabIndex=-1,de.length>0){for(var ue=document.createElement("i"),Ne=0;Ne<de.length;Ne++){var ze=de[Ne];ue.classList.add(ze)}R.appendChild(ue)}return typeof o.icon<"u"&&(R.innerHTML=o.icon),o.action&&h&&(typeof o.action=="function"?R.onclick=function(Te){Te.preventDefault(),o.action(W)}:typeof o.action=="string"&&(R.onclick=function(Te){Te.preventDefault(),window.open(o.action,"_blank")})),R}function ee(){var o=document.createElement("i");return o.className="separator",o.innerHTML="|",o}function ye(o,h,w){var T,L=o;return h&&(T=D(h),w[T]&&(L+=" ("+Z(w[T])+")")),L}function re(o,h){h=h||o.getCursor("start");var w=o.getTokenAt(h);if(!w.type)return{};for(var T=w.type.split(" "),L={},W,R,F=0;F<T.length;F++)W=T[F],W==="strong"?L.bold=!0:W==="variable-2"?(R=o.getLine(h.line),/^\s*\d+\.\s/.test(R)?L["ordered-list"]=!0:L["unordered-list"]=!0):W==="atom"?L.quote=!0:W==="em"?L.italic=!0:W==="quote"?L.quote=!0:W==="strikethrough"?L.strikethrough=!0:W==="comment"?L.code=!0:W==="link"&&!L.image?L.link=!0:W==="image"?L.image=!0:W.match(/^header(-[1-6])?$/)&&(L[W.replace("header","heading")]=!0);return L}var te="";function X(o){var h=o.codemirror;h.setOption("fullScreen",!h.getOption("fullScreen")),h.getOption("fullScreen")?(te=document.body.style.overflow,document.body.style.overflow="hidden"):document.body.style.overflow=te;var w=h.getWrapperElement(),T=w.nextSibling;if(T.classList.contains("editor-preview-active-side"))if(o.options.sideBySideFullscreen===!1){var L=w.parentNode;h.getOption("fullScreen")?L.classList.remove("sided--no-fullscreen"):L.classList.add("sided--no-fullscreen")}else Ze(o);if(o.options.onToggleFullScreen&&o.options.onToggleFullScreen(h.getOption("fullScreen")||!1),typeof o.options.maxHeight<"u"&&(h.getOption("fullScreen")?(h.getScrollerElement().style.removeProperty("height"),T.style.removeProperty("height")):(h.getScrollerElement().style.height=o.options.maxHeight,o.setPreviewMaxHeight())),o.toolbar_div.classList.toggle("fullscreen"),o.toolbarElements&&o.toolbarElements.fullscreen){var W=o.toolbarElements.fullscreen;W.classList.toggle("active")}}function Q(o){ht(o,"bold",o.options.blockStyles.bold)}function j(o){ht(o,"italic",o.options.blockStyles.italic)}function K(o){ht(o,"strikethrough","~~")}function se(o){var h=o.options.blockStyles.code;function w(ft){if(typeof ft!="object")throw"fencing_line() takes a 'line' object (not a line number, or line text). Got: "+typeof ft+": "+ft;return ft.styles&&ft.styles[2]&&ft.styles[2].indexOf("formatting-code-block")!==-1}function T(ft){return ft.state.base.base||ft.state.base}function L(ft,fn,ln,$t,Wt){ln=ln||ft.getLineHandle(fn),$t=$t||ft.getTokenAt({line:fn,ch:1}),Wt=Wt||!!ln.text&&ft.getTokenAt({line:fn,ch:ln.text.length-1});var Mn=$t.type?$t.type.split(" "):[];return Wt&&T(Wt).indentedCode?"indented":Mn.indexOf("comment")===-1?!1:T($t).fencedChars||T(Wt).fencedChars||w(ln)?"fenced":"single"}function W(ft,fn,ln,$t){var Wt=fn.line+1,Mn=ln.line+1,Me=fn.line!==ln.line,_=$t+`
79
+ `,he=`
80
+ `+$t;Me&&Mn++,Me&&ln.ch===0&&(he=$t+`
81
+ `,Mn--),Je(ft,!1,[_,he]),ft.setSelection({line:Wt,ch:0},{line:Mn,ch:0})}var R=o.codemirror,F=R.getCursor("start"),q=R.getCursor("end"),N=R.getTokenAt({line:F.line,ch:F.ch||1}),de=R.getLineHandle(F.line),be=L(R,F.line,de,N),ke,ue,Ne;if(be==="single"){var ze=de.text.slice(0,F.ch).replace("`",""),Te=de.text.slice(F.ch).replace("`","");R.replaceRange(ze+Te,{line:F.line,ch:0},{line:F.line,ch:99999999999999}),F.ch--,F!==q&&q.ch--,R.setSelection(F,q),R.focus()}else if(be==="fenced")if(F.line!==q.line||F.ch!==q.ch){for(ke=F.line;ke>=0&&(de=R.getLineHandle(ke),!w(de));ke--);var Le=R.getTokenAt({line:ke,ch:1}),nt=T(Le).fencedChars,rt,vt,Mt,Tt;w(R.getLineHandle(F.line))?(rt="",vt=F.line):w(R.getLineHandle(F.line-1))?(rt="",vt=F.line-1):(rt=nt+`
82
+ `,vt=F.line),w(R.getLineHandle(q.line))?(Mt="",Tt=q.line,q.ch===0&&(Tt+=1)):q.ch!==0&&w(R.getLineHandle(q.line+1))?(Mt="",Tt=q.line+1):(Mt=nt+`
83
+ `,Tt=q.line+1),q.ch===0&&(Tt-=1),R.operation(function(){R.replaceRange(Mt,{line:Tt,ch:0},{line:Tt+(Mt?0:1),ch:0}),R.replaceRange(rt,{line:vt,ch:0},{line:vt+(rt?0:1),ch:0})}),R.setSelection({line:vt+(rt?1:0),ch:0},{line:Tt+(rt?1:-1),ch:0}),R.focus()}else{var Pn=F.line;if(w(R.getLineHandle(F.line))&&(L(R,F.line+1)==="fenced"?(ke=F.line,Pn=F.line+1):(ue=F.line,Pn=F.line-1)),ke===void 0)for(ke=Pn;ke>=0&&(de=R.getLineHandle(ke),!w(de));ke--);if(ue===void 0)for(Ne=R.lineCount(),ue=Pn;ue<Ne&&(de=R.getLineHandle(ue),!w(de));ue++);R.operation(function(){R.replaceRange("",{line:ke,ch:0},{line:ke+1,ch:0}),R.replaceRange("",{line:ue-1,ch:0},{line:ue,ch:0})}),R.focus()}else if(be==="indented"){if(F.line!==q.line||F.ch!==q.ch)ke=F.line,ue=q.line,q.ch===0&&ue--;else{for(ke=F.line;ke>=0;ke--)if(de=R.getLineHandle(ke),!de.text.match(/^\s*$/)&&L(R,ke,de)!=="indented"){ke+=1;break}for(Ne=R.lineCount(),ue=F.line;ue<Ne;ue++)if(de=R.getLineHandle(ue),!de.text.match(/^\s*$/)&&L(R,ue,de)!=="indented"){ue-=1;break}}var Ht=R.getLineHandle(ue+1),pn=Ht&&R.getTokenAt({line:ue+1,ch:Ht.text.length-1}),zn=pn&&T(pn).indentedCode;zn&&R.replaceRange(`
84
+ `,{line:ue+1,ch:0});for(var Hn=ke;Hn<=ue;Hn++)R.indentLine(Hn,"subtract");R.focus()}else{var Ln=F.line===q.line&&F.ch===q.ch&&F.ch===0,fr=F.line!==q.line;Ln||fr?W(R,F,q,h):Je(R,!1,["`","`"])}}function V(o){je(o.codemirror,"quote")}function pe(o){Ue(o.codemirror,"smaller")}function xe(o){Ue(o.codemirror,"bigger")}function Xe(o){Ue(o.codemirror,void 0,1)}function le(o){Ue(o.codemirror,void 0,2)}function Oe(o){Ue(o.codemirror,void 0,3)}function Re(o){Ue(o.codemirror,void 0,4)}function Pe(o){Ue(o.codemirror,void 0,5)}function P(o){Ue(o.codemirror,void 0,6)}function ce(o){var h=o.codemirror,w="*";["-","+","*"].includes(o.options.unorderedListStyle)&&(w=o.options.unorderedListStyle),je(h,"unordered-list",w)}function ae(o){je(o.codemirror,"ordered-list")}function Ee(o){Ce(o.codemirror)}function $e(o){var h=o.options,w="https://";if(h.promptURLs){var T=prompt(h.promptTexts.link,w);if(!T)return!1;w=lt(T)}Ve(o,"link",h.insertTexts.link,w)}function pt(o){var h=o.options,w="https://";if(h.promptURLs){var T=prompt(h.promptTexts.image,w);if(!T)return!1;w=lt(T)}Ve(o,"image",h.insertTexts.image,w)}function lt(o){return encodeURI(o).replace(/([\\()])/g,"\\$1")}function M(o){o.openBrowseFileWindow()}function g(o,h){var w=o.codemirror,T=re(w),L=o.options,W=h.substr(h.lastIndexOf("/")+1),R=W.substring(W.lastIndexOf(".")+1).replace(/\?.*$/,"").toLowerCase();if(["png","jpg","jpeg","gif","svg","apng","avif","webp"].includes(R))Je(w,T.image,L.insertTexts.uploadedImage,h);else{var F=L.insertTexts.link;F[0]="["+W,Je(w,T.link,F,h)}o.updateStatusBar("upload-image",o.options.imageTexts.sbOnUploaded.replace("#image_name#",W)),setTimeout(function(){o.updateStatusBar("upload-image",o.options.imageTexts.sbInit)},1e3)}function J(o){var h=o.codemirror,w=re(h),T=o.options;Je(h,w.table,T.insertTexts.table)}function Fe(o){var h=o.codemirror,w=re(h),T=o.options;Je(h,w.image,T.insertTexts.horizontalRule)}function Ie(o){var h=o.codemirror;h.undo(),h.focus()}function tt(o){var h=o.codemirror;h.redo(),h.focus()}function Ze(o){var h=o.codemirror,w=h.getWrapperElement(),T=w.nextSibling,L=o.toolbarElements&&o.toolbarElements["side-by-side"],W=!1,R=w.parentNode;T.classList.contains("editor-preview-active-side")?(o.options.sideBySideFullscreen===!1&&R.classList.remove("sided--no-fullscreen"),T.classList.remove("editor-preview-active-side"),L&&L.classList.remove("active"),w.classList.remove("CodeMirror-sided")):(setTimeout(function(){h.getOption("fullScreen")||(o.options.sideBySideFullscreen===!1?R.classList.add("sided--no-fullscreen"):X(o)),T.classList.add("editor-preview-active-side")},1),L&&L.classList.add("active"),w.classList.add("CodeMirror-sided"),W=!0);var F=w.lastChild;if(F.classList.contains("editor-preview-active")){F.classList.remove("editor-preview-active");var q=o.toolbarElements.preview,N=o.toolbar_div;q.classList.remove("active"),N.classList.remove("disabled-for-preview")}var de=function(){var ke=o.options.previewRender(o.value(),T);ke!=null&&(T.innerHTML=ke)};if(h.sideBySideRenderingFunction||(h.sideBySideRenderingFunction=de),W){var be=o.options.previewRender(o.value(),T);be!=null&&(T.innerHTML=be),h.on("update",h.sideBySideRenderingFunction)}else h.off("update",h.sideBySideRenderingFunction);h.refresh()}function Qe(o){var h=o.codemirror,w=h.getWrapperElement(),T=o.toolbar_div,L=o.options.toolbar?o.toolbarElements.preview:!1,W=w.lastChild,R=h.getWrapperElement().nextSibling;if(R.classList.contains("editor-preview-active-side")&&Ze(o),!W||!W.classList.contains("editor-preview-full")){if(W=document.createElement("div"),W.className="editor-preview-full",o.options.previewClass)if(Array.isArray(o.options.previewClass))for(var F=0;F<o.options.previewClass.length;F++)W.classList.add(o.options.previewClass[F]);else typeof o.options.previewClass=="string"&&W.classList.add(o.options.previewClass);w.appendChild(W)}W.classList.contains("editor-preview-active")?(W.classList.remove("editor-preview-active"),L&&(L.classList.remove("active"),T.classList.remove("disabled-for-preview"))):(setTimeout(function(){W.classList.add("editor-preview-active")},1),L&&(L.classList.add("active"),T.classList.add("disabled-for-preview")));var q=o.options.previewRender(o.value(),W);q!==null&&(W.innerHTML=q)}function Je(o,h,w,T){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active")){var L,W=w[0],R=w[1],F={},q={};Object.assign(F,o.getCursor("start")),Object.assign(q,o.getCursor("end")),T&&(W=W.replace("#url#",T),R=R.replace("#url#",T)),h?(L=o.getLine(F.line),W=L.slice(0,F.ch),R=L.slice(F.ch),o.replaceRange(W+R,{line:F.line,ch:0})):(L=o.getSelection(),o.replaceSelection(W+L+R),F.ch+=W.length,F!==q&&(q.ch+=W.length)),o.setSelection(F,q),o.focus()}}function Ue(o,h,w){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active")){for(var T=o.getCursor("start"),L=o.getCursor("end"),W=T.line;W<=L.line;W++)(function(R){var F=o.getLine(R),q=F.search(/[^#]/);h!==void 0?q<=0?h=="bigger"?F="###### "+F:F="# "+F:q==6&&h=="smaller"?F=F.substr(7):q==1&&h=="bigger"?F=F.substr(2):h=="bigger"?F=F.substr(1):F="#"+F:q<=0?F="#".repeat(w)+" "+F:q==w?F=F.substr(q+1):F="#".repeat(w)+" "+F.substr(q+1),o.replaceRange(F,{line:R,ch:0},{line:R,ch:99999999999999})})(W);o.focus()}}function je(o,h,w){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active")){for(var T=/^(\s*)(\*|-|\+|\d*\.)(\s+)/,L=/^\s*/,W=re(o),R=o.getCursor("start"),F=o.getCursor("end"),q={quote:/^(\s*)>\s+/,"unordered-list":T,"ordered-list":T},N=function(Ne,ze){var Te={quote:">","unordered-list":w,"ordered-list":"%%i."};return Te[Ne].replace("%%i",ze)},de=function(Ne,ze){var Te={quote:">","unordered-list":"\\"+w,"ordered-list":"\\d+."},Le=new RegExp(Te[Ne]);return ze&&Le.test(ze)},be=function(Ne,ze,Te){var Le=T.exec(ze),nt=N(Ne,ke);return Le!==null?(de(Ne,Le[2])&&(nt=""),ze=Le[1]+nt+Le[3]+ze.replace(L,"").replace(q[Ne],"$1")):Te==!1&&(ze=nt+" "+ze),ze},ke=1,ue=R.line;ue<=F.line;ue++)(function(Ne){var ze=o.getLine(Ne);W[h]?ze=ze.replace(q[h],"$1"):(h=="unordered-list"&&(ze=be("ordered-list",ze,!0)),ze=be(h,ze,!1),ke+=1),o.replaceRange(ze,{line:Ne,ch:0},{line:Ne,ch:99999999999999})})(ue);o.focus()}}function Ve(o,h,w,T){if(!(!o.codemirror||o.isPreviewActive())){var L=o.codemirror,W=re(L),R=W[h];if(!R){Je(L,R,w,T);return}var F=L.getCursor("start"),q=L.getCursor("end"),N=L.getLine(F.line),de=N.slice(0,F.ch),be=N.slice(F.ch);h=="link"?de=de.replace(/(.*)[^!]\[/,"$1"):h=="image"&&(de=de.replace(/(.*)!\[$/,"$1")),be=be.replace(/]\(.*?\)/,""),L.replaceRange(de+be,{line:F.line,ch:0},{line:F.line,ch:99999999999999}),F.ch-=w[0].length,F!==q&&(q.ch-=w[0].length),L.setSelection(F,q),L.focus()}}function ht(o,h,w,T){if(!(!o.codemirror||o.isPreviewActive())){T=typeof T>"u"?w:T;var L=o.codemirror,W=re(L),R,F=w,q=T,N=L.getCursor("start"),de=L.getCursor("end");W[h]?(R=L.getLine(N.line),F=R.slice(0,N.ch),q=R.slice(N.ch),h=="bold"?(F=F.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),q=q.replace(/(\*\*|__)/,"")):h=="italic"?(F=F.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),q=q.replace(/(\*|_)/,"")):h=="strikethrough"&&(F=F.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),q=q.replace(/(\*\*|~~)/,"")),L.replaceRange(F+q,{line:N.line,ch:0},{line:N.line,ch:99999999999999}),h=="bold"||h=="strikethrough"?(N.ch-=2,N!==de&&(de.ch-=2)):h=="italic"&&(N.ch-=1,N!==de&&(de.ch-=1))):(R=L.getSelection(),h=="bold"?(R=R.split("**").join(""),R=R.split("__").join("")):h=="italic"?(R=R.split("*").join(""),R=R.split("_").join("")):h=="strikethrough"&&(R=R.split("~~").join("")),L.replaceSelection(F+R+q),N.ch+=w.length,de.ch=N.ch+R.length),L.setSelection(N,de),L.focus()}}function Ce(o){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active"))for(var h=o.getCursor("start"),w=o.getCursor("end"),T,L=h.line;L<=w.line;L++)T=o.getLine(L),T=T.replace(/^[ ]*([# ]+|\*|-|[> ]+|[0-9]+(.|\)))[ ]*/,""),o.replaceRange(T,{line:L,ch:0},{line:L,ch:99999999999999})}function Ct(o,h){if(Math.abs(o)<1024)return""+o+h[0];var w=0;do o/=1024,++w;while(Math.abs(o)>=1024&&w<h.length);return""+o.toFixed(1)+h[w]}function Lt(o,h){for(var w in h)Object.prototype.hasOwnProperty.call(h,w)&&(h[w]instanceof Array?o[w]=h[w].concat(o[w]instanceof Array?o[w]:[]):h[w]!==null&&typeof h[w]=="object"&&h[w].constructor===Object?o[w]=Lt(o[w]||{},h[w]):o[w]=h[w]);return o}function ot(o){for(var h=1;h<arguments.length;h++)o=Lt(o,arguments[h]);return o}function Nt(o){var h=/[a-zA-Z0-9_\u00A0-\u02AF\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g,w=o.match(h),T=0;if(w===null)return T;for(var L=0;L<w.length;L++)w[L].charCodeAt(0)>=19968?T+=w[L].length:T+=1;return T}var we={bold:"fa fa-bold",italic:"fa fa-italic",strikethrough:"fa fa-strikethrough",heading:"fa fa-header fa-heading","heading-smaller":"fa fa-header fa-heading header-smaller","heading-bigger":"fa fa-header fa-heading header-bigger","heading-1":"fa fa-header fa-heading header-1","heading-2":"fa fa-header fa-heading header-2","heading-3":"fa fa-header fa-heading header-3",code:"fa fa-code",quote:"fa fa-quote-left","ordered-list":"fa fa-list-ol","unordered-list":"fa fa-list-ul","clean-block":"fa fa-eraser",link:"fa fa-link",image:"fa fa-image","upload-image":"fa fa-image",table:"fa fa-table","horizontal-rule":"fa fa-minus",preview:"fa fa-eye","side-by-side":"fa fa-columns",fullscreen:"fa fa-arrows-alt",guide:"fa fa-question-circle",undo:"fa fa-undo",redo:"fa fa-repeat fa-redo"},xt={bold:{name:"bold",action:Q,className:we.bold,title:"Bold",default:!0},italic:{name:"italic",action:j,className:we.italic,title:"Italic",default:!0},strikethrough:{name:"strikethrough",action:K,className:we.strikethrough,title:"Strikethrough"},heading:{name:"heading",action:pe,className:we.heading,title:"Heading",default:!0},"heading-smaller":{name:"heading-smaller",action:pe,className:we["heading-smaller"],title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:xe,className:we["heading-bigger"],title:"Bigger Heading"},"heading-1":{name:"heading-1",action:Xe,className:we["heading-1"],title:"Big Heading"},"heading-2":{name:"heading-2",action:le,className:we["heading-2"],title:"Medium Heading"},"heading-3":{name:"heading-3",action:Oe,className:we["heading-3"],title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:se,className:we.code,title:"Code"},quote:{name:"quote",action:V,className:we.quote,title:"Quote",default:!0},"unordered-list":{name:"unordered-list",action:ce,className:we["unordered-list"],title:"Generic List",default:!0},"ordered-list":{name:"ordered-list",action:ae,className:we["ordered-list"],title:"Numbered List",default:!0},"clean-block":{name:"clean-block",action:Ee,className:we["clean-block"],title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:$e,className:we.link,title:"Create Link",default:!0},image:{name:"image",action:pt,className:we.image,title:"Insert Image",default:!0},"upload-image":{name:"upload-image",action:M,className:we["upload-image"],title:"Import an image"},table:{name:"table",action:J,className:we.table,title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:Fe,className:we["horizontal-rule"],title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:Qe,className:we.preview,noDisable:!0,title:"Toggle Preview",default:!0},"side-by-side":{name:"side-by-side",action:Ze,className:we["side-by-side"],noDisable:!0,noMobile:!0,title:"Toggle Side by Side",default:!0},fullscreen:{name:"fullscreen",action:X,className:we.fullscreen,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:we.guide,noDisable:!0,title:"Markdown Guide",default:!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:Ie,className:we.undo,noDisable:!0,title:"Undo"},redo:{name:"redo",action:tt,className:we.redo,noDisable:!0,title:"Redo"}},Jt={link:["[","](#url#)"],image:["![","](#url#)"],uploadedImage:["![](#url#)",""],table:["",`
85
+
86
+ | Column 1 | Column 2 | Column 3 |
87
+ | -------- | -------- | -------- |
88
+ | Text | Text | Text |
89
+
90
+ `],horizontalRule:["",`
91
+
92
+ -----
93
+
94
+ `]},wn={link:"URL for the link:",image:"URL of the image:"},G={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},$={bold:"**",code:"```",italic:"*"},I={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"},v={noFileGiven:"You must select a file.",typeNotAllowed:"This image type is not allowed.",fileTooLarge:`Image #image_name# is too big (#image_size#).
95
+ Maximum file size is #image_max_size#.`,importError:"Something went wrong when uploading the image #image_name#."};function m(o){o=o||{},o.parent=this;var h=!0;if(o.autoDownloadFontAwesome===!1&&(h=!1),o.autoDownloadFontAwesome!==!0)for(var w=document.styleSheets,T=0;T<w.length;T++)w[T].href&&w[T].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")>-1&&(h=!1);if(h){var L=document.createElement("link");L.rel="stylesheet",L.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(L)}if(o.element)this.element=o.element;else if(o.element===null){console.log("EasyMDE: Error. No element was found.");return}if(o.toolbar===void 0){o.toolbar=[];for(var W in xt)Object.prototype.hasOwnProperty.call(xt,W)&&(W.indexOf("separator-")!=-1&&o.toolbar.push("|"),(xt[W].default===!0||o.showIcons&&o.showIcons.constructor===Array&&o.showIcons.indexOf(W)!=-1)&&o.toolbar.push(W))}if(Object.prototype.hasOwnProperty.call(o,"previewClass")||(o.previewClass="editor-preview"),Object.prototype.hasOwnProperty.call(o,"status")||(o.status=["autosave","lines","words","cursor"],o.uploadImage&&o.status.unshift("upload-image")),o.previewRender||(o.previewRender=function(F){return this.parent.markdown(F)}),o.parsingConfig=ot({highlightFormatting:!0},o.parsingConfig||{}),o.insertTexts=ot({},Jt,o.insertTexts||{}),o.promptTexts=ot({},wn,o.promptTexts||{}),o.blockStyles=ot({},$,o.blockStyles||{}),o.autosave!=null&&(o.autosave.timeFormat=ot({},G,o.autosave.timeFormat||{})),o.iconClassMap=ot({},we,o.iconClassMap||{}),o.shortcuts=ot({},A,o.shortcuts||{}),o.maxHeight=o.maxHeight||void 0,o.direction=o.direction||"ltr",typeof o.maxHeight<"u"?o.minHeight=o.maxHeight:o.minHeight=o.minHeight||"300px",o.errorCallback=o.errorCallback||function(F){alert(F)},o.uploadImage=o.uploadImage||!1,o.imageMaxSize=o.imageMaxSize||2097152,o.imageAccept=o.imageAccept||"image/png, image/jpeg, image/gif, image/avif",o.imageTexts=ot({},I,o.imageTexts||{}),o.errorMessages=ot({},v,o.errorMessages||{}),o.imagePathAbsolute=o.imagePathAbsolute||!1,o.imageCSRFName=o.imageCSRFName||"csrfmiddlewaretoken",o.imageCSRFHeader=o.imageCSRFHeader||!1,o.imageInputName=o.imageInputName||"image",o.autosave!=null&&o.autosave.unique_id!=null&&o.autosave.unique_id!=""&&(o.autosave.uniqueId=o.autosave.unique_id),o.overlayMode&&o.overlayMode.combine===void 0&&(o.overlayMode.combine=!0),this.options=o,this.render(),o.initialValue&&(!this.options.autosave||this.options.autosave.foundSavedValue!==!0)&&this.value(o.initialValue),o.uploadImage){var R=this;this.codemirror.on("dragenter",function(F,q){R.updateStatusBar("upload-image",R.options.imageTexts.sbOnDragEnter),q.stopPropagation(),q.preventDefault()}),this.codemirror.on("dragend",function(F,q){R.updateStatusBar("upload-image",R.options.imageTexts.sbInit),q.stopPropagation(),q.preventDefault()}),this.codemirror.on("dragleave",function(F,q){R.updateStatusBar("upload-image",R.options.imageTexts.sbInit),q.stopPropagation(),q.preventDefault()}),this.codemirror.on("dragover",function(F,q){R.updateStatusBar("upload-image",R.options.imageTexts.sbOnDragEnter),q.stopPropagation(),q.preventDefault()}),this.codemirror.on("drop",function(F,q){q.stopPropagation(),q.preventDefault(),o.imageUploadFunction?R.uploadImagesUsingCustomFunction(o.imageUploadFunction,q.dataTransfer.files):R.uploadImages(q.dataTransfer.files)}),this.codemirror.on("paste",function(F,q){o.imageUploadFunction?R.uploadImagesUsingCustomFunction(o.imageUploadFunction,q.clipboardData.files):R.uploadImages(q.clipboardData.files)})}}m.prototype.uploadImages=function(o,h,w){if(o.length!==0){for(var T=[],L=0;L<o.length;L++)T.push(o[L].name),this.uploadImage(o[L],h,w);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",T.join(", ")))}},m.prototype.uploadImagesUsingCustomFunction=function(o,h){if(h.length!==0){for(var w=[],T=0;T<h.length;T++)w.push(h[T].name),this.uploadImageUsingCustomFunction(o,h[T]);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",w.join(", ")))}},m.prototype.updateStatusBar=function(o,h){if(this.gui.statusbar){var w=this.gui.statusbar.getElementsByClassName(o);w.length===1?this.gui.statusbar.getElementsByClassName(o)[0].textContent=h:w.length===0?console.log("EasyMDE: status bar item "+o+" was not found."):console.log("EasyMDE: Several status bar items named "+o+" was found.")}},m.prototype.markdown=function(o){if(f){var h;if(this.options&&this.options.renderingConfig&&this.options.renderingConfig.markedOptions?h=this.options.renderingConfig.markedOptions:h={},this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1?h.breaks=!1:h.breaks=!0,this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0){var w=this.options.renderingConfig.hljs||window.hljs;w&&(h.highlight=function(L,W){return W&&w.getLanguage(W)?w.highlight(W,L).value:w.highlightAuto(L).value})}f.use(h);var T=f.parse(o);return this.options.renderingConfig&&typeof this.options.renderingConfig.sanitizerFunction=="function"&&(T=this.options.renderingConfig.sanitizerFunction.call(this,T)),T=S(T),T=z(T),T}},m.prototype.render=function(o){if(o||(o=this.element||document.getElementsByTagName("textarea")[0]),this._rendered&&this._rendered===o)return;this.element=o;var h=this.options,w=this,T={};for(var L in h.shortcuts)h.shortcuts[L]!==null&&b[L]!==null&&(function(Te){T[Z(h.shortcuts[Te])]=function(){var Le=b[Te];typeof Le=="function"?Le(w):typeof Le=="string"&&window.open(Le,"_blank")}})(L);T.Enter="newlineAndIndentContinueMarkdownList",T.Tab="tabAndIndentMarkdownList",T["Shift-Tab"]="shiftTabAndUnindentMarkdownList",T.Esc=function(Te){Te.getOption("fullScreen")&&X(w)},this.documentOnKeyDown=function(Te){Te=Te||window.event,Te.keyCode==27&&w.codemirror.getOption("fullScreen")&&X(w)},document.addEventListener("keydown",this.documentOnKeyDown,!1);var W,R;h.overlayMode?(y.defineMode("overlay-mode",function(Te){return y.overlayMode(y.getMode(Te,h.spellChecker!==!1?"spell-checker":"gfm"),h.overlayMode.mode,h.overlayMode.combine)}),W="overlay-mode",R=h.parsingConfig,R.gitHubSpice=!1):(W=h.parsingConfig,W.name="gfm",W.gitHubSpice=!1),h.spellChecker!==!1&&(W="spell-checker",R=h.parsingConfig,R.name="gfm",R.gitHubSpice=!1,typeof h.spellChecker=="function"?h.spellChecker({codeMirrorInstance:y}):c({codeMirrorInstance:y}));function F(Te,Le,nt){return{addNew:!1}}if(this.codemirror=y.fromTextArea(o,{mode:W,backdrop:R,theme:h.theme!=null?h.theme:"easymde",tabSize:h.tabSize!=null?h.tabSize:2,indentUnit:h.tabSize!=null?h.tabSize:2,indentWithTabs:h.indentWithTabs!==!1,lineNumbers:h.lineNumbers===!0,autofocus:h.autofocus===!0,extraKeys:T,direction:h.direction,lineWrapping:h.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:h.placeholder||o.getAttribute("placeholder")||"",styleSelectedText:h.styleSelectedText!=null?h.styleSelectedText:!k(),scrollbarStyle:h.scrollbarStyle!=null?h.scrollbarStyle:"native",configureMouse:F,inputStyle:h.inputStyle!=null?h.inputStyle:k()?"contenteditable":"textarea",spellcheck:h.nativeSpellcheck!=null?h.nativeSpellcheck:!0,autoRefresh:h.autoRefresh!=null?h.autoRefresh:!1}),this.codemirror.getScrollerElement().style.minHeight=h.minHeight,typeof h.maxHeight<"u"&&(this.codemirror.getScrollerElement().style.height=h.maxHeight),h.forceSync===!0){var q=this.codemirror;q.on("change",function(){q.save()})}this.gui={};var N=document.createElement("div");N.classList.add("EasyMDEContainer"),N.setAttribute("role","application");var de=this.codemirror.getWrapperElement();de.parentNode.insertBefore(N,de),N.appendChild(de),h.toolbar!==!1&&(this.gui.toolbar=this.createToolbar()),h.status!==!1&&(this.gui.statusbar=this.createStatusbar()),h.autosave!=null&&h.autosave.enabled===!0&&(this.autosave(),this.codemirror.on("change",function(){clearTimeout(w._autosave_timeout),w._autosave_timeout=setTimeout(function(){w.autosave()},w.options.autosave.submit_delay||w.options.autosave.delay||1e3)}));function be(Te,Le){var nt,rt=window.getComputedStyle(document.querySelector(".CodeMirror-sizer")).width.replace("px","");return Te<rt?nt=Le+"px":nt=Le/Te*100+"%",nt}var ke=this;function ue(Te,Le){var nt=new URL(Le.url,document.baseURI).href;Te.setAttribute("data-img-src",nt),Te.setAttribute("style","--bg-image:url("+nt+");--width:"+Le.naturalWidth+"px;--height:"+be(Le.naturalWidth,Le.naturalHeight)),ke.codemirror.setSize()}function Ne(){h.previewImagesInEditor&&N.querySelectorAll(".cm-image-marker").forEach(function(Te){var Le=Te.parentElement;if(Le.innerText.match(/^!\[.*?\]\(.*\)/g)&&!Le.hasAttribute("data-img-src")){var nt=Le.innerText.match(/!\[.*?\]\((.*?)\)/);if(window.EMDEimagesCache||(window.EMDEimagesCache={}),nt&&nt.length>=2){var rt=nt[1];if(h.imagesPreviewHandler){var vt=h.imagesPreviewHandler(nt[1]);typeof vt=="string"&&(rt=vt)}if(window.EMDEimagesCache[rt])ue(Le,window.EMDEimagesCache[rt]);else{window.EMDEimagesCache[rt]={};var Mt=document.createElement("img");Mt.onload=function(){window.EMDEimagesCache[rt]={naturalWidth:Mt.naturalWidth,naturalHeight:Mt.naturalHeight,url:rt},ue(Le,window.EMDEimagesCache[rt])},Mt.src=rt}}}})}this.codemirror.on("update",function(){Ne()}),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element,(h.autofocus===!0||o.autofocus)&&this.codemirror.focus();var ze=this.codemirror;setTimeout((function(){ze.refresh()}).bind(ze),0)},m.prototype.cleanup=function(){document.removeEventListener("keydown",this.documentOnKeyDown)};function B(){if(typeof localStorage=="object")try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch{return!1}else return!1;return!0}return m.prototype.autosave=function(){if(B()){var o=this;if(this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to use the autosave feature");return}this.options.autosave.binded!==!0&&(o.element.form!=null&&o.element.form!=null&&o.element.form.addEventListener("submit",function(){clearTimeout(o.autosaveTimeoutId),o.autosaveTimeoutId=void 0,localStorage.removeItem("smde_"+o.options.autosave.uniqueId)}),this.options.autosave.binded=!0),this.options.autosave.loaded!==!0&&(typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)=="string"&&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);var h=o.value();h!==""?localStorage.setItem("smde_"+this.options.autosave.uniqueId,h):localStorage.removeItem("smde_"+this.options.autosave.uniqueId);var w=document.getElementById("autosaved");if(w!=null&&w!=null&&w!=""){var T=new Date,L=new Intl.DateTimeFormat([this.options.autosave.timeFormat.locale,"en-US"],this.options.autosave.timeFormat.format).format(T),W=this.options.autosave.text==null?"Autosaved: ":this.options.autosave.text;w.innerHTML=W+L}}else console.log("EasyMDE: localStorage not available, cannot autosave")},m.prototype.clearAutosavedValue=function(){if(B()){if(this.options.autosave==null||this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to clear the autosave value");return}localStorage.removeItem("smde_"+this.options.autosave.uniqueId)}else console.log("EasyMDE: localStorage not available, cannot autosave")},m.prototype.openBrowseFileWindow=function(o,h){var w=this,T=this.gui.toolbar.getElementsByClassName("imageInput")[0];T.click();function L(W){w.options.imageUploadFunction?w.uploadImagesUsingCustomFunction(w.options.imageUploadFunction,W.target.files):w.uploadImages(W.target.files,o,h),T.removeEventListener("change",L)}T.addEventListener("change",L)},m.prototype.uploadImage=function(o,h,w){var T=this;h=h||function(N){g(T,N)};function L(q){T.updateStatusBar("upload-image",q),setTimeout(function(){T.updateStatusBar("upload-image",T.options.imageTexts.sbInit)},1e4),w&&typeof w=="function"&&w(q),T.options.errorCallback(q)}function W(q){var N=T.options.imageTexts.sizeUnits.split(",");return q.replace("#image_name#",o.name).replace("#image_size#",Ct(o.size,N)).replace("#image_max_size#",Ct(T.options.imageMaxSize,N))}if(o.size>this.options.imageMaxSize){L(W(this.options.errorMessages.fileTooLarge));return}var R=new FormData;R.append("image",o),T.options.imageCSRFToken&&!T.options.imageCSRFHeader&&R.append(T.options.imageCSRFName,T.options.imageCSRFToken);var F=new XMLHttpRequest;F.upload.onprogress=function(q){if(q.lengthComputable){var N=""+Math.round(q.loaded*100/q.total);T.updateStatusBar("upload-image",T.options.imageTexts.sbProgress.replace("#file_name#",o.name).replace("#progress#",N))}},F.open("POST",this.options.imageUploadEndpoint),T.options.imageCSRFToken&&T.options.imageCSRFHeader&&F.setRequestHeader(T.options.imageCSRFName,T.options.imageCSRFToken),F.onload=function(){try{var q=JSON.parse(this.responseText)}catch{console.error("EasyMDE: The server did not return a valid json."),L(W(T.options.errorMessages.importError));return}this.status===200&&q&&!q.error&&q.data&&q.data.filePath?h((T.options.imagePathAbsolute?"":window.location.origin+"/")+q.data.filePath):q.error&&q.error in T.options.errorMessages?L(W(T.options.errorMessages[q.error])):q.error?L(W(q.error)):(console.error("EasyMDE: Received an unexpected response after uploading the image."+this.status+" ("+this.statusText+")"),L(W(T.options.errorMessages.importError)))},F.onerror=function(q){console.error("EasyMDE: An unexpected error occurred when trying to upload the image."+q.target.status+" ("+q.target.statusText+")"),L(T.options.errorMessages.importError)},F.send(R)},m.prototype.uploadImageUsingCustomFunction=function(o,h){var w=this;function T(R){g(w,R)}function L(R){var F=W(R);w.updateStatusBar("upload-image",F),setTimeout(function(){w.updateStatusBar("upload-image",w.options.imageTexts.sbInit)},1e4),w.options.errorCallback(F)}function W(R){var F=w.options.imageTexts.sizeUnits.split(",");return R.replace("#image_name#",h.name).replace("#image_size#",Ct(h.size,F)).replace("#image_max_size#",Ct(w.options.imageMaxSize,F))}o.apply(this,[h,T,L])},m.prototype.setPreviewMaxHeight=function(){var o=this.codemirror,h=o.getWrapperElement(),w=h.nextSibling,T=parseInt(window.getComputedStyle(h).paddingTop),L=parseInt(window.getComputedStyle(h).borderTopWidth),W=parseInt(this.options.maxHeight),R=W+T*2+L*2,F=R.toString()+"px";w.style.height=F},m.prototype.createSideBySide=function(){var o=this.codemirror,h=o.getWrapperElement(),w=h.nextSibling;if(!w||!w.classList.contains("editor-preview-side")){if(w=document.createElement("div"),w.className="editor-preview-side",this.options.previewClass)if(Array.isArray(this.options.previewClass))for(var T=0;T<this.options.previewClass.length;T++)w.classList.add(this.options.previewClass[T]);else typeof this.options.previewClass=="string"&&w.classList.add(this.options.previewClass);h.parentNode.insertBefore(w,h.nextSibling)}if(typeof this.options.maxHeight<"u"&&this.setPreviewMaxHeight(),this.options.syncSideBySidePreviewScroll===!1)return w;var L=!1,W=!1;return o.on("scroll",function(R){if(L){L=!1;return}W=!0;var F=R.getScrollInfo().height-R.getScrollInfo().clientHeight,q=parseFloat(R.getScrollInfo().top)/F,N=(w.scrollHeight-w.clientHeight)*q;w.scrollTop=N}),w.onscroll=function(){if(W){W=!1;return}L=!0;var R=w.scrollHeight-w.clientHeight,F=parseFloat(w.scrollTop)/R,q=(o.getScrollInfo().height-o.getScrollInfo().clientHeight)*F;o.scrollTo(0,q)},w},m.prototype.createToolbar=function(o){if(o=o||this.options.toolbar,!(!o||o.length===0)){var h;for(h=0;h<o.length;h++)xt[o[h]]!=null&&(o[h]=xt[o[h]]);var w=document.createElement("div");w.className="editor-toolbar",w.setAttribute("role","toolbar");var T=this,L={};for(T.toolbar=o,h=0;h<o.length;h++)if(!(o[h].name=="guide"&&T.options.toolbarGuideIcon===!1)&&!(T.options.hideIcons&&T.options.hideIcons.indexOf(o[h].name)!=-1)&&!((o[h].name=="fullscreen"||o[h].name=="side-by-side")&&k())){if(o[h]==="|"){for(var W=!1,R=h+1;R<o.length;R++)o[R]!=="|"&&(!T.options.hideIcons||T.options.hideIcons.indexOf(o[R].name)==-1)&&(W=!0);if(!W)continue}(function(N){var de;if(N==="|"?de=ee():N.children?de=H(N,T.options.toolbarTips,T.options.shortcuts,T):de=ie(N,!0,T.options.toolbarTips,T.options.shortcuts,"button",T),L[N.name||N]=de,w.appendChild(de),N.name==="upload-image"){var be=document.createElement("input");be.className="imageInput",be.type="file",be.multiple=!0,be.name=T.options.imageInputName,be.accept=T.options.imageAccept,be.style.display="none",be.style.opacity=0,w.appendChild(be)}})(o[h])}T.toolbar_div=w,T.toolbarElements=L;var F=this.codemirror;F.on("cursorActivity",function(){var N=re(F);for(var de in L)(function(be){var ke=L[be];N[be]?ke.classList.add("active"):be!="fullscreen"&&be!="side-by-side"&&ke.classList.remove("active")})(de)});var q=F.getWrapperElement();return q.parentNode.insertBefore(w,q),w}},m.prototype.createStatusbar=function(o){o=o||this.options.status;var h=this.options,w=this.codemirror;if(!(!o||o.length===0)){var T=[],L,W,R,F;for(L=0;L<o.length;L++)if(W=void 0,R=void 0,F=void 0,typeof o[L]=="object")T.push({className:o[L].className,defaultValue:o[L].defaultValue,onUpdate:o[L].onUpdate,onActivity:o[L].onActivity});else{var q=o[L];q==="words"?(F=function(ue){ue.innerHTML=Nt(w.getValue())},W=function(ue){ue.innerHTML=Nt(w.getValue())}):q==="lines"?(F=function(ue){ue.innerHTML=w.lineCount()},W=function(ue){ue.innerHTML=w.lineCount()}):q==="cursor"?(F=function(ue){ue.innerHTML="1:1"},R=function(ue){var Ne=w.getCursor(),ze=Ne.line+1,Te=Ne.ch+1;ue.innerHTML=ze+":"+Te}):q==="autosave"?F=function(ue){h.autosave!=null&&h.autosave.enabled===!0&&ue.setAttribute("id","autosaved")}:q==="upload-image"&&(F=function(ue){ue.innerHTML=h.imageTexts.sbInit}),T.push({className:q,defaultValue:F,onUpdate:W,onActivity:R})}var N=document.createElement("div");for(N.className="editor-statusbar",L=0;L<T.length;L++){var de=T[L],be=document.createElement("span");be.className=de.className,typeof de.defaultValue=="function"&&de.defaultValue(be),typeof de.onUpdate=="function"&&this.codemirror.on("update",(function(ue,Ne){return function(){Ne.onUpdate(ue)}})(be,de)),typeof de.onActivity=="function"&&this.codemirror.on("cursorActivity",(function(ue,Ne){return function(){Ne.onActivity(ue)}})(be,de)),N.appendChild(be)}var ke=this.codemirror.getWrapperElement();return ke.parentNode.insertBefore(N,ke.nextSibling),N}},m.prototype.value=function(o){var h=this.codemirror;if(o===void 0)return h.getValue();if(h.getDoc().setValue(o),this.isPreviewActive()){var w=h.getWrapperElement(),T=w.lastChild,L=this.options.previewRender(o,T);L!==null&&(T.innerHTML=L)}return this},m.toggleBold=Q,m.toggleItalic=j,m.toggleStrikethrough=K,m.toggleBlockquote=V,m.toggleHeadingSmaller=pe,m.toggleHeadingBigger=xe,m.toggleHeading1=Xe,m.toggleHeading2=le,m.toggleHeading3=Oe,m.toggleHeading4=Re,m.toggleHeading5=Pe,m.toggleHeading6=P,m.toggleCodeBlock=se,m.toggleUnorderedList=ce,m.toggleOrderedList=ae,m.cleanBlock=Ee,m.drawLink=$e,m.drawImage=pt,m.drawUploadedImage=M,m.drawTable=J,m.drawHorizontalRule=Fe,m.undo=Ie,m.redo=tt,m.togglePreview=Qe,m.toggleSideBySide=Ze,m.toggleFullScreen=X,m.prototype.toggleBold=function(){Q(this)},m.prototype.toggleItalic=function(){j(this)},m.prototype.toggleStrikethrough=function(){K(this)},m.prototype.toggleBlockquote=function(){V(this)},m.prototype.toggleHeadingSmaller=function(){pe(this)},m.prototype.toggleHeadingBigger=function(){xe(this)},m.prototype.toggleHeading1=function(){Xe(this)},m.prototype.toggleHeading2=function(){le(this)},m.prototype.toggleHeading3=function(){Oe(this)},m.prototype.toggleHeading4=function(){Re(this)},m.prototype.toggleHeading5=function(){Pe(this)},m.prototype.toggleHeading6=function(){P(this)},m.prototype.toggleCodeBlock=function(){se(this)},m.prototype.toggleUnorderedList=function(){ce(this)},m.prototype.toggleOrderedList=function(){ae(this)},m.prototype.cleanBlock=function(){Ee(this)},m.prototype.drawLink=function(){$e(this)},m.prototype.drawImage=function(){pt(this)},m.prototype.drawUploadedImage=function(){M(this)},m.prototype.drawTable=function(){J(this)},m.prototype.drawHorizontalRule=function(){Fe(this)},m.prototype.undo=function(){Ie(this)},m.prototype.redo=function(){tt(this)},m.prototype.togglePreview=function(){Qe(this)},m.prototype.toggleSideBySide=function(){Ze(this)},m.prototype.toggleFullScreen=function(){X(this)},m.prototype.isPreviewActive=function(){var o=this.codemirror,h=o.getWrapperElement(),w=h.lastChild;return w.classList.contains("editor-preview-active")},m.prototype.isSideBySideActive=function(){var o=this.codemirror,h=o.getWrapperElement(),w=h.nextSibling;return w.classList.contains("editor-preview-active-side")},m.prototype.isFullscreenActive=function(){var o=this.codemirror;return o.getOption("fullScreen")},m.prototype.getState=function(){var o=this.codemirror;return re(o)},m.prototype.toTextArea=function(){var o=this.codemirror,h=o.getWrapperElement(),w=h.parentNode;w&&(this.gui.toolbar&&w.removeChild(this.gui.toolbar),this.gui.statusbar&&w.removeChild(this.gui.statusbar),this.gui.sideBySide&&w.removeChild(this.gui.sideBySide)),w.parentNode.insertBefore(h,w),w.remove(),o.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())},aa=m,aa}var Ku=Xu();const zt=ur(Ku);function la(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Zn=la();function no(y){Zn=y}var Lr={exec:()=>null};function at(y,c=""){let f=typeof y=="string"?y:y.source;const p={replace:(x,b)=>{let A=typeof b=="string"?b:b.source;return A=A.replace(Kt.caret,"$1"),f=f.replace(x,A),p},getRegex:()=>new RegExp(f,c)};return p}var Kt={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:y=>new RegExp(`^( {0,3}${y})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:y=>new RegExp(`^ {0,${Math.min(3,y-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:y=>new RegExp(`^ {0,${Math.min(3,y-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:y=>new RegExp(`^ {0,${Math.min(3,y-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:y=>new RegExp(`^ {0,${Math.min(3,y-1)}}#`),htmlBeginRegex:y=>new RegExp(`^ {0,${Math.min(3,y-1)}}<(?:[a-z].*>|!--)`,"i")},Yu=/^(?:[ \t]*(?:\n|$))+/,Zu=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Qu=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Mr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ju=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,oa=/(?:[*+-]|\d{1,9}[.)])/,ro=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,io=at(ro).replace(/bull/g,oa).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Vu=at(ro).replace(/bull/g,oa).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),sa=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ef=/^[^\n]+/,ua=/(?!\s*\])(?:\\.|[^\[\]\\])+/,tf=at(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ua).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),nf=at(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,oa).getRegex(),pi="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|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",fa=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,rf=at("^ {0,3}(?:<(script|pre|style|textarea)[\\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[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",fa).replace("tag",pi).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ao=at(sa).replace("hr",Mr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").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|textarea|!--)").replace("tag",pi).getRegex(),af=at(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ao).getRegex(),ca={blockquote:af,code:Zu,def:tf,fences:Qu,heading:Ju,hr:Mr,html:rf,lheading:io,list:nf,newline:Yu,paragraph:ao,table:Lr,text:ef},lo=at("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Mr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",pi).getRegex(),lf={...ca,lheading:Vu,table:lo,paragraph:at(sa).replace("hr",Mr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",lo).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|textarea|!--)").replace("tag",pi).getRegex()},of={...ca,html:at(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",fa).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:Lr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:at(sa).replace("hr",Mr).replace("heading",` *#{1,6} *[^
96
+ ]`).replace("lheading",io).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},sf=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,uf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,oo=/^( {2,}|\\)\n(?!\s*$)/,ff=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,gi=/[\p{P}\p{S}]/u,ha=/[\s\p{P}\p{S}]/u,so=/[^\s\p{P}\p{S}]/u,cf=at(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ha).getRegex(),uo=/(?!~)[\p{P}\p{S}]/u,hf=/(?!~)[\s\p{P}\p{S}]/u,df=/(?:[^\s\p{P}\p{S}]|~)/u,pf=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,fo=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,gf=at(fo,"u").replace(/punct/g,gi).getRegex(),vf=at(fo,"u").replace(/punct/g,uo).getRegex(),co="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",mf=at(co,"gu").replace(/notPunctSpace/g,so).replace(/punctSpace/g,ha).replace(/punct/g,gi).getRegex(),xf=at(co,"gu").replace(/notPunctSpace/g,df).replace(/punctSpace/g,hf).replace(/punct/g,uo).getRegex(),yf=at("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,so).replace(/punctSpace/g,ha).replace(/punct/g,gi).getRegex(),bf=at(/\\(punct)/,"gu").replace(/punct/g,gi).getRegex(),kf=at(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("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])?)+(?![-_])/).getRegex(),Df=at(fa).replace("(?:-->|$)","-->").getRegex(),wf=at("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Df).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),vi=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Cf=at(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",vi).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ho=at(/^!?\[(label)\]\[(ref)\]/).replace("label",vi).replace("ref",ua).getRegex(),po=at(/^!?\[(ref)\](?:\[\])?/).replace("ref",ua).getRegex(),Sf=at("reflink|nolink(?!\\()","g").replace("reflink",ho).replace("nolink",po).getRegex(),da={_backpedal:Lr,anyPunctuation:bf,autolink:kf,blockSkip:pf,br:oo,code:uf,del:Lr,emStrongLDelim:gf,emStrongRDelimAst:mf,emStrongRDelimUnd:yf,escape:sf,link:Cf,nolink:po,punctuation:cf,reflink:ho,reflinkSearch:Sf,tag:wf,text:ff,url:Lr},Af={...da,link:at(/^!?\[(label)\]\((.*?)\)/).replace("label",vi).getRegex(),reflink:at(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",vi).getRegex()},pa={...da,emStrongRDelimAst:xf,emStrongLDelim:vf,url:at(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Ef={...pa,br:at(oo).replace("{2,}","*").getRegex(),text:at(pa.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},mi={normal:ca,gfm:lf,pedantic:of},Br={normal:da,gfm:pa,breaks:Ef,pedantic:Af},Tf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},go=y=>Tf[y];function kn(y,c){if(c){if(Kt.escapeTest.test(y))return y.replace(Kt.escapeReplace,go)}else if(Kt.escapeTestNoEncode.test(y))return y.replace(Kt.escapeReplaceNoEncode,go);return y}function vo(y){try{y=encodeURI(y).replace(Kt.percentDecode,"%")}catch{return null}return y}function mo(y,c){var b;const f=y.replace(Kt.findPipe,(A,D,k)=>{let S=!1,z=D;for(;--z>=0&&k[z]==="\\";)S=!S;return S?"|":" |"}),p=f.split(Kt.splitPipe);let x=0;if(p[0].trim()||p.shift(),p.length>0&&!((b=p.at(-1))!=null&&b.trim())&&p.pop(),c)if(p.length>c)p.splice(c);else for(;p.length<c;)p.push("");for(;x<p.length;x++)p[x]=p[x].trim().replace(Kt.slashPipe,"|");return p}function Rr(y,c,f){const p=y.length;if(p===0)return"";let x=0;for(;x<p&&y.charAt(p-x-1)===c;)x++;return y.slice(0,p-x)}function Ff(y,c){if(y.indexOf(c[1])===-1)return-1;let f=0;for(let p=0;p<y.length;p++)if(y[p]==="\\")p++;else if(y[p]===c[0])f++;else if(y[p]===c[1]&&(f--,f<0))return p;return f>0?-2:-1}function xo(y,c,f,p,x){const b=c.href,A=c.title||null,D=y[1].replace(x.other.outputLinkReplace,"$1");p.state.inLink=!0;const k={type:y[0].charAt(0)==="!"?"image":"link",raw:f,href:b,title:A,text:D,tokens:p.inlineTokens(D)};return p.state.inLink=!1,k}function Lf(y,c,f){const p=y.match(f.other.indentCodeCompensation);if(p===null)return c;const x=p[1];return c.split(`
97
+ `).map(b=>{const A=b.match(f.other.beginningSpace);if(A===null)return b;const[D]=A;return D.length>=x.length?b.slice(x.length):b}).join(`
98
+ `)}var xi=class{constructor(y){dt(this,"options");dt(this,"rules");dt(this,"lexer");this.options=y||Zn}space(y){const c=this.rules.block.newline.exec(y);if(c&&c[0].length>0)return{type:"space",raw:c[0]}}code(y){const c=this.rules.block.code.exec(y);if(c){const f=c[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:c[0],codeBlockStyle:"indented",text:this.options.pedantic?f:Rr(f,`
99
+ `)}}}fences(y){const c=this.rules.block.fences.exec(y);if(c){const f=c[0],p=Lf(f,c[3]||"",this.rules);return{type:"code",raw:f,lang:c[2]?c[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):c[2],text:p}}}heading(y){const c=this.rules.block.heading.exec(y);if(c){let f=c[2].trim();if(this.rules.other.endingHash.test(f)){const p=Rr(f,"#");(this.options.pedantic||!p||this.rules.other.endingSpaceChar.test(p))&&(f=p.trim())}return{type:"heading",raw:c[0],depth:c[1].length,text:f,tokens:this.lexer.inline(f)}}}hr(y){const c=this.rules.block.hr.exec(y);if(c)return{type:"hr",raw:Rr(c[0],`
100
+ `)}}blockquote(y){const c=this.rules.block.blockquote.exec(y);if(c){let f=Rr(c[0],`
101
+ `).split(`
102
+ `),p="",x="";const b=[];for(;f.length>0;){let A=!1;const D=[];let k;for(k=0;k<f.length;k++)if(this.rules.other.blockquoteStart.test(f[k]))D.push(f[k]),A=!0;else if(!A)D.push(f[k]);else break;f=f.slice(k);const S=D.join(`
103
+ `),z=S.replace(this.rules.other.blockquoteSetextReplace,`
104
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");p=p?`${p}
105
+ ${S}`:S,x=x?`${x}
106
+ ${z}`:z;const Z=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(z,b,!0),this.lexer.state.top=Z,f.length===0)break;const H=b.at(-1);if((H==null?void 0:H.type)==="code")break;if((H==null?void 0:H.type)==="blockquote"){const ie=H,ee=ie.raw+`
107
+ `+f.join(`
108
+ `),ye=this.blockquote(ee);b[b.length-1]=ye,p=p.substring(0,p.length-ie.raw.length)+ye.raw,x=x.substring(0,x.length-ie.text.length)+ye.text;break}else if((H==null?void 0:H.type)==="list"){const ie=H,ee=ie.raw+`
109
+ `+f.join(`
110
+ `),ye=this.list(ee);b[b.length-1]=ye,p=p.substring(0,p.length-H.raw.length)+ye.raw,x=x.substring(0,x.length-ie.raw.length)+ye.raw,f=ee.substring(b.at(-1).raw.length).split(`
111
+ `);continue}}return{type:"blockquote",raw:p,tokens:b,text:x}}}list(y){let c=this.rules.block.list.exec(y);if(c){let f=c[1].trim();const p=f.length>1,x={type:"list",raw:"",ordered:p,start:p?+f.slice(0,-1):"",loose:!1,items:[]};f=p?`\\d{1,9}\\${f.slice(-1)}`:`\\${f}`,this.options.pedantic&&(f=p?f:"[*+-]");const b=this.rules.other.listItemRegex(f);let A=!1;for(;y;){let k=!1,S="",z="";if(!(c=b.exec(y))||this.rules.block.hr.test(y))break;S=c[0],y=y.substring(S.length);let Z=c[2].split(`
112
+ `,1)[0].replace(this.rules.other.listReplaceTabs,te=>" ".repeat(3*te.length)),H=y.split(`
113
+ `,1)[0],ie=!Z.trim(),ee=0;if(this.options.pedantic?(ee=2,z=Z.trimStart()):ie?ee=c[1].length+1:(ee=c[2].search(this.rules.other.nonSpaceChar),ee=ee>4?1:ee,z=Z.slice(ee),ee+=c[1].length),ie&&this.rules.other.blankLine.test(H)&&(S+=H+`
114
+ `,y=y.substring(H.length+1),k=!0),!k){const te=this.rules.other.nextBulletRegex(ee),X=this.rules.other.hrRegex(ee),Q=this.rules.other.fencesBeginRegex(ee),j=this.rules.other.headingBeginRegex(ee),K=this.rules.other.htmlBeginRegex(ee);for(;y;){const se=y.split(`
115
+ `,1)[0];let V;if(H=se,this.options.pedantic?(H=H.replace(this.rules.other.listReplaceNesting," "),V=H):V=H.replace(this.rules.other.tabCharGlobal," "),Q.test(H)||j.test(H)||K.test(H)||te.test(H)||X.test(H))break;if(V.search(this.rules.other.nonSpaceChar)>=ee||!H.trim())z+=`
116
+ `+V.slice(ee);else{if(ie||Z.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||Q.test(Z)||j.test(Z)||X.test(Z))break;z+=`
117
+ `+H}!ie&&!H.trim()&&(ie=!0),S+=se+`
118
+ `,y=y.substring(se.length+1),Z=V.slice(ee)}}x.loose||(A?x.loose=!0:this.rules.other.doubleBlankLine.test(S)&&(A=!0));let ye=null,re;this.options.gfm&&(ye=this.rules.other.listIsTask.exec(z),ye&&(re=ye[0]!=="[ ] ",z=z.replace(this.rules.other.listReplaceTask,""))),x.items.push({type:"list_item",raw:S,task:!!ye,checked:re,loose:!1,text:z,tokens:[]}),x.raw+=S}const D=x.items.at(-1);if(D)D.raw=D.raw.trimEnd(),D.text=D.text.trimEnd();else return;x.raw=x.raw.trimEnd();for(let k=0;k<x.items.length;k++)if(this.lexer.state.top=!1,x.items[k].tokens=this.lexer.blockTokens(x.items[k].text,[]),!x.loose){const S=x.items[k].tokens.filter(Z=>Z.type==="space"),z=S.length>0&&S.some(Z=>this.rules.other.anyLine.test(Z.raw));x.loose=z}if(x.loose)for(let k=0;k<x.items.length;k++)x.items[k].loose=!0;return x}}html(y){const c=this.rules.block.html.exec(y);if(c)return{type:"html",block:!0,raw:c[0],pre:c[1]==="pre"||c[1]==="script"||c[1]==="style",text:c[0]}}def(y){const c=this.rules.block.def.exec(y);if(c){const f=c[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),p=c[2]?c[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",x=c[3]?c[3].substring(1,c[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):c[3];return{type:"def",tag:f,raw:c[0],href:p,title:x}}}table(y){var A;const c=this.rules.block.table.exec(y);if(!c||!this.rules.other.tableDelimiter.test(c[2]))return;const f=mo(c[1]),p=c[2].replace(this.rules.other.tableAlignChars,"").split("|"),x=(A=c[3])!=null&&A.trim()?c[3].replace(this.rules.other.tableRowBlankLine,"").split(`
119
+ `):[],b={type:"table",raw:c[0],header:[],align:[],rows:[]};if(f.length===p.length){for(const D of p)this.rules.other.tableAlignRight.test(D)?b.align.push("right"):this.rules.other.tableAlignCenter.test(D)?b.align.push("center"):this.rules.other.tableAlignLeft.test(D)?b.align.push("left"):b.align.push(null);for(let D=0;D<f.length;D++)b.header.push({text:f[D],tokens:this.lexer.inline(f[D]),header:!0,align:b.align[D]});for(const D of x)b.rows.push(mo(D,b.header.length).map((k,S)=>({text:k,tokens:this.lexer.inline(k),header:!1,align:b.align[S]})));return b}}lheading(y){const c=this.rules.block.lheading.exec(y);if(c)return{type:"heading",raw:c[0],depth:c[2].charAt(0)==="="?1:2,text:c[1],tokens:this.lexer.inline(c[1])}}paragraph(y){const c=this.rules.block.paragraph.exec(y);if(c){const f=c[1].charAt(c[1].length-1)===`
120
+ `?c[1].slice(0,-1):c[1];return{type:"paragraph",raw:c[0],text:f,tokens:this.lexer.inline(f)}}}text(y){const c=this.rules.block.text.exec(y);if(c)return{type:"text",raw:c[0],text:c[0],tokens:this.lexer.inline(c[0])}}escape(y){const c=this.rules.inline.escape.exec(y);if(c)return{type:"escape",raw:c[0],text:c[1]}}tag(y){const c=this.rules.inline.tag.exec(y);if(c)return!this.lexer.state.inLink&&this.rules.other.startATag.test(c[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(c[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(c[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(c[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:c[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:c[0]}}link(y){const c=this.rules.inline.link.exec(y);if(c){const f=c[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(f)){if(!this.rules.other.endAngleBracket.test(f))return;const b=Rr(f.slice(0,-1),"\\");if((f.length-b.length)%2===0)return}else{const b=Ff(c[2],"()");if(b===-2)return;if(b>-1){const D=(c[0].indexOf("!")===0?5:4)+c[1].length+b;c[2]=c[2].substring(0,b),c[0]=c[0].substring(0,D).trim(),c[3]=""}}let p=c[2],x="";if(this.options.pedantic){const b=this.rules.other.pedanticHrefTitle.exec(p);b&&(p=b[1],x=b[3])}else x=c[3]?c[3].slice(1,-1):"";return p=p.trim(),this.rules.other.startAngleBracket.test(p)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(f)?p=p.slice(1):p=p.slice(1,-1)),xo(c,{href:p&&p.replace(this.rules.inline.anyPunctuation,"$1"),title:x&&x.replace(this.rules.inline.anyPunctuation,"$1")},c[0],this.lexer,this.rules)}}reflink(y,c){let f;if((f=this.rules.inline.reflink.exec(y))||(f=this.rules.inline.nolink.exec(y))){const p=(f[2]||f[1]).replace(this.rules.other.multipleSpaceGlobal," "),x=c[p.toLowerCase()];if(!x){const b=f[0].charAt(0);return{type:"text",raw:b,text:b}}return xo(f,x,f[0],this.lexer,this.rules)}}emStrong(y,c,f=""){let p=this.rules.inline.emStrongLDelim.exec(y);if(!p||p[3]&&f.match(this.rules.other.unicodeAlphaNumeric))return;if(!(p[1]||p[2]||"")||!f||this.rules.inline.punctuation.exec(f)){const b=[...p[0]].length-1;let A,D,k=b,S=0;const z=p[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(z.lastIndex=0,c=c.slice(-1*y.length+b);(p=z.exec(c))!=null;){if(A=p[1]||p[2]||p[3]||p[4]||p[5]||p[6],!A)continue;if(D=[...A].length,p[3]||p[4]){k+=D;continue}else if((p[5]||p[6])&&b%3&&!((b+D)%3)){S+=D;continue}if(k-=D,k>0)continue;D=Math.min(D,D+k+S);const Z=[...p[0]][0].length,H=y.slice(0,b+p.index+Z+D);if(Math.min(b,D)%2){const ee=H.slice(1,-1);return{type:"em",raw:H,text:ee,tokens:this.lexer.inlineTokens(ee)}}const ie=H.slice(2,-2);return{type:"strong",raw:H,text:ie,tokens:this.lexer.inlineTokens(ie)}}}}codespan(y){const c=this.rules.inline.code.exec(y);if(c){let f=c[2].replace(this.rules.other.newLineCharGlobal," ");const p=this.rules.other.nonSpaceChar.test(f),x=this.rules.other.startingSpaceChar.test(f)&&this.rules.other.endingSpaceChar.test(f);return p&&x&&(f=f.substring(1,f.length-1)),{type:"codespan",raw:c[0],text:f}}}br(y){const c=this.rules.inline.br.exec(y);if(c)return{type:"br",raw:c[0]}}del(y){const c=this.rules.inline.del.exec(y);if(c)return{type:"del",raw:c[0],text:c[2],tokens:this.lexer.inlineTokens(c[2])}}autolink(y){const c=this.rules.inline.autolink.exec(y);if(c){let f,p;return c[2]==="@"?(f=c[1],p="mailto:"+f):(f=c[1],p=f),{type:"link",raw:c[0],text:f,href:p,tokens:[{type:"text",raw:f,text:f}]}}}url(y){var f;let c;if(c=this.rules.inline.url.exec(y)){let p,x;if(c[2]==="@")p=c[0],x="mailto:"+p;else{let b;do b=c[0],c[0]=((f=this.rules.inline._backpedal.exec(c[0]))==null?void 0:f[0])??"";while(b!==c[0]);p=c[0],c[1]==="www."?x="http://"+c[0]:x=c[0]}return{type:"link",raw:c[0],text:p,href:x,tokens:[{type:"text",raw:p,text:p}]}}}inlineText(y){const c=this.rules.inline.text.exec(y);if(c){const f=this.lexer.state.inRawBlock;return{type:"text",raw:c[0],text:c[0],escaped:f}}}},Tn=class Dl{constructor(c){dt(this,"tokens");dt(this,"options");dt(this,"state");dt(this,"tokenizer");dt(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=c||Zn,this.options.tokenizer=this.options.tokenizer||new xi,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const f={other:Kt,block:mi.normal,inline:Br.normal};this.options.pedantic?(f.block=mi.pedantic,f.inline=Br.pedantic):this.options.gfm&&(f.block=mi.gfm,this.options.breaks?f.inline=Br.breaks:f.inline=Br.gfm),this.tokenizer.rules=f}static get rules(){return{block:mi,inline:Br}}static lex(c,f){return new Dl(f).lex(c)}static lexInline(c,f){return new Dl(f).inlineTokens(c)}lex(c){c=c.replace(Kt.carriageReturn,`
121
+ `),this.blockTokens(c,this.tokens);for(let f=0;f<this.inlineQueue.length;f++){const p=this.inlineQueue[f];this.inlineTokens(p.src,p.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(c,f=[],p=!1){var x,b,A;for(this.options.pedantic&&(c=c.replace(Kt.tabCharGlobal," ").replace(Kt.spaceLine,""));c;){let D;if((b=(x=this.options.extensions)==null?void 0:x.block)!=null&&b.some(S=>(D=S.call({lexer:this},c,f))?(c=c.substring(D.raw.length),f.push(D),!0):!1))continue;if(D=this.tokenizer.space(c)){c=c.substring(D.raw.length);const S=f.at(-1);D.raw.length===1&&S!==void 0?S.raw+=`
122
+ `:f.push(D);continue}if(D=this.tokenizer.code(c)){c=c.substring(D.raw.length);const S=f.at(-1);(S==null?void 0:S.type)==="paragraph"||(S==null?void 0:S.type)==="text"?(S.raw+=`
123
+ `+D.raw,S.text+=`
124
+ `+D.text,this.inlineQueue.at(-1).src=S.text):f.push(D);continue}if(D=this.tokenizer.fences(c)){c=c.substring(D.raw.length),f.push(D);continue}if(D=this.tokenizer.heading(c)){c=c.substring(D.raw.length),f.push(D);continue}if(D=this.tokenizer.hr(c)){c=c.substring(D.raw.length),f.push(D);continue}if(D=this.tokenizer.blockquote(c)){c=c.substring(D.raw.length),f.push(D);continue}if(D=this.tokenizer.list(c)){c=c.substring(D.raw.length),f.push(D);continue}if(D=this.tokenizer.html(c)){c=c.substring(D.raw.length),f.push(D);continue}if(D=this.tokenizer.def(c)){c=c.substring(D.raw.length);const S=f.at(-1);(S==null?void 0:S.type)==="paragraph"||(S==null?void 0:S.type)==="text"?(S.raw+=`
125
+ `+D.raw,S.text+=`
126
+ `+D.raw,this.inlineQueue.at(-1).src=S.text):this.tokens.links[D.tag]||(this.tokens.links[D.tag]={href:D.href,title:D.title});continue}if(D=this.tokenizer.table(c)){c=c.substring(D.raw.length),f.push(D);continue}if(D=this.tokenizer.lheading(c)){c=c.substring(D.raw.length),f.push(D);continue}let k=c;if((A=this.options.extensions)!=null&&A.startBlock){let S=1/0;const z=c.slice(1);let Z;this.options.extensions.startBlock.forEach(H=>{Z=H.call({lexer:this},z),typeof Z=="number"&&Z>=0&&(S=Math.min(S,Z))}),S<1/0&&S>=0&&(k=c.substring(0,S+1))}if(this.state.top&&(D=this.tokenizer.paragraph(k))){const S=f.at(-1);p&&(S==null?void 0:S.type)==="paragraph"?(S.raw+=`
127
+ `+D.raw,S.text+=`
128
+ `+D.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=S.text):f.push(D),p=k.length!==c.length,c=c.substring(D.raw.length);continue}if(D=this.tokenizer.text(c)){c=c.substring(D.raw.length);const S=f.at(-1);(S==null?void 0:S.type)==="text"?(S.raw+=`
129
+ `+D.raw,S.text+=`
130
+ `+D.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=S.text):f.push(D);continue}if(c){const S="Infinite loop on byte: "+c.charCodeAt(0);if(this.options.silent){console.error(S);break}else throw new Error(S)}}return this.state.top=!0,f}inline(c,f=[]){return this.inlineQueue.push({src:c,tokens:f}),f}inlineTokens(c,f=[]){var D,k,S;let p=c,x=null;if(this.tokens.links){const z=Object.keys(this.tokens.links);if(z.length>0)for(;(x=this.tokenizer.rules.inline.reflinkSearch.exec(p))!=null;)z.includes(x[0].slice(x[0].lastIndexOf("[")+1,-1))&&(p=p.slice(0,x.index)+"["+"a".repeat(x[0].length-2)+"]"+p.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(x=this.tokenizer.rules.inline.anyPunctuation.exec(p))!=null;)p=p.slice(0,x.index)+"++"+p.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(x=this.tokenizer.rules.inline.blockSkip.exec(p))!=null;)p=p.slice(0,x.index)+"["+"a".repeat(x[0].length-2)+"]"+p.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let b=!1,A="";for(;c;){b||(A=""),b=!1;let z;if((k=(D=this.options.extensions)==null?void 0:D.inline)!=null&&k.some(H=>(z=H.call({lexer:this},c,f))?(c=c.substring(z.raw.length),f.push(z),!0):!1))continue;if(z=this.tokenizer.escape(c)){c=c.substring(z.raw.length),f.push(z);continue}if(z=this.tokenizer.tag(c)){c=c.substring(z.raw.length),f.push(z);continue}if(z=this.tokenizer.link(c)){c=c.substring(z.raw.length),f.push(z);continue}if(z=this.tokenizer.reflink(c,this.tokens.links)){c=c.substring(z.raw.length);const H=f.at(-1);z.type==="text"&&(H==null?void 0:H.type)==="text"?(H.raw+=z.raw,H.text+=z.text):f.push(z);continue}if(z=this.tokenizer.emStrong(c,p,A)){c=c.substring(z.raw.length),f.push(z);continue}if(z=this.tokenizer.codespan(c)){c=c.substring(z.raw.length),f.push(z);continue}if(z=this.tokenizer.br(c)){c=c.substring(z.raw.length),f.push(z);continue}if(z=this.tokenizer.del(c)){c=c.substring(z.raw.length),f.push(z);continue}if(z=this.tokenizer.autolink(c)){c=c.substring(z.raw.length),f.push(z);continue}if(!this.state.inLink&&(z=this.tokenizer.url(c))){c=c.substring(z.raw.length),f.push(z);continue}let Z=c;if((S=this.options.extensions)!=null&&S.startInline){let H=1/0;const ie=c.slice(1);let ee;this.options.extensions.startInline.forEach(ye=>{ee=ye.call({lexer:this},ie),typeof ee=="number"&&ee>=0&&(H=Math.min(H,ee))}),H<1/0&&H>=0&&(Z=c.substring(0,H+1))}if(z=this.tokenizer.inlineText(Z)){c=c.substring(z.raw.length),z.raw.slice(-1)!=="_"&&(A=z.raw.slice(-1)),b=!0;const H=f.at(-1);(H==null?void 0:H.type)==="text"?(H.raw+=z.raw,H.text+=z.text):f.push(z);continue}if(c){const H="Infinite loop on byte: "+c.charCodeAt(0);if(this.options.silent){console.error(H);break}else throw new Error(H)}}return f}},yi=class{constructor(y){dt(this,"options");dt(this,"parser");this.options=y||Zn}space(y){return""}code({text:y,lang:c,escaped:f}){var b;const p=(b=(c||"").match(Kt.notSpaceStart))==null?void 0:b[0],x=y.replace(Kt.endingNewline,"")+`
131
+ `;return p?'<pre><code class="language-'+kn(p)+'">'+(f?x:kn(x,!0))+`</code></pre>
132
+ `:"<pre><code>"+(f?x:kn(x,!0))+`</code></pre>
133
+ `}blockquote({tokens:y}){return`<blockquote>
134
+ ${this.parser.parse(y)}</blockquote>
135
+ `}html({text:y}){return y}heading({tokens:y,depth:c}){return`<h${c}>${this.parser.parseInline(y)}</h${c}>
136
+ `}hr(y){return`<hr>
137
+ `}list(y){const c=y.ordered,f=y.start;let p="";for(let A=0;A<y.items.length;A++){const D=y.items[A];p+=this.listitem(D)}const x=c?"ol":"ul",b=c&&f!==1?' start="'+f+'"':"";return"<"+x+b+`>
138
+ `+p+"</"+x+`>
139
+ `}listitem(y){var f;let c="";if(y.task){const p=this.checkbox({checked:!!y.checked});y.loose?((f=y.tokens[0])==null?void 0:f.type)==="paragraph"?(y.tokens[0].text=p+" "+y.tokens[0].text,y.tokens[0].tokens&&y.tokens[0].tokens.length>0&&y.tokens[0].tokens[0].type==="text"&&(y.tokens[0].tokens[0].text=p+" "+kn(y.tokens[0].tokens[0].text),y.tokens[0].tokens[0].escaped=!0)):y.tokens.unshift({type:"text",raw:p+" ",text:p+" ",escaped:!0}):c+=p+" "}return c+=this.parser.parse(y.tokens,!!y.loose),`<li>${c}</li>
140
+ `}checkbox({checked:y}){return"<input "+(y?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:y}){return`<p>${this.parser.parseInline(y)}</p>
141
+ `}table(y){let c="",f="";for(let x=0;x<y.header.length;x++)f+=this.tablecell(y.header[x]);c+=this.tablerow({text:f});let p="";for(let x=0;x<y.rows.length;x++){const b=y.rows[x];f="";for(let A=0;A<b.length;A++)f+=this.tablecell(b[A]);p+=this.tablerow({text:f})}return p&&(p=`<tbody>${p}</tbody>`),`<table>
142
+ <thead>
143
+ `+c+`</thead>
144
+ `+p+`</table>
145
+ `}tablerow({text:y}){return`<tr>
146
+ ${y}</tr>
147
+ `}tablecell(y){const c=this.parser.parseInline(y.tokens),f=y.header?"th":"td";return(y.align?`<${f} align="${y.align}">`:`<${f}>`)+c+`</${f}>
148
+ `}strong({tokens:y}){return`<strong>${this.parser.parseInline(y)}</strong>`}em({tokens:y}){return`<em>${this.parser.parseInline(y)}</em>`}codespan({text:y}){return`<code>${kn(y,!0)}</code>`}br(y){return"<br>"}del({tokens:y}){return`<del>${this.parser.parseInline(y)}</del>`}link({href:y,title:c,tokens:f}){const p=this.parser.parseInline(f),x=vo(y);if(x===null)return p;y=x;let b='<a href="'+y+'"';return c&&(b+=' title="'+kn(c)+'"'),b+=">"+p+"</a>",b}image({href:y,title:c,text:f,tokens:p}){p&&(f=this.parser.parseInline(p,this.parser.textRenderer));const x=vo(y);if(x===null)return kn(f);y=x;let b=`<img src="${y}" alt="${f}"`;return c&&(b+=` title="${kn(c)}"`),b+=">",b}text(y){return"tokens"in y&&y.tokens?this.parser.parseInline(y.tokens):"escaped"in y&&y.escaped?y.text:kn(y.text)}},ga=class{strong({text:y}){return y}em({text:y}){return y}codespan({text:y}){return y}del({text:y}){return y}html({text:y}){return y}text({text:y}){return y}link({text:y}){return""+y}image({text:y}){return""+y}br(){return""}},Fn=class wl{constructor(c){dt(this,"options");dt(this,"renderer");dt(this,"textRenderer");this.options=c||Zn,this.options.renderer=this.options.renderer||new yi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ga}static parse(c,f){return new wl(f).parse(c)}static parseInline(c,f){return new wl(f).parseInline(c)}parse(c,f=!0){var x,b;let p="";for(let A=0;A<c.length;A++){const D=c[A];if((b=(x=this.options.extensions)==null?void 0:x.renderers)!=null&&b[D.type]){const S=D,z=this.options.extensions.renderers[S.type].call({parser:this},S);if(z!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(S.type)){p+=z||"";continue}}const k=D;switch(k.type){case"space":{p+=this.renderer.space(k);continue}case"hr":{p+=this.renderer.hr(k);continue}case"heading":{p+=this.renderer.heading(k);continue}case"code":{p+=this.renderer.code(k);continue}case"table":{p+=this.renderer.table(k);continue}case"blockquote":{p+=this.renderer.blockquote(k);continue}case"list":{p+=this.renderer.list(k);continue}case"html":{p+=this.renderer.html(k);continue}case"paragraph":{p+=this.renderer.paragraph(k);continue}case"text":{let S=k,z=this.renderer.text(S);for(;A+1<c.length&&c[A+1].type==="text";)S=c[++A],z+=`
149
+ `+this.renderer.text(S);f?p+=this.renderer.paragraph({type:"paragraph",raw:z,text:z,tokens:[{type:"text",raw:z,text:z,escaped:!0}]}):p+=z;continue}default:{const S='Token with "'+k.type+'" type was not found.';if(this.options.silent)return console.error(S),"";throw new Error(S)}}}return p}parseInline(c,f=this.renderer){var x,b;let p="";for(let A=0;A<c.length;A++){const D=c[A];if((b=(x=this.options.extensions)==null?void 0:x.renderers)!=null&&b[D.type]){const S=this.options.extensions.renderers[D.type].call({parser:this},D);if(S!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(D.type)){p+=S||"";continue}}const k=D;switch(k.type){case"escape":{p+=f.text(k);break}case"html":{p+=f.html(k);break}case"link":{p+=f.link(k);break}case"image":{p+=f.image(k);break}case"strong":{p+=f.strong(k);break}case"em":{p+=f.em(k);break}case"codespan":{p+=f.codespan(k);break}case"br":{p+=f.br(k);break}case"del":{p+=f.del(k);break}case"text":{p+=f.text(k);break}default:{const S='Token with "'+k.type+'" type was not found.';if(this.options.silent)return console.error(S),"";throw new Error(S)}}}return p}},bi=(Sa=class{constructor(y){dt(this,"options");dt(this,"block");this.options=y||Zn}preprocess(y){return y}postprocess(y){return y}processAllTokens(y){return y}provideLexer(){return this.block?Tn.lex:Tn.lexInline}provideParser(){return this.block?Fn.parse:Fn.parseInline}},dt(Sa,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Sa),Mf=class{constructor(...y){dt(this,"defaults",la());dt(this,"options",this.setOptions);dt(this,"parse",this.parseMarkdown(!0));dt(this,"parseInline",this.parseMarkdown(!1));dt(this,"Parser",Fn);dt(this,"Renderer",yi);dt(this,"TextRenderer",ga);dt(this,"Lexer",Tn);dt(this,"Tokenizer",xi);dt(this,"Hooks",bi);this.use(...y)}walkTokens(y,c){var p,x;let f=[];for(const b of y)switch(f=f.concat(c.call(this,b)),b.type){case"table":{const A=b;for(const D of A.header)f=f.concat(this.walkTokens(D.tokens,c));for(const D of A.rows)for(const k of D)f=f.concat(this.walkTokens(k.tokens,c));break}case"list":{const A=b;f=f.concat(this.walkTokens(A.items,c));break}default:{const A=b;(x=(p=this.defaults.extensions)==null?void 0:p.childTokens)!=null&&x[A.type]?this.defaults.extensions.childTokens[A.type].forEach(D=>{const k=A[D].flat(1/0);f=f.concat(this.walkTokens(k,c))}):A.tokens&&(f=f.concat(this.walkTokens(A.tokens,c)))}}return f}use(...y){const c=this.defaults.extensions||{renderers:{},childTokens:{}};return y.forEach(f=>{const p={...f};if(p.async=this.defaults.async||p.async||!1,f.extensions&&(f.extensions.forEach(x=>{if(!x.name)throw new Error("extension name required");if("renderer"in x){const b=c.renderers[x.name];b?c.renderers[x.name]=function(...A){let D=x.renderer.apply(this,A);return D===!1&&(D=b.apply(this,A)),D}:c.renderers[x.name]=x.renderer}if("tokenizer"in x){if(!x.level||x.level!=="block"&&x.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const b=c[x.level];b?b.unshift(x.tokenizer):c[x.level]=[x.tokenizer],x.start&&(x.level==="block"?c.startBlock?c.startBlock.push(x.start):c.startBlock=[x.start]:x.level==="inline"&&(c.startInline?c.startInline.push(x.start):c.startInline=[x.start]))}"childTokens"in x&&x.childTokens&&(c.childTokens[x.name]=x.childTokens)}),p.extensions=c),f.renderer){const x=this.defaults.renderer||new yi(this.defaults);for(const b in f.renderer){if(!(b in x))throw new Error(`renderer '${b}' does not exist`);if(["options","parser"].includes(b))continue;const A=b,D=f.renderer[A],k=x[A];x[A]=(...S)=>{let z=D.apply(x,S);return z===!1&&(z=k.apply(x,S)),z||""}}p.renderer=x}if(f.tokenizer){const x=this.defaults.tokenizer||new xi(this.defaults);for(const b in f.tokenizer){if(!(b in x))throw new Error(`tokenizer '${b}' does not exist`);if(["options","rules","lexer"].includes(b))continue;const A=b,D=f.tokenizer[A],k=x[A];x[A]=(...S)=>{let z=D.apply(x,S);return z===!1&&(z=k.apply(x,S)),z}}p.tokenizer=x}if(f.hooks){const x=this.defaults.hooks||new bi;for(const b in f.hooks){if(!(b in x))throw new Error(`hook '${b}' does not exist`);if(["options","block"].includes(b))continue;const A=b,D=f.hooks[A],k=x[A];bi.passThroughHooks.has(b)?x[A]=S=>{if(this.defaults.async)return Promise.resolve(D.call(x,S)).then(Z=>k.call(x,Z));const z=D.call(x,S);return k.call(x,z)}:x[A]=(...S)=>{let z=D.apply(x,S);return z===!1&&(z=k.apply(x,S)),z}}p.hooks=x}if(f.walkTokens){const x=this.defaults.walkTokens,b=f.walkTokens;p.walkTokens=function(A){let D=[];return D.push(b.call(this,A)),x&&(D=D.concat(x.call(this,A))),D}}this.defaults={...this.defaults,...p}}),this}setOptions(y){return this.defaults={...this.defaults,...y},this}lexer(y,c){return Tn.lex(y,c??this.defaults)}parser(y,c){return Fn.parse(y,c??this.defaults)}parseMarkdown(y){return(f,p)=>{const x={...p},b={...this.defaults,...x},A=this.onError(!!b.silent,!!b.async);if(this.defaults.async===!0&&x.async===!1)return A(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof f>"u"||f===null)return A(new Error("marked(): input parameter is undefined or null"));if(typeof f!="string")return A(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(f)+", string expected"));b.hooks&&(b.hooks.options=b,b.hooks.block=y);const D=b.hooks?b.hooks.provideLexer():y?Tn.lex:Tn.lexInline,k=b.hooks?b.hooks.provideParser():y?Fn.parse:Fn.parseInline;if(b.async)return Promise.resolve(b.hooks?b.hooks.preprocess(f):f).then(S=>D(S,b)).then(S=>b.hooks?b.hooks.processAllTokens(S):S).then(S=>b.walkTokens?Promise.all(this.walkTokens(S,b.walkTokens)).then(()=>S):S).then(S=>k(S,b)).then(S=>b.hooks?b.hooks.postprocess(S):S).catch(A);try{b.hooks&&(f=b.hooks.preprocess(f));let S=D(f,b);b.hooks&&(S=b.hooks.processAllTokens(S)),b.walkTokens&&this.walkTokens(S,b.walkTokens);let z=k(S,b);return b.hooks&&(z=b.hooks.postprocess(z)),z}catch(S){return A(S)}}}onError(y,c){return f=>{if(f.message+=`
150
+ Please report this to https://github.com/markedjs/marked.`,y){const p="<p>An error occurred:</p><pre>"+kn(f.message+"",!0)+"</pre>";return c?Promise.resolve(p):p}if(c)return Promise.reject(f);throw f}}},Qn=new Mf;function ut(y,c){return Qn.parse(y,c)}ut.options=ut.setOptions=function(y){return Qn.setOptions(y),ut.defaults=Qn.defaults,no(ut.defaults),ut},ut.getDefaults=la,ut.defaults=Zn,ut.use=function(...y){return Qn.use(...y),ut.defaults=Qn.defaults,no(ut.defaults),ut},ut.walkTokens=function(y,c){return Qn.walkTokens(y,c)},ut.parseInline=Qn.parseInline,ut.Parser=Fn,ut.parser=Fn.parse,ut.Renderer=yi,ut.TextRenderer=ga,ut.Lexer=Tn,ut.lexer=Tn.lex,ut.Tokenizer=xi,ut.Hooks=bi,ut.parse=ut,ut.options,ut.setOptions,ut.use,ut.walkTokens,ut.parseInline,Fn.parse,Tn.lex;/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:yo,setPrototypeOf:bo,isFrozen:Bf,getPrototypeOf:Rf,getOwnPropertyDescriptor:_f}=Object;let{freeze:Yt,seal:dn,create:va}=Object,{apply:ma,construct:xa}=typeof Reflect<"u"&&Reflect;Yt||(Yt=function(c){return c}),dn||(dn=function(c){return c}),ma||(ma=function(c,f){for(var p=arguments.length,x=new Array(p>2?p-2:0),b=2;b<p;b++)x[b-2]=arguments[b];return c.apply(f,x)}),xa||(xa=function(c){for(var f=arguments.length,p=new Array(f>1?f-1:0),x=1;x<f;x++)p[x-1]=arguments[x];return new c(...p)});const ki=Qt(Array.prototype.forEach),If=Qt(Array.prototype.lastIndexOf),ko=Qt(Array.prototype.pop),_r=Qt(Array.prototype.push),Of=Qt(Array.prototype.splice),Di=Qt(String.prototype.toLowerCase),ya=Qt(String.prototype.toString),ba=Qt(String.prototype.match),Ir=Qt(String.prototype.replace),Nf=Qt(String.prototype.indexOf),Pf=Qt(String.prototype.trim),gn=Qt(Object.prototype.hasOwnProperty),Zt=Qt(RegExp.prototype.test),Or=zf(TypeError);function Qt(y){return function(c){c instanceof RegExp&&(c.lastIndex=0);for(var f=arguments.length,p=new Array(f>1?f-1:0),x=1;x<f;x++)p[x-1]=arguments[x];return ma(y,c,p)}}function zf(y){return function(){for(var c=arguments.length,f=new Array(c),p=0;p<c;p++)f[p]=arguments[p];return xa(y,f)}}function Ge(y,c){let f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Di;bo&&bo(y,null);let p=c.length;for(;p--;){let x=c[p];if(typeof x=="string"){const b=f(x);b!==x&&(Bf(c)||(c[p]=b),x=b)}y[x]=!0}return y}function Hf(y){for(let c=0;c<y.length;c++)gn(y,c)||(y[c]=null);return y}function Dn(y){const c=va(null);for(const[f,p]of yo(y))gn(y,f)&&(Array.isArray(p)?c[f]=Hf(p):p&&typeof p=="object"&&p.constructor===Object?c[f]=Dn(p):c[f]=p);return c}function Nr(y,c){for(;y!==null;){const p=_f(y,c);if(p){if(p.get)return Qt(p.get);if(typeof p.value=="function")return Qt(p.value)}y=Rf(y)}function f(){return null}return f}const Do=Yt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ka=Yt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Da=Yt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Wf=Yt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),wa=Yt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Uf=Yt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),wo=Yt(["#text"]),Co=Yt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ca=Yt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),So=Yt(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),wi=Yt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),qf=dn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Gf=dn(/<%[\w\W]*|[\w\W]*%>/gm),$f=dn(/\$\{[\w\W]*/gm),jf=dn(/^data-[\-\w.\u00B7-\uFFFF]+$/),Xf=dn(/^aria-[\-\w]+$/),Ao=dn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Kf=dn(/^(?:\w+script|data):/i),Yf=dn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Eo=dn(/^html$/i),Zf=dn(/^[a-z][.\w]*(-[.\w]+)+$/i);var To=Object.freeze({__proto__:null,ARIA_ATTR:Xf,ATTR_WHITESPACE:Yf,CUSTOM_ELEMENT:Zf,DATA_ATTR:jf,DOCTYPE_NAME:Eo,ERB_EXPR:Gf,IS_ALLOWED_URI:Ao,IS_SCRIPT_OR_DATA:Kf,MUSTACHE_EXPR:qf,TMPLIT_EXPR:$f});const Pr={element:1,text:3,progressingInstruction:7,comment:8,document:9},Qf=function(){return typeof window>"u"?null:window},Jf=function(c,f){if(typeof c!="object"||typeof c.createPolicy!="function")return null;let p=null;const x="data-tt-policy-suffix";f&&f.hasAttribute(x)&&(p=f.getAttribute(x));const b="dompurify"+(p?"#"+p:"");try{return c.createPolicy(b,{createHTML(A){return A},createScriptURL(A){return A}})}catch{return console.warn("TrustedTypes policy "+b+" could not be created."),null}},Fo=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Lo(){let y=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qf();const c=Me=>Lo(Me);if(c.version="3.3.1",c.removed=[],!y||!y.document||y.document.nodeType!==Pr.document||!y.Element)return c.isSupported=!1,c;let{document:f}=y;const p=f,x=p.currentScript,{DocumentFragment:b,HTMLTemplateElement:A,Node:D,Element:k,NodeFilter:S,NamedNodeMap:z=y.NamedNodeMap||y.MozNamedAttrMap,HTMLFormElement:Z,DOMParser:H,trustedTypes:ie}=y,ee=k.prototype,ye=Nr(ee,"cloneNode"),re=Nr(ee,"remove"),te=Nr(ee,"nextSibling"),X=Nr(ee,"childNodes"),Q=Nr(ee,"parentNode");if(typeof A=="function"){const Me=f.createElement("template");Me.content&&Me.content.ownerDocument&&(f=Me.content.ownerDocument)}let j,K="";const{implementation:se,createNodeIterator:V,createDocumentFragment:pe,getElementsByTagName:xe}=f,{importNode:Xe}=p;let le=Fo();c.isSupported=typeof yo=="function"&&typeof Q=="function"&&se&&se.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Oe,ERB_EXPR:Re,TMPLIT_EXPR:Pe,DATA_ATTR:P,ARIA_ATTR:ce,IS_SCRIPT_OR_DATA:ae,ATTR_WHITESPACE:Ee,CUSTOM_ELEMENT:$e}=To;let{IS_ALLOWED_URI:pt}=To,lt=null;const M=Ge({},[...Do,...ka,...Da,...wa,...wo]);let g=null;const J=Ge({},[...Co,...Ca,...So,...wi]);let Fe=Object.seal(va(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ie=null,tt=null;const Ze=Object.seal(va(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Qe=!0,Je=!0,Ue=!1,je=!0,Ve=!1,ht=!0,Ce=!1,Ct=!1,Lt=!1,ot=!1,Nt=!1,we=!1,xt=!0,Jt=!1;const wn="user-content-";let G=!0,$=!1,I={},v=null;const m=Ge({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let B=null;const o=Ge({},["audio","video","img","source","image","track"]);let h=null;const w=Ge({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),T="http://www.w3.org/1998/Math/MathML",L="http://www.w3.org/2000/svg",W="http://www.w3.org/1999/xhtml";let R=W,F=!1,q=null;const N=Ge({},[T,L,W],ya);let de=Ge({},["mi","mo","mn","ms","mtext"]),be=Ge({},["annotation-xml"]);const ke=Ge({},["title","style","font","a","script"]);let ue=null;const Ne=["application/xhtml+xml","text/html"],ze="text/html";let Te=null,Le=null;const nt=f.createElement("form"),rt=function(_){return _ instanceof RegExp||_ instanceof Function},vt=function(){let _=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Le&&Le===_)){if((!_||typeof _!="object")&&(_={}),_=Dn(_),ue=Ne.indexOf(_.PARSER_MEDIA_TYPE)===-1?ze:_.PARSER_MEDIA_TYPE,Te=ue==="application/xhtml+xml"?ya:Di,lt=gn(_,"ALLOWED_TAGS")?Ge({},_.ALLOWED_TAGS,Te):M,g=gn(_,"ALLOWED_ATTR")?Ge({},_.ALLOWED_ATTR,Te):J,q=gn(_,"ALLOWED_NAMESPACES")?Ge({},_.ALLOWED_NAMESPACES,ya):N,h=gn(_,"ADD_URI_SAFE_ATTR")?Ge(Dn(w),_.ADD_URI_SAFE_ATTR,Te):w,B=gn(_,"ADD_DATA_URI_TAGS")?Ge(Dn(o),_.ADD_DATA_URI_TAGS,Te):o,v=gn(_,"FORBID_CONTENTS")?Ge({},_.FORBID_CONTENTS,Te):m,Ie=gn(_,"FORBID_TAGS")?Ge({},_.FORBID_TAGS,Te):Dn({}),tt=gn(_,"FORBID_ATTR")?Ge({},_.FORBID_ATTR,Te):Dn({}),I=gn(_,"USE_PROFILES")?_.USE_PROFILES:!1,Qe=_.ALLOW_ARIA_ATTR!==!1,Je=_.ALLOW_DATA_ATTR!==!1,Ue=_.ALLOW_UNKNOWN_PROTOCOLS||!1,je=_.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ve=_.SAFE_FOR_TEMPLATES||!1,ht=_.SAFE_FOR_XML!==!1,Ce=_.WHOLE_DOCUMENT||!1,ot=_.RETURN_DOM||!1,Nt=_.RETURN_DOM_FRAGMENT||!1,we=_.RETURN_TRUSTED_TYPE||!1,Lt=_.FORCE_BODY||!1,xt=_.SANITIZE_DOM!==!1,Jt=_.SANITIZE_NAMED_PROPS||!1,G=_.KEEP_CONTENT!==!1,$=_.IN_PLACE||!1,pt=_.ALLOWED_URI_REGEXP||Ao,R=_.NAMESPACE||W,de=_.MATHML_TEXT_INTEGRATION_POINTS||de,be=_.HTML_INTEGRATION_POINTS||be,Fe=_.CUSTOM_ELEMENT_HANDLING||{},_.CUSTOM_ELEMENT_HANDLING&&rt(_.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Fe.tagNameCheck=_.CUSTOM_ELEMENT_HANDLING.tagNameCheck),_.CUSTOM_ELEMENT_HANDLING&&rt(_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Fe.attributeNameCheck=_.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),_.CUSTOM_ELEMENT_HANDLING&&typeof _.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Fe.allowCustomizedBuiltInElements=_.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ve&&(Je=!1),Nt&&(ot=!0),I&&(lt=Ge({},wo),g=[],I.html===!0&&(Ge(lt,Do),Ge(g,Co)),I.svg===!0&&(Ge(lt,ka),Ge(g,Ca),Ge(g,wi)),I.svgFilters===!0&&(Ge(lt,Da),Ge(g,Ca),Ge(g,wi)),I.mathMl===!0&&(Ge(lt,wa),Ge(g,So),Ge(g,wi))),_.ADD_TAGS&&(typeof _.ADD_TAGS=="function"?Ze.tagCheck=_.ADD_TAGS:(lt===M&&(lt=Dn(lt)),Ge(lt,_.ADD_TAGS,Te))),_.ADD_ATTR&&(typeof _.ADD_ATTR=="function"?Ze.attributeCheck=_.ADD_ATTR:(g===J&&(g=Dn(g)),Ge(g,_.ADD_ATTR,Te))),_.ADD_URI_SAFE_ATTR&&Ge(h,_.ADD_URI_SAFE_ATTR,Te),_.FORBID_CONTENTS&&(v===m&&(v=Dn(v)),Ge(v,_.FORBID_CONTENTS,Te)),_.ADD_FORBID_CONTENTS&&(v===m&&(v=Dn(v)),Ge(v,_.ADD_FORBID_CONTENTS,Te)),G&&(lt["#text"]=!0),Ce&&Ge(lt,["html","head","body"]),lt.table&&(Ge(lt,["tbody"]),delete Ie.tbody),_.TRUSTED_TYPES_POLICY){if(typeof _.TRUSTED_TYPES_POLICY.createHTML!="function")throw Or('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof _.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Or('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');j=_.TRUSTED_TYPES_POLICY,K=j.createHTML("")}else j===void 0&&(j=Jf(ie,x)),j!==null&&typeof K=="string"&&(K=j.createHTML(""));Yt&&Yt(_),Le=_}},Mt=Ge({},[...ka,...Da,...Wf]),Tt=Ge({},[...wa,...Uf]),Pn=function(_){let he=Q(_);(!he||!he.tagName)&&(he={namespaceURI:R,tagName:"template"});const Se=Di(_.tagName),gt=Di(he.tagName);return q[_.namespaceURI]?_.namespaceURI===L?he.namespaceURI===W?Se==="svg":he.namespaceURI===T?Se==="svg"&&(gt==="annotation-xml"||de[gt]):!!Mt[Se]:_.namespaceURI===T?he.namespaceURI===W?Se==="math":he.namespaceURI===L?Se==="math"&&be[gt]:!!Tt[Se]:_.namespaceURI===W?he.namespaceURI===L&&!be[gt]||he.namespaceURI===T&&!de[gt]?!1:!Tt[Se]&&(ke[Se]||!Mt[Se]):!!(ue==="application/xhtml+xml"&&q[_.namespaceURI]):!1},Ht=function(_){_r(c.removed,{element:_});try{Q(_).removeChild(_)}catch{re(_)}},pn=function(_,he){try{_r(c.removed,{attribute:he.getAttributeNode(_),from:he})}catch{_r(c.removed,{attribute:null,from:he})}if(he.removeAttribute(_),_==="is")if(ot||Nt)try{Ht(he)}catch{}else try{he.setAttribute(_,"")}catch{}},zn=function(_){let he=null,Se=null;if(Lt)_="<remove></remove>"+_;else{const bt=ba(_,/^[\r\n\t ]+/);Se=bt&&bt[0]}ue==="application/xhtml+xml"&&R===W&&(_='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+_+"</body></html>");const gt=j?j.createHTML(_):_;if(R===W)try{he=new H().parseFromString(gt,ue)}catch{}if(!he||!he.documentElement){he=se.createDocument(R,"template",null);try{he.documentElement.innerHTML=F?K:gt}catch{}}const yt=he.body||he.documentElement;return _&&Se&&yt.insertBefore(f.createTextNode(Se),yt.childNodes[0]||null),R===W?xe.call(he,Ce?"html":"body")[0]:Ce?he.documentElement:yt},Hn=function(_){return V.call(_.ownerDocument||_,_,S.SHOW_ELEMENT|S.SHOW_COMMENT|S.SHOW_TEXT|S.SHOW_PROCESSING_INSTRUCTION|S.SHOW_CDATA_SECTION,null)},Ln=function(_){return _ instanceof Z&&(typeof _.nodeName!="string"||typeof _.textContent!="string"||typeof _.removeChild!="function"||!(_.attributes instanceof z)||typeof _.removeAttribute!="function"||typeof _.setAttribute!="function"||typeof _.namespaceURI!="string"||typeof _.insertBefore!="function"||typeof _.hasChildNodes!="function")},fr=function(_){return typeof D=="function"&&_ instanceof D};function ft(Me,_,he){ki(Me,Se=>{Se.call(c,_,he,Le)})}const fn=function(_){let he=null;if(ft(le.beforeSanitizeElements,_,null),Ln(_))return Ht(_),!0;const Se=Te(_.nodeName);if(ft(le.uponSanitizeElement,_,{tagName:Se,allowedTags:lt}),ht&&_.hasChildNodes()&&!fr(_.firstElementChild)&&Zt(/<[/\w!]/g,_.innerHTML)&&Zt(/<[/\w!]/g,_.textContent)||_.nodeType===Pr.progressingInstruction||ht&&_.nodeType===Pr.comment&&Zt(/<[/\w]/g,_.data))return Ht(_),!0;if(!(Ze.tagCheck instanceof Function&&Ze.tagCheck(Se))&&(!lt[Se]||Ie[Se])){if(!Ie[Se]&&$t(Se)&&(Fe.tagNameCheck instanceof RegExp&&Zt(Fe.tagNameCheck,Se)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(Se)))return!1;if(G&&!v[Se]){const gt=Q(_)||_.parentNode,yt=X(_)||_.childNodes;if(yt&&gt){const bt=yt.length;for(let Ut=bt-1;Ut>=0;--Ut){const it=ye(yt[Ut],!0);it.__removalCount=(_.__removalCount||0)+1,gt.insertBefore(it,te(_))}}}return Ht(_),!0}return _ instanceof k&&!Pn(_)||(Se==="noscript"||Se==="noembed"||Se==="noframes")&&Zt(/<\/no(script|embed|frames)/i,_.innerHTML)?(Ht(_),!0):(Ve&&_.nodeType===Pr.text&&(he=_.textContent,ki([Oe,Re,Pe],gt=>{he=Ir(he,gt," ")}),_.textContent!==he&&(_r(c.removed,{element:_.cloneNode()}),_.textContent=he)),ft(le.afterSanitizeElements,_,null),!1)},ln=function(_,he,Se){if(xt&&(he==="id"||he==="name")&&(Se in f||Se in nt))return!1;if(!(Je&&!tt[he]&&Zt(P,he))){if(!(Qe&&Zt(ce,he))){if(!(Ze.attributeCheck instanceof Function&&Ze.attributeCheck(he,_))){if(!g[he]||tt[he]){if(!($t(_)&&(Fe.tagNameCheck instanceof RegExp&&Zt(Fe.tagNameCheck,_)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(_))&&(Fe.attributeNameCheck instanceof RegExp&&Zt(Fe.attributeNameCheck,he)||Fe.attributeNameCheck instanceof Function&&Fe.attributeNameCheck(he,_))||he==="is"&&Fe.allowCustomizedBuiltInElements&&(Fe.tagNameCheck instanceof RegExp&&Zt(Fe.tagNameCheck,Se)||Fe.tagNameCheck instanceof Function&&Fe.tagNameCheck(Se))))return!1}else if(!h[he]){if(!Zt(pt,Ir(Se,Ee,""))){if(!((he==="src"||he==="xlink:href"||he==="href")&&_!=="script"&&Nf(Se,"data:")===0&&B[_])){if(!(Ue&&!Zt(ae,Ir(Se,Ee,"")))){if(Se)return!1}}}}}}}return!0},$t=function(_){return _!=="annotation-xml"&&ba(_,$e)},Wt=function(_){ft(le.beforeSanitizeAttributes,_,null);const{attributes:he}=_;if(!he||Ln(_))return;const Se={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:g,forceKeepAttr:void 0};let gt=he.length;for(;gt--;){const yt=he[gt],{name:bt,namespaceURI:Ut,value:it}=yt,Ae=Te(bt),vn=it;let St=bt==="value"?vn:Pf(vn);if(Se.attrName=Ae,Se.attrValue=St,Se.keepAttr=!0,Se.forceKeepAttr=void 0,ft(le.uponSanitizeAttribute,_,Se),St=Se.attrValue,Jt&&(Ae==="id"||Ae==="name")&&(pn(bt,_),St=wn+St),ht&&Zt(/((--!?|])>)|<\/(style|title|textarea)/i,St)){pn(bt,_);continue}if(Ae==="attributename"&&ba(St,"href")){pn(bt,_);continue}if(Se.forceKeepAttr)continue;if(!Se.keepAttr){pn(bt,_);continue}if(!je&&Zt(/\/>/i,St)){pn(bt,_);continue}Ve&&ki([Oe,Re,Pe],Ye=>{St=Ir(St,Ye," ")});const cn=Te(_.nodeName);if(!ln(cn,Ae,St)){pn(bt,_);continue}if(j&&typeof ie=="object"&&typeof ie.getAttributeType=="function"&&!Ut)switch(ie.getAttributeType(cn,Ae)){case"TrustedHTML":{St=j.createHTML(St);break}case"TrustedScriptURL":{St=j.createScriptURL(St);break}}if(St!==vn)try{Ut?_.setAttributeNS(Ut,bt,St):_.setAttribute(bt,St),Ln(_)?Ht(_):ko(c.removed)}catch{pn(bt,_)}}ft(le.afterSanitizeAttributes,_,null)},Mn=function Me(_){let he=null;const Se=Hn(_);for(ft(le.beforeSanitizeShadowDOM,_,null);he=Se.nextNode();)ft(le.uponSanitizeShadowNode,he,null),fn(he),Wt(he),he.content instanceof b&&Me(he.content);ft(le.afterSanitizeShadowDOM,_,null)};return c.sanitize=function(Me){let _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},he=null,Se=null,gt=null,yt=null;if(F=!Me,F&&(Me="<!-->"),typeof Me!="string"&&!fr(Me))if(typeof Me.toString=="function"){if(Me=Me.toString(),typeof Me!="string")throw Or("dirty is not a string, aborting")}else throw Or("toString is not a function");if(!c.isSupported)return Me;if(Ct||vt(_),c.removed=[],typeof Me=="string"&&($=!1),$){if(Me.nodeName){const it=Te(Me.nodeName);if(!lt[it]||Ie[it])throw Or("root node is forbidden and cannot be sanitized in-place")}}else if(Me instanceof D)he=zn("<!---->"),Se=he.ownerDocument.importNode(Me,!0),Se.nodeType===Pr.element&&Se.nodeName==="BODY"||Se.nodeName==="HTML"?he=Se:he.appendChild(Se);else{if(!ot&&!Ve&&!Ce&&Me.indexOf("<")===-1)return j&&we?j.createHTML(Me):Me;if(he=zn(Me),!he)return ot?null:we?K:""}he&&Lt&&Ht(he.firstChild);const bt=Hn($?Me:he);for(;gt=bt.nextNode();)fn(gt),Wt(gt),gt.content instanceof b&&Mn(gt.content);if($)return Me;if(ot){if(Nt)for(yt=pe.call(he.ownerDocument);he.firstChild;)yt.appendChild(he.firstChild);else yt=he;return(g.shadowroot||g.shadowrootmode)&&(yt=Xe.call(p,yt,!0)),yt}let Ut=Ce?he.outerHTML:he.innerHTML;return Ce&&lt["!doctype"]&&he.ownerDocument&&he.ownerDocument.doctype&&he.ownerDocument.doctype.name&&Zt(Eo,he.ownerDocument.doctype.name)&&(Ut="<!DOCTYPE "+he.ownerDocument.doctype.name+`>
151
+ `+Ut),Ve&&ki([Oe,Re,Pe],it=>{Ut=Ir(Ut,it," ")}),j&&we?j.createHTML(Ut):Ut},c.setConfig=function(){let Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};vt(Me),Ct=!0},c.clearConfig=function(){Le=null,Ct=!1},c.isValidAttribute=function(Me,_,he){Le||vt({});const Se=Te(Me),gt=Te(_);return ln(Se,gt,he)},c.addHook=function(Me,_){typeof _=="function"&&_r(le[Me],_)},c.removeHook=function(Me,_){if(_!==void 0){const he=If(le[Me],_);return he===-1?void 0:Of(le[Me],he,1)[0]}return ko(le[Me])},c.removeHooks=function(Me){le[Me]=[]},c.removeAllHooks=function(){le=Fo()},c}var Vf=Lo();const ec=["innerHTML"],tc={key:1,class:"markdown-editor markdown-editor--enabled"},Mo=Ke.defineComponent({__name:"MarkdownEditor",props:Ke.mergeModels({modelValue:{},disabled:{type:Boolean,default:!1},placeholder:{default:""},minHeight:{default:"200px"},maxHeight:{default:void 0},autofocus:{type:Boolean,default:!1},spellcheck:{type:Boolean,default:!1},toolbarButtons:{default:()=>[["bold","italic","strike"],["heading","blockquote","codeBlock"],["bulletList","orderedList"],["link","table"],["undo","redo"]]},canAttachFiles:{type:Boolean,default:!1},fileAttachmentsMaxSize:{},fileAttachmentsAcceptedTypes:{},debounceMs:{default:300},translations:{default:()=>({bold:"Bold",italic:"Italic",strike:"Strikethrough",link:"Link",heading:"Heading",blockquote:"Quote",codeBlock:"Code",bulletList:"Bullet List",orderedList:"Ordered List",table:"Table",attachFiles:"Attach Files",undo:"Undo",redo:"Redo",preview:"Preview",sideBySide:"Side by Side",fullscreen:"Fullscreen"})},direction:{default:"ltr"}},{modelValue:{default:""},modelModifiers:{}}),emits:Ke.mergeModels(["update:modelValue","change","blur","focus","upload"],["update:modelValue"]),setup(y,{expose:c,emit:f}){const p=y,x=f,b=Ke.useModel(y,"modelValue"),A=Ke.ref(null),D=Ke.ref(null),k=Ke.ref(null),S=Ke.ref(!1);function z(re,te){let X;return((...Q)=>{clearTimeout(X),X=setTimeout(()=>re(...Q),te)})}const Z=Ke.computed(()=>{if(!p.disabled||!b.value)return"";const re=ut(b.value,{async:!1});return Vf.sanitize(re)});function H(){const re=[];return p.toolbarButtons.forEach((te,X)=>{te.forEach(Q=>{const j=ie(Q);j&&re.push(j)}),te.length>0&&X<p.toolbarButtons.length-1&&re.push("|")}),re}function ie(re){const te=p.translations;return{bold:{name:"bold",action:zt.toggleBold,className:"fa fa-bold",title:te.bold},italic:{name:"italic",action:zt.toggleItalic,className:"fa fa-italic",title:te.italic},strike:{name:"strikethrough",action:zt.toggleStrikethrough,className:"fa fa-strikethrough",title:te.strike},link:{name:"link",action:zt.drawLink,className:"fa fa-link",title:te.link},heading:{name:"heading",action:zt.toggleHeadingSmaller,className:"fa fa-header",title:te.heading},blockquote:{name:"quote",action:zt.toggleBlockquote,className:"fa fa-quote-left",title:te.blockquote},codeBlock:{name:"code",action:zt.toggleCodeBlock,className:"fa fa-code",title:te.codeBlock},bulletList:{name:"unordered-list",action:zt.toggleUnorderedList,className:"fa fa-list-ul",title:te.bulletList},orderedList:{name:"ordered-list",action:zt.toggleOrderedList,className:"fa fa-list-ol",title:te.orderedList},table:{name:"table",action:zt.drawTable,className:"fa fa-table",title:te.table},attachFiles:{name:"upload-image",action:zt.drawUploadedImage,className:"fa fa-image",title:te.attachFiles},undo:{name:"undo",action:zt.undo,className:"fa fa-undo",title:te.undo},redo:{name:"redo",action:zt.redo,className:"fa fa-redo",title:te.redo},preview:{name:"preview",action:zt.togglePreview,className:"fa fa-eye",title:te.preview},sideBySide:{name:"side-by-side",action:zt.toggleSideBySide,className:"fa fa-columns",title:te.sideBySide},fullscreen:{name:"fullscreen",action:zt.toggleFullScreen,className:"fa fa-arrows-alt",title:te.fullscreen}}[re]||null}function ee(re,te,X){if(p.fileAttachmentsAcceptedTypes&&!p.fileAttachmentsAcceptedTypes.includes(re.type)){X(`File type not accepted. Allowed types: ${p.fileAttachmentsAcceptedTypes.join(", ")}`);return}if(p.fileAttachmentsMaxSize){const Q=p.fileAttachmentsMaxSize*1024;if(re.size>Q){X(`File too large. Maximum size: ${p.fileAttachmentsMaxSize}KB`);return}}x("upload",re,te,X)}async function ye(){var Q,j;if(!A.value||p.disabled)return;((Q=D.value)==null?void 0:Q.closest('.modal, [role="dialog"]'))&&await new Promise(K=>setTimeout(K,300)),k.value&&(k.value.toTextArea(),k.value=null);const te=H();if(p.canAttachFiles&&!p.toolbarButtons.some(se=>se.includes("attachFiles"))&&te.length>0){te.push("|");const se=ie("attachFiles");se&&te.push(se)}k.value=new zt({element:A.value,initialValue:b.value||"",placeholder:p.placeholder,minHeight:p.minHeight,maxHeight:p.maxHeight,autofocus:p.autofocus,spellChecker:p.spellcheck,autoDownloadFontAwesome:!1,status:!1,toolbar:te.length>0?te:!1,uploadImage:p.canAttachFiles,imageUploadFunction:p.canAttachFiles?ee:void 0,imageAccept:((j=p.fileAttachmentsAcceptedTypes)==null?void 0:j.join(", "))||"image/png, image/jpeg, image/gif, image/webp",previewImagesInEditor:!0}),k.value.codemirror.setOption("direction",p.direction);const X=z(K=>{b.value=K,x("change",K)},p.debounceMs);k.value.codemirror.on("change",()=>{k.value&&X(k.value.value())}),k.value.codemirror.on("blur",()=>{x("blur")}),k.value.codemirror.on("focus",()=>{x("focus")}),k.value.codemirror.on("changes",(K,se)=>{try{const V=se[se.length-1];if((V==null?void 0:V.origin)==="+input"){const pe="(https://)",xe=V.text[V.text.length-1];if(xe.endsWith(pe)&&xe!=="[]"+pe){const Xe=V.from,le=V.to,Re=V.text.length>1?0:Xe.ch;setTimeout(()=>{var Pe;(Pe=k.value)==null||Pe.codemirror.setSelection({line:le.line,ch:Re+xe.lastIndexOf("(")+1},{line:le.line,ch:Re+xe.lastIndexOf(")")})},25)}}}catch{}}),S.value=!0}return Ke.watch(b,re=>{if(!k.value||!S.value||k.value.codemirror.hasFocus())return;k.value.value()!==re&&k.value.value(re||"")}),Ke.watch(()=>p.disabled,async re=>{re&&k.value?(k.value.toTextArea(),k.value=null,S.value=!1):re||(await Ke.nextTick(),ye())}),Ke.onMounted(()=>{p.disabled||ye()}),Ke.onBeforeUnmount(()=>{k.value&&(k.value.cleanup(),k.value=null)}),c({getEditor:()=>k.value,focus:()=>{var re;return(re=k.value)==null?void 0:re.codemirror.focus()},blur:()=>{var te;const re=(te=k.value)==null?void 0:te.codemirror.getWrapperElement();if(re){const X=re.querySelector(".CodeMirror-code");X==null||X.blur()}},getValue:()=>{var re;return((re=k.value)==null?void 0:re.value())||b.value},setValue:re=>{k.value&&k.value.value(re),b.value=re}}),(re,te)=>(Ke.openBlock(),Ke.createElementBlock("div",{ref_key:"containerRef",ref:D,class:"markdown-editor-container"},[y.disabled?(Ke.openBlock(),Ke.createElementBlock("div",{key:0,class:"markdown-editor markdown-editor--disabled markdown-prose",innerHTML:Z.value},null,8,ec)):(Ke.openBlock(),Ke.createElementBlock("div",tc,[Ke.createElementVNode("textarea",{ref_key:"editorRef",ref:A},null,512)]))],512))}}),nc={install(y){y.component("MarkdownEditor",Mo)}};an.MarkdownEditor=Mo,an.default=nc,Object.defineProperties(an,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));