Files
intotheeast-com-content/themes/intotheeast/js/post/post-form.js
T
m038andClaude Opus 4.8 a7bda6ed39 fix(post-form): only auto-expand More options when a field deviates from default
initDisclosure auto-opened the More-options panel whenever any advanced field
'had a value', but the published toggle defaults ON, so a plain create form
tripped it every load. A toggle now counts only when it deviates from its
blueprint default (published: OFF is notable; force_connect/featured: ON is),
so the panel stays collapsed on create. Edit mode still force-opens it
separately. Rebuilt bundle via make build-assets.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mpdu3Dt1iVoozHwAMyjrbn
2026-07-05 23:42:31 +02:00

106 lines
383 KiB
JavaScript

import{a as Ku,b as lt,c as Gh}from"./chunk-ZWRDP37E.js";var Et=lt((rl,nl)=>{(function(o,l){typeof rl=="object"&&typeof nl<"u"?nl.exports=l():typeof define=="function"&&define.amd?define(l):(o=o||self,o.CodeMirror=l())})(rl,function(){"use strict";var o=navigator.userAgent,l=navigator.platform,s=/gecko\/\d/i.test(o),a=/MSIE \d/.test(o),f=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(o),p=/Edge\/(\d+)/.exec(o),c=a||f||p,h=c&&(a?document.documentMode||6:+(p||f)[1]),b=!p&&/WebKit\//.test(o),y=b&&/Qt\/\d+\.\d+/.test(o),x=!p&&/Chrome\/(\d+)/.exec(o),C=x&&+x[1],E=/Opera\//.test(o),F=/Apple Computer/.test(navigator.vendor),_=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(o),L=/PhantomJS/.test(o),T=F&&(/Mobile\/\w+/.test(o)||navigator.maxTouchPoints>2),O=/Android/.test(o),N=T||O||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(o),P=T||/Mac/.test(l),I=/\bCrOS\b/.test(o),W=/win/i.test(l),j=E&&o.match(/Version\/(\d*\.\d*)/);j&&(j=Number(j[1])),j&&j>=15&&(E=!1,b=!0);var X=P&&(y||E&&(j==null||j<12.11)),be=s||c&&h>=9;function U(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ae=function(e,t){var n=e.className,r=U(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function ne(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function se(e,t){return ne(e).appendChild(t)}function S(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var u=0;u<t.length;++u)i.appendChild(t[u]);return i}function R(e,t,n,r){var i=S(e,t,n,r);return i.setAttribute("role","presentation"),i}var z;document.createRange?z=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:z=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function K(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 ue(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function De(e,t){var n=e.className;U(t).test(n)||(e.className+=(n?" ":"")+t)}function ot(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!U(n[r]).test(t)&&(t+=" "+n[r]);return t}var A=function(e){e.select()};T?A=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:c&&(A=function(e){try{e.select()}catch{}});function D(e){return e.display.wrapper.ownerDocument}function ee(e){return we(e.display.wrapper)}function we(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function he(e){return D(e).defaultView}function $e(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Tt(e,t,n){t||(t={});for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n!==!1||!Object.prototype.hasOwnProperty.call(t,r))&&(t[r]=e[r]);return t}function Ke(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var u=r||0,d=i||0;;){var g=e.indexOf(" ",u);if(g<0||g>=t)return d+(t-u);d+=g-u,d+=n-d%n,u=g+1}}var ct=function(){this.id=null,this.f=null,this.time=0,this.handler=$e(this.onTimeout,this)};ct.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ct.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function Be(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var ze=50,Ye={toString:function(){return"CodeMirror.Pass"}},vt={scroll:!1},Tn={origin:"*mouse"},Xt={origin:"+move"};function Kt(e,t,n){for(var r=0,i=0;;){var u=e.indexOf(" ",r);u==-1&&(u=e.length);var d=u-r;if(u==e.length||i+d>=t)return r+Math.min(d,t-i);if(i+=u-r,i+=n-i%n,r=u+1,i>=t)return r}}var zt=[""];function pr(e){for(;zt.length<=e;)zt.push(Ce(zt)+" ");return zt[e]}function Ce(e){return e[e.length-1]}function Ht(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function gr(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function Di(){}function Rl(e,t){var n;return Object.create?n=Object.create(e):(Di.prototype=e,n=new Di),t&&Tt(t,n),n}var Bc=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Ko(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Bc.test(e))}function wi(e,t){return t?t.source.indexOf("\\w")>-1&&Ko(e)?!0:t.test(e):Ko(e)}function Wl(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Nc=/[\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 Yo(e){return e.charCodeAt(0)>=768&&Nc.test(e)}function ql(e,t,n){for(;(n<0?t>0:t<e.length)&&Yo(e.charAt(t));)t+=n;return t}function Ln(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,u=r<0?Math.ceil(i):Math.floor(i);if(u==t)return e(u)?t:n;e(u)?n=u:t=u+r}}function Oc(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,u=0;u<e.length;++u){var d=e[u];(d.from<n&&d.to>t||t==n&&d.to==t)&&(r(Math.max(d.from,t),Math.min(d.to,n),d.level==1?"rtl":"ltr",u),i=!0)}i||r(t,n,"ltr")}var Mn=null;function _n(e,t,n){var r;Mn=null;for(var i=0;i<e.length;++i){var u=e[i];if(u.from<t&&u.to>t)return i;u.to==t&&(u.from!=u.to&&n=="before"?r=i:Mn=i),u.from==t&&(u.from!=u.to&&n!="before"?r=i:Mn=i)}return r??Mn}var Ic=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(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]/,i=/[stwN]/,u=/[LRr]/,d=/[Lb1n]/,g=/[1n]/;function v(m,w,k){this.level=m,this.from=w,this.to=k}return function(m,w){var k=w=="ltr"?"L":"R";if(m.length==0||w=="ltr"&&!r.test(m))return!1;for(var B=m.length,M=[],H=0;H<B;++H)M.push(n(m.charCodeAt(H)));for(var q=0,Y=k;q<B;++q){var Z=M[q];Z=="m"?M[q]=Y:Y=Z}for(var $=0,Q=k;$<B;++$){var te=M[$];te=="1"&&Q=="r"?M[$]="n":u.test(te)&&(Q=te,te=="r"&&(M[$]="R"))}for(var le=1,oe=M[0];le<B-1;++le){var xe=M[le];xe=="+"&&oe=="1"&&M[le+1]=="1"?M[le]="1":xe==","&&oe==M[le+1]&&(oe=="1"||oe=="n")&&(M[le]=oe),oe=xe}for(var Te=0;Te<B;++Te){var nt=M[Te];if(nt==",")M[Te]="N";else if(nt=="%"){var Ie=void 0;for(Ie=Te+1;Ie<B&&M[Ie]=="%";++Ie);for(var St=Te&&M[Te-1]=="!"||Ie<B&&M[Ie]=="1"?"1":"N",xt=Te;xt<Ie;++xt)M[xt]=St;Te=Ie-1}}for(var Ge=0,Dt=k;Ge<B;++Ge){var at=M[Ge];Dt=="L"&&at=="1"?M[Ge]="L":u.test(at)&&(Dt=at)}for(var Ze=0;Ze<B;++Ze)if(i.test(M[Ze])){var Xe=void 0;for(Xe=Ze+1;Xe<B&&i.test(M[Xe]);++Xe);for(var He=(Ze?M[Ze-1]:k)=="L",wt=(Xe<B?M[Xe]:k)=="L",mn=He==wt?He?"L":"R":k,kr=Ze;kr<Xe;++kr)M[kr]=mn;Ze=Xe-1}for(var ut=[],$t,it=0;it<B;)if(d.test(M[it])){var el=it;for(++it;it<B&&d.test(M[it]);++it);ut.push(new v(0,el,it))}else{var lr=it,Wr=ut.length,qr=w=="rtl"?1:0;for(++it;it<B&&M[it]!="L";++it);for(var ht=lr;ht<it;)if(g.test(M[ht])){lr<ht&&(ut.splice(Wr,0,new v(1,lr,ht)),Wr+=qr);var bn=ht;for(++ht;ht<it&&g.test(M[ht]);++ht);ut.splice(Wr,0,new v(2,bn,ht)),Wr+=qr,lr=ht}else++ht;lr<it&&ut.splice(Wr,0,new v(1,lr,it))}return w=="ltr"&&(ut[0].level==1&&($t=m.match(/^\s+/))&&(ut[0].from=$t[0].length,ut.unshift(new v(0,0,$t[0].length))),Ce(ut).level==1&&($t=m.match(/\s+$/))&&(Ce(ut).to-=$t[0].length,ut.push(new v(0,B-$t[0].length,B)))),w=="rtl"?ut.reverse():ut}}();function tr(e,t){var n=e.order;return n==null&&(n=e.order=Ic(e.text,t)),n}var Ul=[],fe=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Ul).concat(n)}};function Zo(e,t){return e._handlers&&e._handlers[t]||Ul}function Lt(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var u=Be(i,n);u>-1&&(r[t]=i.slice(0,u).concat(i.slice(u+1)))}}}function Ue(e,t){var n=Zo(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Ve(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Ue(e,n||t.type,e,t),Qo(t)||t.codemirrorIgnore}function jl(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)Be(n,t[r])==-1&&n.push(t[r])}function It(e,t){return Zo(e,t).length>0}function Qr(e){e.prototype.on=function(t,n){fe(this,t,n)},e.prototype.off=function(t,n){Lt(this,t,n)}}function mt(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Gl(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Qo(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Bn(e){mt(e),Gl(e)}function Jo(e){return e.target||e.srcElement}function Xl(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),P&&e.ctrlKey&&t==1&&(t=3),t}var Pc=function(){if(c&&h<9)return!1;var e=S("div");return"draggable"in e||"dragDrop"in e}(),$o;function zc(e){if($o==null){var t=S("span","\u200B");se(e,S("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&($o=t.offsetWidth<=1&&t.offsetHeight>2&&!(c&&h<8))}var n=$o?S("span","\u200B"):S("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var Vo;function Hc(e){if(Vo!=null)return Vo;var t=se(e,document.createTextNode("A\u062EA")),n=z(t,0,1).getBoundingClientRect(),r=z(t,1,2).getBoundingClientRect();return ne(e),!n||n.left==n.right?!1:Vo=r.right-n.right<3}var ea=`
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
`,t);i==-1&&(i=e.length);var u=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),d=u.indexOf("\r");d!=-1?(n.push(u.slice(0,d)),t+=d+1):(n.push(u),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Rc=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},Wc=function(){var e=S("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ta=null;function qc(e){if(ta!=null)return ta;var t=se(e,S("span","x")),n=t.getBoundingClientRect(),r=z(t,0,1).getBoundingClientRect();return ta=Math.abs(n.left-r.left)>1}var ra={},Jr={};function Uc(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),ra[e]=t}function jc(e,t){Jr[e]=t}function Ci(e){if(typeof e=="string"&&Jr.hasOwnProperty(e))e=Jr[e];else if(e&&typeof e.name=="string"&&Jr.hasOwnProperty(e.name)){var t=Jr[e.name];typeof t=="string"&&(t={name:t}),e=Rl(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ci("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ci("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function na(e,t){t=Ci(t);var n=ra[t.name];if(!n)return na(e,"text/plain");var r=n(e,t);if($r.hasOwnProperty(t.name)){var i=$r[t.name];for(var u in i)i.hasOwnProperty(u)&&(r.hasOwnProperty(u)&&(r["_"+u]=r[u]),r[u]=i[u])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var d in t.modeProps)r[d]=t.modeProps[d];return r}var $r={};function Gc(e,t){var n=$r.hasOwnProperty(e)?$r[e]:$r[e]={};Tt(t,n)}function Lr(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function ia(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Kl(e,t,n){return e.startState?e.startState(t,n):!0}var je=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};je.prototype.eol=function(){return this.pos>=this.string.length},je.prototype.sol=function(){return this.pos==this.lineStart},je.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},je.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},je.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},je.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},je.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},je.prototype.skipToEnd=function(){this.pos=this.string.length},je.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},je.prototype.backUp=function(e){this.pos-=e},je.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Ke(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Ke(this.string,this.lineStart,this.tabSize):0)},je.prototype.indentation=function(){return Ke(this.string,null,this.tabSize)-(this.lineStart?Ke(this.string,this.lineStart,this.tabSize):0)},je.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(d){return n?d.toLowerCase():d},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var u=this.string.slice(this.pos).match(e);return u&&u.index>0?null:(u&&t!==!1&&(this.pos+=u[0].length),u)}},je.prototype.current=function(){return this.string.slice(this.start,this.pos)},je.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},je.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},je.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ie(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 n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],u=i.chunkSize();if(t<u){n=i;break}t-=u}return n.lines[t]}function Mr(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(u){var d=u.text;i==n.line&&(d=d.slice(0,n.ch)),i==t.line&&(d=d.slice(t.ch)),r.push(d),++i}),r}function oa(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function Yt(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function Ae(e){if(e.parent==null)return null;for(var t=e.parent,n=Be(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function _r(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],u=i.height;if(t<u){e=i;continue e}t-=u,n+=i.chunkSize()}return n}while(!e.lines);for(var d=0;d<e.lines.length;++d){var g=e.lines[d],v=g.height;if(t<v)break;t-=v}return n+d}function Nn(e,t){return t>=e.first&&t<e.first+e.size}function aa(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function G(e,t,n){if(n===void 0&&(n=null),!(this instanceof G))return new G(e,t,n);this.line=e,this.ch=t,this.sticky=n}function ve(e,t){return e.line-t.line||e.ch-t.ch}function la(e,t){return e.sticky==t.sticky&&ve(e,t)==0}function sa(e){return G(e.line,e.ch)}function ki(e,t){return ve(e,t)<0?t:e}function Si(e,t){return ve(e,t)<0?e:t}function Yl(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function me(e,t){if(t.line<e.first)return G(e.first,0);var n=e.first+e.size-1;return t.line>n?G(n,ie(e,n).text.length):Xc(t,ie(e,t.line).text.length)}function Xc(e,t){var n=e.ch;return n==null||n>t?G(e.line,t):n<0?G(e.line,0):e}function Zl(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=me(e,t[r]);return n}var Ei=function(e,t){this.state=e,this.lookAhead=t},Zt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Zt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Zt.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}},Zt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Zt.fromSaved=function(e,t,n){return t instanceof Ei?new Zt(e,Lr(e.mode,t.state),n,t.lookAhead):new Zt(e,Lr(e.mode,t),n)},Zt.prototype.save=function(e){var t=e!==!1?Lr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Ei(t,this.maxLookAhead):t};function Ql(e,t,n,r){var i=[e.state.modeGen],u={};rs(e,t.text,e.doc.mode,n,function(m,w){return i.push(m,w)},u,r);for(var d=n.state,g=function(m){n.baseTokens=i;var w=e.state.overlays[m],k=1,B=0;n.state=!0,rs(e,t.text,w.mode,n,function(M,H){for(var q=k;B<M;){var Y=i[k];Y>M&&i.splice(k,1,M,i[k+1],Y),k+=2,B=Math.min(M,Y)}if(H)if(w.opaque)i.splice(q,k-q,M,"overlay "+H),k=q+2;else for(;q<k;q+=2){var Z=i[q+1];i[q+1]=(Z?Z+" ":"")+"overlay "+H}},u),n.state=d,n.baseTokens=null,n.baseTokenPos=1},v=0;v<e.state.overlays.length;++v)g(v);return{styles:i,classes:u.bgClass||u.textClass?u:null}}function Jl(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=On(e,Ae(t)),i=t.text.length>e.options.maxHighlightLength&&Lr(e.doc.mode,r.state),u=Ql(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=u.styles,u.classes?t.styleClasses=u.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function On(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Zt(r,!0,t);var u=Kc(e,t,n),d=u>r.first&&ie(r,u-1).stateAfter,g=d?Zt.fromSaved(r,d,u):new Zt(r,Kl(r.mode),u);return r.iter(u,t,function(v){ua(e,v.text,g);var m=g.line;v.stateAfter=m==t-1||m%5==0||m>=i.viewFrom&&m<i.viewTo?g.save():null,g.nextLine()}),n&&(r.modeFrontier=g.line),g}function ua(e,t,n,r){var i=e.doc.mode,u=new je(t,e.options.tabSize,n);for(u.start=u.pos=r||0,t==""&&$l(i,n.state);!u.eol();)fa(i,u,n.state),u.start=u.pos}function $l(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=ia(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function fa(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=ia(e,n).mode);var u=e.token(t,n);if(t.pos>t.start)return u}throw new Error("Mode "+e.name+" failed to advance stream.")}var Vl=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function es(e,t,n,r){var i=e.doc,u=i.mode,d;t=me(i,t);var g=ie(i,t.line),v=On(e,t.line,n),m=new je(g.text,e.options.tabSize,v),w;for(r&&(w=[]);(r||m.pos<t.ch)&&!m.eol();)m.start=m.pos,d=fa(u,m,v.state),r&&w.push(new Vl(m,d,Lr(i.mode,v.state)));return r?w:new Vl(m,d,v.state)}function ts(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function rs(e,t,n,r,i,u,d){var g=n.flattenSpans;g==null&&(g=e.options.flattenSpans);var v=0,m=null,w=new je(t,e.options.tabSize,r),k,B=e.options.addModeClass&&[null];for(t==""&&ts($l(n,r.state),u);!w.eol();){if(w.pos>e.options.maxHighlightLength?(g=!1,d&&ua(e,t,r,w.pos),w.pos=t.length,k=null):k=ts(fa(n,w,r.state,B),u),B){var M=B[0].name;M&&(k="m-"+(k?M+" "+k:M))}if(!g||m!=k){for(;v<w.start;)v=Math.min(w.start,v+5e3),i(v,m);m=k}w.start=w.pos}for(;v<w.pos;){var H=Math.min(w.pos,v+5e3);i(H,m),v=H}}function Kc(e,t,n){for(var r,i,u=e.doc,d=n?-1:t-(e.doc.mode.innerMode?1e3:100),g=t;g>d;--g){if(g<=u.first)return u.first;var v=ie(u,g-1),m=v.stateAfter;if(m&&(!n||g+(m instanceof Ei?m.lookAhead:0)<=u.modeFrontier))return g;var w=Ke(v.text,null,e.options.tabSize);(i==null||r>w)&&(i=g-1,r=w)}return i}function Yc(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=ie(e,r).stateAfter;if(i&&(!(i instanceof Ei)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var ns=!1,rr=!1;function Zc(){ns=!0}function Qc(){rr=!0}function Ai(e,t,n){this.marker=e,this.from=t,this.to=n}function In(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function Jc(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function $c(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.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 Vc(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var u=e[i],d=u.marker,g=u.from==null||(d.inclusiveLeft?u.from<=t:u.from<t);if(g||u.from==t&&d.type=="bookmark"&&(!n||!u.marker.insertLeft)){var v=u.to==null||(d.inclusiveRight?u.to>=t:u.to>t);(r||(r=[])).push(new Ai(d,u.from,v?null:u.to))}}return r}function ed(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var u=e[i],d=u.marker,g=u.to==null||(d.inclusiveRight?u.to>=t:u.to>t);if(g||u.from==t&&d.type=="bookmark"&&(!n||u.marker.insertLeft)){var v=u.from==null||(d.inclusiveLeft?u.from<=t:u.from<t);(r||(r=[])).push(new Ai(d,v?null:u.from-t,u.to==null?null:u.to-t))}}return r}function ca(e,t){if(t.full)return null;var n=Nn(e,t.from.line)&&ie(e,t.from.line).markedSpans,r=Nn(e,t.to.line)&&ie(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,u=t.to.ch,d=ve(t.from,t.to)==0,g=Vc(n,i,d),v=ed(r,u,d),m=t.text.length==1,w=Ce(t.text).length+(m?i:0);if(g)for(var k=0;k<g.length;++k){var B=g[k];if(B.to==null){var M=In(v,B.marker);M?m&&(B.to=M.to==null?null:M.to+w):B.to=i}}if(v)for(var H=0;H<v.length;++H){var q=v[H];if(q.to!=null&&(q.to+=w),q.from==null){var Y=In(g,q.marker);Y||(q.from=w,m&&(g||(g=[])).push(q))}else q.from+=w,m&&(g||(g=[])).push(q)}g&&(g=is(g)),v&&v!=g&&(v=is(v));var Z=[g];if(!m){var $=t.text.length-2,Q;if($>0&&g)for(var te=0;te<g.length;++te)g[te].to==null&&(Q||(Q=[])).push(new Ai(g[te].marker,null,null));for(var le=0;le<$;++le)Z.push(Q);Z.push(v)}return Z}function is(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function td(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(M){if(M.markedSpans)for(var H=0;H<M.markedSpans.length;++H){var q=M.markedSpans[H].marker;q.readOnly&&(!r||Be(r,q)==-1)&&(r||(r=[])).push(q)}}),!r)return null;for(var i=[{from:t,to:n}],u=0;u<r.length;++u)for(var d=r[u],g=d.find(0),v=0;v<i.length;++v){var m=i[v];if(!(ve(m.to,g.from)<0||ve(m.from,g.to)>0)){var w=[v,1],k=ve(m.from,g.from),B=ve(m.to,g.to);(k<0||!d.inclusiveLeft&&!k)&&w.push({from:m.from,to:g.from}),(B>0||!d.inclusiveRight&&!B)&&w.push({from:g.to,to:m.to}),i.splice.apply(i,w),v+=w.length-3}}return i}function os(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function as(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function Fi(e){return e.inclusiveLeft?-1:0}function Ti(e){return e.inclusiveRight?1:0}function da(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),u=ve(r.from,i.from)||Fi(e)-Fi(t);if(u)return-u;var d=ve(r.to,i.to)||Ti(e)-Ti(t);return d||t.id-e.id}function ls(e,t){var n=rr&&e.markedSpans,r;if(n)for(var i=void 0,u=0;u<n.length;++u)i=n[u],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||da(r,i.marker)<0)&&(r=i.marker);return r}function ss(e){return ls(e,!0)}function Li(e){return ls(e,!1)}function rd(e,t){var n=rr&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var u=n[i];u.marker.collapsed&&(u.from==null||u.from<t)&&(u.to==null||u.to>t)&&(!r||da(r,u.marker)<0)&&(r=u.marker)}return r}function us(e,t,n,r,i){var u=ie(e,t),d=rr&&u.markedSpans;if(d)for(var g=0;g<d.length;++g){var v=d[g];if(v.marker.collapsed){var m=v.marker.find(0),w=ve(m.from,n)||Fi(v.marker)-Fi(i),k=ve(m.to,r)||Ti(v.marker)-Ti(i);if(!(w>=0&&k<=0||w<=0&&k>=0)&&(w<=0&&(v.marker.inclusiveRight&&i.inclusiveLeft?ve(m.to,n)>=0:ve(m.to,n)>0)||w>=0&&(v.marker.inclusiveRight&&i.inclusiveLeft?ve(m.from,r)<=0:ve(m.from,r)<0)))return!0}}}function Rt(e){for(var t;t=ss(e);)e=t.find(-1,!0).line;return e}function nd(e){for(var t;t=Li(e);)e=t.find(1,!0).line;return e}function id(e){for(var t,n;t=Li(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function ha(e,t){var n=ie(e,t),r=Rt(n);return n==r?t:Ae(r)}function fs(e,t){if(t>e.lastLine())return t;var n=ie(e,t),r;if(!vr(e,n))return t;for(;r=Li(n);)n=r.find(1,!0).line;return Ae(n)+1}function vr(e,t){var n=rr&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&pa(e,t,r))return!0}}}function pa(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return pa(e,r.line,In(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.to==t.text.length)return!0;for(var i=void 0,u=0;u<t.markedSpans.length;++u)if(i=t.markedSpans[u],i.marker.collapsed&&!i.marker.widgetNode&&i.from==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&pa(e,t,i))return!0}function nr(e){e=Rt(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var u=n.parent;u;n=u,u=n.parent)for(var d=0;d<u.children.length;++d){var g=u.children[d];if(g==n)break;t+=g.height}return t}function Mi(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=ss(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=Li(r);){var u=n.find(0,!0);t-=r.text.length-u.from.ch,r=u.to.line,t+=r.text.length-u.to.ch}return t}function ga(e){var t=e.display,n=e.doc;t.maxLine=ie(n,n.first),t.maxLineLength=Mi(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=Mi(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var Vr=function(e,t,n){this.text=e,as(this,t),this.height=n?n(this):1};Vr.prototype.lineNo=function(){return Ae(this)},Qr(Vr);function od(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),os(e),as(e,n);var i=r?r(e):1;i!=e.height&&Yt(e,i)}function ad(e){e.parent=null,os(e)}var ld={},sd={};function cs(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?sd:ld;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function ds(e,t){var n=R("span",null,null,b?"padding-right: .1px":null),r={pre:R("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var u=i?t.rest[i-1]:t.line,d=void 0;r.pos=0,r.addToken=fd,Hc(e.display.measure)&&(d=tr(u,e.doc.direction))&&(r.addToken=dd(r.addToken,d)),r.map=[];var g=t!=e.display.externalMeasured&&Ae(u);hd(u,r,Jl(e,u,g)),u.styleClasses&&(u.styleClasses.bgClass&&(r.bgClass=ot(u.styleClasses.bgClass,r.bgClass||"")),u.styleClasses.textClass&&(r.textClass=ot(u.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(zc(e.display.measure))),i==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 Ue(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=ot(r.pre.className,r.textClass||"")),r}function ud(e){var t=S("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function fd(e,t,n,r,i,u,d){if(t){var g=e.splitSpaces?cd(t,e.trailingSpace):t,v=e.cm.state.specialChars,m=!1,w;if(!v.test(t))e.col+=t.length,w=document.createTextNode(g),e.map.push(e.pos,e.pos+t.length,w),c&&h<9&&(m=!0),e.pos+=t.length;else{w=document.createDocumentFragment();for(var k=0;;){v.lastIndex=k;var B=v.exec(t),M=B?B.index-k:t.length-k;if(M){var H=document.createTextNode(g.slice(k,k+M));c&&h<9?w.appendChild(S("span",[H])):w.appendChild(H),e.map.push(e.pos,e.pos+M,H),e.col+=M,e.pos+=M}if(!B)break;k+=M+1;var q=void 0;if(B[0]==" "){var Y=e.cm.options.tabSize,Z=Y-e.col%Y;q=w.appendChild(S("span",pr(Z),"cm-tab")),q.setAttribute("role","presentation"),q.setAttribute("cm-text"," "),e.col+=Z}else B[0]=="\r"||B[0]==`
`?(q=w.appendChild(S("span",B[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),q.setAttribute("cm-text",B[0]),e.col+=1):(q=e.cm.options.specialCharPlaceholder(B[0]),q.setAttribute("cm-text",B[0]),c&&h<9?w.appendChild(S("span",[q])):w.appendChild(q),e.col+=1);e.map.push(e.pos,e.pos+1,q),e.pos++}}if(e.trailingSpace=g.charCodeAt(t.length-1)==32,n||r||i||m||u||d){var $=n||"";r&&($+=r),i&&($+=i);var Q=S("span",[w],$,u);if(d)for(var te in d)d.hasOwnProperty(te)&&te!="style"&&te!="class"&&Q.setAttribute(te,d[te]);return e.content.appendChild(Q)}e.content.appendChild(w)}}function cd(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var u=e.charAt(i);u==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(u="\xA0"),r+=u,n=u==" "}return r}function dd(e,t){return function(n,r,i,u,d,g,v){i=i?i+" cm-force-border":"cm-force-border";for(var m=n.pos,w=m+r.length;;){for(var k=void 0,B=0;B<t.length&&(k=t[B],!(k.to>m&&k.from<=m));B++);if(k.to>=w)return e(n,r,i,u,d,g,v);e(n,r.slice(0,k.to-m),i,u,null,g,v),u=null,r=r.slice(k.to-m),m=k.to}}}function hs(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function hd(e,t,n){var r=e.markedSpans,i=e.text,u=0;if(!r){for(var d=1;d<n.length;d+=2)t.addToken(t,i.slice(u,u=n[d]),cs(n[d+1],t.cm.options));return}for(var g=i.length,v=0,m=1,w="",k,B,M=0,H,q,Y,Z,$;;){if(M==v){H=q=Y=B="",$=null,Z=null,M=1/0;for(var Q=[],te=void 0,le=0;le<r.length;++le){var oe=r[le],xe=oe.marker;if(xe.type=="bookmark"&&oe.from==v&&xe.widgetNode)Q.push(xe);else if(oe.from<=v&&(oe.to==null||oe.to>v||xe.collapsed&&oe.to==v&&oe.from==v)){if(oe.to!=null&&oe.to!=v&&M>oe.to&&(M=oe.to,q=""),xe.className&&(H+=" "+xe.className),xe.css&&(B=(B?B+";":"")+xe.css),xe.startStyle&&oe.from==v&&(Y+=" "+xe.startStyle),xe.endStyle&&oe.to==M&&(te||(te=[])).push(xe.endStyle,oe.to),xe.title&&(($||($={})).title=xe.title),xe.attributes)for(var Te in xe.attributes)($||($={}))[Te]=xe.attributes[Te];xe.collapsed&&(!Z||da(Z.marker,xe)<0)&&(Z=oe)}else oe.from>v&&M>oe.from&&(M=oe.from)}if(te)for(var nt=0;nt<te.length;nt+=2)te[nt+1]==M&&(q+=" "+te[nt]);if(!Z||Z.from==v)for(var Ie=0;Ie<Q.length;++Ie)hs(t,0,Q[Ie]);if(Z&&(Z.from||0)==v){if(hs(t,(Z.to==null?g+1:Z.to)-v,Z.marker,Z.from==null),Z.to==null)return;Z.to==v&&(Z=!1)}}if(v>=g)break;for(var St=Math.min(g,M);;){if(w){var xt=v+w.length;if(!Z){var Ge=xt>St?w.slice(0,St-v):w;t.addToken(t,Ge,k?k+H:H,Y,v+Ge.length==M?q:"",B,$)}if(xt>=St){w=w.slice(St-v),v=St;break}v=xt,Y=""}w=i.slice(u,u=n[m++]),k=cs(n[m++],t.cm.options)}}}function ps(e,t,n){this.line=t,this.rest=id(t),this.size=this.rest?Ae(Ce(this.rest))-n+1:1,this.node=this.text=null,this.hidden=vr(e,t)}function _i(e,t,n){for(var r=[],i,u=t;u<n;u=i){var d=new ps(e.doc,ie(e.doc,u),u);i=u+d.size,r.push(d)}return r}var en=null;function pd(e){en?en.ops.push(e):e.ownsGroup=en={ops:[e],delayedCallbacks:[]}}function gd(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function vd(e,t){var n=e.ownsGroup;if(n)try{gd(n)}finally{en=null,t(n)}}var Pn=null;function et(e,t){var n=Zo(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;en?i=en.delayedCallbacks:Pn?i=Pn:(i=Pn=[],setTimeout(md,0));for(var u=function(g){i.push(function(){return n[g].apply(null,r)})},d=0;d<n.length;++d)u(d)}}function md(){var e=Pn;Pn=null;for(var t=0;t<e.length;++t)e[t]()}function gs(e,t,n,r){for(var i=0;i<t.changes.length;i++){var u=t.changes[i];u=="text"?yd(e,t):u=="gutter"?ms(e,t,n,r):u=="class"?va(e,t):u=="widget"&&xd(e,t,r)}t.changes=null}function zn(e){return e.node==e.text&&(e.node=S("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),c&&h<8&&(e.node.style.zIndex=2)),e.node}function bd(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=zn(t);t.background=r.insertBefore(S("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function vs(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):ds(e,t)}function yd(e,t){var n=t.text.className,r=vs(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,va(e,t)):n&&(t.text.className=n)}function va(e,t){bd(e,t),t.line.wrapClass?zn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function ms(e,t,n,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 i=zn(t);t.gutterBackground=S("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),i.insertBefore(t.gutterBackground,t.text)}var u=t.line.gutterMarkers;if(e.options.lineNumbers||u){var d=zn(t),g=t.gutter=S("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(g.setAttribute("aria-hidden","true"),e.display.input.setUneditable(g),d.insertBefore(g,t.text),t.line.gutterClass&&(g.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!u||!u["CodeMirror-linenumbers"])&&(t.lineNumber=g.appendChild(S("div",aa(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),u)for(var v=0;v<e.display.gutterSpecs.length;++v){var m=e.display.gutterSpecs[v].className,w=u.hasOwnProperty(m)&&u[m];w&&g.appendChild(S("div",[w],"CodeMirror-gutter-elt","left: "+r.gutterLeft[m]+"px; width: "+r.gutterWidth[m]+"px"))}}}function xd(e,t,n){t.alignable&&(t.alignable=null);for(var r=U("CodeMirror-linewidget"),i=t.node.firstChild,u=void 0;i;i=u)u=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);bs(e,t,n)}function Dd(e,t,n,r){var i=vs(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),va(e,t),ms(e,t,n,r),bs(e,t,r),t.node}function bs(e,t,n){if(ys(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)ys(e,t.rest[r],t,n,!1)}function ys(e,t,n,r,i){if(t.widgets)for(var u=zn(n),d=0,g=t.widgets;d<g.length;++d){var v=g[d],m=S("div",[v.node],"CodeMirror-linewidget"+(v.className?" "+v.className:""));v.handleMouseEvents||m.setAttribute("cm-ignore-events","true"),wd(v,m,n,r),e.display.input.setUneditable(m),i&&v.above?u.insertBefore(m,n.gutter||n.text):u.appendChild(m),et(v,"redraw")}}function wd(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function Hn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!K(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),se(t.display.measure,S("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function ir(e,t){for(var n=Jo(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function Bi(e){return e.lineSpace.offsetTop}function ma(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function xs(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=se(e.measure,S("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Qt(e){return ze-e.display.nativeBarWidth}function Br(e){return e.display.scroller.clientWidth-Qt(e)-e.display.barWidth}function ba(e){return e.display.scroller.clientHeight-Qt(e)-e.display.barHeight}function Cd(e,t,n){var r=e.options.lineWrapping,i=r&&Br(e);if(!t.measure.heights||r&&t.measure.width!=i){var u=t.measure.heights=[];if(r){t.measure.width=i;for(var d=t.text.firstChild.getClientRects(),g=0;g<d.length-1;g++){var v=d[g],m=d[g+1];Math.abs(v.bottom-m.bottom)>2&&u.push((v.bottom+m.top)/2-n.top)}}u.push(n.bottom-n.top)}}function Ds(e,t,n){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 i=0;i<e.rest.length;i++)if(Ae(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function kd(e,t){t=Rt(t);var n=Ae(t),r=e.display.externalMeasured=new ps(e.doc,t,n);r.lineN=n;var i=r.built=ds(e,r);return r.text=i.pre,se(e.display.lineMeasure,i.pre),r}function ws(e,t,n,r){return Jt(e,tn(e,t),n,r)}function ya(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Ir(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function tn(e,t){var n=Ae(t),r=ya(e,n);r&&!r.text?r=null:r&&r.changes&&(gs(e,r,n,ka(e)),e.curOp.forceUpdate=!0),r||(r=kd(e,t));var i=Ds(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function Jt(e,t,n,r,i){t.before&&(n=-1);var u=n+(r||""),d;return t.cache.hasOwnProperty(u)?d=t.cache[u]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Cd(e,t.view,t.rect),t.hasHeights=!0),d=Ed(e,t,n,r),d.bogus||(t.cache[u]=d)),{left:d.left,right:d.right,top:i?d.rtop:d.top,bottom:i?d.rbottom:d.bottom}}var Cs={left:0,right:0,top:0,bottom:0};function ks(e,t,n){for(var r,i,u,d,g,v,m=0;m<e.length;m+=3)if(g=e[m],v=e[m+1],t<g?(i=0,u=1,d="left"):t<v?(i=t-g,u=i+1):(m==e.length-3||t==v&&e[m+3]>t)&&(u=v-g,i=u-1,t>=v&&(d="right")),i!=null){if(r=e[m+2],g==v&&n==(r.insertLeft?"left":"right")&&(d=n),n=="left"&&i==0)for(;m&&e[m-2]==e[m-3]&&e[m-1].insertLeft;)r=e[(m-=3)+2],d="left";if(n=="right"&&i==v-g)for(;m<e.length-3&&e[m+3]==e[m+4]&&!e[m+5].insertLeft;)r=e[(m+=3)+2],d="right";break}return{node:r,start:i,end:u,collapse:d,coverStart:g,coverEnd:v}}function Sd(e,t){var n=Cs;if(t=="left")for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function Ed(e,t,n,r){var i=ks(t.map,n,r),u=i.node,d=i.start,g=i.end,v=i.collapse,m;if(u.nodeType==3){for(var w=0;w<4;w++){for(;d&&Yo(t.line.text.charAt(i.coverStart+d));)--d;for(;i.coverStart+g<i.coverEnd&&Yo(t.line.text.charAt(i.coverStart+g));)++g;if(c&&h<9&&d==0&&g==i.coverEnd-i.coverStart?m=u.parentNode.getBoundingClientRect():m=Sd(z(u,d,g).getClientRects(),r),m.left||m.right||d==0)break;g=d,d=d-1,v="right"}c&&h<11&&(m=Ad(e.display.measure,m))}else{d>0&&(v=r="right");var k;e.options.lineWrapping&&(k=u.getClientRects()).length>1?m=k[r=="right"?k.length-1:0]:m=u.getBoundingClientRect()}if(c&&h<9&&!d&&(!m||!m.left&&!m.right)){var B=u.parentNode.getClientRects()[0];B?m={left:B.left,right:B.left+nn(e.display),top:B.top,bottom:B.bottom}:m=Cs}for(var M=m.top-t.rect.top,H=m.bottom-t.rect.top,q=(M+H)/2,Y=t.view.measure.heights,Z=0;Z<Y.length-1&&!(q<Y[Z]);Z++);var $=Z?Y[Z-1]:0,Q=Y[Z],te={left:(v=="right"?m.right:m.left)-t.rect.left,right:(v=="left"?m.left:m.right)-t.rect.left,top:$,bottom:Q};return!m.left&&!m.right&&(te.bogus=!0),e.options.singleCursorHeightPerLine||(te.rtop=M,te.rbottom=H),te}function Ad(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!qc(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function Ss(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 Es(e){e.display.externalMeasure=null,ne(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ss(e.display.view[t])}function Rn(e){Es(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function As(e){return x&&O?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function Fs(e){return x&&O?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function xa(e){var t=Rt(e),n=t.widgets,r=0;if(n)for(var i=0;i<n.length;++i)n[i].above&&(r+=Hn(n[i]));return r}function Ni(e,t,n,r,i){if(!i){var u=xa(t);n.top+=u,n.bottom+=u}if(r=="line")return n;r||(r="local");var d=nr(t);if(r=="local"?d+=Bi(e.display):d-=e.display.viewOffset,r=="page"||r=="window"){var g=e.display.lineSpace.getBoundingClientRect();d+=g.top+(r=="window"?0:Fs(D(e)));var v=g.left+(r=="window"?0:As(D(e)));n.left+=v,n.right+=v}return n.top+=d,n.bottom+=d,n}function Ts(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=As(D(e)),i-=Fs(D(e));else if(n=="local"||!n){var u=e.display.sizer.getBoundingClientRect();r+=u.left,i+=u.top}var d=e.display.lineSpace.getBoundingClientRect();return{left:r-d.left,top:i-d.top}}function Oi(e,t,n,r,i){return r||(r=ie(e.doc,t.line)),Ni(e,r,ws(e,r,t.ch,i),n)}function Wt(e,t,n,r,i,u){r=r||ie(e.doc,t.line),i||(i=tn(e,r));function d(H,q){var Y=Jt(e,i,H,q?"right":"left",u);return q?Y.left=Y.right:Y.right=Y.left,Ni(e,r,Y,n)}var g=tr(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"),!g)return d(m=="before"?v-1:v,m=="before");function w(H,q,Y){var Z=g[q],$=Z.level==1;return d(Y?H-1:H,$!=Y)}var k=_n(g,v,m),B=Mn,M=w(v,k,m=="before");return B!=null&&(M.other=w(v,B,m!="before")),M}function Ls(e,t){var n=0;t=me(e.doc,t),e.options.lineWrapping||(n=nn(e.display)*t.ch);var r=ie(e.doc,t.line),i=nr(r)+Bi(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Da(e,t,n,r,i){var u=G(e,t,n);return u.xRel=i,r&&(u.outside=r),u}function wa(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Da(r.first,0,null,-1,-1);var i=_r(r,n),u=r.first+r.size-1;if(i>u)return Da(r.first+r.size-1,ie(r,u).text.length,null,1,1);t<0&&(t=0);for(var d=ie(r,i);;){var g=Fd(e,d,i,t,n),v=rd(d,g.ch+(g.xRel>0||g.outside>0?1:0));if(!v)return g;var m=v.find(1);if(m.line==i)return m;d=ie(r,i=m.line)}}function Ms(e,t,n,r){r-=xa(t);var i=t.text.length,u=Ln(function(d){return Jt(e,n,d-1).bottom<=r},i,0);return i=Ln(function(d){return Jt(e,n,d).top>r},u,i),{begin:u,end:i}}function _s(e,t,n,r){n||(n=tn(e,t));var i=Ni(e,t,Jt(e,n,r),"line").top;return Ms(e,t,n,i)}function Ca(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function Fd(e,t,n,r,i){i-=nr(t);var u=tn(e,t),d=xa(t),g=0,v=t.text.length,m=!0,w=tr(t,e.doc.direction);if(w){var k=(e.options.lineWrapping?Ld:Td)(e,t,n,u,w,r,i);m=k.level!=1,g=m?k.from:k.to-1,v=m?k.to:k.from-1}var B=null,M=null,H=Ln(function(le){var oe=Jt(e,u,le);return oe.top+=d,oe.bottom+=d,Ca(oe,r,i,!1)?(oe.top<=i&&oe.left<=r&&(B=le,M=oe),!0):!1},g,v),q,Y,Z=!1;if(M){var $=r-M.left<M.right-r,Q=$==m;H=B+(Q?0:1),Y=Q?"after":"before",q=$?M.left:M.right}else{!m&&(H==v||H==g)&&H++,Y=H==0?"after":H==t.text.length?"before":Jt(e,u,H-(m?1:0)).bottom+d<=i==m?"after":"before";var te=Wt(e,G(n,H,Y),"line",t,u);q=te.left,Z=i<te.top?-1:i>=te.bottom?1:0}return H=ql(t.text,H,1),Da(n,H,Y,Z,r-q)}function Td(e,t,n,r,i,u,d){var g=Ln(function(k){var B=i[k],M=B.level!=1;return Ca(Wt(e,G(n,M?B.to:B.from,M?"before":"after"),"line",t,r),u,d,!0)},0,i.length-1),v=i[g];if(g>0){var m=v.level!=1,w=Wt(e,G(n,m?v.from:v.to,m?"after":"before"),"line",t,r);Ca(w,u,d,!0)&&w.top>d&&(v=i[g-1])}return v}function Ld(e,t,n,r,i,u,d){var g=Ms(e,t,r,d),v=g.begin,m=g.end;/\s/.test(t.text.charAt(m-1))&&m--;for(var w=null,k=null,B=0;B<i.length;B++){var M=i[B];if(!(M.from>=m||M.to<=v)){var H=M.level!=1,q=Jt(e,r,H?Math.min(m,M.to)-1:Math.max(v,M.from)).right,Y=q<u?u-q+1e9:q-u;(!w||k>Y)&&(w=M,k=Y)}}return w||(w=i[i.length-1]),w.from<v&&(w={from:v,to:w.to,level:w.level}),w.to>m&&(w={from:w.from,to:m,level:w.level}),w}var Nr;function rn(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Nr==null){Nr=S("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Nr.appendChild(document.createTextNode("x")),Nr.appendChild(S("br"));Nr.appendChild(document.createTextNode("x"))}se(e.measure,Nr);var n=Nr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),ne(e.measure),n||1}function nn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=S("span","xxxxxxxxxx"),n=S("pre",[t],"CodeMirror-line-like");se(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function ka(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,u=t.gutters.firstChild,d=0;u;u=u.nextSibling,++d){var g=e.display.gutterSpecs[d].className;n[g]=u.offsetLeft+u.clientLeft+i,r[g]=u.clientWidth}return{fixedPos:Sa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Sa(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Bs(e){var t=rn(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/nn(e.display)-3);return function(i){if(vr(e.doc,i))return 0;var u=0;if(i.widgets)for(var d=0;d<i.widgets.length;d++)i.widgets[d].height&&(u+=i.widgets[d].height);return n?u+(Math.ceil(i.text.length/r)||1)*t:u+t}}function Ea(e){var t=e.doc,n=Bs(e);t.iter(function(r){var i=n(r);i!=r.height&&Yt(r,i)})}function Or(e,t,n,r){var i=e.display;if(!n&&Jo(t).getAttribute("cm-not-content")=="true")return null;var u,d,g=i.lineSpace.getBoundingClientRect();try{u=t.clientX-g.left,d=t.clientY-g.top}catch{return null}var v=wa(e,u,d),m;if(r&&v.xRel>0&&(m=ie(e.doc,v.line).text).length==v.ch){var w=Ke(m,m.length,e.options.tabSize)-m.length;v=G(v.line,Math.max(0,Math.round((u-xs(e.display).left)/nn(e.display))-w))}return v}function Ir(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function bt(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)rr&&ha(e.doc,t)<i.viewTo&&br(e);else if(n<=i.viewFrom)rr&&fs(e.doc,n+r)>i.viewFrom?br(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)br(e);else if(t<=i.viewFrom){var u=Ii(e,n,n+r,1);u?(i.view=i.view.slice(u.index),i.viewFrom=u.lineN,i.viewTo+=r):br(e)}else if(n>=i.viewTo){var d=Ii(e,t,t,-1);d?(i.view=i.view.slice(0,d.index),i.viewTo=d.lineN):br(e)}else{var g=Ii(e,t,t,-1),v=Ii(e,n,n+r,1);g&&v?(i.view=i.view.slice(0,g.index).concat(_i(e,g.lineN,v.lineN)).concat(i.view.slice(v.index)),i.viewTo+=r):br(e)}var m=i.externalMeasured;m&&(n<m.lineN?m.lineN+=r:t<m.lineN+m.size&&(i.externalMeasured=null))}function mr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var u=r.view[Ir(e,t)];if(u.node!=null){var d=u.changes||(u.changes=[]);Be(d,n)==-1&&d.push(n)}}}function br(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ii(e,t,n,r){var i=Ir(e,t),u,d=e.display.view;if(!rr||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var g=e.display.viewFrom,v=0;v<i;v++)g+=d[v].size;if(g!=t){if(r>0){if(i==d.length-1)return null;u=g+d[i].size-t,i++}else u=g-t;t+=u,n+=u}for(;ha(e.doc,n)!=n;){if(i==(r<0?0:d.length-1))return null;n+=r*d[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function Md(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=_i(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=_i(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Ir(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(_i(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Ir(e,n)))),r.viewTo=n}function Ns(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function Wn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Os(e,t){t===void 0&&(t=!0);var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),u=r.selection=document.createDocumentFragment(),d=e.options.$customCursor;d&&(t=!0);for(var g=0;g<n.sel.ranges.length;g++)if(!(!t&&g==n.sel.primIndex)){var v=n.sel.ranges[g];if(!(v.from().line>=e.display.viewTo||v.to().line<e.display.viewFrom)){var m=v.empty();if(d){var w=d(e,v);w&&Aa(e,w,i)}else(m||e.options.showCursorWhenSelecting)&&Aa(e,v.head,i);m||_d(e,v,u)}}return r}function Aa(e,t,n){var r=Wt(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(S("div","\xA0","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var u=Oi(e,t,"div",null,null),d=u.right-u.left;i.style.width=(d>0?d:e.defaultCharWidth())+"px"}if(r.other){var g=n.appendChild(S("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));g.style.display="",g.style.left=r.other.left+"px",g.style.top=r.other.top+"px",g.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Pi(e,t){return e.top-t.top||e.left-t.left}function _d(e,t,n){var r=e.display,i=e.doc,u=document.createDocumentFragment(),d=xs(e.display),g=d.left,v=Math.max(r.sizerWidth,Br(e)-r.sizer.offsetLeft)-d.right,m=i.direction=="ltr";function w(Q,te,le,oe){te<0&&(te=0),te=Math.round(te),oe=Math.round(oe),u.appendChild(S("div",null,"CodeMirror-selected","position: absolute; left: "+Q+`px;
top: `+te+"px; width: "+(le??v-Q)+`px;
height: `+(oe-te)+"px"))}function k(Q,te,le){var oe=ie(i,Q),xe=oe.text.length,Te,nt;function Ie(Ge,Dt){return Oi(e,G(Q,Ge),"div",oe,Dt)}function St(Ge,Dt,at){var Ze=_s(e,oe,null,Ge),Xe=Dt=="ltr"==(at=="after")?"left":"right",He=at=="after"?Ze.begin:Ze.end-(/\s/.test(oe.text.charAt(Ze.end-1))?2:1);return Ie(He,Xe)[Xe]}var xt=tr(oe,i.direction);return Oc(xt,te||0,le??xe,function(Ge,Dt,at,Ze){var Xe=at=="ltr",He=Ie(Ge,Xe?"left":"right"),wt=Ie(Dt-1,Xe?"right":"left"),mn=te==null&&Ge==0,kr=le==null&&Dt==xe,ut=Ze==0,$t=!xt||Ze==xt.length-1;if(wt.top-He.top<=3){var it=(m?mn:kr)&&ut,el=(m?kr:mn)&&$t,lr=it?g:(Xe?He:wt).left,Wr=el?v:(Xe?wt:He).right;w(lr,He.top,Wr-lr,He.bottom)}else{var qr,ht,bn,tl;Xe?(qr=m&&mn&&ut?g:He.left,ht=m?v:St(Ge,at,"before"),bn=m?g:St(Dt,at,"after"),tl=m&&kr&&$t?v:wt.right):(qr=m?St(Ge,at,"before"):g,ht=!m&&mn&&ut?v:He.right,bn=!m&&kr&&$t?g:wt.left,tl=m?St(Dt,at,"after"):v),w(qr,He.top,ht-qr,He.bottom),He.bottom<wt.top&&w(g,He.bottom,null,wt.top),w(bn,wt.top,tl-bn,wt.bottom)}(!Te||Pi(He,Te)<0)&&(Te=He),Pi(wt,Te)<0&&(Te=wt),(!nt||Pi(He,nt)<0)&&(nt=He),Pi(wt,nt)<0&&(nt=wt)}),{start:Te,end:nt}}var B=t.from(),M=t.to();if(B.line==M.line)k(B.line,B.ch,M.ch);else{var H=ie(i,B.line),q=ie(i,M.line),Y=Rt(H)==Rt(q),Z=k(B.line,B.ch,Y?H.text.length+1:null).end,$=k(M.line,Y?0:null,M.ch).start;Y&&(Z.top<$.top-2?(w(Z.right,Z.top,null,Z.bottom),w(g,$.top,$.left,$.bottom)):w(Z.right,Z.top,$.left-Z.right,Z.bottom)),Z.bottom<$.top&&w(g,Z.bottom,null,$.top)}n.appendChild(u)}function Fa(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||on(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Is(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||La(e))}function Ta(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&on(e))},100)}function La(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Ue(e,"focus",e,t),e.state.focused=!0,De(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()),Fa(e))}function on(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Ue(e,"blur",e,t),e.state.focused=!1,ae(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function zi(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,u=0,d=0;d<t.view.length;d++){var g=t.view[d],v=e.options.lineWrapping,m=void 0,w=0;if(!g.hidden){if(i+=g.line.height,c&&h<8){var k=g.node.offsetTop+g.node.offsetHeight;m=k-n,n=k}else{var B=g.node.getBoundingClientRect();m=B.bottom-B.top,!v&&g.text.firstChild&&(w=g.text.firstChild.getBoundingClientRect().right-B.left-1)}var M=g.line.height-m;if((M>.005||M<-.005)&&(i<r&&(u-=M),Yt(g.line,m),Ps(g.line),g.rest))for(var H=0;H<g.rest.length;H++)Ps(g.rest[H]);if(w>e.display.sizerWidth){var q=Math.ceil(w/nn(e.display));q>e.display.maxLineLength&&(e.display.maxLineLength=q,e.display.maxLine=g.line,e.display.maxLineChanged=!0)}}}Math.abs(u)>2&&(t.scroller.scrollTop+=u)}function Ps(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function Hi(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Bi(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,u=_r(t,r),d=_r(t,i);if(n&&n.ensure){var g=n.ensure.from.line,v=n.ensure.to.line;g<u?(u=g,d=_r(t,nr(ie(t,g))+e.wrapper.clientHeight)):Math.min(v,t.lastLine())>=d&&(u=_r(t,nr(ie(t,v))-e.wrapper.clientHeight),d=v)}return{from:u,to:Math.max(d,u+1)}}function Bd(e,t){if(!Ve(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,u=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(u.defaultView.innerHeight||u.documentElement.clientHeight)&&(i=!1),i!=null&&!L){var d=S("div","\u200B",null,`position: absolute;
top: `+(t.top-n.viewOffset-Bi(e.display))+`px;
height: `+(t.bottom-t.top+Qt(e)+n.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(d),d.scrollIntoView(i),e.display.lineSpace.removeChild(d)}}}function Nd(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?G(t.line,t.ch+1,"before"):t,t=t.ch?G(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var u=0;u<5;u++){var d=!1,g=Wt(e,t),v=!n||n==t?g:Wt(e,n);i={left:Math.min(g.left,v.left),top:Math.min(g.top,v.top)-r,right:Math.max(g.left,v.left),bottom:Math.max(g.bottom,v.bottom)+r};var m=Ma(e,i),w=e.doc.scrollTop,k=e.doc.scrollLeft;if(m.scrollTop!=null&&(Un(e,m.scrollTop),Math.abs(e.doc.scrollTop-w)>1&&(d=!0)),m.scrollLeft!=null&&(Pr(e,m.scrollLeft),Math.abs(e.doc.scrollLeft-k)>1&&(d=!0)),!d)break}return i}function Od(e,t){var n=Ma(e,t);n.scrollTop!=null&&Un(e,n.scrollTop),n.scrollLeft!=null&&Pr(e,n.scrollLeft)}function Ma(e,t){var n=e.display,r=rn(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,u=ba(e),d={};t.bottom-t.top>u&&(t.bottom=t.top+u);var g=e.doc.height+ma(n),v=t.top<r,m=t.bottom>g-r;if(t.top<i)d.scrollTop=v?0:t.top;else if(t.bottom>i+u){var w=Math.min(t.top,(m?g:t.bottom)-u);w!=i&&(d.scrollTop=w)}var k=e.options.fixedGutter?0:n.gutters.offsetWidth,B=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-k,M=Br(e)-n.gutters.offsetWidth,H=t.right-t.left>M;return H&&(t.right=t.left+M),t.left<10?d.scrollLeft=0:t.left<B?d.scrollLeft=Math.max(0,t.left+k-(H?0:10)):t.right>M+B-3&&(d.scrollLeft=t.right+(H?0:10)-M),d}function _a(e,t){t!=null&&(Ri(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function an(e){Ri(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function qn(e,t,n){(t!=null||n!=null)&&Ri(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Id(e,t){Ri(e),e.curOp.scrollToPos=t}function Ri(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Ls(e,t.from),r=Ls(e,t.to);zs(e,n,r,t.margin)}}function zs(e,t,n,r){var i=Ma(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});qn(e,i.scrollLeft,i.scrollTop)}function Un(e,t){Math.abs(e.doc.scrollTop-t)<2||(s||Na(e,{top:t}),Hs(e,t,!0),s&&Na(e),Xn(e,100))}function Hs(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Pr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,js(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function jn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+ma(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?n:0,docHeight:r,scrollHeight:r+Qt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var zr=function(e,t,n){this.cm=n;var r=this.vert=S("div",[S("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=S("div",[S("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),fe(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),fe(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,c&&h<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};zr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var u=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+u)+"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:n?r:0,bottom:t?r:0}},zr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},zr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},zr.prototype.zeroWidthHack=function(){var e=P&&!_?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new ct,this.disableVert=new ct},zr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),u=n=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);u!=e?e.style.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},zr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Gn=function(){};Gn.prototype.update=function(){return{bottom:0,right:0}},Gn.prototype.setScrollLeft=function(){},Gn.prototype.setScrollTop=function(){},Gn.prototype.clear=function(){};function ln(e,t){t||(t=jn(e));var n=e.display.barWidth,r=e.display.barHeight;Rs(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&zi(e),Rs(e,jn(e)),n=e.display.barWidth,r=e.display.barHeight}function Rs(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var Ws={native:zr,null:Gn};function qs(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ae(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ws[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),fe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Pr(e,t):Un(e,t)},e),e.display.scrollbars.addClass&&De(e.display.wrapper,e.display.scrollbars.addClass)}var Pd=0;function Hr(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:++Pd,markArrays:null},pd(e.curOp)}function Rr(e){var t=e.curOp;t&&vd(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;zd(n)})}function zd(e){for(var t=e.ops,n=0;n<t.length;n++)Hd(t[n]);for(var r=0;r<t.length;r++)Rd(t[r]);for(var i=0;i<t.length;i++)Wd(t[i]);for(var u=0;u<t.length;u++)qd(t[u]);for(var d=0;d<t.length;d++)Ud(t[d])}function Hd(e){var t=e.cm,n=t.display;Gd(t),e.updateMaxLine&&ga(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Wi(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Rd(e){e.updatedDisplay=e.mustUpdate&&Ba(e.cm,e.update)}function Wd(e){var t=e.cm,n=t.display;e.updatedDisplay&&zi(t),e.barMeasure=jn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ws(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Qt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Br(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function qd(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Pr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==ue(ee(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ln(t,e.barMeasure),e.updatedDisplay&&Ia(t,e.barMeasure),e.selectionChanged&&Fa(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&Is(e.cm)}function Ud(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&Us(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&Hs(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Pr(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Nd(t,me(r,e.scrollToPos.from),me(r,e.scrollToPos.to),e.scrollToPos.margin);Bd(t,i)}var u=e.maybeHiddenMarkers,d=e.maybeUnhiddenMarkers;if(u)for(var g=0;g<u.length;++g)u[g].lines.length||Ue(u[g],"hide");if(d)for(var v=0;v<d.length;++v)d[v].lines.length&&Ue(d[v],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Ue(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function kt(e,t){if(e.curOp)return t();Hr(e);try{return t()}finally{Rr(e)}}function tt(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Hr(e);try{return t.apply(e,arguments)}finally{Rr(e)}}}function dt(e){return function(){if(this.curOp)return e.apply(this,arguments);Hr(this);try{return e.apply(this,arguments)}finally{Rr(this)}}}function rt(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Hr(t);try{return e.apply(this,arguments)}finally{Rr(t)}}}function Xn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,$e(jd,e))}function jd(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=On(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(u){if(r.line>=e.display.viewFrom){var d=u.styles,g=u.text.length>e.options.maxHighlightLength?Lr(t.mode,r.state):null,v=Ql(e,u,r,!0);g&&(r.state=g),u.styles=v.styles;var m=u.styleClasses,w=v.classes;w?u.styleClasses=w:m&&(u.styleClasses=null);for(var k=!d||d.length!=u.styles.length||m!=w&&(!m||!w||m.bgClass!=w.bgClass||m.textClass!=w.textClass),B=0;!k&&B<d.length;++B)k=d[B]!=u.styles[B];k&&i.push(r.line),u.stateAfter=r.save(),r.nextLine()}else u.text.length<=e.options.maxHighlightLength&&ua(e,u.text,r),u.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return Xn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&kt(e,function(){for(var u=0;u<i.length;u++)mr(e,i[u],"text")})}}var Wi=function(e,t,n){var r=e.display;this.viewport=t,this.visible=Hi(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=Br(e),this.force=n,this.dims=ka(e),this.events=[]};Wi.prototype.signal=function(e,t){It(e,t)&&this.events.push(arguments)},Wi.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Ue.apply(null,this.events[e])};function Gd(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Qt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Qt(e)+"px",t.scrollbarsClipped=!0)}function Xd(e){if(e.hasFocus())return null;var t=ue(ee(e));if(!t||!K(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=he(e).getSelection();r.anchorNode&&r.extend&&K(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Kd(e){if(!(!e||!e.activeElt||e.activeElt==ue(we(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&K(document.body,e.anchorNode)&&K(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function Ba(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return br(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&Ns(e)==0)return!1;Gs(e)&&(br(e),t.dims=ka(e));var i=r.first+r.size,u=Math.max(t.visible.from-e.options.viewportMargin,r.first),d=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<u&&u-n.viewFrom<20&&(u=Math.max(r.first,n.viewFrom)),n.viewTo>d&&n.viewTo-d<20&&(d=Math.min(i,n.viewTo)),rr&&(u=ha(e.doc,u),d=fs(e.doc,d));var g=u!=n.viewFrom||d!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Md(e,u,d),n.viewOffset=nr(ie(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var v=Ns(e);if(!g&&v==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var m=Xd(e);return v>4&&(n.lineDiv.style.display="none"),Yd(e,n.updateLineNumbers,t.dims),v>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Kd(m),ne(n.cursorDiv),ne(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,g&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,Xn(e,400)),n.updateLineNumbers=null,!0}function Us(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Br(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+ma(e.display)-ba(e),n.top)}),t.visible=Hi(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Hi(e.display,e.doc,n));if(!Ba(e,t))break;zi(e);var i=jn(e);Wn(e),ln(e,i),Ia(e,i),t.force=!1}t.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Na(e,t){var n=new Wi(e,t);if(Ba(e,n)){zi(e),Us(e,n);var r=jn(e);Wn(e),ln(e,r),Ia(e,r),n.finish()}}function Yd(e,t,n){var r=e.display,i=e.options.lineNumbers,u=r.lineDiv,d=u.firstChild;function g(H){var q=H.nextSibling;return b&&P&&e.display.currentWheelTarget==H?H.style.display="none":H.parentNode.removeChild(H),q}for(var v=r.view,m=r.viewFrom,w=0;w<v.length;w++){var k=v[w];if(!k.hidden)if(!k.node||k.node.parentNode!=u){var B=Dd(e,k,m,n);u.insertBefore(B,d)}else{for(;d!=k.node;)d=g(d);var M=i&&t!=null&&t<=m&&k.lineNumber;k.changes&&(Be(k.changes,"gutter")>-1&&(M=!1),gs(e,k,m,n)),M&&(ne(k.lineNumber),k.lineNumber.appendChild(document.createTextNode(aa(e.options,m)))),d=k.node.nextSibling}m+=k.size}for(;d;)d=g(d)}function Oa(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",et(e,"gutterChanged",e)}function Ia(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+Qt(e)+"px"}function js(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Sa(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,u=r+"px",d=0;d<n.length;d++)if(!n[d].hidden){e.options.fixedGutter&&(n[d].gutter&&(n[d].gutter.style.left=u),n[d].gutterBackground&&(n[d].gutterBackground.style.left=u));var g=n[d].alignable;if(g)for(var v=0;v<g.length;v++)g[v].style.left=u}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function Gs(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=aa(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(S("div",[S("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),u=i.firstChild.offsetWidth,d=i.offsetWidth-u;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(u,r.lineGutter.offsetWidth-d)+1,r.lineNumWidth=r.lineNumInnerWidth+d,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",Oa(e.display),!0}return!1}function Pa(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var u=e[i],d=null;if(typeof u!="string"&&(d=u.style,u=u.className),u=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:u,style:d})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function Xs(e){var t=e.gutters,n=e.gutterSpecs;ne(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],u=i.className,d=i.style,g=t.appendChild(S("div",null,"CodeMirror-gutter "+u));d&&(g.style.cssText=d),u=="CodeMirror-linenumbers"&&(e.lineGutter=g,g.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",Oa(e)}function Kn(e){Xs(e.display),bt(e),js(e)}function Zd(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=S("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=S("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=R("div",null,"CodeMirror-code"),i.selectionDiv=S("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=S("div",null,"CodeMirror-cursors"),i.measure=S("div",null,"CodeMirror-measure"),i.lineMeasure=S("div",null,"CodeMirror-measure"),i.lineSpace=R("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var u=R("div",[i.lineSpace],"CodeMirror-lines");i.mover=S("div",[u],null,"position: relative"),i.sizer=S("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=S("div",null,null,"position: absolute; height: "+ze+"px; width: 1px;"),i.gutters=S("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=S("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=S("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),x&&C===105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),c&&h<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!b&&!(s&&N)&&(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,i.gutterSpecs=Pa(r.gutters,r.lineNumbers),Xs(i),n.init(i)}var qi=0,or=null;c?or=-.53:s?or=15:x?or=-.7:F&&(or=-1/3);function Ks(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function Qd(e){var t=Ks(e);return t.x*=or,t.y*=or,t}function Ys(e,t){x&&C==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 n=Ks(t),r=n.x,i=n.y,u=or;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,u=1);var d=e.display,g=d.scroller,v=g.scrollWidth>g.clientWidth,m=g.scrollHeight>g.clientHeight;if(r&&v||i&&m){if(i&&P&&b){e:for(var w=t.target,k=d.view;w!=g;w=w.parentNode)for(var B=0;B<k.length;B++)if(k[B].node==w){e.display.currentWheelTarget=w;break e}}if(r&&!s&&!E&&u!=null){i&&m&&Un(e,Math.max(0,g.scrollTop+i*u)),Pr(e,Math.max(0,g.scrollLeft+r*u)),(!i||i&&m)&&mt(t),d.wheelStartX=null;return}if(i&&u!=null){var M=i*u,H=e.doc.scrollTop,q=H+d.wrapper.clientHeight;M<0?H=Math.max(0,H+M-50):q=Math.min(e.doc.height,q+M+50),Na(e,{top:H,bottom:q})}qi<20&&t.deltaMode!==0&&(d.wheelStartX==null?(d.wheelStartX=g.scrollLeft,d.wheelStartY=g.scrollTop,d.wheelDX=r,d.wheelDY=i,setTimeout(function(){if(d.wheelStartX!=null){var Y=g.scrollLeft-d.wheelStartX,Z=g.scrollTop-d.wheelStartY,$=Z&&d.wheelDY&&Z/d.wheelDY||Y&&d.wheelDX&&Y/d.wheelDX;d.wheelStartX=d.wheelStartY=null,$&&(or=(or*qi+$)/(qi+1),++qi)}},200)):(d.wheelDX+=r,d.wheelDY+=i))}}var Mt=function(e,t){this.ranges=e,this.primIndex=t};Mt.prototype.primary=function(){return this.ranges[this.primIndex]},Mt.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 n=this.ranges[t],r=e.ranges[t];if(!la(n.anchor,r.anchor)||!la(n.head,r.head))return!1}return!0},Mt.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ee(sa(this.ranges[t].anchor),sa(this.ranges[t].head));return new Mt(e,this.primIndex)},Mt.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Mt.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ve(t,r.from())>=0&&ve(e,r.to())<=0)return n}return-1};var Ee=function(e,t){this.anchor=e,this.head=t};Ee.prototype.from=function(){return Si(this.anchor,this.head)},Ee.prototype.to=function(){return ki(this.anchor,this.head)},Ee.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function qt(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(B,M){return ve(B.from(),M.from())}),n=Be(t,i);for(var u=1;u<t.length;u++){var d=t[u],g=t[u-1],v=ve(g.to(),d.from());if(r&&!d.empty()?v>0:v>=0){var m=Si(g.from(),d.from()),w=ki(g.to(),d.to()),k=g.empty()?d.from()==d.head:g.from()==g.head;u<=n&&--n,t.splice(--u,2,new Ee(k?w:m,k?m:w))}}return new Mt(t,n)}function yr(e,t){return new Mt([new Ee(e,t||e)],0)}function xr(e){return e.text?G(e.from.line+e.text.length-1,Ce(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Zs(e,t){if(ve(e,t.from)<0)return e;if(ve(e,t.to)<=0)return xr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=xr(t).ch-t.to.ch),G(n,r)}function za(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Ee(Zs(i.anchor,t),Zs(i.head,t)))}return qt(e.cm,n,e.sel.primIndex)}function Qs(e,t,n){return e.line==t.line?G(n.line,e.ch-t.ch+n.ch):G(n.line+(e.line-t.line),e.ch)}function Jd(e,t,n){for(var r=[],i=G(e.first,0),u=i,d=0;d<t.length;d++){var g=t[d],v=Qs(g.from,i,u),m=Qs(xr(g),i,u);if(i=g.to,u=m,n=="around"){var w=e.sel.ranges[d],k=ve(w.head,w.anchor)<0;r[d]=new Ee(k?m:v,k?v:m)}else r[d]=new Ee(v,v)}return new Mt(r,e.sel.primIndex)}function Ha(e){e.doc.mode=na(e.options,e.doc.modeOption),Yn(e)}function Yn(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,Xn(e,100),e.state.modeGen++,e.curOp&&bt(e)}function Js(e,t){return t.from.ch==0&&t.to.ch==0&&Ce(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ra(e,t,n,r){function i($){return n?n[$]:null}function u($,Q,te){od($,Q,te,r),et($,"change",$,t)}function d($,Q){for(var te=[],le=$;le<Q;++le)te.push(new Vr(m[le],i(le),r));return te}var g=t.from,v=t.to,m=t.text,w=ie(e,g.line),k=ie(e,v.line),B=Ce(m),M=i(m.length-1),H=v.line-g.line;if(t.full)e.insert(0,d(0,m.length)),e.remove(m.length,e.size-m.length);else if(Js(e,t)){var q=d(0,m.length-1);u(k,k.text,M),H&&e.remove(g.line,H),q.length&&e.insert(g.line,q)}else if(w==k)if(m.length==1)u(w,w.text.slice(0,g.ch)+B+w.text.slice(v.ch),M);else{var Y=d(1,m.length-1);Y.push(new Vr(B+w.text.slice(v.ch),M,r)),u(w,w.text.slice(0,g.ch)+m[0],i(0)),e.insert(g.line+1,Y)}else if(m.length==1)u(w,w.text.slice(0,g.ch)+m[0]+k.text.slice(v.ch),i(0)),e.remove(g.line+1,H);else{u(w,w.text.slice(0,g.ch)+m[0],i(0)),u(k,B+k.text.slice(v.ch),M);var Z=d(1,m.length-1);H>1&&e.remove(g.line+1,H-1),e.insert(g.line+1,Z)}et(e,"change",e,t)}function Dr(e,t,n){function r(i,u,d){if(i.linked)for(var g=0;g<i.linked.length;++g){var v=i.linked[g];if(v.doc!=u){var m=d&&v.sharedHist;n&&!m||(t(v.doc,m),r(v.doc,i,m))}}}r(e,null,!0)}function $s(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ea(e),Ha(e),Vs(e),e.options.direction=t.direction,e.options.lineWrapping||ga(e),e.options.mode=t.modeOption,bt(e)}function Vs(e){(e.doc.direction=="rtl"?De:ae)(e.display.lineDiv,"CodeMirror-rtl")}function $d(e){kt(e,function(){Vs(e),bt(e)})}function Ui(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 Wa(e,t){var n={from:sa(t.from),to:xr(t),text:Mr(e,t.from,t.to)};return ru(e,n,t.from.line,t.to.line+1),Dr(e,function(r){return ru(r,n,t.from.line,t.to.line+1)},!0),n}function eu(e){for(;e.length;){var t=Ce(e);if(t.ranges)e.pop();else break}}function Vd(e,t){if(t)return eu(e.done),Ce(e.done);if(e.done.length&&!Ce(e.done).ranges)return Ce(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ce(e.done)}function tu(e,t,n,r){var i=e.history;i.undone.length=0;var u=+new Date,d,g;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>u-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(d=Vd(i,i.lastOp==r)))g=Ce(d.changes),ve(t.from,t.to)==0&&ve(t.from,g.to)==0?g.to=xr(t):d.changes.push(Wa(e,t));else{var v=Ce(i.done);for((!v||!v.ranges)&&ji(e.sel,i.done),d={changes:[Wa(e,t)],generation:i.generation},i.done.push(d);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=u,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,g||Ue(e,"historyAdded")}function eh(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function th(e,t,n,r){var i=e.history,u=r&&r.origin;n==i.lastSelOp||u&&i.lastSelOrigin==u&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==u||eh(e,u,Ce(i.done),t))?i.done[i.done.length-1]=t:ji(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=u,i.lastSelOp=n,r&&r.clearRedo!==!1&&eu(i.undone)}function ji(e,t){var n=Ce(t);n&&n.ranges&&n.equals(e)||t.push(e)}function ru(e,t,n,r){var i=t["spans_"+e.id],u=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(d){d.markedSpans&&((i||(i=t["spans_"+e.id]={}))[u]=d.markedSpans),++u})}function rh(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function nh(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(rh(n[i]));return r}function nu(e,t){var n=nh(e,t),r=ca(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var u=n[i],d=r[i];if(u&&d)e:for(var g=0;g<d.length;++g){for(var v=d[g],m=0;m<u.length;++m)if(u[m].marker==v.marker)continue e;u.push(v)}else d&&(n[i]=d)}return n}function sn(e,t,n){for(var r=[],i=0;i<e.length;++i){var u=e[i];if(u.ranges){r.push(n?Mt.prototype.deepCopy.call(u):u);continue}var d=u.changes,g=[];r.push({changes:g});for(var v=0;v<d.length;++v){var m=d[v],w=void 0;if(g.push({from:m.from,to:m.to,text:m.text}),t)for(var k in m)(w=k.match(/^spans_(\d+)$/))&&Be(t,Number(w[1]))>-1&&(Ce(g)[k]=m[k],delete m[k])}}return r}function qa(e,t,n,r){if(r){var i=e.anchor;if(n){var u=ve(t,i)<0;u!=ve(n,i)<0?(i=t,t=n):u!=ve(t,n)<0&&(t=n)}return new Ee(i,t)}else return new Ee(n||t,t)}function Gi(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),st(e,new Mt([qa(e.sel.primary(),t,n,i)],0),r)}function iu(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),u=0;u<e.sel.ranges.length;u++)r[u]=qa(e.sel.ranges[u],t[u],null,i);var d=qt(e.cm,r,e.sel.primIndex);st(e,d,n)}function Ua(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,st(e,qt(e.cm,i,e.sel.primIndex),r)}function ou(e,t,n,r){st(e,yr(t,n),r)}function ih(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var u=0;u<i.length;u++)this.ranges[u]=new Ee(me(e,i[u].anchor),me(e,i[u].head))},origin:n&&n.origin};return Ue(e,"beforeSelectionChange",e,r),e.cm&&Ue(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?qt(e.cm,r.ranges,r.ranges.length-1):t}function au(e,t,n){var r=e.history.done,i=Ce(r);i&&i.ranges?(r[r.length-1]=t,Xi(e,t,n)):st(e,t,n)}function st(e,t,n){Xi(e,t,n),th(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function Xi(e,t,n){(It(e,"beforeSelectionChange")||e.cm&&It(e.cm,"beforeSelectionChange"))&&(t=ih(e,t,n));var r=n&&n.bias||(ve(t.primary().head,e.sel.primary().head)<0?-1:1);lu(e,uu(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&an(e.cm)}function lu(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,jl(e.cm)),et(e,"cursorActivity",e))}function su(e){lu(e,uu(e,e.sel,null,!1))}function uu(e,t,n,r){for(var i,u=0;u<t.ranges.length;u++){var d=t.ranges[u],g=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[u],v=Ki(e,d.anchor,g&&g.anchor,n,r),m=d.head==d.anchor?v:Ki(e,d.head,g&&g.head,n,r);(i||v!=d.anchor||m!=d.head)&&(i||(i=t.ranges.slice(0,u)),i[u]=new Ee(v,m))}return i?qt(e.cm,i,t.primIndex):t}function un(e,t,n,r,i){var u=ie(e,t.line);if(u.markedSpans)for(var d=0;d<u.markedSpans.length;++d){var g=u.markedSpans[d],v=g.marker,m="selectLeft"in v?!v.selectLeft:v.inclusiveLeft,w="selectRight"in v?!v.selectRight:v.inclusiveRight;if((g.from==null||(m?g.from<=t.ch:g.from<t.ch))&&(g.to==null||(w?g.to>=t.ch:g.to>t.ch))){if(i&&(Ue(v,"beforeCursorEnter"),v.explicitlyCleared))if(u.markedSpans){--d;continue}else break;if(!v.atomic)continue;if(n){var k=v.find(r<0?1:-1),B=void 0;if((r<0?w:m)&&(k=fu(e,k,-r,k&&k.line==t.line?u:null)),k&&k.line==t.line&&(B=ve(k,n))&&(r<0?B<0:B>0))return un(e,k,t,r,i)}var M=v.find(r<0?-1:1);return(r<0?m:w)&&(M=fu(e,M,r,M.line==t.line?u:null)),M?un(e,M,t,r,i):null}}return t}function Ki(e,t,n,r,i){var u=r||1,d=un(e,t,n,u,i)||!i&&un(e,t,n,u,!0)||un(e,t,n,-u,i)||!i&&un(e,t,n,-u,!0);return d||(e.cantEdit=!0,G(e.first,0))}function fu(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?me(e,G(t.line-1)):null:n>0&&t.ch==(r||ie(e,t.line)).text.length?t.line<e.first+e.size-1?G(t.line+1,0):null:new G(t.line,t.ch+n)}function cu(e){e.setSelection(G(e.firstLine(),0),G(e.lastLine()),vt)}function du(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,u,d,g){i&&(r.from=me(e,i)),u&&(r.to=me(e,u)),d&&(r.text=d),g!==void 0&&(r.origin=g)}),Ue(e,"beforeChange",e,r),e.cm&&Ue(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 fn(e,t,n){if(e.cm){if(!e.cm.curOp)return tt(e.cm,fn)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((It(e,"beforeChange")||e.cm&&It(e.cm,"beforeChange"))&&(t=du(e,t,!0),!t))){var r=ns&&!n&&td(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)hu(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else hu(e,t)}}function hu(e,t){if(!(t.text.length==1&&t.text[0]==""&&ve(t.from,t.to)==0)){var n=za(e,t);tu(e,t,n,e.cm?e.cm.curOp.id:NaN),Zn(e,t,n,ca(e,t));var r=[];Dr(e,function(i,u){!u&&Be(r,i.history)==-1&&(mu(i.history,t),r.push(i.history)),Zn(i,t,null,ca(i,t))})}}function Yi(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,u,d=e.sel,g=t=="undo"?i.done:i.undone,v=t=="undo"?i.undone:i.done,m=0;m<g.length&&(u=g[m],!(n?u.ranges&&!u.equals(e.sel):!u.ranges));m++);if(m!=g.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(u=g.pop(),u.ranges){if(ji(u,v),n&&!u.equals(e.sel)){st(e,u,{clearRedo:!1});return}d=u}else if(r){g.push(u);return}else break;var w=[];ji(d,v),v.push({changes:w,generation:i.generation}),i.generation=u.generation||++i.maxGeneration;for(var k=It(e,"beforeChange")||e.cm&&It(e.cm,"beforeChange"),B=function(q){var Y=u.changes[q];if(Y.origin=t,k&&!du(e,Y,!1))return g.length=0,{};w.push(Wa(e,Y));var Z=q?za(e,Y):Ce(g);Zn(e,Y,Z,nu(e,Y)),!q&&e.cm&&e.cm.scrollIntoView({from:Y.from,to:xr(Y)});var $=[];Dr(e,function(Q,te){!te&&Be($,Q.history)==-1&&(mu(Q.history,Y),$.push(Q.history)),Zn(Q,Y,null,nu(Q,Y))})},M=u.changes.length-1;M>=0;--M){var H=B(M);if(H)return H.v}}}}function pu(e,t){if(t!=0&&(e.first+=t,e.sel=new Mt(Ht(e.sel.ranges,function(i){return new Ee(G(i.anchor.line+t,i.anchor.ch),G(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){bt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)mr(e.cm,r,"gutter")}}function Zn(e,t,n,r){if(e.cm&&!e.cm.curOp)return tt(e.cm,Zn)(e,t,n,r);if(t.to.line<e.first){pu(e,t.text.length-1-(t.to.line-t.from.line));return}if(!(t.from.line>e.lastLine())){if(t.from.line<e.first){var i=t.text.length-1-(e.first-t.from.line);pu(e,i),t={from:G(e.first,0),to:G(t.to.line+i,t.to.ch),text:[Ce(t.text)],origin:t.origin}}var u=e.lastLine();t.to.line>u&&(t={from:t.from,to:G(u,ie(e,u).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Mr(e,t.from,t.to),n||(n=za(e,t)),e.cm?oh(e.cm,t,r):Ra(e,t,r),Xi(e,n,vt),e.cantEdit&&Ki(e,G(e.firstLine(),0))&&(e.cantEdit=!1)}}function oh(e,t,n){var r=e.doc,i=e.display,u=t.from,d=t.to,g=!1,v=u.line;e.options.lineWrapping||(v=Ae(Rt(ie(r,u.line))),r.iter(v,d.line+1,function(M){if(M==i.maxLine)return g=!0,!0})),r.sel.contains(t.from,t.to)>-1&&jl(e),Ra(r,t,n,Bs(e)),e.options.lineWrapping||(r.iter(v,u.line+t.text.length,function(M){var H=Mi(M);H>i.maxLineLength&&(i.maxLine=M,i.maxLineLength=H,i.maxLineChanged=!0,g=!1)}),g&&(e.curOp.updateMaxLine=!0)),Yc(r,u.line),Xn(e,400);var m=t.text.length-(d.line-u.line)-1;t.full?bt(e):u.line==d.line&&t.text.length==1&&!Js(e.doc,t)?mr(e,u.line,"text"):bt(e,u.line,d.line+1,m);var w=It(e,"changes"),k=It(e,"change");if(k||w){var B={from:u,to:d,text:t.text,removed:t.removed,origin:t.origin};k&&et(e,"change",e,B),w&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(B)}e.display.selForContextMenu=null}function cn(e,t,n,r,i){var u;r||(r=n),ve(r,n)<0&&(u=[r,n],n=u[0],r=u[1]),typeof t=="string"&&(t=e.splitLines(t)),fn(e,{from:n,to:r,text:t,origin:i})}function gu(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function vu(e,t,n,r){for(var i=0;i<e.length;++i){var u=e[i],d=!0;if(u.ranges){u.copied||(u=e[i]=u.deepCopy(),u.copied=!0);for(var g=0;g<u.ranges.length;g++)gu(u.ranges[g].anchor,t,n,r),gu(u.ranges[g].head,t,n,r);continue}for(var v=0;v<u.changes.length;++v){var m=u.changes[v];if(n<m.from.line)m.from=G(m.from.line+r,m.from.ch),m.to=G(m.to.line+r,m.to.ch);else if(t<=m.to.line){d=!1;break}}d||(e.splice(0,i+1),i=0)}}function mu(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;vu(e.done,n,r,i),vu(e.undone,n,r,i)}function Qn(e,t,n,r){var i=t,u=t;return typeof t=="number"?u=ie(e,Yl(e,t)):i=Ae(t),i==null?null:(r(u,i)&&e.cm&&mr(e.cm,i,n),u)}function Jn(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}Jn.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,ad(i),et(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,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,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function $n(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}$n.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var u=Math.min(t,i-e),d=r.height;if(r.removeInner(e,u),this.height-=d-r.height,i==u&&(this.children.splice(n--,1),r.parent=null),(t-=u)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Jn))){var g=[];this.collapse(g),this.children=[new Jn(g)],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,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],u=i.chunkSize();if(e<=u){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var d=i.lines.length%25+25,g=d;g<i.lines.length;){var v=new Jn(i.lines.slice(g,g+=25));i.height-=v.height,this.children.splice(++r,0,v),v.parent=this}i.lines=i.lines.slice(0,d),this.maybeSpill()}break}e-=u}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new $n(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=Be(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new $n(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],u=i.chunkSize();if(e<u){var d=Math.min(t,u-e);if(i.iterN(e,d,n))return!0;if((t-=d)==0)break;e=0}else e-=u}}};var Vn=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};Vn.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=Ae(n);if(!(r==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var u=Hn(this);Yt(n,Math.max(0,n.height-u)),e&&(kt(e,function(){bu(e,n,-u),mr(e,r,"widget")}),et(e,"lineWidgetCleared",e,this,r))}},Vn.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=Hn(this)-t;i&&(vr(this.doc,r)||Yt(r,r.height+i),n&&kt(n,function(){n.curOp.forceUpdate=!0,bu(n,r,i),et(n,"lineWidgetChanged",n,e,Ae(r))}))},Qr(Vn);function bu(e,t,n){nr(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&_a(e,n)}function ah(e,t,n,r){var i=new Vn(e,n,r),u=e.cm;return u&&i.noHScroll&&(u.display.alignWidgets=!0),Qn(e,t,"widget",function(d){var g=d.widgets||(d.widgets=[]);if(i.insertAt==null?g.push(i):g.splice(Math.min(g.length,Math.max(0,i.insertAt)),0,i),i.line=d,u&&!vr(e,d)){var v=nr(d)<e.scrollTop;Yt(d,d.height+Hn(i)),v&&_a(u,i.height),u.curOp.forceUpdate=!0}return!0}),u&&et(u,"lineWidgetAdded",u,i,typeof t=="number"?t:Ae(t)),i}var yu=0,wr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++yu};wr.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Hr(e),It(this,"clear")){var n=this.find();n&&et(this,"clear",n.from,n.to)}for(var r=null,i=null,u=0;u<this.lines.length;++u){var d=this.lines[u],g=In(d.markedSpans,this);e&&!this.collapsed?mr(e,Ae(d),"text"):e&&(g.to!=null&&(i=Ae(d)),g.from!=null&&(r=Ae(d))),d.markedSpans=Jc(d.markedSpans,g),g.from==null&&this.collapsed&&!vr(this.doc,d)&&e&&Yt(d,rn(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var v=0;v<this.lines.length;++v){var m=Rt(this.lines[v]),w=Mi(m);w>e.display.maxLineLength&&(e.display.maxLine=m,e.display.maxLineLength=w,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&bt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&su(e.doc)),e&&et(e,"markerCleared",e,this,r,i),t&&Rr(e),this.parent&&this.parent.clear()}},wr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var u=this.lines[i],d=In(u.markedSpans,this);if(d.from!=null&&(n=G(t?u:Ae(u),d.from),e==-1))return n;if(d.to!=null&&(r=G(t?u:Ae(u),d.to),e==1))return r}return n&&{from:n,to:r}},wr.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||kt(r,function(){var i=t.line,u=Ae(t.line),d=ya(r,u);if(d&&(Ss(d),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!vr(n.doc,i)&&n.height!=null){var g=n.height;n.height=null;var v=Hn(n)-g;v&&Yt(i,i.height+v)}et(r,"markerChanged",r,e)})},wr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Be(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},wr.prototype.detachLine=function(e){if(this.lines.splice(Be(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Qr(wr);function dn(e,t,n,r,i){if(r&&r.shared)return lh(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return tt(e.cm,dn)(e,t,n,r,i);var u=new wr(e,i),d=ve(t,n);if(r&&Tt(r,u,!1),d>0||d==0&&u.clearWhenEmpty!==!1)return u;if(u.replacedWith&&(u.collapsed=!0,u.widgetNode=R("span",[u.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||u.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(u.widgetNode.insertLeft=!0)),u.collapsed){if(us(e,t.line,t,n,u)||t.line!=n.line&&us(e,n.line,t,n,u))throw new Error("Inserting collapsed marker partially overlapping an existing one");Qc()}u.addToHistory&&tu(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var g=t.line,v=e.cm,m;if(e.iter(g,n.line+1,function(k){v&&u.collapsed&&!v.options.lineWrapping&&Rt(k)==v.display.maxLine&&(m=!0),u.collapsed&&g!=t.line&&Yt(k,0),$c(k,new Ai(u,g==t.line?t.ch:null,g==n.line?n.ch:null),e.cm&&e.cm.curOp),++g}),u.collapsed&&e.iter(t.line,n.line+1,function(k){vr(e,k)&&Yt(k,0)}),u.clearOnEnter&&fe(u,"beforeCursorEnter",function(){return u.clear()}),u.readOnly&&(Zc(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),u.collapsed&&(u.id=++yu,u.atomic=!0),v){if(m&&(v.curOp.updateMaxLine=!0),u.collapsed)bt(v,t.line,n.line+1);else if(u.className||u.startStyle||u.endStyle||u.css||u.attributes||u.title)for(var w=t.line;w<=n.line;w++)mr(v,w,"text");u.atomic&&su(v.doc),et(v,"markerAdded",v,u)}return u}var ei=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};ei.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();et(this,"clear")}},ei.prototype.find=function(e,t){return this.primary.find(e,t)},Qr(ei);function lh(e,t,n,r,i){r=Tt(r),r.shared=!1;var u=[dn(e,t,n,r,i)],d=u[0],g=r.widgetNode;return Dr(e,function(v){g&&(r.widgetNode=g.cloneNode(!0)),u.push(dn(v,me(v,t),me(v,n),r,i));for(var m=0;m<v.linked.length;++m)if(v.linked[m].isParent)return;d=Ce(u)}),new ei(u,d)}function xu(e){return e.findMarks(G(e.first,0),e.clipPos(G(e.lastLine())),function(t){return t.parent})}function sh(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),u=e.clipPos(i.from),d=e.clipPos(i.to);if(ve(u,d)){var g=dn(e,u,d,r.primary,r.primary.type);r.markers.push(g),g.parent=r}}}function uh(e){for(var t=function(r){var i=e[r],u=[i.primary.doc];Dr(i.primary.doc,function(v){return u.push(v)});for(var d=0;d<i.markers.length;d++){var g=i.markers[d];Be(u,g.doc)==-1&&(g.parent=null,i.markers.splice(d--,1))}},n=0;n<e.length;n++)t(n)}var fh=0,yt=function(e,t,n,r,i){if(!(this instanceof yt))return new yt(e,t,n,r,i);n==null&&(n=0),$n.call(this,[new Jn([new Vr("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var u=G(n,0);this.sel=yr(u),this.history=new Ui(null),this.id=++fh,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Ra(this,{from:u,to:u,text:e}),st(this,yr(u),vt)};yt.prototype=Rl($n.prototype,{constructor:yt,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=oa(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:rt(function(e){var t=G(this.first,0),n=this.first+this.size-1;fn(this,{from:t,to:G(n,ie(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&qn(this.cm,0,0),st(this,yr(t),vt)}),replaceRange:function(e,t,n,r){t=me(this,t),n=n?me(this,n):t,cn(this,e,t,n,r)},getRange:function(e,t,n){var r=Mr(this,me(this,e),me(this,t));return n===!1?r:n===""?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Nn(this,e))return ie(this,e)},getLineNumber:function(e){return Ae(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ie(this,e)),Rt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return me(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:rt(function(e,t,n){ou(this,me(this,typeof e=="number"?G(e,t||0):e),null,n)}),setSelection:rt(function(e,t,n){ou(this,me(this,e),me(this,t||e),n)}),extendSelection:rt(function(e,t,n){Gi(this,me(this,e),t&&me(this,t),n)}),extendSelections:rt(function(e,t){iu(this,Zl(this,e),t)}),extendSelectionsBy:rt(function(e,t){var n=Ht(this.sel.ranges,e);iu(this,Zl(this,n),t)}),setSelections:rt(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Ee(me(this,e[i].anchor),me(this,e[i].head||e[i].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),st(this,qt(this.cm,r,t),n)}}),addSelection:rt(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Ee(me(this,e),me(this,t||e))),st(this,qt(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=Mr(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Mr(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:rt(function(e,t,n){for(var r=[],i=this.sel,u=0;u<i.ranges.length;u++){var d=i.ranges[u];r[u]={from:d.from(),to:d.to(),text:this.splitLines(e[u]),origin:n}}for(var g=t&&t!="end"&&Jd(this,r,t),v=r.length-1;v>=0;v--)fn(this,r[v]);g?au(this,g):this.cm&&an(this.cm)}),undo:rt(function(){Yi(this,"undo")}),redo:rt(function(){Yi(this,"redo")}),undoSelection:rt(function(){Yi(this,"undo",!0)}),redoSelection:rt(function(){Yi(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new Ui(this.history),Dr(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:sn(this.history.done),undone:sn(this.history.undone)}},setHistory:function(e){var t=this.history=new Ui(this.history);t.done=sn(e.done.slice(0),null,!0),t.undone=sn(e.undone.slice(0),null,!0)},setGutterMarker:rt(function(e,t,n){return Qn(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&Wl(i)&&(r.gutterMarkers=null),!0})}),clearGutter:rt(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&Qn(t,n,"gutter",function(){return n.gutterMarkers[e]=null,Wl(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Nn(this,e)||(t=e,e=ie(this,e),!e))return null}else if(t=Ae(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:rt(function(e,t,n){return Qn(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(U(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:rt(function(e,t,n){return Qn(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",u=r[i];if(u)if(n==null)r[i]=null;else{var d=u.match(U(n));if(!d)return!1;var g=d.index+d[0].length;r[i]=u.slice(0,d.index)+(!d.index||g==u.length?"":" ")+u.slice(g)||null}else return!1;return!0})}),addLineWidget:rt(function(e,t,n){return ah(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return dn(this,me(this,e),me(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=me(this,e),dn(this,e,e,n,"bookmark")},findMarksAt:function(e){e=me(this,e);var t=[],n=ie(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=me(this,e),t=me(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(u){var d=u.markedSpans;if(d)for(var g=0;g<d.length;g++){var v=d[g];!(v.to!=null&&i==e.line&&e.ch>=v.to||v.from==null&&i!=e.line||v.from!=null&&i==t.line&&v.from>=t.ch)&&(!n||n(v.marker))&&r.push(v.marker.parent||v.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var u=i.text.length+r;if(u>e)return t=e,!0;e-=u,++n}),me(this,G(n,t))},indexFromPos:function(e){e=me(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new yt(oa(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,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new yt(oa(this,t,n),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}],sh(r,xu(this)),r},unlinkDoc:function(e){if(e instanceof Ne&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),uh(xu(this));break}}if(e.history==this.history){var r=[e.id];Dr(e,function(i){return r.push(i.id)},!0),e.history=new Ui(null),e.history.done=sn(this.history.done,r),e.history.undone=sn(this.history.undone,r)}},iterLinkedDocs:function(e){Dr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):ea(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:rt(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&$d(this.cm))})}),yt.prototype.eachLine=yt.prototype.iter;var Du=0;function ch(e){var t=this;if(wu(t),!(Ve(t,e)||ir(t.display,e))){mt(e),c&&(Du=+new Date);var n=Or(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,u=Array(i),d=0,g=function(){++d==i&&tt(t,function(){n=me(t.doc,n);var M={from:n,to:n,text:t.doc.splitLines(u.filter(function(H){return H!=null}).join(t.doc.lineSeparator())),origin:"paste"};fn(t.doc,M),au(t.doc,yr(me(t.doc,n),me(t.doc,xr(M))))})()},v=function(M,H){if(t.options.allowDropFileTypes&&Be(t.options.allowDropFileTypes,M.type)==-1){g();return}var q=new FileReader;q.onerror=function(){return g()},q.onload=function(){var Y=q.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Y)){g();return}u[H]=Y,g()},q.readAsText(M)},m=0;m<r.length;m++)v(r[m],m);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var w=e.dataTransfer.getData("Text");if(w){var k;if(t.state.draggingText&&!t.state.draggingText.copy&&(k=t.listSelections()),Xi(t.doc,yr(n,n)),k)for(var B=0;B<k.length;++B)cn(t.doc,"",k[B].anchor,k[B].head,"drag");t.replaceSelection(w,"around","paste"),t.display.input.focus()}}catch{}}}}function dh(e,t){if(c&&(!e.state.draggingText||+new Date-Du<100)){Bn(t);return}if(!(Ve(e,t)||ir(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!F)){var n=S("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",E&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),E&&n.parentNode.removeChild(n)}}function hh(e,t){var n=Or(e,t);if(n){var r=document.createDocumentFragment();Aa(e,n,r),e.display.dragCursor||(e.display.dragCursor=S("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),se(e.display.dragCursor,r)}}function wu(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Cu(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var u=0;u<n.length;u++)e(n[u])})}}var ku=!1;function ph(){ku||(gh(),ku=!0)}function gh(){var e;fe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Cu(vh)},100))}),fe(window,"blur",function(){return Cu(on)})}function vh(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var Cr={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"},ti=0;ti<10;ti++)Cr[ti+48]=Cr[ti+96]=String(ti);for(var Zi=65;Zi<=90;Zi++)Cr[Zi]=String.fromCharCode(Zi);for(var ri=1;ri<=12;ri++)Cr[ri+111]=Cr[ri+63235]="F"+ri;var ar={};ar.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"},ar.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"},ar.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"},ar.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"]},ar.default=P?ar.macDefault:ar.pcDefault;function mh(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,u,d=0;d<t.length-1;d++){var g=t[d];if(/^(cmd|meta|m)$/i.test(g))u=!0;else if(/^a(lt)?$/i.test(g))n=!0;else if(/^(c|ctrl|control)$/i.test(g))r=!0;else if(/^s(hift)?$/i.test(g))i=!0;else throw new Error("Unrecognized modifier name: "+g)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),u&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function bh(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=Ht(n.split(" "),mh),u=0;u<i.length;u++){var d=void 0,g=void 0;u==i.length-1?(g=i.join(" "),d=r):(g=i.slice(0,u+1).join(" "),d="...");var v=t[g];if(!v)t[g]=d;else if(v!=d)throw new Error("Inconsistent bindings for "+g)}delete e[n]}for(var m in t)e[m]=t[m];return e}function hn(e,t,n,r){t=Qi(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return hn(e,t.fallthrough,n,r);for(var u=0;u<t.fallthrough.length;u++){var d=hn(e,t.fallthrough[u],n,r);if(d)return d}}}function Su(e){var t=typeof e=="string"?e:Cr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Eu(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(X?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(X?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function Au(e,t){if(E&&e.keyCode==34&&e.char)return!1;var n=Cr[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),Eu(n,e,t))}function Qi(e){return typeof e=="string"?ar[e]:e}function pn(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var u=t(n[i]);r.length&&ve(u.from,Ce(r).to)<=0;){var d=r.pop();if(ve(d.from,u.from)<0){u.from=d.from;break}}r.push(u)}kt(e,function(){for(var g=r.length-1;g>=0;g--)cn(e.doc,"",r[g].from,r[g].to,"+delete");an(e)})}function ja(e,t,n){var r=ql(e.text,t+n,n);return r<0||r>e.text.length?null:r}function Ga(e,t,n){var r=ja(e,t.ch,n);return r==null?null:new G(t.line,r,n<0?"after":"before")}function Xa(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var u=tr(n,t.doc.direction);if(u){var d=i<0?Ce(u):u[0],g=i<0==(d.level==1),v=g?"after":"before",m;if(d.level>0||t.doc.direction=="rtl"){var w=tn(t,n);m=i<0?n.text.length-1:0;var k=Jt(t,w,m).top;m=Ln(function(B){return Jt(t,w,B).top==k},i<0==(d.level==1)?d.from:d.to-1,m),v=="before"&&(m=ja(n,m,1))}else m=i<0?d.to:d.from;return new G(r,m,v)}}return new G(r,i<0?n.text.length:0,i<0?"before":"after")}function yh(e,t,n,r){var i=tr(t,e.doc.direction);if(!i)return Ga(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var u=_n(i,n.ch,n.sticky),d=i[u];if(e.doc.direction=="ltr"&&d.level%2==0&&(r>0?d.to>n.ch:d.from<n.ch))return Ga(t,n,r);var g=function(Z,$){return ja(t,Z instanceof G?Z.ch:Z,$)},v,m=function(Z){return e.options.lineWrapping?(v=v||tn(e,t),_s(e,t,v,Z)):{begin:0,end:t.text.length}},w=m(n.sticky=="before"?g(n,-1):n.ch);if(e.doc.direction=="rtl"||d.level==1){var k=d.level==1==r<0,B=g(n,k?1:-1);if(B!=null&&(k?B<=d.to&&B<=w.end:B>=d.from&&B>=w.begin)){var M=k?"before":"after";return new G(n.line,B,M)}}var H=function(Z,$,Q){for(var te=function(Te,nt){return nt?new G(n.line,g(Te,1),"before"):new G(n.line,Te,"after")};Z>=0&&Z<i.length;Z+=$){var le=i[Z],oe=$>0==(le.level!=1),xe=oe?Q.begin:g(Q.end,-1);if(le.from<=xe&&xe<le.to||(xe=oe?le.from:g(le.to,-1),Q.begin<=xe&&xe<Q.end))return te(xe,oe)}},q=H(u+r,r,w);if(q)return q;var Y=r>0?w.end:g(w.begin,-1);return Y!=null&&!(r>0&&Y==t.text.length)&&(q=H(r>0?0:i.length-1,r,m(Y)),q)?q:null}var ni={selectAll:cu,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),vt)},killLine:function(e){return pn(e,function(t){if(t.empty()){var n=ie(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:G(t.head.line+1,0)}:{from:t.head,to:G(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return pn(e,function(t){return{from:G(t.from().line,0),to:me(e.doc,G(t.to().line+1,0))}})},delLineLeft:function(e){return pn(e,function(t){return{from:G(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return pn(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return pn(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"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(G(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(G(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Fu(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Tu(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return xh(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Xt)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Xt)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Tu(e,t.head):r},Xt)},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=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var u=n[i].from(),d=Ke(e.getLine(u.line),u.ch,r);t.push(pr(r-d%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return kt(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,u=ie(e.doc,i.line).text;if(u){if(i.ch==u.length&&(i=new G(i.line,i.ch-1)),i.ch>0)i=new G(i.line,i.ch+1),e.replaceRange(u.charAt(i.ch-1)+u.charAt(i.ch-2),G(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var d=ie(e.doc,i.line-1).text;d&&(i=new G(i.line,1),e.replaceRange(u.charAt(0)+e.doc.lineSeparator()+d.charAt(d.length-1),G(i.line-1,d.length-1),i,"+transpose"))}}n.push(new Ee(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return kt(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);an(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Fu(e,t){var n=ie(e.doc,t),r=Rt(n);return r!=n&&(t=Ae(r)),Xa(!0,e,r,t,1)}function xh(e,t){var n=ie(e.doc,t),r=nd(n);return r!=n&&(t=Ae(r)),Xa(!0,e,n,t,-1)}function Tu(e,t){var n=Fu(e,t.line),r=ie(e.doc,n.line),i=tr(r,e.doc.direction);if(!i||i[0].level==0){var u=Math.max(n.ch,r.text.search(/\S/)),d=t.line==n.line&&t.ch<=u&&t.ch;return G(n.line,d?0:u,n.sticky)}return n}function Ji(e,t,n){if(typeof t=="string"&&(t=ni[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Ye}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function Dh(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=hn(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&hn(t,e.options.extraKeys,n,e)||hn(t,e.options.keyMap,n,e)}var wh=new ct;function ii(e,t,n,r){var i=e.state.keySeq;if(i){if(Su(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:wh.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),Lu(e,i+" "+t,n,r))return!0}return Lu(e,t,n,r)}function Lu(e,t,n,r){var i=Dh(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&et(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(mt(n),Fa(e)),!!i}function Mu(e,t){var n=Au(t,!0);return n?t.shiftKey&&!e.state.keySeq?ii(e,"Shift-"+n,t,function(r){return Ji(e,r,!0)})||ii(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return Ji(e,r)}):ii(e,n,t,function(r){return Ji(e,r)}):!1}function Ch(e,t,n){return ii(e,"'"+n+"'",t,function(r){return Ji(e,r,!0)})}var Ka=null;function _u(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=ue(ee(t)),!Ve(t,e))){c&&h<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=Mu(t,e);E&&(Ka=r?n:null,!r&&n==88&&!Wc&&(P?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),s&&!P&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&kh(t)}}function kh(e){var t=e.display.lineDiv;De(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(ae(t,"CodeMirror-crosshair"),Lt(document,"keyup",n),Lt(document,"mouseover",n))}fe(document,"keyup",n),fe(document,"mouseover",n)}function Bu(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ve(this,e)}function Nu(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!(ir(t.display,e)||Ve(t,e)||e.ctrlKey&&!e.altKey||P&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(E&&n==Ka){Ka=null,mt(e);return}if(!(E&&(!e.which||e.which<10)&&Mu(t,e))){var i=String.fromCharCode(r??n);i!="\b"&&(Ch(t,e,i)||t.display.input.onKeyPress(e))}}}var Sh=400,Ya=function(e,t,n){this.time=e,this.pos=t,this.button=n};Ya.prototype.compare=function(e,t,n){return this.time+Sh>e&&ve(t,this.pos)==0&&n==this.button};var oi,ai;function Eh(e,t){var n=+new Date;return ai&&ai.compare(n,e,t)?(oi=ai=null,"triple"):oi&&oi.compare(n,e,t)?(ai=new Ya(n,e,t),oi=null,"double"):(oi=new Ya(n,e,t),ai=null,"single")}function Ou(e){var t=this,n=t.display;if(!(Ve(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,ir(n,e)){b||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!Za(t,e)){var r=Or(t,e),i=Xl(e),u=r?Eh(r,i):"single";he(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Ah(t,i,r,u,e))&&(i==1?r?Th(t,r,u,e):Jo(e)==n.scroller&&mt(e):i==2?(r&&Gi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(be?t.display.input.onContextMenu(e):Ta(t)))}}}function Ah(e,t,n,r,i){var u="Click";return r=="double"?u="Double"+u:r=="triple"&&(u="Triple"+u),u=(t==1?"Left":t==2?"Middle":"Right")+u,ii(e,Eu(u,i),i,function(d){if(typeof d=="string"&&(d=ni[d]),!d)return!1;var g=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),g=d(e,n)!=Ye}finally{e.state.suppressEdits=!1}return g})}function Fh(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var u=I?n.shiftKey&&n.metaKey:n.altKey;i.unit=u?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=P?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(P?n.altKey:n.ctrlKey)),i}function Th(e,t,n,r){c?setTimeout($e(Is,e),0):e.curOp.focus=ue(ee(e));var i=Fh(e,n,r),u=e.doc.sel,d;e.options.dragDrop&&Pc&&!e.isReadOnly()&&n=="single"&&(d=u.contains(t))>-1&&(ve((d=u.ranges[d]).from(),t)<0||t.xRel>0)&&(ve(d.to(),t)>0||t.xRel<0)?Lh(e,r,t,i):Mh(e,r,t,i)}function Lh(e,t,n,r){var i=e.display,u=!1,d=tt(e,function(m){b&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Ta(e)),Lt(i.wrapper.ownerDocument,"mouseup",d),Lt(i.wrapper.ownerDocument,"mousemove",g),Lt(i.scroller,"dragstart",v),Lt(i.scroller,"drop",d),u||(mt(m),r.addNew||Gi(e.doc,n,null,null,r.extend),b&&!F||c&&h==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),g=function(m){u=u||Math.abs(t.clientX-m.clientX)+Math.abs(t.clientY-m.clientY)>=10},v=function(){return u=!0};b&&(i.scroller.draggable=!0),e.state.draggingText=d,d.copy=!r.moveOnDrag,fe(i.wrapper.ownerDocument,"mouseup",d),fe(i.wrapper.ownerDocument,"mousemove",g),fe(i.scroller,"dragstart",v),fe(i.scroller,"drop",d),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function Iu(e,t,n){if(n=="char")return new Ee(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Ee(G(t.line,0),me(e.doc,G(t.line+1,0)));var r=n(e,t);return new Ee(r.from,r.to)}function Mh(e,t,n,r){c&&Ta(e);var i=e.display,u=e.doc;mt(t);var d,g,v=u.sel,m=v.ranges;if(r.addNew&&!r.extend?(g=u.sel.contains(n),g>-1?d=m[g]:d=new Ee(n,n)):(d=u.sel.primary(),g=u.sel.primIndex),r.unit=="rectangle")r.addNew||(d=new Ee(n,n)),n=Or(e,t,!0,!0),g=-1;else{var w=Iu(e,n,r.unit);r.extend?d=qa(d,w.anchor,w.head,r.extend):d=w}r.addNew?g==-1?(g=m.length,st(u,qt(e,m.concat([d]),g),{scroll:!1,origin:"*mouse"})):m.length>1&&m[g].empty()&&r.unit=="char"&&!r.extend?(st(u,qt(e,m.slice(0,g).concat(m.slice(g+1)),0),{scroll:!1,origin:"*mouse"}),v=u.sel):Ua(u,g,d,Tn):(g=0,st(u,new Mt([d],0),Tn),v=u.sel);var k=n;function B(Q){if(ve(k,Q)!=0)if(k=Q,r.unit=="rectangle"){for(var te=[],le=e.options.tabSize,oe=Ke(ie(u,n.line).text,n.ch,le),xe=Ke(ie(u,Q.line).text,Q.ch,le),Te=Math.min(oe,xe),nt=Math.max(oe,xe),Ie=Math.min(n.line,Q.line),St=Math.min(e.lastLine(),Math.max(n.line,Q.line));Ie<=St;Ie++){var xt=ie(u,Ie).text,Ge=Kt(xt,Te,le);Te==nt?te.push(new Ee(G(Ie,Ge),G(Ie,Ge))):xt.length>Ge&&te.push(new Ee(G(Ie,Ge),G(Ie,Kt(xt,nt,le))))}te.length||te.push(new Ee(n,n)),st(u,qt(e,v.ranges.slice(0,g).concat(te),g),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Q)}else{var Dt=d,at=Iu(e,Q,r.unit),Ze=Dt.anchor,Xe;ve(at.anchor,Ze)>0?(Xe=at.head,Ze=Si(Dt.from(),at.anchor)):(Xe=at.anchor,Ze=ki(Dt.to(),at.head));var He=v.ranges.slice(0);He[g]=_h(e,new Ee(me(u,Ze),Xe)),st(u,qt(e,He,g),Tn)}}var M=i.wrapper.getBoundingClientRect(),H=0;function q(Q){var te=++H,le=Or(e,Q,!0,r.unit=="rectangle");if(le)if(ve(le,k)!=0){e.curOp.focus=ue(ee(e)),B(le);var oe=Hi(i,u);(le.line>=oe.to||le.line<oe.from)&&setTimeout(tt(e,function(){H==te&&q(Q)}),150)}else{var xe=Q.clientY<M.top?-20:Q.clientY>M.bottom?20:0;xe&&setTimeout(tt(e,function(){H==te&&(i.scroller.scrollTop+=xe,q(Q))}),50)}}function Y(Q){e.state.selectingText=!1,H=1/0,Q&&(mt(Q),i.input.focus()),Lt(i.wrapper.ownerDocument,"mousemove",Z),Lt(i.wrapper.ownerDocument,"mouseup",$),u.history.lastSelOrigin=null}var Z=tt(e,function(Q){Q.buttons===0||!Xl(Q)?Y(Q):q(Q)}),$=tt(e,Y);e.state.selectingText=$,fe(i.wrapper.ownerDocument,"mousemove",Z),fe(i.wrapper.ownerDocument,"mouseup",$)}function _h(e,t){var n=t.anchor,r=t.head,i=ie(e.doc,n.line);if(ve(n,r)==0&&n.sticky==r.sticky)return t;var u=tr(i);if(!u)return t;var d=_n(u,n.ch,n.sticky),g=u[d];if(g.from!=n.ch&&g.to!=n.ch)return t;var v=d+(g.from==n.ch==(g.level!=1)?0:1);if(v==0||v==u.length)return t;var m;if(r.line!=n.line)m=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var w=_n(u,r.ch,r.sticky),k=w-d||(r.ch-n.ch)*(g.level==1?-1:1);w==v-1||w==v?m=k<0:m=k>0}var B=u[v+(m?-1:0)],M=m==(B.level==1),H=M?B.from:B.to,q=M?"after":"before";return n.ch==H&&n.sticky==q?t:new Ee(new G(n.line,H,q),r)}function Pu(e,t,n,r){var i,u;if(t.touches)i=t.touches[0].clientX,u=t.touches[0].clientY;else try{i=t.clientX,u=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&mt(t);var d=e.display,g=d.lineDiv.getBoundingClientRect();if(u>g.bottom||!It(e,n))return Qo(t);u-=g.top-d.viewOffset;for(var v=0;v<e.display.gutterSpecs.length;++v){var m=d.gutters.childNodes[v];if(m&&m.getBoundingClientRect().right>=i){var w=_r(e.doc,u),k=e.display.gutterSpecs[v];return Ue(e,n,e,w,k.className,t),Qo(t)}}}function Za(e,t){return Pu(e,t,"gutterClick",!0)}function zu(e,t){ir(e.display,t)||Bh(e,t)||Ve(e,t,"contextmenu")||be||e.display.input.onContextMenu(t)}function Bh(e,t){return It(e,"gutterContextMenu")?Pu(e,t,"gutterContextMenu",!1):!1}function Hu(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Rn(e)}var gn={toString:function(){return"CodeMirror.Init"}},Ru={},$i={};function Nh(e){var t=e.optionHandlers;function n(r,i,u,d){e.defaults[r]=i,u&&(t[r]=d?function(g,v,m){m!=gn&&u(g,v,m)}:u)}e.defineOption=n,e.Init=gn,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Ha(r)},!0),n("indentUnit",2,Ha,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){Yn(r),Rn(r),bt(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var u=[],d=r.doc.first;r.doc.iter(function(v){for(var m=0;;){var w=v.text.indexOf(i,m);if(w==-1)break;m=w+i.length,u.push(G(d,w))}d++});for(var g=u.length-1;g>=0;g--)cn(r.doc,i,u[g],G(u[g].line,u[g].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,u){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),u!=gn&&r.refresh()}),n("specialCharPlaceholder",ud,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",N?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!W),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){Hu(r),Kn(r)},!0),n("keyMap","default",function(r,i,u){var d=Qi(i),g=u!=gn&&Qi(u);g&&g.detach&&g.detach(r,d),d.attach&&d.attach(r,g||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ih,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=Pa(i,r.options.lineNumbers),Kn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Sa(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return ln(r)},!0),n("scrollbarStyle","native",function(r){qs(r),ln(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=Pa(r.options.gutters,i),Kn(r)},!0),n("firstLineNumber",1,Kn,!0),n("lineNumberFormatter",function(r){return r},Kn,!0),n("showCursorWhenSelecting",!1,Wn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(on(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,Oh),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,Wn,!0),n("singleCursorHeightPerLine",!0,Wn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Yn,!0),n("addModeClass",!1,Yn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,Yn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function Oh(e,t,n){var r=n&&n!=gn;if(!t!=!r){var i=e.display.dragFunctions,u=t?fe:Lt;u(e.display.scroller,"dragstart",i.start),u(e.display.scroller,"dragenter",i.enter),u(e.display.scroller,"dragover",i.over),u(e.display.scroller,"dragleave",i.leave),u(e.display.scroller,"drop",i.drop)}}function Ih(e){e.options.lineWrapping?(De(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ae(e.display.wrapper,"CodeMirror-wrap"),ga(e)),Ea(e),bt(e),Rn(e),setTimeout(function(){return ln(e)},100)}function Ne(e,t){var n=this;if(!(this instanceof Ne))return new Ne(e,t);this.options=t=t?Tt(t):{},Tt(Ru,t,!1);var r=t.value;typeof r=="string"?r=new yt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Ne.inputStyles[t.inputStyle](this),u=this.display=new Zd(e,r,i,t);u.wrapper.CodeMirror=this,Hu(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),qs(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 ct,keySeq:null,specialChars:null},t.autofocus&&!N&&u.input.focus(),c&&h<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Ph(this),ph(),Hr(this),this.curOp.forceUpdate=!0,$s(this,r),t.autofocus&&!N||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&La(n)},20):on(this);for(var d in $i)$i.hasOwnProperty(d)&&$i[d](this,t[d],gn);Gs(this),t.finishInit&&t.finishInit(this);for(var g=0;g<Qa.length;++g)Qa[g](this);Rr(this),b&&t.lineWrapping&&getComputedStyle(u.lineDiv).textRendering=="optimizelegibility"&&(u.lineDiv.style.textRendering="auto")}Ne.defaults=Ru,Ne.optionHandlers=$i;function Ph(e){var t=e.display;fe(t.scroller,"mousedown",tt(e,Ou)),c&&h<11?fe(t.scroller,"dblclick",tt(e,function(v){if(!Ve(e,v)){var m=Or(e,v);if(!(!m||Za(e,v)||ir(e.display,v))){mt(v);var w=e.findWordAt(m);Gi(e.doc,w.anchor,w.head)}}})):fe(t.scroller,"dblclick",function(v){return Ve(e,v)||mt(v)}),fe(t.scroller,"contextmenu",function(v){return zu(e,v)}),fe(t.input.getField(),"contextmenu",function(v){t.scroller.contains(v.target)||zu(e,v)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function u(v){if(v.touches.length!=1)return!1;var m=v.touches[0];return m.radiusX<=1&&m.radiusY<=1}function d(v,m){if(m.left==null)return!0;var w=m.left-v.left,k=m.top-v.top;return w*w+k*k>20*20}fe(t.scroller,"touchstart",function(v){if(!Ve(e,v)&&!u(v)&&!Za(e,v)){t.input.ensurePolled(),clearTimeout(n);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)}}),fe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),fe(t.scroller,"touchend",function(v){var m=t.activeTouch;if(m&&!ir(t,v)&&m.left!=null&&!m.moved&&new Date-m.start<300){var w=e.coordsChar(t.activeTouch,"page"),k;!m.prev||d(m,m.prev)?k=new Ee(w,w):!m.prev.prev||d(m,m.prev.prev)?k=e.findWordAt(w):k=new Ee(G(w.line,0),me(e.doc,G(w.line+1,0))),e.setSelection(k.anchor,k.head),e.focus(),mt(v)}i()}),fe(t.scroller,"touchcancel",i),fe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Un(e,t.scroller.scrollTop),Pr(e,t.scroller.scrollLeft,!0),Ue(e,"scroll",e))}),fe(t.scroller,"mousewheel",function(v){return Ys(e,v)}),fe(t.scroller,"DOMMouseScroll",function(v){return Ys(e,v)}),fe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(v){Ve(e,v)||Bn(v)},over:function(v){Ve(e,v)||(hh(e,v),Bn(v))},start:function(v){return dh(e,v)},drop:tt(e,ch),leave:function(v){Ve(e,v)||wu(e)}};var g=t.input.getField();fe(g,"keyup",function(v){return Bu.call(e,v)}),fe(g,"keydown",tt(e,_u)),fe(g,"keypress",tt(e,Nu)),fe(g,"focus",function(v){return La(e,v)}),fe(g,"blur",function(v){return on(e,v)})}var Qa=[];Ne.defineInitHook=function(e){return Qa.push(e)};function li(e,t,n,r){var i=e.doc,u;n==null&&(n="add"),n=="smart"&&(i.mode.indent?u=On(e,t).state:n="prev");var d=e.options.tabSize,g=ie(i,t),v=Ke(g.text,null,d);g.stateAfter&&(g.stateAfter=null);var m=g.text.match(/^\s*/)[0],w;if(!r&&!/\S/.test(g.text))w=0,n="not";else if(n=="smart"&&(w=i.mode.indent(u,g.text.slice(m.length),g.text),w==Ye||w>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?w=Ke(ie(i,t-1).text,null,d):w=0:n=="add"?w=v+e.options.indentUnit:n=="subtract"?w=v-e.options.indentUnit:typeof n=="number"&&(w=v+n),w=Math.max(0,w);var k="",B=0;if(e.options.indentWithTabs)for(var M=Math.floor(w/d);M;--M)B+=d,k+=" ";if(B<w&&(k+=pr(w-B)),k!=m)return cn(i,k,G(t,0),G(t,m.length),"+input"),g.stateAfter=null,!0;for(var H=0;H<i.sel.ranges.length;H++){var q=i.sel.ranges[H];if(q.head.line==t&&q.head.ch<m.length){var Y=G(t,m.length);Ua(i,H,new Ee(Y,Y));break}}}var Ut=null;function Vi(e){Ut=e}function Ja(e,t,n,r,i){var u=e.doc;e.display.shift=!1,r||(r=u.sel);var d=+new Date-200,g=i=="paste"||e.state.pasteIncoming>d,v=ea(t),m=null;if(g&&r.ranges.length>1)if(Ut&&Ut.text.join(`
`)==t){if(r.ranges.length%Ut.text.length==0){m=[];for(var w=0;w<Ut.text.length;w++)m.push(u.splitLines(Ut.text[w]))}}else v.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(m=Ht(v,function(Z){return[Z]}));for(var k=e.curOp.updateInput,B=r.ranges.length-1;B>=0;B--){var M=r.ranges[B],H=M.from(),q=M.to();M.empty()&&(n&&n>0?H=G(H.line,H.ch-n):e.state.overwrite&&!g?q=G(q.line,Math.min(ie(u,q.line).text.length,q.ch+Ce(v).length)):g&&Ut&&Ut.lineWise&&Ut.text.join(`
`)==v.join(`
`)&&(H=q=G(H.line,0)));var Y={from:H,to:q,text:m?m[B%m.length]:v,origin:i||(g?"paste":e.state.cutIncoming>d?"cut":"+input")};fn(e.doc,Y),et(e,"inputRead",e,Y)}t&&!g&&qu(e,t),an(e),e.curOp.updateInput<2&&(e.curOp.updateInput=k),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Wu(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&kt(t,function(){return Ja(t,n,0,null,"paste")}),!0}function qu(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var u=e.getModeAt(i.head),d=!1;if(u.electricChars){for(var g=0;g<u.electricChars.length;g++)if(t.indexOf(u.electricChars.charAt(g))>-1){d=li(e,i.head.line,"smart");break}}else u.electricInput&&u.electricInput.test(ie(e.doc,i.head.line).text.slice(0,i.head.ch))&&(d=li(e,i.head.line,"smart"));d&&et(e,"electricInput",e,i.head.line)}}}function Uu(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,u={anchor:G(i,0),head:G(i+1,0)};n.push(u),t.push(e.getRange(u.anchor,u.head))}return{text:t,ranges:n}}function $a(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function ju(){var e=S("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=S("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return b?e.style.width="1000px":e.setAttribute("wrap","off"),T&&(e.style.border="1px solid black"),t}function zh(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){he(this).focus(),this.display.input.focus()},setOption:function(r,i){var u=this.options,d=u[r];u[r]==i&&r!="mode"||(u[r]=i,t.hasOwnProperty(r)&&tt(this,t[r])(this,i,d),Ue(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](Qi(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,u=0;u<i.length;++u)if(i[u]==r||i[u].name==r)return i.splice(u,1),!0},addOverlay:dt(function(r,i){var u=r.token?r:e.getMode(this.options,r);if(u.startState)throw new Error("Overlays may not be stateful.");gr(this.state.overlays,{mode:u,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(d){return d.priority}),this.state.modeGen++,bt(this)}),removeOverlay:dt(function(r){for(var i=this.state.overlays,u=0;u<i.length;++u){var d=i[u].modeSpec;if(d==r||typeof r=="string"&&d.name==r){i.splice(u,1),this.state.modeGen++,bt(this);return}}}),indentLine:dt(function(r,i,u){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),Nn(this.doc,r)&&li(this,r,i,u)}),indentSelection:dt(function(r){for(var i=this.doc.sel.ranges,u=-1,d=0;d<i.length;d++){var g=i[d];if(g.empty())g.head.line>u&&(li(this,g.head.line,r,!0),u=g.head.line,d==this.doc.sel.primIndex&&an(this));else{var v=g.from(),m=g.to(),w=Math.max(u,v.line);u=Math.min(this.lastLine(),m.line-(m.ch?0:1))+1;for(var k=w;k<u;++k)li(this,k,r);var B=this.doc.sel.ranges;v.ch==0&&i.length==B.length&&B[d].from().ch>0&&Ua(this.doc,d,new Ee(v,B[d].to()),vt)}}}),getTokenAt:function(r,i){return es(this,r,i)},getLineTokens:function(r,i){return es(this,G(r),i,!0)},getTokenTypeAt:function(r){r=me(this.doc,r);var i=Jl(this,ie(this.doc,r.line)),u=0,d=(i.length-1)/2,g=r.ch,v;if(g==0)v=i[2];else for(;;){var m=u+d>>1;if((m?i[m*2-1]:0)>=g)d=m;else if(i[m*2+1]<g)u=m+1;else{v=i[m*2+2];break}}var w=v?v.indexOf("overlay "):-1;return w<0?v:w==0?null:v.slice(0,w-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var u=[];if(!n.hasOwnProperty(i))return u;var d=n[i],g=this.getModeAt(r);if(typeof g[i]=="string")d[g[i]]&&u.push(d[g[i]]);else if(g[i])for(var v=0;v<g[i].length;v++){var m=d[g[i][v]];m&&u.push(m)}else g.helperType&&d[g.helperType]?u.push(d[g.helperType]):d[g.name]&&u.push(d[g.name]);for(var w=0;w<d._global.length;w++){var k=d._global[w];k.pred(g,this)&&Be(u,k.val)==-1&&u.push(k.val)}return u},getStateAfter:function(r,i){var u=this.doc;return r=Yl(u,r??u.first+u.size-1),On(this,r+1,i).state},cursorCoords:function(r,i){var u,d=this.doc.sel.primary();return r==null?u=d.head:typeof r=="object"?u=me(this.doc,r):u=r?d.from():d.to(),Wt(this,u,i||"page")},charCoords:function(r,i){return Oi(this,me(this.doc,r),i||"page")},coordsChar:function(r,i){return r=Ts(this,r,i||"page"),wa(this,r.left,r.top)},lineAtHeight:function(r,i){return r=Ts(this,{top:r,left:0},i||"page").top,_r(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,u){var d=!1,g;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,d=!0),g=ie(this.doc,r)}else g=r;return Ni(this,g,{top:0,left:0},i||"page",u||d).top+(d?this.doc.height-nr(g):0)},defaultTextHeight:function(){return rn(this.display)},defaultCharWidth:function(){return nn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,u,d,g){var v=this.display;r=Wt(this,me(this.doc,r));var m=r.bottom,w=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),v.sizer.appendChild(i),d=="over")m=r.top;else if(d=="above"||d=="near"){var k=Math.max(v.wrapper.clientHeight,this.doc.height),B=Math.max(v.sizer.clientWidth,v.lineSpace.clientWidth);(d=="above"||r.bottom+i.offsetHeight>k)&&r.top>i.offsetHeight?m=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=k&&(m=r.bottom),w+i.offsetWidth>B&&(w=B-i.offsetWidth)}i.style.top=m+"px",i.style.left=i.style.right="",g=="right"?(w=v.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(g=="left"?w=0:g=="middle"&&(w=(v.sizer.clientWidth-i.offsetWidth)/2),i.style.left=w+"px"),u&&Od(this,{left:w,top:m,right:w+i.offsetWidth,bottom:m+i.offsetHeight})},triggerOnKeyDown:dt(_u),triggerOnKeyPress:dt(Nu),triggerOnKeyUp:Bu,triggerOnMouseDown:dt(Ou),execCommand:function(r){if(ni.hasOwnProperty(r))return ni[r].call(null,this)},triggerElectric:dt(function(r){qu(this,r)}),findPosH:function(r,i,u,d){var g=1;i<0&&(g=-1,i=-i);for(var v=me(this.doc,r),m=0;m<i&&(v=Va(this.doc,v,g,u,d),!v.hitSide);++m);return v},moveH:dt(function(r,i){var u=this;this.extendSelectionsBy(function(d){return u.display.shift||u.doc.extend||d.empty()?Va(u.doc,d.head,r,i,u.options.rtlMoveVisually):r<0?d.from():d.to()},Xt)}),deleteH:dt(function(r,i){var u=this.doc.sel,d=this.doc;u.somethingSelected()?d.replaceSelection("",null,"+delete"):pn(this,function(g){var v=Va(d,g.head,r,i,!1);return r<0?{from:v,to:g.head}:{from:g.head,to:v}})}),findPosV:function(r,i,u,d){var g=1,v=d;i<0&&(g=-1,i=-i);for(var m=me(this.doc,r),w=0;w<i;++w){var k=Wt(this,m,"div");if(v==null?v=k.left:k.left=v,m=Gu(this,k,g,u),m.hitSide)break}return m},moveV:dt(function(r,i){var u=this,d=this.doc,g=[],v=!this.display.shift&&!d.extend&&d.sel.somethingSelected();if(d.extendSelectionsBy(function(w){if(v)return r<0?w.from():w.to();var k=Wt(u,w.head,"div");w.goalColumn!=null&&(k.left=w.goalColumn),g.push(k.left);var B=Gu(u,k,r,i);return i=="page"&&w==d.sel.primary()&&_a(u,Oi(u,B,"div").top-k.top),B},Xt),g.length)for(var m=0;m<d.sel.ranges.length;m++)d.sel.ranges[m].goalColumn=g[m]}),findWordAt:function(r){var i=this.doc,u=ie(i,r.line).text,d=r.ch,g=r.ch;if(u){var v=this.getHelper(r,"wordChars");(r.sticky=="before"||g==u.length)&&d?--d:++g;for(var m=u.charAt(d),w=wi(m,v)?function(k){return wi(k,v)}:/\s/.test(m)?function(k){return/\s/.test(k)}:function(k){return!/\s/.test(k)&&!wi(k)};d>0&&w(u.charAt(d-1));)--d;for(;g<u.length&&w(u.charAt(g));)++g}return new Ee(G(r.line,d),G(r.line,g))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?De(this.display.cursorDiv,"CodeMirror-overwrite"):ae(this.display.cursorDiv,"CodeMirror-overwrite"),Ue(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==ue(ee(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:dt(function(r,i){qn(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Qt(this)-this.display.barHeight,width:r.scrollWidth-Qt(this)-this.display.barWidth,clientHeight:ba(this),clientWidth:Br(this)}},scrollIntoView:dt(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:G(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?Id(this,r):zs(this,r.from,r.to,r.margin)}),setSize:dt(function(r,i){var u=this,d=function(v){return typeof v=="number"||/^\d+$/.test(String(v))?v+"px":v};r!=null&&(this.display.wrapper.style.width=d(r)),i!=null&&(this.display.wrapper.style.height=d(i)),this.options.lineWrapping&&Es(this);var g=this.display.viewFrom;this.doc.iter(g,this.display.viewTo,function(v){if(v.widgets){for(var m=0;m<v.widgets.length;m++)if(v.widgets[m].noHScroll){mr(u,g,"widget");break}}++g}),this.curOp.forceUpdate=!0,Ue(this,"refresh",this)}),operation:function(r){return kt(this,r)},startOperation:function(){return Hr(this)},endOperation:function(){return Rr(this)},refresh:dt(function(){var r=this.display.cachedTextHeight;bt(this),this.curOp.forceUpdate=!0,Rn(this),qn(this,this.doc.scrollLeft,this.doc.scrollTop),Oa(this.display),(r==null||Math.abs(r-rn(this.display))>.5||this.options.lineWrapping)&&Ea(this),Ue(this,"refresh",this)}),swapDoc:dt(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),$s(this,r),Rn(this),this.display.input.reset(),qn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,et(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[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}},Qr(e),e.registerHelper=function(r,i,u){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=u},e.registerGlobalHelper=function(r,i,u,d){e.registerHelper(r,i,d),n[r]._global.push({pred:u,val:d})}}function Va(e,t,n,r,i){var u=t,d=n,g=ie(e,t.line),v=i&&e.direction=="rtl"?-n:n;function m(){var $=t.line+v;return $<e.first||$>=e.first+e.size?!1:(t=new G($,t.ch,t.sticky),g=ie(e,$))}function w($){var Q;if(r=="codepoint"){var te=g.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(te))Q=null;else{var le=n>0?te>=55296&&te<56320:te>=56320&&te<57343;Q=new G(t.line,Math.max(0,Math.min(g.text.length,t.ch+n*(le?2:1))),-n)}}else i?Q=yh(e.cm,g,t,n):Q=Ga(g,t,n);if(Q==null)if(!$&&m())t=Xa(i,e.cm,g,t.line,v);else return!1;else t=Q;return!0}if(r=="char"||r=="codepoint")w();else if(r=="column")w(!0);else if(r=="word"||r=="group")for(var k=null,B=r=="group",M=e.cm&&e.cm.getHelper(t,"wordChars"),H=!0;!(n<0&&!w(!H));H=!1){var q=g.text.charAt(t.ch)||`
`,Y=wi(q,M)?"w":B&&q==`
`?"n":!B||/\s/.test(q)?null:"p";if(B&&!H&&!Y&&(Y="s"),k&&k!=Y){n<0&&(n=1,w(),t.sticky="after");break}if(Y&&(k=Y),n>0&&!w(!H))break}var Z=Ki(e,t,u,d,!0);return la(u,Z)&&(Z.hitSide=!0),Z}function Gu(e,t,n,r){var i=e.doc,u=t.left,d;if(r=="page"){var g=Math.min(e.display.wrapper.clientHeight,he(e).innerHeight||i(e).documentElement.clientHeight),v=Math.max(g-.5*rn(e.display),3);d=(n>0?t.bottom:t.top)+n*v}else r=="line"&&(d=n>0?t.bottom+3:t.top-3);for(var m;m=wa(e,u,d),!!m.outside;){if(n<0?d<=0:d>=i.height){m.hitSide=!0;break}d+=n*5}return m}var Fe=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ct,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Fe.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,$a(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function u(g){for(var v=g.target;v;v=v.parentNode){if(v==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(v.className))break}return!1}fe(i,"paste",function(g){!u(g)||Ve(r,g)||Wu(g,r)||h<=11&&setTimeout(tt(r,function(){return t.updateFromDOM()}),20)}),fe(i,"compositionstart",function(g){t.composing={data:g.data,done:!1}}),fe(i,"compositionupdate",function(g){t.composing||(t.composing={data:g.data,done:!1})}),fe(i,"compositionend",function(g){t.composing&&(g.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),fe(i,"touchstart",function(){return n.forceCompositionEnd()}),fe(i,"input",function(){t.composing||t.readFromDOMSoon()});function d(g){if(!(!u(g)||Ve(r,g))){if(r.somethingSelected())Vi({lineWise:!1,text:r.getSelections()}),g.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var v=Uu(r);Vi({lineWise:!0,text:v.text}),g.type=="cut"&&r.operation(function(){r.setSelections(v.ranges,0,vt),r.replaceSelection("",null,"cut")})}else return;if(g.clipboardData){g.clipboardData.clearData();var m=Ut.text.join(`
`);if(g.clipboardData.setData("Text",m),g.clipboardData.getData("Text")==m){g.preventDefault();return}}var w=ju(),k=w.firstChild;$a(k),r.display.lineSpace.insertBefore(w,r.display.lineSpace.firstChild),k.value=Ut.text.join(`
`);var B=ue(we(i));A(k),setTimeout(function(){r.display.lineSpace.removeChild(w),B.focus(),B==i&&n.showPrimarySelection()},50)}}fe(i,"copy",d),fe(i,"cut",d)},Fe.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Fe.prototype.prepareSelection=function(){var e=Os(this.cm,!1);return e.focus=ue(we(this.div))==this.div,e},Fe.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Fe.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Fe.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var u=eo(t,e.anchorNode,e.anchorOffset),d=eo(t,e.focusNode,e.focusOffset);if(!(u&&!u.bad&&d&&!d.bad&&ve(Si(u,d),r)==0&&ve(ki(u,d),i)==0)){var g=t.display.view,v=r.line>=t.display.viewFrom&&Xu(t,r)||{node:g[0].measure.map[2],offset:0},m=i.line<t.display.viewTo&&Xu(t,i);if(!m){var w=g[g.length-1].measure,k=w.maps?w.maps[w.maps.length-1]:w.map;m={node:k[k.length-1],offset:k[k.length-2]-k[k.length-3]}}if(!v||!m){e.removeAllRanges();return}var B=e.rangeCount&&e.getRangeAt(0),M;try{M=z(v.node,v.offset,m.offset,m.node)}catch{}M&&(!s&&t.state.focused?(e.collapse(v.node,v.offset),M.collapsed||(e.removeAllRanges(),e.addRange(M))):(e.removeAllRanges(),e.addRange(M)),B&&e.anchorNode==null?e.addRange(B):s&&this.startGracePeriod()),this.rememberSelection()}},Fe.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)},Fe.prototype.showMultipleSelections=function(e){se(this.cm.display.cursorDiv,e.cursors),se(this.cm.display.selectionDiv,e.selection)},Fe.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Fe.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return K(this.div,t)},Fe.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||ue(we(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Fe.prototype.blur=function(){this.div.blur()},Fe.prototype.getField=function(){return this.div},Fe.prototype.supportsTouch=function(){return!0},Fe.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):kt(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},Fe.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Fe.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(O&&x&&this.cm.display.gutterSpecs.length&&Hh(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=eo(t,e.anchorNode,e.anchorOffset),r=eo(t,e.focusNode,e.focusOffset);n&&r&&kt(t,function(){st(t.doc,yr(n,r),vt),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Fe.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=G(r.line-1,ie(e.doc,r.line-1).length)),i.ch==ie(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=G(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var u,d,g;r.line==t.viewFrom||(u=Ir(e,r.line))==0?(d=Ae(t.view[0].line),g=t.view[0].node):(d=Ae(t.view[u].line),g=t.view[u-1].node.nextSibling);var v=Ir(e,i.line),m,w;if(v==t.view.length-1?(m=t.viewTo-1,w=t.lineDiv.lastChild):(m=Ae(t.view[v+1].line)-1,w=t.view[v+1].node.previousSibling),!g)return!1;for(var k=e.doc.splitLines(Rh(e,g,w,d,m)),B=Mr(e.doc,G(d,0),G(m,ie(e.doc,m).text.length));k.length>1&&B.length>1;)if(Ce(k)==Ce(B))k.pop(),B.pop(),m--;else if(k[0]==B[0])k.shift(),B.shift(),d++;else break;for(var M=0,H=0,q=k[0],Y=B[0],Z=Math.min(q.length,Y.length);M<Z&&q.charCodeAt(M)==Y.charCodeAt(M);)++M;for(var $=Ce(k),Q=Ce(B),te=Math.min($.length-(k.length==1?M:0),Q.length-(B.length==1?M:0));H<te&&$.charCodeAt($.length-H-1)==Q.charCodeAt(Q.length-H-1);)++H;if(k.length==1&&B.length==1&&d==r.line)for(;M&&M>r.ch&&$.charCodeAt($.length-H-1)==Q.charCodeAt(Q.length-H-1);)M--,H++;k[k.length-1]=$.slice(0,$.length-H).replace(/^\u200b+/,""),k[0]=k[0].slice(M).replace(/\u200b+$/,"");var le=G(d,M),oe=G(m,B.length?Ce(B).length-H:0);if(k.length>1||k[0]||ve(le,oe))return cn(e.doc,k,le,oe,"+input"),!0},Fe.prototype.ensurePolled=function(){this.forceCompositionEnd()},Fe.prototype.reset=function(){this.forceCompositionEnd()},Fe.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Fe.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))},Fe.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&kt(this.cm,function(){return bt(e.cm)})},Fe.prototype.setUneditable=function(e){e.contentEditable="false"},Fe.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||tt(this.cm,Ja)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Fe.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Fe.prototype.onContextMenu=function(){},Fe.prototype.resetPosition=function(){},Fe.prototype.needsContentAttribute=!0;function Xu(e,t){var n=ya(e,t.line);if(!n||n.hidden)return null;var r=ie(e.doc,t.line),i=Ds(n,r,t.line),u=tr(r,e.doc.direction),d="left";if(u){var g=_n(u,t.ch);d=g%2?"right":"left"}var v=ks(i.map,t.ch,d);return v.offset=v.collapse=="right"?v.end:v.start,v}function Hh(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function vn(e,t){return t&&(e.bad=!0),e}function Rh(e,t,n,r,i){var u="",d=!1,g=e.doc.lineSeparator(),v=!1;function m(M){return function(H){return H.id==M}}function w(){d&&(u+=g,v&&(u+=g),d=v=!1)}function k(M){M&&(w(),u+=M)}function B(M){if(M.nodeType==1){var H=M.getAttribute("cm-text");if(H){k(H);return}var q=M.getAttribute("cm-marker"),Y;if(q){var Z=e.findMarks(G(r,0),G(i+1,0),m(+q));Z.length&&(Y=Z[0].find(0))&&k(Mr(e.doc,Y.from,Y.to).join(g));return}if(M.getAttribute("contenteditable")=="false")return;var $=/^(pre|div|p|li|table|br)$/i.test(M.nodeName);if(!/^br$/i.test(M.nodeName)&&M.textContent.length==0)return;$&&w();for(var Q=0;Q<M.childNodes.length;Q++)B(M.childNodes[Q]);/^(pre|p)$/i.test(M.nodeName)&&(v=!0),$&&(d=!0)}else M.nodeType==3&&k(M.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;B(t),t!=n;)t=t.nextSibling,v=!1;return u}function eo(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return vn(e.clipPos(G(e.display.viewTo-1)),!0);t=null,n=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 i=0;i<e.display.view.length;i++){var u=e.display.view[i];if(u.node==r)return Wh(u,t,n)}}function Wh(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!K(r,t))return vn(G(Ae(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var u=e.rest?Ce(e.rest):e.line;return vn(G(Ae(u),u.text.length),i)}var d=t.nodeType==3?t:null,g=t;for(!d&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(d=t.firstChild,n&&(n=d.nodeValue.length));g.parentNode!=r;)g=g.parentNode;var v=e.measure,m=v.maps;function w(Y,Z,$){for(var Q=-1;Q<(m?m.length:0);Q++)for(var te=Q<0?v.map:m[Q],le=0;le<te.length;le+=3){var oe=te[le+2];if(oe==Y||oe==Z){var xe=Ae(Q<0?e.line:e.rest[Q]),Te=te[le]+$;return($<0||oe!=Y)&&(Te=te[le+($?1:0)]),G(xe,Te)}}}var k=w(d,g,n);if(k)return vn(k,i);for(var B=g.nextSibling,M=d?d.nodeValue.length-n:0;B;B=B.nextSibling){if(k=w(B,B.firstChild,0),k)return vn(G(k.line,k.ch-M),i);M+=B.textContent.length}for(var H=g.previousSibling,q=n;H;H=H.previousSibling){if(k=w(H,H.firstChild,-1),k)return vn(G(k.line,k.ch+q),i);q+=H.textContent.length}}var We=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new ct,this.hasSelection=!1,this.composing=null,this.resetting=!1};We.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),T&&(i.style.width="0px"),fe(i,"input",function(){c&&h>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),fe(i,"paste",function(d){Ve(r,d)||Wu(d,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function u(d){if(!Ve(r,d)){if(r.somethingSelected())Vi({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var g=Uu(r);Vi({lineWise:!0,text:g.text}),d.type=="cut"?r.setSelections(g.ranges,null,vt):(n.prevInput="",i.value=g.text.join(`
`),A(i))}else return;d.type=="cut"&&(r.state.cutIncoming=+new Date)}}fe(i,"cut",u),fe(i,"copy",u),fe(e.scroller,"paste",function(d){if(!(ir(e,d)||Ve(r,d))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var g=new Event("paste");g.clipboardData=d.clipboardData,i.dispatchEvent(g)}}),fe(e.lineSpace,"selectstart",function(d){ir(e,d)||mt(d)}),fe(i,"compositionstart",function(){var d=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:d,range:r.markText(d,r.getCursor("to"),{className:"CodeMirror-composing"})}}),fe(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},We.prototype.createField=function(e){this.wrapper=ju(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;$a(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},We.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},We.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=Os(e);if(e.options.moveInputWithCursor){var i=Wt(e,n.sel.primary().head,"div"),u=t.wrapper.getBoundingClientRect(),d=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+d.top-u.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+d.left-u.left))}return r},We.prototype.showSelection=function(e){var t=this.cm,n=t.display;se(n.cursorDiv,e.cursors),se(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},We.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&A(this.textarea),c&&h>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",c&&h>=9&&(this.hasSelection=null));this.resetting=!1}},We.prototype.getField=function(){return this.textarea},We.prototype.supportsTouch=function(){return!1},We.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!N||ue(we(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},We.prototype.blur=function(){this.textarea.blur()},We.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},We.prototype.receivedFocus=function(){this.slowPoll()},We.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},We.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},We.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||Rc(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(c&&h>=9&&this.hasSelection===i||P&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var u=i.charCodeAt(0);if(u==8203&&!r&&(r="\u200B"),u==8666)return this.reset(),this.cm.execCommand("undo")}for(var d=0,g=Math.min(r.length,i.length);d<g&&r.charCodeAt(d)==i.charCodeAt(d);)++d;return kt(t,function(){Ja(t,i.slice(d),r.length-d,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},We.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},We.prototype.onKeyPress=function(){c&&h>=9&&(this.hasSelection=null),this.fastPoll()},We.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var u=Or(n,e),d=r.scroller.scrollTop;if(!u||E)return;var g=n.options.resetSelectionOnContextMenu;g&&n.doc.sel.contains(u)==-1&&tt(n,st)(n.doc,yr(u),vt);var v=i.style.cssText,m=t.wrapper.style.cssText,w=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-w.top-5)+"px; left: "+(e.clientX-w.left-5)+`px;
z-index: 1000; background: `+(c?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var k;b&&(k=i.ownerDocument.defaultView.scrollY),r.input.focus(),b&&i.ownerDocument.defaultView.scrollTo(null,k),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=M,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function B(){if(i.selectionStart!=null){var q=n.somethingSelected(),Y="\u200B"+(q?i.value:"");i.value="\u21DA",i.value=Y,t.prevInput=q?"":"\u200B",i.selectionStart=1,i.selectionEnd=Y.length,r.selForContextMenu=n.doc.sel}}function M(){if(t.contextMenuPending==M&&(t.contextMenuPending=!1,t.wrapper.style.cssText=m,i.style.cssText=v,c&&h<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=d),i.selectionStart!=null)){(!c||c&&h<9)&&B();var q=0,Y=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?tt(n,cu)(n):q++<10?r.detectingSelectAll=setTimeout(Y,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(Y,200)}}if(c&&h>=9&&B(),be){Bn(e);var H=function(){Lt(window,"mouseup",H),setTimeout(M,20)};fe(window,"mouseup",H)}else setTimeout(M,50)},We.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},We.prototype.setUneditable=function(){},We.prototype.needsContentAttribute=!1;function qh(e,t){if(t=t?Tt(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 n=ue(we(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=g.getValue()}var i;if(e.form&&(fe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var u=e.form;i=u.submit;try{var d=u.submit=function(){r(),u.submit=i,u.submit(),u.submit=d}}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&&(Lt(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var g=Ne(function(v){return e.parentNode.insertBefore(v,e.nextSibling)},t);return g}function Uh(e){e.off=Lt,e.on=fe,e.wheelEventPixels=Qd,e.Doc=yt,e.splitLines=ea,e.countColumn=Ke,e.findColumn=Kt,e.isWordChar=Ko,e.Pass=Ye,e.signal=Ue,e.Line=Vr,e.changeEnd=xr,e.scrollbarModel=Ws,e.Pos=G,e.cmpPos=ve,e.modes=ra,e.mimeModes=Jr,e.resolveMode=Ci,e.getMode=na,e.modeExtensions=$r,e.extendMode=Gc,e.copyState=Lr,e.startState=Kl,e.innerMode=ia,e.commands=ni,e.keyMap=ar,e.keyName=Au,e.isModifierKey=Su,e.lookupKey=hn,e.normalizeKeyMap=bh,e.StringStream=je,e.SharedTextMarker=ei,e.TextMarker=wr,e.LineWidget=Vn,e.e_preventDefault=mt,e.e_stopPropagation=Gl,e.e_stop=Bn,e.addClass=De,e.contains=K,e.rmClass=ae,e.keyNames=Cr}Nh(Ne),zh(Ne);var jh="iter insert remove copy getEditor constructor".split(" ");for(var to in yt.prototype)yt.prototype.hasOwnProperty(to)&&Be(jh,to)<0&&(Ne.prototype[to]=function(e){return function(){return e.apply(this.doc,arguments)}}(yt.prototype[to]));return Qr(yt),Ne.inputStyles={textarea:We,contenteditable:Fe},Ne.defineMode=function(e){!Ne.defaults.mode&&e!="null"&&(Ne.defaults.mode=e),Uc.apply(this,arguments)},Ne.defineMIME=jc,Ne.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Ne.defineMIME("text/plain","null"),Ne.defineExtension=function(e,t){Ne.prototype[e]=t},Ne.defineDocExtension=function(e,t){yt.prototype[e]=t},Ne.fromTextArea=qh,Uh(Ne),Ne.version="5.65.21",Ne})});var Qu=lt((Yu,Zu)=>{(function(o){typeof Yu=="object"&&typeof Zu=="object"?o(Et()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var l=/^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/,s=/^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/,a=/[*+-]\s/;o.commands.newlineAndIndentContinueMarkdownList=function(p){if(p.getOption("disableInput"))return o.Pass;for(var c=p.listSelections(),h=[],b=0;b<c.length;b++){var y=c[b].head,x=p.getStateAfter(y.line),C=o.innerMode(p.getMode(),x);if(C.mode.name!=="markdown"&&C.mode.helperType!=="markdown"){p.execCommand("newlineAndIndent");return}else x=C.state;var E=x.list!==!1,F=x.quote!==0,_=p.getLine(y.line),L=l.exec(_),T=/^\s*$/.test(_.slice(0,y.ch));if(!c[b].empty()||!E&&!F||!L||T){p.execCommand("newlineAndIndent");return}if(s.test(_)){var O=F&&/>\s*$/.test(_),N=!/>\s*$/.test(_);(O||N)&&p.replaceRange("",{line:y.line,ch:0},{line:y.line,ch:y.ch+1}),h[b]=`
`}else{var P=L[1],I=L[5],W=!(a.test(L[2])||L[2].indexOf(">")>=0),j=W?parseInt(L[3],10)+1+L[4]:L[2].replace("x"," ");h[b]=`
`+P+j+I,W&&f(p,y)}}p.replaceSelections(h)};function f(p,c){var h=c.line,b=0,y=0,x=l.exec(p.getLine(h)),C=x[1];do{b+=1;var E=h+b,F=p.getLine(E),_=l.exec(F);if(_){var L=_[1],T=parseInt(x[3],10)+b-y,O=parseInt(_[3],10),N=O;if(C===L&&!isNaN(O))T===O&&(N=O+1),T>O&&(N=T+1),p.replaceRange(F.replace(l,L+N+_[4]+_[5]),{line:E,ch:0},{line:E,ch:F.length});else{if(C.length>L.length||C.length<L.length&&b===1)return;y+=1}}}while(_)}})});var $u=lt(()=>{var Ju=Et();Ju.commands.tabAndIndentMarkdownList=function(o){var l=o.listSelections(),s=l[0].head,a=o.getStateAfter(s.line),f=a.list!==!1;if(f){o.execCommand("indentMore");return}if(o.options.indentWithTabs)o.execCommand("insertTab");else{var p=Array(o.options.tabSize+1).join(" ");o.replaceSelection(p)}};Ju.commands.shiftTabAndUnindentMarkdownList=function(o){var l=o.listSelections(),s=l[0].head,a=o.getStateAfter(s.line),f=a.list!==!1;if(f){o.execCommand("indentLess");return}if(o.options.indentWithTabs)o.execCommand("insertTab");else{var p=Array(o.options.tabSize+1).join(" ");o.replaceSelection(p)}}});var tf=lt((Vu,ef)=>{(function(o){typeof Vu=="object"&&typeof ef=="object"?o(Et()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineOption("fullScreen",!1,function(a,f,p){p==o.Init&&(p=!1),!p!=!f&&(f?l(a):s(a))});function l(a){var f=a.getWrapperElement();a.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:f.style.width,height:f.style.height},f.style.width="",f.style.height="auto",f.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",a.refresh()}function s(a){var f=a.getWrapperElement();f.className=f.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var p=a.state.fullScreenRestore;f.style.width=p.width,f.style.height=p.height,window.scrollTo(p.scrollLeft,p.scrollTop),a.refresh()}})});var il=lt((rf,nf)=>{(function(o){typeof rf=="object"&&typeof nf=="object"?o(Et()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var l={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},s={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};o.defineMode("xml",function(a,f){var p=a.indentUnit,c={},h=f.htmlMode?l:s;for(var b in h)c[b]=h[b];for(var b in f)c[b]=f[b];var y,x;function C(S,R){function z(De){return R.tokenize=De,De(S,R)}var K=S.next();if(K=="<")return S.eat("!")?S.eat("[")?S.match("CDATA[")?z(_("atom","]]>")):null:S.match("--")?z(_("comment","-->")):S.match("DOCTYPE",!0,!0)?(S.eatWhile(/[\w\._\-]/),z(L(1))):null:S.eat("?")?(S.eatWhile(/[\w\._\-]/),R.tokenize=_("meta","?>"),"meta"):(y=S.eat("/")?"closeTag":"openTag",R.tokenize=E,"tag bracket");if(K=="&"){var ue;return S.eat("#")?S.eat("x")?ue=S.eatWhile(/[a-fA-F\d]/)&&S.eat(";"):ue=S.eatWhile(/[\d]/)&&S.eat(";"):ue=S.eatWhile(/[\w\.\-:]/)&&S.eat(";"),ue?"atom":"error"}else return S.eatWhile(/[^&<]/),null}C.isInText=!0;function E(S,R){var z=S.next();if(z==">"||z=="/"&&S.eat(">"))return R.tokenize=C,y=z==">"?"endTag":"selfcloseTag","tag bracket";if(z=="=")return y="equals",null;if(z=="<"){R.tokenize=C,R.state=I,R.tagName=R.tagStart=null;var K=R.tokenize(S,R);return K?K+" tag error":"tag error"}else return/[\'\"]/.test(z)?(R.tokenize=F(z),R.stringStartCol=S.column(),R.tokenize(S,R)):(S.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function F(S){var R=function(z,K){for(;!z.eol();)if(z.next()==S){K.tokenize=E;break}return"string"};return R.isInAttribute=!0,R}function _(S,R){return function(z,K){for(;!z.eol();){if(z.match(R)){K.tokenize=C;break}z.next()}return S}}function L(S){return function(R,z){for(var K;(K=R.next())!=null;){if(K=="<")return z.tokenize=L(S+1),z.tokenize(R,z);if(K==">")if(S==1){z.tokenize=C;break}else return z.tokenize=L(S-1),z.tokenize(R,z)}return"meta"}}function T(S){return S&&S.toLowerCase()}function O(S,R,z){this.prev=S.context,this.tagName=R||"",this.indent=S.indented,this.startOfLine=z,(c.doNotIndent.hasOwnProperty(R)||S.context&&S.context.noIndent)&&(this.noIndent=!0)}function N(S){S.context&&(S.context=S.context.prev)}function P(S,R){for(var z;;){if(!S.context||(z=S.context.tagName,!c.contextGrabbers.hasOwnProperty(T(z))||!c.contextGrabbers[T(z)].hasOwnProperty(T(R))))return;N(S)}}function I(S,R,z){return S=="openTag"?(z.tagStart=R.column(),W):S=="closeTag"?j:I}function W(S,R,z){return S=="word"?(z.tagName=R.current(),x="tag",U):c.allowMissingTagName&&S=="endTag"?(x="tag bracket",U(S,R,z)):(x="error",W)}function j(S,R,z){if(S=="word"){var K=R.current();return z.context&&z.context.tagName!=K&&c.implicitlyClosed.hasOwnProperty(T(z.context.tagName))&&N(z),z.context&&z.context.tagName==K||c.matchClosing===!1?(x="tag",X):(x="tag error",be)}else return c.allowMissingTagName&&S=="endTag"?(x="tag bracket",X(S,R,z)):(x="error",be)}function X(S,R,z){return S!="endTag"?(x="error",X):(N(z),I)}function be(S,R,z){return x="error",X(S,R,z)}function U(S,R,z){if(S=="word")return x="attribute",ae;if(S=="endTag"||S=="selfcloseTag"){var K=z.tagName,ue=z.tagStart;return z.tagName=z.tagStart=null,S=="selfcloseTag"||c.autoSelfClosers.hasOwnProperty(T(K))?P(z,K):(P(z,K),z.context=new O(z,K,ue==z.indented)),I}return x="error",U}function ae(S,R,z){return S=="equals"?ne:(c.allowMissing||(x="error"),U(S,R,z))}function ne(S,R,z){return S=="string"?se:S=="word"&&c.allowUnquoted?(x="string",U):(x="error",U(S,R,z))}function se(S,R,z){return S=="string"?se:U(S,R,z)}return{startState:function(S){var R={tokenize:C,state:I,indented:S||0,tagName:null,tagStart:null,context:null};return S!=null&&(R.baseIndent=S),R},token:function(S,R){if(!R.tagName&&S.sol()&&(R.indented=S.indentation()),S.eatSpace())return null;y=null;var z=R.tokenize(S,R);return(z||y)&&z!="comment"&&(x=null,R.state=R.state(y||z,S,R),x&&(z=x=="error"?z+" error":x)),z},indent:function(S,R,z){var K=S.context;if(S.tokenize.isInAttribute)return S.tagStart==S.indented?S.stringStartCol+1:S.indented+p;if(K&&K.noIndent)return o.Pass;if(S.tokenize!=E&&S.tokenize!=C)return z?z.match(/^(\s*)/)[0].length:0;if(S.tagName)return c.multilineTagIndentPastTag!==!1?S.tagStart+S.tagName.length+2:S.tagStart+p*(c.multilineTagIndentFactor||1);if(c.alignCDATA&&/<!\[CDATA\[/.test(R))return 0;var ue=R&&/^<(\/)?([\w_:\.-]*)/.exec(R);if(ue&&ue[1])for(;K;)if(K.tagName==ue[2]){K=K.prev;break}else if(c.implicitlyClosed.hasOwnProperty(T(K.tagName)))K=K.prev;else break;else if(ue)for(;K;){var De=c.contextGrabbers[T(K.tagName)];if(De&&De.hasOwnProperty(T(ue[2])))K=K.prev;else break}for(;K&&K.prev&&!K.startOfLine;)K=K.prev;return K?K.indent+p:S.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:c.htmlMode?"html":"xml",helperType:c.htmlMode?"html":"xml",skipAttribute:function(S){S.state==ne&&(S.state=U)},xmlCurrentTag:function(S){return S.tagName?{name:S.tagName,close:S.type=="closeTag"}:null},xmlCurrentContext:function(S){for(var R=[],z=S.context;z;z=z.prev)R.push(z.tagName);return R.reverse()}}}),o.defineMIME("text/xml","xml"),o.defineMIME("application/xml","xml"),o.mimeModes.hasOwnProperty("text/html")||o.defineMIME("text/html",{name:"xml",htmlMode:!0})})});var lf=lt((of,af)=>{(function(o){typeof of=="object"&&typeof af=="object"?o(Et()):typeof define=="function"&&define.amd?define(["../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.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 l=0;l<o.modeInfo.length;l++){var s=o.modeInfo[l];s.mimes&&(s.mime=s.mimes[0])}o.findModeByMIME=function(a){a=a.toLowerCase();for(var f=0;f<o.modeInfo.length;f++){var p=o.modeInfo[f];if(p.mime==a)return p;if(p.mimes){for(var c=0;c<p.mimes.length;c++)if(p.mimes[c]==a)return p}}if(/\+xml$/.test(a))return o.findModeByMIME("application/xml");if(/\+json$/.test(a))return o.findModeByMIME("application/json")},o.findModeByExtension=function(a){a=a.toLowerCase();for(var f=0;f<o.modeInfo.length;f++){var p=o.modeInfo[f];if(p.ext){for(var c=0;c<p.ext.length;c++)if(p.ext[c]==a)return p}}},o.findModeByFileName=function(a){for(var f=0;f<o.modeInfo.length;f++){var p=o.modeInfo[f];if(p.file&&p.file.test(a))return p}var c=a.lastIndexOf("."),h=c>-1&&a.substring(c+1,a.length);if(h)return o.findModeByExtension(h)},o.findModeByName=function(a){a=a.toLowerCase();for(var f=0;f<o.modeInfo.length;f++){var p=o.modeInfo[f];if(p.name.toLowerCase()==a)return p;if(p.alias){for(var c=0;c<p.alias.length;c++)if(p.alias[c].toLowerCase()==a)return p}}}})});var ol=lt((sf,uf)=>{(function(o){typeof sf=="object"&&typeof uf=="object"?o(Et(),il(),lf()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],o):o(CodeMirror)})(function(o){"use strict";o.defineMode("markdown",function(l,s){var a=o.getMode(l,"text/html"),f=a.name=="null";function p(A){if(o.findModeByName){var D=o.findModeByName(A);D&&(A=D.mime||D.mimes[0])}var ee=o.getMode(l,A);return ee.name=="null"?null:ee}s.highlightFormatting===void 0&&(s.highlightFormatting=!1),s.maxBlockquoteDepth===void 0&&(s.maxBlockquoteDepth=0),s.taskLists===void 0&&(s.taskLists=!1),s.strikethrough===void 0&&(s.strikethrough=!1),s.emoji===void 0&&(s.emoji=!1),s.fencedCodeBlockHighlighting===void 0&&(s.fencedCodeBlockHighlighting=!0),s.fencedCodeBlockDefaultMode===void 0&&(s.fencedCodeBlockDefaultMode="text/plain"),s.xml===void 0&&(s.xml=!0),s.tokenTypeOverrides===void 0&&(s.tokenTypeOverrides={});var c={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 h in c)c.hasOwnProperty(h)&&s.tokenTypeOverrides[h]&&(c[h]=s.tokenTypeOverrides[h]);var b=/^([*\-_])(?:\s*\1){2,}\s*$/,y=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,x=/^\[(x| )\](?=\s)/i,C=s.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,E=/^ {0,3}(?:\={1,}|-{2,})\s*$/,F=/^[^#!\[\]*_\\<>` "'(~:]+/,_=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,L=/^\s*\[[^\]]+?\]:.*$/,T=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,O=" ";function N(A,D,ee){return D.f=D.inline=ee,ee(A,D)}function P(A,D,ee){return D.f=D.block=ee,ee(A,D)}function I(A){return!A||!/\S/.test(A.string)}function W(A){if(A.linkTitle=!1,A.linkHref=!1,A.linkText=!1,A.em=!1,A.strong=!1,A.strikethrough=!1,A.quote=0,A.indentedCode=!1,A.f==X){var D=f;if(!D){var ee=o.innerMode(a,A.htmlState);D=ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText}D&&(A.f=ne,A.block=j,A.htmlState=null)}return A.trailingSpace=0,A.trailingSpaceNewLine=!1,A.prevLine=A.thisLine,A.thisLine={stream:null},null}function j(A,D){var ee=A.column()===D.indentation,we=I(D.prevLine.stream),he=D.indentedCode,$e=D.prevLine.hr,Tt=D.list!==!1,Ke=(D.listStack[D.listStack.length-1]||0)+3;D.indentedCode=!1;var ct=D.indentation;if(D.indentationDiff===null&&(D.indentationDiff=D.indentation,Tt)){for(D.list=null;ct<D.listStack[D.listStack.length-1];)D.listStack.pop(),D.listStack.length?D.indentation=D.listStack[D.listStack.length-1]:D.list=!1;D.list!==!1&&(D.indentationDiff=ct-D.listStack[D.listStack.length-1])}var Be=!we&&!$e&&!D.prevLine.header&&(!Tt||!he)&&!D.prevLine.fencedCodeEnd,ze=(D.list===!1||$e||we)&&D.indentation<=Ke&&A.match(b),Ye=null;if(D.indentationDiff>=4&&(he||D.prevLine.fencedCodeEnd||D.prevLine.header||we))return A.skipToEnd(),D.indentedCode=!0,c.code;if(A.eatSpace())return null;if(ee&&D.indentation<=Ke&&(Ye=A.match(C))&&Ye[1].length<=6)return D.quote=0,D.header=Ye[1].length,D.thisLine.header=!0,s.highlightFormatting&&(D.formatting="header"),D.f=D.inline,U(D);if(D.indentation<=Ke&&A.eat(">"))return D.quote=ee?1:D.quote+1,s.highlightFormatting&&(D.formatting="quote"),A.eatSpace(),U(D);if(!ze&&!D.setext&&ee&&D.indentation<=Ke&&(Ye=A.match(y))){var vt=Ye[1]?"ol":"ul";return D.indentation=ct+A.current().length,D.list=!0,D.quote=0,D.listStack.push(D.indentation),D.em=!1,D.strong=!1,D.code=!1,D.strikethrough=!1,s.taskLists&&A.match(x,!1)&&(D.taskList=!0),D.f=D.inline,s.highlightFormatting&&(D.formatting=["list","list-"+vt]),U(D)}else{if(ee&&D.indentation<=Ke&&(Ye=A.match(_,!0)))return D.quote=0,D.fencedEndRE=new RegExp(Ye[1]+"+ *$"),D.localMode=s.fencedCodeBlockHighlighting&&p(Ye[2]||s.fencedCodeBlockDefaultMode),D.localMode&&(D.localState=o.startState(D.localMode)),D.f=D.block=be,s.highlightFormatting&&(D.formatting="code-block"),D.code=-1,U(D);if(D.setext||(!Be||!Tt)&&!D.quote&&D.list===!1&&!D.code&&!ze&&!L.test(A.string)&&(Ye=A.lookAhead(1))&&(Ye=Ye.match(E)))return D.setext?(D.header=D.setext,D.setext=0,A.skipToEnd(),s.highlightFormatting&&(D.formatting="header")):(D.header=Ye[0].charAt(0)=="="?1:2,D.setext=D.header),D.thisLine.header=!0,D.f=D.inline,U(D);if(ze)return A.skipToEnd(),D.hr=!0,D.thisLine.hr=!0,c.hr;if(A.peek()==="[")return N(A,D,K)}return N(A,D,D.inline)}function X(A,D){var ee=a.token(A,D.htmlState);if(!f){var we=o.innerMode(a,D.htmlState);(we.mode.name=="xml"&&we.state.tagStart===null&&!we.state.context&&we.state.tokenize.isInText||D.md_inside&&A.current().indexOf(">")>-1)&&(D.f=ne,D.block=j,D.htmlState=null)}return ee}function be(A,D){var ee=D.listStack[D.listStack.length-1]||0,we=D.indentation<ee,he=ee+3;if(D.fencedEndRE&&D.indentation<=he&&(we||A.match(D.fencedEndRE))){s.highlightFormatting&&(D.formatting="code-block");var $e;return we||($e=U(D)),D.localMode=D.localState=null,D.block=j,D.f=ne,D.fencedEndRE=null,D.code=0,D.thisLine.fencedCodeEnd=!0,we?P(A,D,D.block):$e}else return D.localMode?D.localMode.token(A,D.localState):(A.skipToEnd(),c.code)}function U(A){var D=[];if(A.formatting){D.push(c.formatting),typeof A.formatting=="string"&&(A.formatting=[A.formatting]);for(var ee=0;ee<A.formatting.length;ee++)D.push(c.formatting+"-"+A.formatting[ee]),A.formatting[ee]==="header"&&D.push(c.formatting+"-"+A.formatting[ee]+"-"+A.header),A.formatting[ee]==="quote"&&(!s.maxBlockquoteDepth||s.maxBlockquoteDepth>=A.quote?D.push(c.formatting+"-"+A.formatting[ee]+"-"+A.quote):D.push("error"))}if(A.taskOpen)return D.push("meta"),D.length?D.join(" "):null;if(A.taskClosed)return D.push("property"),D.length?D.join(" "):null;if(A.linkHref?D.push(c.linkHref,"url"):(A.strong&&D.push(c.strong),A.em&&D.push(c.em),A.strikethrough&&D.push(c.strikethrough),A.emoji&&D.push(c.emoji),A.linkText&&D.push(c.linkText),A.code&&D.push(c.code),A.image&&D.push(c.image),A.imageAltText&&D.push(c.imageAltText,"link"),A.imageMarker&&D.push(c.imageMarker)),A.header&&D.push(c.header,c.header+"-"+A.header),A.quote&&(D.push(c.quote),!s.maxBlockquoteDepth||s.maxBlockquoteDepth>=A.quote?D.push(c.quote+"-"+A.quote):D.push(c.quote+"-"+s.maxBlockquoteDepth)),A.list!==!1){var we=(A.listStack.length-1)%3;we?we===1?D.push(c.list2):D.push(c.list3):D.push(c.list1)}return A.trailingSpaceNewLine?D.push("trailing-space-new-line"):A.trailingSpace&&D.push("trailing-space-"+(A.trailingSpace%2?"a":"b")),D.length?D.join(" "):null}function ae(A,D){if(A.match(F,!0))return U(D)}function ne(A,D){var ee=D.text(A,D);if(typeof ee<"u")return ee;if(D.list)return D.list=null,U(D);if(D.taskList){var we=A.match(x,!0)[1]===" ";return we?D.taskOpen=!0:D.taskClosed=!0,s.highlightFormatting&&(D.formatting="task"),D.taskList=!1,U(D)}if(D.taskOpen=!1,D.taskClosed=!1,D.header&&A.match(/^#+$/,!0))return s.highlightFormatting&&(D.formatting="header"),U(D);var he=A.next();if(D.linkTitle){D.linkTitle=!1;var $e=he;he==="("&&($e=")"),$e=($e+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Tt="^\\s*(?:[^"+$e+"\\\\]+|\\\\\\\\|\\\\.)"+$e;if(A.match(new RegExp(Tt),!0))return c.linkHref}if(he==="`"){var Ke=D.formatting;s.highlightFormatting&&(D.formatting="code"),A.eatWhile("`");var ct=A.current().length;if(D.code==0&&(!D.quote||ct==1))return D.code=ct,U(D);if(ct==D.code){var Be=U(D);return D.code=0,Be}else return D.formatting=Ke,U(D)}else if(D.code)return U(D);if(he==="\\"&&(A.next(),s.highlightFormatting)){var ze=U(D),Ye=c.formatting+"-escape";return ze?ze+" "+Ye:Ye}if(he==="!"&&A.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return D.imageMarker=!0,D.image=!0,s.highlightFormatting&&(D.formatting="image"),U(D);if(he==="["&&D.imageMarker&&A.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return D.imageMarker=!1,D.imageAltText=!0,s.highlightFormatting&&(D.formatting="image"),U(D);if(he==="]"&&D.imageAltText){s.highlightFormatting&&(D.formatting="image");var ze=U(D);return D.imageAltText=!1,D.image=!1,D.inline=D.f=S,ze}if(he==="["&&!D.image)return D.linkText&&A.match(/^.*?\]/)||(D.linkText=!0,s.highlightFormatting&&(D.formatting="link")),U(D);if(he==="]"&&D.linkText){s.highlightFormatting&&(D.formatting="link");var ze=U(D);return D.linkText=!1,D.inline=D.f=A.match(/\(.*?\)| ?\[.*?\]/,!1)?S:ne,ze}if(he==="<"&&A.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){D.f=D.inline=se,s.highlightFormatting&&(D.formatting="link");var ze=U(D);return ze?ze+=" ":ze="",ze+c.linkInline}if(he==="<"&&A.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){D.f=D.inline=se,s.highlightFormatting&&(D.formatting="link");var ze=U(D);return ze?ze+=" ":ze="",ze+c.linkEmail}if(s.xml&&he==="<"&&A.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var vt=A.string.indexOf(">",A.pos);if(vt!=-1){var Tn=A.string.substring(A.start,vt);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Tn)&&(D.md_inside=!0)}return A.backUp(1),D.htmlState=o.startState(a),P(A,D,X)}if(s.xml&&he==="<"&&A.match(/^\/\w*?>/))return D.md_inside=!1,"tag";if(he==="*"||he==="_"){for(var Xt=1,Kt=A.pos==1?" ":A.string.charAt(A.pos-2);Xt<3&&A.eat(he);)Xt++;var zt=A.peek()||" ",pr=!/\s/.test(zt)&&(!T.test(zt)||/\s/.test(Kt)||T.test(Kt)),Ce=!/\s/.test(Kt)&&(!T.test(Kt)||/\s/.test(zt)||T.test(zt)),Ht=null,gr=null;if(Xt%2&&(!D.em&&pr&&(he==="*"||!Ce||T.test(Kt))?Ht=!0:D.em==he&&Ce&&(he==="*"||!pr||T.test(zt))&&(Ht=!1)),Xt>1&&(!D.strong&&pr&&(he==="*"||!Ce||T.test(Kt))?gr=!0:D.strong==he&&Ce&&(he==="*"||!pr||T.test(zt))&&(gr=!1)),gr!=null||Ht!=null){s.highlightFormatting&&(D.formatting=Ht==null?"strong":gr==null?"em":"strong em"),Ht===!0&&(D.em=he),gr===!0&&(D.strong=he);var Be=U(D);return Ht===!1&&(D.em=!1),gr===!1&&(D.strong=!1),Be}}else if(he===" "&&(A.eat("*")||A.eat("_"))){if(A.peek()===" ")return U(D);A.backUp(1)}if(s.strikethrough){if(he==="~"&&A.eatWhile(he)){if(D.strikethrough){s.highlightFormatting&&(D.formatting="strikethrough");var Be=U(D);return D.strikethrough=!1,Be}else if(A.match(/^[^\s]/,!1))return D.strikethrough=!0,s.highlightFormatting&&(D.formatting="strikethrough"),U(D)}else if(he===" "&&A.match("~~",!0)){if(A.peek()===" ")return U(D);A.backUp(2)}}if(s.emoji&&he===":"&&A.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){D.emoji=!0,s.highlightFormatting&&(D.formatting="emoji");var Di=U(D);return D.emoji=!1,Di}return he===" "&&(A.match(/^ +$/,!1)?D.trailingSpace++:D.trailingSpace&&(D.trailingSpaceNewLine=!0)),U(D)}function se(A,D){var ee=A.next();if(ee===">"){D.f=D.inline=ne,s.highlightFormatting&&(D.formatting="link");var we=U(D);return we?we+=" ":we="",we+c.linkInline}return A.match(/^[^>]+/,!0),c.linkInline}function S(A,D){if(A.eatSpace())return null;var ee=A.next();return ee==="("||ee==="["?(D.f=D.inline=z(ee==="("?")":"]"),s.highlightFormatting&&(D.formatting="link-string"),D.linkHref=!0,U(D)):"error"}var R={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function z(A){return function(D,ee){var we=D.next();if(we===A){ee.f=ee.inline=ne,s.highlightFormatting&&(ee.formatting="link-string");var he=U(ee);return ee.linkHref=!1,he}return D.match(R[A]),ee.linkHref=!0,U(ee)}}function K(A,D){return A.match(/^([^\]\\]|\\.)*\]:/,!1)?(D.f=ue,A.next(),s.highlightFormatting&&(D.formatting="link"),D.linkText=!0,U(D)):N(A,D,ne)}function ue(A,D){if(A.match("]:",!0)){D.f=D.inline=De,s.highlightFormatting&&(D.formatting="link");var ee=U(D);return D.linkText=!1,ee}return A.match(/^([^\]\\]|\\.)+/,!0),c.linkText}function De(A,D){return A.eatSpace()?null:(A.match(/^[^\s]+/,!0),A.peek()===void 0?D.linkTitle=!0:A.match(/^(?:\s+(?:"(?:[^"\\]|\\.)+"|'(?:[^'\\]|\\.)+'|\((?:[^)\\]|\\.)+\)))?/,!0),D.f=D.inline=ne,c.linkHref+" url")}var ot={startState:function(){return{f:j,prevLine:{stream:null},thisLine:{stream:null},block:j,htmlState:null,indentation:0,inline:ne,text:ae,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(A){return{f:A.f,prevLine:A.prevLine,thisLine:A.thisLine,block:A.block,htmlState:A.htmlState&&o.copyState(a,A.htmlState),indentation:A.indentation,localMode:A.localMode,localState:A.localMode?o.copyState(A.localMode,A.localState):null,inline:A.inline,text:A.text,formatting:!1,linkText:A.linkText,linkTitle:A.linkTitle,linkHref:A.linkHref,code:A.code,em:A.em,strong:A.strong,strikethrough:A.strikethrough,emoji:A.emoji,header:A.header,setext:A.setext,hr:A.hr,taskList:A.taskList,list:A.list,listStack:A.listStack.slice(0),quote:A.quote,indentedCode:A.indentedCode,trailingSpace:A.trailingSpace,trailingSpaceNewLine:A.trailingSpaceNewLine,md_inside:A.md_inside,fencedEndRE:A.fencedEndRE}},token:function(A,D){if(D.formatting=!1,A!=D.thisLine.stream){if(D.header=0,D.hr=!1,A.match(/^\s*$/,!0))return W(D),null;if(D.prevLine=D.thisLine,D.thisLine={stream:A},D.taskList=!1,D.trailingSpace=0,D.trailingSpaceNewLine=!1,!D.localState&&(D.f=D.block,D.f!=X)){var ee=A.match(/^\s*/,!0)[0].replace(/\t/g,O).length;if(D.indentation=ee,D.indentationDiff=null,ee>0)return null}}return D.f(A,D)},innerMode:function(A){return A.block==X?{state:A.htmlState,mode:a}:A.localState?{state:A.localState,mode:A.localMode}:{state:A,mode:ot}},indent:function(A,D,ee){return A.block==X&&a.indent?a.indent(A.htmlState,D,ee):A.localState&&A.localMode.indent?A.localMode.indent(A.localState,D,ee):o.Pass},blankLine:W,getType:U,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return ot},"xml"),o.defineMIME("text/markdown","markdown"),o.defineMIME("text/x-markdown","markdown")})});var al=lt((ff,cf)=>{(function(o){typeof ff=="object"&&typeof cf=="object"?o(Et()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.overlayMode=function(l,s,a){return{startState:function(){return{base:o.startState(l),overlay:o.startState(s),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(f){return{base:o.copyState(l,f.base),overlay:o.copyState(s,f.overlay),basePos:f.basePos,baseCur:null,overlayPos:f.overlayPos,overlayCur:null}},token:function(f,p){return(f!=p.streamSeen||Math.min(p.basePos,p.overlayPos)<f.start)&&(p.streamSeen=f,p.basePos=p.overlayPos=f.start),f.start==p.basePos&&(p.baseCur=l.token(f,p.base),p.basePos=f.pos),f.start==p.overlayPos&&(f.pos=f.start,p.overlayCur=s.token(f,p.overlay),p.overlayPos=f.pos),f.pos=Math.min(p.basePos,p.overlayPos),p.overlayCur==null?p.baseCur:p.baseCur!=null&&p.overlay.combineTokens||a&&p.overlay.combineTokens==null?p.baseCur+" "+p.overlayCur:p.overlayCur},indent:l.indent&&function(f,p,c){return l.indent(f.base,p,c)},electricChars:l.electricChars,innerMode:function(f){return{state:f.base,mode:l}},blankLine:function(f){var p,c;return l.blankLine&&(p=l.blankLine(f.base)),s.blankLine&&(c=s.blankLine(f.overlay)),c==null?p:a&&p!=null?p+" "+c:c}}}})});var pf=lt((df,hf)=>{(function(o){typeof df=="object"&&typeof hf=="object"?o(Et()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){o.defineOption("placeholder","",function(h,b,y){var x=y&&y!=o.Init;if(b&&!x)h.on("blur",f),h.on("change",p),h.on("swapDoc",p),o.on(h.getInputField(),"compositionupdate",h.state.placeholderCompose=function(){a(h)}),p(h);else if(!b&&x){h.off("blur",f),h.off("change",p),h.off("swapDoc",p),o.off(h.getInputField(),"compositionupdate",h.state.placeholderCompose),l(h);var C=h.getWrapperElement();C.className=C.className.replace(" CodeMirror-empty","")}b&&!h.hasFocus()&&f(h)});function l(h){h.state.placeholder&&(h.state.placeholder.parentNode.removeChild(h.state.placeholder),h.state.placeholder=null)}function s(h){l(h);var b=h.state.placeholder=document.createElement("pre");b.style.cssText="height: 0; overflow: visible",b.style.direction=h.getOption("direction"),b.className="CodeMirror-placeholder CodeMirror-line-like";var y=h.getOption("placeholder");typeof y=="string"&&(y=document.createTextNode(y)),b.appendChild(y),h.display.lineSpace.insertBefore(b,h.display.lineSpace.firstChild)}function a(h){setTimeout(function(){var b=!1;if(h.lineCount()==1){var y=h.getInputField();b=y.nodeName=="TEXTAREA"?!h.getLine(0).length:!/[^\u200b]/.test(y.querySelector(".CodeMirror-line").textContent)}b?s(h):l(h)},20)}function f(h){c(h)&&s(h)}function p(h){var b=h.getWrapperElement(),y=c(h);b.className=b.className.replace(" CodeMirror-empty","")+(y?" CodeMirror-empty":""),y?s(h):l(h)}function c(h){return h.lineCount()===1&&h.getLine(0)===""}})});var mf=lt((gf,vf)=>{(function(o){typeof gf=="object"&&typeof vf=="object"?o(Et()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineOption("autoRefresh",!1,function(a,f){a.state.autoRefresh&&(s(a,a.state.autoRefresh),a.state.autoRefresh=null),f&&a.display.wrapper.offsetHeight==0&&l(a,a.state.autoRefresh={delay:f.delay||250})});function l(a,f){function p(){a.display.wrapper.offsetHeight?(s(a,f),a.display.lastWrapHeight!=a.display.wrapper.clientHeight&&a.refresh()):f.timeout=setTimeout(p,f.delay)}f.timeout=setTimeout(p,f.delay),f.hurry=function(){clearTimeout(f.timeout),f.timeout=setTimeout(p,50)},o.on(window,"mouseup",f.hurry),o.on(window,"keyup",f.hurry)}function s(a,f){clearTimeout(f.timeout),o.off(window,"mouseup",f.hurry),o.off(window,"keyup",f.hurry)}})});var xf=lt((bf,yf)=>{(function(o){typeof bf=="object"&&typeof yf=="object"?o(Et()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";o.defineOption("styleSelectedText",!1,function(x,C,E){var F=E&&E!=o.Init;C&&!F?(x.state.markedSelection=[],x.state.markedSelectionStyle=typeof C=="string"?C:"CodeMirror-selectedtext",b(x),x.on("cursorActivity",l),x.on("change",s)):!C&&F&&(x.off("cursorActivity",l),x.off("change",s),h(x),x.state.markedSelection=x.state.markedSelectionStyle=null)});function l(x){x.state.markedSelection&&x.operation(function(){y(x)})}function s(x){x.state.markedSelection&&x.state.markedSelection.length&&x.operation(function(){h(x)})}var a=8,f=o.Pos,p=o.cmpPos;function c(x,C,E,F){if(p(C,E)!=0)for(var _=x.state.markedSelection,L=x.state.markedSelectionStyle,T=C.line;;){var O=T==C.line?C:f(T,0),N=T+a,P=N>=E.line,I=P?E:f(N,0),W=x.markText(O,I,{className:L});if(F==null?_.push(W):_.splice(F++,0,W),P)break;T=N}}function h(x){for(var C=x.state.markedSelection,E=0;E<C.length;++E)C[E].clear();C.length=0}function b(x){h(x);for(var C=x.listSelections(),E=0;E<C.length;E++)c(x,C[E].from(),C[E].to())}function y(x){if(!x.somethingSelected())return h(x);if(x.listSelections().length>1)return b(x);var C=x.getCursor("start"),E=x.getCursor("end"),F=x.state.markedSelection;if(!F.length)return c(x,C,E);var _=F[0].find(),L=F[F.length-1].find();if(!_||!L||E.line-C.line<=a||p(C,L.to)>=0||p(E,_.from)<=0)return b(x);for(;p(C,_.from)>0;)F.shift().clear(),_=F[0].find();for(p(C,_.from)<0&&(_.to.line-C.line<a?(F.shift().clear(),c(x,C,_.to,0)):c(x,C,_.from,0));p(E,L.to)<0;)F.pop().clear(),L=F[F.length-1].find();p(E,L.to)>0&&(E.line-L.from.line<a?(F.pop().clear(),c(x,L.from,E)):c(x,L.to,E))}})});var Cf=lt((Df,wf)=>{(function(o){typeof Df=="object"&&typeof wf=="object"?o(Et()):typeof define=="function"&&define.amd?define(["../../lib/codemirror"],o):o(CodeMirror)})(function(o){"use strict";var l=o.Pos;function s(T){var O=T.flags;return O??(T.ignoreCase?"i":"")+(T.global?"g":"")+(T.multiline?"m":"")}function a(T,O){for(var N=s(T),P=N,I=0;I<O.length;I++)P.indexOf(O.charAt(I))==-1&&(P+=O.charAt(I));return N==P?T:new RegExp(T.source,P)}function f(T){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(T.source)}function p(T,O,N){O=a(O,"g");for(var P=N.line,I=N.ch,W=T.lastLine();P<=W;P++,I=0){O.lastIndex=I;var j=T.getLine(P),X=O.exec(j);if(X)return{from:l(P,X.index),to:l(P,X.index+X[0].length),match:X}}}function c(T,O,N){if(!f(O))return p(T,O,N);O=a(O,"gm");for(var P,I=1,W=N.line,j=T.lastLine();W<=j;){for(var X=0;X<I&&!(W>j);X++){var be=T.getLine(W++);P=P==null?be:P+`
`+be}I=I*2,O.lastIndex=N.ch;var U=O.exec(P);if(U){var ae=P.slice(0,U.index).split(`
`),ne=U[0].split(`
`),se=N.line+ae.length-1,S=ae[ae.length-1].length;return{from:l(se,S),to:l(se+ne.length-1,ne.length==1?S+ne[0].length:ne[ne.length-1].length),match:U}}}}function h(T,O,N){for(var P,I=0;I<=T.length;){O.lastIndex=I;var W=O.exec(T);if(!W)break;var j=W.index+W[0].length;if(j>T.length-N)break;(!P||j>P.index+P[0].length)&&(P=W),I=W.index+1}return P}function b(T,O,N){O=a(O,"g");for(var P=N.line,I=N.ch,W=T.firstLine();P>=W;P--,I=-1){var j=T.getLine(P),X=h(j,O,I<0?0:j.length-I);if(X)return{from:l(P,X.index),to:l(P,X.index+X[0].length),match:X}}}function y(T,O,N){if(!f(O))return b(T,O,N);O=a(O,"gm");for(var P,I=1,W=T.getLine(N.line).length-N.ch,j=N.line,X=T.firstLine();j>=X;){for(var be=0;be<I&&j>=X;be++){var U=T.getLine(j--);P=P==null?U:U+`
`+P}I*=2;var ae=h(P,O,W);if(ae){var ne=P.slice(0,ae.index).split(`
`),se=ae[0].split(`
`),S=j+ne.length,R=ne[ne.length-1].length;return{from:l(S,R),to:l(S+se.length-1,se.length==1?R+se[0].length:se[se.length-1].length),match:ae}}}}var x,C;String.prototype.normalize?(x=function(T){return T.normalize("NFD").toLowerCase()},C=function(T){return T.normalize("NFD")}):(x=function(T){return T.toLowerCase()},C=function(T){return T});function E(T,O,N,P){if(T.length==O.length)return N;for(var I=0,W=N+Math.max(0,T.length-O.length);;){if(I==W)return I;var j=I+W>>1,X=P(T.slice(0,j)).length;if(X==N)return j;X>N?W=j:I=j+1}}function F(T,O,N,P){if(!O.length)return null;var I=P?x:C,W=I(O).split(/\r|\n\r?/);e:for(var j=N.line,X=N.ch,be=T.lastLine()+1-W.length;j<=be;j++,X=0){var U=T.getLine(j).slice(X),ae=I(U);if(W.length==1){var ne=ae.indexOf(W[0]);if(ne==-1)continue e;var N=E(U,ae,ne,I)+X;return{from:l(j,E(U,ae,ne,I)+X),to:l(j,E(U,ae,ne+W[0].length,I)+X)}}else{var se=ae.length-W[0].length;if(ae.slice(se)!=W[0])continue e;for(var S=1;S<W.length-1;S++)if(I(T.getLine(j+S))!=W[S])continue e;var R=T.getLine(j+W.length-1),z=I(R),K=W[W.length-1];if(z.slice(0,K.length)!=K)continue e;return{from:l(j,E(U,ae,se,I)+X),to:l(j+W.length-1,E(R,z,K.length,I))}}}}function _(T,O,N,P){if(!O.length)return null;var I=P?x:C,W=I(O).split(/\r|\n\r?/);e:for(var j=N.line,X=N.ch,be=T.firstLine()-1+W.length;j>=be;j--,X=-1){var U=T.getLine(j);X>-1&&(U=U.slice(0,X));var ae=I(U);if(W.length==1){var ne=ae.lastIndexOf(W[0]);if(ne==-1)continue e;return{from:l(j,E(U,ae,ne,I)),to:l(j,E(U,ae,ne+W[0].length,I))}}else{var se=W[W.length-1];if(ae.slice(0,se.length)!=se)continue e;for(var S=1,N=j-W.length+1;S<W.length-1;S++)if(I(T.getLine(N+S))!=W[S])continue e;var R=T.getLine(j+1-W.length),z=I(R);if(z.slice(z.length-W[0].length)!=W[0])continue e;return{from:l(j+1-W.length,E(R,z,R.length-W[0].length,I)),to:l(j,E(U,ae,se.length,I))}}}}function L(T,O,N,P){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=T,N=N?T.clipPos(N):l(0,0),this.pos={from:N,to:N};var I;typeof P=="object"?I=P.caseFold:(I=P,P=null),typeof O=="string"?(I==null&&(I=!1),this.matches=function(W,j){return(W?_:F)(T,O,j,I)}):(O=a(O,"gm"),!P||P.multiline!==!1?this.matches=function(W,j){return(W?y:c)(T,O,j)}:this.matches=function(W,j){return(W?b:p)(T,O,j)})}L.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(T){var O=this.doc.clipPos(T?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(O=l(O.line,O.ch),T?(O.ch--,O.ch<0&&(O.line--,O.ch=(this.doc.getLine(O.line)||"").length)):(O.ch++,O.ch>(this.doc.getLine(O.line)||"").length&&(O.ch=0,O.line++)),o.cmpPos(O,this.doc.clipPos(O))!=0))return this.atOccurrence=!1;var N=this.matches(T,O);if(this.afterEmptyMatch=N&&o.cmpPos(N.from,N.to)==0,N)return this.pos=N,this.atOccurrence=!0,this.pos.match||!0;var P=l(T?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:P,to:P},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(T,O){if(this.atOccurrence){var N=o.splitLines(T);this.doc.replaceRange(N,this.pos.from,this.pos.to,O),this.pos.to=l(this.pos.from.line+N.length-1,N[N.length-1].length+(N.length==1?this.pos.from.ch:0))}}},o.defineExtension("getSearchCursor",function(T,O,N){return new L(this.doc,T,O,N)}),o.defineDocExtension("getSearchCursor",function(T,O,N){return new L(this,T,O,N)}),o.defineExtension("selectMatches",function(T,O){for(var N=[],P=this.getSearchCursor(T,this.getCursor("from"),O);P.findNext()&&!(o.cmpPos(P.to(),this.getCursor("to"))>0);)N.push({anchor:P.from(),head:P.to()});N.length&&this.setSelections(N,0)})})});var Ef=lt((kf,Sf)=>{(function(o){typeof kf=="object"&&typeof Sf=="object"?o(Et(),ol(),al()):typeof define=="function"&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],o):o(CodeMirror)})(function(o){"use strict";var l=/^((?:(?: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;o.defineMode("gfm",function(s,a){var f=0;function p(y){return y.code=!1,null}var c={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(y){return{code:y.code,codeBlock:y.codeBlock,ateSpace:y.ateSpace}},token:function(y,x){if(x.combineTokens=null,x.codeBlock)return y.match(/^```+/)?(x.codeBlock=!1,null):(y.skipToEnd(),null);if(y.sol()&&(x.code=!1),y.sol()&&y.match(/^```+/))return y.skipToEnd(),x.codeBlock=!0,null;if(y.peek()==="`"){y.next();var C=y.pos;y.eatWhile("`");var E=1+y.pos-C;return x.code?E===f&&(x.code=!1):(f=E,x.code=!0),null}else if(x.code)return y.next(),null;if(y.eatSpace())return x.ateSpace=!0,null;if((y.sol()||x.ateSpace)&&(x.ateSpace=!1,a.gitHubSpice!==!1)){if(y.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?=.{0,6}\d)(?:[a-f0-9]{7,40}\b)/))return x.combineTokens=!0,"link";if(y.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return x.combineTokens=!0,"link"}return y.match(l)&&y.string.slice(y.start-2,y.start)!="]("&&(y.start==0||/\W/.test(y.string.charAt(y.start-1)))?(x.combineTokens=!0,"link"):(y.next(),null)},blankLine:p},h={taskLists:!0,strikethrough:!0,emoji:!0};for(var b in a)h[b]=a[b];return h.name="markdown",o.overlayMode(o.getMode(s,h),c)},"markdown"),o.defineMIME("text/x-gfm","gfm")})});var Af=lt(()=>{});var Ff=lt((Ng,sl)=>{var ll;(function(){"use strict";ll=function(o,l,s,a){a=a||{},this.dictionary=null,this.rules={},this.dictionaryTable=new Map,this.compoundRules=[],this.compoundRuleCodes={},this.replacementTable=[],this.flags=a.flags||{},this.memoized={},this.loaded=!1;var f=this,p,c,h,b,y;o&&(f.dictionary=o,l&&s?F():(typeof window<"u"?(a.dictionaryPath?p=a.dictionaryPath:p="typo/dictionaries",window.chrome&&window.chrome.runtime&&window.chrome.runtime.getURL?p=window.chrome.runtime.getURL(p):window.browser&&window.browser.runtime&&window.browser.runtime.getURL&&(p=window.browser.runtime.getURL(p))):typeof __dirname<"u"?p=__dirname+"/dictionaries":p="./dictionaries",l||x(p+"/"+o+"/"+o+".aff",C),s||x(p+"/"+o+"/"+o+".dic",E)));function x(_,L){var T=f._readFile(_,null,a?.asyncLoad);a?.asyncLoad?T.then(function(O){L(O)}):L(T)}function C(_){l=_,s&&F()}function E(_){s=_,l&&F()}function F(){for(f.rules=f._parseAFF(l),f.compoundRuleCodes={},c=0,b=f.compoundRules.length;c<b;c++){var _=f.compoundRules[c];for(h=0,y=_.length;h<y;h++)f.compoundRuleCodes[_[h]]=[]}"ONLYINCOMPOUND"in f.flags&&(f.compoundRuleCodes[f.flags.ONLYINCOMPOUND]=[]),f.dictionaryTable=f._parseDIC(s);for(c in f.compoundRuleCodes)f.compoundRuleCodes[c].length===0&&delete f.compoundRuleCodes[c];for(c=0,b=f.compoundRules.length;c<b;c++){var L=f.compoundRules[c],T="";for(h=0,y=L.length;h<y;h++){var O=L[h];O in f.compoundRuleCodes?T+="("+f.compoundRuleCodes[O].join("|")+")":T+=O}f.compoundRules[c]=new RegExp("^"+T+"$","i")}f.loaded=!0,a?.asyncLoad&&a?.loadedCallback&&a.loadedCallback(f)}return this},ll.prototype={load:function(o){for(var l in o)o.hasOwnProperty(l)&&(this[l]=o[l]);return this},_readFile:function(o,l,s){var a;if(l=l||"utf8",typeof XMLHttpRequest<"u"){var f=new XMLHttpRequest;if(f.open("GET",o,!!s),(a=f.overrideMimeType)===null||a===void 0||a.call(f,"text/plain; charset="+l),s){var p=new Promise(function(h,b){f.onload=function(){f.status===200?h(f.responseText):b(f.statusText)},f.onerror=function(){b(f.statusText)}});return f.send(null),p}else return f.send(null),f.responseText}else if(typeof Ku<"u"){var c=Af();try{if(c.existsSync(o))return c.readFileSync(o,l);console.log("Path "+o+" does not exist.")}catch(h){console.log(h)}return""}return""},_parseAFF:function(o){var l={},s,a,f,p,c,h,b,y,x=o.split(/\r?\n/);for(c=0,b=x.length;c<b;c++)if(s=this._removeAffixComments(x[c]),s=s.trim(),!!s){var C=s.split(/\s+/),E=C[0];if(E==="PFX"||E==="SFX"){var F=C[1],_=C[2];f=parseInt(C[3],10);var L=[];for(h=c+1,y=c+1+f;h<y;h++){a=x[h],p=a.split(/\s+/);var T=p[2],O=p[3].split("/"),N=O[0];N==="0"&&(N="");var P=this.parseRuleCodes(O[1]),I=p[4],W={add:N};P.length>0&&(W.continuationClasses=P),I!=="."&&(E==="SFX"?W.match=new RegExp(I+"$"):W.match=new RegExp("^"+I)),T!="0"&&(E==="SFX"?W.remove=new RegExp(T+"$"):W.remove=T),L.push(W)}l[F]={type:E,combineable:_==="Y",entries:L},c+=f}else if(E==="COMPOUNDRULE"){for(f=parseInt(C[1],10),h=c+1,y=c+1+f;h<y;h++)s=x[h],p=s.split(/\s+/),this.compoundRules.push(p[1]);c+=f}else E==="REP"?(p=s.split(/\s+/),p.length===3&&this.replacementTable.push([p[1],p[2]])):this.flags[E]=C[1]}return l},_removeAffixComments:function(o){return o.match(/^\s*#/)?"":o},_parseDIC:function(o){o=this._removeDicComments(o);var l=o.split(/\r?\n/),s=new Map;function a(ae,ne){s.has(ae)||s.set(ae,null),ne.length>0&&(s.get(ae)===null&&s.set(ae,[]),s.get(ae).push(ne))}for(var f=1,p=l.length;f<p;f++){var c=l[f];if(c){var h=c.replace(/\s.*$/,""),b=h.split("/",2),y=b[0];if(b.length>1){var x=this.parseRuleCodes(b[1]);(!("NEEDAFFIX"in this.flags)||x.indexOf(this.flags.NEEDAFFIX)===-1)&&a(y,x);for(var C=0,E=x.length;C<E;C++){var F=x[C],_=this.rules[F];if(_)for(var L=this._applyRule(y,_),T=0,O=L.length;T<O;T++){var N=L[T];if(a(N,[]),_.combineable)for(var P=C+1;P<E;P++){var I=x[P],W=this.rules[I];if(W&&W.combineable&&_.type!=W.type)for(var j=this._applyRule(N,W),X=0,be=j.length;X<be;X++){var U=j[X];a(U,[])}}}F in this.compoundRuleCodes&&this.compoundRuleCodes[F].push(y)}}else a(y.trim(),[])}}return s},_removeDicComments:function(o){return o=o.replace(/^\t.*$/mg,""),o},parseRuleCodes:function(o){if(o)if("FLAG"in this.flags)if(this.flags.FLAG==="long"){for(var l=[],s=0,a=o.length;s<a;s+=2)l.push(o.substr(s,2));return l}else return this.flags.FLAG==="num"?o.split(","):this.flags.FLAG==="UTF-8"?Array.from(o):o.split("");else return o.split("");else return[]},_applyRule:function(o,l){for(var s=l.entries,a=[],f=0,p=s.length;f<p;f++){var c=s[f];if(!c.match||o.match(c.match)){var h=o;if(c.remove&&(h=h.replace(c.remove,"")),l.type==="SFX"?h=h+c.add:h=c.add+h,a.push(h),"continuationClasses"in c)for(var b=0,y=c.continuationClasses.length;b<y;b++){var x=this.rules[c.continuationClasses[b]];x&&(a=a.concat(this._applyRule(h,x)))}}}return a},check:function(o){if(!this.loaded)throw"Dictionary not loaded.";if(!o)return!1;var l=o.replace(/^\s\s*/,"").replace(/\s\s*$/,"");if(this.checkExact(l))return!0;if(l.toUpperCase()===l){var s=l[0]+l.substring(1).toLowerCase();if(this.hasFlag(s,"KEEPCASE"))return!1;if(this.checkExact(s)||this.checkExact(l.toLowerCase()))return!0}var a=l[0].toLowerCase()+l.substring(1);if(a!==l){if(this.hasFlag(a,"KEEPCASE"))return!1;if(this.checkExact(a))return!0}return!1},checkExact:function(o){if(!this.loaded)throw"Dictionary not loaded.";var l=this.dictionaryTable.get(o),s,a;if(typeof l>"u"){if("COMPOUNDMIN"in this.flags&&o.length>=this.flags.COMPOUNDMIN){for(s=0,a=this.compoundRules.length;s<a;s++)if(o.match(this.compoundRules[s]))return!0}}else{if(l===null)return!0;if(typeof l=="object"){for(s=0,a=l.length;s<a;s++)if(!this.hasFlag(o,"ONLYINCOMPOUND",l[s]))return!0}}return!1},hasFlag:function(o,l,s){if(!this.loaded)throw"Dictionary not loaded.";return!!(l in this.flags&&(typeof s>"u"&&(s=Array.prototype.concat.apply([],this.dictionaryTable.get(o))),s&&s.indexOf(this.flags[l])!==-1))},alphabet:"",suggest:function(o,l){if(!this.loaded)throw"Dictionary not loaded.";if(l=l||5,this.memoized.hasOwnProperty(o)){var s=this.memoized[o].limit;if(l<=s||this.memoized[o].suggestions.length<s)return this.memoized[o].suggestions.slice(0,l)}if(this.check(o))return[];for(var a=0,f=this.replacementTable.length;a<f;a++){var p=this.replacementTable[a];if(o.indexOf(p[0])!==-1){var c=o.replace(p[0],p[1]);if(this.check(c))return[c]}}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 h=this.alphabet.split("");h.sort();for(var b={},a=0;a<h.length;a++)b[h[a]]=!0;this.alphabet="";for(var a in b)this.alphabet+=a}var y=this;function x(E,F){var _={},L,T,O,N,P,I,W=y.alphabet.length;for(var j in E)for(L=0,N=j.length+1;L<N;L++){var X=[j.substring(0,L),j.substring(L)];if(X[1]&&(I=X[0]+X[1].substring(1),(!F||y.check(I))&&(I in _?_[I]+=1:_[I]=1)),X[1].length>1&&X[1][1]!==X[1][0]&&(I=X[0]+X[1][1]+X[1][0]+X[1].substring(2),(!F||y.check(I))&&(I in _?_[I]+=1:_[I]=1)),X[1]){var be=X[1].substring(0,1).toUpperCase()===X[1].substring(0,1)?"uppercase":"lowercase";for(T=0;T<W;T++){var U=y.alphabet[T];be==="uppercase"&&(U=U.toUpperCase()),U!=X[1].substring(0,1)&&(I=X[0]+U+X[1].substring(1),(!F||y.check(I))&&(I in _?_[I]+=1:_[I]=1))}}if(X[1])for(T=0;T<W;T++){var be=X[0].substring(-1).toUpperCase()===X[0].substring(-1)&&X[1].substring(0,1).toUpperCase()===X[1].substring(0,1)?"uppercase":"lowercase",U=y.alphabet[T];be==="uppercase"&&(U=U.toUpperCase()),I=X[0]+U+X[1],(!F||y.check(I))&&(I in _?_[I]+=1:_[I]=1)}}return _}function C(E){var F,_=x((F={},F[E]=!0,F)),L=x(_,!0),T=L;for(var O in _)y.check(O)&&(O in T?T[O]+=_[O]:T[O]=_[O]);var N,P,I=[];for(N in T)T.hasOwnProperty(N)&&(y.hasFlag(N,"PRIORITYSUGGEST")&&(T[N]+=1e3),I.push([N,T[N]]));function W(U,ae){var ne=U[1],se=ae[1];return ne<se?-1:ne>se?1:ae[0].localeCompare(U[0])}I.sort(W).reverse();var j=[],X="lowercase";E.toUpperCase()===E?X="uppercase":E.substr(0,1).toUpperCase()+E.substr(1).toLowerCase()===E&&(X="capitalized");var be=l;for(N=0;N<Math.min(be,I.length);N++)X==="uppercase"?I[N][0]=I[N][0].toUpperCase():X==="capitalized"&&(I[N][0]=I[N][0].substr(0,1).toUpperCase()+I[N][0].substr(1)),!y.hasFlag(I[N][0],"NOSUGGEST")&&j.indexOf(I[N][0])===-1?j.push(I[N][0]):be++;return j}return this.memoized[o]={suggestions:C(o),limit:l},this.memoized[o].suggestions}}})();typeof sl<"u"&&(sl.exports=ll)});var Mf=lt((Ig,Lf)=>{"use strict";var Tf=Ff();function Oe(o){if(o=o||{},typeof o.codeMirrorInstance!="function"||typeof o.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}),o.codeMirrorInstance.defineMode("spell-checker",function(l){if(!Oe.aff_loading){Oe.aff_loading=!0;var s=new XMLHttpRequest;s.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.aff",!0),s.onload=function(){s.readyState===4&&s.status===200&&(Oe.aff_data=s.responseText,Oe.num_loaded++,Oe.num_loaded==2&&(Oe.typo=new Tf("en_US",Oe.aff_data,Oe.dic_data,{platform:"any"})))},s.send(null)}if(!Oe.dic_loading){Oe.dic_loading=!0;var a=new XMLHttpRequest;a.open("GET","https://cdn.jsdelivr.net/codemirror.spell-checker/latest/en_US.dic",!0),a.onload=function(){a.readyState===4&&a.status===200&&(Oe.dic_data=a.responseText,Oe.num_loaded++,Oe.num_loaded==2&&(Oe.typo=new Tf("en_US",Oe.aff_data,Oe.dic_data,{platform:"any"})))},a.send(null)}var f='!"#$%&()*+,-./:;<=>?@[\\]^_`{|}~ ',p={token:function(h){var b=h.peek(),y="";if(f.includes(b))return h.next(),null;for(;(b=h.peek())!=null&&!f.includes(b);)y+=b,h.next();return Oe.typo&&!Oe.typo.check(y)?"spell-error":null}},c=o.codeMirrorInstance.getMode(l,l.backdrop||"text/plain");return o.codeMirrorInstance.overlayMode(c,p,!0)})}Oe.num_loaded=0;Oe.aff_loading=!1;Oe.dic_loading=!1;Oe.aff_data="";Oe.dic_data="";Oe.typo;Lf.exports=Oe});var jf=lt(_e=>{"use strict";function _f(o,l){for(var s=0;s<l.length;s++){var a=l[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(o,Zh(a.key),a)}}function Xh(o,l,s){return l&&_f(o.prototype,l),s&&_f(o,s),Object.defineProperty(o,"prototype",{writable:!1}),o}function _t(){return _t=Object.assign?Object.assign.bind():function(o){for(var l=1;l<arguments.length;l++){var s=arguments[l];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(o[a]=s[a])}return o},_t.apply(this,arguments)}function Kh(o,l){if(o){if(typeof o=="string")return Bf(o,l);var s=Object.prototype.toString.call(o).slice(8,-1);if(s==="Object"&&o.constructor&&(s=o.constructor.name),s==="Map"||s==="Set")return Array.from(o);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return Bf(o,l)}}function Bf(o,l){(l==null||l>o.length)&&(l=o.length);for(var s=0,a=new Array(l);s<l;s++)a[s]=o[s];return a}function ro(o,l){var s=typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(s)return(s=s.call(o)).next.bind(s);if(Array.isArray(o)||(s=Kh(o))||l&&o&&typeof o.length=="number"){s&&(o=s);var a=0;return function(){return a>=o.length?{done:!0}:{done:!1,value:o[a++]}}}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 Yh(o,l){if(typeof o!="object"||o===null)return o;var s=o[Symbol.toPrimitive];if(s!==void 0){var a=s.call(o,l||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(o)}function Zh(o){var l=Yh(o,"string");return typeof l=="symbol"?l:String(l)}function ul(){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}}_e.defaults=ul();function Qh(o){_e.defaults=o}var Rf=/[&<>"']/,Jh=new RegExp(Rf.source,"g"),Wf=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,$h=new RegExp(Wf.source,"g"),Vh={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Nf=function(l){return Vh[l]};function pt(o,l){if(l){if(Rf.test(o))return o.replace(Jh,Nf)}else if(Wf.test(o))return o.replace($h,Nf);return o}var ep=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function qf(o){return o.replace(ep,function(l,s){return s=s.toLowerCase(),s==="colon"?":":s.charAt(0)==="#"?s.charAt(1)==="x"?String.fromCharCode(parseInt(s.substring(2),16)):String.fromCharCode(+s.substring(1)):""})}var tp=/(^|[^\[])\^/g;function Le(o,l){o=typeof o=="string"?o:o.source,l=l||"";var s={replace:function(f,p){return p=p.source||p,p=p.replace(tp,"$1"),o=o.replace(f,p),s},getRegex:function(){return new RegExp(o,l)}};return s}var rp=/[^\w:]/g,np=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function Of(o,l,s){if(o){var a;try{a=decodeURIComponent(qf(s)).replace(rp,"").toLowerCase()}catch{return null}if(a.indexOf("javascript:")===0||a.indexOf("vbscript:")===0||a.indexOf("data:")===0)return null}l&&!np.test(s)&&(s=lp(l,s));try{s=encodeURI(s).replace(/%25/g,"%")}catch{return null}return s}var no={},ip=/^[^:]+:\/*[^/]*$/,op=/^([^:]+:)[\s\S]*$/,ap=/^([^:]+:\/*[^/]*)[\s\S]*$/;function lp(o,l){no[" "+o]||(ip.test(o)?no[" "+o]=o+"/":no[" "+o]=io(o,"/",!0)),o=no[" "+o];var s=o.indexOf(":")===-1;return l.substring(0,2)==="//"?s?l:o.replace(op,"$1")+l:l.charAt(0)==="/"?s?l:o.replace(ap,"$1")+l:o+l}var oo={exec:function(){}};function If(o,l){var s=o.replace(/\|/g,function(p,c,h){for(var b=!1,y=c;--y>=0&&h[y]==="\\";)b=!b;return b?"|":" |"}),a=s.split(/ \|/),f=0;if(a[0].trim()||a.shift(),a.length>0&&!a[a.length-1].trim()&&a.pop(),a.length>l)a.splice(l);else for(;a.length<l;)a.push("");for(;f<a.length;f++)a[f]=a[f].trim().replace(/\\\|/g,"|");return a}function io(o,l,s){var a=o.length;if(a===0)return"";for(var f=0;f<a;){var p=o.charAt(a-f-1);if(p===l&&!s)f++;else if(p!==l&&s)f++;else break}return o.slice(0,a-f)}function sp(o,l){if(o.indexOf(l[1])===-1)return-1;for(var s=o.length,a=0,f=0;f<s;f++)if(o[f]==="\\")f++;else if(o[f]===l[0])a++;else if(o[f]===l[1]&&(a--,a<0))return f;return-1}function up(o){o&&o.sanitize&&!o.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 Pf(o,l){if(l<1)return"";for(var s="";l>1;)l&1&&(s+=o),l>>=1,o+=o;return s+o}function zf(o,l,s,a){var f=l.href,p=l.title?pt(l.title):null,c=o[1].replace(/\\([\[\]])/g,"$1");if(o[0].charAt(0)!=="!"){a.state.inLink=!0;var h={type:"link",raw:s,href:f,title:p,text:c,tokens:a.inlineTokens(c)};return a.state.inLink=!1,h}return{type:"image",raw:s,href:f,title:p,text:pt(c)}}function fp(o,l){var s=o.match(/^(\s+)(?:```)/);if(s===null)return l;var a=s[1];return l.split(`
`).map(function(f){var p=f.match(/^\s+/);if(p===null)return f;var c=p[0];return c.length>=a.length?f.slice(a.length):f}).join(`
`)}var ao=function(){function o(s){this.options=s||_e.defaults}var l=o.prototype;return l.space=function(a){var f=this.rules.block.newline.exec(a);if(f&&f[0].length>0)return{type:"space",raw:f[0]}},l.code=function(a){var f=this.rules.block.code.exec(a);if(f){var p=f[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:f[0],codeBlockStyle:"indented",text:this.options.pedantic?p:io(p,`
`)}}},l.fences=function(a){var f=this.rules.block.fences.exec(a);if(f){var p=f[0],c=fp(p,f[3]||"");return{type:"code",raw:p,lang:f[2]?f[2].trim().replace(this.rules.inline._escapes,"$1"):f[2],text:c}}},l.heading=function(a){var f=this.rules.block.heading.exec(a);if(f){var p=f[2].trim();if(/#$/.test(p)){var c=io(p,"#");(this.options.pedantic||!c||/ $/.test(c))&&(p=c.trim())}return{type:"heading",raw:f[0],depth:f[1].length,text:p,tokens:this.lexer.inline(p)}}},l.hr=function(a){var f=this.rules.block.hr.exec(a);if(f)return{type:"hr",raw:f[0]}},l.blockquote=function(a){var f=this.rules.block.blockquote.exec(a);if(f){var p=f[0].replace(/^ *>[ \t]?/gm,""),c=this.lexer.state.top;this.lexer.state.top=!0;var h=this.lexer.blockTokens(p);return this.lexer.state.top=c,{type:"blockquote",raw:f[0],tokens:h,text:p}}},l.list=function(a){var f=this.rules.block.list.exec(a);if(f){var p,c,h,b,y,x,C,E,F,_,L,T,O=f[1].trim(),N=O.length>1,P={type:"list",raw:"",ordered:N,start:N?+O.slice(0,-1):"",loose:!1,items:[]};O=N?"\\d{1,9}\\"+O.slice(-1):"\\"+O,this.options.pedantic&&(O=N?O:"[*+-]");for(var I=new RegExp("^( {0,3}"+O+")((?:[ ][^\\n]*)?(?:\\n|$))");a&&(T=!1,!(!(f=I.exec(a))||this.rules.block.hr.test(a)));){if(p=f[0],a=a.substring(p.length),E=f[2].split(`
`,1)[0].replace(/^\t+/,function(se){return" ".repeat(3*se.length)}),F=a.split(`
`,1)[0],this.options.pedantic?(b=2,L=E.trimLeft()):(b=f[2].search(/[^ ]/),b=b>4?1:b,L=E.slice(b),b+=f[1].length),x=!1,!E&&/^ *$/.test(F)&&(p+=F+`
`,a=a.substring(F.length+1),T=!0),!T)for(var W=new RegExp("^ {0,"+Math.min(3,b-1)+"}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))"),j=new RegExp("^ {0,"+Math.min(3,b-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),X=new RegExp("^ {0,"+Math.min(3,b-1)+"}(?:```|~~~)"),be=new RegExp("^ {0,"+Math.min(3,b-1)+"}#");a&&(_=a.split(`
`,1)[0],F=_,this.options.pedantic&&(F=F.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!(X.test(F)||be.test(F)||W.test(F)||j.test(a)));){if(F.search(/[^ ]/)>=b||!F.trim())L+=`
`+F.slice(b);else{if(x||E.search(/[^ ]/)>=4||X.test(E)||be.test(E)||j.test(E))break;L+=`
`+F}!x&&!F.trim()&&(x=!0),p+=_+`
`,a=a.substring(_.length+1),E=F.slice(b)}P.loose||(C?P.loose=!0:/\n *\n *$/.test(p)&&(C=!0)),this.options.gfm&&(c=/^\[[ xX]\] /.exec(L),c&&(h=c[0]!=="[ ] ",L=L.replace(/^\[[ xX]\] +/,""))),P.items.push({type:"list_item",raw:p,task:!!c,checked:h,loose:!1,text:L}),P.raw+=p}P.items[P.items.length-1].raw=p.trimRight(),P.items[P.items.length-1].text=L.trimRight(),P.raw=P.raw.trimRight();var U=P.items.length;for(y=0;y<U;y++)if(this.lexer.state.top=!1,P.items[y].tokens=this.lexer.blockTokens(P.items[y].text,[]),!P.loose){var ae=P.items[y].tokens.filter(function(se){return se.type==="space"}),ne=ae.length>0&&ae.some(function(se){return/\n.*\n/.test(se.raw)});P.loose=ne}if(P.loose)for(y=0;y<U;y++)P.items[y].loose=!0;return P}},l.html=function(a){var f=this.rules.block.html.exec(a);if(f){var p={type:"html",raw:f[0],pre:!this.options.sanitizer&&(f[1]==="pre"||f[1]==="script"||f[1]==="style"),text:f[0]};if(this.options.sanitize){var c=this.options.sanitizer?this.options.sanitizer(f[0]):pt(f[0]);p.type="paragraph",p.text=c,p.tokens=this.lexer.inline(c)}return p}},l.def=function(a){var f=this.rules.block.def.exec(a);if(f){var p=f[1].toLowerCase().replace(/\s+/g," "),c=f[2]?f[2].replace(/^<(.*)>$/,"$1").replace(this.rules.inline._escapes,"$1"):"",h=f[3]?f[3].substring(1,f[3].length-1).replace(this.rules.inline._escapes,"$1"):f[3];return{type:"def",tag:p,raw:f[0],href:c,title:h}}},l.table=function(a){var f=this.rules.block.table.exec(a);if(f){var p={type:"table",header:If(f[1]).map(function(C){return{text:C}}),align:f[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:f[3]&&f[3].trim()?f[3].replace(/\n[ \t]*$/,"").split(`
`):[]};if(p.header.length===p.align.length){p.raw=f[0];var c=p.align.length,h,b,y,x;for(h=0;h<c;h++)/^ *-+: *$/.test(p.align[h])?p.align[h]="right":/^ *:-+: *$/.test(p.align[h])?p.align[h]="center":/^ *:-+ *$/.test(p.align[h])?p.align[h]="left":p.align[h]=null;for(c=p.rows.length,h=0;h<c;h++)p.rows[h]=If(p.rows[h],p.header.length).map(function(C){return{text:C}});for(c=p.header.length,b=0;b<c;b++)p.header[b].tokens=this.lexer.inline(p.header[b].text);for(c=p.rows.length,b=0;b<c;b++)for(x=p.rows[b],y=0;y<x.length;y++)x[y].tokens=this.lexer.inline(x[y].text);return p}}},l.lheading=function(a){var f=this.rules.block.lheading.exec(a);if(f)return{type:"heading",raw:f[0],depth:f[2].charAt(0)==="="?1:2,text:f[1],tokens:this.lexer.inline(f[1])}},l.paragraph=function(a){var f=this.rules.block.paragraph.exec(a);if(f){var p=f[1].charAt(f[1].length-1)===`
`?f[1].slice(0,-1):f[1];return{type:"paragraph",raw:f[0],text:p,tokens:this.lexer.inline(p)}}},l.text=function(a){var f=this.rules.block.text.exec(a);if(f)return{type:"text",raw:f[0],text:f[0],tokens:this.lexer.inline(f[0])}},l.escape=function(a){var f=this.rules.inline.escape.exec(a);if(f)return{type:"escape",raw:f[0],text:pt(f[1])}},l.tag=function(a){var f=this.rules.inline.tag.exec(a);if(f)return!this.lexer.state.inLink&&/^<a /i.test(f[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(f[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(f[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(f[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:f[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(f[0]):pt(f[0]):f[0]}},l.link=function(a){var f=this.rules.inline.link.exec(a);if(f){var p=f[2].trim();if(!this.options.pedantic&&/^</.test(p)){if(!/>$/.test(p))return;var c=io(p.slice(0,-1),"\\");if((p.length-c.length)%2===0)return}else{var h=sp(f[2],"()");if(h>-1){var b=f[0].indexOf("!")===0?5:4,y=b+f[1].length+h;f[2]=f[2].substring(0,h),f[0]=f[0].substring(0,y).trim(),f[3]=""}}var x=f[2],C="";if(this.options.pedantic){var E=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(x);E&&(x=E[1],C=E[3])}else C=f[3]?f[3].slice(1,-1):"";return x=x.trim(),/^</.test(x)&&(this.options.pedantic&&!/>$/.test(p)?x=x.slice(1):x=x.slice(1,-1)),zf(f,{href:x&&x.replace(this.rules.inline._escapes,"$1"),title:C&&C.replace(this.rules.inline._escapes,"$1")},f[0],this.lexer)}},l.reflink=function(a,f){var p;if((p=this.rules.inline.reflink.exec(a))||(p=this.rules.inline.nolink.exec(a))){var c=(p[2]||p[1]).replace(/\s+/g," ");if(c=f[c.toLowerCase()],!c){var h=p[0].charAt(0);return{type:"text",raw:h,text:h}}return zf(p,c,p[0],this.lexer)}},l.emStrong=function(a,f,p){p===void 0&&(p="");var c=this.rules.inline.emStrong.lDelim.exec(a);if(c&&!(c[3]&&p.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var h=c[1]||c[2]||"";if(!h||h&&(p===""||this.rules.inline.punctuation.exec(p))){var b=c[0].length-1,y,x,C=b,E=0,F=c[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(F.lastIndex=0,f=f.slice(-1*a.length+b);(c=F.exec(f))!=null;)if(y=c[1]||c[2]||c[3]||c[4]||c[5]||c[6],!!y){if(x=y.length,c[3]||c[4]){C+=x;continue}else if((c[5]||c[6])&&b%3&&!((b+x)%3)){E+=x;continue}if(C-=x,!(C>0)){x=Math.min(x,x+C+E);var _=a.slice(0,b+c.index+(c[0].length-y.length)+x);if(Math.min(b,x)%2){var L=_.slice(1,-1);return{type:"em",raw:_,text:L,tokens:this.lexer.inlineTokens(L)}}var T=_.slice(2,-2);return{type:"strong",raw:_,text:T,tokens:this.lexer.inlineTokens(T)}}}}}},l.codespan=function(a){var f=this.rules.inline.code.exec(a);if(f){var p=f[2].replace(/\n/g," "),c=/[^ ]/.test(p),h=/^ /.test(p)&&/ $/.test(p);return c&&h&&(p=p.substring(1,p.length-1)),p=pt(p,!0),{type:"codespan",raw:f[0],text:p}}},l.br=function(a){var f=this.rules.inline.br.exec(a);if(f)return{type:"br",raw:f[0]}},l.del=function(a){var f=this.rules.inline.del.exec(a);if(f)return{type:"del",raw:f[0],text:f[2],tokens:this.lexer.inlineTokens(f[2])}},l.autolink=function(a,f){var p=this.rules.inline.autolink.exec(a);if(p){var c,h;return p[2]==="@"?(c=pt(this.options.mangle?f(p[1]):p[1]),h="mailto:"+c):(c=pt(p[1]),h=c),{type:"link",raw:p[0],text:c,href:h,tokens:[{type:"text",raw:c,text:c}]}}},l.url=function(a,f){var p;if(p=this.rules.inline.url.exec(a)){var c,h;if(p[2]==="@")c=pt(this.options.mangle?f(p[0]):p[0]),h="mailto:"+c;else{var b;do b=p[0],p[0]=this.rules.inline._backpedal.exec(p[0])[0];while(b!==p[0]);c=pt(p[0]),p[1]==="www."?h="http://"+p[0]:h=p[0]}return{type:"link",raw:p[0],text:c,href:h,tokens:[{type:"text",raw:c,text:c}]}}},l.inlineText=function(a,f){var p=this.rules.inline.text.exec(a);if(p){var c;return this.lexer.state.inRawBlock?c=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(p[0]):pt(p[0]):p[0]:c=pt(this.options.smartypants?f(p[0]):p[0]),{type:"text",raw:p[0],text:c}}},o}(),de={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:oo,lheading:/^((?:.|\n(?!\n))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/};de._label=/(?!\s*\])(?:\\.|[^\[\]\\])+/;de._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;de.def=Le(de.def).replace("label",de._label).replace("title",de._title).getRegex();de.bullet=/(?:[*+-]|\d{1,9}[.)])/;de.listItemStart=Le(/^( *)(bull) */).replace("bull",de.bullet).getRegex();de.list=Le(de.list).replace(/bull/g,de.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+de.def.source+")").getRegex();de._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";de._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;de.html=Le(de.html,"i").replace("comment",de._comment).replace("tag",de._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();de.paragraph=Le(de._paragraph).replace("hr",de.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",de._tag).getRegex();de.blockquote=Le(de.blockquote).replace("paragraph",de.paragraph).getRegex();de.normal=_t({},de);de.gfm=_t({},de.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});de.gfm.table=Le(de.gfm.table).replace("hr",de.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",de._tag).getRegex();de.gfm.paragraph=Le(de._paragraph).replace("hr",de.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",de.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",de._tag).getRegex();de.pedantic=_t({},de.normal,{html:Le(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",de._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:oo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Le(de.normal._paragraph).replace("hr",de.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",de.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var re={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:oo,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:oo,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};re._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";re.punctuation=Le(re.punctuation).replace(/punctuation/g,re._punctuation).getRegex();re.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;re.escapedEmSt=/(?:^|[^\\])(?:\\\\)*\\[*_]/g;re._comment=Le(de._comment).replace("(?:-->|$)","-->").getRegex();re.emStrong.lDelim=Le(re.emStrong.lDelim).replace(/punct/g,re._punctuation).getRegex();re.emStrong.rDelimAst=Le(re.emStrong.rDelimAst,"g").replace(/punct/g,re._punctuation).getRegex();re.emStrong.rDelimUnd=Le(re.emStrong.rDelimUnd,"g").replace(/punct/g,re._punctuation).getRegex();re._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;re._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;re._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])?)+(?![-_])/;re.autolink=Le(re.autolink).replace("scheme",re._scheme).replace("email",re._email).getRegex();re._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;re.tag=Le(re.tag).replace("comment",re._comment).replace("attribute",re._attribute).getRegex();re._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;re._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;re._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;re.link=Le(re.link).replace("label",re._label).replace("href",re._href).replace("title",re._title).getRegex();re.reflink=Le(re.reflink).replace("label",re._label).replace("ref",de._label).getRegex();re.nolink=Le(re.nolink).replace("ref",de._label).getRegex();re.reflinkSearch=Le(re.reflinkSearch,"g").replace("reflink",re.reflink).replace("nolink",re.nolink).getRegex();re.normal=_t({},re);re.pedantic=_t({},re.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:Le(/^!?\[(label)\]\((.*?)\)/).replace("label",re._label).getRegex(),reflink:Le(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",re._label).getRegex()});re.gfm=_t({},re.normal,{escape:Le(re.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.!#$%&'*+\/=?_`{\|}~-]+@)))/});re.gfm.url=Le(re.gfm.url,"i").replace("email",re.gfm._extended_email).getRegex();re.breaks=_t({},re.gfm,{br:Le(re.br).replace("{2,}","*").getRegex(),text:Le(re.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});function cp(o){return o.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 Hf(o){var l="",s,a,f=o.length;for(s=0;s<f;s++)a=o.charCodeAt(s),Math.random()>.5&&(a="x"+a.toString(16)),l+="&#"+a+";";return l}var yn=function(){function o(s){this.tokens=[],this.tokens.links=Object.create(null),this.options=s||_e.defaults,this.options.tokenizer=this.options.tokenizer||new ao,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 a={block:de.normal,inline:re.normal};this.options.pedantic?(a.block=de.pedantic,a.inline=re.pedantic):this.options.gfm&&(a.block=de.gfm,this.options.breaks?a.inline=re.breaks:a.inline=re.gfm),this.tokenizer.rules=a}o.lex=function(a,f){var p=new o(f);return p.lex(a)},o.lexInline=function(a,f){var p=new o(f);return p.inlineTokens(a)};var l=o.prototype;return l.lex=function(a){a=a.replace(/\r\n|\r/g,`
`),this.blockTokens(a,this.tokens);for(var f;f=this.inlineQueue.shift();)this.inlineTokens(f.src,f.tokens);return this.tokens},l.blockTokens=function(a,f){var p=this;f===void 0&&(f=[]),this.options.pedantic?a=a.replace(/\t/g," ").replace(/^ +$/gm,""):a=a.replace(/^( *)(\t+)/gm,function(C,E,F){return E+" ".repeat(F.length)});for(var c,h,b,y;a;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(function(C){return(c=C.call({lexer:p},a,f))?(a=a.substring(c.raw.length),f.push(c),!0):!1}))){if(c=this.tokenizer.space(a)){a=a.substring(c.raw.length),c.raw.length===1&&f.length>0?f[f.length-1].raw+=`
`:f.push(c);continue}if(c=this.tokenizer.code(a)){a=a.substring(c.raw.length),h=f[f.length-1],h&&(h.type==="paragraph"||h.type==="text")?(h.raw+=`
`+c.raw,h.text+=`
`+c.text,this.inlineQueue[this.inlineQueue.length-1].src=h.text):f.push(c);continue}if(c=this.tokenizer.fences(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.heading(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.hr(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.blockquote(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.list(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.html(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.def(a)){a=a.substring(c.raw.length),h=f[f.length-1],h&&(h.type==="paragraph"||h.type==="text")?(h.raw+=`
`+c.raw,h.text+=`
`+c.raw,this.inlineQueue[this.inlineQueue.length-1].src=h.text):this.tokens.links[c.tag]||(this.tokens.links[c.tag]={href:c.href,title:c.title});continue}if(c=this.tokenizer.table(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.lheading(a)){a=a.substring(c.raw.length),f.push(c);continue}if(b=a,this.options.extensions&&this.options.extensions.startBlock&&function(){var C=1/0,E=a.slice(1),F=void 0;p.options.extensions.startBlock.forEach(function(_){F=_.call({lexer:this},E),typeof F=="number"&&F>=0&&(C=Math.min(C,F))}),C<1/0&&C>=0&&(b=a.substring(0,C+1))}(),this.state.top&&(c=this.tokenizer.paragraph(b))){h=f[f.length-1],y&&h.type==="paragraph"?(h.raw+=`
`+c.raw,h.text+=`
`+c.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=h.text):f.push(c),y=b.length!==a.length,a=a.substring(c.raw.length);continue}if(c=this.tokenizer.text(a)){a=a.substring(c.raw.length),h=f[f.length-1],h&&h.type==="text"?(h.raw+=`
`+c.raw,h.text+=`
`+c.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=h.text):f.push(c);continue}if(a){var x="Infinite loop on byte: "+a.charCodeAt(0);if(this.options.silent){console.error(x);break}else throw new Error(x)}}return this.state.top=!0,f},l.inline=function(a,f){return f===void 0&&(f=[]),this.inlineQueue.push({src:a,tokens:f}),f},l.inlineTokens=function(a,f){var p=this;f===void 0&&(f=[]);var c,h,b,y=a,x,C,E;if(this.tokens.links){var F=Object.keys(this.tokens.links);if(F.length>0)for(;(x=this.tokenizer.rules.inline.reflinkSearch.exec(y))!=null;)F.includes(x[0].slice(x[0].lastIndexOf("[")+1,-1))&&(y=y.slice(0,x.index)+"["+Pf("a",x[0].length-2)+"]"+y.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(x=this.tokenizer.rules.inline.blockSkip.exec(y))!=null;)y=y.slice(0,x.index)+"["+Pf("a",x[0].length-2)+"]"+y.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(x=this.tokenizer.rules.inline.escapedEmSt.exec(y))!=null;)y=y.slice(0,x.index+x[0].length-2)+"++"+y.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex),this.tokenizer.rules.inline.escapedEmSt.lastIndex--;for(;a;)if(C||(E=""),C=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(function(L){return(c=L.call({lexer:p},a,f))?(a=a.substring(c.raw.length),f.push(c),!0):!1}))){if(c=this.tokenizer.escape(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.tag(a)){a=a.substring(c.raw.length),h=f[f.length-1],h&&c.type==="text"&&h.type==="text"?(h.raw+=c.raw,h.text+=c.text):f.push(c);continue}if(c=this.tokenizer.link(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.reflink(a,this.tokens.links)){a=a.substring(c.raw.length),h=f[f.length-1],h&&c.type==="text"&&h.type==="text"?(h.raw+=c.raw,h.text+=c.text):f.push(c);continue}if(c=this.tokenizer.emStrong(a,y,E)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.codespan(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.br(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.del(a)){a=a.substring(c.raw.length),f.push(c);continue}if(c=this.tokenizer.autolink(a,Hf)){a=a.substring(c.raw.length),f.push(c);continue}if(!this.state.inLink&&(c=this.tokenizer.url(a,Hf))){a=a.substring(c.raw.length),f.push(c);continue}if(b=a,this.options.extensions&&this.options.extensions.startInline&&function(){var L=1/0,T=a.slice(1),O=void 0;p.options.extensions.startInline.forEach(function(N){O=N.call({lexer:this},T),typeof O=="number"&&O>=0&&(L=Math.min(L,O))}),L<1/0&&L>=0&&(b=a.substring(0,L+1))}(),c=this.tokenizer.inlineText(b,cp)){a=a.substring(c.raw.length),c.raw.slice(-1)!=="_"&&(E=c.raw.slice(-1)),C=!0,h=f[f.length-1],h&&h.type==="text"?(h.raw+=c.raw,h.text+=c.text):f.push(c);continue}if(a){var _="Infinite loop on byte: "+a.charCodeAt(0);if(this.options.silent){console.error(_);break}else throw new Error(_)}}return f},Xh(o,null,[{key:"rules",get:function(){return{block:de,inline:re}}}]),o}(),lo=function(){function o(s){this.options=s||_e.defaults}var l=o.prototype;return l.code=function(a,f,p){var c=(f||"").match(/\S*/)[0];if(this.options.highlight){var h=this.options.highlight(a,c);h!=null&&h!==a&&(p=!0,a=h)}return a=a.replace(/\n$/,"")+`
`,c?'<pre><code class="'+this.options.langPrefix+pt(c)+'">'+(p?a:pt(a,!0))+`</code></pre>
`:"<pre><code>"+(p?a:pt(a,!0))+`</code></pre>
`},l.blockquote=function(a){return`<blockquote>
`+a+`</blockquote>
`},l.html=function(a){return a},l.heading=function(a,f,p,c){if(this.options.headerIds){var h=this.options.headerPrefix+c.slug(p);return"<h"+f+' id="'+h+'">'+a+"</h"+f+`>
`}return"<h"+f+">"+a+"</h"+f+`>
`},l.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},l.list=function(a,f,p){var c=f?"ol":"ul",h=f&&p!==1?' start="'+p+'"':"";return"<"+c+h+`>
`+a+"</"+c+`>
`},l.listitem=function(a){return"<li>"+a+`</li>
`},l.checkbox=function(a){return"<input "+(a?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},l.paragraph=function(a){return"<p>"+a+`</p>
`},l.table=function(a,f){return f&&(f="<tbody>"+f+"</tbody>"),`<table>
<thead>
`+a+`</thead>
`+f+`</table>
`},l.tablerow=function(a){return`<tr>
`+a+`</tr>
`},l.tablecell=function(a,f){var p=f.header?"th":"td",c=f.align?"<"+p+' align="'+f.align+'">':"<"+p+">";return c+a+("</"+p+`>
`)},l.strong=function(a){return"<strong>"+a+"</strong>"},l.em=function(a){return"<em>"+a+"</em>"},l.codespan=function(a){return"<code>"+a+"</code>"},l.br=function(){return this.options.xhtml?"<br/>":"<br>"},l.del=function(a){return"<del>"+a+"</del>"},l.link=function(a,f,p){if(a=Of(this.options.sanitize,this.options.baseUrl,a),a===null)return p;var c='<a href="'+a+'"';return f&&(c+=' title="'+f+'"'),c+=">"+p+"</a>",c},l.image=function(a,f,p){if(a=Of(this.options.sanitize,this.options.baseUrl,a),a===null)return p;var c='<img src="'+a+'" alt="'+p+'"';return f&&(c+=' title="'+f+'"'),c+=this.options.xhtml?"/>":">",c},l.text=function(a){return a},o}(),fl=function(){function o(){}var l=o.prototype;return l.strong=function(a){return a},l.em=function(a){return a},l.codespan=function(a){return a},l.del=function(a){return a},l.html=function(a){return a},l.text=function(a){return a},l.link=function(a,f,p){return""+p},l.image=function(a,f,p){return""+p},l.br=function(){return""},o}(),cl=function(){function o(){this.seen={}}var l=o.prototype;return l.serialize=function(a){return a.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},l.getNextSafeSlug=function(a,f){var p=a,c=0;if(this.seen.hasOwnProperty(p)){c=this.seen[a];do c++,p=a+"-"+c;while(this.seen.hasOwnProperty(p))}return f||(this.seen[a]=c,this.seen[p]=0),p},l.slug=function(a,f){f===void 0&&(f={});var p=this.serialize(a);return this.getNextSafeSlug(p,f.dryrun)},o}(),xn=function(){function o(s){this.options=s||_e.defaults,this.options.renderer=this.options.renderer||new lo,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new fl,this.slugger=new cl}o.parse=function(a,f){var p=new o(f);return p.parse(a)},o.parseInline=function(a,f){var p=new o(f);return p.parseInline(a)};var l=o.prototype;return l.parse=function(a,f){f===void 0&&(f=!0);var p="",c,h,b,y,x,C,E,F,_,L,T,O,N,P,I,W,j,X,be,U=a.length;for(c=0;c<U;c++){if(L=a[c],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[L.type]&&(be=this.options.extensions.renderers[L.type].call({parser:this},L),be!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(L.type))){p+=be||"";continue}switch(L.type){case"space":continue;case"hr":{p+=this.renderer.hr();continue}case"heading":{p+=this.renderer.heading(this.parseInline(L.tokens),L.depth,qf(this.parseInline(L.tokens,this.textRenderer)),this.slugger);continue}case"code":{p+=this.renderer.code(L.text,L.lang,L.escaped);continue}case"table":{for(F="",E="",y=L.header.length,h=0;h<y;h++)E+=this.renderer.tablecell(this.parseInline(L.header[h].tokens),{header:!0,align:L.align[h]});for(F+=this.renderer.tablerow(E),_="",y=L.rows.length,h=0;h<y;h++){for(C=L.rows[h],E="",x=C.length,b=0;b<x;b++)E+=this.renderer.tablecell(this.parseInline(C[b].tokens),{header:!1,align:L.align[b]});_+=this.renderer.tablerow(E)}p+=this.renderer.table(F,_);continue}case"blockquote":{_=this.parse(L.tokens),p+=this.renderer.blockquote(_);continue}case"list":{for(T=L.ordered,O=L.start,N=L.loose,y=L.items.length,_="",h=0;h<y;h++)I=L.items[h],W=I.checked,j=I.task,P="",I.task&&(X=this.renderer.checkbox(W),N?I.tokens.length>0&&I.tokens[0].type==="paragraph"?(I.tokens[0].text=X+" "+I.tokens[0].text,I.tokens[0].tokens&&I.tokens[0].tokens.length>0&&I.tokens[0].tokens[0].type==="text"&&(I.tokens[0].tokens[0].text=X+" "+I.tokens[0].tokens[0].text)):I.tokens.unshift({type:"text",text:X}):P+=X),P+=this.parse(I.tokens,N),_+=this.renderer.listitem(P,j,W);p+=this.renderer.list(_,T,O);continue}case"html":{p+=this.renderer.html(L.text);continue}case"paragraph":{p+=this.renderer.paragraph(this.parseInline(L.tokens));continue}case"text":{for(_=L.tokens?this.parseInline(L.tokens):L.text;c+1<U&&a[c+1].type==="text";)L=a[++c],_+=`
`+(L.tokens?this.parseInline(L.tokens):L.text);p+=f?this.renderer.paragraph(_):_;continue}default:{var ae='Token with "'+L.type+'" type was not found.';if(this.options.silent){console.error(ae);return}else throw new Error(ae)}}}return p},l.parseInline=function(a,f){f=f||this.renderer;var p="",c,h,b,y=a.length;for(c=0;c<y;c++){if(h=a[c],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[h.type]&&(b=this.options.extensions.renderers[h.type].call({parser:this},h),b!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(h.type))){p+=b||"";continue}switch(h.type){case"escape":{p+=f.text(h.text);break}case"html":{p+=f.html(h.text);break}case"link":{p+=f.link(h.href,h.title,this.parseInline(h.tokens,f));break}case"image":{p+=f.image(h.href,h.title,h.text);break}case"strong":{p+=f.strong(this.parseInline(h.tokens,f));break}case"em":{p+=f.em(this.parseInline(h.tokens,f));break}case"codespan":{p+=f.codespan(h.text);break}case"br":{p+=f.br();break}case"del":{p+=f.del(this.parseInline(h.tokens,f));break}case"text":{p+=f.text(h.text);break}default:{var x='Token with "'+h.type+'" type was not found.';if(this.options.silent){console.error(x);return}else throw new Error(x)}}}return p},o}(),si=function(){function o(s){this.options=s||_e.defaults}var l=o.prototype;return l.preprocess=function(a){return a},l.postprocess=function(a){return a},o}();si.passThroughHooks=new Set(["preprocess","postprocess"]);function dp(o,l,s){return function(a){if(a.message+=`
Please report this to https://github.com/markedjs/marked.`,o){var f="<p>An error occurred:</p><pre>"+pt(a.message+"",!0)+"</pre>";if(l)return Promise.resolve(f);if(s){s(null,f);return}return f}if(l)return Promise.reject(a);if(s){s(a);return}throw a}}function Uf(o,l){return function(s,a,f){typeof a=="function"&&(f=a,a=null);var p=_t({},a);a=_t({},ce.defaults,p);var c=dp(a.silent,a.async,f);if(typeof s>"u"||s===null)return c(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return c(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));if(up(a),a.hooks&&(a.hooks.options=a),f){var h=a.highlight,b;try{a.hooks&&(s=a.hooks.preprocess(s)),b=o(s,a)}catch(F){return c(F)}var y=function(_){var L;if(!_)try{a.walkTokens&&ce.walkTokens(b,a.walkTokens),L=l(b,a),a.hooks&&(L=a.hooks.postprocess(L))}catch(T){_=T}return a.highlight=h,_?c(_):f(null,L)};if(!h||h.length<3||(delete a.highlight,!b.length))return y();var x=0;ce.walkTokens(b,function(F){F.type==="code"&&(x++,setTimeout(function(){h(F.text,F.lang,function(_,L){if(_)return y(_);L!=null&&L!==F.text&&(F.text=L,F.escaped=!0),x--,x===0&&y()})},0))}),x===0&&y();return}if(a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(s):s).then(function(F){return o(F,a)}).then(function(F){return a.walkTokens?Promise.all(ce.walkTokens(F,a.walkTokens)).then(function(){return F}):F}).then(function(F){return l(F,a)}).then(function(F){return a.hooks?a.hooks.postprocess(F):F}).catch(c);try{a.hooks&&(s=a.hooks.preprocess(s));var C=o(s,a);a.walkTokens&&ce.walkTokens(C,a.walkTokens);var E=l(C,a);return a.hooks&&(E=a.hooks.postprocess(E)),E}catch(F){return c(F)}}}function ce(o,l,s){return Uf(yn.lex,xn.parse)(o,l,s)}ce.options=ce.setOptions=function(o){return ce.defaults=_t({},ce.defaults,o),Qh(ce.defaults),ce};ce.getDefaults=ul;ce.defaults=_e.defaults;ce.use=function(){for(var o=ce.defaults.extensions||{renderers:{},childTokens:{}},l=arguments.length,s=new Array(l),a=0;a<l;a++)s[a]=arguments[a];s.forEach(function(f){var p=_t({},f);if(p.async=ce.defaults.async||p.async||!1,f.extensions&&(f.extensions.forEach(function(h){if(!h.name)throw new Error("extension name required");if(h.renderer){var b=o.renderers[h.name];b?o.renderers[h.name]=function(){for(var y=arguments.length,x=new Array(y),C=0;C<y;C++)x[C]=arguments[C];var E=h.renderer.apply(this,x);return E===!1&&(E=b.apply(this,x)),E}:o.renderers[h.name]=h.renderer}if(h.tokenizer){if(!h.level||h.level!=="block"&&h.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");o[h.level]?o[h.level].unshift(h.tokenizer):o[h.level]=[h.tokenizer],h.start&&(h.level==="block"?o.startBlock?o.startBlock.push(h.start):o.startBlock=[h.start]:h.level==="inline"&&(o.startInline?o.startInline.push(h.start):o.startInline=[h.start]))}h.childTokens&&(o.childTokens[h.name]=h.childTokens)}),p.extensions=o),f.renderer&&function(){var h=ce.defaults.renderer||new lo,b=function(C){var E=h[C];h[C]=function(){for(var F=arguments.length,_=new Array(F),L=0;L<F;L++)_[L]=arguments[L];var T=f.renderer[C].apply(h,_);return T===!1&&(T=E.apply(h,_)),T}};for(var y in f.renderer)b(y);p.renderer=h}(),f.tokenizer&&function(){var h=ce.defaults.tokenizer||new ao,b=function(C){var E=h[C];h[C]=function(){for(var F=arguments.length,_=new Array(F),L=0;L<F;L++)_[L]=arguments[L];var T=f.tokenizer[C].apply(h,_);return T===!1&&(T=E.apply(h,_)),T}};for(var y in f.tokenizer)b(y);p.tokenizer=h}(),f.hooks&&function(){var h=ce.defaults.hooks||new si,b=function(C){var E=h[C];si.passThroughHooks.has(C)?h[C]=function(F){if(ce.defaults.async)return Promise.resolve(f.hooks[C].call(h,F)).then(function(L){return E.call(h,L)});var _=f.hooks[C].call(h,F);return E.call(h,_)}:h[C]=function(){for(var F=arguments.length,_=new Array(F),L=0;L<F;L++)_[L]=arguments[L];var T=f.hooks[C].apply(h,_);return T===!1&&(T=E.apply(h,_)),T}};for(var y in f.hooks)b(y);p.hooks=h}(),f.walkTokens){var c=ce.defaults.walkTokens;p.walkTokens=function(h){var b=[];return b.push(f.walkTokens.call(this,h)),c&&(b=b.concat(c.call(this,h))),b}}ce.setOptions(p)})};ce.walkTokens=function(o,l){for(var s=[],a=function(){var h=p.value;switch(s=s.concat(l.call(ce,h)),h.type){case"table":{for(var b=ro(h.header),y;!(y=b()).done;){var x=y.value;s=s.concat(ce.walkTokens(x.tokens,l))}for(var C=ro(h.rows),E;!(E=C()).done;)for(var F=E.value,_=ro(F),L;!(L=_()).done;){var T=L.value;s=s.concat(ce.walkTokens(T.tokens,l))}break}case"list":{s=s.concat(ce.walkTokens(h.items,l));break}default:ce.defaults.extensions&&ce.defaults.extensions.childTokens&&ce.defaults.extensions.childTokens[h.type]?ce.defaults.extensions.childTokens[h.type].forEach(function(O){s=s.concat(ce.walkTokens(h[O],l))}):h.tokens&&(s=s.concat(ce.walkTokens(h.tokens,l)))}},f=ro(o),p;!(p=f()).done;)a();return s};ce.parseInline=Uf(yn.lexInline,xn.parseInline);ce.Parser=xn;ce.parser=xn.parse;ce.Renderer=lo;ce.TextRenderer=fl;ce.Lexer=yn;ce.lexer=yn.lex;ce.Tokenizer=ao;ce.Slugger=cl;ce.Hooks=si;ce.parse=ce;var hp=ce.options,pp=ce.setOptions,gp=ce.use,vp=ce.walkTokens,mp=ce.parseInline,bp=ce,yp=xn.parse,xp=yn.lex;_e.Hooks=si;_e.Lexer=yn;_e.Parser=xn;_e.Renderer=lo;_e.Slugger=cl;_e.TextRenderer=fl;_e.Tokenizer=ao;_e.getDefaults=ul;_e.lexer=xp;_e.marked=ce;_e.options=hp;_e.parse=bp;_e.parseInline=mp;_e.parser=yp;_e.setOptions=pp;_e.use=gp;_e.walkTokens=vp});var tc=lt((zg,ec)=>{"use strict";var Dn=Et();Qu();$u();tf();ol();al();pf();mf();xf();Cf();Ef();il();var Dp=Mf(),dl=jf().marked,Kf=/Mac/.test(navigator.platform),wp=new RegExp(/(<a.*?https?:\/\/.*?[^a]>)+?/g),ui={toggleBold:fo,toggleItalic:co,drawLink:ko,toggleHeadingSmaller:fi,toggleHeadingBigger:vo,drawImage:So,toggleBlockquote:go,toggleOrderedList:Do,toggleUnorderedList:xo,toggleCheckList:wo,toggleCodeBlock:po,togglePreview:Lo,toggleStrikethrough:ho,toggleHeading1:mo,toggleHeading2:bo,toggleHeading3:yo,toggleHeading4:pl,toggleHeading5:gl,toggleHeading6:vl,cleanBlock:Co,drawTable:Eo,drawHorizontalRule:Ao,undo:Fo,redo:To,toggleSideBySide:wn,toggleFullScreen:jr},Cp={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"},kp=function(o){for(var l in ui)if(ui[l]===o)return l;return null},hl=function(){var o=!1;return function(l){(/(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(l)||/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(l.substr(0,4)))&&(o=!0)}(navigator.userAgent||navigator.vendor||window.opera),o};function Sp(o){for(var l;(l=wp.exec(o))!==null;){var s=l[0];if(s.indexOf("target=")===-1){var a=s.replace(/>$/,' target="_blank">');o=o.replace(s,a)}}return o}function Ep(o){for(var l=new DOMParser,s=l.parseFromString(o,"text/html"),a=s.getElementsByTagName("li"),f=0;f<a.length;f++)for(var p=a[f],c=0;c<p.children.length;c++){var h=p.children[c];h instanceof HTMLInputElement&&h.type==="checkbox"&&(p.style.marginLeft="-1.5em",p.style.listStyleType="none")}return s.documentElement.innerHTML}function Yf(o){return Kf?o=o.replace("Ctrl","Cmd"):o=o.replace("Cmd","Ctrl"),o}function Ap(o,l,s,a){var f=so(o,!1,l,s,"button",a);f.classList.add("easymde-dropdown"),f.onclick=function(){f.focus()};var p=document.createElement("div");p.className="easymde-dropdown-content";for(var c=0;c<o.children.length;c++){var h=o.children[c],b;typeof h=="string"&&h in Ur?b=so(Ur[h],!0,l,s,"button",a):b=so(h,!0,l,s,"button",a),b.addEventListener("click",function(y){y.stopPropagation()},!1),p.appendChild(b)}return f.appendChild(p),f}function so(o,l,s,a,f,p){o=o||{};var c=document.createElement(f);if(o.attributes)for(var h in o.attributes)Object.prototype.hasOwnProperty.call(o.attributes,h)&&c.setAttribute(h,o.attributes[h]);var b=p.options.toolbarButtonClassPrefix?p.options.toolbarButtonClassPrefix+"-":"";c.className=b+o.name,c.setAttribute("type",f),s=s??!0,o.text&&(c.innerText=o.text),o.name&&o.name in a&&(ui[o.name]=o.action),o.title&&s&&(c.title=Tp(o.title,o.action,a),Kf&&(c.title=c.title.replace("Ctrl","\u2318"),c.title=c.title.replace("Alt","\u2325"))),o.title&&c.setAttribute("aria-label",o.title),o.noDisable&&c.classList.add("no-disable"),o.noMobile&&c.classList.add("no-mobile");var y=[];typeof o.className<"u"&&(y=o.className.split(" "));for(var x=[],C=0;C<y.length;C++){var E=y[C];E.match(/^fa([srlb]|(-[\w-]*)|$)/)?x.push(E):c.classList.add(E)}if(c.tabIndex=-1,x.length>0){for(var F=document.createElement("i"),_=0;_<x.length;_++){var L=x[_];F.classList.add(L)}c.appendChild(F)}return typeof o.icon<"u"&&(c.innerHTML=o.icon),o.action&&l&&(typeof o.action=="function"?c.onclick=function(T){T.preventDefault(),o.action(p)}:typeof o.action=="string"&&(c.onclick=function(T){T.preventDefault(),window.open(o.action,"_blank")})),c}function Fp(){var o=document.createElement("i");return o.className="separator",o.innerHTML="|",o}function Tp(o,l,s){var a,f=o;return l&&(a=kp(l),s[a]&&(f+=" ("+Yf(s[a])+")")),f}function Sr(o,l){l=l||o.getCursor("start");var s=o.getTokenAt(l);if(!s.type)return{};for(var a=s.type.split(" "),f={},p,c,h=0;h<a.length;h++)p=a[h],p==="strong"?f.bold=!0:p==="variable-2"?(c=o.getLine(l.line),/^\s*\d+\.\s/.test(c)?f["ordered-list"]=!0:/^\s*- \[[ xX]]\s/.test(c)?f["check-list"]=!0:f["unordered-list"]=!0):p==="atom"?f.quote=!0:p==="em"?f.italic=!0:p==="quote"?f.quote=!0:p==="strikethrough"?f.strikethrough=!0:p==="comment"?f.code=!0:p==="link"&&!f.image?f.link=!0:p==="image"?f.image=!0:p.match(/^header(-[1-6])?$/)&&(f[p.replace("header","heading")]=!0);return f}var Gf="";function jr(o){var l=o.codemirror;l.setOption("fullScreen",!l.getOption("fullScreen")),l.getOption("fullScreen")?(Gf=document.body.style.overflow,document.body.style.overflow="hidden"):document.body.style.overflow=Gf;var s=l.getWrapperElement(),a=s.nextSibling;if(a.classList.contains("editor-preview-active-side"))if(o.options.sideBySideFullscreen===!1){var f=s.parentNode;l.getOption("fullScreen")?f.classList.remove("sided--no-fullscreen"):f.classList.add("sided--no-fullscreen")}else wn(o);if(o.options.onToggleFullScreen&&o.options.onToggleFullScreen(l.getOption("fullScreen")||!1),typeof o.options.maxHeight<"u"&&(l.getOption("fullScreen")?(l.getScrollerElement().style.removeProperty("height"),a.style.removeProperty("height")):(l.getScrollerElement().style.height=o.options.maxHeight,o.setPreviewMaxHeight())),o.toolbar_div.classList.toggle("fullscreen"),o.toolbarElements&&o.toolbarElements.fullscreen){var p=o.toolbarElements.fullscreen;p.classList.toggle("active")}}function fo(o){bl(o,"bold",o.options.blockStyles.bold)}function co(o){bl(o,"italic",o.options.blockStyles.italic)}function ho(o){bl(o,"strikethrough","~~")}function po(o){var l=o.options.blockStyles.code;function s(R){if(typeof R!="object")throw"fencing_line() takes a 'line' object (not a line number, or line text). Got: "+typeof R+": "+R;return R.styles&&R.styles[2]&&R.styles[2].indexOf("formatting-code-block")!==-1}function a(R){return R.state.base.base||R.state.base}function f(R,z,K,ue,De){K=K||R.getLineHandle(z),ue=ue||R.getTokenAt({line:z,ch:1}),De=De||!!K.text&&R.getTokenAt({line:z,ch:K.text.length-1});var ot=ue.type?ue.type.split(" "):[];return De&&a(De).indentedCode?"indented":ot.indexOf("comment")===-1?!1:a(ue).fencedChars||a(De).fencedChars||s(K)?"fenced":"single"}function p(R,z,K,ue){var De=z.line+1,ot=K.line+1,A=z.line!==K.line,D=ue+`
`,ee=`
`+ue;A&&ot++,A&&K.ch===0&&(ee=ue+`
`,ot--),Gr(R,!1,[D,ee]),R.setSelection({line:De,ch:0},{line:ot,ch:0})}var c=o.codemirror,h=c.getCursor("start"),b=c.getCursor("end"),y=c.getTokenAt({line:h.line,ch:h.ch||1}),x=c.getLineHandle(h.line),C=f(c,h.line,x,y),E,F,_;if(C==="single"){var L=x.text.slice(0,h.ch).replace("`",""),T=x.text.slice(h.ch).replace("`","");c.replaceRange(L+T,{line:h.line,ch:0},{line:h.line,ch:99999999999999}),h.ch--,h!==b&&b.ch--,c.setSelection(h,b),c.focus()}else if(C==="fenced")if(h.line!==b.line||h.ch!==b.ch){for(E=h.line;E>=0&&(x=c.getLineHandle(E),!s(x));E--);var O=c.getTokenAt({line:E,ch:1}),N=a(O).fencedChars,P,I,W,j;s(c.getLineHandle(h.line))?(P="",I=h.line):s(c.getLineHandle(h.line-1))?(P="",I=h.line-1):(P=N+`
`,I=h.line),s(c.getLineHandle(b.line))?(W="",j=b.line,b.ch===0&&(j+=1)):b.ch!==0&&s(c.getLineHandle(b.line+1))?(W="",j=b.line+1):(W=N+`
`,j=b.line+1),b.ch===0&&(j-=1),c.operation(function(){c.replaceRange(W,{line:j,ch:0},{line:j+(W?0:1),ch:0}),c.replaceRange(P,{line:I,ch:0},{line:I+(P?0:1),ch:0})}),c.setSelection({line:I+(P?1:0),ch:0},{line:j+(P?1:-1),ch:0}),c.focus()}else{var X=h.line;if(s(c.getLineHandle(h.line))&&(f(c,h.line+1)==="fenced"?(E=h.line,X=h.line+1):(F=h.line,X=h.line-1)),E===void 0)for(E=X;E>=0&&(x=c.getLineHandle(E),!s(x));E--);if(F===void 0)for(_=c.lineCount(),F=X;F<_&&(x=c.getLineHandle(F),!s(x));F++);c.operation(function(){c.replaceRange("",{line:E,ch:0},{line:E+1,ch:0}),c.replaceRange("",{line:F-1,ch:0},{line:F,ch:0})}),c.focus()}else if(C==="indented"){if(h.line!==b.line||h.ch!==b.ch)E=h.line,F=b.line,b.ch===0&&F--;else{for(E=h.line;E>=0;E--)if(x=c.getLineHandle(E),!x.text.match(/^\s*$/)&&f(c,E,x)!=="indented"){E+=1;break}for(_=c.lineCount(),F=h.line;F<_;F++)if(x=c.getLineHandle(F),!x.text.match(/^\s*$/)&&f(c,F,x)!=="indented"){F-=1;break}}var be=c.getLineHandle(F+1),U=be&&c.getTokenAt({line:F+1,ch:be.text.length-1}),ae=U&&a(U).indentedCode;ae&&c.replaceRange(`
`,{line:F+1,ch:0});for(var ne=E;ne<=F;ne++)c.indentLine(ne,"subtract");c.focus()}else{var se=h.line===b.line&&h.ch===b.ch&&h.ch===0,S=h.line!==b.line;se||S?p(c,h,b,l):Gr(c,!1,["`","`"])}}function go(o){Mo(o.codemirror,"quote")}function fi(o){Er(o.codemirror,"smaller")}function vo(o){Er(o.codemirror,"bigger")}function mo(o){Er(o.codemirror,void 0,1)}function bo(o){Er(o.codemirror,void 0,2)}function yo(o){Er(o.codemirror,void 0,3)}function pl(o){Er(o.codemirror,void 0,4)}function gl(o){Er(o.codemirror,void 0,5)}function vl(o){Er(o.codemirror,void 0,6)}function xo(o){var l=o.codemirror,s="*";["-","+","*"].includes(o.options.unorderedListStyle)&&(s=o.options.unorderedListStyle),Mo(l,"unordered-list",s)}function Do(o){Mo(o.codemirror,"ordered-list")}function wo(o){Mo(o.codemirror,"check-list")}function Co(o){Lp(o.codemirror)}function ko(o){var l=o.options,s="https://";if(l.promptURLs){var a=prompt(l.promptTexts.link,s);if(!a)return!1;s=Zf(a)}Jf(o,"link",l.insertTexts.link,s)}function So(o){var l=o.options,s="https://";if(l.promptURLs){var a=prompt(l.promptTexts.image,s);if(!a)return!1;s=Zf(a)}Jf(o,"image",l.insertTexts.image,s)}function Zf(o){return encodeURI(o).replace(/([\\()])/g,"\\$1")}function ml(o){o.openBrowseFileWindow()}function Qf(o,l){var s=o.codemirror,a=Sr(s),f=o.options,p=l.substr(l.lastIndexOf("/")+1),c=p.substring(p.lastIndexOf(".")+1).replace(/\?.*$/,"").toLowerCase();if(["png","jpg","jpeg","gif","svg","apng","avif","webp"].includes(c))Gr(s,a.image,f.insertTexts.uploadedImage,l);else{var h=f.insertTexts.link;h[0]="["+p,Gr(s,a.link,h,l)}o.updateStatusBar("upload-image",o.options.imageTexts.sbOnUploaded.replace("#image_name#",p)),setTimeout(function(){o.updateStatusBar("upload-image",o.options.imageTexts.sbInit)},1e3)}function Eo(o){var l=o.codemirror,s=Sr(l),a=o.options;Gr(l,s.table,a.insertTexts.table)}function Ao(o){var l=o.codemirror,s=Sr(l),a=o.options;Gr(l,s.image,a.insertTexts.horizontalRule)}function Fo(o){var l=o.codemirror;l.undo(),l.focus()}function To(o){var l=o.codemirror;l.redo(),l.focus()}function wn(o){var l=o.codemirror,s=l.getWrapperElement(),a=s.nextSibling,f=o.toolbarElements&&o.toolbarElements["side-by-side"],p=!1,c=s.parentNode;a.classList.contains("editor-preview-active-side")?(o.options.sideBySideFullscreen===!1&&c.classList.remove("sided--no-fullscreen"),a.classList.remove("editor-preview-active-side"),f&&f.classList.remove("active"),s.classList.remove("CodeMirror-sided")):(setTimeout(function(){l.getOption("fullScreen")||(o.options.sideBySideFullscreen===!1?c.classList.add("sided--no-fullscreen"):jr(o)),a.classList.add("editor-preview-active-side")},1),f&&f.classList.add("active"),s.classList.add("CodeMirror-sided"),p=!0);var h=s.lastChild;if(h.classList.contains("editor-preview-active")){h.classList.remove("editor-preview-active");var b=o.toolbarElements.preview,y=o.toolbar_div;b.classList.remove("active"),y.classList.remove("disabled-for-preview")}var x=function(){var E=o.options.previewRender(o.value(),a);E!=null&&(a.innerHTML=E)};if(l.sideBySideRenderingFunction||(l.sideBySideRenderingFunction=x),p){var C=o.options.previewRender(o.value(),a);C!=null&&(a.innerHTML=C),l.on("update",l.sideBySideRenderingFunction)}else l.off("update",l.sideBySideRenderingFunction);l.refresh()}function Lo(o){var l=o.codemirror,s=l.getWrapperElement(),a=o.toolbar_div,f=o.options.toolbar?o.toolbarElements.preview:!1,p=s.lastChild,c=l.getWrapperElement().nextSibling;if(c.classList.contains("editor-preview-active-side")&&wn(o),!p||!p.classList.contains("editor-preview-full")){if(p=document.createElement("div"),p.className="editor-preview-full",o.options.previewClass)if(Array.isArray(o.options.previewClass))for(var h=0;h<o.options.previewClass.length;h++)p.classList.add(o.options.previewClass[h]);else typeof o.options.previewClass=="string"&&p.classList.add(o.options.previewClass);s.appendChild(p)}p.classList.contains("editor-preview-active")?(p.classList.remove("editor-preview-active"),f&&(f.classList.remove("active"),a.classList.remove("disabled-for-preview"))):(setTimeout(function(){p.classList.add("editor-preview-active")},1),f&&(f.classList.add("active"),a.classList.add("disabled-for-preview")));var b=o.options.previewRender(o.value(),p);b!==null&&(p.innerHTML=b)}function Gr(o,l,s,a){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active")){var f,p=s[0],c=s[1],h={},b={};Object.assign(h,o.getCursor("start")),Object.assign(b,o.getCursor("end")),a&&(p=p.replace("#url#",a),c=c.replace("#url#",a)),l?(f=o.getLine(h.line),p=f.slice(0,h.ch),c=f.slice(h.ch),o.replaceRange(p+c,{line:h.line,ch:0})):(f=o.getSelection(),o.replaceSelection(p+f+c),h.ch+=p.length,h!==b&&(b.ch+=p.length)),o.setSelection(h,b),o.focus()}}function Er(o,l,s){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active")){for(var a=o.getCursor("start"),f=o.getCursor("end"),p=a.line;p<=f.line;p++)(function(c){var h=o.getLine(c),b=h.search(/[^#]/);l!==void 0?b<=0?l=="bigger"?h="###### "+h:h="# "+h:b==6&&l=="smaller"?h=h.substr(7):b==1&&l=="bigger"?h=h.substr(2):l=="bigger"?h=h.substr(1):h="#"+h:b<=0?h="#".repeat(s)+" "+h:b==s?h=h.substr(b+1):h="#".repeat(s)+" "+h.substr(b+1),o.replaceRange(h,{line:c,ch:0},{line:c,ch:99999999999999})})(p);o.focus()}}function Mo(o,l,s){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active")){var a=/^(\s*)(\*|-|\+|\d*\.)(\s+)/,f=/^\s*/,p=Sr(o),c=o.getCursor("start"),h=o.getCursor("end"),b={quote:/^(\s*)>\s+/,"unordered-list":a,"ordered-list":a,"check-list":/^(\s*)(- \[[ xX]])(\s+)/},y=function(O,N){var P={quote:">","unordered-list":s,"ordered-list":"%%i.","check-list":"- [ ]"};return P[O].replace("%%i",N)},x=function(O,N){var P={quote:">","unordered-list":"\\"+s,"ordered-list":"\\d+.","check-list":"- \\[[ xX]]"},I=new RegExp(P[O]);return N&&I.test(N)},C=function(O,N,P){var I=a.exec(N),W=y(O,E);return I!==null?(x(O,I[2])&&(W=""),N=I[1]+W+I[3]+N.replace(f,"").replace(b[O],"$1")):P==!1&&(N=W+" "+N),N},E=1,F=["unordered-list","ordered-list","check-list"],_=Object.keys(p)[0];if(!F.includes(_)){var L=o.getLine(c.line);/^\s*- \[[ xX]]\s/.test(L)?_="check-list":/^\s*\d+\.\s/.test(L)?_="ordered-list":/^\s*[*\-+]\s/.test(L)&&(_="unordered-list")}for(var T=c.line;T<=h.line;T++)(function(O){var N=o.getLine(O);p[l]?N=N.replace(b[l],"$1"):F.includes(_)&&F.includes(l)?(N=N.replace(b[_],"$1"),N=C(l,N,!1),E+=1):(N=C(l,N,!1),E+=1),o.replaceRange(N,{line:O,ch:0},{line:O,ch:99999999999999})})(T);o.focus()}}function Jf(o,l,s,a){if(!(!o.codemirror||o.isPreviewActive())){var f=o.codemirror,p=Sr(f),c=p[l];if(!c){Gr(f,c,s,a);return}var h=f.getCursor("start"),b=f.getCursor("end"),y=f.getLine(h.line),x=y.slice(0,h.ch),C=y.slice(h.ch);l=="link"?x=x.replace(/(.*)[^!]\[/,"$1"):l=="image"&&(x=x.replace(/(.*)!\[$/,"$1")),C=C.replace(/]\(.*?\)/,""),f.replaceRange(x+C,{line:h.line,ch:0},{line:h.line,ch:99999999999999}),h.ch-=s[0].length,h!==b&&(b.ch-=s[0].length),f.setSelection(h,b),f.focus()}}function bl(o,l,s,a){if(!(!o.codemirror||o.isPreviewActive())){a=typeof a>"u"?s:a;var f=o.codemirror,p=Sr(f),c,h=s,b=a,y=f.getCursor("start"),x=f.getCursor("end");p[l]?(c=f.getLine(y.line),h=c.slice(0,y.ch),b=c.slice(y.ch),l=="bold"?(h=h.replace(/(\*\*|__)(?![\s\S]*(\*\*|__))/,""),b=b.replace(/(\*\*|__)/,"")):l=="italic"?(h=h.replace(/(\*|_)(?![\s\S]*(\*|_))/,""),b=b.replace(/(\*|_)/,"")):l=="strikethrough"&&(h=h.replace(/(\*\*|~~)(?![\s\S]*(\*\*|~~))/,""),b=b.replace(/(\*\*|~~)/,"")),f.replaceRange(h+b,{line:y.line,ch:0},{line:y.line,ch:99999999999999}),l=="bold"||l=="strikethrough"?(y.ch-=2,y!==x&&(x.ch-=2)):l=="italic"&&(y.ch-=1,y!==x&&(x.ch-=1))):(c=f.getSelection(),l=="bold"?(c=c.split("**").join(""),c=c.split("__").join("")):l=="italic"?(c=c.split("*").join(""),c=c.split("_").join("")):l=="strikethrough"&&(c=c.split("~~").join("")),f.replaceSelection(h+c+b),y.ch+=s.length,x.ch=y.ch+c.length),f.setSelection(y,x),f.focus()}}function Lp(o){if(!o.getWrapperElement().lastChild.classList.contains("editor-preview-active"))for(var l=o.getCursor("start"),s=o.getCursor("end"),a,f=l.line;f<=s.line;f++)a=o.getLine(f),a=a.replace(/^[ ]*([# ]+|\*|-|[> ]+|[0-9]+(.|\)))[ ]*/,""),o.replaceRange(a,{line:f,ch:0},{line:f,ch:99999999999999})}function uo(o,l){if(Math.abs(o)<1024)return""+o+l[0];var s=0;do o/=1024,++s;while(Math.abs(o)>=1024&&s<l.length);return""+o.toFixed(1)+l[s]}function $f(o,l){for(var s in l)Object.prototype.hasOwnProperty.call(l,s)&&(l[s]instanceof Array?o[s]=l[s].concat(o[s]instanceof Array?o[s]:[]):l[s]!==null&&typeof l[s]=="object"&&l[s].constructor===Object?o[s]=$f(o[s]||{},l[s]):o[s]=l[s]);return o}function sr(o){for(var l=1;l<arguments.length;l++)o=$f(o,arguments[l]);return o}function Xf(o){var l=/[a-zA-Z0-9_\u00A0-\u02AF\u0392-\u03c9\u0410-\u04F9]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af]+/g,s=o.match(l),a=0;if(s===null)return a;for(var f=0;f<s.length;f++)s[f].charCodeAt(0)>=19968?a+=s[f].length:a+=1;return a}var Me={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"},Ur={bold:{name:"bold",action:fo,className:Me.bold,title:"Bold",default:!0},italic:{name:"italic",action:co,className:Me.italic,title:"Italic",default:!0},strikethrough:{name:"strikethrough",action:ho,className:Me.strikethrough,title:"Strikethrough"},heading:{name:"heading",action:fi,className:Me.heading,title:"Heading",default:!0},"heading-smaller":{name:"heading-smaller",action:fi,className:Me["heading-smaller"],title:"Smaller Heading"},"heading-bigger":{name:"heading-bigger",action:vo,className:Me["heading-bigger"],title:"Bigger Heading"},"heading-1":{name:"heading-1",action:mo,className:Me["heading-1"],title:"Big Heading"},"heading-2":{name:"heading-2",action:bo,className:Me["heading-2"],title:"Medium Heading"},"heading-3":{name:"heading-3",action:yo,className:Me["heading-3"],title:"Small Heading"},"separator-1":{name:"separator-1"},code:{name:"code",action:po,className:Me.code,title:"Code"},quote:{name:"quote",action:go,className:Me.quote,title:"Quote",default:!0},"unordered-list":{name:"unordered-list",action:xo,className:Me["unordered-list"],title:"Generic List",default:!0},"ordered-list":{name:"ordered-list",action:Do,className:Me["ordered-list"],title:"Numbered List",default:!0},"check-list":{name:"check-list",action:wo,className:Me["check-list"],title:"Check List",default:!0},"clean-block":{name:"clean-block",action:Co,className:Me["clean-block"],title:"Clean block"},"separator-2":{name:"separator-2"},link:{name:"link",action:ko,className:Me.link,title:"Create Link",default:!0},image:{name:"image",action:So,className:Me.image,title:"Insert Image",default:!0},"upload-image":{name:"upload-image",action:ml,className:Me["upload-image"],title:"Import an image"},table:{name:"table",action:Eo,className:Me.table,title:"Insert Table"},"horizontal-rule":{name:"horizontal-rule",action:Ao,className:Me["horizontal-rule"],title:"Insert Horizontal Line"},"separator-3":{name:"separator-3"},preview:{name:"preview",action:Lo,className:Me.preview,noDisable:!0,title:"Toggle Preview",default:!0},"side-by-side":{name:"side-by-side",action:wn,className:Me["side-by-side"],noDisable:!0,noMobile:!0,title:"Toggle Side by Side",default:!0},fullscreen:{name:"fullscreen",action:jr,className:Me.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:Me.guide,noDisable:!0,title:"Markdown Guide",default:!0},"separator-5":{name:"separator-5"},undo:{name:"undo",action:Fo,className:Me.undo,noDisable:!0,title:"Undo"},redo:{name:"redo",action:To,className:Me.redo,noDisable:!0,title:"Redo"}},Mp={link:["[","](#url#)"],image:["![","](#url#)"],uploadedImage:["![](#url#)",""],table:["",`
| Column 1 | Column 2 | Column 3 |
| -------- | -------- | -------- |
| Text | Text | Text |
`],horizontalRule:["",`
-----
`]},_p={link:"URL for the link:",image:"URL of the image:"},Bp={locale:"en-US",format:{hour:"2-digit",minute:"2-digit"}},Np={bold:"**",code:"```",italic:"*"},Op={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"},Ip={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 V(o){o=o||{},o.parent=this;var l=!0;if(o.autoDownloadFontAwesome===!1&&(l=!1),o.autoDownloadFontAwesome!==!0)for(var s=document.styleSheets,a=0;a<s.length;a++)s[a].href&&s[a].href.indexOf("//maxcdn.bootstrapcdn.com/font-awesome/")>-1&&(l=!1);if(l){var f=document.createElement("link");f.rel="stylesheet",f.href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css",document.getElementsByTagName("head")[0].appendChild(f)}if(o.element)this.element=o.element;else if(o.element===null){console.log("EasyMDE: Error. No element was found.");return}if(o.toolbar===void 0){o.toolbar=[];for(var p in Ur)Object.prototype.hasOwnProperty.call(Ur,p)&&(p.indexOf("separator-")!=-1&&o.toolbar.push("|"),(Ur[p].default===!0||o.showIcons&&o.showIcons.constructor===Array&&o.showIcons.indexOf(p)!=-1)&&o.toolbar.push(p))}if(Object.prototype.hasOwnProperty.call(o,"previewClass")||(o.previewClass="editor-preview"),Object.prototype.hasOwnProperty.call(o,"status")||(o.status=["autosave","lines","words","cursor"],o.uploadImage&&o.status.unshift("upload-image")),o.previewRender||(o.previewRender=function(h){return this.parent.markdown(h)}),o.parsingConfig=sr({highlightFormatting:!0},o.parsingConfig||{}),o.insertTexts=sr({},Mp,o.insertTexts||{}),o.promptTexts=sr({},_p,o.promptTexts||{}),o.blockStyles=sr({},Np,o.blockStyles||{}),o.autosave!=null&&(o.autosave.timeFormat=sr({},Bp,o.autosave.timeFormat||{})),o.iconClassMap=sr({},Me,o.iconClassMap||{}),o.shortcuts=sr({},Cp,o.shortcuts||{}),o.maxHeight=o.maxHeight||void 0,o.direction=o.direction||"ltr",typeof o.maxHeight<"u"?o.minHeight=o.maxHeight:o.minHeight=o.minHeight||"300px",o.errorCallback=o.errorCallback||function(h){alert(h)},o.uploadImage=o.uploadImage||!1,o.imageMaxSize=o.imageMaxSize||2097152,o.imageAccept=o.imageAccept||"image/png, image/jpeg, image/gif, image/avif",o.imageTexts=sr({},Op,o.imageTexts||{}),o.errorMessages=sr({},Ip,o.errorMessages||{}),o.imagePathAbsolute=o.imagePathAbsolute||!1,o.imageCSRFName=o.imageCSRFName||"csrfmiddlewaretoken",o.imageCSRFHeader=o.imageCSRFHeader||!1,o.imageInputName=o.imageInputName||"image",o.autosave!=null&&o.autosave.unique_id!=null&&o.autosave.unique_id!=""&&(o.autosave.uniqueId=o.autosave.unique_id),o.overlayMode&&o.overlayMode.combine===void 0&&(o.overlayMode.combine=!0),this.options=o,this.render(),o.initialValue&&(!this.options.autosave||this.options.autosave.foundSavedValue!==!0)&&this.value(o.initialValue),o.uploadImage){var c=this;this.codemirror.on("dragenter",function(h,b){c.updateStatusBar("upload-image",c.options.imageTexts.sbOnDragEnter),b.stopPropagation(),b.preventDefault()}),this.codemirror.on("dragend",function(h,b){c.updateStatusBar("upload-image",c.options.imageTexts.sbInit),b.stopPropagation(),b.preventDefault()}),this.codemirror.on("dragleave",function(h,b){c.updateStatusBar("upload-image",c.options.imageTexts.sbInit),b.stopPropagation(),b.preventDefault()}),this.codemirror.on("dragover",function(h,b){c.updateStatusBar("upload-image",c.options.imageTexts.sbOnDragEnter),b.stopPropagation(),b.preventDefault()}),this.codemirror.on("drop",function(h,b){b.stopPropagation(),b.preventDefault(),o.imageUploadFunction?c.uploadImagesUsingCustomFunction(o.imageUploadFunction,b.dataTransfer.files):c.uploadImages(b.dataTransfer.files)}),this.codemirror.on("paste",function(h,b){o.imageUploadFunction?c.uploadImagesUsingCustomFunction(o.imageUploadFunction,b.clipboardData.files):c.uploadImages(b.clipboardData.files)})}}V.prototype.uploadImages=function(o,l,s){if(o.length!==0){for(var a=[],f=0;f<o.length;f++)a.push(o[f].name),this.uploadImage(o[f],l,s);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",a.join(", ")))}};V.prototype.uploadImagesUsingCustomFunction=function(o,l){if(l.length!==0){for(var s=[],a=0;a<l.length;a++)s.push(l[a].name),this.uploadImageUsingCustomFunction(o,l[a]);this.updateStatusBar("upload-image",this.options.imageTexts.sbOnDrop.replace("#images_names#",s.join(", ")))}};V.prototype.updateStatusBar=function(o,l){if(this.gui.statusbar){var s=this.gui.statusbar.getElementsByClassName(o);s.length===1?this.gui.statusbar.getElementsByClassName(o)[0].textContent=l:s.length===0?console.log("EasyMDE: status bar item "+o+" was not found."):console.log("EasyMDE: Several status bar items named "+o+" was found.")}};V.prototype.markdown=function(o){if(dl){var l;if(this.options&&this.options.renderingConfig&&this.options.renderingConfig.markedOptions?l=this.options.renderingConfig.markedOptions:l={},this.options&&this.options.renderingConfig&&this.options.renderingConfig.singleLineBreaks===!1?l.breaks=!1:l.breaks=!0,this.options&&this.options.renderingConfig&&this.options.renderingConfig.codeSyntaxHighlighting===!0){var s=this.options.renderingConfig.hljs||window.hljs;s&&(l.highlight=function(f,p){return p&&s.getLanguage(p)?s.highlight(p,f).value:s.highlightAuto(f).value})}dl.use(l);var a=dl.parse(o);return this.options.renderingConfig&&typeof this.options.renderingConfig.sanitizerFunction=="function"&&(a=this.options.renderingConfig.sanitizerFunction.call(this,a)),a=Sp(a),a=Ep(a),a}};V.prototype.render=function(o){if(o||(o=this.element||document.getElementsByTagName("textarea")[0]),this._rendered&&this._rendered===o)return;this.element=o;var l=this.options,s=this,a={};for(var f in l.shortcuts)l.shortcuts[f]!==null&&ui[f]!==null&&function(T){a[Yf(l.shortcuts[T])]=function(){var O=ui[T];typeof O=="function"?O(s):typeof O=="string"&&window.open(O,"_blank")}}(f);a.Enter="newlineAndIndentContinueMarkdownList",a.Tab="tabAndIndentMarkdownList",a["Shift-Tab"]="shiftTabAndUnindentMarkdownList",a.Esc=function(T){T.getOption("fullScreen")&&jr(s)},this.documentOnKeyDown=function(T){T=T||window.event,T.keyCode==27&&s.codemirror.getOption("fullScreen")&&jr(s)},document.addEventListener("keydown",this.documentOnKeyDown,!1);var p,c;l.overlayMode?(Dn.defineMode("overlay-mode",function(T){return Dn.overlayMode(Dn.getMode(T,l.spellChecker!==!1?"spell-checker":"gfm"),l.overlayMode.mode,l.overlayMode.combine)}),p="overlay-mode",c=l.parsingConfig,c.gitHubSpice=!1):(p=l.parsingConfig,p.name="gfm",p.gitHubSpice=!1),l.spellChecker!==!1&&(p="spell-checker",c=l.parsingConfig,c.name="gfm",c.gitHubSpice=!1,typeof l.spellChecker=="function"?l.spellChecker({codeMirrorInstance:Dn}):Dp({codeMirrorInstance:Dn}));function h(T,O,N){return{addNew:!1}}if(this.codemirror=Dn.fromTextArea(o,{mode:p,backdrop:c,theme:l.theme!=null?l.theme:"easymde",tabSize:l.tabSize!=null?l.tabSize:2,indentUnit:l.tabSize!=null?l.tabSize:2,indentWithTabs:l.indentWithTabs!==!1,lineNumbers:l.lineNumbers===!0,autofocus:l.autofocus===!0,extraKeys:a,direction:l.direction,lineWrapping:l.lineWrapping!==!1,allowDropFileTypes:["text/plain"],placeholder:l.placeholder||o.getAttribute("placeholder")||"",styleSelectedText:l.styleSelectedText!=null?l.styleSelectedText:!hl(),scrollbarStyle:l.scrollbarStyle!=null?l.scrollbarStyle:"native",configureMouse:h,inputStyle:l.inputStyle!=null?l.inputStyle:hl()?"contenteditable":"textarea",spellcheck:l.nativeSpellcheck!=null?l.nativeSpellcheck:!0,autoRefresh:l.autoRefresh!=null?l.autoRefresh:!1}),this.codemirror.getScrollerElement().style.minHeight=l.minHeight,typeof l.maxHeight<"u"&&(this.codemirror.getScrollerElement().style.height=l.maxHeight),l.forceSync===!0){var b=this.codemirror;b.on("change",function(){b.save()})}this.gui={};var y=document.createElement("div");y.classList.add("EasyMDEContainer"),y.setAttribute("role","application");var x=this.codemirror.getWrapperElement();x.parentNode.insertBefore(y,x),y.appendChild(x),l.toolbar!==!1&&(this.gui.toolbar=this.createToolbar()),l.status!==!1&&(this.gui.statusbar=this.createStatusbar()),l.autosave!=null&&l.autosave.enabled===!0&&(this.autosave(),this.codemirror.on("change",function(){clearTimeout(s._autosave_timeout),s._autosave_timeout=setTimeout(function(){s.autosave()},s.options.autosave.submit_delay||s.options.autosave.delay||1e3)}));function C(T,O){var N,P=window.getComputedStyle(document.querySelector(".CodeMirror-sizer")).width.replace("px","");return T<P?N=O+"px":N=O/T*100+"%",N}var E=this;function F(T,O){var N=new URL(O.url,document.baseURI).href;T.setAttribute("data-img-src",N),T.setAttribute("style","--bg-image:url("+N+");--width:"+O.naturalWidth+"px;--height:"+C(O.naturalWidth,O.naturalHeight)),E.codemirror.setSize()}function _(){l.previewImagesInEditor&&y.querySelectorAll(".cm-image-marker").forEach(function(T){var O=T.parentElement;if(O.innerText.match(/^!\[.*?\]\(.*\)/g)&&!O.hasAttribute("data-img-src")){var N=O.innerText.match(/!\[.*?\]\((.*?)\)/);if(window.EMDEimagesCache||(window.EMDEimagesCache={}),N&&N.length>=2){var P=N[1];if(l.imagesPreviewHandler){var I=l.imagesPreviewHandler(N[1]);typeof I=="string"&&(P=I)}if(window.EMDEimagesCache[P])F(O,window.EMDEimagesCache[P]);else{window.EMDEimagesCache[P]={};var W=document.createElement("img");W.onload=function(){window.EMDEimagesCache[P]={naturalWidth:W.naturalWidth,naturalHeight:W.naturalHeight,url:P},F(O,window.EMDEimagesCache[P])},W.src=P}}}})}this.codemirror.on("update",function(){_()}),this.gui.sideBySide=this.createSideBySide(),this._rendered=this.element,(l.autofocus===!0||o.autofocus)&&this.codemirror.focus();var L=this.codemirror;setTimeout(function(){L.refresh()}.bind(L),0)};V.prototype.cleanup=function(){document.removeEventListener("keydown",this.documentOnKeyDown)};function Vf(){if(typeof localStorage=="object")try{localStorage.setItem("smde_localStorage",1),localStorage.removeItem("smde_localStorage")}catch{return!1}else return!1;return!0}V.prototype.autosave=function(){if(Vf()){var o=this;if(this.options.autosave.uniqueId==null||this.options.autosave.uniqueId==""){console.log("EasyMDE: You must set a uniqueId to use the autosave feature");return}this.options.autosave.binded!==!0&&(o.element.form!=null&&o.element.form!=null&&o.element.form.addEventListener("submit",function(){clearTimeout(o.autosaveTimeoutId),o.autosaveTimeoutId=void 0,localStorage.removeItem("smde_"+o.options.autosave.uniqueId)}),this.options.autosave.binded=!0),this.options.autosave.loaded!==!0&&(typeof localStorage.getItem("smde_"+this.options.autosave.uniqueId)=="string"&&localStorage.getItem("smde_"+this.options.autosave.uniqueId)!=""&&(this.codemirror.setValue(localStorage.getItem("smde_"+this.options.autosave.uniqueId)),this.options.autosave.foundSavedValue=!0),this.options.autosave.loaded=!0);var l=o.value();l!==""?localStorage.setItem("smde_"+this.options.autosave.uniqueId,l):localStorage.removeItem("smde_"+this.options.autosave.uniqueId);var s=document.getElementById("autosaved");if(s!=null&&s!=null&&s!=""){var a=new Date,f=new Intl.DateTimeFormat([this.options.autosave.timeFormat.locale,"en-US"],this.options.autosave.timeFormat.format).format(a),p=this.options.autosave.text==null?"Autosaved: ":this.options.autosave.text;s.innerHTML=p+f}}else console.log("EasyMDE: localStorage not available, cannot autosave")};V.prototype.clearAutosavedValue=function(){if(Vf()){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")};V.prototype.openBrowseFileWindow=function(o,l){var s=this,a=this.gui.toolbar.getElementsByClassName("imageInput")[0];a.click();function f(p){s.options.imageUploadFunction?s.uploadImagesUsingCustomFunction(s.options.imageUploadFunction,p.target.files):s.uploadImages(p.target.files,o,l),a.removeEventListener("change",f)}a.addEventListener("change",f)};V.prototype.uploadImage=function(o,l,s){var a=this;l=l||function(y){Qf(a,y)};function f(b){a.updateStatusBar("upload-image",b),setTimeout(function(){a.updateStatusBar("upload-image",a.options.imageTexts.sbInit)},1e4),s&&typeof s=="function"&&s(b),a.options.errorCallback(b)}function p(b){var y=a.options.imageTexts.sizeUnits.split(",");return b.replace("#image_name#",o.name).replace("#image_size#",uo(o.size,y)).replace("#image_max_size#",uo(a.options.imageMaxSize,y))}if(o.size>this.options.imageMaxSize){f(p(this.options.errorMessages.fileTooLarge));return}var c=new FormData;c.append("image",o),a.options.imageCSRFToken&&!a.options.imageCSRFHeader&&c.append(a.options.imageCSRFName,a.options.imageCSRFToken);var h=new XMLHttpRequest;h.upload.onprogress=function(b){if(b.lengthComputable){var y=""+Math.round(b.loaded*100/b.total);a.updateStatusBar("upload-image",a.options.imageTexts.sbProgress.replace("#file_name#",o.name).replace("#progress#",y))}},h.open("POST",this.options.imageUploadEndpoint),a.options.imageCSRFToken&&a.options.imageCSRFHeader&&h.setRequestHeader(a.options.imageCSRFName,a.options.imageCSRFToken),h.onload=function(){try{var b=JSON.parse(this.responseText)}catch{console.error("EasyMDE: The server did not return a valid json."),f(p(a.options.errorMessages.importError));return}this.status===200&&b&&!b.error&&b.data&&b.data.filePath?l((a.options.imagePathAbsolute?"":window.location.origin+"/")+b.data.filePath):b.error&&b.error in a.options.errorMessages?f(p(a.options.errorMessages[b.error])):b.error?f(p(b.error)):(console.error("EasyMDE: Received an unexpected response after uploading the image."+this.status+" ("+this.statusText+")"),f(p(a.options.errorMessages.importError)))},h.onerror=function(b){console.error("EasyMDE: An unexpected error occurred when trying to upload the image."+b.target.status+" ("+b.target.statusText+")"),f(a.options.errorMessages.importError)},h.send(c)};V.prototype.uploadImageUsingCustomFunction=function(o,l){var s=this;function a(c){Qf(s,c)}function f(c){var h=p(c);s.updateStatusBar("upload-image",h),setTimeout(function(){s.updateStatusBar("upload-image",s.options.imageTexts.sbInit)},1e4),s.options.errorCallback(h)}function p(c){var h=s.options.imageTexts.sizeUnits.split(",");return c.replace("#image_name#",l.name).replace("#image_size#",uo(l.size,h)).replace("#image_max_size#",uo(s.options.imageMaxSize,h))}o.apply(this,[l,a,f])};V.prototype.setPreviewMaxHeight=function(){var o=this.codemirror,l=o.getWrapperElement(),s=l.nextSibling,a=parseInt(window.getComputedStyle(l).paddingTop),f=parseInt(window.getComputedStyle(l).borderTopWidth),p=parseInt(this.options.maxHeight),c=p+a*2+f*2,h=c.toString()+"px";s.style.height=h};V.prototype.createSideBySide=function(){var o=this.codemirror,l=o.getWrapperElement(),s=l.nextSibling;if(!s||!s.classList.contains("editor-preview-side")){if(s=document.createElement("div"),s.className="editor-preview-side",this.options.previewClass)if(Array.isArray(this.options.previewClass))for(var a=0;a<this.options.previewClass.length;a++)s.classList.add(this.options.previewClass[a]);else typeof this.options.previewClass=="string"&&s.classList.add(this.options.previewClass);l.parentNode.insertBefore(s,l.nextSibling)}if(typeof this.options.maxHeight<"u"&&this.setPreviewMaxHeight(),this.options.syncSideBySidePreviewScroll===!1)return s;var f=!1,p=!1;return o.on("scroll",function(c){if(f){f=!1;return}p=!0;var h=c.getScrollInfo().height-c.getScrollInfo().clientHeight,b=parseFloat(c.getScrollInfo().top)/h,y=(s.scrollHeight-s.clientHeight)*b;s.scrollTop=y}),s.onscroll=function(){if(p){p=!1;return}f=!0;var c=s.scrollHeight-s.clientHeight,h=parseFloat(s.scrollTop)/c,b=(o.getScrollInfo().height-o.getScrollInfo().clientHeight)*h;o.scrollTo(0,b)},s};V.prototype.createToolbar=function(o){if(o=o||this.options.toolbar,!(!o||o.length===0)){var l;for(l=0;l<o.length;l++)Ur[o[l]]!=null&&(o[l]=Ur[o[l]]);var s=document.createElement("div");s.className="editor-toolbar",s.setAttribute("role","toolbar");var a=this,f={};for(a.toolbar=o,l=0;l<o.length;l++)if(!(o[l].name=="guide"&&a.options.toolbarGuideIcon===!1)&&!(a.options.hideIcons&&a.options.hideIcons.indexOf(o[l].name)!=-1)&&!((o[l].name=="fullscreen"||o[l].name=="side-by-side")&&hl())){if(o[l]==="|"){for(var p=!1,c=l+1;c<o.length;c++)o[c]!=="|"&&(!a.options.hideIcons||a.options.hideIcons.indexOf(o[c].name)==-1)&&(p=!0);if(!p)continue}(function(y){var x;if(y==="|"?x=Fp():y.children?x=Ap(y,a.options.toolbarTips,a.options.shortcuts,a):x=so(y,!0,a.options.toolbarTips,a.options.shortcuts,"button",a),f[y.name||y]=x,s.appendChild(x),y.name==="upload-image"){var C=document.createElement("input");C.className="imageInput",C.type="file",C.multiple=!0,C.name=a.options.imageInputName,C.accept=a.options.imageAccept,C.style.display="none",C.style.opacity=0,s.appendChild(C)}})(o[l])}a.toolbar_div=s,a.toolbarElements=f;var h=this.codemirror;h.on("cursorActivity",function(){var y=Sr(h);for(var x in f)(function(C){var E=f[C];y[C]?E.classList.add("active"):C!="fullscreen"&&C!="side-by-side"&&E.classList.remove("active")})(x)});var b=h.getWrapperElement();return b.parentNode.insertBefore(s,b),s}};V.prototype.createStatusbar=function(o){o=o||this.options.status;var l=this.options,s=this.codemirror;if(!(!o||o.length===0)){var a=[],f,p,c,h;for(f=0;f<o.length;f++)if(p=void 0,c=void 0,h=void 0,typeof o[f]=="object")a.push({className:o[f].className,defaultValue:o[f].defaultValue,onUpdate:o[f].onUpdate,onActivity:o[f].onActivity});else{var b=o[f];b==="words"?(h=function(F){F.innerHTML=Xf(s.getValue())},p=function(F){F.innerHTML=Xf(s.getValue())}):b==="lines"?(h=function(F){F.innerHTML=s.lineCount()},p=function(F){F.innerHTML=s.lineCount()}):b==="cursor"?(h=function(F){F.innerHTML="1:1"},c=function(F){var _=s.getCursor(),L=_.line+1,T=_.ch+1;F.innerHTML=L+":"+T}):b==="autosave"?h=function(F){l.autosave!=null&&l.autosave.enabled===!0&&F.setAttribute("id","autosaved")}:b==="upload-image"&&(h=function(F){F.innerHTML=l.imageTexts.sbInit}),a.push({className:b,defaultValue:h,onUpdate:p,onActivity:c})}var y=document.createElement("div");for(y.className="editor-statusbar",f=0;f<a.length;f++){var x=a[f],C=document.createElement("span");C.className=x.className,typeof x.defaultValue=="function"&&x.defaultValue(C),typeof x.onUpdate=="function"&&this.codemirror.on("update",function(F,_){return function(){_.onUpdate(F)}}(C,x)),typeof x.onActivity=="function"&&this.codemirror.on("cursorActivity",function(F,_){return function(){_.onActivity(F)}}(C,x)),y.appendChild(C)}var E=this.codemirror.getWrapperElement();return E.parentNode.insertBefore(y,E.nextSibling),y}};V.prototype.value=function(o){var l=this.codemirror;if(o===void 0)return l.getValue();if(l.getDoc().setValue(o),this.isPreviewActive()){var s=l.getWrapperElement(),a=s.lastChild,f=this.options.previewRender(o,a);f!==null&&(a.innerHTML=f)}return this};V.toggleBold=fo;V.toggleItalic=co;V.toggleStrikethrough=ho;V.toggleBlockquote=go;V.toggleHeadingSmaller=fi;V.toggleHeadingBigger=vo;V.toggleHeading1=mo;V.toggleHeading2=bo;V.toggleHeading3=yo;V.toggleHeading4=pl;V.toggleHeading5=gl;V.toggleHeading6=vl;V.toggleCodeBlock=po;V.toggleUnorderedList=xo;V.toggleOrderedList=Do;V.toggleCheckList=wo;V.cleanBlock=Co;V.drawLink=ko;V.drawImage=So;V.drawUploadedImage=ml;V.drawTable=Eo;V.drawHorizontalRule=Ao;V.undo=Fo;V.redo=To;V.togglePreview=Lo;V.toggleSideBySide=wn;V.toggleFullScreen=jr;V.prototype.toggleBold=function(){fo(this)};V.prototype.toggleItalic=function(){co(this)};V.prototype.toggleStrikethrough=function(){ho(this)};V.prototype.toggleBlockquote=function(){go(this)};V.prototype.toggleHeadingSmaller=function(){fi(this)};V.prototype.toggleHeadingBigger=function(){vo(this)};V.prototype.toggleHeading1=function(){mo(this)};V.prototype.toggleHeading2=function(){bo(this)};V.prototype.toggleHeading3=function(){yo(this)};V.prototype.toggleHeading4=function(){pl(this)};V.prototype.toggleHeading5=function(){gl(this)};V.prototype.toggleHeading6=function(){vl(this)};V.prototype.toggleCodeBlock=function(){po(this)};V.prototype.toggleUnorderedList=function(){xo(this)};V.prototype.toggleOrderedList=function(){Do(this)};V.prototype.toggleCheckList=function(){wo(this)};V.prototype.cleanBlock=function(){Co(this)};V.prototype.drawLink=function(){ko(this)};V.prototype.drawImage=function(){So(this)};V.prototype.drawUploadedImage=function(){ml(this)};V.prototype.drawTable=function(){Eo(this)};V.prototype.drawHorizontalRule=function(){Ao(this)};V.prototype.undo=function(){Fo(this)};V.prototype.redo=function(){To(this)};V.prototype.togglePreview=function(){Lo(this)};V.prototype.toggleSideBySide=function(){wn(this)};V.prototype.toggleFullScreen=function(){jr(this)};V.prototype.isPreviewActive=function(){var o=this.codemirror,l=o.getWrapperElement(),s=l.lastChild;return s.classList.contains("editor-preview-active")};V.prototype.isSideBySideActive=function(){var o=this.codemirror,l=o.getWrapperElement(),s=l.nextSibling;return s.classList.contains("editor-preview-active-side")};V.prototype.isFullscreenActive=function(){var o=this.codemirror;return o.getOption("fullScreen")};V.prototype.getState=function(){var o=this.codemirror;return Sr(o)};V.prototype.toTextArea=function(){var o=this.codemirror,l=o.getWrapperElement(),s=l.parentNode;s&&(this.gui.toolbar&&s.removeChild(this.gui.toolbar),this.gui.statusbar&&s.removeChild(this.gui.statusbar),this.gui.sideBySide&&s.removeChild(this.gui.sideBySide)),s.parentNode.insertBefore(l,s),s.remove(),o.toTextArea(),this.autosaveTimeoutId&&(clearTimeout(this.autosaveTimeoutId),this.autosaveTimeoutId=void 0,this.clearAutosavedValue())};ec.exports=V});var Zr=Gh(tc());function Pp(o,l,s){return(l=Wp(l))in o?Object.defineProperty(o,l,{value:s,enumerable:!0,configurable:!0,writable:!0}):o[l]=s,o}function fr(){return fr=Object.assign?Object.assign.bind():function(o){for(var l=1;l<arguments.length;l++){var s=arguments[l];for(var a in s)({}).hasOwnProperty.call(s,a)&&(o[a]=s[a])}return o},fr.apply(null,arguments)}function rc(o,l){var s=Object.keys(o);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(o);l&&(a=a.filter(function(f){return Object.getOwnPropertyDescriptor(o,f).enumerable})),s.push.apply(s,a)}return s}function er(o){for(var l=1;l<arguments.length;l++){var s=arguments[l]!=null?arguments[l]:{};l%2?rc(Object(s),!0).forEach(function(a){Pp(o,a,s[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(s)):rc(Object(s)).forEach(function(a){Object.defineProperty(o,a,Object.getOwnPropertyDescriptor(s,a))})}return o}function zp(o,l){if(o==null)return{};var s,a,f=Hp(o,l);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(o);for(a=0;a<p.length;a++)s=p[a],l.indexOf(s)===-1&&{}.propertyIsEnumerable.call(o,s)&&(f[s]=o[s])}return f}function Hp(o,l){if(o==null)return{};var s={};for(var a in o)if({}.hasOwnProperty.call(o,a)){if(l.indexOf(a)!==-1)continue;s[a]=o[a]}return s}function Rp(o,l){if(typeof o!="object"||!o)return o;var s=o[Symbol.toPrimitive];if(s!==void 0){var a=s.call(o,l||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(o)}function Wp(o){var l=Rp(o,"string");return typeof l=="symbol"?l:l+""}function Fl(o){"@babel/helpers - typeof";return Fl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},Fl(o)}var qp="1.15.7";function ur(o){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(o)}var cr=ur(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),yi=ur(/Edge/i),nc=ur(/firefox/i),pi=ur(/safari/i)&&!ur(/chrome/i)&&!ur(/android/i),Bl=ur(/iP(ad|od|hone)/i),cc=ur(/chrome/i)&&ur(/android/i),dc={capture:!1,passive:!1};function Se(o,l,s){o.addEventListener(l,s,!cr&&dc)}function ke(o,l,s){o.removeEventListener(l,s,!cr&&dc)}function Ro(o,l){if(l){if(l[0]===">"&&(l=l.substring(1)),o)try{if(o.matches)return o.matches(l);if(o.msMatchesSelector)return o.msMatchesSelector(l);if(o.webkitMatchesSelector)return o.webkitMatchesSelector(l)}catch{return!1}return!1}}function hc(o){return o.host&&o!==document&&o.host.nodeType&&o.host!==o?o.host:o.parentNode}function Gt(o,l,s,a){if(o){s=s||document;do{if(l!=null&&(l[0]===">"?o.parentNode===s&&Ro(o,l):Ro(o,l))||a&&o===s)return o;if(o===s)break}while(o=hc(o))}return null}var ic=/\s+/g;function Bt(o,l,s){if(o&&l)if(o.classList)o.classList[s?"add":"remove"](l);else{var a=(" "+o.className+" ").replace(ic," ").replace(" "+l+" "," ");o.className=(a+(s?" "+l:"")).replace(ic," ")}}function pe(o,l,s){var a=o&&o.style;if(a){if(s===void 0)return document.defaultView&&document.defaultView.getComputedStyle?s=document.defaultView.getComputedStyle(o,""):o.currentStyle&&(s=o.currentStyle),l===void 0?s:s[l];!(l in a)&&l.indexOf("webkit")===-1&&(l="-webkit-"+l),a[l]=s+(typeof s=="string"?"":"px")}}function An(o,l){var s="";if(typeof o=="string")s=o;else do{var a=pe(o,"transform");a&&a!=="none"&&(s=a+" "+s)}while(!l&&(o=o.parentNode));var f=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return f&&new f(s)}function pc(o,l,s){if(o){var a=o.getElementsByTagName(l),f=0,p=a.length;if(s)for(;f<p;f++)s(a[f],f);return a}return[]}function Vt(){var o=document.scrollingElement;return o||document.documentElement}function Je(o,l,s,a,f){if(!(!o.getBoundingClientRect&&o!==window)){var p,c,h,b,y,x,C;if(o!==window&&o.parentNode&&o!==Vt()?(p=o.getBoundingClientRect(),c=p.top,h=p.left,b=p.bottom,y=p.right,x=p.height,C=p.width):(c=0,h=0,b=window.innerHeight,y=window.innerWidth,x=window.innerHeight,C=window.innerWidth),(l||s)&&o!==window&&(f=f||o.parentNode,!cr))do if(f&&f.getBoundingClientRect&&(pe(f,"transform")!=="none"||s&&pe(f,"position")!=="static")){var E=f.getBoundingClientRect();c-=E.top+parseInt(pe(f,"border-top-width")),h-=E.left+parseInt(pe(f,"border-left-width")),b=c+p.height,y=h+p.width;break}while(f=f.parentNode);if(a&&o!==window){var F=An(f||o),_=F&&F.a,L=F&&F.d;F&&(c/=L,h/=_,C/=_,x/=L,b=c+x,y=h+C)}return{top:c,left:h,bottom:b,right:y,width:C,height:x}}}function oc(o,l,s){for(var a=Tr(o,!0),f=Je(o)[l];a;){var p=Je(a)[s],c=void 0;if(s==="top"||s==="left"?c=f>=p:c=f<=p,!c)return a;if(a===Vt())break;a=Tr(a,!1)}return!1}function Fn(o,l,s,a){for(var f=0,p=0,c=o.children;p<c.length;){if(c[p].style.display!=="none"&&c[p]!==ge.ghost&&(a||c[p]!==ge.dragged)&&Gt(c[p],s.draggable,o,!1)){if(f===l)return c[p];f++}p++}return null}function Nl(o,l){for(var s=o.lastElementChild;s&&(s===ge.ghost||pe(s,"display")==="none"||l&&!Ro(s,l));)s=s.previousElementSibling;return s||null}function Pt(o,l){var s=0;if(!o||!o.parentNode)return-1;for(;o=o.previousElementSibling;)o.nodeName.toUpperCase()!=="TEMPLATE"&&o!==ge.clone&&(!l||Ro(o,l))&&s++;return s}function ac(o){var l=0,s=0,a=Vt();if(o)do{var f=An(o),p=f.a,c=f.d;l+=o.scrollLeft*p,s+=o.scrollTop*c}while(o!==a&&(o=o.parentNode));return[l,s]}function Up(o,l){for(var s in o)if(o.hasOwnProperty(s)){for(var a in l)if(l.hasOwnProperty(a)&&l[a]===o[s][a])return Number(s)}return-1}function Tr(o,l){if(!o||!o.getBoundingClientRect)return Vt();var s=o,a=!1;do if(s.clientWidth<s.scrollWidth||s.clientHeight<s.scrollHeight){var f=pe(s);if(s.clientWidth<s.scrollWidth&&(f.overflowX=="auto"||f.overflowX=="scroll")||s.clientHeight<s.scrollHeight&&(f.overflowY=="auto"||f.overflowY=="scroll")){if(!s.getBoundingClientRect||s===document.body)return Vt();if(a||l)return s;a=!0}}while(s=s.parentNode);return Vt()}function jp(o,l){if(o&&l)for(var s in l)l.hasOwnProperty(s)&&(o[s]=l[s]);return o}function yl(o,l){return Math.round(o.top)===Math.round(l.top)&&Math.round(o.left)===Math.round(l.left)&&Math.round(o.height)===Math.round(l.height)&&Math.round(o.width)===Math.round(l.width)}var gi;function gc(o,l){return function(){if(!gi){var s=arguments,a=this;s.length===1?o.call(a,s[0]):o.apply(a,s),gi=setTimeout(function(){gi=void 0},l)}}}function Gp(){clearTimeout(gi),gi=void 0}function vc(o,l,s){o.scrollLeft+=l,o.scrollTop+=s}function mc(o){var l=window.Polymer,s=window.jQuery||window.Zepto;return l&&l.dom?l.dom(o).cloneNode(!0):s?s(o).clone(!0)[0]:o.cloneNode(!0)}function bc(o,l,s){var a={};return Array.from(o.children).forEach(function(f){var p,c,h,b;if(!(!Gt(f,l.draggable,o,!1)||f.animated||f===s)){var y=Je(f);a.left=Math.min((p=a.left)!==null&&p!==void 0?p:1/0,y.left),a.top=Math.min((c=a.top)!==null&&c!==void 0?c:1/0,y.top),a.right=Math.max((h=a.right)!==null&&h!==void 0?h:-1/0,y.right),a.bottom=Math.max((b=a.bottom)!==null&&b!==void 0?b:-1/0,y.bottom)}}),a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}var Ft="Sortable"+new Date().getTime();function Xp(){var o=[],l;return{captureAnimationState:function(){if(o=[],!!this.options.animation){var a=[].slice.call(this.el.children);a.forEach(function(f){if(!(pe(f,"display")==="none"||f===ge.ghost)){o.push({target:f,rect:Je(f)});var p=er({},o[o.length-1].rect);if(f.thisAnimationDuration){var c=An(f,!0);c&&(p.top-=c.f,p.left-=c.e)}f.fromRect=p}})}},addAnimationState:function(a){o.push(a)},removeAnimationState:function(a){o.splice(Up(o,{target:a}),1)},animateAll:function(a){var f=this;if(!this.options.animation){clearTimeout(l),typeof a=="function"&&a();return}var p=!1,c=0;o.forEach(function(h){var b=0,y=h.target,x=y.fromRect,C=Je(y),E=y.prevFromRect,F=y.prevToRect,_=h.rect,L=An(y,!0);L&&(C.top-=L.f,C.left-=L.e),y.toRect=C,y.thisAnimationDuration&&yl(E,C)&&!yl(x,C)&&(_.top-C.top)/(_.left-C.left)===(x.top-C.top)/(x.left-C.left)&&(b=Yp(_,E,F,f.options)),yl(C,x)||(y.prevFromRect=x,y.prevToRect=C,b||(b=f.options.animation),f.animate(y,_,C,b)),b&&(p=!0,c=Math.max(c,b),clearTimeout(y.animationResetTimer),y.animationResetTimer=setTimeout(function(){y.animationTime=0,y.prevFromRect=null,y.fromRect=null,y.prevToRect=null,y.thisAnimationDuration=null},b),y.thisAnimationDuration=b)}),clearTimeout(l),p?l=setTimeout(function(){typeof a=="function"&&a()},c):typeof a=="function"&&a(),o=[]},animate:function(a,f,p,c){if(c){pe(a,"transition",""),pe(a,"transform","");var h=An(this.el),b=h&&h.a,y=h&&h.d,x=(f.left-p.left)/(b||1),C=(f.top-p.top)/(y||1);a.animatingX=!!x,a.animatingY=!!C,pe(a,"transform","translate3d("+x+"px,"+C+"px,0)"),this.forRepaintDummy=Kp(a),pe(a,"transition","transform "+c+"ms"+(this.options.easing?" "+this.options.easing:"")),pe(a,"transform","translate3d(0,0,0)"),typeof a.animated=="number"&&clearTimeout(a.animated),a.animated=setTimeout(function(){pe(a,"transition",""),pe(a,"transform",""),a.animated=!1,a.animatingX=!1,a.animatingY=!1},c)}}}}function Kp(o){return o.offsetWidth}function Yp(o,l,s,a){return Math.sqrt(Math.pow(l.top-o.top,2)+Math.pow(l.left-o.left,2))/Math.sqrt(Math.pow(l.top-s.top,2)+Math.pow(l.left-s.left,2))*a.animation}var Cn=[],xl={initializeByDefault:!0},xi={mount:function(l){for(var s in xl)xl.hasOwnProperty(s)&&!(s in l)&&(l[s]=xl[s]);Cn.forEach(function(a){if(a.pluginName===l.pluginName)throw"Sortable: Cannot mount plugin ".concat(l.pluginName," more than once")}),Cn.push(l)},pluginEvent:function(l,s,a){var f=this;this.eventCanceled=!1,a.cancel=function(){f.eventCanceled=!0};var p=l+"Global";Cn.forEach(function(c){s[c.pluginName]&&(s[c.pluginName][p]&&s[c.pluginName][p](er({sortable:s},a)),s.options[c.pluginName]&&s[c.pluginName][l]&&s[c.pluginName][l](er({sortable:s},a)))})},initializePlugins:function(l,s,a,f){Cn.forEach(function(h){var b=h.pluginName;if(!(!l.options[b]&&!h.initializeByDefault)){var y=new h(l,s,l.options);y.sortable=l,y.options=l.options,l[b]=y,fr(a,y.defaults)}});for(var p in l.options)if(l.options.hasOwnProperty(p)){var c=this.modifyOption(l,p,l.options[p]);typeof c<"u"&&(l.options[p]=c)}},getEventProperties:function(l,s){var a={};return Cn.forEach(function(f){typeof f.eventProperties=="function"&&fr(a,f.eventProperties.call(s[f.pluginName],l))}),a},modifyOption:function(l,s,a){var f;return Cn.forEach(function(p){l[p.pluginName]&&p.optionListeners&&typeof p.optionListeners[s]=="function"&&(f=p.optionListeners[s].call(l[p.pluginName],a))}),f}};function Zp(o){var l=o.sortable,s=o.rootEl,a=o.name,f=o.targetEl,p=o.cloneEl,c=o.toEl,h=o.fromEl,b=o.oldIndex,y=o.newIndex,x=o.oldDraggableIndex,C=o.newDraggableIndex,E=o.originalEvent,F=o.putSortable,_=o.extraEventProperties;if(l=l||s&&s[Ft],!!l){var L,T=l.options,O="on"+a.charAt(0).toUpperCase()+a.substr(1);window.CustomEvent&&!cr&&!yi?L=new CustomEvent(a,{bubbles:!0,cancelable:!0}):(L=document.createEvent("Event"),L.initEvent(a,!0,!0)),L.to=c||s,L.from=h||s,L.item=f||s,L.clone=p,L.oldIndex=b,L.newIndex=y,L.oldDraggableIndex=x,L.newDraggableIndex=C,L.originalEvent=E,L.pullMode=F?F.lastPutMode:void 0;var N=er(er({},_),xi.getEventProperties(a,l));for(var P in N)L[P]=N[P];s&&s.dispatchEvent(L),T[O]&&T[O].call(l,L)}}var Qp=["evt"],At=function(l,s){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},f=a.evt,p=zp(a,Qp);xi.pluginEvent.bind(ge)(l,s,er({dragEl:J,parentEl:qe,ghostEl:ye,rootEl:Pe,nextEl:Yr,lastDownEl:Io,cloneEl:Re,cloneHidden:Fr,dragStarted:ci,putSortable:ft,activeSortable:ge.active,originalEvent:f,oldIndex:En,oldDraggableIndex:vi,newIndex:Nt,newDraggableIndex:Ar,hideGhostForTarget:wc,unhideGhostForTarget:Cc,cloneNowHidden:function(){Fr=!0},cloneNowShown:function(){Fr=!1},dispatchSortableEvent:function(h){Ct({sortable:s,name:h,originalEvent:f})}},p))};function Ct(o){Zp(er({putSortable:ft,cloneEl:Re,targetEl:J,rootEl:Pe,oldIndex:En,oldDraggableIndex:vi,newIndex:Nt,newDraggableIndex:Ar},o))}var J,qe,ye,Pe,Yr,Io,Re,Fr,En,Nt,vi,Ar,_o,ft,Sn=!1,Wo=!1,qo=[],Xr,jt,Dl,wl,lc,sc,ci,kn,mi,bi=!1,Bo=!1,Po,gt,Cl=[],Tl=!1,Uo=[],Go=typeof document<"u",No=Bl,uc=yi||cr?"cssFloat":"float",Jp=Go&&!cc&&!Bl&&"draggable"in document.createElement("div"),yc=function(){if(Go){if(cr)return!1;var o=document.createElement("x");return o.style.cssText="pointer-events:auto",o.style.pointerEvents==="auto"}}(),xc=function(l,s){var a=pe(l),f=parseInt(a.width)-parseInt(a.paddingLeft)-parseInt(a.paddingRight)-parseInt(a.borderLeftWidth)-parseInt(a.borderRightWidth),p=Fn(l,0,s),c=Fn(l,1,s),h=p&&pe(p),b=c&&pe(c),y=h&&parseInt(h.marginLeft)+parseInt(h.marginRight)+Je(p).width,x=b&&parseInt(b.marginLeft)+parseInt(b.marginRight)+Je(c).width;if(a.display==="flex")return a.flexDirection==="column"||a.flexDirection==="column-reverse"?"vertical":"horizontal";if(a.display==="grid")return a.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(p&&h.float&&h.float!=="none"){var C=h.float==="left"?"left":"right";return c&&(b.clear==="both"||b.clear===C)?"vertical":"horizontal"}return p&&(h.display==="block"||h.display==="flex"||h.display==="table"||h.display==="grid"||y>=f&&a[uc]==="none"||c&&a[uc]==="none"&&y+x>f)?"vertical":"horizontal"},$p=function(l,s,a){var f=a?l.left:l.top,p=a?l.right:l.bottom,c=a?l.width:l.height,h=a?s.left:s.top,b=a?s.right:s.bottom,y=a?s.width:s.height;return f===h||p===b||f+c/2===h+y/2},Vp=function(l,s){var a;return qo.some(function(f){var p=f[Ft].options.emptyInsertThreshold;if(!(!p||Nl(f))){var c=Je(f),h=l>=c.left-p&&l<=c.right+p,b=s>=c.top-p&&s<=c.bottom+p;if(h&&b)return a=f}}),a},Dc=function(l){function s(p,c){return function(h,b,y,x){var C=h.options.group.name&&b.options.group.name&&h.options.group.name===b.options.group.name;if(p==null&&(c||C))return!0;if(p==null||p===!1)return!1;if(c&&p==="clone")return p;if(typeof p=="function")return s(p(h,b,y,x),c)(h,b,y,x);var E=(c?h:b).options.group.name;return p===!0||typeof p=="string"&&p===E||p.join&&p.indexOf(E)>-1}}var a={},f=l.group;(!f||Fl(f)!="object")&&(f={name:f}),a.name=f.name,a.checkPull=s(f.pull,!0),a.checkPut=s(f.put),a.revertClone=f.revertClone,l.group=a},wc=function(){!yc&&ye&&pe(ye,"display","none")},Cc=function(){!yc&&ye&&pe(ye,"display","")};Go&&!cc&&document.addEventListener("click",function(o){if(Wo)return o.preventDefault(),o.stopPropagation&&o.stopPropagation(),o.stopImmediatePropagation&&o.stopImmediatePropagation(),Wo=!1,!1},!0);var Kr=function(l){if(J){l=l.touches?l.touches[0]:l;var s=Vp(l.clientX,l.clientY);if(s){var a={};for(var f in l)l.hasOwnProperty(f)&&(a[f]=l[f]);a.target=a.rootEl=s,a.preventDefault=void 0,a.stopPropagation=void 0,s[Ft]._onDragOver(a)}}},eg=function(l){J&&J.parentNode[Ft]._isOutsideThisEl(l.target)};function ge(o,l){if(!(o&&o.nodeType&&o.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(o));this.el=o,this.options=l=fr({},l),o[Ft]=this;var s={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(o.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return xc(o,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(c,h){c.setData("Text",h.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:ge.supportPointer!==!1&&"PointerEvent"in window&&(!pi||Bl),emptyInsertThreshold:5};xi.initializePlugins(this,o,s);for(var a in s)!(a in l)&&(l[a]=s[a]);Dc(l);for(var f in this)f.charAt(0)==="_"&&typeof this[f]=="function"&&(this[f]=this[f].bind(this));this.nativeDraggable=l.forceFallback?!1:Jp,this.nativeDraggable&&(this.options.touchStartThreshold=1),l.supportPointer?Se(o,"pointerdown",this._onTapStart):(Se(o,"mousedown",this._onTapStart),Se(o,"touchstart",this._onTapStart)),this.nativeDraggable&&(Se(o,"dragover",this),Se(o,"dragenter",this)),qo.push(this.el),l.store&&l.store.get&&this.sort(l.store.get(this)||[]),fr(this,Xp())}ge.prototype={constructor:ge,_isOutsideThisEl:function(l){!this.el.contains(l)&&l!==this.el&&(kn=null)},_getDirection:function(l,s){return typeof this.options.direction=="function"?this.options.direction.call(this,l,s,J):this.options.direction},_onTapStart:function(l){if(l.cancelable){var s=this,a=this.el,f=this.options,p=f.preventOnFilter,c=l.type,h=l.touches&&l.touches[0]||l.pointerType&&l.pointerType==="touch"&&l,b=(h||l).target,y=l.target.shadowRoot&&(l.path&&l.path[0]||l.composedPath&&l.composedPath()[0])||b,x=f.filter;if(sg(a),!J&&!(/mousedown|pointerdown/.test(c)&&l.button!==0||f.disabled)&&!y.isContentEditable&&!(!this.nativeDraggable&&pi&&b&&b.tagName.toUpperCase()==="SELECT")&&(b=Gt(b,f.draggable,a,!1),!(b&&b.animated)&&Io!==b)){if(En=Pt(b),vi=Pt(b,f.draggable),typeof x=="function"){if(x.call(this,l,b,this)){Ct({sortable:s,rootEl:y,name:"filter",targetEl:b,toEl:a,fromEl:a}),At("filter",s,{evt:l}),p&&l.preventDefault();return}}else if(x&&(x=x.split(",").some(function(C){if(C=Gt(y,C.trim(),a,!1),C)return Ct({sortable:s,rootEl:C,name:"filter",targetEl:b,fromEl:a,toEl:a}),At("filter",s,{evt:l}),!0}),x)){p&&l.preventDefault();return}f.handle&&!Gt(y,f.handle,a,!1)||this._prepareDragStart(l,h,b)}}},_prepareDragStart:function(l,s,a){var f=this,p=f.el,c=f.options,h=p.ownerDocument,b;if(a&&!J&&a.parentNode===p){var y=Je(a);if(Pe=p,J=a,qe=J.parentNode,Yr=J.nextSibling,Io=a,_o=c.group,ge.dragged=J,Xr={target:J,clientX:(s||l).clientX,clientY:(s||l).clientY},lc=Xr.clientX-y.left,sc=Xr.clientY-y.top,this._lastX=(s||l).clientX,this._lastY=(s||l).clientY,J.style["will-change"]="all",b=function(){if(At("delayEnded",f,{evt:l}),ge.eventCanceled){f._onDrop();return}f._disableDelayedDragEvents(),!nc&&f.nativeDraggable&&(J.draggable=!0),f._triggerDragStart(l,s),Ct({sortable:f,name:"choose",originalEvent:l}),Bt(J,c.chosenClass,!0)},c.ignore.split(",").forEach(function(x){pc(J,x.trim(),kl)}),Se(h,"dragover",Kr),Se(h,"mousemove",Kr),Se(h,"touchmove",Kr),c.supportPointer?(Se(h,"pointerup",f._onDrop),!this.nativeDraggable&&Se(h,"pointercancel",f._onDrop)):(Se(h,"mouseup",f._onDrop),Se(h,"touchend",f._onDrop),Se(h,"touchcancel",f._onDrop)),nc&&this.nativeDraggable&&(this.options.touchStartThreshold=4,J.draggable=!0),At("delayStart",this,{evt:l}),c.delay&&(!c.delayOnTouchOnly||s)&&(!this.nativeDraggable||!(yi||cr))){if(ge.eventCanceled){this._onDrop();return}c.supportPointer?(Se(h,"pointerup",f._disableDelayedDrag),Se(h,"pointercancel",f._disableDelayedDrag)):(Se(h,"mouseup",f._disableDelayedDrag),Se(h,"touchend",f._disableDelayedDrag),Se(h,"touchcancel",f._disableDelayedDrag)),Se(h,"mousemove",f._delayedDragTouchMoveHandler),Se(h,"touchmove",f._delayedDragTouchMoveHandler),c.supportPointer&&Se(h,"pointermove",f._delayedDragTouchMoveHandler),f._dragStartTimer=setTimeout(b,c.delay)}else b()}},_delayedDragTouchMoveHandler:function(l){var s=l.touches?l.touches[0]:l;Math.max(Math.abs(s.clientX-this._lastX),Math.abs(s.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){J&&kl(J),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var l=this.el.ownerDocument;ke(l,"mouseup",this._disableDelayedDrag),ke(l,"touchend",this._disableDelayedDrag),ke(l,"touchcancel",this._disableDelayedDrag),ke(l,"pointerup",this._disableDelayedDrag),ke(l,"pointercancel",this._disableDelayedDrag),ke(l,"mousemove",this._delayedDragTouchMoveHandler),ke(l,"touchmove",this._delayedDragTouchMoveHandler),ke(l,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(l,s){s=s||l.pointerType=="touch"&&l,!this.nativeDraggable||s?this.options.supportPointer?Se(document,"pointermove",this._onTouchMove):s?Se(document,"touchmove",this._onTouchMove):Se(document,"mousemove",this._onTouchMove):(Se(J,"dragend",this),Se(Pe,"dragstart",this._onDragStart));try{document.selection?zo(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(l,s){if(Sn=!1,Pe&&J){At("dragStarted",this,{evt:s}),this.nativeDraggable&&Se(document,"dragover",eg);var a=this.options;!l&&Bt(J,a.dragClass,!1),Bt(J,a.ghostClass,!0),ge.active=this,l&&this._appendGhost(),Ct({sortable:this,name:"start",originalEvent:s})}else this._nulling()},_emulateDragOver:function(){if(jt){this._lastX=jt.clientX,this._lastY=jt.clientY,wc();for(var l=document.elementFromPoint(jt.clientX,jt.clientY),s=l;l&&l.shadowRoot&&(l=l.shadowRoot.elementFromPoint(jt.clientX,jt.clientY),l!==s);)s=l;if(J.parentNode[Ft]._isOutsideThisEl(l),s)do{if(s[Ft]){var a=void 0;if(a=s[Ft]._onDragOver({clientX:jt.clientX,clientY:jt.clientY,target:l,rootEl:s}),a&&!this.options.dragoverBubble)break}l=s}while(s=hc(s));Cc()}},_onTouchMove:function(l){if(Xr){var s=this.options,a=s.fallbackTolerance,f=s.fallbackOffset,p=l.touches?l.touches[0]:l,c=ye&&An(ye,!0),h=ye&&c&&c.a,b=ye&&c&&c.d,y=No&&gt&&ac(gt),x=(p.clientX-Xr.clientX+f.x)/(h||1)+(y?y[0]-Cl[0]:0)/(h||1),C=(p.clientY-Xr.clientY+f.y)/(b||1)+(y?y[1]-Cl[1]:0)/(b||1);if(!ge.active&&!Sn){if(a&&Math.max(Math.abs(p.clientX-this._lastX),Math.abs(p.clientY-this._lastY))<a)return;this._onDragStart(l,!0)}if(ye){c?(c.e+=x-(Dl||0),c.f+=C-(wl||0)):c={a:1,b:0,c:0,d:1,e:x,f:C};var E="matrix(".concat(c.a,",").concat(c.b,",").concat(c.c,",").concat(c.d,",").concat(c.e,",").concat(c.f,")");pe(ye,"webkitTransform",E),pe(ye,"mozTransform",E),pe(ye,"msTransform",E),pe(ye,"transform",E),Dl=x,wl=C,jt=p}l.cancelable&&l.preventDefault()}},_appendGhost:function(){if(!ye){var l=this.options.fallbackOnBody?document.body:Pe,s=Je(J,!0,No,!0,l),a=this.options;if(No){for(gt=l;pe(gt,"position")==="static"&&pe(gt,"transform")==="none"&&gt!==document;)gt=gt.parentNode;gt!==document.body&&gt!==document.documentElement?(gt===document&&(gt=Vt()),s.top+=gt.scrollTop,s.left+=gt.scrollLeft):gt=Vt(),Cl=ac(gt)}ye=J.cloneNode(!0),Bt(ye,a.ghostClass,!1),Bt(ye,a.fallbackClass,!0),Bt(ye,a.dragClass,!0),pe(ye,"transition",""),pe(ye,"transform",""),pe(ye,"box-sizing","border-box"),pe(ye,"margin",0),pe(ye,"top",s.top),pe(ye,"left",s.left),pe(ye,"width",s.width),pe(ye,"height",s.height),pe(ye,"opacity","0.8"),pe(ye,"position",No?"absolute":"fixed"),pe(ye,"zIndex","100000"),pe(ye,"pointerEvents","none"),ge.ghost=ye,l.appendChild(ye),pe(ye,"transform-origin",lc/parseInt(ye.style.width)*100+"% "+sc/parseInt(ye.style.height)*100+"%")}},_onDragStart:function(l,s){var a=this,f=l.dataTransfer,p=a.options;if(At("dragStart",this,{evt:l}),ge.eventCanceled){this._onDrop();return}At("setupClone",this),ge.eventCanceled||(Re=mc(J),Re.removeAttribute("id"),Re.draggable=!1,Re.style["will-change"]="",this._hideClone(),Bt(Re,this.options.chosenClass,!1),ge.clone=Re),a.cloneId=zo(function(){At("clone",a),!ge.eventCanceled&&(a.options.removeCloneOnHide||Pe.insertBefore(Re,J),a._hideClone(),Ct({sortable:a,name:"clone"}))}),!s&&Bt(J,p.dragClass,!0),s?(Wo=!0,a._loopId=setInterval(a._emulateDragOver,50)):(ke(document,"mouseup",a._onDrop),ke(document,"touchend",a._onDrop),ke(document,"touchcancel",a._onDrop),f&&(f.effectAllowed="move",p.setData&&p.setData.call(a,f,J)),Se(document,"drop",a),pe(J,"transform","translateZ(0)")),Sn=!0,a._dragStartId=zo(a._dragStarted.bind(a,s,l)),Se(document,"selectstart",a),ci=!0,window.getSelection().removeAllRanges(),pi&&pe(document.body,"user-select","none")},_onDragOver:function(l){var s=this.el,a=l.target,f,p,c,h=this.options,b=h.group,y=ge.active,x=_o===b,C=h.sort,E=ft||y,F,_=this,L=!1;if(Tl)return;function T(De,ot){At(De,_,er({evt:l,isOwner:x,axis:F?"vertical":"horizontal",revert:c,dragRect:f,targetRect:p,canSort:C,fromSortable:E,target:a,completed:N,onMove:function(D,ee){return Oo(Pe,s,J,f,D,Je(D),l,ee)},changed:P},ot))}function O(){T("dragOverAnimationCapture"),_.captureAnimationState(),_!==E&&E.captureAnimationState()}function N(De){return T("dragOverCompleted",{insertion:De}),De&&(x?y._hideClone():y._showClone(_),_!==E&&(Bt(J,ft?ft.options.ghostClass:y.options.ghostClass,!1),Bt(J,h.ghostClass,!0)),ft!==_&&_!==ge.active?ft=_:_===ge.active&&ft&&(ft=null),E===_&&(_._ignoreWhileAnimating=a),_.animateAll(function(){T("dragOverAnimationComplete"),_._ignoreWhileAnimating=null}),_!==E&&(E.animateAll(),E._ignoreWhileAnimating=null)),(a===J&&!J.animated||a===s&&!a.animated)&&(kn=null),!h.dragoverBubble&&!l.rootEl&&a!==document&&(J.parentNode[Ft]._isOutsideThisEl(l.target),!De&&Kr(l)),!h.dragoverBubble&&l.stopPropagation&&l.stopPropagation(),L=!0}function P(){Nt=Pt(J),Ar=Pt(J,h.draggable),Ct({sortable:_,name:"change",toEl:s,newIndex:Nt,newDraggableIndex:Ar,originalEvent:l})}if(l.preventDefault!==void 0&&l.cancelable&&l.preventDefault(),a=Gt(a,h.draggable,s,!0),T("dragOver"),ge.eventCanceled)return L;if(J.contains(l.target)||a.animated&&a.animatingX&&a.animatingY||_._ignoreWhileAnimating===a)return N(!1);if(Wo=!1,y&&!h.disabled&&(x?C||(c=qe!==Pe):ft===this||(this.lastPutMode=_o.checkPull(this,y,J,l))&&b.checkPut(this,y,J,l))){if(F=this._getDirection(l,a)==="vertical",f=Je(J),T("dragOverValid"),ge.eventCanceled)return L;if(c)return qe=Pe,O(),this._hideClone(),T("revert"),ge.eventCanceled||(Yr?Pe.insertBefore(J,Yr):Pe.appendChild(J)),N(!0);var I=Nl(s,h.draggable);if(!I||ig(l,F,this)&&!I.animated){if(I===J)return N(!1);if(I&&s===l.target&&(a=I),a&&(p=Je(a)),Oo(Pe,s,J,f,a,p,l,!!a)!==!1)return O(),I&&I.nextSibling?s.insertBefore(J,I.nextSibling):s.appendChild(J),qe=s,P(),N(!0)}else if(I&&ng(l,F,this)){var W=Fn(s,0,h,!0);if(W===J)return N(!1);if(a=W,p=Je(a),Oo(Pe,s,J,f,a,p,l,!1)!==!1)return O(),s.insertBefore(J,W),qe=s,P(),N(!0)}else if(a.parentNode===s){p=Je(a);var j=0,X,be=J.parentNode!==s,U=!$p(J.animated&&J.toRect||f,a.animated&&a.toRect||p,F),ae=F?"top":"left",ne=oc(a,"top","top")||oc(J,"top","top"),se=ne?ne.scrollTop:void 0;kn!==a&&(X=p[ae],bi=!1,Bo=!U&&h.invertSwap||be),j=og(l,a,p,F,U?1:h.swapThreshold,h.invertedSwapThreshold==null?h.swapThreshold:h.invertedSwapThreshold,Bo,kn===a);var S;if(j!==0){var R=Pt(J);do R-=j,S=qe.children[R];while(S&&(pe(S,"display")==="none"||S===ye))}if(j===0||S===a)return N(!1);kn=a,mi=j;var z=a.nextElementSibling,K=!1;K=j===1;var ue=Oo(Pe,s,J,f,a,p,l,K);if(ue!==!1)return(ue===1||ue===-1)&&(K=ue===1),Tl=!0,setTimeout(rg,30),O(),K&&!z?s.appendChild(J):a.parentNode.insertBefore(J,K?z:a),ne&&vc(ne,0,se-ne.scrollTop),qe=J.parentNode,X!==void 0&&!Bo&&(Po=Math.abs(X-Je(a)[ae])),P(),N(!0)}if(s.contains(J))return N(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){ke(document,"mousemove",this._onTouchMove),ke(document,"touchmove",this._onTouchMove),ke(document,"pointermove",this._onTouchMove),ke(document,"dragover",Kr),ke(document,"mousemove",Kr),ke(document,"touchmove",Kr)},_offUpEvents:function(){var l=this.el.ownerDocument;ke(l,"mouseup",this._onDrop),ke(l,"touchend",this._onDrop),ke(l,"pointerup",this._onDrop),ke(l,"pointercancel",this._onDrop),ke(l,"touchcancel",this._onDrop),ke(document,"selectstart",this)},_onDrop:function(l){var s=this.el,a=this.options;if(Nt=Pt(J),Ar=Pt(J,a.draggable),At("drop",this,{evt:l}),qe=J&&J.parentNode,Nt=Pt(J),Ar=Pt(J,a.draggable),ge.eventCanceled){this._nulling();return}Sn=!1,Bo=!1,bi=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ll(this.cloneId),Ll(this._dragStartId),this.nativeDraggable&&(ke(document,"drop",this),ke(s,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),pi&&pe(document.body,"user-select",""),pe(J,"transform",""),l&&(ci&&(l.cancelable&&l.preventDefault(),!a.dropBubble&&l.stopPropagation()),ye&&ye.parentNode&&ye.parentNode.removeChild(ye),(Pe===qe||ft&&ft.lastPutMode!=="clone")&&Re&&Re.parentNode&&Re.parentNode.removeChild(Re),J&&(this.nativeDraggable&&ke(J,"dragend",this),kl(J),J.style["will-change"]="",ci&&!Sn&&Bt(J,ft?ft.options.ghostClass:this.options.ghostClass,!1),Bt(J,this.options.chosenClass,!1),Ct({sortable:this,name:"unchoose",toEl:qe,newIndex:null,newDraggableIndex:null,originalEvent:l}),Pe!==qe?(Nt>=0&&(Ct({rootEl:qe,name:"add",toEl:qe,fromEl:Pe,originalEvent:l}),Ct({sortable:this,name:"remove",toEl:qe,originalEvent:l}),Ct({rootEl:qe,name:"sort",toEl:qe,fromEl:Pe,originalEvent:l}),Ct({sortable:this,name:"sort",toEl:qe,originalEvent:l})),ft&&ft.save()):Nt!==En&&Nt>=0&&(Ct({sortable:this,name:"update",toEl:qe,originalEvent:l}),Ct({sortable:this,name:"sort",toEl:qe,originalEvent:l})),ge.active&&((Nt==null||Nt===-1)&&(Nt=En,Ar=vi),Ct({sortable:this,name:"end",toEl:qe,originalEvent:l}),this.save()))),this._nulling()},_nulling:function(){At("nulling",this),Pe=J=qe=ye=Yr=Re=Io=Fr=Xr=jt=ci=Nt=Ar=En=vi=kn=mi=ft=_o=ge.dragged=ge.ghost=ge.clone=ge.active=null;var l=this.el;Uo.forEach(function(s){l.contains(s)&&(s.checked=!0)}),Uo.length=Dl=wl=0},handleEvent:function(l){switch(l.type){case"drop":case"dragend":this._onDrop(l);break;case"dragenter":case"dragover":J&&(this._onDragOver(l),tg(l));break;case"selectstart":l.preventDefault();break}},toArray:function(){for(var l=[],s,a=this.el.children,f=0,p=a.length,c=this.options;f<p;f++)s=a[f],Gt(s,c.draggable,this.el,!1)&&l.push(s.getAttribute(c.dataIdAttr)||lg(s));return l},sort:function(l,s){var a={},f=this.el;this.toArray().forEach(function(p,c){var h=f.children[c];Gt(h,this.options.draggable,f,!1)&&(a[p]=h)},this),s&&this.captureAnimationState(),l.forEach(function(p){a[p]&&(f.removeChild(a[p]),f.appendChild(a[p]))}),s&&this.animateAll()},save:function(){var l=this.options.store;l&&l.set&&l.set(this)},closest:function(l,s){return Gt(l,s||this.options.draggable,this.el,!1)},option:function(l,s){var a=this.options;if(s===void 0)return a[l];var f=xi.modifyOption(this,l,s);typeof f<"u"?a[l]=f:a[l]=s,l==="group"&&Dc(a)},destroy:function(){At("destroy",this);var l=this.el;l[Ft]=null,ke(l,"mousedown",this._onTapStart),ke(l,"touchstart",this._onTapStart),ke(l,"pointerdown",this._onTapStart),this.nativeDraggable&&(ke(l,"dragover",this),ke(l,"dragenter",this)),Array.prototype.forEach.call(l.querySelectorAll("[draggable]"),function(s){s.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),qo.splice(qo.indexOf(this.el),1),this.el=l=null},_hideClone:function(){if(!Fr){if(At("hideClone",this),ge.eventCanceled)return;pe(Re,"display","none"),this.options.removeCloneOnHide&&Re.parentNode&&Re.parentNode.removeChild(Re),Fr=!0}},_showClone:function(l){if(l.lastPutMode!=="clone"){this._hideClone();return}if(Fr){if(At("showClone",this),ge.eventCanceled)return;J.parentNode==Pe&&!this.options.group.revertClone?Pe.insertBefore(Re,J):Yr?Pe.insertBefore(Re,Yr):Pe.appendChild(Re),this.options.group.revertClone&&this.animate(J,Re),pe(Re,"display",""),Fr=!1}}};function tg(o){o.dataTransfer&&(o.dataTransfer.dropEffect="move"),o.cancelable&&o.preventDefault()}function Oo(o,l,s,a,f,p,c,h){var b,y=o[Ft],x=y.options.onMove,C;return window.CustomEvent&&!cr&&!yi?b=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(b=document.createEvent("Event"),b.initEvent("move",!0,!0)),b.to=l,b.from=o,b.dragged=s,b.draggedRect=a,b.related=f||l,b.relatedRect=p||Je(l),b.willInsertAfter=h,b.originalEvent=c,o.dispatchEvent(b),x&&(C=x.call(y,b,c)),C}function kl(o){o.draggable=!1}function rg(){Tl=!1}function ng(o,l,s){var a=Je(Fn(s.el,0,s.options,!0)),f=bc(s.el,s.options,ye),p=10;return l?o.clientX<f.left-p||o.clientY<a.top&&o.clientX<a.right:o.clientY<f.top-p||o.clientY<a.bottom&&o.clientX<a.left}function ig(o,l,s){var a=Je(Nl(s.el,s.options.draggable)),f=bc(s.el,s.options,ye),p=10;return l?o.clientX>f.right+p||o.clientY>a.bottom&&o.clientX>a.left:o.clientY>f.bottom+p||o.clientX>a.right&&o.clientY>a.top}function og(o,l,s,a,f,p,c,h){var b=a?o.clientY:o.clientX,y=a?s.height:s.width,x=a?s.top:s.left,C=a?s.bottom:s.right,E=!1;if(!c){if(h&&Po<y*f){if(!bi&&(mi===1?b>x+y*p/2:b<C-y*p/2)&&(bi=!0),bi)E=!0;else if(mi===1?b<x+Po:b>C-Po)return-mi}else if(b>x+y*(1-f)/2&&b<C-y*(1-f)/2)return ag(l)}return E=E||c,E&&(b<x+y*p/2||b>C-y*p/2)?b>x+y/2?1:-1:0}function ag(o){return Pt(J)<Pt(o)?1:-1}function lg(o){for(var l=o.tagName+o.className+o.src+o.href+o.textContent,s=l.length,a=0;s--;)a+=l.charCodeAt(s);return a.toString(36)}function sg(o){Uo.length=0;for(var l=o.getElementsByTagName("input"),s=l.length;s--;){var a=l[s];a.checked&&Uo.push(a)}}function zo(o){return setTimeout(o,0)}function Ll(o){return clearTimeout(o)}Go&&Se(document,"touchmove",function(o){(ge.active||Sn)&&o.cancelable&&o.preventDefault()});ge.utils={on:Se,off:ke,css:pe,find:pc,is:function(l,s){return!!Gt(l,s,l,!1)},extend:jp,throttle:gc,closest:Gt,toggleClass:Bt,clone:mc,index:Pt,nextTick:zo,cancelNextTick:Ll,detectDirection:xc,getChild:Fn,expando:Ft};ge.get=function(o){return o[Ft]};ge.mount=function(){for(var o=arguments.length,l=new Array(o),s=0;s<o;s++)l[s]=arguments[s];l[0].constructor===Array&&(l=l[0]),l.forEach(function(a){if(!a.prototype||!a.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(a));a.utils&&(ge.utils=er(er({},ge.utils),a.utils)),xi.mount(a)})};ge.create=function(o,l){return new ge(o,l)};ge.version=qp;var Qe=[],di,Ml,_l=!1,Sl,El,jo,hi;function ug(){function o(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var l in this)l.charAt(0)==="_"&&typeof this[l]=="function"&&(this[l]=this[l].bind(this))}return o.prototype={dragStarted:function(s){var a=s.originalEvent;this.sortable.nativeDraggable?Se(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Se(document,"pointermove",this._handleFallbackAutoScroll):a.touches?Se(document,"touchmove",this._handleFallbackAutoScroll):Se(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(s){var a=s.originalEvent;!this.options.dragOverBubble&&!a.rootEl&&this._handleAutoScroll(a)},drop:function(){this.sortable.nativeDraggable?ke(document,"dragover",this._handleAutoScroll):(ke(document,"pointermove",this._handleFallbackAutoScroll),ke(document,"touchmove",this._handleFallbackAutoScroll),ke(document,"mousemove",this._handleFallbackAutoScroll)),fc(),Ho(),Gp()},nulling:function(){jo=Ml=di=_l=hi=Sl=El=null,Qe.length=0},_handleFallbackAutoScroll:function(s){this._handleAutoScroll(s,!0)},_handleAutoScroll:function(s,a){var f=this,p=(s.touches?s.touches[0]:s).clientX,c=(s.touches?s.touches[0]:s).clientY,h=document.elementFromPoint(p,c);if(jo=s,a||this.options.forceAutoScrollFallback||yi||cr||pi){Al(s,this.options,h,a);var b=Tr(h,!0);_l&&(!hi||p!==Sl||c!==El)&&(hi&&fc(),hi=setInterval(function(){var y=Tr(document.elementFromPoint(p,c),!0);y!==b&&(b=y,Ho()),Al(s,f.options,y,a)},10),Sl=p,El=c)}else{if(!this.options.bubbleScroll||Tr(h,!0)===Vt()){Ho();return}Al(s,this.options,Tr(h,!1),!1)}}},fr(o,{pluginName:"scroll",initializeByDefault:!0})}function Ho(){Qe.forEach(function(o){clearInterval(o.pid)}),Qe=[]}function fc(){clearInterval(hi)}var Al=gc(function(o,l,s,a){if(l.scroll){var f=(o.touches?o.touches[0]:o).clientX,p=(o.touches?o.touches[0]:o).clientY,c=l.scrollSensitivity,h=l.scrollSpeed,b=Vt(),y=!1,x;Ml!==s&&(Ml=s,Ho(),di=l.scroll,x=l.scrollFn,di===!0&&(di=Tr(s,!0)));var C=0,E=di;do{var F=E,_=Je(F),L=_.top,T=_.bottom,O=_.left,N=_.right,P=_.width,I=_.height,W=void 0,j=void 0,X=F.scrollWidth,be=F.scrollHeight,U=pe(F),ae=F.scrollLeft,ne=F.scrollTop;F===b?(W=P<X&&(U.overflowX==="auto"||U.overflowX==="scroll"||U.overflowX==="visible"),j=I<be&&(U.overflowY==="auto"||U.overflowY==="scroll"||U.overflowY==="visible")):(W=P<X&&(U.overflowX==="auto"||U.overflowX==="scroll"),j=I<be&&(U.overflowY==="auto"||U.overflowY==="scroll"));var se=W&&(Math.abs(N-f)<=c&&ae+P<X)-(Math.abs(O-f)<=c&&!!ae),S=j&&(Math.abs(T-p)<=c&&ne+I<be)-(Math.abs(L-p)<=c&&!!ne);if(!Qe[C])for(var R=0;R<=C;R++)Qe[R]||(Qe[R]={});(Qe[C].vx!=se||Qe[C].vy!=S||Qe[C].el!==F)&&(Qe[C].el=F,Qe[C].vx=se,Qe[C].vy=S,clearInterval(Qe[C].pid),(se!=0||S!=0)&&(y=!0,Qe[C].pid=setInterval(function(){a&&this.layer===0&&ge.active._onTouchMove(jo);var z=Qe[this.layer].vy?Qe[this.layer].vy*h:0,K=Qe[this.layer].vx?Qe[this.layer].vx*h:0;typeof x=="function"&&x.call(ge.dragged.parentNode[Ft],K,z,o,jo,Qe[this.layer].el)!=="continue"||vc(Qe[this.layer].el,K,z)}.bind({layer:C}),24))),C++}while(l.bubbleScroll&&E!==b&&(E=Tr(E,!1)));_l=y}},30),kc=function(l){var s=l.originalEvent,a=l.putSortable,f=l.dragEl,p=l.activeSortable,c=l.dispatchSortableEvent,h=l.hideGhostForTarget,b=l.unhideGhostForTarget;if(s){var y=a||p;h();var x=s.changedTouches&&s.changedTouches.length?s.changedTouches[0]:s,C=document.elementFromPoint(x.clientX,x.clientY);b(),y&&!y.el.contains(C)&&(c("spill"),this.onSpill({dragEl:f,putSortable:a}))}};function Ol(){}Ol.prototype={startIndex:null,dragStart:function(l){var s=l.oldDraggableIndex;this.startIndex=s},onSpill:function(l){var s=l.dragEl,a=l.putSortable;this.sortable.captureAnimationState(),a&&a.captureAnimationState();var f=Fn(this.sortable.el,this.startIndex,this.options);f?this.sortable.el.insertBefore(s,f):this.sortable.el.appendChild(s),this.sortable.animateAll(),a&&a.animateAll()},drop:kc};fr(Ol,{pluginName:"revertOnSpill"});function Il(){}Il.prototype={onSpill:function(l){var s=l.dragEl,a=l.putSortable,f=a||this.sortable;f.captureAnimationState(),s.parentNode&&s.parentNode.removeChild(s),f.animateAll()},drop:kc};fr(Il,{pluginName:"removeOnSpill"});ge.mount(new ug);ge.mount(Il,Ol);var Sc=ge;function fg(){var o=document.querySelector('textarea[name="data[content]"]');if(!o)return null;var l=new Zr.default({element:o,spellChecker:!1,autoDownloadFontAwesome:!1,status:!1,placeholder:"What happened today?",minHeight:"180px",toolbar:[{name:"bold",action:Zr.default.toggleBold,className:"mde-btn mde-bold",title:"Bold"},{name:"italic",action:Zr.default.toggleItalic,className:"mde-btn mde-italic",title:"Italic"},{name:"unordered-list",action:Zr.default.toggleUnorderedList,className:"mde-btn mde-ul",title:"Bulleted list"},{name:"link",action:Zr.default.drawLink,className:"mde-btn mde-link",title:"Insert link"},"|",{name:"preview",action:Zr.default.togglePreview,className:"mde-btn mde-preview",title:"Toggle preview"}]});l.codemirror.on("change",function(){l.codemirror.save()});var s=o.closest("form");return s&&s.addEventListener("submit",function(){l.codemirror.save()},!0),l}var cg=["heic","heix","heif","hevc","hevx","mif1","msf1","heim","heis","hevm","hevs"];function _c(o){return o.slice(0,64).arrayBuffer().then(function(l){var s=new Uint8Array(l);if(s.length<12||String.fromCharCode(s[4],s[5],s[6],s[7])!=="ftyp")return!1;for(var a="",f=8;f+4<=s.length;f+=4)a+=String.fromCharCode(s[f],s[f+1],s[f+2],s[f+3]).toLowerCase();return cg.some(function(p){return a.indexOf(p)!==-1})}).catch(function(){return!1})}function dg(o){var l=String(o||"photo").replace(/\.[^.]+$/,"");return l=l.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,""),(l||"photo")+".jpg"}function Ec(){var o=document.querySelector(".filepond-root, .form-input-file");if(!o||!o.parentNode)return null;var l=o.parentNode.querySelector(".photo-convert-status");return l||(l=document.createElement("p"),l.className="photo-convert-status form-status",l.setAttribute("role","status"),o.parentNode.insertBefore(l,o.nextSibling)),l}function hg(){var o=document.querySelector(".filepond-root, .form-input-file");if(!o)return null;var l=o.closest(".form-field");if(!l)return null;var s=l.querySelector(".form-label"),a=document.createElement("details");a.className="photos-collapse",a.open=!0;var f=document.createElement("summary");for(f.className="photos-collapse__summary",f.textContent="Photos (1\u20136)",a.appendChild(f);l.firstChild;)a.appendChild(l.firstChild);return l.appendChild(a),s&&(s.style.display="none"),{details:a,summary:f}}function pg(){var o=document.querySelector('form[name="new-entry"]');if(!o||Xo)return;var l=0,s=hg(),a=null;o.addEventListener("submit",function(){if(a){var x=a.getFiles();if(x.length){var C=o.querySelector('input[name="photo_order"]');C||(C=document.createElement("input"),C.type="hidden",C.name="photo_order",o.appendChild(C)),C.value=JSON.stringify(x.map(function(E){return E.filename}))}}},!0);function f(x,C){var E=Ec();E&&(E.textContent=x||"",E.className="photo-convert-status form-status"+(C?" form-status--"+C:""))}function p(){if(s){var x=document.querySelectorAll(".filepond--item[data-filepond-item-state]"),C=x.length,E=0;Array.prototype.forEach.call(x,function(F){F.getAttribute("data-filepond-item-state")==="processing-complete"&&E++}),l>0||C>0&&E<C?(s.summary.textContent=l>0?"Converting "+l+" photo"+(l>1?"s":"")+"\u2026":"Uploading "+C+" photo"+(C>1?"s":"")+"\u2026",s.details.open=!0):C>0?(s.summary.textContent="\u2713 "+C+" photo"+(C>1?"s":"")+" ready \u2014 tap to review",s.details.open=!1):(s.summary.textContent="Photos (1\u20136)",s.details.open=!0)}}function c(){p(),setTimeout(p,150),setTimeout(p,500)}function h(){var x=o.querySelector('button[type="submit"], input[type="submit"]');if(x&&(x.disabled=l>0),l>0)f("Converting "+l+" photo"+(l>1?"s":"")+"\u2026");else{var C=Ec();C&&/Converting/.test(C.textContent)&&f("")}p()}o.addEventListener("submit",function(x){l>0&&(x.preventDefault(),f("Hang on \u2014 a photo is still converting.","err"))},!0);function b(x){return function(C){var E=C&&C.file;return E?_c(E).then(function(F){return F?(l++,h(),import("./heic-to-CN7JBE7H.js").then(function(_){var L=_.heicTo||_.default&&_.default.heicTo;return L({blob:E,type:"image/jpeg",quality:.85})}).then(function(_){var L=new File([_],dg(E.name),{type:"image/jpeg"});x.addFile(L)}).catch(function(){f("A photo couldn\u2019t be converted and was skipped \u2014 the others are fine.","err")}).then(function(){l--,h()}),!1):!0}):!0}}var y=0;(function x(){var C=window.GravFilePond&&window.GravFilePond.getInstances?window.GravFilePond.getInstances():[];if(!C.length){y++<120&&setTimeout(x,50);return}C.forEach(function(E){E&&!E._heicHooked&&(E._heicHooked=!0,E.setOptions({beforeAddFile:b(E),allowReorder:!0,itemInsertLocation:"after"}),a=E,["addfile","processfile","processfiles","removefile","error"].forEach(function(F){try{E.on(F,c)}catch{}}),p())})})()}function Ot(o){return document.querySelector('[name="data['+o+']"]')}function gg(){var o=Array.prototype.slice.call(document.querySelectorAll(".advanced-field"));if(o.length){var l=[];if(o.forEach(function(p){var c=p.closest(".form-field");c&&l.indexOf(c)===-1&&l.push(c)}),!!l.length){var s=document.createElement("details");s.className="more-options";var a=document.createElement("summary");a.className="more-options__summary",a.textContent="More options",s.appendChild(a),l[0].parentNode.insertBefore(s,l[0]),l.forEach(function(p){s.appendChild(p)});var f=l.some(function(p){var c=p.querySelector('input[type="text"]');if(c&&c.value.trim())return!0;var h=p.querySelector('input[type="radio"]:checked');if(!h||!h.value)return!1;var b=/\[published\]$/.test(h.name||"");return b?h.value==="0":h.value!=="0"});f&&(s.open=!0)}}}var vg={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 dr(o,l,s){o&&(o.className="form-status"+(s?" form-status--"+s:""),o.textContent=l||"")}function mg(){var o=document.getElementById("get-location"),l=document.getElementById("get-weather");if(!o&&!l)return;var s=document.getElementById("location-status"),a=document.getElementById("weather-status");function f(){var h=Ot("lat"),b=Ot("lng"),y=h?h.value.trim():"",x=b?b.value.trim():"";return y&&x?{lat:y,lng:x}:null}function p(){if(l){var h=!!f();l.disabled=!h,l.title=h?"":"Get location first"}}p();function c(h,b){var y=Ot("location_city"),x=Ot("location_country");if(!((!y||y.value.trim())&&(!x||x.value.trim()))){var C="https://api.bigdatacloud.net/data/reverse-geocode-client?latitude="+encodeURIComponent(h)+"&longitude="+encodeURIComponent(b)+"&localityLanguage=en";fetch(C).then(function(E){return E.json()}).then(function(E){var F=(E.city||E.locality||"").trim(),_=(E.countryName||"").trim();y&&!y.value.trim()&&F&&(y.value=F),x&&!x.value.trim()&&_&&(x.value=_);var L=[F,_].filter(Boolean).join(", ");L&&dr(s,"\u2713 Location captured \xB7 "+L,"ok")}).catch(function(){})}}o&&o.addEventListener("click",function(){if(!navigator.geolocation){dr(s,"Geolocation is not supported on this device.","err");return}o.classList.add("is-loading"),o.disabled=!0,dr(s,"Getting location\u2026"),navigator.geolocation.getCurrentPosition(function(h){var b=h.coords.latitude.toFixed(6),y=h.coords.longitude.toFixed(6),x=Ot("lat"),C=Ot("lng");x&&(x.value=b),C&&(C.value=y),o.classList.remove("is-loading"),o.disabled=!1,dr(s,"\u2713 Location captured \xB7 "+b+", "+y,"ok"),p(),c(b,y)},function(h){o.classList.remove("is-loading"),o.disabled=!1,dr(s,"\u2717 "+(h&&h.message?h.message:"Could not get location")+" \u2014 enter coordinates manually if needed.","err")},{enableHighAccuracy:!0,timeout:15e3})}),l&&l.addEventListener("click",function(){var h=f();if(!h){dr(a,"Get location first, then fetch weather.","err");return}l.classList.add("is-loading"),l.disabled=!0,dr(a,"Fetching weather\u2026");var b="https://api.open-meteo.com/v1/forecast?latitude="+h.lat+"&longitude="+h.lng+"&current=temperature_2m,weather_code&temperature_unit=celsius";fetch(b).then(function(y){return y.json()}).then(function(y){var x=Math.round(y.current.temperature_2m),C=vg[y.current.weather_code]||"Cloudy",E=Ot("weather_temp_c"),F=Ot("weather_desc");E&&(E.value=x),F&&(F.value=C),l.classList.remove("is-loading"),p(),dr(a,"\u2713 Weather set \xB7 "+C+" \xB7 "+x+"\xB0C (edit above if needed)","ok")}).catch(function(){l.classList.remove("is-loading"),p(),dr(a,"\u2717 Could not fetch weather \u2014 set it manually above.","err")})})}function bg(){var o=new Date;return o.setSeconds(0,0),o.setMinutes(o.getMinutes()-o.getTimezoneOffset()),o.toISOString().slice(0,16)}function yg(){var o={title:"Title",date:"Date & time",content:"Content"},l=document.querySelector('form[name="new-entry"]');if(!l)return;var s=Ot("date");s&&!String(s.value).trim()&&(s.value=bg());function a(){l.querySelectorAll(".field-error").forEach(function(c){c.remove()}),l.querySelectorAll(".field-invalid").forEach(function(c){c.classList.remove("field-invalid")})}function f(c,h){c.classList.add("field-invalid");var b=document.createElement("span");b.className="field-error",b.textContent=h,c.parentNode.insertBefore(b,c.nextSibling)}function p(c){var h=l.querySelector(".photos-collapse"),b,y;if(h?(h.open=!0,y=h.querySelector(".photos-collapse__summary"),b=h):(b=document.querySelector(".filepond-root, .form-input-file"),y=b),!y)return b||null;var x=document.createElement("span");return x.className="field-error",x.textContent=c,y.insertAdjacentElement("afterend",x),b||y}l.addEventListener("submit",function(c){a();var h=null;!Xo&&document.querySelectorAll(".filepond--item").length<1&&(h=p("Add at least one photo.")),Object.keys(o).forEach(function(b){var y=Ot(b);y&&!String(y.value).trim()&&(f(y,o[b]+" is required."),h||(h=y))}),h&&(c.preventDefault(),typeof h.focus=="function"&&h.focus(),h.scrollIntoView({behavior:"smooth",block:"center"}))})}var Pl="intotheeast:new-entry-draft";function xg(o){return Array.prototype.slice.call(o.querySelectorAll('[name^="data["]')).filter(function(l){if(l.type==="file")return!1;var s=l.name;return s.indexOf("data[_json")!==0&&s.indexOf("data[photos")!==0})}function Dg(){var o=document.querySelector(".filepond-root, .form-input-file");if(!(!o||!o.parentNode)&&!o.parentNode.querySelector(".photo-reauth-hint")){var l=document.createElement("p");l.className="photo-reauth-hint is-shown",l.textContent="Your text was restored \u2014 photos need re-selecting (they can\u2019t be saved in a draft).",o.parentNode.insertBefore(l,o.nextSibling)}}function wg(){var o=document.querySelector('form[name="new-entry"]');if(!o||Xo)return;if(document.querySelector(".notices.success")){try{localStorage.removeItem(Pl)}catch{}return}function l(){var p={};xg(o).forEach(function(c){c.type==="radio"?c.checked&&(p[c.name]=c.value):p[c.name]=c.value});try{localStorage.setItem(Pl,JSON.stringify(p))}catch{}}var s=null;try{s=localStorage.getItem(Pl)}catch{s=null}if(s){var a=null;try{a=JSON.parse(s)}catch{a=null}if(a){var f=!1;Object.keys(a).forEach(function(p){var c=a[p];if(c!=null&&String(c).trim()&&(f=!0),p!=="data[content]"){var h=o.querySelectorAll('input[type="radio"][name="'+p+'"]');if(h.length){h.forEach(function(y){y.checked=y.value===c});return}var b=o.querySelector('[name="'+p+'"]');b&&b.type!=="file"&&(b.value=c)}}),window.postFormEditor&&a["data[content]"]!=null&&window.postFormEditor.value(a["data[content]"]),f&&Dg()}}o.addEventListener("input",l),o.addEventListener("change",l),window.postFormEditor&&window.postFormEditor.codemirror.on("change",l)}function Cg(){var o=document.querySelector(".post-form-wrap"),l=document.querySelector(".post-form-wrap .notices.success, .post-form-wrap .notices.green");if(!(!o||!l)){var s=document.createElement("div");s.className="post-success";var a=document.createElement("p");a.className="post-success__title",a.textContent="\u2713 Saved to your journal.",s.appendChild(a);var f=document.createElement("div");f.className="post-success__actions";var p=o.getAttribute("data-trip-url");if(p){var c=document.createElement("a");c.className="post-success__view",c.href=p,c.textContent="View your journal \u2192",f.appendChild(c)}var h=document.createElement("a");h.className="post-success__again",h.href=window.location.pathname,h.textContent="Post another",f.appendChild(h),s.appendChild(f),l.parentNode.insertBefore(s,l.nextSibling),["form",".form-action-row","#location-status","#weather-status"].forEach(function(b){var y=o.querySelector(b);y&&(y.style.display="none")}),l.scrollIntoView({behavior:"smooth",block:"start"})}}var Xo=!1;function Ac(o){return new URLSearchParams(window.location.search).get(o)}function hr(o,l){var s=Ot(o);s&&(s.value=l==null?"":String(l))}function zl(o,l){var s=l?"1":"0",a=document.querySelectorAll('[name="data['+o+']"]');Array.prototype.forEach.call(a,function(f){f.checked=String(f.value)===s})}function kg(o){var l=o==null?"":String(o);if(window.postFormEditor&&typeof window.postFormEditor.value=="function")window.postFormEditor.value(l);else{var s=Ot("content");s&&(s.value=l)}}function Fc(o,l){var s=o.querySelectorAll("input, textarea, select, button");Array.prototype.forEach.call(s,function(a){a.type==="file"||a.name&&a.name.indexOf("data[photos")===0||(a.disabled=l)}),window.postFormEditor&&window.postFormEditor.codemirror&&window.postFormEditor.codemirror.setOption("readOnly",l?"nocursor":!1)}function Hl(o,l){o&&(o.tagName==="INPUT"?o.value=l:o.textContent=l)}function Sg(o,l){var s=o.querySelector(".post-edit-error");if(s){s.textContent=l;return}var a=document.createElement("div");a.className="post-edit-error",a.setAttribute("role","alert"),a.textContent=l;var f=o.querySelector("h1");f?f.insertAdjacentElement("afterend",a):o.insertBefore(a,o.firstChild)}var Eg=/\.(jpe?g|png|webp|heic|heif|gif)$/i;function Tc(o){var l=/(?:^|\/)photo-0*(\d+)\./i.exec(o);return l?parseInt(l[1],10):Number.MAX_SAFE_INTEGER}function Ag(o,l){var s=Tc(o),a=Tc(l);return s!==a?s-a:o<l?-1:o>l?1:0}function Lc(o,l){var s=String(o||"photo"),a=s.lastIndexOf("."),f=(a>0?s.slice(0,a):s).toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"photo",p=l?".jpg":a>0?s.slice(a).toLowerCase():".jpg",c=Date.now().toString(36)+Math.random().toString(36).slice(2,6);return f+"-"+c+p}function Fg(o){var l=document.querySelector('form[name="new-entry"]');if(!l||!o)return;var s=o.split("/").filter(Boolean).pop();if(!s)return;var a=document.querySelector(".filepond-root, .form-input-file"),f=a?a.closest(".form-field"):null;f&&(f.style.display="none");var p=l.querySelector(".photos-collapse");p&&(p.style.display="none");var c=document.createElement("div");c.className="photo-editor",c.innerHTML='<div class="photo-editor__head"><span class="photo-editor__label">Photos</span><button type="button" class="photo-editor__add">Add photos</button></div><p class="photo-editor__status gpx-status" role="status"></p><div class="photo-editor__grid" aria-live="polite"></div><input type="file" class="photo-editor__input" multiple hidden accept="image/jpeg,image/png,image/webp,.jpg,.jpeg,.png,.webp,.heic,.heif">',f&&f.parentNode?f.parentNode.insertBefore(c,f):l.insertBefore(c,l.firstElementChild);var h=c.querySelector(".photo-editor__grid"),b=c.querySelector(".photo-editor__status"),y=c.querySelector(".photo-editor__add"),x=c.querySelector(".photo-editor__input"),C=[],E=null,F=!1,_=0;function L(S,R){b.textContent=S||"",b.className="photo-editor__status gpx-status"+(R?" error":"")}function T(S){F=S,y.disabled=S,Array.prototype.forEach.call(h.querySelectorAll(".photo-editor__del, .photo-editor__confirm-yes, .photo-editor__confirm-no"),function(R){R.disabled=S}),E&&E.option("disabled",S)}function O(S,R,z){return fetch(S,Object.assign({credentials:"include"},R)).then(function(K){if(K.ok||z&&z.indexOf(K.status)!==-1)return K;var ue=new Error("HTTP "+K.status);throw ue.status=K.status,ue})}function N(S,R){var z=S&&S.status;return z===401||z===403?"Your login session expired \u2014 sign in again, then retry.":R}function P(){return fetch("/api/v1/pages"+o+"/media",{credentials:"include",headers:{Accept:"application/json"}}).then(function(S){if(!S.ok)throw new Error("HTTP "+S.status);return S.json()}).then(function(S){return(S&&S.data||[]).filter(function(R){return R&&typeof R.filename=="string"&&Eg.test(R.filename)}).map(function(R){return R.filename}).sort(Ag)})}function I(S){return O("/api/v1/entry/"+encodeURIComponent(s)+"/photos/order",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({order:S})})}function W(S){if(C=(S||[]).slice(),E&&(E.destroy(),E=null),h.innerHTML="",!C.length){h.innerHTML='<p class="photo-editor__empty">No photos yet \u2014 add some.</p>';return}var R=++_;C.forEach(function(z){var K=document.createElement("div");K.className="photo-editor__cell",K.setAttribute("data-filename",z);var ue=document.createElement("img");ue.className="photo-editor__img",ue.loading="lazy",ue.alt=z,ue.src=o+"/"+encodeURIComponent(z)+"?v="+R;var De=document.createElement("button");De.type="button",De.className="photo-editor__del",De.setAttribute("aria-label","Delete "+z),De.textContent="\u2715",De.addEventListener("click",function(){U(K,z)}),K.appendChild(ue),K.appendChild(De),h.appendChild(K)}),C.length>1&&(E=new Sc(h,{animation:150,draggable:".photo-editor__cell",filter:".photo-editor__confirm",onEnd:be}))}function j(){return Array.prototype.map.call(h.querySelectorAll(".photo-editor__cell"),function(S){return S.getAttribute("data-filename")})}function X(S,R){if(S.length!==R.length)return!1;for(var z=0;z<S.length;z++)if(S[z]!==R[z])return!1;return!0}function be(){var S=j();if(!X(S,C)){var R=C.slice();T(!0),L("Saving order\u2026"),I(S).then(function(){return P().then(function(z){L(""),W(z)},function(){L(""),W(S)})},function(z){L(N(z,"Couldn\u2019t save the new order \u2014 reverted. Try again."),!0),W(R)}).then(function(){T(!1)})}}function U(S,R){if(!(F||S.querySelector(".photo-editor__confirm"))){var z=document.createElement("div");z.className="photo-editor__confirm",z.innerHTML='<span class="photo-editor__confirm-q">Delete?</span><button type="button" class="photo-editor__confirm-yes">Confirm</button><button type="button" class="photo-editor__confirm-no">Cancel</button>',S.appendChild(z),S.classList.add("is-confirming"),z.querySelector(".photo-editor__confirm-no").addEventListener("click",function(){S.classList.remove("is-confirming"),z.remove()}),z.querySelector(".photo-editor__confirm-yes").addEventListener("click",function(){z.querySelector(".photo-editor__confirm-yes").disabled=!0,z.querySelector(".photo-editor__confirm-no").disabled=!0,ae(R)})}}function ae(S){var R=C.slice(),z=C.filter(function(K){return K!==S});T(!0),L("Deleting\u2026"),O("/api/v1/pages"+o+"/media/"+encodeURIComponent(S),{method:"DELETE"},[204,404]).then(function(){return(z.length?I(z):Promise.resolve()).then(P).then(function(K){L(""),W(K)},function(){L("Photo deleted, but refreshing the list failed \u2014 reload if it looks off.",!0),W(z)})},function(K){L(N(K,"Couldn\u2019t delete that photo. Try again."),!0),W(R)}).then(function(){T(!1)})}function ne(S){return _c(S).then(function(R){return R?import("./heic-to-CN7JBE7H.js").then(function(z){var K=z.heicTo||z.default&&z.default.heicTo;return K({blob:S,type:"image/jpeg",quality:.85})}).then(function(z){return{blob:z,name:Lc(S.name,!0)}}):{blob:S,name:Lc(S.name,!1)}})}y.addEventListener("click",function(){F||x.click()}),x.addEventListener("change",function(){var S=Array.prototype.slice.call(x.files||[]);x.value="",S.length&&se(S)});function se(S){T(!0);var R=S.length,z=0,K=0,ue=!1,De=C.slice(),ot=Promise.resolve();S.forEach(function(A){ot=ot.then(function(){return z++,L("Uploading "+z+" of "+R+"\u2026"),ne(A).then(function(D){var ee=new FormData;return ee.append("file",D.blob,D.name),O("/api/v1/pages"+o+"/media",{method:"POST",body:ee})}).then(null,function(D){K++,D&&(D.status===401||D.status===403)&&(ue=!0)})})}),ot.then(function(){return L("Finishing\u2026"),P()}).then(function(A){var D=De.filter(function(he){return A.indexOf(he)!==-1}),ee=A.filter(function(he){return De.indexOf(he)===-1}),we=D.concat(ee);return we.length?I(we).catch(function(){return I(we)}).catch(function(){return Promise.all(ee.map(function(he){return O("/api/v1/pages"+o+"/media/"+encodeURIComponent(he),{method:"DELETE"},[204,404]).then(function(){return!0},function(){return!1})})).then(function(he){var $e=new Error("reorder failed");throw $e.rolledBack=!0,$e.rollbackIncomplete=he.indexOf(!1)!==-1,$e})}).then(P):(W([]),null)}).then(function(A){A&&W(A),K?L(ue?"Couldn\u2019t add photos \u2014 your login session expired. Sign in again, then retry.":K+" photo"+(K>1?"s":"")+" couldn\u2019t be added.",!0):L("")}).catch(function(A){var D;return A&&A.rolledBack?D=A.rollbackIncomplete?"Couldn\u2019t finish adding photos and cleanup was incomplete \u2014 reload the page and check your photos.":"Couldn\u2019t finish adding photos \u2014 changes were rolled back. Try again.":D="Couldn\u2019t add photos. Please try again.",L(D,!0),P().then(W,function(){W(De)})}).then(function(){T(!1)})}h.innerHTML='<p class="photo-editor__loading">Loading photos\u2026</p>',P().then(W).catch(function(){L("Couldn\u2019t load photos.",!0),W([])})}function Tg(){var o=document.querySelector('form[name="new-entry"]'),l=document.querySelector(".post-form-wrap");if(!(!o||!l)){var s=Ac("edit");if(s){Xo=!0;var a=l.querySelector("h1");a&&(a.textContent="Edit entry");var f=o.querySelector('button[type="submit"], input[type="submit"]'),p=f?f.tagName==="INPUT"?f.value:f.textContent:"Save changes";Fc(o,!0),Hl(f,"Loading entry\u2026");var c=Ac("return")||l.getAttribute("data-trip-url")||"";o.setAttribute("action","/post?edit="+encodeURIComponent(s)+(c?"&return="+encodeURIComponent(c):"")),fetch("/api/v1/pages"+s,{credentials:"include",headers:{Accept:"application/json"}}).then(function(h){if(!h.ok){var b=new Error("HTTP "+h.status);throw b.status=h.status,b}return h.json()}).then(function(h){var b=h&&h.data||{},y=b.header||{};hr("title",y.title!=null?y.title:b.title),hr("date",y.date?String(y.date).replace(" ","T"):""),kg(b.content),hr("lat",y.lat),hr("lng",y.lng),hr("location_city",y.location_city),hr("location_country",y.location_country),hr("weather_desc",y.weather_desc),hr("weather_temp_c",y.weather_temp_c),hr("transport_mode",y.transport_mode),zl("featured",y.featured),zl("force_connect",y.force_connect),zl("published",y.published!==void 0?y.published:b.published);var x=Ot("edit_path");x&&(x.value=s+"/entry.md"),Fc(o,!1),Hl(f,"Save changes");var C=o.querySelector(".more-options");C&&(C.open=!0),Fg(s)}).catch(function(h){var b=h&&h.status===404?"This entry no longer exists \u2014 it may have been deleted. Head back to the journal.":"Sorry \u2014 this entry couldn\u2019t be loaded for editing. Check your connection and try again.";Sg(l,b),Hl(f,p)})}}}function Mc(){window.postFormEditor=fg(),Cg(),Tg(),wg(),pg(),gg(),mg(),yg()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",Mc):Mc();
/*! Bundled license information:
sortablejs/modular/sortable.esm.js:
(**!
* Sortable 1.15.7
* @author RubaXa <trash@rubaxa.org>
* @author owenm <owen23355@gmail.com>
* @license MIT
*)
*/