- Reorder blueprint to Photos → Title → Content; drop title autofocus so the
picker leads (it anchors what you write).
- After upload the photo section auto-collapses to a live summary bar
("✓ N photos ready — tap to review") and re-expands on tap; the field's
own .form-label is hidden so the <summary> is the sole header. Trailing
refreshes settle the summary past FilePond's event/DOM timing gap.
- Replace FilePond's murky completed-thumbnail overlay with a clean green ✓
badge (remove action left intact).
- On a successful post, hide the reset form + location/weather controls so
only the "✓ Saved" confirmation + View-journal CTA remain.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
96 lines
334 KiB
JavaScript
96 lines
334 KiB
JavaScript
import{a as ms,b as Ye,c as _c}from"./chunk-ZWRDP37E.js";var ct=Ye((Ko,Xo)=>{(function(a,c){typeof Ko=="object"&&typeof Xo<"u"?Xo.exports=c():typeof define=="function"&&define.amd?define(c):(a=a||self,a.CodeMirror=c())})(Ko,function(){"use strict";var a=navigator.userAgent,c=navigator.platform,d=/gecko\/\d/i.test(a),l=/MSIE \d/.test(a),u=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(a),g=/Edge\/(\d+)/.exec(a),f=l||u||g,p=f&&(l?document.documentMode||6:+(g||u)[1]),b=!g&&/WebKit\//.test(a),C=b&&/Qt\/\d+\.\d+/.test(a),D=!g&&/Chrome\/(\d+)/.exec(a),E=D&&+D[1],T=/Opera\//.test(a),M=/Apple Computer/.test(navigator.vendor),z=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(a),I=/PhantomJS/.test(a),F=M&&(/Mobile\/\w+/.test(a)||navigator.maxTouchPoints>2),B=/Android/.test(a),N=F||B||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(a),R=F||/Mac/.test(c),H=/\bCrOS\b/.test(a),_=/win/i.test(c),X=T&&a.match(/Version\/(\d*\.\d*)/);X&&(X=Number(X[1])),X&&X>=15&&(T=!1,b=!0);var K=R&&(C||T&&(X==null||X<12.11)),ge=d||f&&p>=9;function G(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ue=function(e,t){var i=e.className,r=G(t).exec(i);if(r){var n=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(n?r[1]+n:"")}};function ae(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function de(e,t){return ae(e).appendChild(t)}function A(e,t,i,r){var n=document.createElement(e);if(i&&(n.className=i),r&&(n.style.cssText=r),typeof t=="string")n.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)n.appendChild(t[o]);return n}function U(e,t,i,r){var n=A(e,t,i,r);return n.setAttribute("role","presentation"),n}var W;document.createRange?W=function(e,t,i,r){var n=document.createRange();return n.setEnd(r||e,i),n.setStart(e,t),n}:W=function(e,t,i){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",i),r.moveStart("character",t),r};function V(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 ve(e){var t=e.ownerDocument||e,i;try{i=e.activeElement}catch{i=t.body||null}for(;i&&i.shadowRoot&&i.shadowRoot.activeElement;)i=i.shadowRoot.activeElement;return i}function Te(e,t){var i=e.className;G(t).test(i)||(e.className+=(i?" ":"")+t)}function vt(e,t){for(var i=e.split(" "),r=0;r<i.length;r++)i[r]&&!G(i[r]).test(t)&&(t+=" "+i[r]);return t}var k=function(e){e.select()};F?k=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:f&&(k=function(e){try{e.select()}catch{}});function y(e){return e.display.wrapper.ownerDocument}function ee(e){return ye(e.display.wrapper)}function ye(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function he(e){return y(e).defaultView}function tt(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function dt(e,t,i){t||(t={});for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(i!==!1||!Object.prototype.hasOwnProperty.call(t,r))&&(t[r]=e[r]);return t}function Re(e,t,i,r,n){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,s=n||0;;){var h=e.indexOf(" ",o);if(h<0||h>=t)return s+(t-o);s+=h-o,s+=i-s%i,o=h+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 i=+new Date+e;(!this.id||i<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=i)};function Fe(e,t){for(var i=0;i<e.length;++i)if(e[i]==t)return i;return-1}var Me=50,Pe={toString:function(){return"CodeMirror.Pass"}},rt={scroll:!1},Ur={origin:"*mouse"},kt={origin:"+move"};function St(e,t,i){for(var r=0,n=0;;){var o=e.indexOf(" ",r);o==-1&&(o=e.length);var s=o-r;if(o==e.length||n+s>=t)return r+Math.min(s,t-n);if(n+=o-r,n+=i-n%i,r=o+1,n>=t)return r}}var yt=[""];function Pt(e){for(;yt.length<=e;)yt.push(me(yt)+" ");return yt[e]}function me(e){return e[e.length-1]}function bt(e,t){for(var i=[],r=0;r<e.length;r++)i[r]=t(e[r],r);return i}function _t(e,t,i){for(var r=0,n=i(t);r<e.length&&i(e[r])<=n;)r++;e.splice(r,0,t)}function Si(){}function fa(e,t){var i;return Object.create?i=Object.create(e):(Si.prototype=e,i=new Si),t&&dt(t,i),i}var Eu=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function On(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Eu.test(e))}function Fi(e,t){return t?t.source.indexOf("\\w")>-1&&On(e)?!0:t.test(e):On(e)}function ca(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Au=/[\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 Hn(e){return e.charCodeAt(0)>=768&&Au.test(e)}function da(e,t,i){for(;(i<0?t>0:t<e.length)&&Hn(e.charAt(t));)t+=i;return t}function jr(e,t,i){for(var r=t>i?-1:1;;){if(t==i)return t;var n=(t+i)/2,o=r<0?Math.ceil(n):Math.floor(n);if(o==t)return e(o)?t:i;e(o)?i=o:t=o+r}}function Lu(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var n=!1,o=0;o<e.length;++o){var s=e[o];(s.from<i&&s.to>t||t==i&&s.to==t)&&(r(Math.max(s.from,t),Math.min(s.to,i),s.level==1?"rtl":"ltr",o),n=!0)}n||r(t,i,"ltr")}var Gr=null;function Kr(e,t,i){var r;Gr=null;for(var n=0;n<e.length;++n){var o=e[n];if(o.from<t&&o.to>t)return n;o.to==t&&(o.from!=o.to&&i=="before"?r=n:Gr=n),o.from==t&&(o.from!=o.to&&i!="before"?r=n:Gr=n)}return r??Gr}var Tu=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(m){return m<=247?e.charAt(m):1424<=m&&m<=1524?"R":1536<=m&&m<=1785?t.charAt(m-1536):1774<=m&&m<=2220?"r":8192<=m&&m<=8203?"w":m==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,n=/[stwN]/,o=/[LRr]/,s=/[Lb1n]/,h=/[1n]/;function v(m,x,w){this.level=m,this.from=x,this.to=w}return function(m,x){var w=x=="ltr"?"L":"R";if(m.length==0||x=="ltr"&&!r.test(m))return!1;for(var L=m.length,S=[],O=0;O<L;++O)S.push(i(m.charCodeAt(O)));for(var P=0,j=w;P<L;++P){var Y=S[P];Y=="m"?S[P]=j:j=Y}for(var Q=0,Z=w;Q<L;++Q){var $=S[Q];$=="1"&&Z=="r"?S[Q]="n":o.test($)&&(Z=$,$=="r"&&(S[Q]="R"))}for(var ne=1,ie=S[0];ne<L-1;++ne){var pe=S[ne];pe=="+"&&ie=="1"&&S[ne+1]=="1"?S[ne]="1":pe==","&&ie==S[ne+1]&&(ie=="1"||ie=="n")&&(S[ne]=ie),ie=pe}for(var Ce=0;Ce<L;++Ce){var Ge=S[Ce];if(Ge==",")S[Ce]="N";else if(Ge=="%"){var Le=void 0;for(Le=Ce+1;Le<L&&S[Le]=="%";++Le);for(var ft=Ce&&S[Ce-1]=="!"||Le<L&&S[Le]=="1"?"1":"N",at=Ce;at<Le;++at)S[at]=ft;Ce=Le-1}}for(var Oe=0,lt=w;Oe<L;++Oe){var Xe=S[Oe];lt=="L"&&Xe=="1"?S[Oe]="L":o.test(Xe)&&(lt=Xe)}for(var _e=0;_e<L;++_e)if(n.test(S[_e])){var He=void 0;for(He=_e+1;He<L&&n.test(S[He]);++He);for(var Be=(_e?S[_e-1]:w)=="L",st=(He<L?S[He]:w)=="L",Hr=Be==st?Be?"L":"R":w,Zt=_e;Zt<He;++Zt)S[Zt]=Hr;_e=He-1}for(var Qe=[],Tt,Ke=0;Ke<L;)if(s.test(S[Ke])){var jo=Ke;for(++Ke;Ke<L&&s.test(S[Ke]);++Ke);Qe.push(new v(0,jo,Ke))}else{var Ht=Ke,fr=Qe.length,cr=x=="rtl"?1:0;for(++Ke;Ke<L&&S[Ke]!="L";++Ke);for(var Ve=Ht;Ve<Ke;)if(h.test(S[Ve])){Ht<Ve&&(Qe.splice(fr,0,new v(1,Ht,Ve)),fr+=cr);var Rr=Ve;for(++Ve;Ve<Ke&&h.test(S[Ve]);++Ve);Qe.splice(fr,0,new v(2,Rr,Ve)),fr+=cr,Ht=Ve}else++Ve;Ht<Ke&&Qe.splice(fr,0,new v(1,Ht,Ke))}return x=="ltr"&&(Qe[0].level==1&&(Tt=m.match(/^\s+/))&&(Qe[0].from=Tt[0].length,Qe.unshift(new v(0,0,Tt[0].length))),me(Qe).level==1&&(Tt=m.match(/\s+$/))&&(me(Qe).to-=Tt[0].length,Qe.push(new v(0,L-Tt[0].length,L)))),x=="rtl"?Qe.reverse():Qe}}();function Mt(e,t){var i=e.order;return i==null&&(i=e.order=Tu(e.text,t)),i}var ha=[],oe=function(e,t,i){if(e.addEventListener)e.addEventListener(t,i,!1);else if(e.attachEvent)e.attachEvent("on"+t,i);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||ha).concat(i)}};function Rn(e,t){return e._handlers&&e._handlers[t]||ha}function ht(e,t,i){if(e.removeEventListener)e.removeEventListener(t,i,!1);else if(e.detachEvent)e.detachEvent("on"+t,i);else{var r=e._handlers,n=r&&r[t];if(n){var o=Fe(n,i);o>-1&&(r[t]=n.slice(0,o).concat(n.slice(o+1)))}}}function Ie(e,t){var i=Rn(e,t);if(i.length)for(var r=Array.prototype.slice.call(arguments,2),n=0;n<i.length;++n)i[n].apply(null,r)}function We(e,t,i){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ie(e,i||t.type,e,t),Pn(t)||t.codemirrorIgnore}function pa(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var i=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)Fe(i,t[r])==-1&&i.push(t[r])}function mt(e,t){return Rn(e,t).length>0}function mr(e){e.prototype.on=function(t,i){oe(this,t,i)},e.prototype.off=function(t,i){ht(this,t,i)}}function it(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ga(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Pn(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Xr(e){it(e),ga(e)}function _n(e){return e.target||e.srcElement}function va(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),R&&e.ctrlKey&&t==1&&(t=3),t}var Mu=function(){if(f&&p<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}(),Wn;function Bu(e){if(Wn==null){var t=A("span","\u200B");de(e,A("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Wn=t.offsetWidth<=1&&t.offsetHeight>2&&!(f&&p<8))}var i=Wn?A("span","\u200B"):A("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var qn;function Nu(e){if(qn!=null)return qn;var t=de(e,document.createTextNode("A\u062EA")),i=W(t,0,1).getBoundingClientRect(),r=W(t,1,2).getBoundingClientRect();return ae(e),!i||i.left==i.right?!1:qn=r.right-i.right<3}var Un=`
|
|
|
|
b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var n=e.indexOf(`
|
|
`,t);n==-1&&(n=e.length);var o=e.slice(t,e.charAt(n-1)=="\r"?n-1:n),s=o.indexOf("\r");s!=-1?(i.push(o.slice(0,s)),t+=s+1):(i.push(o),t=n+1)}return i}:function(e){return e.split(/\r\n?|\n/)},Iu=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},zu=function(){var e=A("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),jn=null;function Ou(e){if(jn!=null)return jn;var t=de(e,A("span","x")),i=t.getBoundingClientRect(),r=W(t,0,1).getBoundingClientRect();return jn=Math.abs(i.left-r.left)>1}var Gn={},yr={};function Hu(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Gn[e]=t}function Ru(e,t){yr[e]=t}function Ei(e){if(typeof e=="string"&&yr.hasOwnProperty(e))e=yr[e];else if(e&&typeof e.name=="string"&&yr.hasOwnProperty(e.name)){var t=yr[e.name];typeof t=="string"&&(t={name:t}),e=fa(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ei("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ei("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Kn(e,t){t=Ei(t);var i=Gn[t.name];if(!i)return Kn(e,"text/plain");var r=i(e,t);if(br.hasOwnProperty(t.name)){var n=br[t.name];for(var o in n)n.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=n[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var s in t.modeProps)r[s]=t.modeProps[s];return r}var br={};function Pu(e,t){var i=br.hasOwnProperty(e)?br[e]:br[e]={};dt(t,i)}function Vt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var n=t[r];n instanceof Array&&(n=n.concat([])),i[r]=n}return i}function Xn(e,t){for(var i;e.innerMode&&(i=e.innerMode(t),!(!i||i.mode==e));)t=i.state,e=i.mode;return i||{mode:e,state:t}}function ma(e,t,i){return e.startState?e.startState(t,i):!0}var ze=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};ze.prototype.eol=function(){return this.pos>=this.string.length},ze.prototype.sol=function(){return this.pos==this.lineStart},ze.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ze.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},ze.prototype.eat=function(e){var t=this.string.charAt(this.pos),i;if(typeof e=="string"?i=t==e:i=t&&(e.test?e.test(t):e(t)),i)return++this.pos,t},ze.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},ze.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ze.prototype.skipToEnd=function(){this.pos=this.string.length},ze.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ze.prototype.backUp=function(e){this.pos-=e},ze.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Re(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Re(this.string,this.lineStart,this.tabSize):0)},ze.prototype.indentation=function(){return Re(this.string,null,this.tabSize)-(this.lineStart?Re(this.string,this.lineStart,this.tabSize):0)},ze.prototype.match=function(e,t,i){if(typeof e=="string"){var r=function(s){return i?s.toLowerCase():s},n=this.string.substr(this.pos,e.length);if(r(n)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var o=this.string.slice(this.pos).match(e);return o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},ze.prototype.current=function(){return this.string.slice(this.start,this.pos)},ze.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ze.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ze.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function re(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 i=e;!i.lines;)for(var r=0;;++r){var n=i.children[r],o=n.chunkSize();if(t<o){i=n;break}t-=o}return i.lines[t]}function er(e,t,i){var r=[],n=t.line;return e.iter(t.line,i.line+1,function(o){var s=o.text;n==i.line&&(s=s.slice(0,i.ch)),n==t.line&&(s=s.slice(t.ch)),r.push(s),++n}),r}function Yn(e,t,i){var r=[];return e.iter(t,i,function(n){r.push(n.text)}),r}function Ft(e,t){var i=t-e.height;if(i)for(var r=e;r;r=r.parent)r.height+=i}function xe(e){if(e.parent==null)return null;for(var t=e.parent,i=Fe(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var n=0;r.children[n]!=t;++n)i+=r.children[n].chunkSize();return i+t.first}function tr(e,t){var i=e.first;e:do{for(var r=0;r<e.children.length;++r){var n=e.children[r],o=n.height;if(t<o){e=n;continue e}t-=o,i+=n.chunkSize()}return i}while(!e.lines);for(var s=0;s<e.lines.length;++s){var h=e.lines[s],v=h.height;if(t<v)break;t-=v}return i+s}function Yr(e,t){return t>=e.first&&t<e.first+e.size}function Zn(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function q(e,t,i){if(i===void 0&&(i=null),!(this instanceof q))return new q(e,t,i);this.line=e,this.ch=t,this.sticky=i}function fe(e,t){return e.line-t.line||e.ch-t.ch}function Qn(e,t){return e.sticky==t.sticky&&fe(e,t)==0}function Jn(e){return q(e.line,e.ch)}function Ai(e,t){return fe(e,t)<0?t:e}function Li(e,t){return fe(e,t)<0?e:t}function ya(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ce(e,t){if(t.line<e.first)return q(e.first,0);var i=e.first+e.size-1;return t.line>i?q(i,re(e,i).text.length):_u(t,re(e,t.line).text.length)}function _u(e,t){var i=e.ch;return i==null||i>t?q(e.line,t):i<0?q(e.line,0):e}function ba(e,t){for(var i=[],r=0;r<t.length;r++)i[r]=ce(e,t[r]);return i}var Ti=function(e,t){this.state=e,this.lookAhead=t},Et=function(e,t,i,r){this.state=t,this.doc=e,this.line=i,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Et.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Et.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}},Et.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Et.fromSaved=function(e,t,i){return t instanceof Ti?new Et(e,Vt(e.mode,t.state),i,t.lookAhead):new Et(e,Vt(e.mode,t),i)},Et.prototype.save=function(e){var t=e!==!1?Vt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Ti(t,this.maxLookAhead):t};function xa(e,t,i,r){var n=[e.state.modeGen],o={};Fa(e,t.text,e.doc.mode,i,function(m,x){return n.push(m,x)},o,r);for(var s=i.state,h=function(m){i.baseTokens=n;var x=e.state.overlays[m],w=1,L=0;i.state=!0,Fa(e,t.text,x.mode,i,function(S,O){for(var P=w;L<S;){var j=n[w];j>S&&n.splice(w,1,S,n[w+1],j),w+=2,L=Math.min(S,j)}if(O)if(x.opaque)n.splice(P,w-P,S,"overlay "+O),w=P+2;else for(;P<w;P+=2){var Y=n[P+1];n[P+1]=(Y?Y+" ":"")+"overlay "+O}},o),i.state=s,i.baseTokens=null,i.baseTokenPos=1},v=0;v<e.state.overlays.length;++v)h(v);return{styles:n,classes:o.bgClass||o.textClass?o:null}}function Da(e,t,i){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Zr(e,xe(t)),n=t.text.length>e.options.maxHighlightLength&&Vt(e.doc.mode,r.state),o=xa(e,t,r);n&&(r.state=n),t.stateAfter=r.save(!n),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Zr(e,t,i){var r=e.doc,n=e.display;if(!r.mode.startState)return new Et(r,!0,t);var o=Wu(e,t,i),s=o>r.first&&re(r,o-1).stateAfter,h=s?Et.fromSaved(r,s,o):new Et(r,ma(r.mode),o);return r.iter(o,t,function(v){$n(e,v.text,h);var m=h.line;v.stateAfter=m==t-1||m%5==0||m>=n.viewFrom&&m<n.viewTo?h.save():null,h.nextLine()}),i&&(r.modeFrontier=h.line),h}function $n(e,t,i,r){var n=e.doc.mode,o=new ze(t,e.options.tabSize,i);for(o.start=o.pos=r||0,t==""&&Ca(n,i.state);!o.eol();)Vn(n,o,i.state),o.start=o.pos}function Ca(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var i=Xn(e,t);if(i.mode.blankLine)return i.mode.blankLine(i.state)}}function Vn(e,t,i,r){for(var n=0;n<10;n++){r&&(r[0]=Xn(e,i).mode);var o=e.token(t,i);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var wa=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function ka(e,t,i,r){var n=e.doc,o=n.mode,s;t=ce(n,t);var h=re(n,t.line),v=Zr(e,t.line,i),m=new ze(h.text,e.options.tabSize,v),x;for(r&&(x=[]);(r||m.pos<t.ch)&&!m.eol();)m.start=m.pos,s=Vn(o,m,v.state),r&&x.push(new wa(m,s,Vt(n.mode,v.state)));return r?x:new wa(m,s,v.state)}function Sa(e,t){if(e)for(;;){var i=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i)break;e=e.slice(0,i.index)+e.slice(i.index+i[0].length);var r=i[1]?"bgClass":"textClass";t[r]==null?t[r]=i[2]:new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+i[2])}return e}function Fa(e,t,i,r,n,o,s){var h=i.flattenSpans;h==null&&(h=e.options.flattenSpans);var v=0,m=null,x=new ze(t,e.options.tabSize,r),w,L=e.options.addModeClass&&[null];for(t==""&&Sa(Ca(i,r.state),o);!x.eol();){if(x.pos>e.options.maxHighlightLength?(h=!1,s&&$n(e,t,r,x.pos),x.pos=t.length,w=null):w=Sa(Vn(i,x,r.state,L),o),L){var S=L[0].name;S&&(w="m-"+(w?S+" "+w:S))}if(!h||m!=w){for(;v<x.start;)v=Math.min(x.start,v+5e3),n(v,m);m=w}x.start=x.pos}for(;v<x.pos;){var O=Math.min(x.pos,v+5e3);n(O,m),v=O}}function Wu(e,t,i){for(var r,n,o=e.doc,s=i?-1:t-(e.doc.mode.innerMode?1e3:100),h=t;h>s;--h){if(h<=o.first)return o.first;var v=re(o,h-1),m=v.stateAfter;if(m&&(!i||h+(m instanceof Ti?m.lookAhead:0)<=o.modeFrontier))return h;var x=Re(v.text,null,e.options.tabSize);(n==null||r>x)&&(n=h-1,r=x)}return n}function qu(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var i=e.first,r=t-1;r>i;r--){var n=re(e,r).stateAfter;if(n&&(!(n instanceof Ti)||r+n.lookAhead<t)){i=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,i)}}var Ea=!1,Bt=!1;function Uu(){Ea=!0}function ju(){Bt=!0}function Mi(e,t,i){this.marker=e,this.from=t,this.to=i}function Qr(e,t){if(e)for(var i=0;i<e.length;++i){var r=e[i];if(r.marker==t)return r}}function Gu(e,t){for(var i,r=0;r<e.length;++r)e[r]!=t&&(i||(i=[])).push(e[r]);return i}function Ku(e,t,i){var r=i&&window.WeakSet&&(i.markedSpans||(i.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function Xu(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var o=e[n],s=o.marker,h=o.from==null||(s.inclusiveLeft?o.from<=t:o.from<t);if(h||o.from==t&&s.type=="bookmark"&&(!i||!o.marker.insertLeft)){var v=o.to==null||(s.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Mi(s,o.from,v?null:o.to))}}return r}function Yu(e,t,i){var r;if(e)for(var n=0;n<e.length;++n){var o=e[n],s=o.marker,h=o.to==null||(s.inclusiveRight?o.to>=t:o.to>t);if(h||o.from==t&&s.type=="bookmark"&&(!i||o.marker.insertLeft)){var v=o.from==null||(s.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Mi(s,v?null:o.from-t,o.to==null?null:o.to-t))}}return r}function eo(e,t){if(t.full)return null;var i=Yr(e,t.from.line)&&re(e,t.from.line).markedSpans,r=Yr(e,t.to.line)&&re(e,t.to.line).markedSpans;if(!i&&!r)return null;var n=t.from.ch,o=t.to.ch,s=fe(t.from,t.to)==0,h=Xu(i,n,s),v=Yu(r,o,s),m=t.text.length==1,x=me(t.text).length+(m?n:0);if(h)for(var w=0;w<h.length;++w){var L=h[w];if(L.to==null){var S=Qr(v,L.marker);S?m&&(L.to=S.to==null?null:S.to+x):L.to=n}}if(v)for(var O=0;O<v.length;++O){var P=v[O];if(P.to!=null&&(P.to+=x),P.from==null){var j=Qr(h,P.marker);j||(P.from=x,m&&(h||(h=[])).push(P))}else P.from+=x,m&&(h||(h=[])).push(P)}h&&(h=Aa(h)),v&&v!=h&&(v=Aa(v));var Y=[h];if(!m){var Q=t.text.length-2,Z;if(Q>0&&h)for(var $=0;$<h.length;++$)h[$].to==null&&(Z||(Z=[])).push(new Mi(h[$].marker,null,null));for(var ne=0;ne<Q;++ne)Y.push(Z);Y.push(v)}return Y}function Aa(e){for(var t=0;t<e.length;++t){var i=e[t];i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Zu(e,t,i){var r=null;if(e.iter(t.line,i.line+1,function(S){if(S.markedSpans)for(var O=0;O<S.markedSpans.length;++O){var P=S.markedSpans[O].marker;P.readOnly&&(!r||Fe(r,P)==-1)&&(r||(r=[])).push(P)}}),!r)return null;for(var n=[{from:t,to:i}],o=0;o<r.length;++o)for(var s=r[o],h=s.find(0),v=0;v<n.length;++v){var m=n[v];if(!(fe(m.to,h.from)<0||fe(m.from,h.to)>0)){var x=[v,1],w=fe(m.from,h.from),L=fe(m.to,h.to);(w<0||!s.inclusiveLeft&&!w)&&x.push({from:m.from,to:h.from}),(L>0||!s.inclusiveRight&&!L)&&x.push({from:h.to,to:m.to}),n.splice.apply(n,x),v+=x.length-3}}return n}function La(e){var t=e.markedSpans;if(t){for(var i=0;i<t.length;++i)t[i].marker.detachLine(e);e.markedSpans=null}}function Ta(e,t){if(t){for(var i=0;i<t.length;++i)t[i].marker.attachLine(e);e.markedSpans=t}}function Bi(e){return e.inclusiveLeft?-1:0}function Ni(e){return e.inclusiveRight?1:0}function to(e,t){var i=e.lines.length-t.lines.length;if(i!=0)return i;var r=e.find(),n=t.find(),o=fe(r.from,n.from)||Bi(e)-Bi(t);if(o)return-o;var s=fe(r.to,n.to)||Ni(e)-Ni(t);return s||t.id-e.id}function Ma(e,t){var i=Bt&&e.markedSpans,r;if(i)for(var n=void 0,o=0;o<i.length;++o)n=i[o],n.marker.collapsed&&(t?n.from:n.to)==null&&(!r||to(r,n.marker)<0)&&(r=n.marker);return r}function Ba(e){return Ma(e,!0)}function Ii(e){return Ma(e,!1)}function Qu(e,t){var i=Bt&&e.markedSpans,r;if(i)for(var n=0;n<i.length;++n){var o=i[n];o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!r||to(r,o.marker)<0)&&(r=o.marker)}return r}function Na(e,t,i,r,n){var o=re(e,t),s=Bt&&o.markedSpans;if(s)for(var h=0;h<s.length;++h){var v=s[h];if(v.marker.collapsed){var m=v.marker.find(0),x=fe(m.from,i)||Bi(v.marker)-Bi(n),w=fe(m.to,r)||Ni(v.marker)-Ni(n);if(!(x>=0&&w<=0||x<=0&&w>=0)&&(x<=0&&(v.marker.inclusiveRight&&n.inclusiveLeft?fe(m.to,i)>=0:fe(m.to,i)>0)||x>=0&&(v.marker.inclusiveRight&&n.inclusiveLeft?fe(m.from,r)<=0:fe(m.from,r)<0)))return!0}}}function xt(e){for(var t;t=Ba(e);)e=t.find(-1,!0).line;return e}function Ju(e){for(var t;t=Ii(e);)e=t.find(1,!0).line;return e}function $u(e){for(var t,i;t=Ii(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function ro(e,t){var i=re(e,t),r=xt(i);return i==r?t:xe(r)}function Ia(e,t){if(t>e.lastLine())return t;var i=re(e,t),r;if(!Wt(e,i))return t;for(;r=Ii(i);)i=r.find(1,!0).line;return xe(i)+1}function Wt(e,t){var i=Bt&&t.markedSpans;if(i){for(var r=void 0,n=0;n<i.length;++n)if(r=i[n],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&io(e,t,r))return!0}}}function io(e,t,i){if(i.to==null){var r=i.marker.find(1,!0);return io(e,r.line,Qr(r.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length)return!0;for(var n=void 0,o=0;o<t.markedSpans.length;++o)if(n=t.markedSpans[o],n.marker.collapsed&&!n.marker.widgetNode&&n.from==i.to&&(n.to==null||n.to!=i.from)&&(n.marker.inclusiveLeft||i.marker.inclusiveRight)&&io(e,t,n))return!0}function Nt(e){e=xt(e);for(var t=0,i=e.parent,r=0;r<i.lines.length;++r){var n=i.lines[r];if(n==e)break;t+=n.height}for(var o=i.parent;o;i=o,o=i.parent)for(var s=0;s<o.children.length;++s){var h=o.children[s];if(h==i)break;t+=h.height}return t}function zi(e){if(e.height==0)return 0;for(var t=e.text.length,i,r=e;i=Ba(r);){var n=i.find(0,!0);r=n.from.line,t+=n.from.ch-n.to.ch}for(r=e;i=Ii(r);){var o=i.find(0,!0);t-=r.text.length-o.from.ch,r=o.to.line,t+=r.text.length-o.to.ch}return t}function no(e){var t=e.display,i=e.doc;t.maxLine=re(i,i.first),t.maxLineLength=zi(t.maxLine),t.maxLineChanged=!0,i.iter(function(r){var n=zi(r);n>t.maxLineLength&&(t.maxLineLength=n,t.maxLine=r)})}var xr=function(e,t,i){this.text=e,Ta(this,t),this.height=i?i(this):1};xr.prototype.lineNo=function(){return xe(this)},mr(xr);function Vu(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),La(e),Ta(e,i);var n=r?r(e):1;n!=e.height&&Ft(e,n)}function ef(e){e.parent=null,La(e)}var tf={},rf={};function za(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?rf:tf;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function Oa(e,t){var i=U("span",null,null,b?"padding-right: .1px":null),r={pre:U("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var o=n?t.rest[n-1]:t.line,s=void 0;r.pos=0,r.addToken=of,Nu(e.display.measure)&&(s=Mt(o,e.doc.direction))&&(r.addToken=lf(r.addToken,s)),r.map=[];var h=t!=e.display.externalMeasured&&xe(o);sf(o,r,Da(e,o,h)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=vt(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=vt(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Bu(e.display.measure))),n==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(b){var v=r.content.lastChild;(/\bcm-tab\b/.test(v.className)||v.querySelector&&v.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Ie(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=vt(r.pre.className,r.textClass||"")),r}function nf(e){var t=A("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function of(e,t,i,r,n,o,s){if(t){var h=e.splitSpaces?af(t,e.trailingSpace):t,v=e.cm.state.specialChars,m=!1,x;if(!v.test(t))e.col+=t.length,x=document.createTextNode(h),e.map.push(e.pos,e.pos+t.length,x),f&&p<9&&(m=!0),e.pos+=t.length;else{x=document.createDocumentFragment();for(var w=0;;){v.lastIndex=w;var L=v.exec(t),S=L?L.index-w:t.length-w;if(S){var O=document.createTextNode(h.slice(w,w+S));f&&p<9?x.appendChild(A("span",[O])):x.appendChild(O),e.map.push(e.pos,e.pos+S,O),e.col+=S,e.pos+=S}if(!L)break;w+=S+1;var P=void 0;if(L[0]==" "){var j=e.cm.options.tabSize,Y=j-e.col%j;P=x.appendChild(A("span",Pt(Y),"cm-tab")),P.setAttribute("role","presentation"),P.setAttribute("cm-text"," "),e.col+=Y}else L[0]=="\r"||L[0]==`
|
|
`?(P=x.appendChild(A("span",L[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),P.setAttribute("cm-text",L[0]),e.col+=1):(P=e.cm.options.specialCharPlaceholder(L[0]),P.setAttribute("cm-text",L[0]),f&&p<9?x.appendChild(A("span",[P])):x.appendChild(P),e.col+=1);e.map.push(e.pos,e.pos+1,P),e.pos++}}if(e.trailingSpace=h.charCodeAt(t.length-1)==32,i||r||n||m||o||s){var Q=i||"";r&&(Q+=r),n&&(Q+=n);var Z=A("span",[x],Q,o);if(s)for(var $ in s)s.hasOwnProperty($)&&$!="style"&&$!="class"&&Z.setAttribute($,s[$]);return e.content.appendChild(Z)}e.content.appendChild(x)}}function af(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",n=0;n<e.length;n++){var o=e.charAt(n);o==" "&&i&&(n==e.length-1||e.charCodeAt(n+1)==32)&&(o="\xA0"),r+=o,i=o==" "}return r}function lf(e,t){return function(i,r,n,o,s,h,v){n=n?n+" cm-force-border":"cm-force-border";for(var m=i.pos,x=m+r.length;;){for(var w=void 0,L=0;L<t.length&&(w=t[L],!(w.to>m&&w.from<=m));L++);if(w.to>=x)return e(i,r,n,o,s,h,v);e(i,r.slice(0,w.to-m),n,o,null,h,v),o=null,r=r.slice(w.to-m),m=w.to}}}function Ha(e,t,i,r){var n=!r&&i.widgetNode;n&&e.map.push(e.pos,e.pos+t,n),!r&&e.cm.display.input.needsContentAttribute&&(n||(n=e.content.appendChild(document.createElement("span"))),n.setAttribute("cm-marker",i.id)),n&&(e.cm.display.input.setUneditable(n),e.content.appendChild(n)),e.pos+=t,e.trailingSpace=!1}function sf(e,t,i){var r=e.markedSpans,n=e.text,o=0;if(!r){for(var s=1;s<i.length;s+=2)t.addToken(t,n.slice(o,o=i[s]),za(i[s+1],t.cm.options));return}for(var h=n.length,v=0,m=1,x="",w,L,S=0,O,P,j,Y,Q;;){if(S==v){O=P=j=L="",Q=null,Y=null,S=1/0;for(var Z=[],$=void 0,ne=0;ne<r.length;++ne){var ie=r[ne],pe=ie.marker;if(pe.type=="bookmark"&&ie.from==v&&pe.widgetNode)Z.push(pe);else if(ie.from<=v&&(ie.to==null||ie.to>v||pe.collapsed&&ie.to==v&&ie.from==v)){if(ie.to!=null&&ie.to!=v&&S>ie.to&&(S=ie.to,P=""),pe.className&&(O+=" "+pe.className),pe.css&&(L=(L?L+";":"")+pe.css),pe.startStyle&&ie.from==v&&(j+=" "+pe.startStyle),pe.endStyle&&ie.to==S&&($||($=[])).push(pe.endStyle,ie.to),pe.title&&((Q||(Q={})).title=pe.title),pe.attributes)for(var Ce in pe.attributes)(Q||(Q={}))[Ce]=pe.attributes[Ce];pe.collapsed&&(!Y||to(Y.marker,pe)<0)&&(Y=ie)}else ie.from>v&&S>ie.from&&(S=ie.from)}if($)for(var Ge=0;Ge<$.length;Ge+=2)$[Ge+1]==S&&(P+=" "+$[Ge]);if(!Y||Y.from==v)for(var Le=0;Le<Z.length;++Le)Ha(t,0,Z[Le]);if(Y&&(Y.from||0)==v){if(Ha(t,(Y.to==null?h+1:Y.to)-v,Y.marker,Y.from==null),Y.to==null)return;Y.to==v&&(Y=!1)}}if(v>=h)break;for(var ft=Math.min(h,S);;){if(x){var at=v+x.length;if(!Y){var Oe=at>ft?x.slice(0,ft-v):x;t.addToken(t,Oe,w?w+O:O,j,v+Oe.length==S?P:"",L,Q)}if(at>=ft){x=x.slice(ft-v),v=ft;break}v=at,j=""}x=n.slice(o,o=i[m++]),w=za(i[m++],t.cm.options)}}}function Ra(e,t,i){this.line=t,this.rest=$u(t),this.size=this.rest?xe(me(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Wt(e,t)}function Oi(e,t,i){for(var r=[],n,o=t;o<i;o=n){var s=new Ra(e.doc,re(e.doc,o),o);n=o+s.size,r.push(s)}return r}var Dr=null;function uf(e){Dr?Dr.ops.push(e):e.ownsGroup=Dr={ops:[e],delayedCallbacks:[]}}function ff(e){var t=e.delayedCallbacks,i=0;do{for(;i<t.length;i++)t[i].call(null);for(var r=0;r<e.ops.length;r++){var n=e.ops[r];if(n.cursorActivityHandlers)for(;n.cursorActivityCalled<n.cursorActivityHandlers.length;)n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}while(i<t.length)}function cf(e,t){var i=e.ownsGroup;if(i)try{ff(i)}finally{Dr=null,t(i)}}var Jr=null;function qe(e,t){var i=Rn(e,t);if(i.length){var r=Array.prototype.slice.call(arguments,2),n;Dr?n=Dr.delayedCallbacks:Jr?n=Jr:(n=Jr=[],setTimeout(df,0));for(var o=function(h){n.push(function(){return i[h].apply(null,r)})},s=0;s<i.length;++s)o(s)}}function df(){var e=Jr;Jr=null;for(var t=0;t<e.length;++t)e[t]()}function Pa(e,t,i,r){for(var n=0;n<t.changes.length;n++){var o=t.changes[n];o=="text"?pf(e,t):o=="gutter"?Wa(e,t,i,r):o=="class"?oo(e,t):o=="widget"&&gf(e,t,r)}t.changes=null}function $r(e){return e.node==e.text&&(e.node=A("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),f&&p<8&&(e.node.style.zIndex=2)),e.node}function hf(e,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i&&(i+=" CodeMirror-linebackground"),t.background)i?t.background.className=i:(t.background.parentNode.removeChild(t.background),t.background=null);else if(i){var r=$r(t);t.background=r.insertBefore(A("div",null,i),r.firstChild),e.display.input.setUneditable(t.background)}}function _a(e,t){var i=e.display.externalMeasured;return i&&i.line==t.line?(e.display.externalMeasured=null,t.measure=i.measure,i.built):Oa(e,t)}function pf(e,t){var i=t.text.className,r=_a(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,oo(e,t)):i&&(t.text.className=i)}function oo(e,t){hf(e,t),t.line.wrapClass?$r(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function Wa(e,t,i,r){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 n=$r(t);t.gutterBackground=A("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),n.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var s=$r(t),h=t.gutter=A("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(h.setAttribute("aria-hidden","true"),e.display.input.setUneditable(h),s.insertBefore(h,t.text),t.line.gutterClass&&(h.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])&&(t.lineNumber=h.appendChild(A("div",Zn(e.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var v=0;v<e.display.gutterSpecs.length;++v){var m=e.display.gutterSpecs[v].className,x=o.hasOwnProperty(m)&&o[m];x&&h.appendChild(A("div",[x],"CodeMirror-gutter-elt","left: "+r.gutterLeft[m]+"px; width: "+r.gutterWidth[m]+"px"))}}}function gf(e,t,i){t.alignable&&(t.alignable=null);for(var r=G("CodeMirror-linewidget"),n=t.node.firstChild,o=void 0;n;n=o)o=n.nextSibling,r.test(n.className)&&t.node.removeChild(n);qa(e,t,i)}function vf(e,t,i,r){var n=_a(e,t);return t.text=t.node=n.pre,n.bgClass&&(t.bgClass=n.bgClass),n.textClass&&(t.textClass=n.textClass),oo(e,t),Wa(e,t,i,r),qa(e,t,r),t.node}function qa(e,t,i){if(Ua(e,t.line,t,i,!0),t.rest)for(var r=0;r<t.rest.length;r++)Ua(e,t.rest[r],t,i,!1)}function Ua(e,t,i,r,n){if(t.widgets)for(var o=$r(i),s=0,h=t.widgets;s<h.length;++s){var v=h[s],m=A("div",[v.node],"CodeMirror-linewidget"+(v.className?" "+v.className:""));v.handleMouseEvents||m.setAttribute("cm-ignore-events","true"),mf(v,m,i,r),e.display.input.setUneditable(m),n&&v.above?o.insertBefore(m,i.gutter||i.text):o.appendChild(m),qe(v,"redraw")}}function mf(e,t,i,r){if(e.noHScroll){(i.alignable||(i.alignable=[])).push(t);var n=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(n-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=n+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Vr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!V(document.body,e.node)){var i="position: relative;";e.coverGutter&&(i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(i+="width: "+t.display.wrapper.clientWidth+"px;"),de(t.display.measure,A("div",[e.node],null,i))}return e.height=e.node.parentNode.offsetHeight}function It(e,t){for(var i=_n(t);i!=e.wrapper;i=i.parentNode)if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==e.sizer&&i!=e.mover)return!0}function Hi(e){return e.lineSpace.offsetTop}function ao(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function ja(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=de(e.measure,A("pre","x","CodeMirror-line-like")),i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function At(e){return Me-e.display.nativeBarWidth}function rr(e){return e.display.scroller.clientWidth-At(e)-e.display.barWidth}function lo(e){return e.display.scroller.clientHeight-At(e)-e.display.barHeight}function yf(e,t,i){var r=e.options.lineWrapping,n=r&&rr(e);if(!t.measure.heights||r&&t.measure.width!=n){var o=t.measure.heights=[];if(r){t.measure.width=n;for(var s=t.text.firstChild.getClientRects(),h=0;h<s.length-1;h++){var v=s[h],m=s[h+1];Math.abs(v.bottom-m.bottom)>2&&o.push((v.bottom+m.top)/2-i.top)}}o.push(i.bottom-i.top)}}function Ga(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var n=0;n<e.rest.length;n++)if(xe(e.rest[n])>i)return{map:e.measure.maps[n],cache:e.measure.caches[n],before:!0}}}function bf(e,t){t=xt(t);var i=xe(t),r=e.display.externalMeasured=new Ra(e.doc,t,i);r.lineN=i;var n=r.built=Oa(e,r);return r.text=n.pre,de(e.display.lineMeasure,n.pre),r}function Ka(e,t,i,r){return Lt(e,Cr(e,t),i,r)}function so(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[or(e,t)];var i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size)return i}function Cr(e,t){var i=xe(t),r=so(e,i);r&&!r.text?r=null:r&&r.changes&&(Pa(e,r,i,po(e)),e.curOp.forceUpdate=!0),r||(r=bf(e,t));var n=Ga(r,t,i);return{line:t,view:r,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:!1}}function Lt(e,t,i,r,n){t.before&&(i=-1);var o=i+(r||""),s;return t.cache.hasOwnProperty(o)?s=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(yf(e,t.view,t.rect),t.hasHeights=!0),s=Df(e,t,i,r),s.bogus||(t.cache[o]=s)),{left:s.left,right:s.right,top:n?s.rtop:s.top,bottom:n?s.rbottom:s.bottom}}var Xa={left:0,right:0,top:0,bottom:0};function Ya(e,t,i){for(var r,n,o,s,h,v,m=0;m<e.length;m+=3)if(h=e[m],v=e[m+1],t<h?(n=0,o=1,s="left"):t<v?(n=t-h,o=n+1):(m==e.length-3||t==v&&e[m+3]>t)&&(o=v-h,n=o-1,t>=v&&(s="right")),n!=null){if(r=e[m+2],h==v&&i==(r.insertLeft?"left":"right")&&(s=i),i=="left"&&n==0)for(;m&&e[m-2]==e[m-3]&&e[m-1].insertLeft;)r=e[(m-=3)+2],s="left";if(i=="right"&&n==v-h)for(;m<e.length-3&&e[m+3]==e[m+4]&&!e[m+5].insertLeft;)r=e[(m+=3)+2],s="right";break}return{node:r,start:n,end:o,collapse:s,coverStart:h,coverEnd:v}}function xf(e,t){var i=Xa;if(t=="left")for(var r=0;r<e.length&&(i=e[r]).left==i.right;r++);else for(var n=e.length-1;n>=0&&(i=e[n]).left==i.right;n--);return i}function Df(e,t,i,r){var n=Ya(t.map,i,r),o=n.node,s=n.start,h=n.end,v=n.collapse,m;if(o.nodeType==3){for(var x=0;x<4;x++){for(;s&&Hn(t.line.text.charAt(n.coverStart+s));)--s;for(;n.coverStart+h<n.coverEnd&&Hn(t.line.text.charAt(n.coverStart+h));)++h;if(f&&p<9&&s==0&&h==n.coverEnd-n.coverStart?m=o.parentNode.getBoundingClientRect():m=xf(W(o,s,h).getClientRects(),r),m.left||m.right||s==0)break;h=s,s=s-1,v="right"}f&&p<11&&(m=Cf(e.display.measure,m))}else{s>0&&(v=r="right");var w;e.options.lineWrapping&&(w=o.getClientRects()).length>1?m=w[r=="right"?w.length-1:0]:m=o.getBoundingClientRect()}if(f&&p<9&&!s&&(!m||!m.left&&!m.right)){var L=o.parentNode.getClientRects()[0];L?m={left:L.left,right:L.left+kr(e.display),top:L.top,bottom:L.bottom}:m=Xa}for(var S=m.top-t.rect.top,O=m.bottom-t.rect.top,P=(S+O)/2,j=t.view.measure.heights,Y=0;Y<j.length-1&&!(P<j[Y]);Y++);var Q=Y?j[Y-1]:0,Z=j[Y],$={left:(v=="right"?m.right:m.left)-t.rect.left,right:(v=="left"?m.left:m.right)-t.rect.left,top:Q,bottom:Z};return!m.left&&!m.right&&($.bogus=!0),e.options.singleCursorHeightPerLine||($.rtop=S,$.rbottom=O),$}function Cf(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Ou(e))return t;var i=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*r,bottom:t.bottom*r}}function Za(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 Qa(e){e.display.externalMeasure=null,ae(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Za(e.display.view[t])}function ei(e){Qa(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Ja(e){return D&&B?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function $a(e){return D&&B?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function uo(e){var t=xt(e),i=t.widgets,r=0;if(i)for(var n=0;n<i.length;++n)i[n].above&&(r+=Vr(i[n]));return r}function Ri(e,t,i,r,n){if(!n){var o=uo(t);i.top+=o,i.bottom+=o}if(r=="line")return i;r||(r="local");var s=Nt(t);if(r=="local"?s+=Hi(e.display):s-=e.display.viewOffset,r=="page"||r=="window"){var h=e.display.lineSpace.getBoundingClientRect();s+=h.top+(r=="window"?0:$a(y(e)));var v=h.left+(r=="window"?0:Ja(y(e)));i.left+=v,i.right+=v}return i.top+=s,i.bottom+=s,i}function Va(e,t,i){if(i=="div")return t;var r=t.left,n=t.top;if(i=="page")r-=Ja(y(e)),n-=$a(y(e));else if(i=="local"||!i){var o=e.display.sizer.getBoundingClientRect();r+=o.left,n+=o.top}var s=e.display.lineSpace.getBoundingClientRect();return{left:r-s.left,top:n-s.top}}function Pi(e,t,i,r,n){return r||(r=re(e.doc,t.line)),Ri(e,r,Ka(e,r,t.ch,n),i)}function Dt(e,t,i,r,n,o){r=r||re(e.doc,t.line),n||(n=Cr(e,r));function s(O,P){var j=Lt(e,n,O,P?"right":"left",o);return P?j.left=j.right:j.right=j.left,Ri(e,r,j,i)}var h=Mt(r,e.doc.direction),v=t.ch,m=t.sticky;if(v>=r.text.length?(v=r.text.length,m="before"):v<=0&&(v=0,m="after"),!h)return s(m=="before"?v-1:v,m=="before");function x(O,P,j){var Y=h[P],Q=Y.level==1;return s(j?O-1:O,Q!=j)}var w=Kr(h,v,m),L=Gr,S=x(v,w,m=="before");return L!=null&&(S.other=x(v,L,m!="before")),S}function el(e,t){var i=0;t=ce(e.doc,t),e.options.lineWrapping||(i=kr(e.display)*t.ch);var r=re(e.doc,t.line),n=Nt(r)+Hi(e.display);return{left:i,right:i,top:n,bottom:n+r.height}}function fo(e,t,i,r,n){var o=q(e,t,i);return o.xRel=n,r&&(o.outside=r),o}function co(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return fo(r.first,0,null,-1,-1);var n=tr(r,i),o=r.first+r.size-1;if(n>o)return fo(r.first+r.size-1,re(r,o).text.length,null,1,1);t<0&&(t=0);for(var s=re(r,n);;){var h=wf(e,s,n,t,i),v=Qu(s,h.ch+(h.xRel>0||h.outside>0?1:0));if(!v)return h;var m=v.find(1);if(m.line==n)return m;s=re(r,n=m.line)}}function tl(e,t,i,r){r-=uo(t);var n=t.text.length,o=jr(function(s){return Lt(e,i,s-1).bottom<=r},n,0);return n=jr(function(s){return Lt(e,i,s).top>r},o,n),{begin:o,end:n}}function rl(e,t,i,r){i||(i=Cr(e,t));var n=Ri(e,t,Lt(e,i,r),"line").top;return tl(e,t,i,n)}function ho(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function wf(e,t,i,r,n){n-=Nt(t);var o=Cr(e,t),s=uo(t),h=0,v=t.text.length,m=!0,x=Mt(t,e.doc.direction);if(x){var w=(e.options.lineWrapping?Sf:kf)(e,t,i,o,x,r,n);m=w.level!=1,h=m?w.from:w.to-1,v=m?w.to:w.from-1}var L=null,S=null,O=jr(function(ne){var ie=Lt(e,o,ne);return ie.top+=s,ie.bottom+=s,ho(ie,r,n,!1)?(ie.top<=n&&ie.left<=r&&(L=ne,S=ie),!0):!1},h,v),P,j,Y=!1;if(S){var Q=r-S.left<S.right-r,Z=Q==m;O=L+(Z?0:1),j=Z?"after":"before",P=Q?S.left:S.right}else{!m&&(O==v||O==h)&&O++,j=O==0?"after":O==t.text.length?"before":Lt(e,o,O-(m?1:0)).bottom+s<=n==m?"after":"before";var $=Dt(e,q(i,O,j),"line",t,o);P=$.left,Y=n<$.top?-1:n>=$.bottom?1:0}return O=da(t.text,O,1),fo(i,O,j,Y,r-P)}function kf(e,t,i,r,n,o,s){var h=jr(function(w){var L=n[w],S=L.level!=1;return ho(Dt(e,q(i,S?L.to:L.from,S?"before":"after"),"line",t,r),o,s,!0)},0,n.length-1),v=n[h];if(h>0){var m=v.level!=1,x=Dt(e,q(i,m?v.from:v.to,m?"after":"before"),"line",t,r);ho(x,o,s,!0)&&x.top>s&&(v=n[h-1])}return v}function Sf(e,t,i,r,n,o,s){var h=tl(e,t,r,s),v=h.begin,m=h.end;/\s/.test(t.text.charAt(m-1))&&m--;for(var x=null,w=null,L=0;L<n.length;L++){var S=n[L];if(!(S.from>=m||S.to<=v)){var O=S.level!=1,P=Lt(e,r,O?Math.min(m,S.to)-1:Math.max(v,S.from)).right,j=P<o?o-P+1e9:P-o;(!x||w>j)&&(x=S,w=j)}}return x||(x=n[n.length-1]),x.from<v&&(x={from:v,to:x.to,level:x.level}),x.to>m&&(x={from:x.from,to:m,level:x.level}),x}var ir;function wr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(ir==null){ir=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)ir.appendChild(document.createTextNode("x")),ir.appendChild(A("br"));ir.appendChild(document.createTextNode("x"))}de(e.measure,ir);var i=ir.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),ae(e.measure),i||1}function kr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),i=A("pre",[t],"CodeMirror-line-like");de(e.measure,i);var r=t.getBoundingClientRect(),n=(r.right-r.left)/10;return n>2&&(e.cachedCharWidth=n),n||10}function po(e){for(var t=e.display,i={},r={},n=t.gutters.clientLeft,o=t.gutters.firstChild,s=0;o;o=o.nextSibling,++s){var h=e.display.gutterSpecs[s].className;i[h]=o.offsetLeft+o.clientLeft+n,r[h]=o.clientWidth}return{fixedPos:go(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function go(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function il(e){var t=wr(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/kr(e.display)-3);return function(n){if(Wt(e.doc,n))return 0;var o=0;if(n.widgets)for(var s=0;s<n.widgets.length;s++)n.widgets[s].height&&(o+=n.widgets[s].height);return i?o+(Math.ceil(n.text.length/r)||1)*t:o+t}}function vo(e){var t=e.doc,i=il(e);t.iter(function(r){var n=i(r);n!=r.height&&Ft(r,n)})}function nr(e,t,i,r){var n=e.display;if(!i&&_n(t).getAttribute("cm-not-content")=="true")return null;var o,s,h=n.lineSpace.getBoundingClientRect();try{o=t.clientX-h.left,s=t.clientY-h.top}catch{return null}var v=co(e,o,s),m;if(r&&v.xRel>0&&(m=re(e.doc,v.line).text).length==v.ch){var x=Re(m,m.length,e.options.tabSize)-m.length;v=q(v.line,Math.max(0,Math.round((o-ja(e.display).left)/kr(e.display))-x))}return v}function or(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var i=e.display.view,r=0;r<i.length;r++)if(t-=i[r].size,t<0)return r}function nt(e,t,i,r){t==null&&(t=e.doc.first),i==null&&(i=e.doc.first+e.doc.size),r||(r=0);var n=e.display;if(r&&i<n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>t)&&(n.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=n.viewTo)Bt&&ro(e.doc,t)<n.viewTo&&Ut(e);else if(i<=n.viewFrom)Bt&&Ia(e.doc,i+r)>n.viewFrom?Ut(e):(n.viewFrom+=r,n.viewTo+=r);else if(t<=n.viewFrom&&i>=n.viewTo)Ut(e);else if(t<=n.viewFrom){var o=_i(e,i,i+r,1);o?(n.view=n.view.slice(o.index),n.viewFrom=o.lineN,n.viewTo+=r):Ut(e)}else if(i>=n.viewTo){var s=_i(e,t,t,-1);s?(n.view=n.view.slice(0,s.index),n.viewTo=s.lineN):Ut(e)}else{var h=_i(e,t,t,-1),v=_i(e,i,i+r,1);h&&v?(n.view=n.view.slice(0,h.index).concat(Oi(e,h.lineN,v.lineN)).concat(n.view.slice(v.index)),n.viewTo+=r):Ut(e)}var m=n.externalMeasured;m&&(i<m.lineN?m.lineN+=r:t<m.lineN+m.size&&(n.externalMeasured=null))}function qt(e,t,i){e.curOp.viewChanged=!0;var r=e.display,n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[or(e,t)];if(o.node!=null){var s=o.changes||(o.changes=[]);Fe(s,i)==-1&&s.push(i)}}}function Ut(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function _i(e,t,i,r){var n=or(e,t),o,s=e.display.view;if(!Bt||i==e.doc.first+e.doc.size)return{index:n,lineN:i};for(var h=e.display.viewFrom,v=0;v<n;v++)h+=s[v].size;if(h!=t){if(r>0){if(n==s.length-1)return null;o=h+s[n].size-t,n++}else o=h-t;t+=o,i+=o}for(;ro(e.doc,i)!=i;){if(n==(r<0?0:s.length-1))return null;i+=r*s[n-(r<0?1:0)].size,n+=r}return{index:n,lineN:i}}function Ff(e,t,i){var r=e.display,n=r.view;n.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=Oi(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=Oi(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(or(e,t))),r.viewFrom=t,r.viewTo<i?r.view=r.view.concat(Oi(e,r.viewTo,i)):r.viewTo>i&&(r.view=r.view.slice(0,or(e,i)))),r.viewTo=i}function nl(e){for(var t=e.display.view,i=0,r=0;r<t.length;r++){var n=t[r];!n.hidden&&(!n.node||n.changes)&&++i}return i}function ti(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ol(e,t){t===void 0&&(t=!0);var i=e.doc,r={},n=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),s=e.options.$customCursor;s&&(t=!0);for(var h=0;h<i.sel.ranges.length;h++)if(!(!t&&h==i.sel.primIndex)){var v=i.sel.ranges[h];if(!(v.from().line>=e.display.viewTo||v.to().line<e.display.viewFrom)){var m=v.empty();if(s){var x=s(e,v);x&&mo(e,x,n)}else(m||e.options.showCursorWhenSelecting)&&mo(e,v.head,n);m||Ef(e,v,o)}}return r}function mo(e,t,i){var r=Dt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),n=i.appendChild(A("div","\xA0","CodeMirror-cursor"));if(n.style.left=r.left+"px",n.style.top=r.top+"px",n.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var o=Pi(e,t,"div",null,null),s=o.right-o.left;n.style.width=(s>0?s:e.defaultCharWidth())+"px"}if(r.other){var h=i.appendChild(A("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));h.style.display="",h.style.left=r.other.left+"px",h.style.top=r.other.top+"px",h.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Wi(e,t){return e.top-t.top||e.left-t.left}function Ef(e,t,i){var r=e.display,n=e.doc,o=document.createDocumentFragment(),s=ja(e.display),h=s.left,v=Math.max(r.sizerWidth,rr(e)-r.sizer.offsetLeft)-s.right,m=n.direction=="ltr";function x(Z,$,ne,ie){$<0&&($=0),$=Math.round($),ie=Math.round(ie),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+Z+`px;
|
|
top: `+$+"px; width: "+(ne??v-Z)+`px;
|
|
height: `+(ie-$)+"px"))}function w(Z,$,ne){var ie=re(n,Z),pe=ie.text.length,Ce,Ge;function Le(Oe,lt){return Pi(e,q(Z,Oe),"div",ie,lt)}function ft(Oe,lt,Xe){var _e=rl(e,ie,null,Oe),He=lt=="ltr"==(Xe=="after")?"left":"right",Be=Xe=="after"?_e.begin:_e.end-(/\s/.test(ie.text.charAt(_e.end-1))?2:1);return Le(Be,He)[He]}var at=Mt(ie,n.direction);return Lu(at,$||0,ne??pe,function(Oe,lt,Xe,_e){var He=Xe=="ltr",Be=Le(Oe,He?"left":"right"),st=Le(lt-1,He?"right":"left"),Hr=$==null&&Oe==0,Zt=ne==null&<==pe,Qe=_e==0,Tt=!at||_e==at.length-1;if(st.top-Be.top<=3){var Ke=(m?Hr:Zt)&&Qe,jo=(m?Zt:Hr)&&Tt,Ht=Ke?h:(He?Be:st).left,fr=jo?v:(He?st:Be).right;x(Ht,Be.top,fr-Ht,Be.bottom)}else{var cr,Ve,Rr,Go;He?(cr=m&&Hr&&Qe?h:Be.left,Ve=m?v:ft(Oe,Xe,"before"),Rr=m?h:ft(lt,Xe,"after"),Go=m&&Zt&&Tt?v:st.right):(cr=m?ft(Oe,Xe,"before"):h,Ve=!m&&Hr&&Qe?v:Be.right,Rr=!m&&Zt&&Tt?h:st.left,Go=m?ft(lt,Xe,"after"):v),x(cr,Be.top,Ve-cr,Be.bottom),Be.bottom<st.top&&x(h,Be.bottom,null,st.top),x(Rr,st.top,Go-Rr,st.bottom)}(!Ce||Wi(Be,Ce)<0)&&(Ce=Be),Wi(st,Ce)<0&&(Ce=st),(!Ge||Wi(Be,Ge)<0)&&(Ge=Be),Wi(st,Ge)<0&&(Ge=st)}),{start:Ce,end:Ge}}var L=t.from(),S=t.to();if(L.line==S.line)w(L.line,L.ch,S.ch);else{var O=re(n,L.line),P=re(n,S.line),j=xt(O)==xt(P),Y=w(L.line,L.ch,j?O.text.length+1:null).end,Q=w(S.line,j?0:null,S.ch).start;j&&(Y.top<Q.top-2?(x(Y.right,Y.top,null,Y.bottom),x(h,Q.top,Q.left,Q.bottom)):x(Y.right,Y.top,Q.left-Y.right,Y.bottom)),Y.bottom<Q.top&&x(h,Y.bottom,null,Q.top)}i.appendChild(o)}function yo(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var i=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Sr(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function al(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||xo(e))}function bo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Sr(e))},100)}function xo(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Ie(e,"focus",e,t),e.state.focused=!0,Te(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),b&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),yo(e))}function Sr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ie(e,"blur",e,t),e.state.focused=!1,ue(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function qi(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),n=t.lineDiv.getBoundingClientRect().top,o=0,s=0;s<t.view.length;s++){var h=t.view[s],v=e.options.lineWrapping,m=void 0,x=0;if(!h.hidden){if(n+=h.line.height,f&&p<8){var w=h.node.offsetTop+h.node.offsetHeight;m=w-i,i=w}else{var L=h.node.getBoundingClientRect();m=L.bottom-L.top,!v&&h.text.firstChild&&(x=h.text.firstChild.getBoundingClientRect().right-L.left-1)}var S=h.line.height-m;if((S>.005||S<-.005)&&(n<r&&(o-=S),Ft(h.line,m),ll(h.line),h.rest))for(var O=0;O<h.rest.length;O++)ll(h.rest[O]);if(x>e.display.sizerWidth){var P=Math.ceil(x/kr(e.display));P>e.display.maxLineLength&&(e.display.maxLineLength=P,e.display.maxLine=h.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function ll(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var i=e.widgets[t],r=i.node.parentNode;r&&(i.height=r.offsetHeight)}}function Ui(e,t,i){var r=i&&i.top!=null?Math.max(0,i.top):e.scroller.scrollTop;r=Math.floor(r-Hi(e));var n=i&&i.bottom!=null?i.bottom:r+e.wrapper.clientHeight,o=tr(t,r),s=tr(t,n);if(i&&i.ensure){var h=i.ensure.from.line,v=i.ensure.to.line;h<o?(o=h,s=tr(t,Nt(re(t,h))+e.wrapper.clientHeight)):Math.min(v,t.lastLine())>=s&&(o=tr(t,Nt(re(t,v))-e.wrapper.clientHeight),s=v)}return{from:o,to:Math.max(s,o+1)}}function Af(e,t){if(!We(e,"scrollCursorIntoView")){var i=e.display,r=i.sizer.getBoundingClientRect(),n=null,o=i.wrapper.ownerDocument;if(t.top+r.top<0?n=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(n=!1),n!=null&&!I){var s=A("div","\u200B",null,`position: absolute;
|
|
top: `+(t.top-i.viewOffset-Hi(e.display))+`px;
|
|
height: `+(t.bottom-t.top+At(e)+i.barHeight)+`px;
|
|
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(s),s.scrollIntoView(n),e.display.lineSpace.removeChild(s)}}}function Lf(e,t,i,r){r==null&&(r=0);var n;!e.options.lineWrapping&&t==i&&(i=t.sticky=="before"?q(t.line,t.ch+1,"before"):t,t=t.ch?q(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var s=!1,h=Dt(e,t),v=!i||i==t?h:Dt(e,i);n={left:Math.min(h.left,v.left),top:Math.min(h.top,v.top)-r,right:Math.max(h.left,v.left),bottom:Math.max(h.bottom,v.bottom)+r};var m=Do(e,n),x=e.doc.scrollTop,w=e.doc.scrollLeft;if(m.scrollTop!=null&&(ii(e,m.scrollTop),Math.abs(e.doc.scrollTop-x)>1&&(s=!0)),m.scrollLeft!=null&&(ar(e,m.scrollLeft),Math.abs(e.doc.scrollLeft-w)>1&&(s=!0)),!s)break}return n}function Tf(e,t){var i=Do(e,t);i.scrollTop!=null&&ii(e,i.scrollTop),i.scrollLeft!=null&&ar(e,i.scrollLeft)}function Do(e,t){var i=e.display,r=wr(e.display);t.top<0&&(t.top=0);var n=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,o=lo(e),s={};t.bottom-t.top>o&&(t.bottom=t.top+o);var h=e.doc.height+ao(i),v=t.top<r,m=t.bottom>h-r;if(t.top<n)s.scrollTop=v?0:t.top;else if(t.bottom>n+o){var x=Math.min(t.top,(m?h:t.bottom)-o);x!=n&&(s.scrollTop=x)}var w=e.options.fixedGutter?0:i.gutters.offsetWidth,L=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-w,S=rr(e)-i.gutters.offsetWidth,O=t.right-t.left>S;return O&&(t.right=t.left+S),t.left<10?s.scrollLeft=0:t.left<L?s.scrollLeft=Math.max(0,t.left+w-(O?0:10)):t.right>S+L-3&&(s.scrollLeft=t.right+(O?0:10)-S),s}function Co(e,t){t!=null&&(ji(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Fr(e){ji(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function ri(e,t,i){(t!=null||i!=null)&&ji(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Mf(e,t){ji(e),e.curOp.scrollToPos=t}function ji(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=el(e,t.from),r=el(e,t.to);sl(e,i,r,t.margin)}}function sl(e,t,i,r){var n=Do(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});ri(e,n.scrollLeft,n.scrollTop)}function ii(e,t){Math.abs(e.doc.scrollTop-t)<2||(d||ko(e,{top:t}),ul(e,t,!0),d&&ko(e),ai(e,100))}function ul(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function ar(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,pl(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function ni(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+ao(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?i:0,docHeight:r,scrollHeight:r+At(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var lr=function(e,t,i){this.cm=i;var r=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),n=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=n.tabIndex=-1,e(r),e(n),oe(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),oe(n,"scroll",function(){n.clientWidth&&t(n.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,f&&p<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};lr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var n=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+n)+"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=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},lr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},lr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},lr.prototype.zeroWidthHack=function(){var e=R&&!z?"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},lr.prototype.enableZeroWidthBar=function(e,t,i){e.style.visibility="";function r(){var n=e.getBoundingClientRect(),o=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);o!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},lr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var oi=function(){};oi.prototype.update=function(){return{bottom:0,right:0}},oi.prototype.setScrollLeft=function(){},oi.prototype.setScrollTop=function(){},oi.prototype.clear=function(){};function Er(e,t){t||(t=ni(e));var i=e.display.barWidth,r=e.display.barHeight;fl(e,t);for(var n=0;n<4&&i!=e.display.barWidth||r!=e.display.barHeight;n++)i!=e.display.barWidth&&e.options.lineWrapping&&qi(e),fl(e,ni(e)),i=e.display.barWidth,r=e.display.barHeight}function fl(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var cl={native:lr,null:oi};function dl(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ue(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new cl[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),oe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?ar(e,t):ii(e,t)},e),e.display.scrollbars.addClass&&Te(e.display.wrapper,e.display.scrollbars.addClass)}var Bf=0;function sr(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:++Bf,markArrays:null},uf(e.curOp)}function ur(e){var t=e.curOp;t&&cf(t,function(i){for(var r=0;r<i.ops.length;r++)i.ops[r].cm.curOp=null;Nf(i)})}function Nf(e){for(var t=e.ops,i=0;i<t.length;i++)If(t[i]);for(var r=0;r<t.length;r++)zf(t[r]);for(var n=0;n<t.length;n++)Of(t[n]);for(var o=0;o<t.length;o++)Hf(t[o]);for(var s=0;s<t.length;s++)Rf(t[s])}function If(e){var t=e.cm,i=t.display;_f(t),e.updateMaxLine&&no(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<i.viewFrom||e.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Gi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function zf(e){e.updatedDisplay=e.mustUpdate&&wo(e.cm,e.update)}function Of(e){var t=e.cm,i=t.display;e.updatedDisplay&&qi(t),e.barMeasure=ni(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Ka(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+At(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-rr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function Hf(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&ar(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var i=e.focus&&e.focus==ve(ee(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,i),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Er(t,e.barMeasure),e.updatedDisplay&&Fo(t,e.barMeasure),e.selectionChanged&&yo(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),i&&al(e.cm)}function Rf(e){var t=e.cm,i=t.display,r=t.doc;if(e.updatedDisplay&&hl(t,e.update),i.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(i.wheelStartX=i.wheelStartY=null),e.scrollTop!=null&&ul(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&ar(t,e.scrollLeft,!0,!0),e.scrollToPos){var n=Lf(t,ce(r,e.scrollToPos.from),ce(r,e.scrollToPos.to),e.scrollToPos.margin);Af(t,n)}var o=e.maybeHiddenMarkers,s=e.maybeUnhiddenMarkers;if(o)for(var h=0;h<o.length;++h)o[h].lines.length||Ie(o[h],"hide");if(s)for(var v=0;v<s.length;++v)s[v].lines.length&&Ie(s[v],"unhide");i.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ie(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function ut(e,t){if(e.curOp)return t();sr(e);try{return t()}finally{ur(e)}}function Ue(e,t){return function(){if(e.curOp)return t.apply(e,arguments);sr(e);try{return t.apply(e,arguments)}finally{ur(e)}}}function $e(e){return function(){if(this.curOp)return e.apply(this,arguments);sr(this);try{return e.apply(this,arguments)}finally{ur(this)}}}function je(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);sr(t);try{return e.apply(this,arguments)}finally{ur(t)}}}function ai(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,tt(Pf,e))}function Pf(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var i=+new Date+e.options.workTime,r=Zr(e,t.highlightFrontier),n=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var s=o.styles,h=o.text.length>e.options.maxHighlightLength?Vt(t.mode,r.state):null,v=xa(e,o,r,!0);h&&(r.state=h),o.styles=v.styles;var m=o.styleClasses,x=v.classes;x?o.styleClasses=x:m&&(o.styleClasses=null);for(var w=!s||s.length!=o.styles.length||m!=x&&(!m||!x||m.bgClass!=x.bgClass||m.textClass!=x.textClass),L=0;!w&&L<s.length;++L)w=s[L]!=o.styles[L];w&&n.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&$n(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>i)return ai(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),n.length&&ut(e,function(){for(var o=0;o<n.length;o++)qt(e,n[o],"text")})}}var Gi=function(e,t,i){var r=e.display;this.viewport=t,this.visible=Ui(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=rr(e),this.force=i,this.dims=po(e),this.events=[]};Gi.prototype.signal=function(e,t){mt(e,t)&&this.events.push(arguments)},Gi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ie.apply(null,this.events[e])};function _f(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=At(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=At(e)+"px",t.scrollbarsClipped=!0)}function Wf(e){if(e.hasFocus())return null;var t=ve(ee(e));if(!t||!V(e.display.lineDiv,t))return null;var i={activeElt:t};if(window.getSelection){var r=he(e).getSelection();r.anchorNode&&r.extend&&V(e.display.lineDiv,r.anchorNode)&&(i.anchorNode=r.anchorNode,i.anchorOffset=r.anchorOffset,i.focusNode=r.focusNode,i.focusOffset=r.focusOffset)}return i}function qf(e){if(!(!e||!e.activeElt||e.activeElt==ve(ye(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&V(document.body,e.anchorNode)&&V(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,i=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),i.removeAllRanges(),i.addRange(r),i.extend(e.focusNode,e.focusOffset)}}function wo(e,t){var i=e.display,r=e.doc;if(t.editorIsHidden)return Ut(e),!1;if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&nl(e)==0)return!1;gl(e)&&(Ut(e),t.dims=po(e));var n=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),s=Math.min(n,t.visible.to+e.options.viewportMargin);i.viewFrom<o&&o-i.viewFrom<20&&(o=Math.max(r.first,i.viewFrom)),i.viewTo>s&&i.viewTo-s<20&&(s=Math.min(n,i.viewTo)),Bt&&(o=ro(e.doc,o),s=Ia(e.doc,s));var h=o!=i.viewFrom||s!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Ff(e,o,s),i.viewOffset=Nt(re(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var v=nl(e);if(!h&&v==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var m=Wf(e);return v>4&&(i.lineDiv.style.display="none"),Uf(e,i.updateLineNumbers,t.dims),v>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,qf(m),ae(i.cursorDiv),ae(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,h&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,ai(e,400)),i.updateLineNumbers=null,!0}function hl(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==rr(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+ao(e.display)-lo(e),i.top)}),t.visible=Ui(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Ui(e.display,e.doc,i));if(!wo(e,t))break;qi(e);var n=ni(e);ti(e),Er(e,n),Fo(e,n),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 ko(e,t){var i=new Gi(e,t);if(wo(e,i)){qi(e),hl(e,i);var r=ni(e);ti(e),Er(e,r),Fo(e,r),i.finish()}}function Uf(e,t,i){var r=e.display,n=e.options.lineNumbers,o=r.lineDiv,s=o.firstChild;function h(O){var P=O.nextSibling;return b&&R&&e.display.currentWheelTarget==O?O.style.display="none":O.parentNode.removeChild(O),P}for(var v=r.view,m=r.viewFrom,x=0;x<v.length;x++){var w=v[x];if(!w.hidden)if(!w.node||w.node.parentNode!=o){var L=vf(e,w,m,i);o.insertBefore(L,s)}else{for(;s!=w.node;)s=h(s);var S=n&&t!=null&&t<=m&&w.lineNumber;w.changes&&(Fe(w.changes,"gutter")>-1&&(S=!1),Pa(e,w,m,i)),S&&(ae(w.lineNumber),w.lineNumber.appendChild(document.createTextNode(Zn(e.options,m)))),s=w.node.nextSibling}m+=w.size}for(;s;)s=h(s)}function So(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",qe(e,"gutterChanged",e)}function Fo(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+At(e)+"px"}function pl(e){var t=e.display,i=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=go(t)-t.scroller.scrollLeft+e.doc.scrollLeft,n=t.gutters.offsetWidth,o=r+"px",s=0;s<i.length;s++)if(!i[s].hidden){e.options.fixedGutter&&(i[s].gutter&&(i[s].gutter.style.left=o),i[s].gutterBackground&&(i[s].gutterBackground.style.left=o));var h=i[s].alignable;if(h)for(var v=0;v<h.length;v++)h[v].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+n+"px")}}function gl(e){if(!e.options.lineNumbers)return!1;var t=e.doc,i=Zn(e.options,t.first+t.size-1),r=e.display;if(i.length!=r.lineNumChars){var n=r.measure.appendChild(A("div",[A("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=n.firstChild.offsetWidth,s=n.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-s)+1,r.lineNumWidth=r.lineNumInnerWidth+s,r.lineNumChars=r.lineNumInnerWidth?i.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",So(e.display),!0}return!1}function Eo(e,t){for(var i=[],r=!1,n=0;n<e.length;n++){var o=e[n],s=null;if(typeof o!="string"&&(s=o.style,o=o.className),o=="CodeMirror-linenumbers")if(t)r=!0;else continue;i.push({className:o,style:s})}return t&&!r&&i.push({className:"CodeMirror-linenumbers",style:null}),i}function vl(e){var t=e.gutters,i=e.gutterSpecs;ae(t),e.lineGutter=null;for(var r=0;r<i.length;++r){var n=i[r],o=n.className,s=n.style,h=t.appendChild(A("div",null,"CodeMirror-gutter "+o));s&&(h.style.cssText=s),o=="CodeMirror-linenumbers"&&(e.lineGutter=h,h.style.width=(e.lineNumWidth||1)+"px")}t.style.display=i.length?"":"none",So(e)}function li(e){vl(e.display),nt(e),pl(e)}function jf(e,t,i,r){var n=this;this.input=i,n.scrollbarFiller=A("div",null,"CodeMirror-scrollbar-filler"),n.scrollbarFiller.setAttribute("cm-not-content","true"),n.gutterFiller=A("div",null,"CodeMirror-gutter-filler"),n.gutterFiller.setAttribute("cm-not-content","true"),n.lineDiv=U("div",null,"CodeMirror-code"),n.selectionDiv=A("div",null,null,"position: relative; z-index: 1"),n.cursorDiv=A("div",null,"CodeMirror-cursors"),n.measure=A("div",null,"CodeMirror-measure"),n.lineMeasure=A("div",null,"CodeMirror-measure"),n.lineSpace=U("div",[n.measure,n.lineMeasure,n.selectionDiv,n.cursorDiv,n.lineDiv],null,"position: relative; outline: none");var o=U("div",[n.lineSpace],"CodeMirror-lines");n.mover=A("div",[o],null,"position: relative"),n.sizer=A("div",[n.mover],"CodeMirror-sizer"),n.sizerWidth=null,n.heightForcer=A("div",null,null,"position: absolute; height: "+Me+"px; width: 1px;"),n.gutters=A("div",null,"CodeMirror-gutters"),n.lineGutter=null,n.scroller=A("div",[n.sizer,n.heightForcer,n.gutters],"CodeMirror-scroll"),n.scroller.setAttribute("tabIndex","-1"),n.wrapper=A("div",[n.scrollbarFiller,n.gutterFiller,n.scroller],"CodeMirror"),D&&E===105&&(n.wrapper.style.clipPath="inset(0px)"),n.wrapper.setAttribute("translate","no"),f&&p<8&&(n.gutters.style.zIndex=-1,n.scroller.style.paddingRight=0),!b&&!(d&&N)&&(n.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(n.wrapper):e(n.wrapper)),n.viewFrom=n.viewTo=t.first,n.reportedViewFrom=n.reportedViewTo=t.first,n.view=[],n.renderedView=null,n.externalMeasured=null,n.viewOffset=0,n.lastWrapHeight=n.lastWrapWidth=0,n.updateLineNumbers=null,n.nativeBarWidth=n.barHeight=n.barWidth=0,n.scrollbarsClipped=!1,n.lineNumWidth=n.lineNumInnerWidth=n.lineNumChars=null,n.alignWidgets=!1,n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.maxLine=null,n.maxLineLength=0,n.maxLineChanged=!1,n.wheelDX=n.wheelDY=n.wheelStartX=n.wheelStartY=null,n.shift=!1,n.selForContextMenu=null,n.activeTouch=null,n.gutterSpecs=Eo(r.gutters,r.lineNumbers),vl(n),i.init(n)}var Ki=0,zt=null;f?zt=-.53:d?zt=15:D?zt=-.7:M&&(zt=-1/3);function ml(e){var t=e.wheelDeltaX,i=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),i==null&&e.detail&&e.axis==e.VERTICAL_AXIS?i=e.detail:i==null&&(i=e.wheelDelta),{x:t,y:i}}function Gf(e){var t=ml(e);return t.x*=zt,t.y*=zt,t}function yl(e,t){D&&E==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 i=ml(t),r=i.x,n=i.y,o=zt;t.deltaMode===0&&(r=t.deltaX,n=t.deltaY,o=1);var s=e.display,h=s.scroller,v=h.scrollWidth>h.clientWidth,m=h.scrollHeight>h.clientHeight;if(r&&v||n&&m){if(n&&R&&b){e:for(var x=t.target,w=s.view;x!=h;x=x.parentNode)for(var L=0;L<w.length;L++)if(w[L].node==x){e.display.currentWheelTarget=x;break e}}if(r&&!d&&!T&&o!=null){n&&m&&ii(e,Math.max(0,h.scrollTop+n*o)),ar(e,Math.max(0,h.scrollLeft+r*o)),(!n||n&&m)&&it(t),s.wheelStartX=null;return}if(n&&o!=null){var S=n*o,O=e.doc.scrollTop,P=O+s.wrapper.clientHeight;S<0?O=Math.max(0,O+S-50):P=Math.min(e.doc.height,P+S+50),ko(e,{top:O,bottom:P})}Ki<20&&t.deltaMode!==0&&(s.wheelStartX==null?(s.wheelStartX=h.scrollLeft,s.wheelStartY=h.scrollTop,s.wheelDX=r,s.wheelDY=n,setTimeout(function(){if(s.wheelStartX!=null){var j=h.scrollLeft-s.wheelStartX,Y=h.scrollTop-s.wheelStartY,Q=Y&&s.wheelDY&&Y/s.wheelDY||j&&s.wheelDX&&j/s.wheelDX;s.wheelStartX=s.wheelStartY=null,Q&&(zt=(zt*Ki+Q)/(Ki+1),++Ki)}},200)):(s.wheelDX+=r,s.wheelDY+=n))}}var pt=function(e,t){this.ranges=e,this.primIndex=t};pt.prototype.primary=function(){return this.ranges[this.primIndex]},pt.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 i=this.ranges[t],r=e.ranges[t];if(!Qn(i.anchor,r.anchor)||!Qn(i.head,r.head))return!1}return!0},pt.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new be(Jn(this.ranges[t].anchor),Jn(this.ranges[t].head));return new pt(e,this.primIndex)},pt.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},pt.prototype.contains=function(e,t){t||(t=e);for(var i=0;i<this.ranges.length;i++){var r=this.ranges[i];if(fe(t,r.from())>=0&&fe(e,r.to())<=0)return i}return-1};var be=function(e,t){this.anchor=e,this.head=t};be.prototype.from=function(){return Li(this.anchor,this.head)},be.prototype.to=function(){return Ai(this.anchor,this.head)},be.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ct(e,t,i){var r=e&&e.options.selectionsMayTouch,n=t[i];t.sort(function(L,S){return fe(L.from(),S.from())}),i=Fe(t,n);for(var o=1;o<t.length;o++){var s=t[o],h=t[o-1],v=fe(h.to(),s.from());if(r&&!s.empty()?v>0:v>=0){var m=Li(h.from(),s.from()),x=Ai(h.to(),s.to()),w=h.empty()?s.from()==s.head:h.from()==h.head;o<=i&&--i,t.splice(--o,2,new be(w?x:m,w?m:x))}}return new pt(t,i)}function jt(e,t){return new pt([new be(e,t||e)],0)}function Gt(e){return e.text?q(e.from.line+e.text.length-1,me(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function bl(e,t){if(fe(e,t.from)<0)return e;if(fe(e,t.to)<=0)return Gt(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Gt(t).ch-t.to.ch),q(i,r)}function Ao(e,t){for(var i=[],r=0;r<e.sel.ranges.length;r++){var n=e.sel.ranges[r];i.push(new be(bl(n.anchor,t),bl(n.head,t)))}return Ct(e.cm,i,e.sel.primIndex)}function xl(e,t,i){return e.line==t.line?q(i.line,e.ch-t.ch+i.ch):q(i.line+(e.line-t.line),e.ch)}function Kf(e,t,i){for(var r=[],n=q(e.first,0),o=n,s=0;s<t.length;s++){var h=t[s],v=xl(h.from,n,o),m=xl(Gt(h),n,o);if(n=h.to,o=m,i=="around"){var x=e.sel.ranges[s],w=fe(x.head,x.anchor)<0;r[s]=new be(w?m:v,w?v:m)}else r[s]=new be(v,v)}return new pt(r,e.sel.primIndex)}function Lo(e){e.doc.mode=Kn(e.options,e.doc.modeOption),si(e)}function si(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,ai(e,100),e.state.modeGen++,e.curOp&&nt(e)}function Dl(e,t){return t.from.ch==0&&t.to.ch==0&&me(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function To(e,t,i,r){function n(Q){return i?i[Q]:null}function o(Q,Z,$){Vu(Q,Z,$,r),qe(Q,"change",Q,t)}function s(Q,Z){for(var $=[],ne=Q;ne<Z;++ne)$.push(new xr(m[ne],n(ne),r));return $}var h=t.from,v=t.to,m=t.text,x=re(e,h.line),w=re(e,v.line),L=me(m),S=n(m.length-1),O=v.line-h.line;if(t.full)e.insert(0,s(0,m.length)),e.remove(m.length,e.size-m.length);else if(Dl(e,t)){var P=s(0,m.length-1);o(w,w.text,S),O&&e.remove(h.line,O),P.length&&e.insert(h.line,P)}else if(x==w)if(m.length==1)o(x,x.text.slice(0,h.ch)+L+x.text.slice(v.ch),S);else{var j=s(1,m.length-1);j.push(new xr(L+x.text.slice(v.ch),S,r)),o(x,x.text.slice(0,h.ch)+m[0],n(0)),e.insert(h.line+1,j)}else if(m.length==1)o(x,x.text.slice(0,h.ch)+m[0]+w.text.slice(v.ch),n(0)),e.remove(h.line+1,O);else{o(x,x.text.slice(0,h.ch)+m[0],n(0)),o(w,L+w.text.slice(v.ch),S);var Y=s(1,m.length-1);O>1&&e.remove(h.line+1,O-1),e.insert(h.line+1,Y)}qe(e,"change",e,t)}function Kt(e,t,i){function r(n,o,s){if(n.linked)for(var h=0;h<n.linked.length;++h){var v=n.linked[h];if(v.doc!=o){var m=s&&v.sharedHist;i&&!m||(t(v.doc,m),r(v.doc,n,m))}}}r(e,null,!0)}function Cl(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,vo(e),Lo(e),wl(e),e.options.direction=t.direction,e.options.lineWrapping||no(e),e.options.mode=t.modeOption,nt(e)}function wl(e){(e.doc.direction=="rtl"?Te:ue)(e.display.lineDiv,"CodeMirror-rtl")}function Xf(e){ut(e,function(){wl(e),nt(e)})}function Xi(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 Mo(e,t){var i={from:Jn(t.from),to:Gt(t),text:er(e,t.from,t.to)};return Fl(e,i,t.from.line,t.to.line+1),Kt(e,function(r){return Fl(r,i,t.from.line,t.to.line+1)},!0),i}function kl(e){for(;e.length;){var t=me(e);if(t.ranges)e.pop();else break}}function Yf(e,t){if(t)return kl(e.done),me(e.done);if(e.done.length&&!me(e.done).ranges)return me(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),me(e.done)}function Sl(e,t,i,r){var n=e.history;n.undone.length=0;var o=+new Date,s,h;if((n.lastOp==r||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(s=Yf(n,n.lastOp==r)))h=me(s.changes),fe(t.from,t.to)==0&&fe(t.from,h.to)==0?h.to=Gt(t):s.changes.push(Mo(e,t));else{var v=me(n.done);for((!v||!v.ranges)&&Yi(e.sel,n.done),s={changes:[Mo(e,t)],generation:n.generation},n.done.push(s);n.done.length>n.undoDepth;)n.done.shift(),n.done[0].ranges||n.done.shift()}n.done.push(i),n.generation=++n.maxGeneration,n.lastModTime=n.lastSelTime=o,n.lastOp=n.lastSelOp=r,n.lastOrigin=n.lastSelOrigin=t.origin,h||Ie(e,"historyAdded")}function Zf(e,t,i,r){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Qf(e,t,i,r){var n=e.history,o=r&&r.origin;i==n.lastSelOp||o&&n.lastSelOrigin==o&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==o||Zf(e,o,me(n.done),t))?n.done[n.done.length-1]=t:Yi(t,n.done),n.lastSelTime=+new Date,n.lastSelOrigin=o,n.lastSelOp=i,r&&r.clearRedo!==!1&&kl(n.undone)}function Yi(e,t){var i=me(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Fl(e,t,i,r){var n=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(s){s.markedSpans&&((n||(n=t["spans_"+e.id]={}))[o]=s.markedSpans),++o})}function Jf(e){if(!e)return null;for(var t,i=0;i<e.length;++i)e[i].marker.explicitlyCleared?t||(t=e.slice(0,i)):t&&t.push(e[i]);return t?t.length?t:null:e}function $f(e,t){var i=t["spans_"+e.id];if(!i)return null;for(var r=[],n=0;n<t.text.length;++n)r.push(Jf(i[n]));return r}function El(e,t){var i=$f(e,t),r=eo(e,t);if(!i)return r;if(!r)return i;for(var n=0;n<i.length;++n){var o=i[n],s=r[n];if(o&&s)e:for(var h=0;h<s.length;++h){for(var v=s[h],m=0;m<o.length;++m)if(o[m].marker==v.marker)continue e;o.push(v)}else s&&(i[n]=s)}return i}function Ar(e,t,i){for(var r=[],n=0;n<e.length;++n){var o=e[n];if(o.ranges){r.push(i?pt.prototype.deepCopy.call(o):o);continue}var s=o.changes,h=[];r.push({changes:h});for(var v=0;v<s.length;++v){var m=s[v],x=void 0;if(h.push({from:m.from,to:m.to,text:m.text}),t)for(var w in m)(x=w.match(/^spans_(\d+)$/))&&Fe(t,Number(x[1]))>-1&&(me(h)[w]=m[w],delete m[w])}}return r}function Bo(e,t,i,r){if(r){var n=e.anchor;if(i){var o=fe(t,n)<0;o!=fe(i,n)<0?(n=t,t=i):o!=fe(t,i)<0&&(t=i)}return new be(n,t)}else return new be(i||t,t)}function Zi(e,t,i,r,n){n==null&&(n=e.cm&&(e.cm.display.shift||e.extend)),Ze(e,new pt([Bo(e.sel.primary(),t,i,n)],0),r)}function Al(e,t,i){for(var r=[],n=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Bo(e.sel.ranges[o],t[o],null,n);var s=Ct(e.cm,r,e.sel.primIndex);Ze(e,s,i)}function No(e,t,i,r){var n=e.sel.ranges.slice(0);n[t]=i,Ze(e,Ct(e.cm,n,e.sel.primIndex),r)}function Ll(e,t,i,r){Ze(e,jt(t,i),r)}function Vf(e,t,i){var r={ranges:t.ranges,update:function(n){this.ranges=[];for(var o=0;o<n.length;o++)this.ranges[o]=new be(ce(e,n[o].anchor),ce(e,n[o].head))},origin:i&&i.origin};return Ie(e,"beforeSelectionChange",e,r),e.cm&&Ie(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?Ct(e.cm,r.ranges,r.ranges.length-1):t}function Tl(e,t,i){var r=e.history.done,n=me(r);n&&n.ranges?(r[r.length-1]=t,Qi(e,t,i)):Ze(e,t,i)}function Ze(e,t,i){Qi(e,t,i),Qf(e,e.sel,e.cm?e.cm.curOp.id:NaN,i)}function Qi(e,t,i){(mt(e,"beforeSelectionChange")||e.cm&&mt(e.cm,"beforeSelectionChange"))&&(t=Vf(e,t,i));var r=i&&i.bias||(fe(t.primary().head,e.sel.primary().head)<0?-1:1);Ml(e,Nl(e,t,r,!0)),!(i&&i.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&Fr(e.cm)}function Ml(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,pa(e.cm)),qe(e,"cursorActivity",e))}function Bl(e){Ml(e,Nl(e,e.sel,null,!1))}function Nl(e,t,i,r){for(var n,o=0;o<t.ranges.length;o++){var s=t.ranges[o],h=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],v=Ji(e,s.anchor,h&&h.anchor,i,r),m=s.head==s.anchor?v:Ji(e,s.head,h&&h.head,i,r);(n||v!=s.anchor||m!=s.head)&&(n||(n=t.ranges.slice(0,o)),n[o]=new be(v,m))}return n?Ct(e.cm,n,t.primIndex):t}function Lr(e,t,i,r,n){var o=re(e,t.line);if(o.markedSpans)for(var s=0;s<o.markedSpans.length;++s){var h=o.markedSpans[s],v=h.marker,m="selectLeft"in v?!v.selectLeft:v.inclusiveLeft,x="selectRight"in v?!v.selectRight:v.inclusiveRight;if((h.from==null||(m?h.from<=t.ch:h.from<t.ch))&&(h.to==null||(x?h.to>=t.ch:h.to>t.ch))){if(n&&(Ie(v,"beforeCursorEnter"),v.explicitlyCleared))if(o.markedSpans){--s;continue}else break;if(!v.atomic)continue;if(i){var w=v.find(r<0?1:-1),L=void 0;if((r<0?x:m)&&(w=Il(e,w,-r,w&&w.line==t.line?o:null)),w&&w.line==t.line&&(L=fe(w,i))&&(r<0?L<0:L>0))return Lr(e,w,t,r,n)}var S=v.find(r<0?-1:1);return(r<0?m:x)&&(S=Il(e,S,r,S.line==t.line?o:null)),S?Lr(e,S,t,r,n):null}}return t}function Ji(e,t,i,r,n){var o=r||1,s=Lr(e,t,i,o,n)||!n&&Lr(e,t,i,o,!0)||Lr(e,t,i,-o,n)||!n&&Lr(e,t,i,-o,!0);return s||(e.cantEdit=!0,q(e.first,0))}function Il(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?ce(e,q(t.line-1)):null:i>0&&t.ch==(r||re(e,t.line)).text.length?t.line<e.first+e.size-1?q(t.line+1,0):null:new q(t.line,t.ch+i)}function zl(e){e.setSelection(q(e.firstLine(),0),q(e.lastLine()),rt)}function Ol(e,t,i){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return i&&(r.update=function(n,o,s,h){n&&(r.from=ce(e,n)),o&&(r.to=ce(e,o)),s&&(r.text=s),h!==void 0&&(r.origin=h)}),Ie(e,"beforeChange",e,r),e.cm&&Ie(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Tr(e,t,i){if(e.cm){if(!e.cm.curOp)return Ue(e.cm,Tr)(e,t,i);if(e.cm.state.suppressEdits)return}if(!((mt(e,"beforeChange")||e.cm&&mt(e.cm,"beforeChange"))&&(t=Ol(e,t,!0),!t))){var r=Ea&&!i&&Zu(e,t.from,t.to);if(r)for(var n=r.length-1;n>=0;--n)Hl(e,{from:r[n].from,to:r[n].to,text:n?[""]:t.text,origin:t.origin});else Hl(e,t)}}function Hl(e,t){if(!(t.text.length==1&&t.text[0]==""&&fe(t.from,t.to)==0)){var i=Ao(e,t);Sl(e,t,i,e.cm?e.cm.curOp.id:NaN),ui(e,t,i,eo(e,t));var r=[];Kt(e,function(n,o){!o&&Fe(r,n.history)==-1&&(Wl(n.history,t),r.push(n.history)),ui(n,t,null,eo(n,t))})}}function $i(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!i)){for(var n=e.history,o,s=e.sel,h=t=="undo"?n.done:n.undone,v=t=="undo"?n.undone:n.done,m=0;m<h.length&&(o=h[m],!(i?o.ranges&&!o.equals(e.sel):!o.ranges));m++);if(m!=h.length){for(n.lastOrigin=n.lastSelOrigin=null;;)if(o=h.pop(),o.ranges){if(Yi(o,v),i&&!o.equals(e.sel)){Ze(e,o,{clearRedo:!1});return}s=o}else if(r){h.push(o);return}else break;var x=[];Yi(s,v),v.push({changes:x,generation:n.generation}),n.generation=o.generation||++n.maxGeneration;for(var w=mt(e,"beforeChange")||e.cm&&mt(e.cm,"beforeChange"),L=function(P){var j=o.changes[P];if(j.origin=t,w&&!Ol(e,j,!1))return h.length=0,{};x.push(Mo(e,j));var Y=P?Ao(e,j):me(h);ui(e,j,Y,El(e,j)),!P&&e.cm&&e.cm.scrollIntoView({from:j.from,to:Gt(j)});var Q=[];Kt(e,function(Z,$){!$&&Fe(Q,Z.history)==-1&&(Wl(Z.history,j),Q.push(Z.history)),ui(Z,j,null,El(Z,j))})},S=o.changes.length-1;S>=0;--S){var O=L(S);if(O)return O.v}}}}function Rl(e,t){if(t!=0&&(e.first+=t,e.sel=new pt(bt(e.sel.ranges,function(n){return new be(q(n.anchor.line+t,n.anchor.ch),q(n.head.line+t,n.head.ch))}),e.sel.primIndex),e.cm)){nt(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;r<i.viewTo;r++)qt(e.cm,r,"gutter")}}function ui(e,t,i,r){if(e.cm&&!e.cm.curOp)return Ue(e.cm,ui)(e,t,i,r);if(t.to.line<e.first){Rl(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 n=t.text.length-1-(e.first-t.from.line);Rl(e,n),t={from:q(e.first,0),to:q(t.to.line+n,t.to.ch),text:[me(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:q(o,re(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=er(e,t.from,t.to),i||(i=Ao(e,t)),e.cm?ec(e.cm,t,r):To(e,t,r),Qi(e,i,rt),e.cantEdit&&Ji(e,q(e.firstLine(),0))&&(e.cantEdit=!1)}}function ec(e,t,i){var r=e.doc,n=e.display,o=t.from,s=t.to,h=!1,v=o.line;e.options.lineWrapping||(v=xe(xt(re(r,o.line))),r.iter(v,s.line+1,function(S){if(S==n.maxLine)return h=!0,!0})),r.sel.contains(t.from,t.to)>-1&&pa(e),To(r,t,i,il(e)),e.options.lineWrapping||(r.iter(v,o.line+t.text.length,function(S){var O=zi(S);O>n.maxLineLength&&(n.maxLine=S,n.maxLineLength=O,n.maxLineChanged=!0,h=!1)}),h&&(e.curOp.updateMaxLine=!0)),qu(r,o.line),ai(e,400);var m=t.text.length-(s.line-o.line)-1;t.full?nt(e):o.line==s.line&&t.text.length==1&&!Dl(e.doc,t)?qt(e,o.line,"text"):nt(e,o.line,s.line+1,m);var x=mt(e,"changes"),w=mt(e,"change");if(w||x){var L={from:o,to:s,text:t.text,removed:t.removed,origin:t.origin};w&&qe(e,"change",e,L),x&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(L)}e.display.selForContextMenu=null}function Mr(e,t,i,r,n){var o;r||(r=i),fe(r,i)<0&&(o=[r,i],i=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Tr(e,{from:i,to:r,text:t,origin:n})}function Pl(e,t,i,r){i<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function _l(e,t,i,r){for(var n=0;n<e.length;++n){var o=e[n],s=!0;if(o.ranges){o.copied||(o=e[n]=o.deepCopy(),o.copied=!0);for(var h=0;h<o.ranges.length;h++)Pl(o.ranges[h].anchor,t,i,r),Pl(o.ranges[h].head,t,i,r);continue}for(var v=0;v<o.changes.length;++v){var m=o.changes[v];if(i<m.from.line)m.from=q(m.from.line+r,m.from.ch),m.to=q(m.to.line+r,m.to.ch);else if(t<=m.to.line){s=!1;break}}s||(e.splice(0,n+1),n=0)}}function Wl(e,t){var i=t.from.line,r=t.to.line,n=t.text.length-(r-i)-1;_l(e.done,i,r,n),_l(e.undone,i,r,n)}function fi(e,t,i,r){var n=t,o=t;return typeof t=="number"?o=re(e,ya(e,t)):n=xe(t),n==null?null:(r(o,n)&&e.cm&&qt(e.cm,n,i),o)}function ci(e){this.lines=e,this.parent=null;for(var t=0,i=0;i<e.length;++i)e[i].parent=this,t+=e[i].height;this.height=t}ci.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var i=e,r=e+t;i<r;++i){var n=this.lines[i];this.height-=n.height,ef(n),qe(n,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,i){this.height+=i,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,i){for(var r=e+t;e<r;++e)if(i(this.lines[e]))return!0}};function di(e){this.children=e;for(var t=0,i=0,r=0;r<e.length;++r){var n=e[r];t+=n.chunkSize(),i+=n.height,n.parent=this}this.size=t,this.height=i,this.parent=null}di.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var i=0;i<this.children.length;++i){var r=this.children[i],n=r.chunkSize();if(e<n){var o=Math.min(t,n-e),s=r.height;if(r.removeInner(e,o),this.height-=s-r.height,n==o&&(this.children.splice(i--,1),r.parent=null),(t-=o)==0)break;e=0}else e-=n}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof ci))){var h=[];this.collapse(h),this.children=[new ci(h)],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,i){this.size+=t.length,this.height+=i;for(var r=0;r<this.children.length;++r){var n=this.children[r],o=n.chunkSize();if(e<=o){if(n.insertInner(e,t,i),n.lines&&n.lines.length>50){for(var s=n.lines.length%25+25,h=s;h<n.lines.length;){var v=new ci(n.lines.slice(h,h+=25));n.height-=v.height,this.children.splice(++r,0,v),v.parent=this}n.lines=n.lines.slice(0,s),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),i=new di(t);if(e.parent){e.size-=i.size,e.height-=i.height;var n=Fe(e.parent.children,e);e.parent.children.splice(n+1,0,i)}else{var r=new di(e.children);r.parent=e,e.children=[r,i],e=r}i.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;r<this.children.length;++r){var n=this.children[r],o=n.chunkSize();if(e<o){var s=Math.min(t,o-e);if(n.iterN(e,s,i))return!0;if((t-=s)==0)break;e=0}else e-=o}}};var hi=function(e,t,i){if(i)for(var r in i)i.hasOwnProperty(r)&&(this[r]=i[r]);this.doc=e,this.node=t};hi.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,i=this.line,r=xe(i);if(!(r==null||!t)){for(var n=0;n<t.length;++n)t[n]==this&&t.splice(n--,1);t.length||(i.widgets=null);var o=Vr(this);Ft(i,Math.max(0,i.height-o)),e&&(ut(e,function(){ql(e,i,-o),qt(e,r,"widget")}),qe(e,"lineWidgetCleared",e,this,r))}},hi.prototype.changed=function(){var e=this,t=this.height,i=this.doc.cm,r=this.line;this.height=null;var n=Vr(this)-t;n&&(Wt(this.doc,r)||Ft(r,r.height+n),i&&ut(i,function(){i.curOp.forceUpdate=!0,ql(i,r,n),qe(i,"lineWidgetChanged",i,e,xe(r))}))},mr(hi);function ql(e,t,i){Nt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&Co(e,i)}function tc(e,t,i,r){var n=new hi(e,i,r),o=e.cm;return o&&n.noHScroll&&(o.display.alignWidgets=!0),fi(e,t,"widget",function(s){var h=s.widgets||(s.widgets=[]);if(n.insertAt==null?h.push(n):h.splice(Math.min(h.length,Math.max(0,n.insertAt)),0,n),n.line=s,o&&!Wt(e,s)){var v=Nt(s)<e.scrollTop;Ft(s,s.height+Vr(n)),v&&Co(o,n.height),o.curOp.forceUpdate=!0}return!0}),o&&qe(o,"lineWidgetAdded",o,n,typeof t=="number"?t:xe(t)),n}var Ul=0,Xt=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Ul};Xt.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&sr(e),mt(this,"clear")){var i=this.find();i&&qe(this,"clear",i.from,i.to)}for(var r=null,n=null,o=0;o<this.lines.length;++o){var s=this.lines[o],h=Qr(s.markedSpans,this);e&&!this.collapsed?qt(e,xe(s),"text"):e&&(h.to!=null&&(n=xe(s)),h.from!=null&&(r=xe(s))),s.markedSpans=Gu(s.markedSpans,h),h.from==null&&this.collapsed&&!Wt(this.doc,s)&&e&&Ft(s,wr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var v=0;v<this.lines.length;++v){var m=xt(this.lines[v]),x=zi(m);x>e.display.maxLineLength&&(e.display.maxLine=m,e.display.maxLineLength=x,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&nt(e,r,n+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Bl(e.doc)),e&&qe(e,"markerCleared",e,this,r,n),t&&ur(e),this.parent&&this.parent.clear()}},Xt.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,n=0;n<this.lines.length;++n){var o=this.lines[n],s=Qr(o.markedSpans,this);if(s.from!=null&&(i=q(t?o:xe(o),s.from),e==-1))return i;if(s.to!=null&&(r=q(t?o:xe(o),s.to),e==1))return r}return i&&{from:i,to:r}},Xt.prototype.changed=function(){var e=this,t=this.find(-1,!0),i=this,r=this.doc.cm;!t||!r||ut(r,function(){var n=t.line,o=xe(t.line),s=so(r,o);if(s&&(Za(s),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!Wt(i.doc,n)&&i.height!=null){var h=i.height;i.height=null;var v=Vr(i)-h;v&&Ft(n,n.height+v)}qe(r,"markerChanged",r,e)})},Xt.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Fe(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},Xt.prototype.detachLine=function(e){if(this.lines.splice(Fe(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},mr(Xt);function Br(e,t,i,r,n){if(r&&r.shared)return rc(e,t,i,r,n);if(e.cm&&!e.cm.curOp)return Ue(e.cm,Br)(e,t,i,r,n);var o=new Xt(e,n),s=fe(t,i);if(r&&dt(r,o,!1),s>0||s==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=U("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Na(e,t.line,t,i,o)||t.line!=i.line&&Na(e,i.line,t,i,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");ju()}o.addToHistory&&Sl(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var h=t.line,v=e.cm,m;if(e.iter(h,i.line+1,function(w){v&&o.collapsed&&!v.options.lineWrapping&&xt(w)==v.display.maxLine&&(m=!0),o.collapsed&&h!=t.line&&Ft(w,0),Ku(w,new Mi(o,h==t.line?t.ch:null,h==i.line?i.ch:null),e.cm&&e.cm.curOp),++h}),o.collapsed&&e.iter(t.line,i.line+1,function(w){Wt(e,w)&&Ft(w,0)}),o.clearOnEnter&&oe(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Uu(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Ul,o.atomic=!0),v){if(m&&(v.curOp.updateMaxLine=!0),o.collapsed)nt(v,t.line,i.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var x=t.line;x<=i.line;x++)qt(v,x,"text");o.atomic&&Bl(v.doc),qe(v,"markerAdded",v,o)}return o}var pi=function(e,t){this.markers=e,this.primary=t;for(var i=0;i<e.length;++i)e[i].parent=this};pi.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();qe(this,"clear")}},pi.prototype.find=function(e,t){return this.primary.find(e,t)},mr(pi);function rc(e,t,i,r,n){r=dt(r),r.shared=!1;var o=[Br(e,t,i,r,n)],s=o[0],h=r.widgetNode;return Kt(e,function(v){h&&(r.widgetNode=h.cloneNode(!0)),o.push(Br(v,ce(v,t),ce(v,i),r,n));for(var m=0;m<v.linked.length;++m)if(v.linked[m].isParent)return;s=me(o)}),new pi(o,s)}function jl(e){return e.findMarks(q(e.first,0),e.clipPos(q(e.lastLine())),function(t){return t.parent})}function ic(e,t){for(var i=0;i<t.length;i++){var r=t[i],n=r.find(),o=e.clipPos(n.from),s=e.clipPos(n.to);if(fe(o,s)){var h=Br(e,o,s,r.primary,r.primary.type);r.markers.push(h),h.parent=r}}}function nc(e){for(var t=function(r){var n=e[r],o=[n.primary.doc];Kt(n.primary.doc,function(v){return o.push(v)});for(var s=0;s<n.markers.length;s++){var h=n.markers[s];Fe(o,h.doc)==-1&&(h.parent=null,n.markers.splice(s--,1))}},i=0;i<e.length;i++)t(i)}var oc=0,ot=function(e,t,i,r,n){if(!(this instanceof ot))return new ot(e,t,i,r,n);i==null&&(i=0),di.call(this,[new ci([new xr("",null)])]),this.first=i,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=i;var o=q(i,0);this.sel=jt(o),this.history=new Xi(null),this.id=++oc,this.modeOption=t,this.lineSep=r,this.direction=n=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),To(this,{from:o,to:o,text:e}),Ze(this,jt(o),rt)};ot.prototype=fa(di.prototype,{constructor:ot,iter:function(e,t,i){i?this.iterN(e-this.first,t-e,i):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var i=0,r=0;r<t.length;++r)i+=t[r].height;this.insertInner(e-this.first,t,i)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=Yn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:je(function(e){var t=q(this.first,0),i=this.first+this.size-1;Tr(this,{from:t,to:q(i,re(this,i).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ri(this.cm,0,0),Ze(this,jt(t),rt)}),replaceRange:function(e,t,i,r){t=ce(this,t),i=i?ce(this,i):t,Mr(this,e,t,i,r)},getRange:function(e,t,i){var r=er(this,ce(this,e),ce(this,t));return i===!1?r:i===""?r.join(""):r.join(i||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Yr(this,e))return re(this,e)},getLineNumber:function(e){return xe(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=re(this,e)),xt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ce(this,e)},getCursor:function(e){var t=this.sel.primary(),i;return e==null||e=="head"?i=t.head:e=="anchor"?i=t.anchor:e=="end"||e=="to"||e===!1?i=t.to():i=t.from(),i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:je(function(e,t,i){Ll(this,ce(this,typeof e=="number"?q(e,t||0):e),null,i)}),setSelection:je(function(e,t,i){Ll(this,ce(this,e),ce(this,t||e),i)}),extendSelection:je(function(e,t,i){Zi(this,ce(this,e),t&&ce(this,t),i)}),extendSelections:je(function(e,t){Al(this,ba(this,e),t)}),extendSelectionsBy:je(function(e,t){var i=bt(this.sel.ranges,e);Al(this,ba(this,i),t)}),setSelections:je(function(e,t,i){if(e.length){for(var r=[],n=0;n<e.length;n++)r[n]=new be(ce(this,e[n].anchor),ce(this,e[n].head||e[n].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),Ze(this,Ct(this.cm,r,t),i)}}),addSelection:je(function(e,t,i){var r=this.sel.ranges.slice(0);r.push(new be(ce(this,e),ce(this,t||e))),Ze(this,Ct(this.cm,r,r.length-1),i)}),getSelection:function(e){for(var t=this.sel.ranges,i,r=0;r<t.length;r++){var n=er(this,t[r].from(),t[r].to());i=i?i.concat(n):n}return e===!1?i:i.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],i=this.sel.ranges,r=0;r<i.length;r++){var n=er(this,i[r].from(),i[r].to());e!==!1&&(n=n.join(e||this.lineSeparator())),t[r]=n}return t},replaceSelection:function(e,t,i){for(var r=[],n=0;n<this.sel.ranges.length;n++)r[n]=e;this.replaceSelections(r,t,i||"+input")},replaceSelections:je(function(e,t,i){for(var r=[],n=this.sel,o=0;o<n.ranges.length;o++){var s=n.ranges[o];r[o]={from:s.from(),to:s.to(),text:this.splitLines(e[o]),origin:i}}for(var h=t&&t!="end"&&Kf(this,r,t),v=r.length-1;v>=0;v--)Tr(this,r[v]);h?Tl(this,h):this.cm&&Fr(this.cm)}),undo:je(function(){$i(this,"undo")}),redo:je(function(){$i(this,"redo")}),undoSelection:je(function(){$i(this,"undo",!0)}),redoSelection:je(function(){$i(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var n=0;n<e.undone.length;n++)e.undone[n].ranges||++i;return{undo:t,redo:i}},clearHistory:function(){var e=this;this.history=new Xi(this.history),Kt(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:Ar(this.history.done),undone:Ar(this.history.undone)}},setHistory:function(e){var t=this.history=new Xi(this.history);t.done=Ar(e.done.slice(0),null,!0),t.undone=Ar(e.undone.slice(0),null,!0)},setGutterMarker:je(function(e,t,i){return fi(this,e,"gutter",function(r){var n=r.gutterMarkers||(r.gutterMarkers={});return n[t]=i,!i&&ca(n)&&(r.gutterMarkers=null),!0})}),clearGutter:je(function(e){var t=this;this.iter(function(i){i.gutterMarkers&&i.gutterMarkers[e]&&fi(t,i,"gutter",function(){return i.gutterMarkers[e]=null,ca(i.gutterMarkers)&&(i.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Yr(this,e)||(t=e,e=re(this,e),!e))return null}else if(t=xe(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:je(function(e,t,i){return fi(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[n])r[n]=i;else{if(G(i).test(r[n]))return!1;r[n]+=" "+i}return!0})}),removeLineClass:je(function(e,t,i){return fi(this,e,t=="gutter"?"gutter":"class",function(r){var n=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",o=r[n];if(o)if(i==null)r[n]=null;else{var s=o.match(G(i));if(!s)return!1;var h=s.index+s[0].length;r[n]=o.slice(0,s.index)+(!s.index||h==o.length?"":" ")+o.slice(h)||null}else return!1;return!0})}),addLineWidget:je(function(e,t,i){return tc(this,e,t,i)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,i){return Br(this,ce(this,e),ce(this,t),i,i&&i.type||"range")},setBookmark:function(e,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ce(this,e),Br(this,e,e,i,"bookmark")},findMarksAt:function(e){e=ce(this,e);var t=[],i=re(this,e.line).markedSpans;if(i)for(var r=0;r<i.length;++r){var n=i[r];(n.from==null||n.from<=e.ch)&&(n.to==null||n.to>=e.ch)&&t.push(n.marker.parent||n.marker)}return t},findMarks:function(e,t,i){e=ce(this,e),t=ce(this,t);var r=[],n=e.line;return this.iter(e.line,t.line+1,function(o){var s=o.markedSpans;if(s)for(var h=0;h<s.length;h++){var v=s[h];!(v.to!=null&&n==e.line&&e.ch>=v.to||v.from==null&&n!=e.line||v.from!=null&&n==t.line&&v.from>=t.ch)&&(!i||i(v.marker))&&r.push(v.marker.parent||v.marker)}++n}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;r<i.length;++r)i[r].from!=null&&e.push(i[r].marker)}),e},posFromIndex:function(e){var t,i=this.first,r=this.lineSeparator().length;return this.iter(function(n){var o=n.text.length+r;if(o>e)return t=e,!0;e-=o,++i}),ce(this,q(i,t))},indexFromPos:function(e){e=ce(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var i=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+i}),t},copy:function(e){var t=new ot(Yn(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,i=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<i&&(i=e.to);var r=new ot(Yn(this,t,i),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],ic(r,jl(this)),r},unlinkDoc:function(e){if(e instanceof Ee&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),nc(jl(this));break}}if(e.history==this.history){var r=[e.id];Kt(e,function(n){return r.push(n.id)},!0),e.history=new Xi(null),e.history.done=Ar(this.history.done,r),e.history.undone=Ar(this.history.undone,r)}},iterLinkedDocs:function(e){Kt(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Un(e)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:je(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&Xf(this.cm))})}),ot.prototype.eachLine=ot.prototype.iter;var Gl=0;function ac(e){var t=this;if(Kl(t),!(We(t,e)||It(t.display,e))){it(e),f&&(Gl=+new Date);var i=nr(t,e,!0),r=e.dataTransfer.files;if(!(!i||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var n=r.length,o=Array(n),s=0,h=function(){++s==n&&Ue(t,function(){i=ce(t.doc,i);var S={from:i,to:i,text:t.doc.splitLines(o.filter(function(O){return O!=null}).join(t.doc.lineSeparator())),origin:"paste"};Tr(t.doc,S),Tl(t.doc,jt(ce(t.doc,i),ce(t.doc,Gt(S))))})()},v=function(S,O){if(t.options.allowDropFileTypes&&Fe(t.options.allowDropFileTypes,S.type)==-1){h();return}var P=new FileReader;P.onerror=function(){return h()},P.onload=function(){var j=P.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(j)){h();return}o[O]=j,h()},P.readAsText(S)},m=0;m<r.length;m++)v(r[m],m);else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var x=e.dataTransfer.getData("Text");if(x){var w;if(t.state.draggingText&&!t.state.draggingText.copy&&(w=t.listSelections()),Qi(t.doc,jt(i,i)),w)for(var L=0;L<w.length;++L)Mr(t.doc,"",w[L].anchor,w[L].head,"drag");t.replaceSelection(x,"around","paste"),t.display.input.focus()}}catch{}}}}function lc(e,t){if(f&&(!e.state.draggingText||+new Date-Gl<100)){Xr(t);return}if(!(We(e,t)||It(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!M)){var i=A("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",T&&(i.width=i.height=1,e.display.wrapper.appendChild(i),i._top=i.offsetTop),t.dataTransfer.setDragImage(i,0,0),T&&i.parentNode.removeChild(i)}}function sc(e,t){var i=nr(e,t);if(i){var r=document.createDocumentFragment();mo(e,i,r),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),de(e.display.dragCursor,r)}}function Kl(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Xl(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),i=[],r=0;r<t.length;r++){var n=t[r].CodeMirror;n&&i.push(n)}i.length&&i[0].operation(function(){for(var o=0;o<i.length;o++)e(i[o])})}}var Yl=!1;function uc(){Yl||(fc(),Yl=!0)}function fc(){var e;oe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Xl(cc)},100))}),oe(window,"blur",function(){return Xl(Sr)})}function cc(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Yt={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"},gi=0;gi<10;gi++)Yt[gi+48]=Yt[gi+96]=String(gi);for(var Vi=65;Vi<=90;Vi++)Yt[Vi]=String.fromCharCode(Vi);for(var vi=1;vi<=12;vi++)Yt[vi+111]=Yt[vi+63235]="F"+vi;var Ot={};Ot.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"},Ot.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"},Ot.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"},Ot.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"]},Ot.default=R?Ot.macDefault:Ot.pcDefault;function dc(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var i,r,n,o,s=0;s<t.length-1;s++){var h=t[s];if(/^(cmd|meta|m)$/i.test(h))o=!0;else if(/^a(lt)?$/i.test(h))i=!0;else if(/^(c|ctrl|control)$/i.test(h))r=!0;else if(/^s(hift)?$/i.test(h))n=!0;else throw new Error("Unrecognized modifier name: "+h)}return i&&(e="Alt-"+e),r&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),n&&(e="Shift-"+e),e}function hc(e){var t={};for(var i in e)if(e.hasOwnProperty(i)){var r=e[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i))continue;if(r=="..."){delete e[i];continue}for(var n=bt(i.split(" "),dc),o=0;o<n.length;o++){var s=void 0,h=void 0;o==n.length-1?(h=n.join(" "),s=r):(h=n.slice(0,o+1).join(" "),s="...");var v=t[h];if(!v)t[h]=s;else if(v!=s)throw new Error("Inconsistent bindings for "+h)}delete e[i]}for(var m in t)e[m]=t[m];return e}function Nr(e,t,i,r){t=en(t);var n=t.call?t.call(e,r):t[e];if(n===!1)return"nothing";if(n==="...")return"multi";if(n!=null&&i(n))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Nr(e,t.fallthrough,i,r);for(var o=0;o<t.fallthrough.length;o++){var s=Nr(e,t.fallthrough[o],i,r);if(s)return s}}}function Zl(e){var t=typeof e=="string"?e:Yt[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Ql(e,t,i){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(K?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(K?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!i&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Jl(e,t){if(T&&e.keyCode==34&&e.char)return!1;var i=Yt[e.keyCode];return i==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(i=e.code),Ql(i,e,t))}function en(e){return typeof e=="string"?Ot[e]:e}function Ir(e,t){for(var i=e.doc.sel.ranges,r=[],n=0;n<i.length;n++){for(var o=t(i[n]);r.length&&fe(o.from,me(r).to)<=0;){var s=r.pop();if(fe(s.from,o.from)<0){o.from=s.from;break}}r.push(o)}ut(e,function(){for(var h=r.length-1;h>=0;h--)Mr(e.doc,"",r[h].from,r[h].to,"+delete");Fr(e)})}function Io(e,t,i){var r=da(e.text,t+i,i);return r<0||r>e.text.length?null:r}function zo(e,t,i){var r=Io(e,t.ch,i);return r==null?null:new q(t.line,r,i<0?"after":"before")}function Oo(e,t,i,r,n){if(e){t.doc.direction=="rtl"&&(n=-n);var o=Mt(i,t.doc.direction);if(o){var s=n<0?me(o):o[0],h=n<0==(s.level==1),v=h?"after":"before",m;if(s.level>0||t.doc.direction=="rtl"){var x=Cr(t,i);m=n<0?i.text.length-1:0;var w=Lt(t,x,m).top;m=jr(function(L){return Lt(t,x,L).top==w},n<0==(s.level==1)?s.from:s.to-1,m),v=="before"&&(m=Io(i,m,1))}else m=n<0?s.to:s.from;return new q(r,m,v)}}return new q(r,n<0?i.text.length:0,n<0?"before":"after")}function pc(e,t,i,r){var n=Mt(t,e.doc.direction);if(!n)return zo(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var o=Kr(n,i.ch,i.sticky),s=n[o];if(e.doc.direction=="ltr"&&s.level%2==0&&(r>0?s.to>i.ch:s.from<i.ch))return zo(t,i,r);var h=function(Y,Q){return Io(t,Y instanceof q?Y.ch:Y,Q)},v,m=function(Y){return e.options.lineWrapping?(v=v||Cr(e,t),rl(e,t,v,Y)):{begin:0,end:t.text.length}},x=m(i.sticky=="before"?h(i,-1):i.ch);if(e.doc.direction=="rtl"||s.level==1){var w=s.level==1==r<0,L=h(i,w?1:-1);if(L!=null&&(w?L<=s.to&&L<=x.end:L>=s.from&&L>=x.begin)){var S=w?"before":"after";return new q(i.line,L,S)}}var O=function(Y,Q,Z){for(var $=function(Ce,Ge){return Ge?new q(i.line,h(Ce,1),"before"):new q(i.line,Ce,"after")};Y>=0&&Y<n.length;Y+=Q){var ne=n[Y],ie=Q>0==(ne.level!=1),pe=ie?Z.begin:h(Z.end,-1);if(ne.from<=pe&&pe<ne.to||(pe=ie?ne.from:h(ne.to,-1),Z.begin<=pe&&pe<Z.end))return $(pe,ie)}},P=O(o+r,r,x);if(P)return P;var j=r>0?x.end:h(x.begin,-1);return j!=null&&!(r>0&&j==t.text.length)&&(P=O(r>0?0:n.length-1,r,m(j)),P)?P:null}var mi={selectAll:zl,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),rt)},killLine:function(e){return Ir(e,function(t){if(t.empty()){var i=re(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line<e.lastLine()?{from:t.head,to:q(t.head.line+1,0)}:{from:t.head,to:q(t.head.line,i)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Ir(e,function(t){return{from:q(t.from().line,0),to:ce(e.doc,q(t.to().line+1,0))}})},delLineLeft:function(e){return Ir(e,function(t){return{from:q(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Ir(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return Ir(e,function(t){var i=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:r}})},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(q(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(q(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return $l(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Vl(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return gc(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:i},"div")},kt)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:i},"div")},kt)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var i=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:i},"div");return r.ch<e.getLine(r.line).search(/\S/)?Vl(e,t.head):r},kt)},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=[],i=e.listSelections(),r=e.options.tabSize,n=0;n<i.length;n++){var o=i[n].from(),s=Re(e.getLine(o.line),o.ch,r);t.push(Pt(r-s%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ut(e,function(){for(var t=e.listSelections(),i=[],r=0;r<t.length;r++)if(t[r].empty()){var n=t[r].head,o=re(e.doc,n.line).text;if(o){if(n.ch==o.length&&(n=new q(n.line,n.ch-1)),n.ch>0)n=new q(n.line,n.ch+1),e.replaceRange(o.charAt(n.ch-1)+o.charAt(n.ch-2),q(n.line,n.ch-2),n,"+transpose");else if(n.line>e.doc.first){var s=re(e.doc,n.line-1).text;s&&(n=new q(n.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+s.charAt(s.length-1),q(n.line-1,s.length-1),n,"+transpose"))}}i.push(new be(n,n))}e.setSelections(i)})},newlineAndIndent:function(e){return ut(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);Fr(e)})},openLine:function(e){return e.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function $l(e,t){var i=re(e.doc,t),r=xt(i);return r!=i&&(t=xe(r)),Oo(!0,e,r,t,1)}function gc(e,t){var i=re(e.doc,t),r=Ju(i);return r!=i&&(t=xe(r)),Oo(!0,e,i,t,-1)}function Vl(e,t){var i=$l(e,t.line),r=re(e.doc,i.line),n=Mt(r,e.doc.direction);if(!n||n[0].level==0){var o=Math.max(i.ch,r.text.search(/\S/)),s=t.line==i.line&&t.ch<=o&&t.ch;return q(i.line,s?0:o,i.sticky)}return i}function tn(e,t,i){if(typeof t=="string"&&(t=mi[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,n=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),i&&(e.display.shift=!1),n=t(e)!=Pe}finally{e.display.shift=r,e.state.suppressEdits=!1}return n}function vc(e,t,i){for(var r=0;r<e.state.keyMaps.length;r++){var n=Nr(t,e.state.keyMaps[r],i,e);if(n)return n}return e.options.extraKeys&&Nr(t,e.options.extraKeys,i,e)||Nr(t,e.options.keyMap,i,e)}var mc=new Je;function yi(e,t,i,r){var n=e.state.keySeq;if(n){if(Zl(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:mc.set(50,function(){e.state.keySeq==n&&(e.state.keySeq=null,e.display.input.reset())}),es(e,n+" "+t,i,r))return!0}return es(e,t,i,r)}function es(e,t,i,r){var n=vc(e,t,r);return n=="multi"&&(e.state.keySeq=t),n=="handled"&&qe(e,"keyHandled",e,t,i),(n=="handled"||n=="multi")&&(it(i),yo(e)),!!n}function ts(e,t){var i=Jl(t,!0);return i?t.shiftKey&&!e.state.keySeq?yi(e,"Shift-"+i,t,function(r){return tn(e,r,!0)})||yi(e,i,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return tn(e,r)}):yi(e,i,t,function(r){return tn(e,r)}):!1}function yc(e,t,i){return yi(e,"'"+i+"'",t,function(r){return tn(e,r,!0)})}var Ho=null;function rs(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=ve(ee(t)),!We(t,e))){f&&p<11&&e.keyCode==27&&(e.returnValue=!1);var i=e.keyCode;t.display.shift=i==16||e.shiftKey;var r=ts(t,e);T&&(Ho=r?i:null,!r&&i==88&&!zu&&(R?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),d&&!R&&!r&&i==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),i==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&bc(t)}}function bc(e){var t=e.display.lineDiv;Te(t,"CodeMirror-crosshair");function i(r){(r.keyCode==18||!r.altKey)&&(ue(t,"CodeMirror-crosshair"),ht(document,"keyup",i),ht(document,"mouseover",i))}oe(document,"keyup",i),oe(document,"mouseover",i)}function is(e){e.keyCode==16&&(this.doc.sel.shift=!1),We(this,e)}function ns(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(It(t.display,e)||We(t,e)||e.ctrlKey&&!e.altKey||R&&e.metaKey)){var i=e.keyCode,r=e.charCode;if(T&&i==Ho){Ho=null,it(e);return}if(!(T&&(!e.which||e.which<10)&&ts(t,e))){var n=String.fromCharCode(r??i);n!="\b"&&(yc(t,e,n)||t.display.input.onKeyPress(e))}}}var xc=400,Ro=function(e,t,i){this.time=e,this.pos=t,this.button=i};Ro.prototype.compare=function(e,t,i){return this.time+xc>e&&fe(t,this.pos)==0&&i==this.button};var bi,xi;function Dc(e,t){var i=+new Date;return xi&&xi.compare(i,e,t)?(bi=xi=null,"triple"):bi&&bi.compare(i,e,t)?(xi=new Ro(i,e,t),bi=null,"double"):(bi=new Ro(i,e,t),xi=null,"single")}function os(e){var t=this,i=t.display;if(!(We(t,e)||i.activeTouch&&i.input.supportsTouch())){if(i.input.ensurePolled(),i.shift=e.shiftKey,It(i,e)){b||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(!Po(t,e)){var r=nr(t,e),n=va(e),o=r?Dc(r,n):"single";he(t).focus(),n==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Cc(t,n,r,o,e))&&(n==1?r?kc(t,r,o,e):_n(e)==i.scroller&&it(e):n==2?(r&&Zi(t.doc,r),setTimeout(function(){return i.input.focus()},20)):n==3&&(ge?t.display.input.onContextMenu(e):bo(t)))}}}function Cc(e,t,i,r,n){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,yi(e,Ql(o,n),n,function(s){if(typeof s=="string"&&(s=mi[s]),!s)return!1;var h=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),h=s(e,i)!=Pe}finally{e.state.suppressEdits=!1}return h})}function wc(e,t,i){var r=e.getOption("configureMouse"),n=r?r(e,t,i):{};if(n.unit==null){var o=H?i.shiftKey&&i.metaKey:i.altKey;n.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(n.extend==null||e.doc.extend)&&(n.extend=e.doc.extend||i.shiftKey),n.addNew==null&&(n.addNew=R?i.metaKey:i.ctrlKey),n.moveOnDrag==null&&(n.moveOnDrag=!(R?i.altKey:i.ctrlKey)),n}function kc(e,t,i,r){f?setTimeout(tt(al,e),0):e.curOp.focus=ve(ee(e));var n=wc(e,i,r),o=e.doc.sel,s;e.options.dragDrop&&Mu&&!e.isReadOnly()&&i=="single"&&(s=o.contains(t))>-1&&(fe((s=o.ranges[s]).from(),t)<0||t.xRel>0)&&(fe(s.to(),t)>0||t.xRel<0)?Sc(e,r,t,n):Fc(e,r,t,n)}function Sc(e,t,i,r){var n=e.display,o=!1,s=Ue(e,function(m){b&&(n.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:bo(e)),ht(n.wrapper.ownerDocument,"mouseup",s),ht(n.wrapper.ownerDocument,"mousemove",h),ht(n.scroller,"dragstart",v),ht(n.scroller,"drop",s),o||(it(m),r.addNew||Zi(e.doc,i,null,null,r.extend),b&&!M||f&&p==9?setTimeout(function(){n.wrapper.ownerDocument.body.focus({preventScroll:!0}),n.input.focus()},20):n.input.focus())}),h=function(m){o=o||Math.abs(t.clientX-m.clientX)+Math.abs(t.clientY-m.clientY)>=10},v=function(){return o=!0};b&&(n.scroller.draggable=!0),e.state.draggingText=s,s.copy=!r.moveOnDrag,oe(n.wrapper.ownerDocument,"mouseup",s),oe(n.wrapper.ownerDocument,"mousemove",h),oe(n.scroller,"dragstart",v),oe(n.scroller,"drop",s),e.state.delayingBlurEvent=!0,setTimeout(function(){return n.input.focus()},20),n.scroller.dragDrop&&n.scroller.dragDrop()}function as(e,t,i){if(i=="char")return new be(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new be(q(t.line,0),ce(e.doc,q(t.line+1,0)));var r=i(e,t);return new be(r.from,r.to)}function Fc(e,t,i,r){f&&bo(e);var n=e.display,o=e.doc;it(t);var s,h,v=o.sel,m=v.ranges;if(r.addNew&&!r.extend?(h=o.sel.contains(i),h>-1?s=m[h]:s=new be(i,i)):(s=o.sel.primary(),h=o.sel.primIndex),r.unit=="rectangle")r.addNew||(s=new be(i,i)),i=nr(e,t,!0,!0),h=-1;else{var x=as(e,i,r.unit);r.extend?s=Bo(s,x.anchor,x.head,r.extend):s=x}r.addNew?h==-1?(h=m.length,Ze(o,Ct(e,m.concat([s]),h),{scroll:!1,origin:"*mouse"})):m.length>1&&m[h].empty()&&r.unit=="char"&&!r.extend?(Ze(o,Ct(e,m.slice(0,h).concat(m.slice(h+1)),0),{scroll:!1,origin:"*mouse"}),v=o.sel):No(o,h,s,Ur):(h=0,Ze(o,new pt([s],0),Ur),v=o.sel);var w=i;function L(Z){if(fe(w,Z)!=0)if(w=Z,r.unit=="rectangle"){for(var $=[],ne=e.options.tabSize,ie=Re(re(o,i.line).text,i.ch,ne),pe=Re(re(o,Z.line).text,Z.ch,ne),Ce=Math.min(ie,pe),Ge=Math.max(ie,pe),Le=Math.min(i.line,Z.line),ft=Math.min(e.lastLine(),Math.max(i.line,Z.line));Le<=ft;Le++){var at=re(o,Le).text,Oe=St(at,Ce,ne);Ce==Ge?$.push(new be(q(Le,Oe),q(Le,Oe))):at.length>Oe&&$.push(new be(q(Le,Oe),q(Le,St(at,Ge,ne))))}$.length||$.push(new be(i,i)),Ze(o,Ct(e,v.ranges.slice(0,h).concat($),h),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Z)}else{var lt=s,Xe=as(e,Z,r.unit),_e=lt.anchor,He;fe(Xe.anchor,_e)>0?(He=Xe.head,_e=Li(lt.from(),Xe.anchor)):(He=Xe.anchor,_e=Ai(lt.to(),Xe.head));var Be=v.ranges.slice(0);Be[h]=Ec(e,new be(ce(o,_e),He)),Ze(o,Ct(e,Be,h),Ur)}}var S=n.wrapper.getBoundingClientRect(),O=0;function P(Z){var $=++O,ne=nr(e,Z,!0,r.unit=="rectangle");if(ne)if(fe(ne,w)!=0){e.curOp.focus=ve(ee(e)),L(ne);var ie=Ui(n,o);(ne.line>=ie.to||ne.line<ie.from)&&setTimeout(Ue(e,function(){O==$&&P(Z)}),150)}else{var pe=Z.clientY<S.top?-20:Z.clientY>S.bottom?20:0;pe&&setTimeout(Ue(e,function(){O==$&&(n.scroller.scrollTop+=pe,P(Z))}),50)}}function j(Z){e.state.selectingText=!1,O=1/0,Z&&(it(Z),n.input.focus()),ht(n.wrapper.ownerDocument,"mousemove",Y),ht(n.wrapper.ownerDocument,"mouseup",Q),o.history.lastSelOrigin=null}var Y=Ue(e,function(Z){Z.buttons===0||!va(Z)?j(Z):P(Z)}),Q=Ue(e,j);e.state.selectingText=Q,oe(n.wrapper.ownerDocument,"mousemove",Y),oe(n.wrapper.ownerDocument,"mouseup",Q)}function Ec(e,t){var i=t.anchor,r=t.head,n=re(e.doc,i.line);if(fe(i,r)==0&&i.sticky==r.sticky)return t;var o=Mt(n);if(!o)return t;var s=Kr(o,i.ch,i.sticky),h=o[s];if(h.from!=i.ch&&h.to!=i.ch)return t;var v=s+(h.from==i.ch==(h.level!=1)?0:1);if(v==0||v==o.length)return t;var m;if(r.line!=i.line)m=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var x=Kr(o,r.ch,r.sticky),w=x-s||(r.ch-i.ch)*(h.level==1?-1:1);x==v-1||x==v?m=w<0:m=w>0}var L=o[v+(m?-1:0)],S=m==(L.level==1),O=S?L.from:L.to,P=S?"after":"before";return i.ch==O&&i.sticky==P?t:new be(new q(i.line,O,P),r)}function ls(e,t,i,r){var n,o;if(t.touches)n=t.touches[0].clientX,o=t.touches[0].clientY;else try{n=t.clientX,o=t.clientY}catch{return!1}if(n>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&it(t);var s=e.display,h=s.lineDiv.getBoundingClientRect();if(o>h.bottom||!mt(e,i))return Pn(t);o-=h.top-s.viewOffset;for(var v=0;v<e.display.gutterSpecs.length;++v){var m=s.gutters.childNodes[v];if(m&&m.getBoundingClientRect().right>=n){var x=tr(e.doc,o),w=e.display.gutterSpecs[v];return Ie(e,i,e,x,w.className,t),Pn(t)}}}function Po(e,t){return ls(e,t,"gutterClick",!0)}function ss(e,t){It(e.display,t)||Ac(e,t)||We(e,t,"contextmenu")||ge||e.display.input.onContextMenu(t)}function Ac(e,t){return mt(e,"gutterContextMenu")?ls(e,t,"gutterContextMenu",!1):!1}function us(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),ei(e)}var zr={toString:function(){return"CodeMirror.Init"}},fs={},rn={};function Lc(e){var t=e.optionHandlers;function i(r,n,o,s){e.defaults[r]=n,o&&(t[r]=s?function(h,v,m){m!=zr&&o(h,v,m)}:o)}e.defineOption=i,e.Init=zr,i("value","",function(r,n){return r.setValue(n)},!0),i("mode",null,function(r,n){r.doc.modeOption=n,Lo(r)},!0),i("indentUnit",2,Lo,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){si(r),ei(r),nt(r)},!0),i("lineSeparator",null,function(r,n){if(r.doc.lineSep=n,!!n){var o=[],s=r.doc.first;r.doc.iter(function(v){for(var m=0;;){var x=v.text.indexOf(n,m);if(x==-1)break;m=x+n.length,o.push(q(s,x))}s++});for(var h=o.length-1;h>=0;h--)Mr(r.doc,n,o[h],q(o[h].line,o[h].ch+n.length))}}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,n,o){r.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),o!=zr&&r.refresh()}),i("specialCharPlaceholder",nf,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",N?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,n){return r.getInputField().spellcheck=n},!0),i("autocorrect",!1,function(r,n){return r.getInputField().autocorrect=n},!0),i("autocapitalize",!1,function(r,n){return r.getInputField().autocapitalize=n},!0),i("rtlMoveVisually",!_),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){us(r),li(r)},!0),i("keyMap","default",function(r,n,o){var s=en(n),h=o!=zr&&en(o);h&&h.detach&&h.detach(r,s),s.attach&&s.attach(r,h||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Mc,!0),i("gutters",[],function(r,n){r.display.gutterSpecs=Eo(n,r.options.lineNumbers),li(r)},!0),i("fixedGutter",!0,function(r,n){r.display.gutters.style.left=n?go(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return Er(r)},!0),i("scrollbarStyle","native",function(r){dl(r),Er(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,n){r.display.gutterSpecs=Eo(r.options.gutters,n),li(r)},!0),i("firstLineNumber",1,li,!0),i("lineNumberFormatter",function(r){return r},li,!0),i("showCursorWhenSelecting",!1,ti,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,n){n=="nocursor"&&(Sr(r),r.display.input.blur()),r.display.input.readOnlyChanged(n)}),i("screenReaderLabel",null,function(r,n){n=n===""?null:n,r.display.input.screenReaderLabelChanged(n)}),i("disableInput",!1,function(r,n){n||r.display.input.reset()},!0),i("dragDrop",!0,Tc),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,ti,!0),i("singleCursorHeightPerLine",!0,ti,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,si,!0),i("addModeClass",!1,si,!0),i("pollInterval",100),i("undoDepth",200,function(r,n){return r.doc.history.undoDepth=n}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,si,!0),i("moveInputWithCursor",!0,function(r,n){n||r.display.input.resetPosition()}),i("tabindex",null,function(r,n){return r.display.input.getField().tabIndex=n||""}),i("autofocus",null),i("direction","ltr",function(r,n){return r.doc.setDirection(n)},!0),i("phrases",null)}function Tc(e,t,i){var r=i&&i!=zr;if(!t!=!r){var n=e.display.dragFunctions,o=t?oe:ht;o(e.display.scroller,"dragstart",n.start),o(e.display.scroller,"dragenter",n.enter),o(e.display.scroller,"dragover",n.over),o(e.display.scroller,"dragleave",n.leave),o(e.display.scroller,"drop",n.drop)}}function Mc(e){e.options.lineWrapping?(Te(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ue(e.display.wrapper,"CodeMirror-wrap"),no(e)),vo(e),nt(e),ei(e),setTimeout(function(){return Er(e)},100)}function Ee(e,t){var i=this;if(!(this instanceof Ee))return new Ee(e,t);this.options=t=t?dt(t):{},dt(fs,t,!1);var r=t.value;typeof r=="string"?r=new ot(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var n=new Ee.inputStyles[t.inputStyle](this),o=this.display=new jf(e,r,n,t);o.wrapper.CodeMirror=this,us(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),dl(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&&!N&&o.input.focus(),f&&p<11&&setTimeout(function(){return i.display.input.reset(!0)},20),Bc(this),uc(),sr(this),this.curOp.forceUpdate=!0,Cl(this,r),t.autofocus&&!N||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&xo(i)},20):Sr(this);for(var s in rn)rn.hasOwnProperty(s)&&rn[s](this,t[s],zr);gl(this),t.finishInit&&t.finishInit(this);for(var h=0;h<_o.length;++h)_o[h](this);ur(this),b&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"&&(o.lineDiv.style.textRendering="auto")}Ee.defaults=fs,Ee.optionHandlers=rn;function Bc(e){var t=e.display;oe(t.scroller,"mousedown",Ue(e,os)),f&&p<11?oe(t.scroller,"dblclick",Ue(e,function(v){if(!We(e,v)){var m=nr(e,v);if(!(!m||Po(e,v)||It(e.display,v))){it(v);var x=e.findWordAt(m);Zi(e.doc,x.anchor,x.head)}}})):oe(t.scroller,"dblclick",function(v){return We(e,v)||it(v)}),oe(t.scroller,"contextmenu",function(v){return ss(e,v)}),oe(t.input.getField(),"contextmenu",function(v){t.scroller.contains(v.target)||ss(e,v)});var i,r={end:0};function n(){t.activeTouch&&(i=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function o(v){if(v.touches.length!=1)return!1;var m=v.touches[0];return m.radiusX<=1&&m.radiusY<=1}function s(v,m){if(m.left==null)return!0;var x=m.left-v.left,w=m.top-v.top;return x*x+w*w>20*20}oe(t.scroller,"touchstart",function(v){if(!We(e,v)&&!o(v)&&!Po(e,v)){t.input.ensurePolled(),clearTimeout(i);var m=+new Date;t.activeTouch={start:m,moved:!1,prev:m-r.end<=300?r:null},v.touches.length==1&&(t.activeTouch.left=v.touches[0].pageX,t.activeTouch.top=v.touches[0].pageY)}}),oe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),oe(t.scroller,"touchend",function(v){var m=t.activeTouch;if(m&&!It(t,v)&&m.left!=null&&!m.moved&&new Date-m.start<300){var x=e.coordsChar(t.activeTouch,"page"),w;!m.prev||s(m,m.prev)?w=new be(x,x):!m.prev.prev||s(m,m.prev.prev)?w=e.findWordAt(x):w=new be(q(x.line,0),ce(e.doc,q(x.line+1,0))),e.setSelection(w.anchor,w.head),e.focus(),it(v)}n()}),oe(t.scroller,"touchcancel",n),oe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(ii(e,t.scroller.scrollTop),ar(e,t.scroller.scrollLeft,!0),Ie(e,"scroll",e))}),oe(t.scroller,"mousewheel",function(v){return yl(e,v)}),oe(t.scroller,"DOMMouseScroll",function(v){return yl(e,v)}),oe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(v){We(e,v)||Xr(v)},over:function(v){We(e,v)||(sc(e,v),Xr(v))},start:function(v){return lc(e,v)},drop:Ue(e,ac),leave:function(v){We(e,v)||Kl(e)}};var h=t.input.getField();oe(h,"keyup",function(v){return is.call(e,v)}),oe(h,"keydown",Ue(e,rs)),oe(h,"keypress",Ue(e,ns)),oe(h,"focus",function(v){return xo(e,v)}),oe(h,"blur",function(v){return Sr(e,v)})}var _o=[];Ee.defineInitHook=function(e){return _o.push(e)};function Di(e,t,i,r){var n=e.doc,o;i==null&&(i="add"),i=="smart"&&(n.mode.indent?o=Zr(e,t).state:i="prev");var s=e.options.tabSize,h=re(n,t),v=Re(h.text,null,s);h.stateAfter&&(h.stateAfter=null);var m=h.text.match(/^\s*/)[0],x;if(!r&&!/\S/.test(h.text))x=0,i="not";else if(i=="smart"&&(x=n.mode.indent(o,h.text.slice(m.length),h.text),x==Pe||x>150)){if(!r)return;i="prev"}i=="prev"?t>n.first?x=Re(re(n,t-1).text,null,s):x=0:i=="add"?x=v+e.options.indentUnit:i=="subtract"?x=v-e.options.indentUnit:typeof i=="number"&&(x=v+i),x=Math.max(0,x);var w="",L=0;if(e.options.indentWithTabs)for(var S=Math.floor(x/s);S;--S)L+=s,w+=" ";if(L<x&&(w+=Pt(x-L)),w!=m)return Mr(n,w,q(t,0),q(t,m.length),"+input"),h.stateAfter=null,!0;for(var O=0;O<n.sel.ranges.length;O++){var P=n.sel.ranges[O];if(P.head.line==t&&P.head.ch<m.length){var j=q(t,m.length);No(n,O,new be(j,j));break}}}var wt=null;function nn(e){wt=e}function Wo(e,t,i,r,n){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var s=+new Date-200,h=n=="paste"||e.state.pasteIncoming>s,v=Un(t),m=null;if(h&&r.ranges.length>1)if(wt&&wt.text.join(`
|
|
`)==t){if(r.ranges.length%wt.text.length==0){m=[];for(var x=0;x<wt.text.length;x++)m.push(o.splitLines(wt.text[x]))}}else v.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(m=bt(v,function(Y){return[Y]}));for(var w=e.curOp.updateInput,L=r.ranges.length-1;L>=0;L--){var S=r.ranges[L],O=S.from(),P=S.to();S.empty()&&(i&&i>0?O=q(O.line,O.ch-i):e.state.overwrite&&!h?P=q(P.line,Math.min(re(o,P.line).text.length,P.ch+me(v).length)):h&&wt&&wt.lineWise&&wt.text.join(`
|
|
`)==v.join(`
|
|
`)&&(O=P=q(O.line,0)));var j={from:O,to:P,text:m?m[L%m.length]:v,origin:n||(h?"paste":e.state.cutIncoming>s?"cut":"+input")};Tr(e.doc,j),qe(e,"inputRead",e,j)}t&&!h&&ds(e,t),Fr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=w),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function cs(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&ut(t,function(){return Wo(t,i,0,null,"paste")}),!0}function ds(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var n=i.ranges[r];if(!(n.head.ch>100||r&&i.ranges[r-1].head.line==n.head.line)){var o=e.getModeAt(n.head),s=!1;if(o.electricChars){for(var h=0;h<o.electricChars.length;h++)if(t.indexOf(o.electricChars.charAt(h))>-1){s=Di(e,n.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(re(e.doc,n.head.line).text.slice(0,n.head.ch))&&(s=Di(e,n.head.line,"smart"));s&&qe(e,"electricInput",e,n.head.line)}}}function hs(e){for(var t=[],i=[],r=0;r<e.doc.sel.ranges.length;r++){var n=e.doc.sel.ranges[r].head.line,o={anchor:q(n,0),head:q(n+1,0)};i.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:i}}function qo(e,t,i,r){e.setAttribute("autocorrect",i?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function ps(){var e=A("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=A("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return b?e.style.width="1000px":e.setAttribute("wrap","off"),F&&(e.style.border="1px solid black"),t}function Nc(e){var t=e.optionHandlers,i=e.helpers={};e.prototype={constructor:e,focus:function(){he(this).focus(),this.display.input.focus()},setOption:function(r,n){var o=this.options,s=o[r];o[r]==n&&r!="mode"||(o[r]=n,t.hasOwnProperty(r)&&Ue(this,t[r])(this,n,s),Ie(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,n){this.state.keyMaps[n?"push":"unshift"](en(r))},removeKeyMap:function(r){for(var n=this.state.keyMaps,o=0;o<n.length;++o)if(n[o]==r||n[o].name==r)return n.splice(o,1),!0},addOverlay:$e(function(r,n){var o=r.token?r:e.getMode(this.options,r);if(o.startState)throw new Error("Overlays may not be stateful.");_t(this.state.overlays,{mode:o,modeSpec:r,opaque:n&&n.opaque,priority:n&&n.priority||0},function(s){return s.priority}),this.state.modeGen++,nt(this)}),removeOverlay:$e(function(r){for(var n=this.state.overlays,o=0;o<n.length;++o){var s=n[o].modeSpec;if(s==r||typeof r=="string"&&s.name==r){n.splice(o,1),this.state.modeGen++,nt(this);return}}}),indentLine:$e(function(r,n,o){typeof n!="string"&&typeof n!="number"&&(n==null?n=this.options.smartIndent?"smart":"prev":n=n?"add":"subtract"),Yr(this.doc,r)&&Di(this,r,n,o)}),indentSelection:$e(function(r){for(var n=this.doc.sel.ranges,o=-1,s=0;s<n.length;s++){var h=n[s];if(h.empty())h.head.line>o&&(Di(this,h.head.line,r,!0),o=h.head.line,s==this.doc.sel.primIndex&&Fr(this));else{var v=h.from(),m=h.to(),x=Math.max(o,v.line);o=Math.min(this.lastLine(),m.line-(m.ch?0:1))+1;for(var w=x;w<o;++w)Di(this,w,r);var L=this.doc.sel.ranges;v.ch==0&&n.length==L.length&&L[s].from().ch>0&&No(this.doc,s,new be(v,L[s].to()),rt)}}}),getTokenAt:function(r,n){return ka(this,r,n)},getLineTokens:function(r,n){return ka(this,q(r),n,!0)},getTokenTypeAt:function(r){r=ce(this.doc,r);var n=Da(this,re(this.doc,r.line)),o=0,s=(n.length-1)/2,h=r.ch,v;if(h==0)v=n[2];else for(;;){var m=o+s>>1;if((m?n[m*2-1]:0)>=h)s=m;else if(n[m*2+1]<h)o=m+1;else{v=n[m*2+2];break}}var x=v?v.indexOf("overlay "):-1;return x<0?v:x==0?null:v.slice(0,x-1)},getModeAt:function(r){var n=this.doc.mode;return n.innerMode?e.innerMode(n,this.getTokenAt(r).state).mode:n},getHelper:function(r,n){return this.getHelpers(r,n)[0]},getHelpers:function(r,n){var o=[];if(!i.hasOwnProperty(n))return o;var s=i[n],h=this.getModeAt(r);if(typeof h[n]=="string")s[h[n]]&&o.push(s[h[n]]);else if(h[n])for(var v=0;v<h[n].length;v++){var m=s[h[n][v]];m&&o.push(m)}else h.helperType&&s[h.helperType]?o.push(s[h.helperType]):s[h.name]&&o.push(s[h.name]);for(var x=0;x<s._global.length;x++){var w=s._global[x];w.pred(h,this)&&Fe(o,w.val)==-1&&o.push(w.val)}return o},getStateAfter:function(r,n){var o=this.doc;return r=ya(o,r??o.first+o.size-1),Zr(this,r+1,n).state},cursorCoords:function(r,n){var o,s=this.doc.sel.primary();return r==null?o=s.head:typeof r=="object"?o=ce(this.doc,r):o=r?s.from():s.to(),Dt(this,o,n||"page")},charCoords:function(r,n){return Pi(this,ce(this.doc,r),n||"page")},coordsChar:function(r,n){return r=Va(this,r,n||"page"),co(this,r.left,r.top)},lineAtHeight:function(r,n){return r=Va(this,{top:r,left:0},n||"page").top,tr(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,n,o){var s=!1,h;if(typeof r=="number"){var v=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>v&&(r=v,s=!0),h=re(this.doc,r)}else h=r;return Ri(this,h,{top:0,left:0},n||"page",o||s).top+(s?this.doc.height-Nt(h):0)},defaultTextHeight:function(){return wr(this.display)},defaultCharWidth:function(){return kr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,n,o,s,h){var v=this.display;r=Dt(this,ce(this.doc,r));var m=r.bottom,x=r.left;if(n.style.position="absolute",n.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(n),v.sizer.appendChild(n),s=="over")m=r.top;else if(s=="above"||s=="near"){var w=Math.max(v.wrapper.clientHeight,this.doc.height),L=Math.max(v.sizer.clientWidth,v.lineSpace.clientWidth);(s=="above"||r.bottom+n.offsetHeight>w)&&r.top>n.offsetHeight?m=r.top-n.offsetHeight:r.bottom+n.offsetHeight<=w&&(m=r.bottom),x+n.offsetWidth>L&&(x=L-n.offsetWidth)}n.style.top=m+"px",n.style.left=n.style.right="",h=="right"?(x=v.sizer.clientWidth-n.offsetWidth,n.style.right="0px"):(h=="left"?x=0:h=="middle"&&(x=(v.sizer.clientWidth-n.offsetWidth)/2),n.style.left=x+"px"),o&&Tf(this,{left:x,top:m,right:x+n.offsetWidth,bottom:m+n.offsetHeight})},triggerOnKeyDown:$e(rs),triggerOnKeyPress:$e(ns),triggerOnKeyUp:is,triggerOnMouseDown:$e(os),execCommand:function(r){if(mi.hasOwnProperty(r))return mi[r].call(null,this)},triggerElectric:$e(function(r){ds(this,r)}),findPosH:function(r,n,o,s){var h=1;n<0&&(h=-1,n=-n);for(var v=ce(this.doc,r),m=0;m<n&&(v=Uo(this.doc,v,h,o,s),!v.hitSide);++m);return v},moveH:$e(function(r,n){var o=this;this.extendSelectionsBy(function(s){return o.display.shift||o.doc.extend||s.empty()?Uo(o.doc,s.head,r,n,o.options.rtlMoveVisually):r<0?s.from():s.to()},kt)}),deleteH:$e(function(r,n){var o=this.doc.sel,s=this.doc;o.somethingSelected()?s.replaceSelection("",null,"+delete"):Ir(this,function(h){var v=Uo(s,h.head,r,n,!1);return r<0?{from:v,to:h.head}:{from:h.head,to:v}})}),findPosV:function(r,n,o,s){var h=1,v=s;n<0&&(h=-1,n=-n);for(var m=ce(this.doc,r),x=0;x<n;++x){var w=Dt(this,m,"div");if(v==null?v=w.left:w.left=v,m=gs(this,w,h,o),m.hitSide)break}return m},moveV:$e(function(r,n){var o=this,s=this.doc,h=[],v=!this.display.shift&&!s.extend&&s.sel.somethingSelected();if(s.extendSelectionsBy(function(x){if(v)return r<0?x.from():x.to();var w=Dt(o,x.head,"div");x.goalColumn!=null&&(w.left=x.goalColumn),h.push(w.left);var L=gs(o,w,r,n);return n=="page"&&x==s.sel.primary()&&Co(o,Pi(o,L,"div").top-w.top),L},kt),h.length)for(var m=0;m<s.sel.ranges.length;m++)s.sel.ranges[m].goalColumn=h[m]}),findWordAt:function(r){var n=this.doc,o=re(n,r.line).text,s=r.ch,h=r.ch;if(o){var v=this.getHelper(r,"wordChars");(r.sticky=="before"||h==o.length)&&s?--s:++h;for(var m=o.charAt(s),x=Fi(m,v)?function(w){return Fi(w,v)}:/\s/.test(m)?function(w){return/\s/.test(w)}:function(w){return!/\s/.test(w)&&!Fi(w)};s>0&&x(o.charAt(s-1));)--s;for(;h<o.length&&x(o.charAt(h));)++h}return new be(q(r.line,s),q(r.line,h))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Te(this.display.cursorDiv,"CodeMirror-overwrite"):ue(this.display.cursorDiv,"CodeMirror-overwrite"),Ie(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==ve(ee(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:$e(function(r,n){ri(this,r,n)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-At(this)-this.display.barHeight,width:r.scrollWidth-At(this)-this.display.barWidth,clientHeight:lo(this),clientWidth:rr(this)}},scrollIntoView:$e(function(r,n){r==null?(r={from:this.doc.sel.primary().head,to:null},n==null&&(n=this.options.cursorScrollMargin)):typeof r=="number"?r={from:q(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=n||0,r.from.line!=null?Mf(this,r):sl(this,r.from,r.to,r.margin)}),setSize:$e(function(r,n){var o=this,s=function(v){return typeof v=="number"||/^\d+$/.test(String(v))?v+"px":v};r!=null&&(this.display.wrapper.style.width=s(r)),n!=null&&(this.display.wrapper.style.height=s(n)),this.options.lineWrapping&&Qa(this);var h=this.display.viewFrom;this.doc.iter(h,this.display.viewTo,function(v){if(v.widgets){for(var m=0;m<v.widgets.length;m++)if(v.widgets[m].noHScroll){qt(o,h,"widget");break}}++h}),this.curOp.forceUpdate=!0,Ie(this,"refresh",this)}),operation:function(r){return ut(this,r)},startOperation:function(){return sr(this)},endOperation:function(){return ur(this)},refresh:$e(function(){var r=this.display.cachedTextHeight;nt(this),this.curOp.forceUpdate=!0,ei(this),ri(this,this.doc.scrollLeft,this.doc.scrollTop),So(this.display),(r==null||Math.abs(r-wr(this.display))>.5||this.options.lineWrapping)&&vo(this),Ie(this,"refresh",this)}),swapDoc:$e(function(r){var n=this.doc;return n.cm=null,this.state.selectingText&&this.state.selectingText(),Cl(this,r),ei(this),this.display.input.reset(),ri(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,qe(this,"swapDoc",this,n),n}),phrase:function(r){var n=this.options.phrases;return n&&Object.prototype.hasOwnProperty.call(n,r)?n[r]:r},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}},mr(e),e.registerHelper=function(r,n,o){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][n]=o},e.registerGlobalHelper=function(r,n,o,s){e.registerHelper(r,n,s),i[r]._global.push({pred:o,val:s})}}function Uo(e,t,i,r,n){var o=t,s=i,h=re(e,t.line),v=n&&e.direction=="rtl"?-i:i;function m(){var Q=t.line+v;return Q<e.first||Q>=e.first+e.size?!1:(t=new q(Q,t.ch,t.sticky),h=re(e,Q))}function x(Q){var Z;if(r=="codepoint"){var $=h.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN($))Z=null;else{var ne=i>0?$>=55296&&$<56320:$>=56320&&$<57343;Z=new q(t.line,Math.max(0,Math.min(h.text.length,t.ch+i*(ne?2:1))),-i)}}else n?Z=pc(e.cm,h,t,i):Z=zo(h,t,i);if(Z==null)if(!Q&&m())t=Oo(n,e.cm,h,t.line,v);else return!1;else t=Z;return!0}if(r=="char"||r=="codepoint")x();else if(r=="column")x(!0);else if(r=="word"||r=="group")for(var w=null,L=r=="group",S=e.cm&&e.cm.getHelper(t,"wordChars"),O=!0;!(i<0&&!x(!O));O=!1){var P=h.text.charAt(t.ch)||`
|
|
`,j=Fi(P,S)?"w":L&&P==`
|
|
`?"n":!L||/\s/.test(P)?null:"p";if(L&&!O&&!j&&(j="s"),w&&w!=j){i<0&&(i=1,x(),t.sticky="after");break}if(j&&(w=j),i>0&&!x(!O))break}var Y=Ji(e,t,o,s,!0);return Qn(o,Y)&&(Y.hitSide=!0),Y}function gs(e,t,i,r){var n=e.doc,o=t.left,s;if(r=="page"){var h=Math.min(e.display.wrapper.clientHeight,he(e).innerHeight||n(e).documentElement.clientHeight),v=Math.max(h-.5*wr(e.display),3);s=(i>0?t.bottom:t.top)+i*v}else r=="line"&&(s=i>0?t.bottom+3:t.top-3);for(var m;m=co(e,o,s),!!m.outside;){if(i<0?s<=0:s>=n.height){m.hitSide=!0;break}s+=i*5}return m}var De=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};De.prototype.init=function(e){var t=this,i=this,r=i.cm,n=i.div=e.lineDiv;n.contentEditable=!0,qo(n,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(h){for(var v=h.target;v;v=v.parentNode){if(v==n)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(v.className))break}return!1}oe(n,"paste",function(h){!o(h)||We(r,h)||cs(h,r)||p<=11&&setTimeout(Ue(r,function(){return t.updateFromDOM()}),20)}),oe(n,"compositionstart",function(h){t.composing={data:h.data,done:!1}}),oe(n,"compositionupdate",function(h){t.composing||(t.composing={data:h.data,done:!1})}),oe(n,"compositionend",function(h){t.composing&&(h.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),oe(n,"touchstart",function(){return i.forceCompositionEnd()}),oe(n,"input",function(){t.composing||t.readFromDOMSoon()});function s(h){if(!(!o(h)||We(r,h))){if(r.somethingSelected())nn({lineWise:!1,text:r.getSelections()}),h.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var v=hs(r);nn({lineWise:!0,text:v.text}),h.type=="cut"&&r.operation(function(){r.setSelections(v.ranges,0,rt),r.replaceSelection("",null,"cut")})}else return;if(h.clipboardData){h.clipboardData.clearData();var m=wt.text.join(`
|
|
`);if(h.clipboardData.setData("Text",m),h.clipboardData.getData("Text")==m){h.preventDefault();return}}var x=ps(),w=x.firstChild;qo(w),r.display.lineSpace.insertBefore(x,r.display.lineSpace.firstChild),w.value=wt.text.join(`
|
|
`);var L=ve(ye(n));k(w),setTimeout(function(){r.display.lineSpace.removeChild(x),L.focus(),L==n&&i.showPrimarySelection()},50)}}oe(n,"copy",s),oe(n,"cut",s)},De.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},De.prototype.prepareSelection=function(){var e=ol(this.cm,!1);return e.focus=ve(ye(this.div))==this.div,e},De.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},De.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},De.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),n=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||n.line<t.display.viewFrom){e.removeAllRanges();return}var o=on(t,e.anchorNode,e.anchorOffset),s=on(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&s&&!s.bad&&fe(Li(o,s),r)==0&&fe(Ai(o,s),n)==0)){var h=t.display.view,v=r.line>=t.display.viewFrom&&vs(t,r)||{node:h[0].measure.map[2],offset:0},m=n.line<t.display.viewTo&&vs(t,n);if(!m){var x=h[h.length-1].measure,w=x.maps?x.maps[x.maps.length-1]:x.map;m={node:w[w.length-1],offset:w[w.length-2]-w[w.length-3]}}if(!v||!m){e.removeAllRanges();return}var L=e.rangeCount&&e.getRangeAt(0),S;try{S=W(v.node,v.offset,m.offset,m.node)}catch{}S&&(!d&&t.state.focused?(e.collapse(v.node,v.offset),S.collapsed||(e.removeAllRanges(),e.addRange(S))):(e.removeAllRanges(),e.addRange(S)),L&&e.anchorNode==null?e.addRange(L):d&&this.startGracePeriod()),this.rememberSelection()}},De.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)},De.prototype.showMultipleSelections=function(e){de(this.cm.display.cursorDiv,e.cursors),de(this.cm.display.selectionDiv,e.selection)},De.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},De.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return V(this.div,t)},De.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||ve(ye(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},De.prototype.blur=function(){this.div.blur()},De.prototype.getField=function(){return this.div},De.prototype.supportsTouch=function(){return!0},De.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):ut(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function i(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,i))}this.polling.set(this.cm.options.pollInterval,i)},De.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},De.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(B&&D&&this.cm.display.gutterSpecs.length&&Ic(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var i=on(t,e.anchorNode,e.anchorOffset),r=on(t,e.focusNode,e.focusOffset);i&&r&&ut(t,function(){Ze(t.doc,jt(i,r),rt),(i.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},De.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,i=e.doc.sel.primary(),r=i.from(),n=i.to();if(r.ch==0&&r.line>e.firstLine()&&(r=q(r.line-1,re(e.doc,r.line-1).length)),n.ch==re(e.doc,n.line).text.length&&n.line<e.lastLine()&&(n=q(n.line+1,0)),r.line<t.viewFrom||n.line>t.viewTo-1)return!1;var o,s,h;r.line==t.viewFrom||(o=or(e,r.line))==0?(s=xe(t.view[0].line),h=t.view[0].node):(s=xe(t.view[o].line),h=t.view[o-1].node.nextSibling);var v=or(e,n.line),m,x;if(v==t.view.length-1?(m=t.viewTo-1,x=t.lineDiv.lastChild):(m=xe(t.view[v+1].line)-1,x=t.view[v+1].node.previousSibling),!h)return!1;for(var w=e.doc.splitLines(zc(e,h,x,s,m)),L=er(e.doc,q(s,0),q(m,re(e.doc,m).text.length));w.length>1&&L.length>1;)if(me(w)==me(L))w.pop(),L.pop(),m--;else if(w[0]==L[0])w.shift(),L.shift(),s++;else break;for(var S=0,O=0,P=w[0],j=L[0],Y=Math.min(P.length,j.length);S<Y&&P.charCodeAt(S)==j.charCodeAt(S);)++S;for(var Q=me(w),Z=me(L),$=Math.min(Q.length-(w.length==1?S:0),Z.length-(L.length==1?S:0));O<$&&Q.charCodeAt(Q.length-O-1)==Z.charCodeAt(Z.length-O-1);)++O;if(w.length==1&&L.length==1&&s==r.line)for(;S&&S>r.ch&&Q.charCodeAt(Q.length-O-1)==Z.charCodeAt(Z.length-O-1);)S--,O++;w[w.length-1]=Q.slice(0,Q.length-O).replace(/^\u200b+/,""),w[0]=w[0].slice(S).replace(/\u200b+$/,"");var ne=q(s,S),ie=q(m,L.length?me(L).length-O:0);if(w.length>1||w[0]||fe(ne,ie))return Mr(e.doc,w,ne,ie,"+input"),!0},De.prototype.ensurePolled=function(){this.forceCompositionEnd()},De.prototype.reset=function(){this.forceCompositionEnd()},De.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},De.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))},De.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ut(this.cm,function(){return nt(e.cm)})},De.prototype.setUneditable=function(e){e.contentEditable="false"},De.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Ue(this.cm,Wo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},De.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},De.prototype.onContextMenu=function(){},De.prototype.resetPosition=function(){},De.prototype.needsContentAttribute=!0;function vs(e,t){var i=so(e,t.line);if(!i||i.hidden)return null;var r=re(e.doc,t.line),n=Ga(i,r,t.line),o=Mt(r,e.doc.direction),s="left";if(o){var h=Kr(o,t.ch);s=h%2?"right":"left"}var v=Ya(n.map,t.ch,s);return v.offset=v.collapse=="right"?v.end:v.start,v}function Ic(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Or(e,t){return t&&(e.bad=!0),e}function zc(e,t,i,r,n){var o="",s=!1,h=e.doc.lineSeparator(),v=!1;function m(S){return function(O){return O.id==S}}function x(){s&&(o+=h,v&&(o+=h),s=v=!1)}function w(S){S&&(x(),o+=S)}function L(S){if(S.nodeType==1){var O=S.getAttribute("cm-text");if(O){w(O);return}var P=S.getAttribute("cm-marker"),j;if(P){var Y=e.findMarks(q(r,0),q(n+1,0),m(+P));Y.length&&(j=Y[0].find(0))&&w(er(e.doc,j.from,j.to).join(h));return}if(S.getAttribute("contenteditable")=="false")return;var Q=/^(pre|div|p|li|table|br)$/i.test(S.nodeName);if(!/^br$/i.test(S.nodeName)&&S.textContent.length==0)return;Q&&x();for(var Z=0;Z<S.childNodes.length;Z++)L(S.childNodes[Z]);/^(pre|p)$/i.test(S.nodeName)&&(v=!0),Q&&(s=!0)}else S.nodeType==3&&w(S.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;L(t),t!=i;)t=t.nextSibling,v=!1;return o}function on(e,t,i){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[i],!r)return Or(e.clipPos(q(e.display.viewTo-1)),!0);t=null,i=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var n=0;n<e.display.view.length;n++){var o=e.display.view[n];if(o.node==r)return Oc(o,t,i)}}function Oc(e,t,i){var r=e.text.firstChild,n=!1;if(!t||!V(r,t))return Or(q(xe(e.line),0),!0);if(t==r&&(n=!0,t=r.childNodes[i],i=0,!t)){var o=e.rest?me(e.rest):e.line;return Or(q(xe(o),o.text.length),n)}var s=t.nodeType==3?t:null,h=t;for(!s&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(s=t.firstChild,i&&(i=s.nodeValue.length));h.parentNode!=r;)h=h.parentNode;var v=e.measure,m=v.maps;function x(j,Y,Q){for(var Z=-1;Z<(m?m.length:0);Z++)for(var $=Z<0?v.map:m[Z],ne=0;ne<$.length;ne+=3){var ie=$[ne+2];if(ie==j||ie==Y){var pe=xe(Z<0?e.line:e.rest[Z]),Ce=$[ne]+Q;return(Q<0||ie!=j)&&(Ce=$[ne+(Q?1:0)]),q(pe,Ce)}}}var w=x(s,h,i);if(w)return Or(w,n);for(var L=h.nextSibling,S=s?s.nodeValue.length-i:0;L;L=L.nextSibling){if(w=x(L,L.firstChild,0),w)return Or(q(w.line,w.ch-S),n);S+=L.textContent.length}for(var O=h.previousSibling,P=i;O;O=O.previousSibling){if(w=x(O,O.firstChild,-1),w)return Or(q(w.line,w.ch+P),n);P+=O.textContent.length}}var Ne=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Je,this.hasSelection=!1,this.composing=null,this.resetting=!1};Ne.prototype.init=function(e){var t=this,i=this,r=this.cm;this.createField(e);var n=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),F&&(n.style.width="0px"),oe(n,"input",function(){f&&p>=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),oe(n,"paste",function(s){We(r,s)||cs(s,r)||(r.state.pasteIncoming=+new Date,i.fastPoll())});function o(s){if(!We(r,s)){if(r.somethingSelected())nn({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var h=hs(r);nn({lineWise:!0,text:h.text}),s.type=="cut"?r.setSelections(h.ranges,null,rt):(i.prevInput="",n.value=h.text.join(`
|
|
`),k(n))}else return;s.type=="cut"&&(r.state.cutIncoming=+new Date)}}oe(n,"cut",o),oe(n,"copy",o),oe(e.scroller,"paste",function(s){if(!(It(e,s)||We(r,s))){if(!n.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var h=new Event("paste");h.clipboardData=s.clipboardData,n.dispatchEvent(h)}}),oe(e.lineSpace,"selectstart",function(s){It(e,s)||it(s)}),oe(n,"compositionstart",function(){var s=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:s,range:r.markText(s,r.getCursor("to"),{className:"CodeMirror-composing"})}}),oe(n,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},Ne.prototype.createField=function(e){this.wrapper=ps(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;qo(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},Ne.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Ne.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=ol(e);if(e.options.moveInputWithCursor){var n=Dt(e,i.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),s=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+s.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+s.left-o.left))}return r},Ne.prototype.showSelection=function(e){var t=this.cm,i=t.display;de(i.cursorDiv,e.cursors),de(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},Ne.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&k(this.textarea),f&&p>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",f&&p>=9&&(this.hasSelection=null));this.resetting=!1}},Ne.prototype.getField=function(){return this.textarea},Ne.prototype.supportsTouch=function(){return!1},Ne.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!N||ve(ye(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},Ne.prototype.blur=function(){this.textarea.blur()},Ne.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Ne.prototype.receivedFocus=function(){this.slowPoll()},Ne.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},Ne.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},Ne.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Iu(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var n=i.value;if(n==r&&!t.somethingSelected())return!1;if(f&&p>=9&&this.hasSelection===n||R&&/[\uf700-\uf7ff]/.test(n))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=n.charCodeAt(0);if(o==8203&&!r&&(r="\u200B"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var s=0,h=Math.min(r.length,n.length);s<h&&r.charCodeAt(s)==n.charCodeAt(s);)++s;return ut(t,function(){Wo(t,n.slice(s),r.length-s,null,e.composing?"*compose":null),n.length>1e3||n.indexOf(`
|
|
`)>-1?i.value=e.prevInput="":e.prevInput=n,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},Ne.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Ne.prototype.onKeyPress=function(){f&&p>=9&&(this.hasSelection=null),this.fastPoll()},Ne.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,n=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=nr(i,e),s=r.scroller.scrollTop;if(!o||T)return;var h=i.options.resetSelectionOnContextMenu;h&&i.doc.sel.contains(o)==-1&&Ue(i,Ze)(i.doc,jt(o),rt);var v=n.style.cssText,m=t.wrapper.style.cssText,x=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",n.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(e.clientY-x.top-5)+"px; left: "+(e.clientX-x.left-5)+`px;
|
|
z-index: 1000; background: `+(f?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var w;b&&(w=n.ownerDocument.defaultView.scrollY),r.input.focus(),b&&n.ownerDocument.defaultView.scrollTo(null,w),r.input.reset(),i.somethingSelected()||(n.value=t.prevInput=" "),t.contextMenuPending=S,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function L(){if(n.selectionStart!=null){var P=i.somethingSelected(),j="\u200B"+(P?n.value:"");n.value="\u21DA",n.value=j,t.prevInput=P?"":"\u200B",n.selectionStart=1,n.selectionEnd=j.length,r.selForContextMenu=i.doc.sel}}function S(){if(t.contextMenuPending==S&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,n.style.cssText=v,f&&p<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=s),n.selectionStart!=null)){(!f||f&&p<9)&&L();var P=0,j=function(){r.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="\u200B"?Ue(i,zl)(i):P++<10?r.detectingSelectAll=setTimeout(j,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(j,200)}}if(f&&p>=9&&L(),ge){Xr(e);var O=function(){ht(window,"mouseup",O),setTimeout(S,20)};oe(window,"mouseup",O)}else setTimeout(S,50)},Ne.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Ne.prototype.setUneditable=function(){},Ne.prototype.needsContentAttribute=!1;function Hc(e,t){if(t=t?dt(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 i=ve(ye(e));t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=h.getValue()}var n;if(e.form&&(oe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;n=o.submit;try{var s=o.submit=function(){r(),o.submit=n,o.submit(),o.submit=s}}catch{}}t.finishInit=function(v){v.save=r,v.getTextArea=function(){return e},v.toTextArea=function(){v.toTextArea=isNaN,r(),e.parentNode.removeChild(v.getWrapperElement()),e.style.display="",e.form&&(ht(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=n))}},e.style.display="none";var h=Ee(function(v){return e.parentNode.insertBefore(v,e.nextSibling)},t);return h}function Rc(e){e.off=ht,e.on=oe,e.wheelEventPixels=Gf,e.Doc=ot,e.splitLines=Un,e.countColumn=Re,e.findColumn=St,e.isWordChar=On,e.Pass=Pe,e.signal=Ie,e.Line=xr,e.changeEnd=Gt,e.scrollbarModel=cl,e.Pos=q,e.cmpPos=fe,e.modes=Gn,e.mimeModes=yr,e.resolveMode=Ei,e.getMode=Kn,e.modeExtensions=br,e.extendMode=Pu,e.copyState=Vt,e.startState=ma,e.innerMode=Xn,e.commands=mi,e.keyMap=Ot,e.keyName=Jl,e.isModifierKey=Zl,e.lookupKey=Nr,e.normalizeKeyMap=hc,e.StringStream=ze,e.SharedTextMarker=pi,e.TextMarker=Xt,e.LineWidget=hi,e.e_preventDefault=it,e.e_stopPropagation=ga,e.e_stop=Xr,e.addClass=Te,e.contains=V,e.rmClass=ue,e.keyNames=Yt}Lc(Ee),Nc(Ee);var Pc="iter insert remove copy getEditor constructor".split(" ");for(var an in ot.prototype)ot.prototype.hasOwnProperty(an)&&Fe(Pc,an)<0&&(Ee.prototype[an]=function(e){return function(){return e.apply(this.doc,arguments)}}(ot.prototype[an]));return mr(ot),Ee.inputStyles={textarea:Ne,contenteditable:De},Ee.defineMode=function(e){!Ee.defaults.mode&&e!="null"&&(Ee.defaults.mode=e),Hu.apply(this,arguments)},Ee.defineMIME=Ru,Ee.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ee.defineMIME("text/plain","null"),Ee.defineExtension=function(e,t){Ee.prototype[e]=t},Ee.defineDocExtension=function(e,t){ot.prototype[e]=t},Ee.fromTextArea=Hc,Rc(Ee),Ee.version="5.65.21",Ee})});var xs=Ye((ys,bs)=>{(function(a){typeof ys=="object"&&typeof bs=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";var c=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,d=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,l=/[*+-]\s/;a.commands.newlineAndIndentContinueMarkdownList=function(g){if(g.getOption("disableInput"))return a.Pass;for(var f=g.listSelections(),p=[],b=0;b<f.length;b++){var C=f[b].head,D=g.getStateAfter(C.line),E=a.innerMode(g.getMode(),D);if(E.mode.name!=="markdown"&&E.mode.helperType!=="markdown"){g.execCommand("newlineAndIndent");return}else D=E.state;var T=D.list!==!1,M=D.quote!==0,z=g.getLine(C.line),I=c.exec(z),F=/^\s*$/.test(z.slice(0,C.ch));if(!f[b].empty()||!T&&!M||!I||F){g.execCommand("newlineAndIndent");return}if(d.test(z)){var B=M&&/>\s*$/.test(z),N=!/>\s*$/.test(z);(B||N)&&g.replaceRange("",{line:C.line,ch:0},{line:C.line,ch:C.ch+1}),p[b]=`
|
|
`}else{var R=I[1],H=I[5],_=!(l.test(I[2])||I[2].indexOf(">")>=0),X=_?parseInt(I[3],10)+1+I[4]:I[2].replace("x"," ");p[b]=`
|
|
`+R+X+H,_&&u(g,C)}}g.replaceSelections(p)};function u(g,f){var p=f.line,b=0,C=0,D=c.exec(g.getLine(p)),E=D[1];do{b+=1;var T=p+b,M=g.getLine(T),z=c.exec(M);if(z){var I=z[1],F=parseInt(D[3],10)+b-C,B=parseInt(z[3],10),N=B;if(E===I&&!isNaN(B))F===B&&(N=B+1),F>B&&(N=F+1),g.replaceRange(M.replace(c,I+N+z[4]+z[5]),{line:T,ch:0},{line:T,ch:M.length});else{if(E.length>I.length||E.length<I.length&&b===1)return;C+=1}}}while(z)}})});var Cs=Ye(()=>{var Ds=ct();Ds.commands.tabAndIndentMarkdownList=function(a){var c=a.listSelections(),d=c[0].head,l=a.getStateAfter(d.line),u=l.list!==!1;if(u){a.execCommand("indentMore");return}if(a.options.indentWithTabs)a.execCommand("insertTab");else{var g=Array(a.options.tabSize+1).join(" ");a.replaceSelection(g)}};Ds.commands.shiftTabAndUnindentMarkdownList=function(a){var c=a.listSelections(),d=c[0].head,l=a.getStateAfter(d.line),u=l.list!==!1;if(u){a.execCommand("indentLess");return}if(a.options.indentWithTabs)a.execCommand("insertTab");else{var g=Array(a.options.tabSize+1).join(" ");a.replaceSelection(g)}}});var Ss=Ye((ws,ks)=>{(function(a){typeof ws=="object"&&typeof ks=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.defineOption("fullScreen",!1,function(l,u,g){g==a.Init&&(g=!1),!g!=!u&&(u?c(l):d(l))});function c(l){var u=l.getWrapperElement();l.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:u.style.width,height:u.style.height},u.style.width="",u.style.height="auto",u.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",l.refresh()}function d(l){var u=l.getWrapperElement();u.className=u.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var g=l.state.fullScreenRestore;u.style.width=g.width,u.style.height=g.height,window.scrollTo(g.scrollLeft,g.scrollTop),l.refresh()}})});var Yo=Ye((Fs,Es)=>{(function(a){typeof Fs=="object"&&typeof Es=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";var c={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},d={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};a.defineMode("xml",function(l,u){var g=l.indentUnit,f={},p=u.htmlMode?c:d;for(var b in p)f[b]=p[b];for(var b in u)f[b]=u[b];var C,D;function E(A,U){function W(Te){return U.tokenize=Te,Te(A,U)}var V=A.next();if(V=="<")return A.eat("!")?A.eat("[")?A.match("CDATA[")?W(z("atom","]]>")):null:A.match("--")?W(z("comment","-->")):A.match("DOCTYPE",!0,!0)?(A.eatWhile(/[\w\._\-]/),W(I(1))):null:A.eat("?")?(A.eatWhile(/[\w\._\-]/),U.tokenize=z("meta","?>"),"meta"):(C=A.eat("/")?"closeTag":"openTag",U.tokenize=T,"tag bracket");if(V=="&"){var ve;return A.eat("#")?A.eat("x")?ve=A.eatWhile(/[a-fA-F\d]/)&&A.eat(";"):ve=A.eatWhile(/[\d]/)&&A.eat(";"):ve=A.eatWhile(/[\w\.\-:]/)&&A.eat(";"),ve?"atom":"error"}else return A.eatWhile(/[^&<]/),null}E.isInText=!0;function T(A,U){var W=A.next();if(W==">"||W=="/"&&A.eat(">"))return U.tokenize=E,C=W==">"?"endTag":"selfcloseTag","tag bracket";if(W=="=")return C="equals",null;if(W=="<"){U.tokenize=E,U.state=H,U.tagName=U.tagStart=null;var V=U.tokenize(A,U);return V?V+" tag error":"tag error"}else return/[\'\"]/.test(W)?(U.tokenize=M(W),U.stringStartCol=A.column(),U.tokenize(A,U)):(A.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function M(A){var U=function(W,V){for(;!W.eol();)if(W.next()==A){V.tokenize=T;break}return"string"};return U.isInAttribute=!0,U}function z(A,U){return function(W,V){for(;!W.eol();){if(W.match(U)){V.tokenize=E;break}W.next()}return A}}function I(A){return function(U,W){for(var V;(V=U.next())!=null;){if(V=="<")return W.tokenize=I(A+1),W.tokenize(U,W);if(V==">")if(A==1){W.tokenize=E;break}else return W.tokenize=I(A-1),W.tokenize(U,W)}return"meta"}}function F(A){return A&&A.toLowerCase()}function B(A,U,W){this.prev=A.context,this.tagName=U||"",this.indent=A.indented,this.startOfLine=W,(f.doNotIndent.hasOwnProperty(U)||A.context&&A.context.noIndent)&&(this.noIndent=!0)}function N(A){A.context&&(A.context=A.context.prev)}function R(A,U){for(var W;;){if(!A.context||(W=A.context.tagName,!f.contextGrabbers.hasOwnProperty(F(W))||!f.contextGrabbers[F(W)].hasOwnProperty(F(U))))return;N(A)}}function H(A,U,W){return A=="openTag"?(W.tagStart=U.column(),_):A=="closeTag"?X:H}function _(A,U,W){return A=="word"?(W.tagName=U.current(),D="tag",G):f.allowMissingTagName&&A=="endTag"?(D="tag bracket",G(A,U,W)):(D="error",_)}function X(A,U,W){if(A=="word"){var V=U.current();return W.context&&W.context.tagName!=V&&f.implicitlyClosed.hasOwnProperty(F(W.context.tagName))&&N(W),W.context&&W.context.tagName==V||f.matchClosing===!1?(D="tag",K):(D="tag error",ge)}else return f.allowMissingTagName&&A=="endTag"?(D="tag bracket",K(A,U,W)):(D="error",ge)}function K(A,U,W){return A!="endTag"?(D="error",K):(N(W),H)}function ge(A,U,W){return D="error",K(A,U,W)}function G(A,U,W){if(A=="word")return D="attribute",ue;if(A=="endTag"||A=="selfcloseTag"){var V=W.tagName,ve=W.tagStart;return W.tagName=W.tagStart=null,A=="selfcloseTag"||f.autoSelfClosers.hasOwnProperty(F(V))?R(W,V):(R(W,V),W.context=new B(W,V,ve==W.indented)),H}return D="error",G}function ue(A,U,W){return A=="equals"?ae:(f.allowMissing||(D="error"),G(A,U,W))}function ae(A,U,W){return A=="string"?de:A=="word"&&f.allowUnquoted?(D="string",G):(D="error",G(A,U,W))}function de(A,U,W){return A=="string"?de:G(A,U,W)}return{startState:function(A){var U={tokenize:E,state:H,indented:A||0,tagName:null,tagStart:null,context:null};return A!=null&&(U.baseIndent=A),U},token:function(A,U){if(!U.tagName&&A.sol()&&(U.indented=A.indentation()),A.eatSpace())return null;C=null;var W=U.tokenize(A,U);return(W||C)&&W!="comment"&&(D=null,U.state=U.state(C||W,A,U),D&&(W=D=="error"?W+" error":D)),W},indent:function(A,U,W){var V=A.context;if(A.tokenize.isInAttribute)return A.tagStart==A.indented?A.stringStartCol+1:A.indented+g;if(V&&V.noIndent)return a.Pass;if(A.tokenize!=T&&A.tokenize!=E)return W?W.match(/^(\s*)/)[0].length:0;if(A.tagName)return f.multilineTagIndentPastTag!==!1?A.tagStart+A.tagName.length+2:A.tagStart+g*(f.multilineTagIndentFactor||1);if(f.alignCDATA&&/<!\[CDATA\[/.test(U))return 0;var ve=U&&/^<(\/)?([\w_:\.-]*)/.exec(U);if(ve&&ve[1])for(;V;)if(V.tagName==ve[2]){V=V.prev;break}else if(f.implicitlyClosed.hasOwnProperty(F(V.tagName)))V=V.prev;else break;else if(ve)for(;V;){var Te=f.contextGrabbers[F(V.tagName)];if(Te&&Te.hasOwnProperty(F(ve[2])))V=V.prev;else break}for(;V&&V.prev&&!V.startOfLine;)V=V.prev;return V?V.indent+g:A.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:f.htmlMode?"html":"xml",helperType:f.htmlMode?"html":"xml",skipAttribute:function(A){A.state==ae&&(A.state=G)},xmlCurrentTag:function(A){return A.tagName?{name:A.tagName,close:A.type=="closeTag"}:null},xmlCurrentContext:function(A){for(var U=[],W=A.context;W;W=W.prev)U.push(W.tagName);return U.reverse()}}}),a.defineMIME("text/xml","xml"),a.defineMIME("application/xml","xml"),a.mimeModes.hasOwnProperty("text/html")||a.defineMIME("text/html",{name:"xml",htmlMode:!0})})});var Ts=Ye((As,Ls)=>{(function(a){typeof As=="object"&&typeof Ls=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.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 c=0;c<a.modeInfo.length;c++){var d=a.modeInfo[c];d.mimes&&(d.mime=d.mimes[0])}a.findModeByMIME=function(l){l=l.toLowerCase();for(var u=0;u<a.modeInfo.length;u++){var g=a.modeInfo[u];if(g.mime==l)return g;if(g.mimes){for(var f=0;f<g.mimes.length;f++)if(g.mimes[f]==l)return g}}if(/\+xml$/.test(l))return a.findModeByMIME("application/xml");if(/\+json$/.test(l))return a.findModeByMIME("application/json")},a.findModeByExtension=function(l){l=l.toLowerCase();for(var u=0;u<a.modeInfo.length;u++){var g=a.modeInfo[u];if(g.ext){for(var f=0;f<g.ext.length;f++)if(g.ext[f]==l)return g}}},a.findModeByFileName=function(l){for(var u=0;u<a.modeInfo.length;u++){var g=a.modeInfo[u];if(g.file&&g.file.test(l))return g}var f=l.lastIndexOf("."),p=f>-1&&l.substring(f+1,l.length);if(p)return a.findModeByExtension(p)},a.findModeByName=function(l){l=l.toLowerCase();for(var u=0;u<a.modeInfo.length;u++){var g=a.modeInfo[u];if(g.name.toLowerCase()==l)return g;if(g.alias){for(var f=0;f<g.alias.length;f++)if(g.alias[f].toLowerCase()==l)return g}}}})});var Zo=Ye((Ms,Bs)=>{(function(a){typeof Ms=="object"&&typeof Bs=="object"?a(ct(),Yo(),Ts()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],a):a(CodeMirror)})(function(a){"use strict";a.defineMode("markdown",function(c,d){var l=a.getMode(c,"text/html"),u=l.name=="null";function g(k){if(a.findModeByName){var y=a.findModeByName(k);y&&(k=y.mime||y.mimes[0])}var ee=a.getMode(c,k);return ee.name=="null"?null:ee}d.highlightFormatting===void 0&&(d.highlightFormatting=!1),d.maxBlockquoteDepth===void 0&&(d.maxBlockquoteDepth=0),d.taskLists===void 0&&(d.taskLists=!1),d.strikethrough===void 0&&(d.strikethrough=!1),d.emoji===void 0&&(d.emoji=!1),d.fencedCodeBlockHighlighting===void 0&&(d.fencedCodeBlockHighlighting=!0),d.fencedCodeBlockDefaultMode===void 0&&(d.fencedCodeBlockDefaultMode="text/plain"),d.xml===void 0&&(d.xml=!0),d.tokenTypeOverrides===void 0&&(d.tokenTypeOverrides={});var f={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 p in f)f.hasOwnProperty(p)&&d.tokenTypeOverrides[p]&&(f[p]=d.tokenTypeOverrides[p]);var b=/^([*\-_])(?:\s*\1){2,}\s*$/,C=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,D=/^\[(x| )\](?=\s)/i,E=d.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,T=/^ {0,3}(?:\={1,}|-{2,})\s*$/,M=/^[^#!\[\]*_\\<>` "'(~:]+/,z=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,I=/^\s*\[[^\]]+?\]:.*$/,F=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,B=" ";function N(k,y,ee){return y.f=y.inline=ee,ee(k,y)}function R(k,y,ee){return y.f=y.block=ee,ee(k,y)}function H(k){return!k||!/\S/.test(k.string)}function _(k){if(k.linkTitle=!1,k.linkHref=!1,k.linkText=!1,k.em=!1,k.strong=!1,k.strikethrough=!1,k.quote=0,k.indentedCode=!1,k.f==K){var y=u;if(!y){var ee=a.innerMode(l,k.htmlState);y=ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText}y&&(k.f=ae,k.block=X,k.htmlState=null)}return k.trailingSpace=0,k.trailingSpaceNewLine=!1,k.prevLine=k.thisLine,k.thisLine={stream:null},null}function X(k,y){var ee=k.column()===y.indentation,ye=H(y.prevLine.stream),he=y.indentedCode,tt=y.prevLine.hr,dt=y.list!==!1,Re=(y.listStack[y.listStack.length-1]||0)+3;y.indentedCode=!1;var Je=y.indentation;if(y.indentationDiff===null&&(y.indentationDiff=y.indentation,dt)){for(y.list=null;Je<y.listStack[y.listStack.length-1];)y.listStack.pop(),y.listStack.length?y.indentation=y.listStack[y.listStack.length-1]:y.list=!1;y.list!==!1&&(y.indentationDiff=Je-y.listStack[y.listStack.length-1])}var Fe=!ye&&!tt&&!y.prevLine.header&&(!dt||!he)&&!y.prevLine.fencedCodeEnd,Me=(y.list===!1||tt||ye)&&y.indentation<=Re&&k.match(b),Pe=null;if(y.indentationDiff>=4&&(he||y.prevLine.fencedCodeEnd||y.prevLine.header||ye))return k.skipToEnd(),y.indentedCode=!0,f.code;if(k.eatSpace())return null;if(ee&&y.indentation<=Re&&(Pe=k.match(E))&&Pe[1].length<=6)return y.quote=0,y.header=Pe[1].length,y.thisLine.header=!0,d.highlightFormatting&&(y.formatting="header"),y.f=y.inline,G(y);if(y.indentation<=Re&&k.eat(">"))return y.quote=ee?1:y.quote+1,d.highlightFormatting&&(y.formatting="quote"),k.eatSpace(),G(y);if(!Me&&!y.setext&&ee&&y.indentation<=Re&&(Pe=k.match(C))){var rt=Pe[1]?"ol":"ul";return y.indentation=Je+k.current().length,y.list=!0,y.quote=0,y.listStack.push(y.indentation),y.em=!1,y.strong=!1,y.code=!1,y.strikethrough=!1,d.taskLists&&k.match(D,!1)&&(y.taskList=!0),y.f=y.inline,d.highlightFormatting&&(y.formatting=["list","list-"+rt]),G(y)}else{if(ee&&y.indentation<=Re&&(Pe=k.match(z,!0)))return y.quote=0,y.fencedEndRE=new RegExp(Pe[1]+"+ *$"),y.localMode=d.fencedCodeBlockHighlighting&&g(Pe[2]||d.fencedCodeBlockDefaultMode),y.localMode&&(y.localState=a.startState(y.localMode)),y.f=y.block=ge,d.highlightFormatting&&(y.formatting="code-block"),y.code=-1,G(y);if(y.setext||(!Fe||!dt)&&!y.quote&&y.list===!1&&!y.code&&!Me&&!I.test(k.string)&&(Pe=k.lookAhead(1))&&(Pe=Pe.match(T)))return y.setext?(y.header=y.setext,y.setext=0,k.skipToEnd(),d.highlightFormatting&&(y.formatting="header")):(y.header=Pe[0].charAt(0)=="="?1:2,y.setext=y.header),y.thisLine.header=!0,y.f=y.inline,G(y);if(Me)return k.skipToEnd(),y.hr=!0,y.thisLine.hr=!0,f.hr;if(k.peek()==="[")return N(k,y,V)}return N(k,y,y.inline)}function K(k,y){var ee=l.token(k,y.htmlState);if(!u){var ye=a.innerMode(l,y.htmlState);(ye.mode.name=="xml"&&ye.state.tagStart===null&&!ye.state.context&&ye.state.tokenize.isInText||y.md_inside&&k.current().indexOf(">")>-1)&&(y.f=ae,y.block=X,y.htmlState=null)}return ee}function ge(k,y){var ee=y.listStack[y.listStack.length-1]||0,ye=y.indentation<ee,he=ee+3;if(y.fencedEndRE&&y.indentation<=he&&(ye||k.match(y.fencedEndRE))){d.highlightFormatting&&(y.formatting="code-block");var tt;return ye||(tt=G(y)),y.localMode=y.localState=null,y.block=X,y.f=ae,y.fencedEndRE=null,y.code=0,y.thisLine.fencedCodeEnd=!0,ye?R(k,y,y.block):tt}else return y.localMode?y.localMode.token(k,y.localState):(k.skipToEnd(),f.code)}function G(k){var y=[];if(k.formatting){y.push(f.formatting),typeof k.formatting=="string"&&(k.formatting=[k.formatting]);for(var ee=0;ee<k.formatting.length;ee++)y.push(f.formatting+"-"+k.formatting[ee]),k.formatting[ee]==="header"&&y.push(f.formatting+"-"+k.formatting[ee]+"-"+k.header),k.formatting[ee]==="quote"&&(!d.maxBlockquoteDepth||d.maxBlockquoteDepth>=k.quote?y.push(f.formatting+"-"+k.formatting[ee]+"-"+k.quote):y.push("error"))}if(k.taskOpen)return y.push("meta"),y.length?y.join(" "):null;if(k.taskClosed)return y.push("property"),y.length?y.join(" "):null;if(k.linkHref?y.push(f.linkHref,"url"):(k.strong&&y.push(f.strong),k.em&&y.push(f.em),k.strikethrough&&y.push(f.strikethrough),k.emoji&&y.push(f.emoji),k.linkText&&y.push(f.linkText),k.code&&y.push(f.code),k.image&&y.push(f.image),k.imageAltText&&y.push(f.imageAltText,"link"),k.imageMarker&&y.push(f.imageMarker)),k.header&&y.push(f.header,f.header+"-"+k.header),k.quote&&(y.push(f.quote),!d.maxBlockquoteDepth||d.maxBlockquoteDepth>=k.quote?y.push(f.quote+"-"+k.quote):y.push(f.quote+"-"+d.maxBlockquoteDepth)),k.list!==!1){var ye=(k.listStack.length-1)%3;ye?ye===1?y.push(f.list2):y.push(f.list3):y.push(f.list1)}return k.trailingSpaceNewLine?y.push("trailing-space-new-line"):k.trailingSpace&&y.push("trailing-space-"+(k.trailingSpace%2?"a":"b")),y.length?y.join(" "):null}function ue(k,y){if(k.match(M,!0))return G(y)}function ae(k,y){var ee=y.text(k,y);if(typeof ee<"u")return ee;if(y.list)return y.list=null,G(y);if(y.taskList){var ye=k.match(D,!0)[1]===" ";return ye?y.taskOpen=!0:y.taskClosed=!0,d.highlightFormatting&&(y.formatting="task"),y.taskList=!1,G(y)}if(y.taskOpen=!1,y.taskClosed=!1,y.header&&k.match(/^#+$/,!0))return d.highlightFormatting&&(y.formatting="header"),G(y);var he=k.next();if(y.linkTitle){y.linkTitle=!1;var tt=he;he==="("&&(tt=")"),tt=(tt+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var dt="^\\s*(?:[^"+tt+"\\\\]+|\\\\\\\\|\\\\.)"+tt;if(k.match(new RegExp(dt),!0))return f.linkHref}if(he==="`"){var Re=y.formatting;d.highlightFormatting&&(y.formatting="code"),k.eatWhile("`");var Je=k.current().length;if(y.code==0&&(!y.quote||Je==1))return y.code=Je,G(y);if(Je==y.code){var Fe=G(y);return y.code=0,Fe}else return y.formatting=Re,G(y)}else if(y.code)return G(y);if(he==="\\"&&(k.next(),d.highlightFormatting)){var Me=G(y),Pe=f.formatting+"-escape";return Me?Me+" "+Pe:Pe}if(he==="!"&&k.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return y.imageMarker=!0,y.image=!0,d.highlightFormatting&&(y.formatting="image"),G(y);if(he==="["&&y.imageMarker&&k.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return y.imageMarker=!1,y.imageAltText=!0,d.highlightFormatting&&(y.formatting="image"),G(y);if(he==="]"&&y.imageAltText){d.highlightFormatting&&(y.formatting="image");var Me=G(y);return y.imageAltText=!1,y.image=!1,y.inline=y.f=A,Me}if(he==="["&&!y.image)return y.linkText&&k.match(/^.*?\]/)||(y.linkText=!0,d.highlightFormatting&&(y.formatting="link")),G(y);if(he==="]"&&y.linkText){d.highlightFormatting&&(y.formatting="link");var Me=G(y);return y.linkText=!1,y.inline=y.f=k.match(/\(.*?\)| ?\[.*?\]/,!1)?A:ae,Me}if(he==="<"&&k.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=de,d.highlightFormatting&&(y.formatting="link");var Me=G(y);return Me?Me+=" ":Me="",Me+f.linkInline}if(he==="<"&&k.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){y.f=y.inline=de,d.highlightFormatting&&(y.formatting="link");var Me=G(y);return Me?Me+=" ":Me="",Me+f.linkEmail}if(d.xml&&he==="<"&&k.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var rt=k.string.indexOf(">",k.pos);if(rt!=-1){var Ur=k.string.substring(k.start,rt);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Ur)&&(y.md_inside=!0)}return k.backUp(1),y.htmlState=a.startState(l),R(k,y,K)}if(d.xml&&he==="<"&&k.match(/^\/\w*?>/))return y.md_inside=!1,"tag";if(he==="*"||he==="_"){for(var kt=1,St=k.pos==1?" ":k.string.charAt(k.pos-2);kt<3&&k.eat(he);)kt++;var yt=k.peek()||" ",Pt=!/\s/.test(yt)&&(!F.test(yt)||/\s/.test(St)||F.test(St)),me=!/\s/.test(St)&&(!F.test(St)||/\s/.test(yt)||F.test(yt)),bt=null,_t=null;if(kt%2&&(!y.em&&Pt&&(he==="*"||!me||F.test(St))?bt=!0:y.em==he&&me&&(he==="*"||!Pt||F.test(yt))&&(bt=!1)),kt>1&&(!y.strong&&Pt&&(he==="*"||!me||F.test(St))?_t=!0:y.strong==he&&me&&(he==="*"||!Pt||F.test(yt))&&(_t=!1)),_t!=null||bt!=null){d.highlightFormatting&&(y.formatting=bt==null?"strong":_t==null?"em":"strong em"),bt===!0&&(y.em=he),_t===!0&&(y.strong=he);var Fe=G(y);return bt===!1&&(y.em=!1),_t===!1&&(y.strong=!1),Fe}}else if(he===" "&&(k.eat("*")||k.eat("_"))){if(k.peek()===" ")return G(y);k.backUp(1)}if(d.strikethrough){if(he==="~"&&k.eatWhile(he)){if(y.strikethrough){d.highlightFormatting&&(y.formatting="strikethrough");var Fe=G(y);return y.strikethrough=!1,Fe}else if(k.match(/^[^\s]/,!1))return y.strikethrough=!0,d.highlightFormatting&&(y.formatting="strikethrough"),G(y)}else if(he===" "&&k.match("~~",!0)){if(k.peek()===" ")return G(y);k.backUp(2)}}if(d.emoji&&he===":"&&k.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){y.emoji=!0,d.highlightFormatting&&(y.formatting="emoji");var Si=G(y);return y.emoji=!1,Si}return he===" "&&(k.match(/^ +$/,!1)?y.trailingSpace++:y.trailingSpace&&(y.trailingSpaceNewLine=!0)),G(y)}function de(k,y){var ee=k.next();if(ee===">"){y.f=y.inline=ae,d.highlightFormatting&&(y.formatting="link");var ye=G(y);return ye?ye+=" ":ye="",ye+f.linkInline}return k.match(/^[^>]+/,!0),f.linkInline}function A(k,y){if(k.eatSpace())return null;var ee=k.next();return ee==="("||ee==="["?(y.f=y.inline=W(ee==="("?")":"]"),d.highlightFormatting&&(y.formatting="link-string"),y.linkHref=!0,G(y)):"error"}var U={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function W(k){return function(y,ee){var ye=y.next();if(ye===k){ee.f=ee.inline=ae,d.highlightFormatting&&(ee.formatting="link-string");var he=G(ee);return ee.linkHref=!1,he}return y.match(U[k]),ee.linkHref=!0,G(ee)}}function V(k,y){return k.match(/^([^\]\\]|\\.)*\]:/,!1)?(y.f=ve,k.next(),d.highlightFormatting&&(y.formatting="link"),y.linkText=!0,G(y)):N(k,y,ae)}function ve(k,y){if(k.match("]:",!0)){y.f=y.inline=Te,d.highlightFormatting&&(y.formatting="link");var ee=G(y);return y.linkText=!1,ee}return k.match(/^([^\]\\]|\\.)+/,!0),f.linkText}function Te(k,y){return k.eatSpace()?null:(k.match(/^[^\s]+/,!0),k.peek()===void 0?y.linkTitle=!0:k.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),y.f=y.inline=ae,f.linkHref+" url")}var vt={startState:function(){return{f:X,prevLine:{stream:null},thisLine:{stream:null},block:X,htmlState:null,indentation:0,inline:ae,text:ue,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(k){return{f:k.f,prevLine:k.prevLine,thisLine:k.thisLine,block:k.block,htmlState:k.htmlState&&a.copyState(l,k.htmlState),indentation:k.indentation,localMode:k.localMode,localState:k.localMode?a.copyState(k.localMode,k.localState):null,inline:k.inline,text:k.text,formatting:!1,linkText:k.linkText,linkTitle:k.linkTitle,linkHref:k.linkHref,code:k.code,em:k.em,strong:k.strong,strikethrough:k.strikethrough,emoji:k.emoji,header:k.header,setext:k.setext,hr:k.hr,taskList:k.taskList,list:k.list,listStack:k.listStack.slice(0),quote:k.quote,indentedCode:k.indentedCode,trailingSpace:k.trailingSpace,trailingSpaceNewLine:k.trailingSpaceNewLine,md_inside:k.md_inside,fencedEndRE:k.fencedEndRE}},token:function(k,y){if(y.formatting=!1,k!=y.thisLine.stream){if(y.header=0,y.hr=!1,k.match(/^\s*$/,!0))return _(y),null;if(y.prevLine=y.thisLine,y.thisLine={stream:k},y.taskList=!1,y.trailingSpace=0,y.trailingSpaceNewLine=!1,!y.localState&&(y.f=y.block,y.f!=K)){var ee=k.match(/^\s*/,!0)[0].replace(/\t/g,B).length;if(y.indentation=ee,y.indentationDiff=null,ee>0)return null}}return y.f(k,y)},innerMode:function(k){return k.block==K?{state:k.htmlState,mode:l}:k.localState?{state:k.localState,mode:k.localMode}:{state:k,mode:vt}},indent:function(k,y,ee){return k.block==K&&l.indent?l.indent(k.htmlState,y,ee):k.localState&&k.localMode.indent?k.localMode.indent(k.localState,y,ee):a.Pass},blankLine:_,getType:G,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return vt},"xml"),a.defineMIME("text/markdown","markdown"),a.defineMIME("text/x-markdown","markdown")})});var Qo=Ye((Ns,Is)=>{(function(a){typeof Ns=="object"&&typeof Is=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.overlayMode=function(c,d,l){return{startState:function(){return{base:a.startState(c),overlay:a.startState(d),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(u){return{base:a.copyState(c,u.base),overlay:a.copyState(d,u.overlay),basePos:u.basePos,baseCur:null,overlayPos:u.overlayPos,overlayCur:null}},token:function(u,g){return(u!=g.streamSeen||Math.min(g.basePos,g.overlayPos)<u.start)&&(g.streamSeen=u,g.basePos=g.overlayPos=u.start),u.start==g.basePos&&(g.baseCur=c.token(u,g.base),g.basePos=u.pos),u.start==g.overlayPos&&(u.pos=u.start,g.overlayCur=d.token(u,g.overlay),g.overlayPos=u.pos),u.pos=Math.min(g.basePos,g.overlayPos),g.overlayCur==null?g.baseCur:g.baseCur!=null&&g.overlay.combineTokens||l&&g.overlay.combineTokens==null?g.baseCur+" "+g.overlayCur:g.overlayCur},indent:c.indent&&function(u,g,f){return c.indent(u.base,g,f)},electricChars:c.electricChars,innerMode:function(u){return{state:u.base,mode:c}},blankLine:function(u){var g,f;return c.blankLine&&(g=c.blankLine(u.base)),d.blankLine&&(f=d.blankLine(u.overlay)),f==null?g:l&&g!=null?g+" "+f:f}}}})});var Hs=Ye((zs,Os)=>{(function(a){typeof zs=="object"&&typeof Os=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){a.defineOption("placeholder","",function(p,b,C){var D=C&&C!=a.Init;if(b&&!D)p.on("blur",u),p.on("change",g),p.on("swapDoc",g),a.on(p.getInputField(),"compositionupdate",p.state.placeholderCompose=function(){l(p)}),g(p);else if(!b&&D){p.off("blur",u),p.off("change",g),p.off("swapDoc",g),a.off(p.getInputField(),"compositionupdate",p.state.placeholderCompose),c(p);var E=p.getWrapperElement();E.className=E.className.replace(" CodeMirror-empty","")}b&&!p.hasFocus()&&u(p)});function c(p){p.state.placeholder&&(p.state.placeholder.parentNode.removeChild(p.state.placeholder),p.state.placeholder=null)}function d(p){c(p);var b=p.state.placeholder=document.createElement("pre");b.style.cssText="height: 0; overflow: visible",b.style.direction=p.getOption("direction"),b.className="CodeMirror-placeholder CodeMirror-line-like";var C=p.getOption("placeholder");typeof C=="string"&&(C=document.createTextNode(C)),b.appendChild(C),p.display.lineSpace.insertBefore(b,p.display.lineSpace.firstChild)}function l(p){setTimeout(function(){var b=!1;if(p.lineCount()==1){var C=p.getInputField();b=C.nodeName=="TEXTAREA"?!p.getLine(0).length:!/[^\u200b]/.test(C.querySelector(".CodeMirror-line").textContent)}b?d(p):c(p)},20)}function u(p){f(p)&&d(p)}function g(p){var b=p.getWrapperElement(),C=f(p);b.className=b.className.replace(" CodeMirror-empty","")+(C?" CodeMirror-empty":""),C?d(p):c(p)}function f(p){return p.lineCount()===1&&p.getLine(0)===""}})});var _s=Ye((Rs,Ps)=>{(function(a){typeof Rs=="object"&&typeof Ps=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.defineOption("autoRefresh",!1,function(l,u){l.state.autoRefresh&&(d(l,l.state.autoRefresh),l.state.autoRefresh=null),u&&l.display.wrapper.offsetHeight==0&&c(l,l.state.autoRefresh={delay:u.delay||250})});function c(l,u){function g(){l.display.wrapper.offsetHeight?(d(l,u),l.display.lastWrapHeight!=l.display.wrapper.clientHeight&&l.refresh()):u.timeout=setTimeout(g,u.delay)}u.timeout=setTimeout(g,u.delay),u.hurry=function(){clearTimeout(u.timeout),u.timeout=setTimeout(g,50)},a.on(window,"mouseup",u.hurry),a.on(window,"keyup",u.hurry)}function d(l,u){clearTimeout(u.timeout),a.off(window,"mouseup",u.hurry),a.off(window,"keyup",u.hurry)}})});var Us=Ye((Ws,qs)=>{(function(a){typeof Ws=="object"&&typeof qs=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";a.defineOption("styleSelectedText",!1,function(D,E,T){var M=T&&T!=a.Init;E&&!M?(D.state.markedSelection=[],D.state.markedSelectionStyle=typeof E=="string"?E:"CodeMirror-selectedtext",b(D),D.on("cursorActivity",c),D.on("change",d)):!E&&M&&(D.off("cursorActivity",c),D.off("change",d),p(D),D.state.markedSelection=D.state.markedSelectionStyle=null)});function c(D){D.state.markedSelection&&D.operation(function(){C(D)})}function d(D){D.state.markedSelection&&D.state.markedSelection.length&&D.operation(function(){p(D)})}var l=8,u=a.Pos,g=a.cmpPos;function f(D,E,T,M){if(g(E,T)!=0)for(var z=D.state.markedSelection,I=D.state.markedSelectionStyle,F=E.line;;){var B=F==E.line?E:u(F,0),N=F+l,R=N>=T.line,H=R?T:u(N,0),_=D.markText(B,H,{className:I});if(M==null?z.push(_):z.splice(M++,0,_),R)break;F=N}}function p(D){for(var E=D.state.markedSelection,T=0;T<E.length;++T)E[T].clear();E.length=0}function b(D){p(D);for(var E=D.listSelections(),T=0;T<E.length;T++)f(D,E[T].from(),E[T].to())}function C(D){if(!D.somethingSelected())return p(D);if(D.listSelections().length>1)return b(D);var E=D.getCursor("start"),T=D.getCursor("end"),M=D.state.markedSelection;if(!M.length)return f(D,E,T);var z=M[0].find(),I=M[M.length-1].find();if(!z||!I||T.line-E.line<=l||g(E,I.to)>=0||g(T,z.from)<=0)return b(D);for(;g(E,z.from)>0;)M.shift().clear(),z=M[0].find();for(g(E,z.from)<0&&(z.to.line-E.line<l?(M.shift().clear(),f(D,E,z.to,0)):f(D,E,z.from,0));g(T,I.to)<0;)M.pop().clear(),I=M[M.length-1].find();g(T,I.to)>0&&(T.line-I.from.line<l?(M.pop().clear(),f(D,I.from,T)):f(D,I.to,T))}})});var Ks=Ye((js,Gs)=>{(function(a){typeof js=="object"&&typeof Gs=="object"?a(ct()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],a):a(CodeMirror)})(function(a){"use strict";var c=a.Pos;function d(F){var B=F.flags;return B??(F.ignoreCase?"i":"")+(F.global?"g":"")+(F.multiline?"m":"")}function l(F,B){for(var N=d(F),R=N,H=0;H<B.length;H++)R.indexOf(B.charAt(H))==-1&&(R+=B.charAt(H));return N==R?F:new RegExp(F.source,R)}function u(F){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(F.source)}function g(F,B,N){B=l(B,"g");for(var R=N.line,H=N.ch,_=F.lastLine();R<=_;R++,H=0){B.lastIndex=H;var X=F.getLine(R),K=B.exec(X);if(K)return{from:c(R,K.index),to:c(R,K.index+K[0].length),match:K}}}function f(F,B,N){if(!u(B))return g(F,B,N);B=l(B,"gm");for(var R,H=1,_=N.line,X=F.lastLine();_<=X;){for(var K=0;K<H&&!(_>X);K++){var ge=F.getLine(_++);R=R==null?ge:R+`
|
|
`+ge}H=H*2,B.lastIndex=N.ch;var G=B.exec(R);if(G){var ue=R.slice(0,G.index).split(`
|
|
`),ae=G[0].split(`
|
|
`),de=N.line+ue.length-1,A=ue[ue.length-1].length;return{from:c(de,A),to:c(de+ae.length-1,ae.length==1?A+ae[0].length:ae[ae.length-1].length),match:G}}}}function p(F,B,N){for(var R,H=0;H<=F.length;){B.lastIndex=H;var _=B.exec(F);if(!_)break;var X=_.index+_[0].length;if(X>F.length-N)break;(!R||X>R.index+R[0].length)&&(R=_),H=_.index+1}return R}function b(F,B,N){B=l(B,"g");for(var R=N.line,H=N.ch,_=F.firstLine();R>=_;R--,H=-1){var X=F.getLine(R),K=p(X,B,H<0?0:X.length-H);if(K)return{from:c(R,K.index),to:c(R,K.index+K[0].length),match:K}}}function C(F,B,N){if(!u(B))return b(F,B,N);B=l(B,"gm");for(var R,H=1,_=F.getLine(N.line).length-N.ch,X=N.line,K=F.firstLine();X>=K;){for(var ge=0;ge<H&&X>=K;ge++){var G=F.getLine(X--);R=R==null?G:G+`
|
|
`+R}H*=2;var ue=p(R,B,_);if(ue){var ae=R.slice(0,ue.index).split(`
|
|
`),de=ue[0].split(`
|
|
`),A=X+ae.length,U=ae[ae.length-1].length;return{from:c(A,U),to:c(A+de.length-1,de.length==1?U+de[0].length:de[de.length-1].length),match:ue}}}}var D,E;String.prototype.normalize?(D=function(F){return F.normalize("NFD").toLowerCase()},E=function(F){return F.normalize("NFD")}):(D=function(F){return F.toLowerCase()},E=function(F){return F});function T(F,B,N,R){if(F.length==B.length)return N;for(var H=0,_=N+Math.max(0,F.length-B.length);;){if(H==_)return H;var X=H+_>>1,K=R(F.slice(0,X)).length;if(K==N)return X;K>N?_=X:H=X+1}}function M(F,B,N,R){if(!B.length)return null;var H=R?D:E,_=H(B).split(/\r|\n\r?/);e:for(var X=N.line,K=N.ch,ge=F.lastLine()+1-_.length;X<=ge;X++,K=0){var G=F.getLine(X).slice(K),ue=H(G);if(_.length==1){var ae=ue.indexOf(_[0]);if(ae==-1)continue e;var N=T(G,ue,ae,H)+K;return{from:c(X,T(G,ue,ae,H)+K),to:c(X,T(G,ue,ae+_[0].length,H)+K)}}else{var de=ue.length-_[0].length;if(ue.slice(de)!=_[0])continue e;for(var A=1;A<_.length-1;A++)if(H(F.getLine(X+A))!=_[A])continue e;var U=F.getLine(X+_.length-1),W=H(U),V=_[_.length-1];if(W.slice(0,V.length)!=V)continue e;return{from:c(X,T(G,ue,de,H)+K),to:c(X+_.length-1,T(U,W,V.length,H))}}}}function z(F,B,N,R){if(!B.length)return null;var H=R?D:E,_=H(B).split(/\r|\n\r?/);e:for(var X=N.line,K=N.ch,ge=F.firstLine()-1+_.length;X>=ge;X--,K=-1){var G=F.getLine(X);K>-1&&(G=G.slice(0,K));var ue=H(G);if(_.length==1){var ae=ue.lastIndexOf(_[0]);if(ae==-1)continue e;return{from:c(X,T(G,ue,ae,H)),to:c(X,T(G,ue,ae+_[0].length,H))}}else{var de=_[_.length-1];if(ue.slice(0,de.length)!=de)continue e;for(var A=1,N=X-_.length+1;A<_.length-1;A++)if(H(F.getLine(N+A))!=_[A])continue e;var U=F.getLine(X+1-_.length),W=H(U);if(W.slice(W.length-_[0].length)!=_[0])continue e;return{from:c(X+1-_.length,T(U,W,U.length-_[0].length,H)),to:c(X,T(G,ue,de.length,H))}}}}function I(F,B,N,R){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=F,N=N?F.clipPos(N):c(0,0),this.pos={from:N,to:N};var H;typeof R=="object"?H=R.caseFold:(H=R,R=null),typeof B=="string"?(H==null&&(H=!1),this.matches=function(_,X){return(_?z:M)(F,B,X,H)}):(B=l(B,"gm"),!R||R.multiline!==!1?this.matches=function(_,X){return(_?C:f)(F,B,X)}:this.matches=function(_,X){return(_?b:g)(F,B,X)})}I.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(F){var B=this.doc.clipPos(F?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(B=c(B.line,B.ch),F?(B.ch--,B.ch<0&&(B.line--,B.ch=(this.doc.getLine(B.line)||"").length)):(B.ch++,B.ch>(this.doc.getLine(B.line)||"").length&&(B.ch=0,B.line++)),a.cmpPos(B,this.doc.clipPos(B))!=0))return this.atOccurrence=!1;var N=this.matches(F,B);if(this.afterEmptyMatch=N&&a.cmpPos(N.from,N.to)==0,N)return this.pos=N,this.atOccurrence=!0,this.pos.match||!0;var R=c(F?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:R,to:R},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(F,B){if(this.atOccurrence){var N=a.splitLines(F);this.doc.replaceRange(N,this.pos.from,this.pos.to,B),this.pos.to=c(this.pos.from.line+N.length-1,N[N.length-1].length+(N.length==1?this.pos.from.ch:0))}}},a.defineExtension("getSearchCursor",function(F,B,N){return new I(this.doc,F,B,N)}),a.defineDocExtension("getSearchCursor",function(F,B,N){return new I(this,F,B,N)}),a.defineExtension("selectMatches",function(F,B){for(var N=[],R=this.getSearchCursor(F,this.getCursor("from"),B);R.findNext()&&!(a.cmpPos(R.to(),this.getCursor("to"))>0);)N.push({anchor:R.from(),head:R.to()});N.length&&this.setSelections(N,0)})})});var Zs=Ye((Xs,Ys)=>{(function(a){typeof Xs=="object"&&typeof Ys=="object"?a(ct(),Zo(),Qo()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],a):a(CodeMirror)})(function(a){"use strict";var c=/^((?:(?: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;a.defineMode("gfm",function(d,l){var u=0;function g(C){return C.code=!1,null}var f={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(C){return{code:C.code,codeBlock:C.codeBlock,ateSpace:C.ateSpace}},token:function(C,D){if(D.combineTokens=null,D.codeBlock)return C.match(/^```+/)?(D.codeBlock=!1,null):(C.skipToEnd(),null);if(C.sol()&&(D.code=!1),C.sol()&&C.match(/^```+/))return C.skipToEnd(),D.codeBlock=!0,null;if(C.peek()==="`"){C.next();var E=C.pos;C.eatWhile("`");var T=1+C.pos-E;return D.code?T===u&&(D.code=!1):(u=T,D.code=!0),null}else if(D.code)return C.next(),null;if(C.eatSpace())return D.ateSpace=!0,null;if((C.sol()||D.ateSpace)&&(D.ateSpace=!1,l.gitHubSpice!==!1)){if(C.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return D.combineTokens=!0,"link";if(C.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return D.combineTokens=!0,"link"}return C.match(c)&&C.string.slice(C.start-2,C.start)!="]("&&(C.start==0||/\W/.test(C.string.charAt(C.start-1)))?(D.combineTokens=!0,"link"):(C.next(),null)},blankLine:g},p={taskLists:!0,strikethrough:!0,emoji:!0};for(var b in l)p[b]=l[b];return p.name="markdown",a.overlayMode(a.getMode(d,p),f)},"markdown"),a.defineMIME("text/x-gfm","gfm")})});var Qs=Ye(()=>{});var Js=Ye((Qd,$o)=>{var Jo;(function(){"use strict";Jo=function(a,c,d,l){l=l||{},this.dictionary=null,this.rules={},this.dictionaryTable=new Map,this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=l.flags||{},this.memoized={},this.loaded=!1;var u=this,g,f,p,b,C;a&&(u.dictionary=a,c&&d?M():(typeof window<"u"?(l.dictionaryPath?g=l.dictionaryPath:g="typo/dictionaries",window.chrome&&window.chrome.runtime&&window.chrome.runtime.getURL?g=window.chrome.runtime.getURL(g):window.browser&&window.browser.runtime&&window.browser.runtime.getURL&&(g=window.browser.runtime.getURL(g))):typeof __dirname<"u"?g=__dirname+"/dictionaries":g="./dictionaries",c||D(g+"/"+a+"/"+a+".aff",E),d||D(g+"/"+a+"/"+a+".dic",T)));function D(z,I){var F=u._readFile(z,null,l?.asyncLoad);l?.asyncLoad?F.then(function(B){I(B)}):I(F)}function E(z){c=z,d&&M()}function T(z){d=z,c&&M()}function M(){for(u.rules=u._parseAFF(c),u.compoundRuleCodes={},f=0,b=u.compoundRules.length;f<b;f++){var z=u.compoundRules[f];for(p=0,C=z.length;p<C;p++)u.compoundRuleCodes[z[p]]=[]}"ONLYINCOMPOUND"in u.flags&&(u.compoundRuleCodes[u.flags.ONLYINCOMPOUND]=[]),u.dictionaryTable=u._parseDIC(d);for(f in u.compoundRuleCodes)u.compoundRuleCodes[f].length===0&&delete u.compoundRuleCodes[f];for(f=0,b=u.compoundRules.length;f<b;f++){var I=u.compoundRules[f],F="";for(p=0,C=I.length;p<C;p++){var B=I[p];B in u.compoundRuleCodes?F+="("+u.compoundRuleCodes[B].join("|")+")":F+=B}u.compoundRules[f]=new RegExp("^"+F+"$","i")}u.loaded=!0,l?.asyncLoad&&l?.loadedCallback&&l.loadedCallback(u)}return this},Jo.prototype={load:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);return this},_readFile:function(a,c,d){var l;if(c=c||"utf8",typeof XMLHttpRequest<"u"){var u=new XMLHttpRequest;if(u.open("GET",a,!!d),(l=u.overrideMimeType)===null||l===void 0||l.call(u,"text/plain; charset="+c),d){var g=new Promise(function(p,b){u.onload=function(){u.status===200?p(u.responseText):b(u.statusText)},u.onerror=function(){b(u.statusText)}});return u.send(null),g}else return u.send(null),u.responseText}else if(typeof ms<"u"){var f=Qs();try{if(f.existsSync(a))return f.readFileSync(a,c);console.log("Path "+a+" does not exist.")}catch(p){console.log(p)}return""}return""},_parseAFF:function(a){var c={},d,l,u,g,f,p,b,C,D=a.split(/\r?\n/);for(f=0,b=D.length;f<b;f++)if(d=this._removeAffixComments(D[f]),d=d.trim(),!!d){var E=d.split(/\s+/),T=E[0];if(T==="PFX"||T==="SFX"){var M=E[1],z=E[2];u=parseInt(E[3],10);var I=[];for(p=f+1,C=f+1+u;p<C;p++){l=D[p],g=l.split(/\s+/);var F=g[2],B=g[3].split("/"),N=B[0];N==="0"&&(N="");var R=this.parseRuleCodes(B[1]),H=g[4],_={add:N};R.length>0&&(_.continuationClasses=R),H!=="."&&(T==="SFX"?_.match=new RegExp(H+"$"):_.match=new RegExp("^"+H)),F!="0"&&(T==="SFX"?_.remove=new RegExp(F+"$"):_.remove=F),I.push(_)}c[M]={type:T,combineable:z==="Y",entries:I},f+=u}else if(T==="COMPOUNDRULE"){for(u=parseInt(E[1],10),p=f+1,C=f+1+u;p<C;p++)d=D[p],g=d.split(/\s+/),this.compoundRules.push(g[1]);f+=u}else T==="REP"?(g=d.split(/\s+/),g.length===3&&this.replacementTable.push([g[1],g[2]])):this.flags[T]=E[1]}return c},_removeAffixComments:function(a){return a.match(/^\s*#/)?"":a},_parseDIC:function(a){a=this._removeDicComments(a);var c=a.split(/\r?\n/),d=new Map;function l(ue,ae){d.has(ue)||d.set(ue,null),ae.length>0&&(d.get(ue)===null&&d.set(ue,[]),d.get(ue).push(ae))}for(var u=1,g=c.length;u<g;u++){var f=c[u];if(f){var p=f.replace(/\s.*$/,""),b=p.split("/",2),C=b[0];if(b.length>1){var D=this.parseRuleCodes(b[1]);(!("NEEDAFFIX"in this.flags)||D.indexOf(this.flags.NEEDAFFIX)===-1)&&l(C,D);for(var E=0,T=D.length;E<T;E++){var M=D[E],z=this.rules[M];if(z)for(var I=this._applyRule(C,z),F=0,B=I.length;F<B;F++){var N=I[F];if(l(N,[]),z.combineable)for(var R=E+1;R<T;R++){var H=D[R],_=this.rules[H];if(_&&_.combineable&&z.type!=_.type)for(var X=this._applyRule(N,_),K=0,ge=X.length;K<ge;K++){var G=X[K];l(G,[])}}}M in this.compoundRuleCodes&&this.compoundRuleCodes[M].push(C)}}else l(C.trim(),[])}}return d},_removeDicComments:function(a){return a=a.replace(/^\t.*$/mg,""),a},parseRuleCodes:function(a){if(a)if("FLAG"in this.flags)if(this.flags.FLAG==="long"){for(var c=[],d=0,l=a.length;d<l;d+=2)c.push(a.substr(d,2));return c}else return this.flags.FLAG==="num"?a.split(","):this.flags.FLAG==="UTF-8"?Array.from(a):a.split("");else return a.split("");else return[]},_applyRule:function(a,c){for(var d=c.entries,l=[],u=0,g=d.length;u<g;u++){var f=d[u];if(!f.match||a.match(f.match)){var p=a;if(f.remove&&(p=p.replace(f.remove,"")),c.type==="SFX"?p=p+f.add:p=f.add+p,l.push(p),"continuationClasses"in f)for(var b=0,C=f.continuationClasses.length;b<C;b++){var D=this.rules[f.continuationClasses[b]];D&&(l=l.concat(this._applyRule(p,D)))}}}return l},check:function(a){if(!this.loaded)throw"Dictionary not loaded.";if(!a)return!1;var c=a.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.checkExact(c))return!0;if(c.toUpperCase()===c){var d=c[0]+c.substring(1).toLowerCase();if(this.hasFlag(d,"KEEPCASE"))return!1;if(this.checkExact(d)||this.checkExact(c.toLowerCase()))return!0}var l=c[0].toLowerCase()+c.substring(1);if(l!==c){if(this.hasFlag(l,"KEEPCASE"))return!1;if(this.checkExact(l))return!0}return!1},checkExact:function(a){if(!this.loaded)throw"Dictionary not loaded.";var c=this.dictionaryTable.get(a),d,l;if(typeof c>"u"){if("COMPOUNDMIN"in this.flags&&a.length>=this.flags.COMPOUNDMIN){for(d=0,l=this.compoundRules.length;d<l;d++)if(a.match(this.compoundRules[d]))return!0}}else{if(c===null)return!0;if(typeof c=="object"){for(d=0,l=c.length;d<l;d++)if(!this.hasFlag(a,"ONLYINCOMPOUND",c[d]))return!0}}return!1},hasFlag:function(a,c,d){if(!this.loaded)throw"Dictionary not loaded.";return!!(c in this.flags&&(typeof d>"u"&&(d=Array.prototype.concat.apply([],this.dictionaryTable.get(a))),d&&d.indexOf(this.flags[c])!==-1))},alphabet:"",suggest:function(a,c){if(!this.loaded)throw"Dictionary not loaded.";if(c=c||5,this.memoized.hasOwnProperty(a)){var d=this.memoized[a].limit;if(c<=d||this.memoized[a].suggestions.length<d)return this.memoized[a].suggestions.slice(0,c)}if(this.check(a))return[];for(var l=0,u=this.replacementTable.length;l<u;l++){var g=this.replacementTable[l];if(a.indexOf(g[0])!==-1){var f=a.replace(g[0],g[1]);if(this.check(f))return[f]}}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 p=this.alphabet.split("");p.sort();for(var b={},l=0;l<p.length;l++)b[p[l]]=!0;this.alphabet="";for(var l in b)this.alphabet+=l}var C=this;function D(T,M){var z={},I,F,B,N,R,H,_=C.alphabet.length;for(var X in T)for(I=0,N=X.length+1;I<N;I++){var K=[X.substring(0,I),X.substring(I)];if(K[1]&&(H=K[0]+K[1].substring(1),(!M||C.check(H))&&(H in z?z[H]+=1:z[H]=1)),K[1].length>1&&K[1][1]!==K[1][0]&&(H=K[0]+K[1][1]+K[1][0]+K[1].substring(2),(!M||C.check(H))&&(H in z?z[H]+=1:z[H]=1)),K[1]){var ge=K[1].substring(0,1).toUpperCase()===K[1].substring(0,1)?"uppercase":"lowercase";for(F=0;F<_;F++){var G=C.alphabet[F];ge==="uppercase"&&(G=G.toUpperCase()),G!=K[1].substring(0,1)&&(H=K[0]+G+K[1].substring(1),(!M||C.check(H))&&(H in z?z[H]+=1:z[H]=1))}}if(K[1])for(F=0;F<_;F++){var ge=K[0].substring(-1).toUpperCase()===K[0].substring(-1)&&K[1].substring(0,1).toUpperCase()===K[1].substring(0,1)?"uppercase":"lowercase",G=C.alphabet[F];ge==="uppercase"&&(G=G.toUpperCase()),H=K[0]+G+K[1],(!M||C.check(H))&&(H in z?z[H]+=1:z[H]=1)}}return z}function E(T){var M,z=D((M={},M[T]=!0,M)),I=D(z,!0),F=I;for(var B in z)C.check(B)&&(B in F?F[B]+=z[B]:F[B]=z[B]);var N,R,H=[];for(N in F)F.hasOwnProperty(N)&&(C.hasFlag(N,"PRIORITYSUGGEST")&&(F[N]+=1e3),H.push([N,F[N]]));function _(G,ue){var ae=G[1],de=ue[1];return ae<de?-1:ae>de?1:ue[0].localeCompare(G[0])}H.sort(_).reverse();var X=[],K="lowercase";T.toUpperCase()===T?K="uppercase":T.substr(0,1).toUpperCase()+T.substr(1).toLowerCase()===T&&(K="capitalized");var ge=c;for(N=0;N<Math.min(ge,H.length);N++)K==="uppercase"?H[N][0]=H[N][0].toUpperCase():K==="capitalized"&&(H[N][0]=H[N][0].substr(0,1).toUpperCase()+H[N][0].substr(1)),!C.hasFlag(H[N][0],"NOSUGGEST")&&X.indexOf(H[N][0])===-1?X.push(H[N][0]):ge++;return X}return this.memoized[a]={suggestions:E(a),limit:c},this.memoized[a].suggestions}}})();typeof $o<"u"&&($o.exports=Jo)});var eu=Ye(($d,Vs)=>{"use strict";var $s=Js();function Ae(a){if(a=a||{},typeof a.codeMirrorInstance!="function"||typeof a.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(){"use strict";return String.prototype.indexOf.apply(this,arguments)!==-1}),a.codeMirrorInstance.defineMode("spell-checker",function(c){if(!Ae.aff_loading){Ae.aff_loading=!0;var d=new XMLHttpRequest;d.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),d.onload=function(){d.readyState===4&&d.status===200&&(Ae.aff_data=d.responseText,Ae.num_loaded++,Ae.num_loaded==2&&(Ae.typo=new $s("en_US",Ae.aff_data,Ae.dic_data,{platform:"any"})))},d.send(null)}if(!Ae.dic_loading){Ae.dic_loading=!0;var l=new XMLHttpRequest;l.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),l.onload=function(){l.readyState===4&&l.status===200&&(Ae.dic_data=l.responseText,Ae.num_loaded++,Ae.num_loaded==2&&(Ae.typo=new $s("en_US",Ae.aff_data,Ae.dic_data,{platform:"any"})))},l.send(null)}var u='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',g={token:function(p){var b=p.peek(),C="";if(u.includes(b))return p.next(),null;for(;(b=p.peek())!=null&&!u.includes(b);)C+=b,p.next();return Ae.typo&&!Ae.typo.check(C)?"spell-error":null}},f=a.codeMirrorInstance.getMode(c,c.backdrop||"text/plain");return a.codeMirrorInstance.overlayMode(f,g,!0)})}Ae.num_loaded=0;Ae.aff_loading=!1;Ae.dic_loading=!1;Ae.aff_data="";Ae.dic_data="";Ae.typo;Vs.exports=Ae});var hu=Ye(Se=>{"use strict";function tu(a,c){for(var d=0;d<c.length;d++){var l=c[d];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(a,jc(l.key),l)}}function Wc(a,c,d){return c&&tu(a.prototype,c),d&&tu(a,d),Object.defineProperty(a,"prototype",{writable:!1}),a}function gt(){return gt=Object.assign?Object.assign.bind():function(a){for(var c=1;c<arguments.length;c++){var d=arguments[c];for(var l in d)Object.prototype.hasOwnProperty.call(d,l)&&(a[l]=d[l])}return a},gt.apply(this,arguments)}function qc(a,c){if(a){if(typeof a=="string")return ru(a,c);var d=Object.prototype.toString.call(a).slice(8,-1);if(d==="Object"&&a.constructor&&(d=a.constructor.name),d==="Map"||d==="Set")return Array.from(a);if(d==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d))return ru(a,c)}}function ru(a,c){(c==null||c>a.length)&&(c=a.length);for(var d=0,l=new Array(c);d<c;d++)l[d]=a[d];return l}function ln(a,c){var d=typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(d)return(d=d.call(a)).next.bind(d);if(Array.isArray(a)||(d=qc(a))||c&&a&&typeof a.length=="number"){d&&(a=d);var l=0;return function(){return l>=a.length?{done:!0}:{done:!1,value:a[l++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uc(a,c){if(typeof a!="object"||a===null)return a;var d=a[Symbol.toPrimitive];if(d!==void 0){var l=d.call(a,c||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(a)}function jc(a){var c=Uc(a,"string");return typeof c=="symbol"?c:String(c)}function Vo(){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}}Se.defaults=Vo();function Gc(a){Se.defaults=a}var uu=/[&<>"']/,Kc=new RegExp(uu.source,"g"),fu=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Xc=new RegExp(fu.source,"g"),Yc={"&":"&","<":"<",">":">",'"':""","'":"'"},iu=function(c){return Yc[c]};function et(a,c){if(c){if(uu.test(a))return a.replace(Kc,iu)}else if(fu.test(a))return a.replace(Xc,iu);return a}var Zc=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function cu(a){return a.replace(Zc,function(c,d){return d=d.toLowerCase(),d==="colon"?":":d.charAt(0)==="#"?d.charAt(1)==="x"?String.fromCharCode(parseInt(d.substring(2),16)):String.fromCharCode(+d.substring(1)):""})}var Qc=/(^|[^\[])\^/g;function we(a,c){a=typeof a=="string"?a:a.source,c=c||"";var d={replace:function(u,g){return g=g.source||g,g=g.replace(Qc,"$1"),a=a.replace(u,g),d},getRegex:function(){return new RegExp(a,c)}};return d}var Jc=/[^\w:]/g,$c=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function nu(a,c,d){if(a){var l;try{l=decodeURIComponent(cu(d)).replace(Jc,"").toLowerCase()}catch{return null}if(l.indexOf("javascript:")===0||l.indexOf("vbscript:")===0||l.indexOf("data:")===0)return null}c&&!$c.test(d)&&(d=rd(c,d));try{d=encodeURI(d).replace(/%25/g,"%")}catch{return null}return d}var sn={},Vc=/^[^:]+:\/*[^/]*$/,ed=/^([^:]+:)[\s\S]*$/,td=/^([^:]+:\/*[^/]*)[\s\S]*$/;function rd(a,c){sn[" "+a]||(Vc.test(a)?sn[" "+a]=a+"/":sn[" "+a]=un(a,"/",!0)),a=sn[" "+a];var d=a.indexOf(":")===-1;return c.substring(0,2)==="//"?d?c:a.replace(ed,"$1")+c:c.charAt(0)==="/"?d?c:a.replace(td,"$1")+c:a+c}var fn={exec:function(){}};function ou(a,c){var d=a.replace(/\|/g,function(g,f,p){for(var b=!1,C=f;--C>=0&&p[C]==="\\";)b=!b;return b?"|":" |"}),l=d.split(/ \|/),u=0;if(l[0].trim()||l.shift(),l.length>0&&!l[l.length-1].trim()&&l.pop(),l.length>c)l.splice(c);else for(;l.length<c;)l.push("");for(;u<l.length;u++)l[u]=l[u].trim().replace(/\\\|/g,"|");return l}function un(a,c,d){var l=a.length;if(l===0)return"";for(var u=0;u<l;){var g=a.charAt(l-u-1);if(g===c&&!d)u++;else if(g!==c&&d)u++;else break}return a.slice(0,l-u)}function id(a,c){if(a.indexOf(c[1])===-1)return-1;for(var d=a.length,l=0,u=0;u<d;u++)if(a[u]==="\\")u++;else if(a[u]===c[0])l++;else if(a[u]===c[1]&&(l--,l<0))return u;return-1}function nd(a){a&&a.sanitize&&!a.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 au(a,c){if(c<1)return"";for(var d="";c>1;)c&1&&(d+=a),c>>=1,a+=a;return d+a}function lu(a,c,d,l){var u=c.href,g=c.title?et(c.title):null,f=a[1].replace(/\\([\[\]])/g,"$1");if(a[0].charAt(0)!=="!"){l.state.inLink=!0;var p={type:"link",raw:d,href:u,title:g,text:f,tokens:l.inlineTokens(f)};return l.state.inLink=!1,p}return{type:"image",raw:d,href:u,title:g,text:et(f)}}function od(a,c){var d=a.match(/^(\s+)(?:```)/);if(d===null)return c;var l=d[1];return c.split(`
|
|
`).map(function(u){var g=u.match(/^\s+/);if(g===null)return u;var f=g[0];return f.length>=l.length?u.slice(l.length):u}).join(`
|
|
`)}var cn=function(){function a(d){this.options=d||Se.defaults}var c=a.prototype;return c.space=function(l){var u=this.rules.block.newline.exec(l);if(u&&u[0].length>0)return{type:"space",raw:u[0]}},c.code=function(l){var u=this.rules.block.code.exec(l);if(u){var g=u[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:u[0],codeBlockStyle:"indented",text:this.options.pedantic?g:un(g,`
|
|
`)}}},c.fences=function(l){var u=this.rules.block.fences.exec(l);if(u){var g=u[0],f=od(g,u[3]||"");return{type:"code",raw:g,lang:u[2]?u[2].trim().replace(this.rules.inline._escapes,"$1"):u[2],text:f}}},c.heading=function(l){var u=this.rules.block.heading.exec(l);if(u){var g=u[2].trim();if(/#$/.test(g)){var f=un(g,"#");(this.options.pedantic||!f||/ $/.test(f))&&(g=f.trim())}return{type:"heading",raw:u[0],depth:u[1].length,text:g,tokens:this.lexer.inline(g)}}},c.hr=function(l){var u=this.rules.block.hr.exec(l);if(u)return{type:"hr",raw:u[0]}},c.blockquote=function(l){var u=this.rules.block.blockquote.exec(l);if(u){var g=u[0].replace(/^ *>[ \t]?/gm,""),f=this.lexer.state.top;this.lexer.state.top=!0;var p=this.lexer.blockTokens(g);return this.lexer.state.top=f,{type:"blockquote",raw:u[0],tokens:p,text:g}}},c.list=function(l){var u=this.rules.block.list.exec(l);if(u){var g,f,p,b,C,D,E,T,M,z,I,F,B=u[1].trim(),N=B.length>1,R={type:"list",raw:"",ordered:N,start:N?+B.slice(0,-1):"",loose:!1,items:[]};B=N?"\\d{1,9}\\"+B.slice(-1):"\\"+B,this.options.pedantic&&(B=N?B:"[*+-]");for(var H=new RegExp("^( {0,3}"+B+")((?:[ ][^\\n]*)?(?:\\n|$))");l&&(F=!1,!(!(u=H.exec(l))||this.rules.block.hr.test(l)));){if(g=u[0],l=l.substring(g.length),T=u[2].split(`
|
|
`,1)[0].replace(/^\t+/,function(de){return" ".repeat(3*de.length)}),M=l.split(`
|
|
`,1)[0],this.options.pedantic?(b=2,I=T.trimLeft()):(b=u[2].search(/[^ ]/),b=b>4?1:b,I=T.slice(b),b+=u[1].length),D=!1,!T&&/^ *$/.test(M)&&(g+=M+`
|
|
`,l=l.substring(M.length+1),F=!0),!F)for(var _=new RegExp("^ {0,"+Math.min(3,b-1)+"}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))"),X=new RegExp("^ {0,"+Math.min(3,b-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),K=new RegExp("^ {0,"+Math.min(3,b-1)+"}(?:```|~~~)"),ge=new RegExp("^ {0,"+Math.min(3,b-1)+"}#");l&&(z=l.split(`
|
|
`,1)[0],M=z,this.options.pedantic&&(M=M.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(K.test(M)||ge.test(M)||_.test(M)||X.test(l)));){if(M.search(/[^ ]/)>=b||!M.trim())I+=`
|
|
`+M.slice(b);else{if(D||T.search(/[^ ]/)>=4||K.test(T)||ge.test(T)||X.test(T))break;I+=`
|
|
`+M}!D&&!M.trim()&&(D=!0),g+=z+`
|
|
`,l=l.substring(z.length+1),T=M.slice(b)}R.loose||(E?R.loose=!0:/\n *\n *$/.test(g)&&(E=!0)),this.options.gfm&&(f=/^\[[ xX]\] /.exec(I),f&&(p=f[0]!=="[ ] ",I=I.replace(/^\[[ xX]\] +/,""))),R.items.push({type:"list_item",raw:g,task:!!f,checked:p,loose:!1,text:I}),R.raw+=g}R.items[R.items.length-1].raw=g.trimRight(),R.items[R.items.length-1].text=I.trimRight(),R.raw=R.raw.trimRight();var G=R.items.length;for(C=0;C<G;C++)if(this.lexer.state.top=!1,R.items[C].tokens=this.lexer.blockTokens(R.items[C].text,[]),!R.loose){var ue=R.items[C].tokens.filter(function(de){return de.type==="space"}),ae=ue.length>0&&ue.some(function(de){return/\n.*\n/.test(de.raw)});R.loose=ae}if(R.loose)for(C=0;C<G;C++)R.items[C].loose=!0;return R}},c.html=function(l){var u=this.rules.block.html.exec(l);if(u){var g={type:"html",raw:u[0],pre:!this.options.sanitizer&&(u[1]==="pre"||u[1]==="script"||u[1]==="style"),text:u[0]};if(this.options.sanitize){var f=this.options.sanitizer?this.options.sanitizer(u[0]):et(u[0]);g.type="paragraph",g.text=f,g.tokens=this.lexer.inline(f)}return g}},c.def=function(l){var u=this.rules.block.def.exec(l);if(u){var g=u[1].toLowerCase().replace(/\s+/g," "),f=u[2]?u[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",p=u[3]?u[3].substring(1,u[3].length-1).replace(this.rules.inline._escapes,"$1"):u[3];return{type:"def",tag:g,raw:u[0],href:f,title:p}}},c.table=function(l){var u=this.rules.block.table.exec(l);if(u){var g={type:"table",header:ou(u[1]).map(function(E){return{text:E}}),align:u[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:u[3]&&u[3].trim()?u[3].replace(/\n[ \t]*$/,"").split(`
|
|
`):[]};if(g.header.length===g.align.length){g.raw=u[0];var f=g.align.length,p,b,C,D;for(p=0;p<f;p++)/^ *-+: *$/.test(g.align[p])?g.align[p]="right":/^ *:-+: *$/.test(g.align[p])?g.align[p]="center":/^ *:-+ *$/.test(g.align[p])?g.align[p]="left":g.align[p]=null;for(f=g.rows.length,p=0;p<f;p++)g.rows[p]=ou(g.rows[p],g.header.length).map(function(E){return{text:E}});for(f=g.header.length,b=0;b<f;b++)g.header[b].tokens=this.lexer.inline(g.header[b].text);for(f=g.rows.length,b=0;b<f;b++)for(D=g.rows[b],C=0;C<D.length;C++)D[C].tokens=this.lexer.inline(D[C].text);return g}}},c.lheading=function(l){var u=this.rules.block.lheading.exec(l);if(u)return{type:"heading",raw:u[0],depth:u[2].charAt(0)==="="?1:2,text:u[1],tokens:this.lexer.inline(u[1])}},c.paragraph=function(l){var u=this.rules.block.paragraph.exec(l);if(u){var g=u[1].charAt(u[1].length-1)===`
|
|
`?u[1].slice(0,-1):u[1];return{type:"paragraph",raw:u[0],text:g,tokens:this.lexer.inline(g)}}},c.text=function(l){var u=this.rules.block.text.exec(l);if(u)return{type:"text",raw:u[0],text:u[0],tokens:this.lexer.inline(u[0])}},c.escape=function(l){var u=this.rules.inline.escape.exec(l);if(u)return{type:"escape",raw:u[0],text:et(u[1])}},c.tag=function(l){var u=this.rules.inline.tag.exec(l);if(u)return!this.lexer.state.inLink&&/^<a /i.test(u[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(u[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(u[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(u[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:u[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(u[0]):et(u[0]):u[0]}},c.link=function(l){var u=this.rules.inline.link.exec(l);if(u){var g=u[2].trim();if(!this.options.pedantic&&/^</.test(g)){if(!/>$/.test(g))return;var f=un(g.slice(0,-1),"\\");if((g.length-f.length)%2===0)return}else{var p=id(u[2],"()");if(p>-1){var b=u[0].indexOf("!")===0?5:4,C=b+u[1].length+p;u[2]=u[2].substring(0,p),u[0]=u[0].substring(0,C).trim(),u[3]=""}}var D=u[2],E="";if(this.options.pedantic){var T=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(D);T&&(D=T[1],E=T[3])}else E=u[3]?u[3].slice(1,-1):"";return D=D.trim(),/^</.test(D)&&(this.options.pedantic&&!/>$/.test(g)?D=D.slice(1):D=D.slice(1,-1)),lu(u,{href:D&&D.replace(this.rules.inline._escapes,"$1"),title:E&&E.replace(this.rules.inline._escapes,"$1")},u[0],this.lexer)}},c.reflink=function(l,u){var g;if((g=this.rules.inline.reflink.exec(l))||(g=this.rules.inline.nolink.exec(l))){var f=(g[2]||g[1]).replace(/\s+/g," ");if(f=u[f.toLowerCase()],!f){var p=g[0].charAt(0);return{type:"text",raw:p,text:p}}return lu(g,f,g[0],this.lexer)}},c.emStrong=function(l,u,g){g===void 0&&(g="");var f=this.rules.inline.emStrong.lDelim.exec(l);if(f&&!(f[3]&&g.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 p=f[1]||f[2]||"";if(!p||p&&(g===""||this.rules.inline.punctuation.exec(g))){var b=f[0].length-1,C,D,E=b,T=0,M=f[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(M.lastIndex=0,u=u.slice(-1*l.length+b);(f=M.exec(u))!=null;)if(C=f[1]||f[2]||f[3]||f[4]||f[5]||f[6],!!C){if(D=C.length,f[3]||f[4]){E+=D;continue}else if((f[5]||f[6])&&b%3&&!((b+D)%3)){T+=D;continue}if(E-=D,!(E>0)){D=Math.min(D,D+E+T);var z=l.slice(0,b+f.index+(f[0].length-C.length)+D);if(Math.min(b,D)%2){var I=z.slice(1,-1);return{type:"em",raw:z,text:I,tokens:this.lexer.inlineTokens(I)}}var F=z.slice(2,-2);return{type:"strong",raw:z,text:F,tokens:this.lexer.inlineTokens(F)}}}}}},c.codespan=function(l){var u=this.rules.inline.code.exec(l);if(u){var g=u[2].replace(/\n/g," "),f=/[^ ]/.test(g),p=/^ /.test(g)&&/ $/.test(g);return f&&p&&(g=g.substring(1,g.length-1)),g=et(g,!0),{type:"codespan",raw:u[0],text:g}}},c.br=function(l){var u=this.rules.inline.br.exec(l);if(u)return{type:"br",raw:u[0]}},c.del=function(l){var u=this.rules.inline.del.exec(l);if(u)return{type:"del",raw:u[0],text:u[2],tokens:this.lexer.inlineTokens(u[2])}},c.autolink=function(l,u){var g=this.rules.inline.autolink.exec(l);if(g){var f,p;return g[2]==="@"?(f=et(this.options.mangle?u(g[1]):g[1]),p="mailto:"+f):(f=et(g[1]),p=f),{type:"link",raw:g[0],text:f,href:p,tokens:[{type:"text",raw:f,text:f}]}}},c.url=function(l,u){var g;if(g=this.rules.inline.url.exec(l)){var f,p;if(g[2]==="@")f=et(this.options.mangle?u(g[0]):g[0]),p="mailto:"+f;else{var b;do b=g[0],g[0]=this.rules.inline._backpedal.exec(g[0])[0];while(b!==g[0]);f=et(g[0]),g[1]==="www."?p="http://"+g[0]:p=g[0]}return{type:"link",raw:g[0],text:f,href:p,tokens:[{type:"text",raw:f,text:f}]}}},c.inlineText=function(l,u){var g=this.rules.inline.text.exec(l);if(g){var f;return this.lexer.state.inRawBlock?f=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(g[0]):et(g[0]):g[0]:f=et(this.options.smartypants?u(g[0]):g[0]),{type:"text",raw:g[0],text:f}}},a}(),se={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:fn,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};se._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;se._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;se.def=we(se.def).replace("label",se._label).replace("title",se._title).getRegex();se.bullet=/(?:[*+-]|\d{1,9}[.)])/;se.listItemStart=we(/^( *)(bull) */).replace("bull",se.bullet).getRegex();se.list=we(se.list).replace(/bull/g,se.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+se.def.source+")").getRegex();se._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";se._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;se.html=we(se.html,"i").replace("comment",se._comment).replace("tag",se._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();se.paragraph=we(se._paragraph).replace("hr",se.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",se._tag).getRegex();se.blockquote=we(se.blockquote).replace("paragraph",se.paragraph).getRegex();se.normal=gt({},se);se.gfm=gt({},se.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});se.gfm.table=we(se.gfm.table).replace("hr",se.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",se._tag).getRegex();se.gfm.paragraph=we(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",se.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",se._tag).getRegex();se.pedantic=gt({},se.normal,{html:we(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",se._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:fn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:we(se.normal._paragraph).replace("hr",se.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",se.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var te={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:fn,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:fn,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};te._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";te.punctuation=we(te.punctuation).replace(/punctuation/g,te._punctuation).getRegex();te.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;te.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;te._comment=we(se._comment).replace("(?:-->|$)","-->").getRegex();te.emStrong.lDelim=we(te.emStrong.lDelim).replace(/punct/g,te._punctuation).getRegex();te.emStrong.rDelimAst=we(te.emStrong.rDelimAst,"g").replace(/punct/g,te._punctuation).getRegex();te.emStrong.rDelimUnd=we(te.emStrong.rDelimUnd,"g").replace(/punct/g,te._punctuation).getRegex();te._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;te._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;te._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])?)+(?![-_])/;te.autolink=we(te.autolink).replace("scheme",te._scheme).replace("email",te._email).getRegex();te._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;te.tag=we(te.tag).replace("comment",te._comment).replace("attribute",te._attribute).getRegex();te._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;te._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;te._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;te.link=we(te.link).replace("label",te._label).replace("href",te._href).replace("title",te._title).getRegex();te.reflink=we(te.reflink).replace("label",te._label).replace("ref",se._label).getRegex();te.nolink=we(te.nolink).replace("ref",se._label).getRegex();te.reflinkSearch=we(te.reflinkSearch,"g").replace("reflink",te.reflink).replace("nolink",te.nolink).getRegex();te.normal=gt({},te);te.pedantic=gt({},te.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:we(/^!?\[(label)\]\((.*?)\)/).replace("label",te._label).getRegex(),reflink:we(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",te._label).getRegex()});te.gfm=gt({},te.normal,{escape:we(te.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.!#$%&'*+\/=?_`{\|}~-]+@)))/});te.gfm.url=we(te.gfm.url,"i").replace("email",te.gfm._extended_email).getRegex();te.breaks=gt({},te.gfm,{br:we(te.br).replace("{2,}","*").getRegex(),text:we(te.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});function ad(a){return a.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function su(a){var c="",d,l,u=a.length;for(d=0;d<u;d++)l=a.charCodeAt(d),Math.random()>.5&&(l="x"+l.toString(16)),c+="&#"+l+";";return c}var Pr=function(){function a(d){this.tokens=[],this.tokens.links=Object.create(null),this.options=d||Se.defaults,this.options.tokenizer=this.options.tokenizer||new cn,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 l={block:se.normal,inline:te.normal};this.options.pedantic?(l.block=se.pedantic,l.inline=te.pedantic):this.options.gfm&&(l.block=se.gfm,this.options.breaks?l.inline=te.breaks:l.inline=te.gfm),this.tokenizer.rules=l}a.lex=function(l,u){var g=new a(u);return g.lex(l)},a.lexInline=function(l,u){var g=new a(u);return g.inlineTokens(l)};var c=a.prototype;return c.lex=function(l){l=l.replace(/\r\n|\r/g,`
|
|
`),this.blockTokens(l,this.tokens);for(var u;u=this.inlineQueue.shift();)this.inlineTokens(u.src,u.tokens);return this.tokens},c.blockTokens=function(l,u){var g=this;u===void 0&&(u=[]),this.options.pedantic?l=l.replace(/\t/g," ").replace(/^ +$/gm,""):l=l.replace(/^( *)(\t+)/gm,function(E,T,M){return T+" ".repeat(M.length)});for(var f,p,b,C;l;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(E){return(f=E.call({lexer:g},l,u))?(l=l.substring(f.raw.length),u.push(f),!0):!1}))){if(f=this.tokenizer.space(l)){l=l.substring(f.raw.length),f.raw.length===1&&u.length>0?u[u.length-1].raw+=`
|
|
`:u.push(f);continue}if(f=this.tokenizer.code(l)){l=l.substring(f.raw.length),p=u[u.length-1],p&&(p.type==="paragraph"||p.type==="text")?(p.raw+=`
|
|
`+f.raw,p.text+=`
|
|
`+f.text,this.inlineQueue[this.inlineQueue.length-1].src=p.text):u.push(f);continue}if(f=this.tokenizer.fences(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.heading(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.hr(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.blockquote(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.list(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.html(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.def(l)){l=l.substring(f.raw.length),p=u[u.length-1],p&&(p.type==="paragraph"||p.type==="text")?(p.raw+=`
|
|
`+f.raw,p.text+=`
|
|
`+f.raw,this.inlineQueue[this.inlineQueue.length-1].src=p.text):this.tokens.links[f.tag]||(this.tokens.links[f.tag]={href:f.href,title:f.title});continue}if(f=this.tokenizer.table(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.lheading(l)){l=l.substring(f.raw.length),u.push(f);continue}if(b=l,this.options.extensions&&this.options.extensions.startBlock&&function(){var E=1/0,T=l.slice(1),M=void 0;g.options.extensions.startBlock.forEach(function(z){M=z.call({lexer:this},T),typeof M=="number"&&M>=0&&(E=Math.min(E,M))}),E<1/0&&E>=0&&(b=l.substring(0,E+1))}(),this.state.top&&(f=this.tokenizer.paragraph(b))){p=u[u.length-1],C&&p.type==="paragraph"?(p.raw+=`
|
|
`+f.raw,p.text+=`
|
|
`+f.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=p.text):u.push(f),C=b.length!==l.length,l=l.substring(f.raw.length);continue}if(f=this.tokenizer.text(l)){l=l.substring(f.raw.length),p=u[u.length-1],p&&p.type==="text"?(p.raw+=`
|
|
`+f.raw,p.text+=`
|
|
`+f.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=p.text):u.push(f);continue}if(l){var D="Infinite loop on byte: "+l.charCodeAt(0);if(this.options.silent){console.error(D);break}else throw new Error(D)}}return this.state.top=!0,u},c.inline=function(l,u){return u===void 0&&(u=[]),this.inlineQueue.push({src:l,tokens:u}),u},c.inlineTokens=function(l,u){var g=this;u===void 0&&(u=[]);var f,p,b,C=l,D,E,T;if(this.tokens.links){var M=Object.keys(this.tokens.links);if(M.length>0)for(;(D=this.tokenizer.rules.inline.reflinkSearch.exec(C))!=null;)M.includes(D[0].slice(D[0].lastIndexOf("[")+1,-1))&&(C=C.slice(0,D.index)+"["+au("a",D[0].length-2)+"]"+C.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(D=this.tokenizer.rules.inline.blockSkip.exec(C))!=null;)C=C.slice(0,D.index)+"["+au("a",D[0].length-2)+"]"+C.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(D=this.tokenizer.rules.inline.escapedEmSt.exec(C))!=null;)C=C.slice(0,D.index+D[0].length-2)+"++"+C.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;l;)if(E||(T=""),E=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(I){return(f=I.call({lexer:g},l,u))?(l=l.substring(f.raw.length),u.push(f),!0):!1}))){if(f=this.tokenizer.escape(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.tag(l)){l=l.substring(f.raw.length),p=u[u.length-1],p&&f.type==="text"&&p.type==="text"?(p.raw+=f.raw,p.text+=f.text):u.push(f);continue}if(f=this.tokenizer.link(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.reflink(l,this.tokens.links)){l=l.substring(f.raw.length),p=u[u.length-1],p&&f.type==="text"&&p.type==="text"?(p.raw+=f.raw,p.text+=f.text):u.push(f);continue}if(f=this.tokenizer.emStrong(l,C,T)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.codespan(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.br(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.del(l)){l=l.substring(f.raw.length),u.push(f);continue}if(f=this.tokenizer.autolink(l,su)){l=l.substring(f.raw.length),u.push(f);continue}if(!this.state.inLink&&(f=this.tokenizer.url(l,su))){l=l.substring(f.raw.length),u.push(f);continue}if(b=l,this.options.extensions&&this.options.extensions.startInline&&function(){var I=1/0,F=l.slice(1),B=void 0;g.options.extensions.startInline.forEach(function(N){B=N.call({lexer:this},F),typeof B=="number"&&B>=0&&(I=Math.min(I,B))}),I<1/0&&I>=0&&(b=l.substring(0,I+1))}(),f=this.tokenizer.inlineText(b,ad)){l=l.substring(f.raw.length),f.raw.slice(-1)!=="_"&&(T=f.raw.slice(-1)),E=!0,p=u[u.length-1],p&&p.type==="text"?(p.raw+=f.raw,p.text+=f.text):u.push(f);continue}if(l){var z="Infinite loop on byte: "+l.charCodeAt(0);if(this.options.silent){console.error(z);break}else throw new Error(z)}}return u},Wc(a,null,[{key:"rules",get:function(){return{block:se,inline:te}}}]),a}(),dn=function(){function a(d){this.options=d||Se.defaults}var c=a.prototype;return c.code=function(l,u,g){var f=(u||"").match(/\S*/)[0];if(this.options.highlight){var p=this.options.highlight(l,f);p!=null&&p!==l&&(g=!0,l=p)}return l=l.replace(/\n$/,"")+`
|
|
`,f?'<pre><code class="'+this.options.langPrefix+et(f)+'">'+(g?l:et(l,!0))+`</code></pre>
|
|
`:"<pre><code>"+(g?l:et(l,!0))+`</code></pre>
|
|
`},c.blockquote=function(l){return`<blockquote>
|
|
`+l+`</blockquote>
|
|
`},c.html=function(l){return l},c.heading=function(l,u,g,f){if(this.options.headerIds){var p=this.options.headerPrefix+f.slug(g);return"<h"+u+' id="'+p+'">'+l+"</h"+u+`>
|
|
`}return"<h"+u+">"+l+"</h"+u+`>
|
|
`},c.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},c.list=function(l,u,g){var f=u?"ol":"ul",p=u&&g!==1?' start="'+g+'"':"";return"<"+f+p+`>
|
|
`+l+"</"+f+`>
|
|
`},c.listitem=function(l){return"<li>"+l+`</li>
|
|
`},c.checkbox=function(l){return"<input "+(l?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},c.paragraph=function(l){return"<p>"+l+`</p>
|
|
`},c.table=function(l,u){return u&&(u="<tbody>"+u+"</tbody>"),`<table>
|
|
<thead>
|
|
`+l+`</thead>
|
|
`+u+`</table>
|
|
`},c.tablerow=function(l){return`<tr>
|
|
`+l+`</tr>
|
|
`},c.tablecell=function(l,u){var g=u.header?"th":"td",f=u.align?"<"+g+' align="'+u.align+'">':"<"+g+">";return f+l+("</"+g+`>
|
|
`)},c.strong=function(l){return"<strong>"+l+"</strong>"},c.em=function(l){return"<em>"+l+"</em>"},c.codespan=function(l){return"<code>"+l+"</code>"},c.br=function(){return this.options.xhtml?"<br/>":"<br>"},c.del=function(l){return"<del>"+l+"</del>"},c.link=function(l,u,g){if(l=nu(this.options.sanitize,this.options.baseUrl,l),l===null)return g;var f='<a href="'+l+'"';return u&&(f+=' title="'+u+'"'),f+=">"+g+"</a>",f},c.image=function(l,u,g){if(l=nu(this.options.sanitize,this.options.baseUrl,l),l===null)return g;var f='<img src="'+l+'" alt="'+g+'"';return u&&(f+=' title="'+u+'"'),f+=this.options.xhtml?"/>":">",f},c.text=function(l){return l},a}(),ea=function(){function a(){}var c=a.prototype;return c.strong=function(l){return l},c.em=function(l){return l},c.codespan=function(l){return l},c.del=function(l){return l},c.html=function(l){return l},c.text=function(l){return l},c.link=function(l,u,g){return""+g},c.image=function(l,u,g){return""+g},c.br=function(){return""},a}(),ta=function(){function a(){this.seen={}}var c=a.prototype;return c.serialize=function(l){return l.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},c.getNextSafeSlug=function(l,u){var g=l,f=0;if(this.seen.hasOwnProperty(g)){f=this.seen[l];do f++,g=l+"-"+f;while(this.seen.hasOwnProperty(g))}return u||(this.seen[l]=f,this.seen[g]=0),g},c.slug=function(l,u){u===void 0&&(u={});var g=this.serialize(l);return this.getNextSafeSlug(g,u.dryrun)},a}(),_r=function(){function a(d){this.options=d||Se.defaults,this.options.renderer=this.options.renderer||new dn,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ea,this.slugger=new ta}a.parse=function(l,u){var g=new a(u);return g.parse(l)},a.parseInline=function(l,u){var g=new a(u);return g.parseInline(l)};var c=a.prototype;return c.parse=function(l,u){u===void 0&&(u=!0);var g="",f,p,b,C,D,E,T,M,z,I,F,B,N,R,H,_,X,K,ge,G=l.length;for(f=0;f<G;f++){if(I=l[f],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[I.type]&&(ge=this.options.extensions.renderers[I.type].call({parser:this},I),ge!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(I.type))){g+=ge||"";continue}switch(I.type){case"space":continue;case"hr":{g+=this.renderer.hr();continue}case"heading":{g+=this.renderer.heading(this.parseInline(I.tokens),I.depth,cu(this.parseInline(I.tokens,this.textRenderer)),this.slugger);continue}case"code":{g+=this.renderer.code(I.text,I.lang,I.escaped);continue}case"table":{for(M="",T="",C=I.header.length,p=0;p<C;p++)T+=this.renderer.tablecell(this.parseInline(I.header[p].tokens),{header:!0,align:I.align[p]});for(M+=this.renderer.tablerow(T),z="",C=I.rows.length,p=0;p<C;p++){for(E=I.rows[p],T="",D=E.length,b=0;b<D;b++)T+=this.renderer.tablecell(this.parseInline(E[b].tokens),{header:!1,align:I.align[b]});z+=this.renderer.tablerow(T)}g+=this.renderer.table(M,z);continue}case"blockquote":{z=this.parse(I.tokens),g+=this.renderer.blockquote(z);continue}case"list":{for(F=I.ordered,B=I.start,N=I.loose,C=I.items.length,z="",p=0;p<C;p++)H=I.items[p],_=H.checked,X=H.task,R="",H.task&&(K=this.renderer.checkbox(_),N?H.tokens.length>0&&H.tokens[0].type==="paragraph"?(H.tokens[0].text=K+" "+H.tokens[0].text,H.tokens[0].tokens&&H.tokens[0].tokens.length>0&&H.tokens[0].tokens[0].type==="text"&&(H.tokens[0].tokens[0].text=K+" "+H.tokens[0].tokens[0].text)):H.tokens.unshift({type:"text",text:K}):R+=K),R+=this.parse(H.tokens,N),z+=this.renderer.listitem(R,X,_);g+=this.renderer.list(z,F,B);continue}case"html":{g+=this.renderer.html(I.text);continue}case"paragraph":{g+=this.renderer.paragraph(this.parseInline(I.tokens));continue}case"text":{for(z=I.tokens?this.parseInline(I.tokens):I.text;f+1<G&&l[f+1].type==="text";)I=l[++f],z+=`
|
|
`+(I.tokens?this.parseInline(I.tokens):I.text);g+=u?this.renderer.paragraph(z):z;continue}default:{var ue='Token with "'+I.type+'" type was not found.';if(this.options.silent){console.error(ue);return}else throw new Error(ue)}}}return g},c.parseInline=function(l,u){u=u||this.renderer;var g="",f,p,b,C=l.length;for(f=0;f<C;f++){if(p=l[f],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[p.type]&&(b=this.options.extensions.renderers[p.type].call({parser:this},p),b!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(p.type))){g+=b||"";continue}switch(p.type){case"escape":{g+=u.text(p.text);break}case"html":{g+=u.html(p.text);break}case"link":{g+=u.link(p.href,p.title,this.parseInline(p.tokens,u));break}case"image":{g+=u.image(p.href,p.title,p.text);break}case"strong":{g+=u.strong(this.parseInline(p.tokens,u));break}case"em":{g+=u.em(this.parseInline(p.tokens,u));break}case"codespan":{g+=u.codespan(p.text);break}case"br":{g+=u.br();break}case"del":{g+=u.del(this.parseInline(p.tokens,u));break}case"text":{g+=u.text(p.text);break}default:{var D='Token with "'+p.type+'" type was not found.';if(this.options.silent){console.error(D);return}else throw new Error(D)}}}return g},a}(),Ci=function(){function a(d){this.options=d||Se.defaults}var c=a.prototype;return c.preprocess=function(l){return l},c.postprocess=function(l){return l},a}();Ci.passThroughHooks=new Set(["preprocess","postprocess"]);function ld(a,c,d){return function(l){if(l.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,a){var u="<p>An error occurred:</p><pre>"+et(l.message+"",!0)+"</pre>";if(c)return Promise.resolve(u);if(d){d(null,u);return}return u}if(c)return Promise.reject(l);if(d){d(l);return}throw l}}function du(a,c){return function(d,l,u){typeof l=="function"&&(u=l,l=null);var g=gt({},l);l=gt({},le.defaults,g);var f=ld(l.silent,l.async,u);if(typeof d>"u"||d===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof d!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(d)+", string expected"));if(nd(l),l.hooks&&(l.hooks.options=l),u){var p=l.highlight,b;try{l.hooks&&(d=l.hooks.preprocess(d)),b=a(d,l)}catch(M){return f(M)}var C=function(z){var I;if(!z)try{l.walkTokens&&le.walkTokens(b,l.walkTokens),I=c(b,l),l.hooks&&(I=l.hooks.postprocess(I))}catch(F){z=F}return l.highlight=p,z?f(z):u(null,I)};if(!p||p.length<3||(delete l.highlight,!b.length))return C();var D=0;le.walkTokens(b,function(M){M.type==="code"&&(D++,setTimeout(function(){p(M.text,M.lang,function(z,I){if(z)return C(z);I!=null&&I!==M.text&&(M.text=I,M.escaped=!0),D--,D===0&&C()})},0))}),D===0&&C();return}if(l.async)return Promise.resolve(l.hooks?l.hooks.preprocess(d):d).then(function(M){return a(M,l)}).then(function(M){return l.walkTokens?Promise.all(le.walkTokens(M,l.walkTokens)).then(function(){return M}):M}).then(function(M){return c(M,l)}).then(function(M){return l.hooks?l.hooks.postprocess(M):M}).catch(f);try{l.hooks&&(d=l.hooks.preprocess(d));var E=a(d,l);l.walkTokens&&le.walkTokens(E,l.walkTokens);var T=c(E,l);return l.hooks&&(T=l.hooks.postprocess(T)),T}catch(M){return f(M)}}}function le(a,c,d){return du(Pr.lex,_r.parse)(a,c,d)}le.options=le.setOptions=function(a){return le.defaults=gt({},le.defaults,a),Gc(le.defaults),le};le.getDefaults=Vo;le.defaults=Se.defaults;le.use=function(){for(var a=le.defaults.extensions||{renderers:{},childTokens:{}},c=arguments.length,d=new Array(c),l=0;l<c;l++)d[l]=arguments[l];d.forEach(function(u){var g=gt({},u);if(g.async=le.defaults.async||g.async||!1,u.extensions&&(u.extensions.forEach(function(p){if(!p.name)throw new Error("extension name required");if(p.renderer){var b=a.renderers[p.name];b?a.renderers[p.name]=function(){for(var C=arguments.length,D=new Array(C),E=0;E<C;E++)D[E]=arguments[E];var T=p.renderer.apply(this,D);return T===!1&&(T=b.apply(this,D)),T}:a.renderers[p.name]=p.renderer}if(p.tokenizer){if(!p.level||p.level!=="block"&&p.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");a[p.level]?a[p.level].unshift(p.tokenizer):a[p.level]=[p.tokenizer],p.start&&(p.level==="block"?a.startBlock?a.startBlock.push(p.start):a.startBlock=[p.start]:p.level==="inline"&&(a.startInline?a.startInline.push(p.start):a.startInline=[p.start]))}p.childTokens&&(a.childTokens[p.name]=p.childTokens)}),g.extensions=a),u.renderer&&function(){var p=le.defaults.renderer||new dn,b=function(E){var T=p[E];p[E]=function(){for(var M=arguments.length,z=new Array(M),I=0;I<M;I++)z[I]=arguments[I];var F=u.renderer[E].apply(p,z);return F===!1&&(F=T.apply(p,z)),F}};for(var C in u.renderer)b(C);g.renderer=p}(),u.tokenizer&&function(){var p=le.defaults.tokenizer||new cn,b=function(E){var T=p[E];p[E]=function(){for(var M=arguments.length,z=new Array(M),I=0;I<M;I++)z[I]=arguments[I];var F=u.tokenizer[E].apply(p,z);return F===!1&&(F=T.apply(p,z)),F}};for(var C in u.tokenizer)b(C);g.tokenizer=p}(),u.hooks&&function(){var p=le.defaults.hooks||new Ci,b=function(E){var T=p[E];Ci.passThroughHooks.has(E)?p[E]=function(M){if(le.defaults.async)return Promise.resolve(u.hooks[E].call(p,M)).then(function(I){return T.call(p,I)});var z=u.hooks[E].call(p,M);return T.call(p,z)}:p[E]=function(){for(var M=arguments.length,z=new Array(M),I=0;I<M;I++)z[I]=arguments[I];var F=u.hooks[E].apply(p,z);return F===!1&&(F=T.apply(p,z)),F}};for(var C in u.hooks)b(C);g.hooks=p}(),u.walkTokens){var f=le.defaults.walkTokens;g.walkTokens=function(p){var b=[];return b.push(u.walkTokens.call(this,p)),f&&(b=b.concat(f.call(this,p))),b}}le.setOptions(g)})};le.walkTokens=function(a,c){for(var d=[],l=function(){var p=g.value;switch(d=d.concat(c.call(le,p)),p.type){case"table":{for(var b=ln(p.header),C;!(C=b()).done;){var D=C.value;d=d.concat(le.walkTokens(D.tokens,c))}for(var E=ln(p.rows),T;!(T=E()).done;)for(var M=T.value,z=ln(M),I;!(I=z()).done;){var F=I.value;d=d.concat(le.walkTokens(F.tokens,c))}break}case"list":{d=d.concat(le.walkTokens(p.items,c));break}default:le.defaults.extensions&&le.defaults.extensions.childTokens&&le.defaults.extensions.childTokens[p.type]?le.defaults.extensions.childTokens[p.type].forEach(function(B){d=d.concat(le.walkTokens(p[B],c))}):p.tokens&&(d=d.concat(le.walkTokens(p.tokens,c)))}},u=ln(a),g;!(g=u()).done;)l();return d};le.parseInline=du(Pr.lexInline,_r.parseInline);le.Parser=_r;le.parser=_r.parse;le.Renderer=dn;le.TextRenderer=ea;le.Lexer=Pr;le.lexer=Pr.lex;le.Tokenizer=cn;le.Slugger=ta;le.Hooks=Ci;le.parse=le;var sd=le.options,ud=le.setOptions,fd=le.use,cd=le.walkTokens,dd=le.parseInline,hd=le,pd=_r.parse,gd=Pr.lex;Se.Hooks=Ci;Se.Lexer=Pr;Se.Parser=_r;Se.Renderer=dn;Se.Slugger=ta;Se.TextRenderer=ea;Se.Tokenizer=cn;Se.getDefaults=Vo;Se.lexer=gd;Se.marked=le;Se.options=sd;Se.parse=hd;Se.parseInline=dd;Se.parser=pd;Se.setOptions=ud;Se.use=fd;Se.walkTokens=cd});var ku=Ye((eh,wu)=>{"use strict";var Wr=ct();xs();Cs();Ss();Zo();Qo();Hs();_s();Us();Ks();Zs();Yo();var vd=eu(),ra=hu().marked,vu=/Mac/.test(navigator.platform),md=new RegExp(/(<a.*?https?:\/\/.*?[^a]>)+?/g),wi={toggleBold:gn,toggleItalic:vn,drawLink:An,toggleHeadingSmaller:ki,toggleHeadingBigger:xn,drawImage:Ln,toggleBlockquote:bn,toggleOrderedList:Sn,toggleUnorderedList:kn,toggleCheckList:Fn,toggleCodeBlock:yn,togglePreview:In,toggleStrikethrough:mn,toggleHeading1:Dn,toggleHeading2:Cn,toggleHeading3:wn,toggleHeading4:na,toggleHeading5:oa,toggleHeading6:aa,cleanBlock:En,drawTable:Tn,drawHorizontalRule:Mn,undo:Bn,redo:Nn,toggleSideBySide:qr,toggleFullScreen:hr},yd={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",toggleCheckList:"Shift-Cmd-L",toggleCodeBlock:"Cmd-Alt-C",togglePreview:"Cmd-P",toggleSideBySide:"F9",toggleFullScreen:"F11"},bd=function(a){for(var c in wi)if(wi[c]===a)return c;return null},ia=function(){var a=!1;return function(c){(/(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(c)||/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(c.substr(0,4)))&&(a=!0)}(navigator.userAgent||navigator.vendor||window.opera),a};function xd(a){for(var c;(c=md.exec(a))!==null;){var d=c[0];if(d.indexOf("target=")===-1){var l=d.replace(/>$/,' target="_blank">');a=a.replace(d,l)}}return a}function Dd(a){for(var c=new DOMParser,d=c.parseFromString(a,"text/html"),l=d.getElementsByTagName("li"),u=0;u<l.length;u++)for(var g=l[u],f=0;f<g.children.length;f++){var p=g.children[f];p instanceof HTMLInputElement&&p.type==="checkbox"&&(g.style.marginLeft="-1.5em",g.style.listStyleType="none")}return d.documentElement.innerHTML}function mu(a){return vu?a=a.replace("Ctrl","Cmd"):a=a.replace("Cmd","Ctrl"),a}function Cd(a,c,d,l){var u=hn(a,!1,c,d,"button",l);u.classList.add("easymde-dropdown"),u.onclick=function(){u.focus()};var g=document.createElement("div");g.className="easymde-dropdown-content";for(var f=0;f<a.children.length;f++){var p=a.children[f],b;typeof p=="string"&&p in dr?b=hn(dr[p],!0,c,d,"button",l):b=hn(p,!0,c,d,"button",l),b.addEventListener("click",function(C){C.stopPropagation()},!1),g.appendChild(b)}return u.appendChild(g),u}function hn(a,c,d,l,u,g){a=a||{};var f=document.createElement(u);if(a.attributes)for(var p in a.attributes)Object.prototype.hasOwnProperty.call(a.attributes,p)&&f.setAttribute(p,a.attributes[p]);var b=g.options.toolbarButtonClassPrefix?g.options.toolbarButtonClassPrefix+"-":"";f.className=b+a.name,f.setAttribute("type",u),d=d??!0,a.text&&(f.innerText=a.text),a.name&&a.name in l&&(wi[a.name]=a.action),a.title&&d&&(f.title=kd(a.title,a.action,l),vu&&(f.title=f.title.replace("Ctrl","\u2318"),f.title=f.title.replace("Alt","\u2325"))),a.title&&f.setAttribute("aria-label",a.title),a.noDisable&&f.classList.add("no-disable"),a.noMobile&&f.classList.add("no-mobile");var C=[];typeof a.className<"u"&&(C=a.className.split(" "));for(var D=[],E=0;E<C.length;E++){var T=C[E];T.match(/^fa([srlb]|(-[\w-]*)|$)/)?D.push(T):f.classList.add(T)}if(f.tabIndex=-1,D.length>0){for(var M=document.createElement("i"),z=0;z<D.length;z++){var I=D[z];M.classList.add(I)}f.appendChild(M)}return typeof a.icon<"u"&&(f.innerHTML=a.icon),a.action&&c&&(typeof a.action=="function"?f.onclick=function(F){F.preventDefault(),a.action(g)}:typeof a.action=="string"&&(f.onclick=function(F){F.preventDefault(),window.open(a.action,"_blank")})),f}function wd(){var a=document.createElement("i");return a.className="separator",a.innerHTML="|",a}function kd(a,c,d){var l,u=a;return c&&(l=bd(c),d[l]&&(u+=" ("+mu(d[l])+")")),u}function Qt(a,c){c=c||a.getCursor("start");var d=a.getTokenAt(c);if(!d.type)return{};for(var l=d.type.split(" "),u={},g,f,p=0;p<l.length;p++)g=l[p],g==="strong"?u.bold=!0:g==="variable-2"?(f=a.getLine(c.line),/^\s*\d+\.\s/.test(f)?u["ordered-list"]=!0:/^\s*- \[[ xX]]\s/.test(f)?u["check-list"]=!0:u["unordered-list"]=!0):g==="atom"?u.quote=!0:g==="em"?u.italic=!0:g==="quote"?u.quote=!0:g==="strikethrough"?u.strikethrough=!0:g==="comment"?u.code=!0:g==="link"&&!u.image?u.link=!0:g==="image"?u.image=!0:g.match(/^header(-[1-6])?$/)&&(u[g.replace("header","heading")]=!0);return u}var pu="";function hr(a){var c=a.codemirror;c.setOption("fullScreen",!c.getOption("fullScreen")),c.getOption("fullScreen")?(pu=document.body.style.overflow,document.body.style.overflow="hidden"):document.body.style.overflow=pu;var d=c.getWrapperElement(),l=d.nextSibling;if(l.classList.contains("editor-preview-active-side"))if(a.options.sideBySideFullscreen===!1){var u=d.parentNode;c.getOption("fullScreen")?u.classList.remove("sided--no-fullscreen"):u.classList.add("sided--no-fullscreen")}else qr(a);if(a.options.onToggleFullScreen&&a.options.onToggleFullScreen(c.getOption("fullScreen")||!1),typeof a.options.maxHeight<"u"&&(c.getOption("fullScreen")?(c.getScrollerElement().style.removeProperty("height"),l.style.removeProperty("height")):(c.getScrollerElement().style.height=a.options.maxHeight,a.setPreviewMaxHeight())),a.toolbar_div.classList.toggle("fullscreen"),a.toolbarElements&&a.toolbarElements.fullscreen){var g=a.toolbarElements.fullscreen;g.classList.toggle("active")}}function gn(a){sa(a,"bold",a.options.blockStyles.bold)}function vn(a){sa(a,"italic",a.options.blockStyles.italic)}function mn(a){sa(a,"strikethrough","~~")}function yn(a){var c=a.options.blockStyles.code;function d(U){if(typeof U!="object")throw"fencing_line() takes a 'line' object (not a line number, or line text). Got: "+typeof U+": "+U;return U.styles&&U.styles[2]&&U.styles[2].indexOf("formatting-code-block")!==-1}function l(U){return U.state.base.base||U.state.base}function u(U,W,V,ve,Te){V=V||U.getLineHandle(W),ve=ve||U.getTokenAt({line:W,ch:1}),Te=Te||!!V.text&&U.getTokenAt({line:W,ch:V.text.length-1});var vt=ve.type?ve.type.split(" "):[];return Te&&l(Te).indentedCode?"indented":vt.indexOf("comment")===-1?!1:l(ve).fencedChars||l(Te).fencedChars||d(V)?"fenced":"single"}function g(U,W,V,ve){var Te=W.line+1,vt=V.line+1,k=W.line!==V.line,y=ve+`
|
|
`,ee=`
|
|
`+ve;k&&vt++,k&&V.ch===0&&(ee=ve+`
|
|
`,vt--),pr(U,!1,[y,ee]),U.setSelection({line:Te,ch:0},{line:vt,ch:0})}var f=a.codemirror,p=f.getCursor("start"),b=f.getCursor("end"),C=f.getTokenAt({line:p.line,ch:p.ch||1}),D=f.getLineHandle(p.line),E=u(f,p.line,D,C),T,M,z;if(E==="single"){var I=D.text.slice(0,p.ch).replace("`",""),F=D.text.slice(p.ch).replace("`","");f.replaceRange(I+F,{line:p.line,ch:0},{line:p.line,ch:99999999999999}),p.ch--,p!==b&&b.ch--,f.setSelection(p,b),f.focus()}else if(E==="fenced")if(p.line!==b.line||p.ch!==b.ch){for(T=p.line;T>=0&&(D=f.getLineHandle(T),!d(D));T--);var B=f.getTokenAt({line:T,ch:1}),N=l(B).fencedChars,R,H,_,X;d(f.getLineHandle(p.line))?(R="",H=p.line):d(f.getLineHandle(p.line-1))?(R="",H=p.line-1):(R=N+`
|
|
`,H=p.line),d(f.getLineHandle(b.line))?(_="",X=b.line,b.ch===0&&(X+=1)):b.ch!==0&&d(f.getLineHandle(b.line+1))?(_="",X=b.line+1):(_=N+`
|
|
`,X=b.line+1),b.ch===0&&(X-=1),f.operation(function(){f.replaceRange(_,{line:X,ch:0},{line:X+(_?0:1),ch:0}),f.replaceRange(R,{line:H,ch:0},{line:H+(R?0:1),ch:0})}),f.setSelection({line:H+(R?1:0),ch:0},{line:X+(R?1:-1),ch:0}),f.focus()}else{var K=p.line;if(d(f.getLineHandle(p.line))&&(u(f,p.line+1)==="fenced"?(T=p.line,K=p.line+1):(M=p.line,K=p.line-1)),T===void 0)for(T=K;T>=0&&(D=f.getLineHandle(T),!d(D));T--);if(M===void 0)for(z=f.lineCount(),M=K;M<z&&(D=f.getLineHandle(M),!d(D));M++);f.operation(function(){f.replaceRange("",{line:T,ch:0},{line:T+1,ch:0}),f.replaceRange("",{line:M-1,ch:0},{line:M,ch:0})}),f.focus()}else if(E==="indented"){if(p.line!==b.line||p.ch!==b.ch)T=p.line,M=b.line,b.ch===0&&M--;else{for(T=p.line;T>=0;T--)if(D=f.getLineHandle(T),!D.text.match(/^\s*$/)&&u(f,T,D)!=="indented"){T+=1;break}for(z=f.lineCount(),M=p.line;M<z;M++)if(D=f.getLineHandle(M),!D.text.match(/^\s*$/)&&u(f,M,D)!=="indented"){M-=1;break}}var ge=f.getLineHandle(M+1),G=ge&&f.getTokenAt({line:M+1,ch:ge.text.length-1}),ue=G&&l(G).indentedCode;ue&&f.replaceRange(`
|
|
`,{line:M+1,ch:0});for(var ae=T;ae<=M;ae++)f.indentLine(ae,"subtract");f.focus()}else{var de=p.line===b.line&&p.ch===b.ch&&p.ch===0,A=p.line!==b.line;de||A?g(f,p,b,c):pr(f,!1,["`","`"])}}function bn(a){zn(a.codemirror,"quote")}function ki(a){Jt(a.codemirror,"smaller")}function xn(a){Jt(a.codemirror,"bigger")}function Dn(a){Jt(a.codemirror,void 0,1)}function Cn(a){Jt(a.codemirror,void 0,2)}function wn(a){Jt(a.codemirror,void 0,3)}function na(a){Jt(a.codemirror,void 0,4)}function oa(a){Jt(a.codemirror,void 0,5)}function aa(a){Jt(a.codemirror,void 0,6)}function kn(a){var c=a.codemirror,d="*";["-","+","*"].includes(a.options.unorderedListStyle)&&(d=a.options.unorderedListStyle),zn(c,"unordered-list",d)}function Sn(a){zn(a.codemirror,"ordered-list")}function Fn(a){zn(a.codemirror,"check-list")}function En(a){Sd(a.codemirror)}function An(a){var c=a.options,d="https://";if(c.promptURLs){var l=prompt(c.promptTexts.link,d);if(!l)return!1;d=yu(l)}xu(a,"link",c.insertTexts.link,d)}function Ln(a){var c=a.options,d="https://";if(c.promptURLs){var l=prompt(c.promptTexts.image,d);if(!l)return!1;d=yu(l)}xu(a,"image",c.insertTexts.image,d)}function yu(a){return encodeURI(a).replace(/([\\()])/g,"\\$1")}function la(a){a.openBrowseFileWindow()}function bu(a,c){var d=a.codemirror,l=Qt(d),u=a.options,g=c.substr(c.lastIndexOf("/")+1),f=g.substring(g.lastIndexOf(".")+1).replace(/\?.*$/,"").toLowerCase();if(["png","jpg","jpeg","gif","svg","apng","avif","webp"].includes(f))pr(d,l.image,u.insertTexts.uploadedImage,c);else{var p=u.insertTexts.link;p[0]="["+g,pr(d,l.link,p,c)}a.updateStatusBar("upload-image",a.options.imageTexts.sbOnUploaded.replace("#image_name#",g)),setTimeout(function(){a.updateStatusBar("upload-image",a.options.imageTexts.sbInit)},1e3)}function Tn(a){var c=a.codemirror,d=Qt(c),l=a.options;pr(c,d.table,l.insertTexts.table)}function Mn(a){var c=a.codemirror,d=Qt(c),l=a.options;pr(c,d.image,l.insertTexts.horizontalRule)}function Bn(a){var c=a.codemirror;c.undo(),c.focus()}function Nn(a){var c=a.codemirror;c.redo(),c.focus()}function qr(a){var c=a.codemirror,d=c.getWrapperElement(),l=d.nextSibling,u=a.toolbarElements&&a.toolbarElements["side-by-side"],g=!1,f=d.parentNode;l.classList.contains("editor-preview-active-side")?(a.options.sideBySideFullscreen===!1&&f.classList.remove("sided--no-fullscreen"),l.classList.remove("editor-preview-active-side"),u&&u.classList.remove("active"),d.classList.remove("CodeMirror-sided")):(setTimeout(function(){c.getOption("fullScreen")||(a.options.sideBySideFullscreen===!1?f.classList.add("sided--no-fullscreen"):hr(a)),l.classList.add("editor-preview-active-side")},1),u&&u.classList.add("active"),d.classList.add("CodeMirror-sided"),g=!0);var p=d.lastChild;if(p.classList.contains("editor-preview-active")){p.classList.remove("editor-preview-active");var b=a.toolbarElements.preview,C=a.toolbar_div;b.classList.remove("active"),C.classList.remove("disabled-for-preview")}var D=function(){var T=a.options.previewRender(a.value(),l);T!=null&&(l.innerHTML=T)};if(c.sideBySideRenderingFunction||(c.sideBySideRenderingFunction=D),g){var E=a.options.previewRender(a.value(),l);E!=null&&(l.innerHTML=E),c.on("update",c.sideBySideRenderingFunction)}else c.off("update",c.sideBySideRenderingFunction);c.refresh()}function In(a){var c=a.codemirror,d=c.getWrapperElement(),l=a.toolbar_div,u=a.options.toolbar?a.toolbarElements.preview:!1,g=d.lastChild,f=c.getWrapperElement().nextSibling;if(f.classList.contains("editor-preview-active-side")&&qr(a),!g||!g.classList.contains("editor-preview-full")){if(g=document.createElement("div"),g.className="editor-preview-full",a.options.previewClass)if(Array.isArray(a.options.previewClass))for(var p=0;p<a.options.previewClass.length;p++)g.classList.add(a.options.previewClass[p]);else typeof a.options.previewClass=="string"&&g.classList.add(a.options.previewClass);d.appendChild(g)}g.classList.contains("editor-preview-active")?(g.classList.remove("editor-preview-active"),u&&(u.classList.remove("active"),l.classList.remove("disabled-for-preview"))):(setTimeout(function(){g.classList.add("editor-preview-active")},1),u&&(u.classList.add("active"),l.classList.add("disabled-for-preview")));var b=a.options.previewRender(a.value(),g);b!==null&&(g.innerHTML=b)}function pr(a,c,d,l){if(!a.getWrapperElement().lastChild.classList.contains("editor-preview-active")){var u,g=d[0],f=d[1],p={},b={};Object.assign(p,a.getCursor("start")),Object.assign(b,a.getCursor("end")),l&&(g=g.replace("#url#",l),f=f.replace("#url#",l)),c?(u=a.getLine(p.line),g=u.slice(0,p.ch),f=u.slice(p.ch),a.replaceRange(g+f,{line:p.line,ch:0})):(u=a.getSelection(),a.replaceSelection(g+u+f),p.ch+=g.length,p!==b&&(b.ch+=g.length)),a.setSelection(p,b),a.focus()}}function Jt(a,c,d){if(!a.getWrapperElement().lastChild.classList.contains("editor-preview-active")){for(var l=a.getCursor("start"),u=a.getCursor("end"),g=l.line;g<=u.line;g++)(function(f){var p=a.getLine(f),b=p.search(/[^#]/);c!==void 0?b<=0?c=="bigger"?p="###### "+p:p="# "+p:b==6&&c=="smaller"?p=p.substr(7):b==1&&c=="bigger"?p=p.substr(2):c=="bigger"?p=p.substr(1):p="#"+p:b<=0?p="#".repeat(d)+" "+p:b==d?p=p.substr(b+1):p="#".repeat(d)+" "+p.substr(b+1),a.replaceRange(p,{line:f,ch:0},{line:f,ch:99999999999999})})(g);a.focus()}}function zn(a,c,d){if(!a.getWrapperElement().lastChild.classList.contains("editor-preview-active")){var l=/^(\s*)(\*|-|\+|\d*\.)(\s+)/,u=/^\s*/,g=Qt(a),f=a.getCursor("start"),p=a.getCursor("end"),b={quote:/^(\s*)>\s+/,"unordered-list":l,"ordered-list":l,"check-list":/^(\s*)(- \[[ xX]])(\s+)/},C=function(B,N){var R={quote:">","unordered-list":d,"ordered-list":"%%i.","check-list":"- [ ]"};return R[B].replace("%%i",N)},D=function(B,N){var R={quote:">","unordered-list":"\\"+d,"ordered-list":"\\d+.","check-list":"- \\[[ xX]]"},H=new RegExp(R[B]);return N&&H.test(N)},E=function(B,N,R){var H=l.exec(N),_=C(B,T);return H!==null?(D(B,H[2])&&(_=""),N=H[1]+_+H[3]+N.replace(u,"").replace(b[B],"$1")):R==!1&&(N=_+" "+N),N},T=1,M=["unordered-list","ordered-list","check-list"],z=Object.keys(g)[0];if(!M.includes(z)){var I=a.getLine(f.line);/^\s*- \[[ xX]]\s/.test(I)?z="check-list":/^\s*\d+\.\s/.test(I)?z="ordered-list":/^\s*[*\-+]\s/.test(I)&&(z="unordered-list")}for(var F=f.line;F<=p.line;F++)(function(B){var N=a.getLine(B);g[c]?N=N.replace(b[c],"$1"):M.includes(z)&&M.includes(c)?(N=N.replace(b[z],"$1"),N=E(c,N,!1),T+=1):(N=E(c,N,!1),T+=1),a.replaceRange(N,{line:B,ch:0},{line:B,ch:99999999999999})})(F);a.focus()}}function xu(a,c,d,l){if(!(!a.codemirror||a.isPreviewActive())){var u=a.codemirror,g=Qt(u),f=g[c];if(!f){pr(u,f,d,l);return}var p=u.getCursor("start"),b=u.getCursor("end"),C=u.getLine(p.line),D=C.slice(0,p.ch),E=C.slice(p.ch);c=="link"?D=D.replace(/(.*)[^!]\[/,"$1"):c=="image"&&(D=D.replace(/(.*)!\[$/,"$1")),E=E.replace(/]\(.*?\)/,""),u.replaceRange(D+E,{line:p.line,ch:0},{line:p.line,ch:99999999999999}),p.ch-=d[0].length,p!==b&&(b.ch-=d[0].length),u.setSelection(p,b),u.focus()}}function sa(a,c,d,l){if(!(!a.codemirror||a.isPreviewActive())){l=typeof l>"u"?d:l;var u=a.codemirror,g=Qt(u),f,p=d,b=l,C=u.getCursor("start"),D=u.getCursor("end");g[c]?(f=u.getLine(C.line),p=f.slice(0,C.ch),b=f.slice(C.ch),c=="bold"?(p=p.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),b=b.replace(/(\*\*|__)/,"")):c=="italic"?(p=p.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),b=b.replace(/(\*|_)/,"")):c=="strikethrough"&&(p=p.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),b=b.replace(/(\*\*|~~)/,"")),u.replaceRange(p+b,{line:C.line,ch:0},{line:C.line,ch:99999999999999}),c=="bold"||c=="strikethrough"?(C.ch-=2,C!==D&&(D.ch-=2)):c=="italic"&&(C.ch-=1,C!==D&&(D.ch-=1))):(f=u.getSelection(),c=="bold"?(f=f.split("**").join(""),f=f.split("__").join("")):c=="italic"?(f=f.split("*").join(""),f=f.split("_").join("")):c=="strikethrough"&&(f=f.split("~~").join("")),u.replaceSelection(p+f+b),C.ch+=d.length,D.ch=C.ch+f.length),u.setSelection(C,D),u.focus()}}function Sd(a){if(!a.getWrapperElement().lastChild.classList.contains("editor-preview-active"))for(var c=a.getCursor("start"),d=a.getCursor("end"),l,u=c.line;u<=d.line;u++)l=a.getLine(u),l=l.replace(/^[ ]*([# ]+|\*|-|[> ]+|[0-9]+(.|\)))[ ]*/,""),a.replaceRange(l,{line:u,ch:0},{line:u,ch:99999999999999})}function pn(a,c){if(Math.abs(a)<1024)return""+a+c[0];var d=0;do a/=1024,++d;while(Math.abs(a)>=1024&&d<c.length);return""+a.toFixed(1)+c[d]}function Du(a,c){for(var d in c)Object.prototype.hasOwnProperty.call(c,d)&&(c[d]instanceof Array?a[d]=c[d].concat(a[d]instanceof Array?a[d]:[]):c[d]!==null&&typeof c[d]=="object"&&c[d].constructor===Object?a[d]=Du(a[d]||{},c[d]):a[d]=c[d]);return a}function Rt(a){for(var c=1;c<arguments.length;c++)a=Du(a,arguments[c]);return a}function gu(a){var c=/[a-zA-Z0-9_\u00A0-\u02AF\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g,d=a.match(c),l=0;if(d===null)return l;for(var u=0;u<d.length;u++)d[u].charCodeAt(0)>=19968?l+=d[u].length:l+=1;return l}var ke={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","check-list":"fa fa-check-square-o","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"},dr={bold:{name:"bold",action:gn,className:ke.bold,title:"Bold",default:!0},italic:{name:"italic",action:vn,className:ke.italic,title:"Italic",default:!0},strikethrough:{name:"strikethrough",action:mn,className:ke.strikethrough,title:"Strikethrough"},heading:{name:"heading",action:ki,className:ke.heading,title:"Heading",default:!0},"heading-smaller":{name:"heading-smaller",action:ki,className:ke["heading-smaller"],title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:xn,className:ke["heading-bigger"],title:"Bigger Heading"},"heading-1":{name:"heading-1",action:Dn,className:ke["heading-1"],title:"Big Heading"},"heading-2":{name:"heading-2",action:Cn,className:ke["heading-2"],title:"Medium Heading"},"heading-3":{name:"heading-3",action:wn,className:ke["heading-3"],title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:yn,className:ke.code,title:"Code"},quote:{name:"quote",action:bn,className:ke.quote,title:"Quote",default:!0},"unordered-list":{name:"unordered-list",action:kn,className:ke["unordered-list"],title:"Generic List",default:!0},"ordered-list":{name:"ordered-list",action:Sn,className:ke["ordered-list"],title:"Numbered List",default:!0},"check-list":{name:"check-list",action:Fn,className:ke["check-list"],title:"Check List",default:!0},"clean-block":{name:"clean-block",action:En,className:ke["clean-block"],title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:An,className:ke.link,title:"Create Link",default:!0},image:{name:"image",action:Ln,className:ke.image,title:"Insert Image",default:!0},"upload-image":{name:"upload-image",action:la,className:ke["upload-image"],title:"Import an image"},table:{name:"table",action:Tn,className:ke.table,title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:Mn,className:ke["horizontal-rule"],title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:In,className:ke.preview,noDisable:!0,title:"Toggle Preview",default:!0},"side-by-side":{name:"side-by-side",action:qr,className:ke["side-by-side"],noDisable:!0,noMobile:!0,title:"Toggle Side by Side",default:!0},fullscreen:{name:"fullscreen",action:hr,className:ke.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:ke.guide,noDisable:!0,title:"Markdown Guide",default:!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:Bn,className:ke.undo,noDisable:!0,title:"Undo"},redo:{name:"redo",action:Nn,className:ke.redo,noDisable:!0,title:"Redo"}},Fd={link:["[","](#url#)"],image:[""],uploadedImage:["",""],table:["",`
|
|
|
|
| Column 1 | Column 2 | Column 3 |
|
|
| -------- | -------- | -------- |
|
|
| Text | Text | Text |
|
|
|
|
`],horizontalRule:["",`
|
|
|
|
-----
|
|
|
|
`]},Ed={link:"URL for the link:",image:"URL of the image:"},Ad={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},Ld={bold:"**",code:"```",italic:"*"},Td={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"},Md={noFileGiven:"You must select a file.",typeNotAllowed:"This image type is not allowed.",fileTooLarge:`Image #image_name# is too big (#image_size#).
|
|
Maximum file size is #image_max_size#.`,importError:"Something went wrong when uploading the image #image_name#."};function J(a){a=a||{},a.parent=this;var c=!0;if(a.autoDownloadFontAwesome===!1&&(c=!1),a.autoDownloadFontAwesome!==!0)for(var d=document.styleSheets,l=0;l<d.length;l++)d[l].href&&d[l].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")>-1&&(c=!1);if(c){var u=document.createElement("link");u.rel="stylesheet",u.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(u)}if(a.element)this.element=a.element;else if(a.element===null){console.log("EasyMDE: Error. No element was found.");return}if(a.toolbar===void 0){a.toolbar=[];for(var g in dr)Object.prototype.hasOwnProperty.call(dr,g)&&(g.indexOf("separator-")!=-1&&a.toolbar.push("|"),(dr[g].default===!0||a.showIcons&&a.showIcons.constructor===Array&&a.showIcons.indexOf(g)!=-1)&&a.toolbar.push(g))}if(Object.prototype.hasOwnProperty.call(a,"previewClass")||(a.previewClass="editor-preview"),Object.prototype.hasOwnProperty.call(a,"status")||(a.status=["autosave","lines","words","cursor"],a.uploadImage&&a.status.unshift("upload-image")),a.previewRender||(a.previewRender=function(p){return this.parent.markdown(p)}),a.parsingConfig=Rt({highlightFormatting:!0},a.parsingConfig||{}),a.insertTexts=Rt({},Fd,a.insertTexts||{}),a.promptTexts=Rt({},Ed,a.promptTexts||{}),a.blockStyles=Rt({},Ld,a.blockStyles||{}),a.autosave!=null&&(a.autosave.timeFormat=Rt({},Ad,a.autosave.timeFormat||{})),a.iconClassMap=Rt({},ke,a.iconClassMap||{}),a.shortcuts=Rt({},yd,a.shortcuts||{}),a.maxHeight=a.maxHeight||void 0,a.direction=a.direction||"ltr",typeof a.maxHeight<"u"?a.minHeight=a.maxHeight:a.minHeight=a.minHeight||"300px",a.errorCallback=a.errorCallback||function(p){alert(p)},a.uploadImage=a.uploadImage||!1,a.imageMaxSize=a.imageMaxSize||2097152,a.imageAccept=a.imageAccept||"image/png, image/jpeg, image/gif, image/avif",a.imageTexts=Rt({},Td,a.imageTexts||{}),a.errorMessages=Rt({},Md,a.errorMessages||{}),a.imagePathAbsolute=a.imagePathAbsolute||!1,a.imageCSRFName=a.imageCSRFName||"csrfmiddlewaretoken",a.imageCSRFHeader=a.imageCSRFHeader||!1,a.imageInputName=a.imageInputName||"image",a.autosave!=null&&a.autosave.unique_id!=null&&a.autosave.unique_id!=""&&(a.autosave.uniqueId=a.autosave.unique_id),a.overlayMode&&a.overlayMode.combine===void 0&&(a.overlayMode.combine=!0),this.options=a,this.render(),a.initialValue&&(!this.options.autosave||this.options.autosave.foundSavedValue!==!0)&&this.value(a.initialValue),a.uploadImage){var f=this;this.codemirror.on("dragenter",function(p,b){f.updateStatusBar("upload-image",f.options.imageTexts.sbOnDragEnter),b.stopPropagation(),b.preventDefault()}),this.codemirror.on("dragend",function(p,b){f.updateStatusBar("upload-image",f.options.imageTexts.sbInit),b.stopPropagation(),b.preventDefault()}),this.codemirror.on("dragleave",function(p,b){f.updateStatusBar("upload-image",f.options.imageTexts.sbInit),b.stopPropagation(),b.preventDefault()}),this.codemirror.on("dragover",function(p,b){f.updateStatusBar("upload-image",f.options.imageTexts.sbOnDragEnter),b.stopPropagation(),b.preventDefault()}),this.codemirror.on("drop",function(p,b){b.stopPropagation(),b.preventDefault(),a.imageUploadFunction?f.uploadImagesUsingCustomFunction(a.imageUploadFunction,b.dataTransfer.files):f.uploadImages(b.dataTransfer.files)}),this.codemirror.on("paste",function(p,b){a.imageUploadFunction?f.uploadImagesUsingCustomFunction(a.imageUploadFunction,b.clipboardData.files):f.uploadImages(b.clipboardData.files)})}}J.prototype.uploadImages=function(a,c,d){if(a.length!==0){for(var l=[],u=0;u<a.length;u++)l.push(a[u].name),this.uploadImage(a[u],c,d);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",l.join(", ")))}};J.prototype.uploadImagesUsingCustomFunction=function(a,c){if(c.length!==0){for(var d=[],l=0;l<c.length;l++)d.push(c[l].name),this.uploadImageUsingCustomFunction(a,c[l]);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",d.join(", ")))}};J.prototype.updateStatusBar=function(a,c){if(this.gui.statusbar){var d=this.gui.statusbar.getElementsByClassName(a);d.length===1?this.gui.statusbar.getElementsByClassName(a)[0].textContent=c:d.length===0?console.log("EasyMDE: status bar item "+a+" was not found."):console.log("EasyMDE: Several status bar items named "+a+" was found.")}};J.prototype.markdown=function(a){if(ra){var c;if(this.options&&this.options.renderingConfig&&this.options.renderingConfig.markedOptions?c=this.options.renderingConfig.markedOptions:c={},this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1?c.breaks=!1:c.breaks=!0,this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0){var d=this.options.renderingConfig.hljs||window.hljs;d&&(c.highlight=function(u,g){return g&&d.getLanguage(g)?d.highlight(g,u).value:d.highlightAuto(u).value})}ra.use(c);var l=ra.parse(a);return this.options.renderingConfig&&typeof this.options.renderingConfig.sanitizerFunction=="function"&&(l=this.options.renderingConfig.sanitizerFunction.call(this,l)),l=xd(l),l=Dd(l),l}};J.prototype.render=function(a){if(a||(a=this.element||document.getElementsByTagName("textarea")[0]),this._rendered&&this._rendered===a)return;this.element=a;var c=this.options,d=this,l={};for(var u in c.shortcuts)c.shortcuts[u]!==null&&wi[u]!==null&&function(F){l[mu(c.shortcuts[F])]=function(){var B=wi[F];typeof B=="function"?B(d):typeof B=="string"&&window.open(B,"_blank")}}(u);l.Enter="newlineAndIndentContinueMarkdownList",l.Tab="tabAndIndentMarkdownList",l["Shift-Tab"]="shiftTabAndUnindentMarkdownList",l.Esc=function(F){F.getOption("fullScreen")&&hr(d)},this.documentOnKeyDown=function(F){F=F||window.event,F.keyCode==27&&d.codemirror.getOption("fullScreen")&&hr(d)},document.addEventListener("keydown",this.documentOnKeyDown,!1);var g,f;c.overlayMode?(Wr.defineMode("overlay-mode",function(F){return Wr.overlayMode(Wr.getMode(F,c.spellChecker!==!1?"spell-checker":"gfm"),c.overlayMode.mode,c.overlayMode.combine)}),g="overlay-mode",f=c.parsingConfig,f.gitHubSpice=!1):(g=c.parsingConfig,g.name="gfm",g.gitHubSpice=!1),c.spellChecker!==!1&&(g="spell-checker",f=c.parsingConfig,f.name="gfm",f.gitHubSpice=!1,typeof c.spellChecker=="function"?c.spellChecker({codeMirrorInstance:Wr}):vd({codeMirrorInstance:Wr}));function p(F,B,N){return{addNew:!1}}if(this.codemirror=Wr.fromTextArea(a,{mode:g,backdrop:f,theme:c.theme!=null?c.theme:"easymde",tabSize:c.tabSize!=null?c.tabSize:2,indentUnit:c.tabSize!=null?c.tabSize:2,indentWithTabs:c.indentWithTabs!==!1,lineNumbers:c.lineNumbers===!0,autofocus:c.autofocus===!0,extraKeys:l,direction:c.direction,lineWrapping:c.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:c.placeholder||a.getAttribute("placeholder")||"",styleSelectedText:c.styleSelectedText!=null?c.styleSelectedText:!ia(),scrollbarStyle:c.scrollbarStyle!=null?c.scrollbarStyle:"native",configureMouse:p,inputStyle:c.inputStyle!=null?c.inputStyle:ia()?"contenteditable":"textarea",spellcheck:c.nativeSpellcheck!=null?c.nativeSpellcheck:!0,autoRefresh:c.autoRefresh!=null?c.autoRefresh:!1}),this.codemirror.getScrollerElement().style.minHeight=c.minHeight,typeof c.maxHeight<"u"&&(this.codemirror.getScrollerElement().style.height=c.maxHeight),c.forceSync===!0){var b=this.codemirror;b.on("change",function(){b.save()})}this.gui={};var C=document.createElement("div");C.classList.add("EasyMDEContainer"),C.setAttribute("role","application");var D=this.codemirror.getWrapperElement();D.parentNode.insertBefore(C,D),C.appendChild(D),c.toolbar!==!1&&(this.gui.toolbar=this.createToolbar()),c.status!==!1&&(this.gui.statusbar=this.createStatusbar()),c.autosave!=null&&c.autosave.enabled===!0&&(this.autosave(),this.codemirror.on("change",function(){clearTimeout(d._autosave_timeout),d._autosave_timeout=setTimeout(function(){d.autosave()},d.options.autosave.submit_delay||d.options.autosave.delay||1e3)}));function E(F,B){var N,R=window.getComputedStyle(document.querySelector(".CodeMirror-sizer")).width.replace("px","");return F<R?N=B+"px":N=B/F*100+"%",N}var T=this;function M(F,B){var N=new URL(B.url,document.baseURI).href;F.setAttribute("data-img-src",N),F.setAttribute("style","--bg-image:url("+N+");--width:"+B.naturalWidth+"px;--height:"+E(B.naturalWidth,B.naturalHeight)),T.codemirror.setSize()}function z(){c.previewImagesInEditor&&C.querySelectorAll(".cm-image-marker").forEach(function(F){var B=F.parentElement;if(B.innerText.match(/^!\[.*?\]\(.*\)/g)&&!B.hasAttribute("data-img-src")){var N=B.innerText.match(/!\[.*?\]\((.*?)\)/);if(window.EMDEimagesCache||(window.EMDEimagesCache={}),N&&N.length>=2){var R=N[1];if(c.imagesPreviewHandler){var H=c.imagesPreviewHandler(N[1]);typeof H=="string"&&(R=H)}if(window.EMDEimagesCache[R])M(B,window.EMDEimagesCache[R]);else{window.EMDEimagesCache[R]={};var _=document.createElement("img");_.onload=function(){window.EMDEimagesCache[R]={naturalWidth:_.naturalWidth,naturalHeight:_.naturalHeight,url:R},M(B,window.EMDEimagesCache[R])},_.src=R}}}})}this.codemirror.on("update",function(){z()}),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element,(c.autofocus===!0||a.autofocus)&&this.codemirror.focus();var I=this.codemirror;setTimeout(function(){I.refresh()}.bind(I),0)};J.prototype.cleanup=function(){document.removeEventListener("keydown",this.documentOnKeyDown)};function Cu(){if(typeof localStorage=="object")try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch{return!1}else return!1;return!0}J.prototype.autosave=function(){if(Cu()){var a=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&&(a.element.form!=null&&a.element.form!=null&&a.element.form.addEventListener("submit",function(){clearTimeout(a.autosaveTimeoutId),a.autosaveTimeoutId=void 0,localStorage.removeItem("smde_"+a.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 c=a.value();c!==""?localStorage.setItem("smde_"+this.options.autosave.uniqueId,c):localStorage.removeItem("smde_"+this.options.autosave.uniqueId);var d=document.getElementById("autosaved");if(d!=null&&d!=null&&d!=""){var l=new Date,u=new Intl.DateTimeFormat([this.options.autosave.timeFormat.locale,"en-US"],this.options.autosave.timeFormat.format).format(l),g=this.options.autosave.text==null?"Autosaved: ":this.options.autosave.text;d.innerHTML=g+u}}else console.log("EasyMDE: localStorage not available, cannot autosave")};J.prototype.clearAutosavedValue=function(){if(Cu()){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")};J.prototype.openBrowseFileWindow=function(a,c){var d=this,l=this.gui.toolbar.getElementsByClassName("imageInput")[0];l.click();function u(g){d.options.imageUploadFunction?d.uploadImagesUsingCustomFunction(d.options.imageUploadFunction,g.target.files):d.uploadImages(g.target.files,a,c),l.removeEventListener("change",u)}l.addEventListener("change",u)};J.prototype.uploadImage=function(a,c,d){var l=this;c=c||function(C){bu(l,C)};function u(b){l.updateStatusBar("upload-image",b),setTimeout(function(){l.updateStatusBar("upload-image",l.options.imageTexts.sbInit)},1e4),d&&typeof d=="function"&&d(b),l.options.errorCallback(b)}function g(b){var C=l.options.imageTexts.sizeUnits.split(",");return b.replace("#image_name#",a.name).replace("#image_size#",pn(a.size,C)).replace("#image_max_size#",pn(l.options.imageMaxSize,C))}if(a.size>this.options.imageMaxSize){u(g(this.options.errorMessages.fileTooLarge));return}var f=new FormData;f.append("image",a),l.options.imageCSRFToken&&!l.options.imageCSRFHeader&&f.append(l.options.imageCSRFName,l.options.imageCSRFToken);var p=new XMLHttpRequest;p.upload.onprogress=function(b){if(b.lengthComputable){var C=""+Math.round(b.loaded*100/b.total);l.updateStatusBar("upload-image",l.options.imageTexts.sbProgress.replace("#file_name#",a.name).replace("#progress#",C))}},p.open("POST",this.options.imageUploadEndpoint),l.options.imageCSRFToken&&l.options.imageCSRFHeader&&p.setRequestHeader(l.options.imageCSRFName,l.options.imageCSRFToken),p.onload=function(){try{var b=JSON.parse(this.responseText)}catch{console.error("EasyMDE: The server did not return a valid json."),u(g(l.options.errorMessages.importError));return}this.status===200&&b&&!b.error&&b.data&&b.data.filePath?c((l.options.imagePathAbsolute?"":window.location.origin+"/")+b.data.filePath):b.error&&b.error in l.options.errorMessages?u(g(l.options.errorMessages[b.error])):b.error?u(g(b.error)):(console.error("EasyMDE: Received an unexpected response after uploading the image."+this.status+" ("+this.statusText+")"),u(g(l.options.errorMessages.importError)))},p.onerror=function(b){console.error("EasyMDE: An unexpected error occurred when trying to upload the image."+b.target.status+" ("+b.target.statusText+")"),u(l.options.errorMessages.importError)},p.send(f)};J.prototype.uploadImageUsingCustomFunction=function(a,c){var d=this;function l(f){bu(d,f)}function u(f){var p=g(f);d.updateStatusBar("upload-image",p),setTimeout(function(){d.updateStatusBar("upload-image",d.options.imageTexts.sbInit)},1e4),d.options.errorCallback(p)}function g(f){var p=d.options.imageTexts.sizeUnits.split(",");return f.replace("#image_name#",c.name).replace("#image_size#",pn(c.size,p)).replace("#image_max_size#",pn(d.options.imageMaxSize,p))}a.apply(this,[c,l,u])};J.prototype.setPreviewMaxHeight=function(){var a=this.codemirror,c=a.getWrapperElement(),d=c.nextSibling,l=parseInt(window.getComputedStyle(c).paddingTop),u=parseInt(window.getComputedStyle(c).borderTopWidth),g=parseInt(this.options.maxHeight),f=g+l*2+u*2,p=f.toString()+"px";d.style.height=p};J.prototype.createSideBySide=function(){var a=this.codemirror,c=a.getWrapperElement(),d=c.nextSibling;if(!d||!d.classList.contains("editor-preview-side")){if(d=document.createElement("div"),d.className="editor-preview-side",this.options.previewClass)if(Array.isArray(this.options.previewClass))for(var l=0;l<this.options.previewClass.length;l++)d.classList.add(this.options.previewClass[l]);else typeof this.options.previewClass=="string"&&d.classList.add(this.options.previewClass);c.parentNode.insertBefore(d,c.nextSibling)}if(typeof this.options.maxHeight<"u"&&this.setPreviewMaxHeight(),this.options.syncSideBySidePreviewScroll===!1)return d;var u=!1,g=!1;return a.on("scroll",function(f){if(u){u=!1;return}g=!0;var p=f.getScrollInfo().height-f.getScrollInfo().clientHeight,b=parseFloat(f.getScrollInfo().top)/p,C=(d.scrollHeight-d.clientHeight)*b;d.scrollTop=C}),d.onscroll=function(){if(g){g=!1;return}u=!0;var f=d.scrollHeight-d.clientHeight,p=parseFloat(d.scrollTop)/f,b=(a.getScrollInfo().height-a.getScrollInfo().clientHeight)*p;a.scrollTo(0,b)},d};J.prototype.createToolbar=function(a){if(a=a||this.options.toolbar,!(!a||a.length===0)){var c;for(c=0;c<a.length;c++)dr[a[c]]!=null&&(a[c]=dr[a[c]]);var d=document.createElement("div");d.className="editor-toolbar",d.setAttribute("role","toolbar");var l=this,u={};for(l.toolbar=a,c=0;c<a.length;c++)if(!(a[c].name=="guide"&&l.options.toolbarGuideIcon===!1)&&!(l.options.hideIcons&&l.options.hideIcons.indexOf(a[c].name)!=-1)&&!((a[c].name=="fullscreen"||a[c].name=="side-by-side")&&ia())){if(a[c]==="|"){for(var g=!1,f=c+1;f<a.length;f++)a[f]!=="|"&&(!l.options.hideIcons||l.options.hideIcons.indexOf(a[f].name)==-1)&&(g=!0);if(!g)continue}(function(C){var D;if(C==="|"?D=wd():C.children?D=Cd(C,l.options.toolbarTips,l.options.shortcuts,l):D=hn(C,!0,l.options.toolbarTips,l.options.shortcuts,"button",l),u[C.name||C]=D,d.appendChild(D),C.name==="upload-image"){var E=document.createElement("input");E.className="imageInput",E.type="file",E.multiple=!0,E.name=l.options.imageInputName,E.accept=l.options.imageAccept,E.style.display="none",E.style.opacity=0,d.appendChild(E)}})(a[c])}l.toolbar_div=d,l.toolbarElements=u;var p=this.codemirror;p.on("cursorActivity",function(){var C=Qt(p);for(var D in u)(function(E){var T=u[E];C[E]?T.classList.add("active"):E!="fullscreen"&&E!="side-by-side"&&T.classList.remove("active")})(D)});var b=p.getWrapperElement();return b.parentNode.insertBefore(d,b),d}};J.prototype.createStatusbar=function(a){a=a||this.options.status;var c=this.options,d=this.codemirror;if(!(!a||a.length===0)){var l=[],u,g,f,p;for(u=0;u<a.length;u++)if(g=void 0,f=void 0,p=void 0,typeof a[u]=="object")l.push({className:a[u].className,defaultValue:a[u].defaultValue,onUpdate:a[u].onUpdate,onActivity:a[u].onActivity});else{var b=a[u];b==="words"?(p=function(M){M.innerHTML=gu(d.getValue())},g=function(M){M.innerHTML=gu(d.getValue())}):b==="lines"?(p=function(M){M.innerHTML=d.lineCount()},g=function(M){M.innerHTML=d.lineCount()}):b==="cursor"?(p=function(M){M.innerHTML="1:1"},f=function(M){var z=d.getCursor(),I=z.line+1,F=z.ch+1;M.innerHTML=I+":"+F}):b==="autosave"?p=function(M){c.autosave!=null&&c.autosave.enabled===!0&&M.setAttribute("id","autosaved")}:b==="upload-image"&&(p=function(M){M.innerHTML=c.imageTexts.sbInit}),l.push({className:b,defaultValue:p,onUpdate:g,onActivity:f})}var C=document.createElement("div");for(C.className="editor-statusbar",u=0;u<l.length;u++){var D=l[u],E=document.createElement("span");E.className=D.className,typeof D.defaultValue=="function"&&D.defaultValue(E),typeof D.onUpdate=="function"&&this.codemirror.on("update",function(M,z){return function(){z.onUpdate(M)}}(E,D)),typeof D.onActivity=="function"&&this.codemirror.on("cursorActivity",function(M,z){return function(){z.onActivity(M)}}(E,D)),C.appendChild(E)}var T=this.codemirror.getWrapperElement();return T.parentNode.insertBefore(C,T.nextSibling),C}};J.prototype.value=function(a){var c=this.codemirror;if(a===void 0)return c.getValue();if(c.getDoc().setValue(a),this.isPreviewActive()){var d=c.getWrapperElement(),l=d.lastChild,u=this.options.previewRender(a,l);u!==null&&(l.innerHTML=u)}return this};J.toggleBold=gn;J.toggleItalic=vn;J.toggleStrikethrough=mn;J.toggleBlockquote=bn;J.toggleHeadingSmaller=ki;J.toggleHeadingBigger=xn;J.toggleHeading1=Dn;J.toggleHeading2=Cn;J.toggleHeading3=wn;J.toggleHeading4=na;J.toggleHeading5=oa;J.toggleHeading6=aa;J.toggleCodeBlock=yn;J.toggleUnorderedList=kn;J.toggleOrderedList=Sn;J.toggleCheckList=Fn;J.cleanBlock=En;J.drawLink=An;J.drawImage=Ln;J.drawUploadedImage=la;J.drawTable=Tn;J.drawHorizontalRule=Mn;J.undo=Bn;J.redo=Nn;J.togglePreview=In;J.toggleSideBySide=qr;J.toggleFullScreen=hr;J.prototype.toggleBold=function(){gn(this)};J.prototype.toggleItalic=function(){vn(this)};J.prototype.toggleStrikethrough=function(){mn(this)};J.prototype.toggleBlockquote=function(){bn(this)};J.prototype.toggleHeadingSmaller=function(){ki(this)};J.prototype.toggleHeadingBigger=function(){xn(this)};J.prototype.toggleHeading1=function(){Dn(this)};J.prototype.toggleHeading2=function(){Cn(this)};J.prototype.toggleHeading3=function(){wn(this)};J.prototype.toggleHeading4=function(){na(this)};J.prototype.toggleHeading5=function(){oa(this)};J.prototype.toggleHeading6=function(){aa(this)};J.prototype.toggleCodeBlock=function(){yn(this)};J.prototype.toggleUnorderedList=function(){kn(this)};J.prototype.toggleOrderedList=function(){Sn(this)};J.prototype.toggleCheckList=function(){Fn(this)};J.prototype.cleanBlock=function(){En(this)};J.prototype.drawLink=function(){An(this)};J.prototype.drawImage=function(){Ln(this)};J.prototype.drawUploadedImage=function(){la(this)};J.prototype.drawTable=function(){Tn(this)};J.prototype.drawHorizontalRule=function(){Mn(this)};J.prototype.undo=function(){Bn(this)};J.prototype.redo=function(){Nn(this)};J.prototype.togglePreview=function(){In(this)};J.prototype.toggleSideBySide=function(){qr(this)};J.prototype.toggleFullScreen=function(){hr(this)};J.prototype.isPreviewActive=function(){var a=this.codemirror,c=a.getWrapperElement(),d=c.lastChild;return d.classList.contains("editor-preview-active")};J.prototype.isSideBySideActive=function(){var a=this.codemirror,c=a.getWrapperElement(),d=c.nextSibling;return d.classList.contains("editor-preview-active-side")};J.prototype.isFullscreenActive=function(){var a=this.codemirror;return a.getOption("fullScreen")};J.prototype.getState=function(){var a=this.codemirror;return Qt(a)};J.prototype.toTextArea=function(){var a=this.codemirror,c=a.getWrapperElement(),d=c.parentNode;d&&(this.gui.toolbar&&d.removeChild(this.gui.toolbar),this.gui.statusbar&&d.removeChild(this.gui.statusbar),this.gui.sideBySide&&d.removeChild(this.gui.sideBySide)),d.parentNode.insertBefore(c,d),d.remove(),a.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())};wu.exports=J});var gr=_c(ku());function Bd(){var a=document.querySelector('textarea[name="data[content]"]');if(!a)return null;var c=new gr.default({element:a,spellChecker:!1,autoDownloadFontAwesome:!1,status:!1,placeholder:"What happened today?",minHeight:"180px",toolbar:[{name:"bold",action:gr.default.toggleBold,className:"mde-btn mde-bold",title:"Bold"},{name:"italic",action:gr.default.toggleItalic,className:"mde-btn mde-italic",title:"Italic"},{name:"unordered-list",action:gr.default.toggleUnorderedList,className:"mde-btn mde-ul",title:"Bulleted list"},{name:"link",action:gr.default.drawLink,className:"mde-btn mde-link",title:"Insert link"},"|",{name:"preview",action:gr.default.togglePreview,className:"mde-btn mde-preview",title:"Toggle preview"}]});c.codemirror.on("change",function(){c.codemirror.save()});var d=a.closest("form");return d&&d.addEventListener("submit",function(){c.codemirror.save()},!0),c}var Nd=["heic","heix","heif","hevc","hevx","mif1","msf1","heim","heis","hevm","hevs"];function Id(a){return a.slice(0,64).arrayBuffer().then(function(c){var d=new Uint8Array(c);if(d.length<12||String.fromCharCode(d[4],d[5],d[6],d[7])!=="ftyp")return!1;for(var l="",u=8;u+4<=d.length;u+=4)l+=String.fromCharCode(d[u],d[u+1],d[u+2],d[u+3]).toLowerCase();return Nd.some(function(g){return l.indexOf(g)!==-1})}).catch(function(){return!1})}function zd(a){var c=String(a||"photo").replace(/\.[^.]+$/,"");return c=c.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),(c||"photo")+".jpg"}function Su(){var a=document.querySelector(".filepond-root, .form-input-file");if(!a||!a.parentNode)return null;var c=a.parentNode.querySelector(".photo-convert-status");return c||(c=document.createElement("p"),c.className="photo-convert-status form-status",c.setAttribute("role","status"),a.parentNode.insertBefore(c,a.nextSibling)),c}function Od(){var a=document.querySelector(".filepond-root, .form-input-file");if(!a)return null;var c=a.closest(".form-field");if(!c)return null;var d=c.querySelector(".form-label"),l=document.createElement("details");l.className="photos-collapse",l.open=!0;var u=document.createElement("summary");for(u.className="photos-collapse__summary",u.textContent="Photos (max 4)",l.appendChild(u);c.firstChild;)l.appendChild(c.firstChild);return c.appendChild(l),d&&(d.style.display="none"),{details:l,summary:u}}function Hd(){var a=document.querySelector('form[name="new-entry"]');if(!a)return;var c=0,d=Od();function l(C,D){var E=Su();E&&(E.textContent=C||"",E.className="photo-convert-status form-status"+(D?" form-status--"+D:""))}function u(){if(d){var C=document.querySelectorAll(".filepond--item[data-filepond-item-state]"),D=C.length,E=0;Array.prototype.forEach.call(C,function(T){T.getAttribute("data-filepond-item-state")==="processing-complete"&&E++}),c>0||D>0&&E<D?(d.summary.textContent=c>0?"Converting "+c+" photo"+(c>1?"s":"")+"\u2026":"Uploading "+D+" photo"+(D>1?"s":"")+"\u2026",d.details.open=!0):D>0?(d.summary.textContent="\u2713 "+D+" photo"+(D>1?"s":"")+" ready \u2014 tap to review",d.details.open=!1):(d.summary.textContent="Photos (max 4)",d.details.open=!0)}}function g(){u(),setTimeout(u,150),setTimeout(u,500)}function f(){var C=a.querySelector('button[type="submit"], input[type="submit"]');if(C&&(C.disabled=c>0),c>0)l("Converting "+c+" photo"+(c>1?"s":"")+"\u2026");else{var D=Su();D&&/Converting/.test(D.textContent)&&l("")}u()}a.addEventListener("submit",function(C){c>0&&(C.preventDefault(),l("Hang on \u2014 a photo is still converting.","err"))},!0);function p(C){return function(D){var E=D&&D.file;return E?Id(E).then(function(T){return T?(c++,f(),import("./heic-to-CN7JBE7H.js").then(function(M){var z=M.heicTo||M.default&&M.default.heicTo;return z({blob:E,type:"image/jpeg",quality:.85})}).then(function(M){var z=new File([M],zd(E.name),{type:"image/jpeg"});C.addFile(z)}).catch(function(){l("A photo couldn\u2019t be converted and was skipped \u2014 the others are fine.","err")}).then(function(){c--,f()}),!1):!0}):!0}}var b=0;(function C(){var D=window.GravFilePond&&window.GravFilePond.getInstances?window.GravFilePond.getInstances():[];if(!D.length){b++<120&&setTimeout(C,50);return}D.forEach(function(E){E&&!E._heicHooked&&(E._heicHooked=!0,E.setOptions({beforeAddFile:p(E)}),["addfile","processfile","processfiles","removefile","error"].forEach(function(T){try{E.on(T,g)}catch{}}),u())})})()}function vr(a){return document.querySelector('[name="data['+a+']"]')}function Rd(){var a=Array.prototype.slice.call(document.querySelectorAll(".advanced-field"));if(a.length){var c=[];if(a.forEach(function(g){var f=g.closest(".form-field");f&&c.indexOf(f)===-1&&c.push(f)}),!!c.length){var d=document.createElement("details");d.className="more-options";var l=document.createElement("summary");l.className="more-options__summary",l.textContent="More options",d.appendChild(l),c[0].parentNode.insertBefore(d,c[0]),c.forEach(function(g){d.appendChild(g)});var u=c.some(function(g){var f=g.querySelector('input[type="text"]');if(f&&f.value.trim())return!0;var p=g.querySelector('input[type="radio"]:checked');return!!(p&&p.value&&p.value!=="0")});u&&(d.open=!0)}}}var Pd={0:"Sunny",1:"Partly cloudy",2:"Partly cloudy",3:"Cloudy",45:"Foggy",48:"Foggy",51:"Drizzle",53:"Drizzle",55:"Drizzle",56:"Drizzle",57:"Drizzle",61:"Rain",63:"Rain",65:"Rain",66:"Rain",67:"Rain",80:"Rain",81:"Rain",82:"Rain",71:"Snow",73:"Snow",75:"Snow",77:"Snow",85:"Snow",86:"Snow",95:"Thunderstorm",96:"Thunderstorm",99:"Thunderstorm"};function $t(a,c,d){a&&(a.className="form-status"+(d?" form-status--"+d:""),a.textContent=c||"")}function _d(){var a=document.getElementById("get-location"),c=document.getElementById("get-weather");if(!a&&!c)return;var d=document.getElementById("location-status"),l=document.getElementById("weather-status");function u(){var f=vr("lat"),p=vr("lng"),b=f?f.value.trim():"",C=p?p.value.trim():"";return b&&C?{lat:b,lng:C}:null}function g(){if(c){var f=!!u();c.disabled=!f,c.title=f?"":"Get location first"}}g(),a&&a.addEventListener("click",function(){if(!navigator.geolocation){$t(d,"Geolocation is not supported on this device.","err");return}a.classList.add("is-loading"),a.disabled=!0,$t(d,"Getting location\u2026"),navigator.geolocation.getCurrentPosition(function(f){var p=f.coords.latitude.toFixed(6),b=f.coords.longitude.toFixed(6),C=vr("lat"),D=vr("lng");C&&(C.value=p),D&&(D.value=b),a.classList.remove("is-loading"),a.disabled=!1,$t(d,"\u2713 Location captured \xB7 "+p+", "+b,"ok"),g()},function(f){a.classList.remove("is-loading"),a.disabled=!1,$t(d,"\u2717 "+(f&&f.message?f.message:"Could not get location")+" \u2014 enter coordinates manually if needed.","err")},{enableHighAccuracy:!0,timeout:15e3})}),c&&c.addEventListener("click",function(){var f=u();if(!f){$t(l,"Get location first, then fetch weather.","err");return}c.classList.add("is-loading"),c.disabled=!0,$t(l,"Fetching weather\u2026");var p="https://api.open-meteo.com/v1/forecast?latitude="+f.lat+"&longitude="+f.lng+"¤t=temperature_2m,weather_code&temperature_unit=celsius";fetch(p).then(function(b){return b.json()}).then(function(b){var C=Math.round(b.current.temperature_2m),D=Pd[b.current.weather_code]||"Cloudy",E=vr("weather_temp_c"),T=vr("weather_desc");E&&(E.value=C),T&&(T.value=D),c.classList.remove("is-loading"),g(),$t(l,"\u2713 Weather set \xB7 "+D+" \xB7 "+C+"\xB0C (edit above if needed)","ok")}).catch(function(){c.classList.remove("is-loading"),g(),$t(l,"\u2717 Could not fetch weather \u2014 set it manually above.","err")})})}function Wd(){var a={title:"Title",content:"Content"},c=document.querySelector('form[name="new-entry"]');if(!c)return;function d(){c.querySelectorAll(".field-error").forEach(function(u){u.remove()}),c.querySelectorAll(".field-invalid").forEach(function(u){u.classList.remove("field-invalid")})}function l(u,g){u.classList.add("field-invalid");var f=document.createElement("span");f.className="field-error",f.textContent=g,u.parentNode.insertBefore(f,u.nextSibling)}c.addEventListener("submit",function(u){d();var g=null;Object.keys(a).forEach(function(f){var p=vr(f);p&&!String(p.value).trim()&&(l(p,a[f]+" is required."),g||(g=p))}),g&&(u.preventDefault(),g.focus(),g.scrollIntoView({behavior:"smooth",block:"center"}))})}var ua="intotheeast:new-entry-draft";function qd(a){return Array.prototype.slice.call(a.querySelectorAll('[name^="data["]')).filter(function(c){if(c.type==="file")return!1;var d=c.name;return d.indexOf("data[_json")!==0&&d.indexOf("data[photos")!==0})}function Ud(){var a=document.querySelector(".filepond-root, .form-input-file");if(!(!a||!a.parentNode)&&!a.parentNode.querySelector(".photo-reauth-hint")){var c=document.createElement("p");c.className="photo-reauth-hint is-shown",c.textContent="Your text was restored \u2014 photos need re-selecting (they can\u2019t be saved in a draft).",a.parentNode.insertBefore(c,a.nextSibling)}}function jd(){var a=document.querySelector('form[name="new-entry"]');if(!a)return;if(document.querySelector(".notices.success")){try{localStorage.removeItem(ua)}catch{}return}function c(){var g={};qd(a).forEach(function(f){f.type==="radio"?f.checked&&(g[f.name]=f.value):g[f.name]=f.value});try{localStorage.setItem(ua,JSON.stringify(g))}catch{}}var d=null;try{d=localStorage.getItem(ua)}catch{d=null}if(d){var l=null;try{l=JSON.parse(d)}catch{l=null}if(l){var u=!1;Object.keys(l).forEach(function(g){var f=l[g];if(f!=null&&String(f).trim()&&(u=!0),g!=="data[content]"){var p=a.querySelectorAll('input[type="radio"][name="'+g+'"]');if(p.length){p.forEach(function(C){C.checked=C.value===f});return}var b=a.querySelector('[name="'+g+'"]');b&&b.type!=="file"&&(b.value=f)}}),window.postFormEditor&&l["data[content]"]!=null&&window.postFormEditor.value(l["data[content]"]),u&&Ud()}}a.addEventListener("input",c),a.addEventListener("change",c),window.postFormEditor&&window.postFormEditor.codemirror.on("change",c)}function Gd(){var a=document.querySelector(".post-form-wrap"),c=document.querySelector(".post-form-wrap .notices.success, .post-form-wrap .notices.green");if(!(!a||!c)){var d=document.createElement("div");d.className="post-success";var l=document.createElement("p");l.className="post-success__title",l.textContent="\u2713 Saved to your journal.",d.appendChild(l);var u=document.createElement("div");u.className="post-success__actions";var g=a.getAttribute("data-trip-url");if(g){var f=document.createElement("a");f.className="post-success__view",f.href=g,f.textContent="View your journal \u2192",u.appendChild(f)}var p=document.createElement("a");p.className="post-success__again",p.href=window.location.pathname,p.textContent="Post another",u.appendChild(p),d.appendChild(u),c.parentNode.insertBefore(d,c.nextSibling),["form",".form-action-row","#location-status","#weather-status"].forEach(function(b){var C=a.querySelector(b);C&&(C.style.display="none")}),c.scrollIntoView({behavior:"smooth",block:"start"})}}function Fu(){window.postFormEditor=Bd(),Gd(),jd(),Hd(),Rd(),_d(),Wd()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Fu):Fu();
|