dootask/public/js/build/index.46b5c251.js
2024-05-12 00:18:34 +09:00

67 lines
259 KiB
JavaScript
Vendored

import{t as br,g as Ls,n as gl}from"./app.a5003f55.js";import{I as Ts}from"./ImgUpload.b8011e7b.js";import"./@micro-zoe.c2e1472d.js";import"./jquery.b0449679.js";import"./@traptitech.b6e72224.js";import"./katex.9792db63.js";import"./localforage.700ea121.js";import"./markdown-it.28fd7f10.js";import"./entities.797c3e49.js";import"./uc.micro.39573202.js";import"./mdurl.2f66c031.js";import"./linkify-it.3ecfda1e.js";import"./punycode.b7e94e71.js";import"./highlight.js.24fdca15.js";import"./markdown-it-link-attributes.e1d5d151.js";import"./vue.ea2bb532.js";import"./vuex.cc7cb26e.js";import"./axios.6ec123f8.js";import"./le5le-store.b40f9152.js";import"./openpgp_hi.15f91b1d.js";import"./vue-router.2d566cd7.js";import"./vue-clipboard2.f62d09e0.js";import"./clipboard.13c9d2be.js";import"./view-design-hi.895c48df.js";import"./default-passive-events.a3d698c9.js";import"./vuedraggable.4bb621b8.js";import"./sortablejs.88918bd7.js";import"./vue-resize-observer.eb9dc3d4.js";import"./element-sea.faaf089e.js";import"./deepmerge.cecf392e.js";import"./resize-observer-polyfill.88ee0e7b.js";import"./throttle-debounce.7c3948b2.js";import"./babel-helper-vue-jsx-merge-props.5ed215c3.js";import"./normalize-wheel.2a034b9f.js";import"./async-validator.45b57f96.js";import"./babel-runtime.4773988a.js";import"./core-js.314b4a1d.js";var Te=navigator.userAgent,ml=navigator.platform,gt=/gecko\/\d/i.test(Te),yl=/MSIE \d/.test(Te),bl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Te),Zr=/Edge\/(\d+)/.exec(Te),re=yl||bl||Zr,ce=re&&(yl?document.documentMode||6:+(Zr||bl)[1]),Le=!Zr&&/WebKit\//.test(Te),Ms=Le&&/Qt\/\d+\.\d+/.test(Te),On=!Zr&&/Chrome\//.test(Te),Xe=/Opera\//.test(Te),wl=/Apple Computer/.test(navigator.vendor),Ds=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(Te),As=/PhantomJS/.test(Te),Qr=!Zr&&/AppleWebKit/.test(Te)&&/Mobile\/\w+/.test(Te),In=/Android/.test(Te),zr=Qr||In||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(Te),Ye=Qr||/Mac/.test(ml),Fs=/\bCrOS\b/.test(Te),Es=/win/i.test(ml),Nt=Xe&&Te.match(/Version\/(\d*\.\d*)/);Nt&&(Nt=Number(Nt[1]));Nt&&Nt>=15&&(Xe=!1,Le=!0);var Fo=Ye&&(Ms||Xe&&(Nt==null||Nt<12.11)),Ii=gt||re&&ce>=9;function Pr(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var Rt=function(e,t){var r=e.className,n=Pr(t).exec(r);if(n){var i=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(i?n[1]+i:"")}};function mt(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function Ie(e,t){return mt(e).appendChild(t)}function G(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function nr(e,t,r,n){var i=G(e,t,r,n);return i.setAttribute("role","presentation"),i}var It;document.createRange?It=function(e,t,r,n){var i=document.createRange();return i.setEnd(n||e,r),i.setStart(e,t),i}:It=function(e,t,r){var n=document.body.createTextRange();try{n.moveToElementText(e.parentNode)}catch{return n}return n.collapse(!0),n.moveEnd("character",r),n.moveStart("character",t),n};function yt(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 at(){var e;try{e=document.activeElement}catch{e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function Ut(e,t){var r=e.className;Pr(t).test(r)||(e.className+=(r?" ":"")+t)}function ai(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!Pr(r[n]).test(t)&&(t+=" "+r[n]);return t}var Wr=function(e){e.select()};Qr?Wr=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:re&&(Wr=function(e){try{e.select()}catch{}});function Hn(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function Ht(e,t,r){t||(t={});for(var n in e)e.hasOwnProperty(n)&&(r!==!1||!t.hasOwnProperty(n))&&(t[n]=e[n]);return t}function Pe(e,t,r,n,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=n||0,l=i||0;;){var a=e.indexOf(" ",o);if(a<0||a>=t)return l+(t-o);l+=a-o,l+=r-l%r,o=a+1}}var bt=function(){this.id=null,this.f=null,this.time=0,this.handler=Hn(this.onTimeout,this)};bt.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)};bt.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=r)};function Ce(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}var kl=30,zn={toString:function(){return"CodeMirror.Pass"}},et={scroll:!1},si={origin:"*mouse"},Dr={origin:"+move"};function pi(e,t,r){for(var n=0,i=0;;){var o=e.indexOf(" ",n);o==-1&&(o=e.length);var l=o-n;if(o==e.length||i+l>=t)return n+Math.min(l,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}var hn=[""];function Hi(e){for(;hn.length<=e;)hn.push(ie(hn)+" ");return hn[e]}function ie(e){return e[e.length-1]}function Pn(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function Ns(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function Eo(){}function xl(e,t){var r;return Object.create?r=Object.create(e):(Eo.prototype=e,r=new Eo),t&&Ht(t,r),r}var Os=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function vi(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Os.test(e))}function bn(e,t){return t?t.source.indexOf("\\w")>-1&&vi(e)?!0:t.test(e):vi(e)}function No(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Is=/[\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 gi(e){return e.charCodeAt(0)>=768&&Is.test(e)}function Cl(e,t,r){for(;(r<0?t>0:t<e.length)&&gi(e.charAt(t));)t+=r;return t}function _r(e,t,r){for(var n=t>r?-1:1;;){if(t==r)return t;var i=(t+r)/2,o=n<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:r;e(o)?r=o:t=o+n}}function Hs(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var l=e[o];(l.from<r&&l.to>t||t==r&&l.to==t)&&(n(Math.max(l.from,t),Math.min(l.to,r),l.level==1?"rtl":"ltr",o),i=!0)}i||n(t,r,"ltr")}var Lr=null;function Br(e,t,r){var n;Lr=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&r=="before"?n=i:Lr=i),o.from==t&&(o.from!=o.to&&r!="before"?n=i:Lr=i)}return n!=null?n:Lr}var zs=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(u){return u<=247?e.charAt(u):1424<=u&&u<=1524?"R":1536<=u&&u<=1785?t.charAt(u-1536):1774<=u&&u<=2220?"r":8192<=u&&u<=8203?"w":u==8204?"b":"L"}var n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,l=/[Lb1n]/,a=/[1n]/;function s(u,h,p){this.level=u,this.from=h,this.to=p}return function(u,h){var p=h=="ltr"?"L":"R";if(u.length==0||h=="ltr"&&!n.test(u))return!1;for(var b=u.length,y=[],k=0;k<b;++k)y.push(r(u.charCodeAt(k)));for(var S=0,D=p;S<b;++S){var A=y[S];A=="m"?y[S]=D:D=A}for(var I=0,L=p;I<b;++I){var E=y[I];E=="1"&&L=="r"?y[I]="n":o.test(E)&&(L=E,E=="r"&&(y[I]="R"))}for(var P=1,W=y[0];P<b-1;++P){var Y=y[P];Y=="+"&&W=="1"&&y[P+1]=="1"?y[P]="1":Y==","&&W==y[P+1]&&(W=="1"||W=="n")&&(y[P]=W),W=Y}for(var _=0;_<b;++_){var v=y[_];if(v==",")y[_]="N";else if(v=="%"){var C=void 0;for(C=_+1;C<b&&y[C]=="%";++C);for(var d=_&&y[_-1]=="!"||C<b&&y[C]=="1"?"1":"N",B=_;B<C;++B)y[B]=d;_=C-1}}for(var Q=0,j=p;Q<b;++Q){var w=y[Q];j=="L"&&w=="1"?y[Q]="L":o.test(w)&&(j=w)}for(var T=0;T<b;++T)if(i.test(y[T])){var x=void 0;for(x=T+1;x<b&&i.test(y[x]);++x);for(var K=(T?y[T-1]:p)=="L",m=(x<b?y[x]:p)=="L",c=K==m?K?"L":"R":p,z=T;z<x;++z)y[z]=c;T=x-1}for(var H=[],O,U=0;U<b;)if(l.test(y[U])){var se=U;for(++U;U<b&&l.test(y[U]);++U);H.push(new s(0,se,U))}else{var ge=U,$=H.length;for(++U;U<b&&y[U]!="L";++U);for(var ee=ge;ee<U;)if(a.test(y[ee])){ge<ee&&H.splice($,0,new s(1,ge,ee));var oe=ee;for(++ee;ee<U&&a.test(y[ee]);++ee);H.splice($,0,new s(2,oe,ee)),ge=ee}else++ee;ge<U&&H.splice($,0,new s(1,ge,U))}return h=="ltr"&&(H[0].level==1&&(O=u.match(/^\s+/))&&(H[0].from=O[0].length,H.unshift(new s(0,0,O[0].length))),ie(H).level==1&&(O=u.match(/\s+$/))&&(ie(H).to-=O[0].length,H.push(new s(0,b-O[0].length,b)))),h=="rtl"?H.reverse():H}}();function st(e,t){var r=e.order;return r==null&&(r=e.order=zs(e.text,t)),r}var Sl=[],X=function(e,t,r){if(e.addEventListener)e.addEventListener(t,r,!1);else if(e.attachEvent)e.attachEvent("on"+t,r);else{var n=e._handlers||(e._handlers={});n[t]=(n[t]||Sl).concat(r)}};function zi(e,t){return e._handlers&&e._handlers[t]||Sl}function Oe(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=Ce(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function de(e,t){var r=zi(e,t);if(!!r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function ye(e,t,r){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),de(e,r||t.type,e,t),mi(t)||t.codemirrorIgnore}function Ll(e){var t=e._handlers&&e._handlers.cursorActivity;if(!!t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)Ce(r,t[n])==-1&&r.push(t[n])}function We(e,t){return zi(e,t).length>0}function hr(e){e.prototype.on=function(t,r){X(this,t,r)},e.prototype.off=function(t,r){Oe(this,t,r)}}function Ae(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Tl(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function mi(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Rr(e){Ae(e),Tl(e)}function Pi(e){return e.target||e.srcElement}function Ml(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),Ye&&e.ctrlKey&&t==1&&(t=3),t}var Ps=function(){if(re&&ce<9)return!1;var e=G("div");return"draggable"in e||"dragDrop"in e}(),ui;function Ws(e){if(ui==null){var t=G("span","\u200B");Ie(e,G("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(ui=t.offsetWidth<=1&&t.offsetHeight>2&&!(re&&ce<8))}var r=ui?G("span","\u200B"):G("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var fi;function _s(e){if(fi!=null)return fi;var t=Ie(e,document.createTextNode("A\u062EA")),r=It(t,0,1).getBoundingClientRect(),n=It(t,1,2).getBoundingClientRect();return mt(e),!r||r.left==r.right?!1:fi=n.right-r.right<3}var Wi=`
b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],n=e.length;t<=n;){var i=e.indexOf(`
`,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),l=o.indexOf("\r");l!=-1?(r.push(o.slice(0,l)),t+=l+1):(r.push(o),t=i+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Bs=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},Rs=function(){var e=G("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ci=null;function Us(e){if(ci!=null)return ci;var t=Ie(e,G("span","x")),r=t.getBoundingClientRect(),n=It(t,0,1).getBoundingClientRect();return ci=Math.abs(r.left-n.left)>1}var _i={},er={};function Ks(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),_i[e]=t}function qs(e,t){er[e]=t}function Sn(e){if(typeof e=="string"&&er.hasOwnProperty(e))e=er[e];else if(e&&typeof e.name=="string"&&er.hasOwnProperty(e.name)){var t=er[e.name];typeof t=="string"&&(t={name:t}),e=xl(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Sn("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Sn("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Bi(e,t){t=Sn(t);var r=_i[t.name];if(!r)return Bi(e,"text/plain");var n=r(e,t);if(ir.hasOwnProperty(t.name)){var i=ir[t.name];for(var o in i)!i.hasOwnProperty(o)||(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var l in t.modeProps)n[l]=t.modeProps[l];return n}var ir={};function Gs(e,t){var r=ir.hasOwnProperty(e)?ir[e]:ir[e]={};Ht(t,r)}function zt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function Ri(e,t){for(var r;e.innerMode&&(r=e.innerMode(t),!(!r||r.mode==e));)t=r.state,e=r.mode;return r||{mode:e,state:t}}function Dl(e,t,r){return e.startState?e.startState(t,r):!0}var pe=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};pe.prototype.eol=function(){return this.pos>=this.string.length};pe.prototype.sol=function(){return this.pos==this.lineStart};pe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0};pe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)};pe.prototype.eat=function(e){var t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e.test?e.test(t):e(t)),r)return++this.pos,t};pe.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t};pe.prototype.eatSpace=function(){for(var e=this,t=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++e.pos;return this.pos>t};pe.prototype.skipToEnd=function(){this.pos=this.string.length};pe.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0};pe.prototype.backUp=function(e){this.pos-=e};pe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Pe(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Pe(this.string,this.lineStart,this.tabSize):0)};pe.prototype.indentation=function(){return Pe(this.string,null,this.tabSize)-(this.lineStart?Pe(this.string,this.lineStart,this.tabSize):0)};pe.prototype.match=function(e,t,r){if(typeof e=="string"){var n=function(l){return r?l.toLowerCase():l},i=this.string.substr(this.pos,e.length);if(n(i)==n(e))return t!==!1&&(this.pos+=e.length),!0}else{var o=this.string.slice(this.pos).match(e);return o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}};pe.prototype.current=function(){return this.string.slice(this.start,this.pos)};pe.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}};pe.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)};pe.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function q(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function Ot(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(o){var l=o.text;i==r.line&&(l=l.slice(0,r.ch)),i==t.line&&(l=l.slice(t.ch)),n.push(l),++i}),n}function hi(e,t,r){var n=[];return e.iter(t,r,function(i){n.push(i.text)}),n}function Qe(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function le(e){if(e.parent==null)return null;for(var t=e.parent,r=Ce(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function Et(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var l=0;l<e.lines.length;++l){var a=e.lines[l],s=a.height;if(t<s)break;t-=s}return r+l}function Ur(e,t){return t>=e.first&&t<e.first+e.size}function Ui(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function F(e,t,r){if(r===void 0&&(r=null),!(this instanceof F))return new F(e,t,r);this.line=e,this.ch=t,this.sticky=r}function Z(e,t){return e.line-t.line||e.ch-t.ch}function yi(e,t){return e.sticky==t.sticky&&Z(e,t)==0}function bi(e){return F(e.line,e.ch)}function Wn(e,t){return Z(e,t)<0?t:e}function _n(e,t){return Z(e,t)<0?e:t}function Al(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function V(e,t){if(t.line<e.first)return F(e.first,0);var r=e.first+e.size-1;return t.line>r?F(r,q(e,r).text.length):Xs(t,q(e,t.line).text.length)}function Xs(e,t){var r=e.ch;return r==null||r>t?F(e.line,t):r<0?F(e.line,0):e}function Oo(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=V(e,t[n]);return r}var Bn=function(e,t){this.state=e,this.lookAhead=t},Ze=function(e,t,r,n){this.state=t,this.doc=e,this.line=r,this.maxLookAhead=n||0,this.baseTokens=null,this.baseTokenPos=1};Ze.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t};Ze.prototype.baseToken=function(e){var t=this;if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)t.baseTokenPos+=2;var r=this.baseTokens[this.baseTokenPos+1];return{type:r&&r.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}};Ze.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--};Ze.fromSaved=function(e,t,r){return t instanceof Bn?new Ze(e,zt(e.mode,t.state),r,t.lookAhead):new Ze(e,zt(e.mode,t),r)};Ze.prototype.save=function(e){var t=e!==!1?zt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Bn(t,this.maxLookAhead):t};function Fl(e,t,r,n){var i=[e.state.modeGen],o={};Po(e,t.text,e.doc.mode,r,function(u,h){return i.push(u,h)},o,n);for(var l=r.state,a=function(u){r.baseTokens=i;var h=e.state.overlays[u],p=1,b=0;r.state=!0,Po(e,t.text,h.mode,r,function(y,k){for(var S=p;b<y;){var D=i[p];D>y&&i.splice(p,1,y,i[p+1],D),p+=2,b=Math.min(y,D)}if(!!k)if(h.opaque)i.splice(S,p-S,y,"overlay "+k),p=S+2;else for(;S<p;S+=2){var A=i[S+1];i[S+1]=(A?A+" ":"")+"overlay "+k}},o),r.state=l,r.baseTokens=null,r.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)a(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function El(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=Jr(e,le(t)),i=t.text.length>e.options.maxHighlightLength&&zt(e.doc.mode,n.state),o=Fl(e,t,n);i&&(n.state=i),t.stateAfter=n.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Jr(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return new Ze(n,!0,t);var o=Ys(e,t,r),l=o>n.first&&q(n,o-1).stateAfter,a=l?Ze.fromSaved(n,l,o):new Ze(n,Dl(n.mode),o);return n.iter(o,t,function(s){Ki(e,s.text,a);var u=a.line;s.stateAfter=u==t-1||u%5==0||u>=i.viewFrom&&u<i.viewTo?a.save():null,a.nextLine()}),r&&(n.modeFrontier=a.line),a}function Ki(e,t,r,n){var i=e.doc.mode,o=new pe(t,e.options.tabSize,r);for(o.start=o.pos=n||0,t==""&&Nl(i,r.state);!o.eol();)qi(i,o,r.state),o.start=o.pos}function Nl(e,t){if(e.blankLine)return e.blankLine(t);if(!!e.innerMode){var r=Ri(e,t);if(r.mode.blankLine)return r.mode.blankLine(r.state)}}function qi(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=Ri(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var Io=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function Ho(e,t,r,n){var i=e.doc,o=i.mode,l;t=V(i,t);var a=q(i,t.line),s=Jr(e,t.line,r),u=new pe(a.text,e.options.tabSize,s),h;for(n&&(h=[]);(n||u.pos<t.ch)&&!u.eol();)u.start=u.pos,l=qi(o,u,s.state),n&&h.push(new Io(u,l,zt(i.mode,s.state)));return n?h:new Io(u,l,s.state)}function zo(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";t[n]==null?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function Po(e,t,r,n,i,o,l){var a=r.flattenSpans;a==null&&(a=e.options.flattenSpans);var s=0,u=null,h=new pe(t,e.options.tabSize,n),p,b=e.options.addModeClass&&[null];for(t==""&&zo(Nl(r,n.state),o);!h.eol();){if(h.pos>e.options.maxHighlightLength?(a=!1,l&&Ki(e,t,n,h.pos),h.pos=t.length,p=null):p=zo(qi(r,h,n.state,b),o),b){var y=b[0].name;y&&(p="m-"+(p?y+" "+p:y))}if(!a||u!=p){for(;s<h.start;)s=Math.min(h.start,s+5e3),i(s,u);u=p}h.start=h.pos}for(;s<h.pos;){var k=Math.min(h.pos,s+5e3);i(k,u),s=k}}function Ys(e,t,r){for(var n,i,o=e.doc,l=r?-1:t-(e.doc.mode.innerMode?1e3:100),a=t;a>l;--a){if(a<=o.first)return o.first;var s=q(o,a-1),u=s.stateAfter;if(u&&(!r||a+(u instanceof Bn?u.lookAhead:0)<=o.modeFrontier))return a;var h=Pe(s.text,null,e.options.tabSize);(i==null||n>h)&&(i=a-1,n=h)}return i}function js(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var r=e.first,n=t-1;n>r;n--){var i=q(e,n).stateAfter;if(i&&(!(i instanceof Bn)||n+i.lookAhead<t)){r=n+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,r)}}var Ol=!1,it=!1;function Zs(){Ol=!0}function Qs(){it=!0}function Rn(e,t,r){this.marker=e,this.from=t,this.to=r}function Kr(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function Js(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function Vs(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function $s(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,a=o.from==null||(l.inclusiveLeft?o.from<=t:o.from<t);if(a||o.from==t&&l.type=="bookmark"&&(!r||!o.marker.insertLeft)){var s=o.to==null||(l.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new Rn(l,o.from,s?null:o.to))}}return n}function eu(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],l=o.marker,a=o.to==null||(l.inclusiveRight?o.to>=t:o.to>t);if(a||o.from==t&&l.type=="bookmark"&&(!r||o.marker.insertLeft)){var s=o.from==null||(l.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new Rn(l,s?null:o.from-t,o.to==null?null:o.to-t))}}return n}function wi(e,t){if(t.full)return null;var r=Ur(e,t.from.line)&&q(e,t.from.line).markedSpans,n=Ur(e,t.to.line)&&q(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,l=Z(t.from,t.to)==0,a=$s(r,i,l),s=eu(n,o,l),u=t.text.length==1,h=ie(t.text).length+(u?i:0);if(a)for(var p=0;p<a.length;++p){var b=a[p];if(b.to==null){var y=Kr(s,b.marker);y?u&&(b.to=y.to==null?null:y.to+h):b.to=i}}if(s)for(var k=0;k<s.length;++k){var S=s[k];if(S.to!=null&&(S.to+=h),S.from==null){var D=Kr(a,S.marker);D||(S.from=h,u&&(a||(a=[])).push(S))}else S.from+=h,u&&(a||(a=[])).push(S)}a&&(a=Wo(a)),s&&s!=a&&(s=Wo(s));var A=[a];if(!u){var I=t.text.length-2,L;if(I>0&&a)for(var E=0;E<a.length;++E)a[E].to==null&&(L||(L=[])).push(new Rn(a[E].marker,null,null));for(var P=0;P<I;++P)A.push(L);A.push(s)}return A}function Wo(e){for(var t=0;t<e.length;++t){var r=e[t];r.from!=null&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function tu(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(y){if(y.markedSpans)for(var k=0;k<y.markedSpans.length;++k){var S=y.markedSpans[k].marker;S.readOnly&&(!n||Ce(n,S)==-1)&&(n||(n=[])).push(S)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var l=n[o],a=l.find(0),s=0;s<i.length;++s){var u=i[s];if(!(Z(u.to,a.from)<0||Z(u.from,a.to)>0)){var h=[s,1],p=Z(u.from,a.from),b=Z(u.to,a.to);(p<0||!l.inclusiveLeft&&!p)&&h.push({from:u.from,to:a.from}),(b>0||!l.inclusiveRight&&!b)&&h.push({from:a.to,to:u.to}),i.splice.apply(i,h),s+=h.length-3}}return i}function Il(e){var t=e.markedSpans;if(!!t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function Hl(e,t){if(!!t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function Ln(e){return e.inclusiveLeft?-1:0}function Tn(e){return e.inclusiveRight?1:0}function Gi(e,t){var r=e.lines.length-t.lines.length;if(r!=0)return r;var n=e.find(),i=t.find(),o=Z(n.from,i.from)||Ln(e)-Ln(t);if(o)return-o;var l=Z(n.to,i.to)||Tn(e)-Tn(t);return l||t.id-e.id}function zl(e,t){var r=it&&e.markedSpans,n;if(r)for(var i=void 0,o=0;o<r.length;++o)i=r[o],i.marker.collapsed&&(t?i.from:i.to)==null&&(!n||Gi(n,i.marker)<0)&&(n=i.marker);return n}function Pl(e){return zl(e,!0)}function Un(e){return zl(e,!1)}function ru(e,t){var r=it&&e.markedSpans,n;if(r)for(var i=0;i<r.length;++i){var o=r[i];o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!n||Gi(n,o.marker)<0)&&(n=o.marker)}return n}function _o(e,t,r,n,i){var o=q(e,t),l=it&&o.markedSpans;if(l)for(var a=0;a<l.length;++a){var s=l[a];if(!!s.marker.collapsed){var u=s.marker.find(0),h=Z(u.from,r)||Ln(s.marker)-Ln(i),p=Z(u.to,n)||Tn(s.marker)-Tn(i);if(!(h>=0&&p<=0||h<=0&&p>=0)&&(h<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?Z(u.to,r)>=0:Z(u.to,r)>0)||h>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?Z(u.from,n)<=0:Z(u.from,n)<0)))return!0}}}function Je(e){for(var t;t=Pl(e);)e=t.find(-1,!0).line;return e}function nu(e){for(var t;t=Un(e);)e=t.find(1,!0).line;return e}function iu(e){for(var t,r;t=Un(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function Xi(e,t){var r=q(e,t),n=Je(r);return r==n?t:le(n)}function Wl(e,t){if(t>e.lastLine())return t;var r=q(e,t),n;if(!Ct(e,r))return t;for(;n=Un(r);)r=n.find(1,!0).line;return le(r)+1}function Ct(e,t){var r=it&&t.markedSpans;if(r){for(var n=void 0,i=0;i<r.length;++i)if(n=r[i],!!n.marker.collapsed){if(n.from==null)return!0;if(!n.marker.widgetNode&&n.from==0&&n.marker.inclusiveLeft&&ki(e,t,n))return!0}}}function ki(e,t,r){if(r.to==null){var n=r.marker.find(1,!0);return ki(e,n.line,Kr(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(i.to==null||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&ki(e,t,i))return!0}function ot(e){e=Je(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;r=o,o=r.parent)for(var l=0;l<o.children.length;++l){var a=o.children[l];if(a==r)break;t+=a.height}return t}function Mn(e){if(e.height==0)return 0;for(var t=e.text.length,r,n=e;r=Pl(n);){var i=r.find(0,!0);n=i.from.line,t+=i.from.ch-i.to.ch}for(n=e;r=Un(n);){var o=r.find(0,!0);t-=n.text.length-o.from.ch,n=o.to.line,t+=n.text.length-o.to.ch}return t}function Yi(e){var t=e.display,r=e.doc;t.maxLine=q(r,r.first),t.maxLineLength=Mn(t.maxLine),t.maxLineChanged=!0,r.iter(function(n){var i=Mn(n);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=n)})}var ar=function(e,t,r){this.text=e,Hl(this,t),this.height=r?r(this):1};ar.prototype.lineNo=function(){return le(this)};hr(ar);function ou(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Il(e),Hl(e,r);var i=n?n(e):1;i!=e.height&&Qe(e,i)}function lu(e){e.parent=null,Il(e)}var au={},su={};function Bo(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?su:au;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function _l(e,t){var r=nr("span",null,null,Le?"padding-right: .1px":null),n={pre:nr("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;n.pos=0,n.addToken=fu,_s(e.display.measure)&&(l=st(o,e.doc.direction))&&(n.addToken=hu(n.addToken,l)),n.map=[];var a=t!=e.display.externalMeasured&&le(o);du(o,n,El(e,o,a)),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=ai(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=ai(o.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(Ws(e.display.measure))),i==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(Le){var s=n.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return de(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=ai(n.pre.className,n.textClass||"")),n}function uu(e){var t=G("span","\u2022","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function fu(e,t,r,n,i,o,l){if(!!t){var a=e.splitSpaces?cu(t,e.trailingSpace):t,s=e.cm.state.specialChars,u=!1,h;if(!s.test(t))e.col+=t.length,h=document.createTextNode(a),e.map.push(e.pos,e.pos+t.length,h),re&&ce<9&&(u=!0),e.pos+=t.length;else{h=document.createDocumentFragment();for(var p=0;;){s.lastIndex=p;var b=s.exec(t),y=b?b.index-p:t.length-p;if(y){var k=document.createTextNode(a.slice(p,p+y));re&&ce<9?h.appendChild(G("span",[k])):h.appendChild(k),e.map.push(e.pos,e.pos+y,k),e.col+=y,e.pos+=y}if(!b)break;p+=y+1;var S=void 0;if(b[0]==" "){var D=e.cm.options.tabSize,A=D-e.col%D;S=h.appendChild(G("span",Hi(A),"cm-tab")),S.setAttribute("role","presentation"),S.setAttribute("cm-text"," "),e.col+=A}else b[0]=="\r"||b[0]==`
`?(S=h.appendChild(G("span",b[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),S.setAttribute("cm-text",b[0]),e.col+=1):(S=e.cm.options.specialCharPlaceholder(b[0]),S.setAttribute("cm-text",b[0]),re&&ce<9?h.appendChild(G("span",[S])):h.appendChild(S),e.col+=1);e.map.push(e.pos,e.pos+1,S),e.pos++}}if(e.trailingSpace=a.charCodeAt(t.length-1)==32,r||n||i||u||o){var I=r||"";n&&(I+=n),i&&(I+=i);var L=G("span",[h],I,o);if(l)for(var E in l)l.hasOwnProperty(E)&&E!="style"&&E!="class"&&L.setAttribute(E,l[E]);return e.content.appendChild(L)}e.content.appendChild(h)}}function cu(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);o==" "&&r&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(o="\xA0"),n+=o,r=o==" "}return n}function hu(e,t){return function(r,n,i,o,l,a,s){i=i?i+" cm-force-border":"cm-force-border";for(var u=r.pos,h=u+n.length;;){for(var p=void 0,b=0;b<t.length&&(p=t[b],!(p.to>u&&p.from<=u));b++);if(p.to>=h)return e(r,n,i,o,l,a,s);e(r,n.slice(0,p.to-u),i,o,null,a,s),o=null,n=n.slice(p.to-u),u=p.to}}}function Ro(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function du(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(!n){for(var l=1;l<r.length;l+=2)t.addToken(t,i.slice(o,o=r[l]),Bo(r[l+1],t.cm.options));return}for(var a=i.length,s=0,u=1,h="",p,b,y=0,k,S,D,A,I;;){if(y==s){k=S=D=b="",I=null,A=null,y=1/0;for(var L=[],E=void 0,P=0;P<n.length;++P){var W=n[P],Y=W.marker;if(Y.type=="bookmark"&&W.from==s&&Y.widgetNode)L.push(Y);else if(W.from<=s&&(W.to==null||W.to>s||Y.collapsed&&W.to==s&&W.from==s)){if(W.to!=null&&W.to!=s&&y>W.to&&(y=W.to,S=""),Y.className&&(k+=" "+Y.className),Y.css&&(b=(b?b+";":"")+Y.css),Y.startStyle&&W.from==s&&(D+=" "+Y.startStyle),Y.endStyle&&W.to==y&&(E||(E=[])).push(Y.endStyle,W.to),Y.title&&((I||(I={})).title=Y.title),Y.attributes)for(var _ in Y.attributes)(I||(I={}))[_]=Y.attributes[_];Y.collapsed&&(!A||Gi(A.marker,Y)<0)&&(A=W)}else W.from>s&&y>W.from&&(y=W.from)}if(E)for(var v=0;v<E.length;v+=2)E[v+1]==y&&(S+=" "+E[v]);if(!A||A.from==s)for(var C=0;C<L.length;++C)Ro(t,0,L[C]);if(A&&(A.from||0)==s){if(Ro(t,(A.to==null?a+1:A.to)-s,A.marker,A.from==null),A.to==null)return;A.to==s&&(A=!1)}}if(s>=a)break;for(var d=Math.min(a,y);;){if(h){var B=s+h.length;if(!A){var Q=B>d?h.slice(0,d-s):h;t.addToken(t,Q,p?p+k:k,D,s+Q.length==y?S:"",b,I)}if(B>=d){h=h.slice(d-s),s=d;break}s=B,D=""}h=i.slice(o,o=r[u++]),p=Bo(r[u++],t.cm.options)}}}function Bl(e,t,r){this.line=t,this.rest=iu(t),this.size=this.rest?le(ie(this.rest))-r+1:1,this.node=this.text=null,this.hidden=Ct(e,t)}function wn(e,t,r){for(var n=[],i,o=t;o<r;o=i){var l=new Bl(e.doc,q(e.doc,o),o);i=o+l.size,n.push(l)}return n}var or=null;function pu(e){or?or.ops.push(e):e.ownsGroup=or={ops:[e],delayedCallbacks:[]}}function vu(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}function gu(e,t){var r=e.ownsGroup;if(!!r)try{vu(r)}finally{or=null,t(r)}}var Ar=null;function ke(e,t){var r=zi(e,t);if(!!r.length){var n=Array.prototype.slice.call(arguments,2),i;or?i=or.delayedCallbacks:Ar?i=Ar:(i=Ar=[],setTimeout(mu,0));for(var o=function(a){i.push(function(){return r[a].apply(null,n)})},l=0;l<r.length;++l)o(l)}}function mu(){var e=Ar;Ar=null;for(var t=0;t<e.length;++t)e[t]()}function Rl(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];o=="text"?bu(e,t):o=="gutter"?Kl(e,t,r,n):o=="class"?ji(e,t):o=="widget"&&wu(e,t,n)}t.changes=null}function qr(e){return e.node==e.text&&(e.node=G("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),re&&ce<8&&(e.node.style.zIndex=2)),e.node}function yu(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=qr(t);t.background=n.insertBefore(G("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function Ul(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):_l(e,t)}function bu(e,t){var r=t.text.className,n=Ul(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,ji(e,t)):r&&(t.text.className=r)}function ji(e,t){yu(e,t),t.line.wrapClass?qr(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function Kl(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=qr(t);t.gutterBackground=G("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var l=qr(t),a=t.gutter=G("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(a),l.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])&&(t.lineNumber=a.appendChild(G("div",Ui(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var u=e.display.gutterSpecs[s].className,h=o.hasOwnProperty(u)&&o[u];h&&a.appendChild(G("div",[h],"CodeMirror-gutter-elt","left: "+n.gutterLeft[u]+"px; width: "+n.gutterWidth[u]+"px"))}}}function wu(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,n.className=="CodeMirror-linewidget"&&t.node.removeChild(n);ql(e,t,r)}function ku(e,t,r,n){var i=Ul(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),ji(e,t),Kl(e,t,r,n),ql(e,t,n),t.node}function ql(e,t,r){if(Uo(e,t.line,t,r,!0),t.rest)for(var n=0;n<t.rest.length;n++)Uo(e,t.rest[n],t,r,!1)}function Uo(e,t,r,n,i){if(!!t.widgets)for(var o=qr(r),l=0,a=t.widgets;l<a.length;++l){var s=a[l],u=G("div",[s.node],"CodeMirror-linewidget");s.handleMouseEvents||u.setAttribute("cm-ignore-events","true"),xu(s,u,r,n),e.display.input.setUneditable(u),i&&s.above?o.insertBefore(u,r.gutter||r.text):o.appendChild(u),ke(s,"redraw")}}function xu(e,t,r,n){if(e.noHScroll){(r.alignable||(r.alignable=[])).push(t);var i=n.wrapperWidth;t.style.left=n.fixedPos+"px",e.coverGutter||(i-=n.gutterTotalWidth,t.style.paddingLeft=n.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-n.gutterTotalWidth+"px"))}function Vr(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!yt(document.body,e.node)){var r="position: relative;";e.coverGutter&&(r+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(r+="width: "+t.display.wrapper.clientWidth+"px;"),Ie(t.display.measure,G("div",[e.node],null,r))}return e.height=e.node.parentNode.offsetHeight}function lt(e,t){for(var r=Pi(t);r!=e.wrapper;r=r.parentNode)if(!r||r.nodeType==1&&r.getAttribute("cm-ignore-events")=="true"||r.parentNode==e.sizer&&r!=e.mover)return!0}function Kn(e){return e.lineSpace.offsetTop}function Zi(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Gl(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=Ie(e.measure,G("pre","x","CodeMirror-line-like")),r=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,n={left:parseInt(r.paddingLeft),right:parseInt(r.paddingRight)};return!isNaN(n.left)&&!isNaN(n.right)&&(e.cachedPaddingH=n),n}function Ve(e){return kl-e.display.nativeBarWidth}function Kt(e){return e.display.scroller.clientWidth-Ve(e)-e.display.barWidth}function Qi(e){return e.display.scroller.clientHeight-Ve(e)-e.display.barHeight}function Cu(e,t,r){var n=e.options.lineWrapping,i=n&&Kt(e);if(!t.measure.heights||n&&t.measure.width!=i){var o=t.measure.heights=[];if(n){t.measure.width=i;for(var l=t.text.firstChild.getClientRects(),a=0;a<l.length-1;a++){var s=l[a],u=l[a+1];Math.abs(s.bottom-u.bottom)>2&&o.push((s.bottom+u.top)/2-r.top)}}o.push(r.bottom-r.top)}}function Xl(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var i=0;i<e.rest.length;i++)if(le(e.rest[i])>r)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}function Su(e,t){t=Je(t);var r=le(t),n=e.display.externalMeasured=new Bl(e.doc,t,r);n.lineN=r;var i=n.built=_l(e,n);return n.text=i.pre,Ie(e.display.lineMeasure,i.pre),n}function Yl(e,t,r,n){return $e(e,dr(e,t),r,n)}function Ji(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Wt(e,t)];var r=e.display.externalMeasured;if(r&&t>=r.lineN&&t<r.lineN+r.size)return r}function dr(e,t){var r=le(t),n=Ji(e,r);n&&!n.text?n=null:n&&n.changes&&(Rl(e,n,r,eo(e)),e.curOp.forceUpdate=!0),n||(n=Su(e,t));var i=Xl(n,t,r);return{line:t,view:n,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function $e(e,t,r,n,i){t.before&&(r=-1);var o=r+(n||""),l;return t.cache.hasOwnProperty(o)?l=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(Cu(e,t.view,t.rect),t.hasHeights=!0),l=Tu(e,t,r,n),l.bogus||(t.cache[o]=l)),{left:l.left,right:l.right,top:i?l.rtop:l.top,bottom:i?l.rbottom:l.bottom}}var jl={left:0,right:0,top:0,bottom:0};function Zl(e,t,r){for(var n,i,o,l,a,s,u=0;u<e.length;u+=3)if(a=e[u],s=e[u+1],t<a?(i=0,o=1,l="left"):t<s?(i=t-a,o=i+1):(u==e.length-3||t==s&&e[u+3]>t)&&(o=s-a,i=o-1,t>=s&&(l="right")),i!=null){if(n=e[u+2],a==s&&r==(n.insertLeft?"left":"right")&&(l=r),r=="left"&&i==0)for(;u&&e[u-2]==e[u-3]&&e[u-1].insertLeft;)n=e[(u-=3)+2],l="left";if(r=="right"&&i==s-a)for(;u<e.length-3&&e[u+3]==e[u+4]&&!e[u+5].insertLeft;)n=e[(u+=3)+2],l="right";break}return{node:n,start:i,end:o,collapse:l,coverStart:a,coverEnd:s}}function Lu(e,t){var r=jl;if(t=="left")for(var n=0;n<e.length&&(r=e[n]).left==r.right;n++);else for(var i=e.length-1;i>=0&&(r=e[i]).left==r.right;i--);return r}function Tu(e,t,r,n){var i=Zl(t.map,r,n),o=i.node,l=i.start,a=i.end,s=i.collapse,u;if(o.nodeType==3){for(var h=0;h<4;h++){for(;l&&gi(t.line.text.charAt(i.coverStart+l));)--l;for(;i.coverStart+a<i.coverEnd&&gi(t.line.text.charAt(i.coverStart+a));)++a;if(re&&ce<9&&l==0&&a==i.coverEnd-i.coverStart?u=o.parentNode.getBoundingClientRect():u=Lu(It(o,l,a).getClientRects(),n),u.left||u.right||l==0)break;a=l,l=l-1,s="right"}re&&ce<11&&(u=Mu(e.display.measure,u))}else{l>0&&(s=n="right");var p;e.options.lineWrapping&&(p=o.getClientRects()).length>1?u=p[n=="right"?p.length-1:0]:u=o.getBoundingClientRect()}if(re&&ce<9&&!l&&(!u||!u.left&&!u.right)){var b=o.parentNode.getClientRects()[0];b?u={left:b.left,right:b.left+pr(e.display),top:b.top,bottom:b.bottom}:u=jl}for(var y=u.top-t.rect.top,k=u.bottom-t.rect.top,S=(y+k)/2,D=t.view.measure.heights,A=0;A<D.length-1&&!(S<D[A]);A++);var I=A?D[A-1]:0,L=D[A],E={left:(s=="right"?u.right:u.left)-t.rect.left,right:(s=="left"?u.left:u.right)-t.rect.left,top:I,bottom:L};return!u.left&&!u.right&&(E.bogus=!0),e.options.singleCursorHeightPerLine||(E.rtop=y,E.rbottom=k),E}function Mu(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Us(e))return t;var r=screen.logicalXDPI/screen.deviceXDPI,n=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*r,right:t.right*r,top:t.top*n,bottom:t.bottom*n}}function Ql(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 Jl(e){e.display.externalMeasure=null,mt(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)Ql(e.display.view[t])}function Gr(e){Jl(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function Vl(){return On&&In?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function $l(){return On&&In?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function Vi(e){var t=0;if(e.widgets)for(var r=0;r<e.widgets.length;++r)e.widgets[r].above&&(t+=Vr(e.widgets[r]));return t}function qn(e,t,r,n,i){if(!i){var o=Vi(t);r.top+=o,r.bottom+=o}if(n=="line")return r;n||(n="local");var l=ot(t);if(n=="local"?l+=Kn(e.display):l-=e.display.viewOffset,n=="page"||n=="window"){var a=e.display.lineSpace.getBoundingClientRect();l+=a.top+(n=="window"?0:$l());var s=a.left+(n=="window"?0:Vl());r.left+=s,r.right+=s}return r.top+=l,r.bottom+=l,r}function Ko(e,t,r){if(r=="div")return t;var n=t.left,i=t.top;if(r=="page")n-=Vl(),i-=$l();else if(r=="local"||!r){var o=e.display.sizer.getBoundingClientRect();n+=o.left,i+=o.top}var l=e.display.lineSpace.getBoundingClientRect();return{left:n-l.left,top:i-l.top}}function xi(e,t,r,n,i){return n||(n=q(e.doc,t.line)),qn(e,n,Yl(e,n,t.ch,i),r)}function qe(e,t,r,n,i,o){n=n||q(e.doc,t.line),i||(i=dr(e,n));function l(k,S){var D=$e(e,i,k,S?"right":"left",o);return S?D.left=D.right:D.right=D.left,qn(e,n,D,r)}var a=st(n,e.doc.direction),s=t.ch,u=t.sticky;if(s>=n.text.length?(s=n.text.length,u="before"):s<=0&&(s=0,u="after"),!a)return l(u=="before"?s-1:s,u=="before");function h(k,S,D){var A=a[S],I=A.level==1;return l(D?k-1:k,I!=D)}var p=Br(a,s,u),b=Lr,y=h(s,p,u=="before");return b!=null&&(y.other=h(s,b,u!="before")),y}function qo(e,t){var r=0;t=V(e.doc,t),e.options.lineWrapping||(r=pr(e.display)*t.ch);var n=q(e.doc,t.line),i=ot(n)+Kn(e.display);return{left:r,right:r,top:i,bottom:i+n.height}}function Ci(e,t,r,n,i){var o=F(e,t,r);return o.xRel=i,n&&(o.outside=n),o}function $i(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return Ci(n.first,0,null,-1,-1);var i=Et(n,r),o=n.first+n.size-1;if(i>o)return Ci(n.first+n.size-1,q(n,o).text.length,null,1,1);t<0&&(t=0);for(var l=q(n,i);;){var a=Du(e,l,i,t,r),s=ru(l,a.ch+(a.xRel>0||a.outside>0?1:0));if(!s)return a;var u=s.find(1);if(u.line==i)return u;l=q(n,i=u.line)}}function ea(e,t,r,n){n-=Vi(t);var i=t.text.length,o=_r(function(l){return $e(e,r,l-1).bottom<=n},i,0);return i=_r(function(l){return $e(e,r,l).top>n},o,i),{begin:o,end:i}}function ta(e,t,r,n){r||(r=dr(e,t));var i=qn(e,t,$e(e,r,n),"line").top;return ea(e,t,r,i)}function Si(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function Du(e,t,r,n,i){i-=ot(t);var o=dr(e,t),l=Vi(t),a=0,s=t.text.length,u=!0,h=st(t,e.doc.direction);if(h){var p=(e.options.lineWrapping?Fu:Au)(e,t,r,o,h,n,i);u=p.level!=1,a=u?p.from:p.to-1,s=u?p.to:p.from-1}var b=null,y=null,k=_r(function(P){var W=$e(e,o,P);return W.top+=l,W.bottom+=l,Si(W,n,i,!1)?(W.top<=i&&W.left<=n&&(b=P,y=W),!0):!1},a,s),S,D,A=!1;if(y){var I=n-y.left<y.right-n,L=I==u;k=b+(L?0:1),D=L?"after":"before",S=I?y.left:y.right}else{!u&&(k==s||k==a)&&k++,D=k==0?"after":k==t.text.length?"before":$e(e,o,k-(u?1:0)).bottom+l<=i==u?"after":"before";var E=qe(e,F(r,k,D),"line",t,o);S=E.left,A=i<E.top?-1:i>=E.bottom?1:0}return k=Cl(t.text,k,1),Ci(r,k,D,A,n-S)}function Au(e,t,r,n,i,o,l){var a=_r(function(p){var b=i[p],y=b.level!=1;return Si(qe(e,F(r,y?b.to:b.from,y?"before":"after"),"line",t,n),o,l,!0)},0,i.length-1),s=i[a];if(a>0){var u=s.level!=1,h=qe(e,F(r,u?s.from:s.to,u?"after":"before"),"line",t,n);Si(h,o,l,!0)&&h.top>l&&(s=i[a-1])}return s}function Fu(e,t,r,n,i,o,l){var a=ea(e,t,n,l),s=a.begin,u=a.end;/\s/.test(t.text.charAt(u-1))&&u--;for(var h=null,p=null,b=0;b<i.length;b++){var y=i[b];if(!(y.from>=u||y.to<=s)){var k=y.level!=1,S=$e(e,n,k?Math.min(u,y.to)-1:Math.max(s,y.from)).right,D=S<o?o-S+1e9:S-o;(!h||p>D)&&(h=y,p=D)}}return h||(h=i[i.length-1]),h.from<s&&(h={from:s,to:h.to,level:h.level}),h.to>u&&(h={from:h.from,to:u,level:h.level}),h}var Ft;function sr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Ft==null){Ft=G("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Ft.appendChild(document.createTextNode("x")),Ft.appendChild(G("br"));Ft.appendChild(document.createTextNode("x"))}Ie(e.measure,Ft);var r=Ft.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),mt(e.measure),r||1}function pr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=G("span","xxxxxxxxxx"),r=G("pre",[t],"CodeMirror-line-like");Ie(e.measure,r);var n=t.getBoundingClientRect(),i=(n.right-n.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function eo(e){for(var t=e.display,r={},n={},i=t.gutters.clientLeft,o=t.gutters.firstChild,l=0;o;o=o.nextSibling,++l){var a=e.display.gutterSpecs[l].className;r[a]=o.offsetLeft+o.clientLeft+i,n[a]=o.clientWidth}return{fixedPos:to(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function to(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function ra(e){var t=sr(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/pr(e.display)-3);return function(i){if(Ct(e.doc,i))return 0;var o=0;if(i.widgets)for(var l=0;l<i.widgets.length;l++)i.widgets[l].height&&(o+=i.widgets[l].height);return r?o+(Math.ceil(i.text.length/n)||1)*t:o+t}}function ro(e){var t=e.doc,r=ra(e);t.iter(function(n){var i=r(n);i!=n.height&&Qe(n,i)})}function Pt(e,t,r,n){var i=e.display;if(!r&&Pi(t).getAttribute("cm-not-content")=="true")return null;var o,l,a=i.lineSpace.getBoundingClientRect();try{o=t.clientX-a.left,l=t.clientY-a.top}catch{return null}var s=$i(e,o,l),u;if(n&&s.xRel==1&&(u=q(e.doc,s.line).text).length==s.ch){var h=Pe(u,u.length,e.options.tabSize)-u.length;s=F(s.line,Math.max(0,Math.round((o-Gl(e.display).left)/pr(e.display))-h))}return s}function Wt(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var r=e.display.view,n=0;n<r.length;n++)if(t-=r[n].size,t<0)return n}function Fe(e,t,r,n){t==null&&(t=e.doc.first),r==null&&(r=e.doc.first+e.doc.size),n||(n=0);var i=e.display;if(n&&r<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)it&&Xi(e.doc,t)<i.viewTo&&vt(e);else if(r<=i.viewFrom)it&&Wl(e.doc,r+n)>i.viewFrom?vt(e):(i.viewFrom+=n,i.viewTo+=n);else if(t<=i.viewFrom&&r>=i.viewTo)vt(e);else if(t<=i.viewFrom){var o=dn(e,r,r+n,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=n):vt(e)}else if(r>=i.viewTo){var l=dn(e,t,t,-1);l?(i.view=i.view.slice(0,l.index),i.viewTo=l.lineN):vt(e)}else{var a=dn(e,t,t,-1),s=dn(e,r,r+n,1);a&&s?(i.view=i.view.slice(0,a.index).concat(wn(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=n):vt(e)}var u=i.externalMeasured;u&&(r<u.lineN?u.lineN+=n:t<u.lineN+u.size&&(i.externalMeasured=null))}function St(e,t,r){e.curOp.viewChanged=!0;var n=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(n.externalMeasured=null),!(t<n.viewFrom||t>=n.viewTo)){var o=n.view[Wt(e,t)];if(o.node!=null){var l=o.changes||(o.changes=[]);Ce(l,r)==-1&&l.push(r)}}}function vt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function dn(e,t,r,n){var i=Wt(e,t),o,l=e.display.view;if(!it||r==e.doc.first+e.doc.size)return{index:i,lineN:r};for(var a=e.display.viewFrom,s=0;s<i;s++)a+=l[s].size;if(a!=t){if(n>0){if(i==l.length-1)return null;o=a+l[i].size-t,i++}else o=a-t;t+=o,r+=o}for(;Xi(e.doc,r)!=r;){if(i==(n<0?0:l.length-1))return null;r+=n*l[i-(n<0?1:0)].size,i+=n}return{index:i,lineN:r}}function Eu(e,t,r){var n=e.display,i=n.view;i.length==0||t>=n.viewTo||r<=n.viewFrom?(n.view=wn(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=wn(e,t,n.viewFrom).concat(n.view):n.viewFrom<t&&(n.view=n.view.slice(Wt(e,t))),n.viewFrom=t,n.viewTo<r?n.view=n.view.concat(wn(e,n.viewTo,r)):n.viewTo>r&&(n.view=n.view.slice(0,Wt(e,r)))),n.viewTo=r}function Go(e){for(var t=e.display.view,r=0,n=0;n<t.length;n++){var i=t[n];!i.hidden&&(!i.node||i.changes)&&++r}return r}function Fr(e){e.display.input.showSelection(e.display.input.prepareSelection())}function na(e,t){t===void 0&&(t=!0);for(var r=e.doc,n={},i=n.cursors=document.createDocumentFragment(),o=n.selection=document.createDocumentFragment(),l=0;l<r.sel.ranges.length;l++)if(!(!t&&l==r.sel.primIndex)){var a=r.sel.ranges[l];if(!(a.from().line>=e.display.viewTo||a.to().line<e.display.viewFrom)){var s=a.empty();(s||e.options.showCursorWhenSelecting)&&ia(e,a.head,i),s||Nu(e,a,o)}}return n}function ia(e,t,r){var n=qe(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=r.appendChild(G("div","\xA0","CodeMirror-cursor"));if(i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=Math.max(0,n.bottom-n.top)*e.options.cursorHeight+"px",n.other){var o=r.appendChild(G("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));o.style.display="",o.style.left=n.other.left+"px",o.style.top=n.other.top+"px",o.style.height=(n.other.bottom-n.other.top)*.85+"px"}}function pn(e,t){return e.top-t.top||e.left-t.left}function Nu(e,t,r){var n=e.display,i=e.doc,o=document.createDocumentFragment(),l=Gl(e.display),a=l.left,s=Math.max(n.sizerWidth,Kt(e)-n.sizer.offsetLeft)-l.right,u=i.direction=="ltr";function h(L,E,P,W){E<0&&(E=0),E=Math.round(E),W=Math.round(W),o.appendChild(G("div",null,"CodeMirror-selected","position: absolute; left: "+L+`px;
top: `+E+"px; width: "+(P==null?s-L:P)+`px;
height: `+(W-E)+"px"))}function p(L,E,P){var W=q(i,L),Y=W.text.length,_,v;function C(Q,j){return xi(e,F(L,Q),"div",W,j)}function d(Q,j,w){var T=ta(e,W,null,Q),x=j=="ltr"==(w=="after")?"left":"right",K=w=="after"?T.begin:T.end-(/\s/.test(W.text.charAt(T.end-1))?2:1);return C(K,x)[x]}var B=st(W,i.direction);return Hs(B,E||0,P==null?Y:P,function(Q,j,w,T){var x=w=="ltr",K=C(Q,x?"left":"right"),m=C(j-1,x?"right":"left"),c=E==null&&Q==0,z=P==null&&j==Y,H=T==0,O=!B||T==B.length-1;if(m.top-K.top<=3){var U=(u?c:z)&&H,se=(u?z:c)&&O,ge=U?a:(x?K:m).left,$=se?s:(x?m:K).right;h(ge,K.top,$-ge,K.bottom)}else{var ee,oe,he,ze;x?(ee=u&&c&&H?a:K.left,oe=u?s:d(Q,w,"before"),he=u?a:d(j,w,"after"),ze=u&&z&&O?s:m.right):(ee=u?d(Q,w,"before"):a,oe=!u&&c&&H?s:K.right,he=!u&&z&&O?a:m.left,ze=u?d(j,w,"after"):s),h(ee,K.top,oe-ee,K.bottom),K.bottom<m.top&&h(a,K.bottom,null,m.top),h(he,m.top,ze-he,m.bottom)}(!_||pn(K,_)<0)&&(_=K),pn(m,_)<0&&(_=m),(!v||pn(K,v)<0)&&(v=K),pn(m,v)<0&&(v=m)}),{start:_,end:v}}var b=t.from(),y=t.to();if(b.line==y.line)p(b.line,b.ch,y.ch);else{var k=q(i,b.line),S=q(i,y.line),D=Je(k)==Je(S),A=p(b.line,b.ch,D?k.text.length+1:null).end,I=p(y.line,D?0:null,y.ch).start;D&&(A.top<I.top-2?(h(A.right,A.top,null,A.bottom),h(a,I.top,I.left,I.bottom)):h(A.right,A.top,I.left-A.right,A.bottom)),A.bottom<I.top&&h(a,A.bottom,null,I.top)}r.appendChild(o)}function no(e){if(!!e.state.focused){var t=e.display;clearInterval(t.blinker);var r=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){return t.cursorDiv.style.visibility=(r=!r)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function oa(e){e.state.focused||(e.display.input.focus(),io(e))}function la(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,$r(e))},100)}function io(e,t){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(de(e,"focus",e,t),e.state.focused=!0,Ut(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),Le&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),no(e))}function $r(e,t){e.state.delayingBlurEvent||(e.state.focused&&(de(e,"blur",e,t),e.state.focused=!1,Rt(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Gn(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n<t.view.length;n++){var i=t.view[n],o=e.options.lineWrapping,l=void 0,a=0;if(!i.hidden){if(re&&ce<8){var s=i.node.offsetTop+i.node.offsetHeight;l=s-r,r=s}else{var u=i.node.getBoundingClientRect();l=u.bottom-u.top,!o&&i.text.firstChild&&(a=i.text.firstChild.getBoundingClientRect().right-u.left-1)}var h=i.line.height-l;if((h>.005||h<-.005)&&(Qe(i.line,l),Xo(i.line),i.rest))for(var p=0;p<i.rest.length;p++)Xo(i.rest[p]);if(a>e.display.sizerWidth){var b=Math.ceil(a/pr(e.display));b>e.display.maxLineLength&&(e.display.maxLineLength=b,e.display.maxLine=i.line,e.display.maxLineChanged=!0)}}}}function Xo(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var r=e.widgets[t],n=r.node.parentNode;n&&(r.height=n.offsetHeight)}}function oo(e,t,r){var n=r&&r.top!=null?Math.max(0,r.top):e.scroller.scrollTop;n=Math.floor(n-Kn(e));var i=r&&r.bottom!=null?r.bottom:n+e.wrapper.clientHeight,o=Et(t,n),l=Et(t,i);if(r&&r.ensure){var a=r.ensure.from.line,s=r.ensure.to.line;a<o?(o=a,l=Et(t,ot(q(t,a))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=l&&(o=Et(t,ot(q(t,s))-e.wrapper.clientHeight),l=s)}return{from:o,to:Math.max(l,o+1)}}function Ou(e,t){if(!ye(e,"scrollCursorIntoView")){var r=e.display,n=r.sizer.getBoundingClientRect(),i=null;if(t.top+n.top<0?i=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),i!=null&&!As){var o=G("div","\u200B",null,`position: absolute;
top: `+(t.top-r.viewOffset-Kn(e.display))+`px;
height: `+(t.bottom-t.top+Ve(e)+r.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function Iu(e,t,r,n){n==null&&(n=0);var i;!e.options.lineWrapping&&t==r&&(t=t.ch?F(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?F(t.line,t.ch+1,"before"):t);for(var o=0;o<5;o++){var l=!1,a=qe(e,t),s=!r||r==t?a:qe(e,r);i={left:Math.min(a.left,s.left),top:Math.min(a.top,s.top)-n,right:Math.max(a.left,s.left),bottom:Math.max(a.bottom,s.bottom)+n};var u=lo(e,i),h=e.doc.scrollTop,p=e.doc.scrollLeft;if(u.scrollTop!=null&&(en(e,u.scrollTop),Math.abs(e.doc.scrollTop-h)>1&&(l=!0)),u.scrollLeft!=null&&(qt(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-p)>1&&(l=!0)),!l)break}return i}function Hu(e,t){var r=lo(e,t);r.scrollTop!=null&&en(e,r.scrollTop),r.scrollLeft!=null&&qt(e,r.scrollLeft)}function lo(e,t){var r=e.display,n=sr(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,o=Qi(e),l={};t.bottom-t.top>o&&(t.bottom=t.top+o);var a=e.doc.height+Zi(r),s=t.top<n,u=t.bottom>a-n;if(t.top<i)l.scrollTop=s?0:t.top;else if(t.bottom>i+o){var h=Math.min(t.top,(u?a:t.bottom)-o);h!=i&&(l.scrollTop=h)}var p=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft,b=Kt(e)-(e.options.fixedGutter?r.gutters.offsetWidth:0),y=t.right-t.left>b;return y&&(t.right=t.left+b),t.left<10?l.scrollLeft=0:t.left<p?l.scrollLeft=Math.max(0,t.left-(y?0:10)):t.right>b+p-3&&(l.scrollLeft=t.right+(y?0:10)-b),l}function ao(e,t){t!=null&&(Xn(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function vr(e){Xn(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Er(e,t,r){(t!=null||r!=null)&&Xn(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function zu(e,t){Xn(e),e.curOp.scrollToPos=t}function Xn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=qo(e,t.from),n=qo(e,t.to);aa(e,r,n,t.margin)}}function aa(e,t,r,n){var i=lo(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});Er(e,i.scrollLeft,i.scrollTop)}function en(e,t){Math.abs(e.doc.scrollTop-t)<2||(gt||Li(e,{top:t}),sa(e,t,!0),gt&&Li(e),rn(e,100))}function sa(e,t,r){t=Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t),!(e.display.scroller.scrollTop==t&&!r)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function qt(e,t,r,n){t=Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth),!((r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)&&(e.doc.scrollLeft=t,ha(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Xr(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+Zi(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?r:0,docHeight:n,scrollHeight:n+Ve(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var Gt=function(e,t,r){this.cm=r;var n=this.vert=G("div",[G("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=G("div",[G("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");n.tabIndex=i.tabIndex=-1,e(n),e(i),X(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),X(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,re&&ce<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Gt.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var i=e.viewHeight-(t?n:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(r?n:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}};Gt.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")};Gt.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")};Gt.prototype.zeroWidthHack=function(){var e=Ye&&!Ds?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new bt,this.disableVert=new bt};Gt.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function n(){var i=e.getBoundingClientRect(),o=r=="vert"?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1);o!=e?e.style.pointerEvents="none":t.set(1e3,n)}t.set(1e3,n)};Gt.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var tn=function(){};tn.prototype.update=function(){return{bottom:0,right:0}};tn.prototype.setScrollLeft=function(){};tn.prototype.setScrollTop=function(){};tn.prototype.clear=function(){};function ur(e,t){t||(t=Xr(e));var r=e.display.barWidth,n=e.display.barHeight;Yo(e,t);for(var i=0;i<4&&r!=e.display.barWidth||n!=e.display.barHeight;i++)r!=e.display.barWidth&&e.options.lineWrapping&&Gn(e),Yo(e,Xr(e)),r=e.display.barWidth,n=e.display.barHeight}function Yo(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var ua={native:Gt,null:tn};function fa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&Rt(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new ua[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),X(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?qt(e,t):en(e,t)},e),e.display.scrollbars.addClass&&Ut(e.display.wrapper,e.display.scrollbars.addClass)}var Pu=0;function Xt(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:++Pu},pu(e.curOp)}function Yt(e){var t=e.curOp;t&&gu(t,function(r){for(var n=0;n<r.ops.length;n++)r.ops[n].cm.curOp=null;Wu(r)})}function Wu(e){for(var t=e.ops,r=0;r<t.length;r++)_u(t[r]);for(var n=0;n<t.length;n++)Bu(t[n]);for(var i=0;i<t.length;i++)Ru(t[i]);for(var o=0;o<t.length;o++)Uu(t[o]);for(var l=0;l<t.length;l++)Ku(t[l])}function _u(e){var t=e.cm,r=t.display;Gu(t),e.updateMaxLine&&Yi(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<r.viewFrom||e.scrollToPos.to.line>=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Yn(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Bu(e){e.updatedDisplay=e.mustUpdate&&so(e.cm,e.update)}function Ru(e){var t=e.cm,r=t.display;e.updatedDisplay&&Gn(t),e.barMeasure=Xr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Yl(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+Ve(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Kt(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function Uu(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&qt(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var r=e.focus&&e.focus==at();e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,r),(e.updatedDisplay||e.startHeight!=t.doc.height)&&ur(t,e.barMeasure),e.updatedDisplay&&fo(t,e.barMeasure),e.selectionChanged&&no(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),r&&oa(e.cm)}function Ku(e){var t=e.cm,r=t.display,n=t.doc;if(e.updatedDisplay&&ca(t,e.update),r.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(r.wheelStartX=r.wheelStartY=null),e.scrollTop!=null&&sa(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&qt(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=Iu(t,V(n,e.scrollToPos.from),V(n,e.scrollToPos.to),e.scrollToPos.margin);Ou(t,i)}var o=e.maybeHiddenMarkers,l=e.maybeUnhiddenMarkers;if(o)for(var a=0;a<o.length;++a)o[a].lines.length||de(o[a],"hide");if(l)for(var s=0;s<l.length;++s)l[s].lines.length&&de(l[s],"unhide");r.wrapper.offsetHeight&&(n.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&de(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function Ee(e,t){if(e.curOp)return t();Xt(e);try{return t()}finally{Yt(e)}}function be(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Xt(e);try{return t.apply(e,arguments)}finally{Yt(e)}}}function Se(e){return function(){if(this.curOp)return e.apply(this,arguments);Xt(this);try{return e.apply(this,arguments)}finally{Yt(this)}}}function me(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Xt(t);try{return e.apply(this,arguments)}finally{Yt(t)}}}function rn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,Hn(qu,e))}function qu(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var r=+new Date+e.options.workTime,n=Jr(e,t.highlightFrontier),i=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(n.line>=e.display.viewFrom){var l=o.styles,a=o.text.length>e.options.maxHighlightLength?zt(t.mode,n.state):null,s=Fl(e,o,n,!0);a&&(n.state=a),o.styles=s.styles;var u=o.styleClasses,h=s.classes;h?o.styleClasses=h:u&&(o.styleClasses=null);for(var p=!l||l.length!=o.styles.length||u!=h&&(!u||!h||u.bgClass!=h.bgClass||u.textClass!=h.textClass),b=0;!p&&b<l.length;++b)p=l[b]!=o.styles[b];p&&i.push(n.line),o.stateAfter=n.save(),n.nextLine()}else o.text.length<=e.options.maxHighlightLength&&Ki(e,o.text,n),o.stateAfter=n.line%5==0?n.save():null,n.nextLine();if(+new Date>r)return rn(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),i.length&&Ee(e,function(){for(var o=0;o<i.length;o++)St(e,i[o],"text")})}}var Yn=function(e,t,r){var n=e.display;this.viewport=t,this.visible=oo(n,e.doc,t),this.editorIsHidden=!n.wrapper.offsetWidth,this.wrapperHeight=n.wrapper.clientHeight,this.wrapperWidth=n.wrapper.clientWidth,this.oldDisplayWidth=Kt(e),this.force=r,this.dims=eo(e),this.events=[]};Yn.prototype.signal=function(e,t){We(e,t)&&this.events.push(arguments)};Yn.prototype.finish=function(){for(var e=this,t=0;t<this.events.length;t++)de.apply(null,e.events[t])};function Gu(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Ve(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Ve(e)+"px",t.scrollbarsClipped=!0)}function Xu(e){if(e.hasFocus())return null;var t=at();if(!t||!yt(e.display.lineDiv,t))return null;var r={activeElt:t};if(window.getSelection){var n=window.getSelection();n.anchorNode&&n.extend&&yt(e.display.lineDiv,n.anchorNode)&&(r.anchorNode=n.anchorNode,r.anchorOffset=n.anchorOffset,r.focusNode=n.focusNode,r.focusOffset=n.focusOffset)}return r}function Yu(e){if(!(!e||!e.activeElt||e.activeElt==at())&&(e.activeElt.focus(),e.anchorNode&&yt(document.body,e.anchorNode)&&yt(document.body,e.focusNode))){var t=window.getSelection(),r=document.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),t.removeAllRanges(),t.addRange(r),t.extend(e.focusNode,e.focusOffset)}}function so(e,t){var r=e.display,n=e.doc;if(t.editorIsHidden)return vt(e),!1;if(!t.force&&t.visible.from>=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&Go(e)==0)return!1;da(e)&&(vt(e),t.dims=eo(e));var i=n.first+n.size,o=Math.max(t.visible.from-e.options.viewportMargin,n.first),l=Math.min(i,t.visible.to+e.options.viewportMargin);r.viewFrom<o&&o-r.viewFrom<20&&(o=Math.max(n.first,r.viewFrom)),r.viewTo>l&&r.viewTo-l<20&&(l=Math.min(i,r.viewTo)),it&&(o=Xi(e.doc,o),l=Wl(e.doc,l));var a=o!=r.viewFrom||l!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Eu(e,o,l),r.viewOffset=ot(q(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var s=Go(e);if(!a&&s==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var u=Xu(e);return s>4&&(r.lineDiv.style.display="none"),ju(e,r.updateLineNumbers,t.dims),s>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,Yu(u),mt(r.cursorDiv),mt(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,a&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,rn(e,400)),r.updateLineNumbers=null,!0}function ca(e,t){for(var r=t.viewport,n=!0;!((!n||!e.options.lineWrapping||t.oldDisplayWidth==Kt(e))&&(r&&r.top!=null&&(r={top:Math.min(e.doc.height+Zi(e.display)-Qi(e),r.top)}),t.visible=oo(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)||!so(e,t));n=!1){Gn(e);var i=Xr(e);Fr(e),ur(e,i),fo(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 Li(e,t){var r=new Yn(e,t);if(so(e,r)){Gn(e),ca(e,r);var n=Xr(e);Fr(e),ur(e,n),fo(e,n),r.finish()}}function ju(e,t,r){var n=e.display,i=e.options.lineNumbers,o=n.lineDiv,l=o.firstChild;function a(k){var S=k.nextSibling;return Le&&Ye&&e.display.currentWheelTarget==k?k.style.display="none":k.parentNode.removeChild(k),S}for(var s=n.view,u=n.viewFrom,h=0;h<s.length;h++){var p=s[h];if(!p.hidden)if(!p.node||p.node.parentNode!=o){var b=ku(e,p,u,r);o.insertBefore(b,l)}else{for(;l!=p.node;)l=a(l);var y=i&&t!=null&&t<=u&&p.lineNumber;p.changes&&(Ce(p.changes,"gutter")>-1&&(y=!1),Rl(e,p,u,r)),y&&(mt(p.lineNumber),p.lineNumber.appendChild(document.createTextNode(Ui(e.options,u)))),l=p.node.nextSibling}u+=p.size}for(;l;)l=a(l)}function uo(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px"}function fo(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ve(e)+"px"}function ha(e){var t=e.display,r=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var n=to(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=n+"px",l=0;l<r.length;l++)if(!r[l].hidden){e.options.fixedGutter&&(r[l].gutter&&(r[l].gutter.style.left=o),r[l].gutterBackground&&(r[l].gutterBackground.style.left=o));var a=r[l].alignable;if(a)for(var s=0;s<a.length;s++)a[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=n+i+"px")}}function da(e){if(!e.options.lineNumbers)return!1;var t=e.doc,r=Ui(e.options,t.first+t.size-1),n=e.display;if(r.length!=n.lineNumChars){var i=n.measure.appendChild(G("div",[G("div",r)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,l=i.offsetWidth-o;return n.lineGutter.style.width="",n.lineNumInnerWidth=Math.max(o,n.lineGutter.offsetWidth-l)+1,n.lineNumWidth=n.lineNumInnerWidth+l,n.lineNumChars=n.lineNumInnerWidth?r.length:-1,n.lineGutter.style.width=n.lineNumWidth+"px",uo(e.display),!0}return!1}function Ti(e,t){for(var r=[],n=!1,i=0;i<e.length;i++){var o=e[i],l=null;if(typeof o!="string"&&(l=o.style,o=o.className),o=="CodeMirror-linenumbers")if(t)n=!0;else continue;r.push({className:o,style:l})}return t&&!n&&r.push({className:"CodeMirror-linenumbers",style:null}),r}function pa(e){var t=e.gutters,r=e.gutterSpecs;mt(t),e.lineGutter=null;for(var n=0;n<r.length;++n){var i=r[n],o=i.className,l=i.style,a=t.appendChild(G("div",null,"CodeMirror-gutter "+o));l&&(a.style.cssText=l),o=="CodeMirror-linenumbers"&&(e.lineGutter=a,a.style.width=(e.lineNumWidth||1)+"px")}t.style.display=r.length?"":"none",uo(e)}function wr(e){pa(e.display),Fe(e),ha(e)}function Zu(e,t,r,n){var i=this;this.input=r,i.scrollbarFiller=G("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=G("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=nr("div",null,"CodeMirror-code"),i.selectionDiv=G("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=G("div",null,"CodeMirror-cursors"),i.measure=G("div",null,"CodeMirror-measure"),i.lineMeasure=G("div",null,"CodeMirror-measure"),i.lineSpace=nr("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=nr("div",[i.lineSpace],"CodeMirror-lines");i.mover=G("div",[o],null,"position: relative"),i.sizer=G("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=G("div",null,null,"position: absolute; height: "+kl+"px; width: 1px;"),i.gutters=G("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=G("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=G("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),re&&ce<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!Le&&!(gt&&zr)&&(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=Ti(n.gutters,n.lineNumbers),pa(i),r.init(i)}var vn=0,Ne=null;re?Ne=-.53:gt?Ne=15:On?Ne=-.7:wl&&(Ne=-1/3);function va(e){var t=e.wheelDeltaX,r=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),r==null&&e.detail&&e.axis==e.VERTICAL_AXIS?r=e.detail:r==null&&(r=e.wheelDelta),{x:t,y:r}}function Qu(e){var t=va(e);return t.x*=Ne,t.y*=Ne,t}function jo(e,t){var r=va(t),n=r.x,i=r.y,o=e.display,l=o.scroller,a=l.scrollWidth>l.clientWidth,s=l.scrollHeight>l.clientHeight;if(!!(n&&a||i&&s)){if(i&&Ye&&Le){e:for(var u=t.target,h=o.view;u!=l;u=u.parentNode)for(var p=0;p<h.length;p++)if(h[p].node==u){e.display.currentWheelTarget=u;break e}}if(n&&!gt&&!Xe&&Ne!=null){i&&s&&en(e,Math.max(0,l.scrollTop+i*Ne)),qt(e,Math.max(0,l.scrollLeft+n*Ne)),(!i||i&&s)&&Ae(t),o.wheelStartX=null;return}if(i&&Ne!=null){var b=i*Ne,y=e.doc.scrollTop,k=y+o.wrapper.clientHeight;b<0?y=Math.max(0,y+b-50):k=Math.min(e.doc.height,k+b+50),Li(e,{top:y,bottom:k})}vn<20&&(o.wheelStartX==null?(o.wheelStartX=l.scrollLeft,o.wheelStartY=l.scrollTop,o.wheelDX=n,o.wheelDY=i,setTimeout(function(){if(o.wheelStartX!=null){var S=l.scrollLeft-o.wheelStartX,D=l.scrollTop-o.wheelStartY,A=D&&o.wheelDY&&D/o.wheelDY||S&&o.wheelDX&&S/o.wheelDX;o.wheelStartX=o.wheelStartY=null,A&&(Ne=(Ne*vn+A)/(vn+1),++vn)}},200)):(o.wheelDX+=n,o.wheelDY+=i))}}var He=function(e,t){this.ranges=e,this.primIndex=t};He.prototype.primary=function(){return this.ranges[this.primIndex]};He.prototype.equals=function(e){var t=this;if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var r=0;r<this.ranges.length;r++){var n=t.ranges[r],i=e.ranges[r];if(!yi(n.anchor,i.anchor)||!yi(n.head,i.head))return!1}return!0};He.prototype.deepCopy=function(){for(var e=this,t=[],r=0;r<this.ranges.length;r++)t[r]=new ne(bi(e.ranges[r].anchor),bi(e.ranges[r].head));return new He(t,this.primIndex)};He.prototype.somethingSelected=function(){for(var e=this,t=0;t<this.ranges.length;t++)if(!e.ranges[t].empty())return!0;return!1};He.prototype.contains=function(e,t){var r=this;t||(t=e);for(var n=0;n<this.ranges.length;n++){var i=r.ranges[n];if(Z(t,i.from())>=0&&Z(e,i.to())<=0)return n}return-1};var ne=function(e,t){this.anchor=e,this.head=t};ne.prototype.from=function(){return _n(this.anchor,this.head)};ne.prototype.to=function(){return Wn(this.anchor,this.head)};ne.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ge(e,t,r){var n=e&&e.options.selectionsMayTouch,i=t[r];t.sort(function(b,y){return Z(b.from(),y.from())}),r=Ce(t,i);for(var o=1;o<t.length;o++){var l=t[o],a=t[o-1],s=Z(a.to(),l.from());if(n&&!l.empty()?s>0:s>=0){var u=_n(a.from(),l.from()),h=Wn(a.to(),l.to()),p=a.empty()?l.from()==l.head:a.from()==a.head;o<=r&&--r,t.splice(--o,2,new ne(p?h:u,p?u:h))}}return new He(t,r)}function wt(e,t){return new He([new ne(e,t||e)],0)}function kt(e){return e.text?F(e.from.line+e.text.length-1,ie(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Zo(e,t){if(Z(e,t.from)<0)return e;if(Z(e,t.to)<=0)return kt(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=kt(t).ch-t.to.ch),F(r,n)}function co(e,t){for(var r=[],n=0;n<e.sel.ranges.length;n++){var i=e.sel.ranges[n];r.push(new ne(Zo(i.anchor,t),Zo(i.head,t)))}return Ge(e.cm,r,e.sel.primIndex)}function Qo(e,t,r){return e.line==t.line?F(r.line,e.ch-t.ch+r.ch):F(r.line+(e.line-t.line),e.ch)}function Ju(e,t,r){for(var n=[],i=F(e.first,0),o=i,l=0;l<t.length;l++){var a=t[l],s=Qo(a.from,i,o),u=Qo(kt(a),i,o);if(i=a.to,o=u,r=="around"){var h=e.sel.ranges[l],p=Z(h.head,h.anchor)<0;n[l]=new ne(p?u:s,p?s:u)}else n[l]=new ne(s,s)}return new He(n,e.sel.primIndex)}function Mi(e){e.doc.mode=Bi(e.options,e.doc.modeOption),Tr(e)}function Tr(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,rn(e,100),e.state.modeGen++,e.curOp&&Fe(e)}function ga(e,t){return t.from.ch==0&&t.to.ch==0&&ie(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function ho(e,t,r,n){function i(I){return r?r[I]:null}function o(I,L,E){ou(I,L,E,n),ke(I,"change",I,t)}function l(I,L){for(var E=[],P=I;P<L;++P)E.push(new ar(u[P],i(P),n));return E}var a=t.from,s=t.to,u=t.text,h=q(e,a.line),p=q(e,s.line),b=ie(u),y=i(u.length-1),k=s.line-a.line;if(t.full)e.insert(0,l(0,u.length)),e.remove(u.length,e.size-u.length);else if(ga(e,t)){var S=l(0,u.length-1);o(p,p.text,y),k&&e.remove(a.line,k),S.length&&e.insert(a.line,S)}else if(h==p)if(u.length==1)o(h,h.text.slice(0,a.ch)+b+h.text.slice(s.ch),y);else{var D=l(1,u.length-1);D.push(new ar(b+h.text.slice(s.ch),y,n)),o(h,h.text.slice(0,a.ch)+u[0],i(0)),e.insert(a.line+1,D)}else if(u.length==1)o(h,h.text.slice(0,a.ch)+u[0]+p.text.slice(s.ch),i(0)),e.remove(a.line+1,k);else{o(h,h.text.slice(0,a.ch)+u[0],i(0)),o(p,b+p.text.slice(s.ch),y);var A=l(1,u.length-1);k>1&&e.remove(a.line+1,k-1),e.insert(a.line+1,A)}ke(e,"change",e,t)}function _t(e,t,r){function n(i,o,l){if(i.linked)for(var a=0;a<i.linked.length;++a){var s=i.linked[a];if(s.doc!=o){var u=l&&s.sharedHist;r&&!u||(t(s.doc,u),n(s.doc,i,u))}}}n(e,null,!0)}function ma(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,ro(e),Mi(e),ya(e),e.options.lineWrapping||Yi(e),e.options.mode=t.modeOption,Fe(e)}function ya(e){(e.doc.direction=="rtl"?Ut:Rt)(e.display.lineDiv,"CodeMirror-rtl")}function Vu(e){Ee(e,function(){ya(e),Fe(e)})}function kn(e){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e||1}function Di(e,t){var r={from:bi(t.from),to:kt(t),text:Ot(e,t.from,t.to)};return Jo(e,r,t.from.line,t.to.line+1),_t(e,function(n){return Jo(n,r,t.from.line,t.to.line+1)},!0),r}function ba(e){for(;e.length;){var t=ie(e);if(t.ranges)e.pop();else break}}function $u(e,t){if(t)return ba(e.done),ie(e.done);if(e.done.length&&!ie(e.done).ranges)return ie(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ie(e.done)}function wa(e,t,r,n){var i=e.history;i.undone.length=0;var o=+new Date,l,a;if((i.lastOp==n||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(l=$u(i,i.lastOp==n)))a=ie(l.changes),Z(t.from,t.to)==0&&Z(t.from,a.to)==0?a.to=kt(t):l.changes.push(Di(e,t));else{var s=ie(i.done);for((!s||!s.ranges)&&Dn(e.sel,i.done),l={changes:[Di(e,t)],generation:i.generation},i.done.push(l);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(r),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=o,i.lastOp=i.lastSelOp=n,i.lastOrigin=i.lastSelOrigin=t.origin,a||de(e,"historyAdded")}function ef(e,t,r,n){var i=t.charAt(0);return i=="*"||i=="+"&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function tf(e,t,r,n){var i=e.history,o=n&&n.origin;r==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||ef(e,o,ie(i.done),t))?i.done[i.done.length-1]=t:Dn(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=r,n&&n.clearRedo!==!1&&ba(i.undone)}function Dn(e,t){var r=ie(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Jo(e,t,r,n){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(l){l.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=l.markedSpans),++o})}function rf(e){if(!e)return null;for(var t,r=0;r<e.length;++r)e[r].marker.explicitlyCleared?t||(t=e.slice(0,r)):t&&t.push(e[r]);return t?t.length?t:null:e}function nf(e,t){var r=t["spans_"+e.id];if(!r)return null;for(var n=[],i=0;i<t.text.length;++i)n.push(rf(r[i]));return n}function Vo(e,t){var r=nf(e,t),n=wi(e,t);if(!r)return n;if(!n)return r;for(var i=0;i<r.length;++i){var o=r[i],l=n[i];if(o&&l){e:for(var a=0;a<l.length;++a){for(var s=l[a],u=0;u<o.length;++u)if(o[u].marker==s.marker)continue e;o.push(s)}}else l&&(r[i]=l)}return r}function Jt(e,t,r){for(var n=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges){n.push(r?He.prototype.deepCopy.call(o):o);continue}var l=o.changes,a=[];n.push({changes:a});for(var s=0;s<l.length;++s){var u=l[s],h=void 0;if(a.push({from:u.from,to:u.to,text:u.text}),t)for(var p in u)(h=p.match(/^spans_(\d+)$/))&&Ce(t,Number(h[1]))>-1&&(ie(a)[p]=u[p],delete u[p])}}return n}function po(e,t,r,n){if(n){var i=e.anchor;if(r){var o=Z(t,i)<0;o!=Z(r,i)<0?(i=t,t=r):o!=Z(t,r)<0&&(t=r)}return new ne(i,t)}else return new ne(r||t,t)}function jn(e,t,r,n,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),xe(e,new He([po(e.sel.primary(),t,r,i)],0),n)}function $o(e,t,r){for(var n=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)n[o]=po(e.sel.ranges[o],t[o],null,i);var l=Ge(e.cm,n,e.sel.primIndex);xe(e,l,r)}function vo(e,t,r,n){var i=e.sel.ranges.slice(0);i[t]=r,xe(e,Ge(e.cm,i,e.sel.primIndex),n)}function el(e,t,r,n){xe(e,wt(t,r),n)}function of(e,t,r){var n={ranges:t.ranges,update:function(i){var o=this;this.ranges=[];for(var l=0;l<i.length;l++)o.ranges[l]=new ne(V(e,i[l].anchor),V(e,i[l].head))},origin:r&&r.origin};return de(e,"beforeSelectionChange",e,n),e.cm&&de(e.cm,"beforeSelectionChange",e.cm,n),n.ranges!=t.ranges?Ge(e.cm,n.ranges,n.ranges.length-1):t}function ka(e,t,r){var n=e.history.done,i=ie(n);i&&i.ranges?(n[n.length-1]=t,Zn(e,t,r)):xe(e,t,r)}function xe(e,t,r){Zn(e,t,r),tf(e,e.sel,e.cm?e.cm.curOp.id:NaN,r)}function Zn(e,t,r){(We(e,"beforeSelectionChange")||e.cm&&We(e.cm,"beforeSelectionChange"))&&(t=of(e,t,r));var n=r&&r.bias||(Z(t.primary().head,e.sel.primary().head)<0?-1:1);xa(e,Sa(e,t,n,!0)),!(r&&r.scroll===!1)&&e.cm&&vr(e.cm)}function xa(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Ll(e.cm)),ke(e,"cursorActivity",e))}function Ca(e){xa(e,Sa(e,e.sel,null,!1))}function Sa(e,t,r,n){for(var i,o=0;o<t.ranges.length;o++){var l=t.ranges[o],a=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=An(e,l.anchor,a&&a.anchor,r,n),u=An(e,l.head,a&&a.head,r,n);(i||s!=l.anchor||u!=l.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new ne(s,u))}return i?Ge(e.cm,i,t.primIndex):t}function tr(e,t,r,n,i){var o=q(e,t.line);if(o.markedSpans)for(var l=0;l<o.markedSpans.length;++l){var a=o.markedSpans[l],s=a.marker,u="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,h="selectRight"in s?!s.selectRight:s.inclusiveRight;if((a.from==null||(u?a.from<=t.ch:a.from<t.ch))&&(a.to==null||(h?a.to>=t.ch:a.to>t.ch))){if(i&&(de(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--l;continue}else break;if(!s.atomic)continue;if(r){var p=s.find(n<0?1:-1),b=void 0;if((n<0?h:u)&&(p=tl(e,p,-n,p&&p.line==t.line?o:null)),p&&p.line==t.line&&(b=Z(p,r))&&(n<0?b<0:b>0))return tr(e,p,t,n,i)}var y=s.find(n<0?-1:1);return(n<0?u:h)&&(y=tl(e,y,n,y.line==t.line?o:null)),y?tr(e,y,t,n,i):null}}return t}function An(e,t,r,n,i){var o=n||1,l=tr(e,t,r,o,i)||!i&&tr(e,t,r,o,!0)||tr(e,t,r,-o,i)||!i&&tr(e,t,r,-o,!0);return l||(e.cantEdit=!0,F(e.first,0))}function tl(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?V(e,F(t.line-1)):null:r>0&&t.ch==(n||q(e,t.line)).text.length?t.line<e.first+e.size-1?F(t.line+1,0):null:new F(t.line,t.ch+r)}function La(e){e.setSelection(F(e.firstLine(),0),F(e.lastLine()),et)}function Ta(e,t,r){var n={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return n.canceled=!0}};return r&&(n.update=function(i,o,l,a){i&&(n.from=V(e,i)),o&&(n.to=V(e,o)),l&&(n.text=l),a!==void 0&&(n.origin=a)}),de(e,"beforeChange",e,n),e.cm&&de(e.cm,"beforeChange",e.cm,n),n.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:n.from,to:n.to,text:n.text,origin:n.origin}}function fr(e,t,r){if(e.cm){if(!e.cm.curOp)return be(e.cm,fr)(e,t,r);if(e.cm.state.suppressEdits)return}if(!((We(e,"beforeChange")||e.cm&&We(e.cm,"beforeChange"))&&(t=Ta(e,t,!0),!t))){var n=Ol&&!r&&tu(e,t.from,t.to);if(n)for(var i=n.length-1;i>=0;--i)rl(e,{from:n[i].from,to:n[i].to,text:i?[""]:t.text,origin:t.origin});else rl(e,t)}}function rl(e,t){if(!(t.text.length==1&&t.text[0]==""&&Z(t.from,t.to)==0)){var r=co(e,t);wa(e,t,r,e.cm?e.cm.curOp.id:NaN),Yr(e,t,r,wi(e,t));var n=[];_t(e,function(i,o){!o&&Ce(n,i.history)==-1&&(Ma(i.history,t),n.push(i.history)),Yr(i,t,null,wi(i,t))})}}function gn(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(!(n&&!r)){for(var i=e.history,o,l=e.sel,a=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,u=0;u<a.length&&(o=a[u],!(r?o.ranges&&!o.equals(e.sel):!o.ranges));u++);if(u!=a.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(o=a.pop(),o.ranges){if(Dn(o,s),r&&!o.equals(e.sel)){xe(e,o,{clearRedo:!1});return}l=o}else if(n){a.push(o);return}else break;var h=[];Dn(l,s),s.push({changes:h,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var p=We(e,"beforeChange")||e.cm&&We(e.cm,"beforeChange"),b=function(S){var D=o.changes[S];if(D.origin=t,p&&!Ta(e,D,!1))return a.length=0,{};h.push(Di(e,D));var A=S?co(e,D):ie(a);Yr(e,D,A,Vo(e,D)),!S&&e.cm&&e.cm.scrollIntoView({from:D.from,to:kt(D)});var I=[];_t(e,function(L,E){!E&&Ce(I,L.history)==-1&&(Ma(L.history,D),I.push(L.history)),Yr(L,D,null,Vo(L,D))})},y=o.changes.length-1;y>=0;--y){var k=b(y);if(k)return k.v}}}}function nl(e,t){if(t!=0&&(e.first+=t,e.sel=new He(Pn(e.sel.ranges,function(i){return new ne(F(i.anchor.line+t,i.anchor.ch),F(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){Fe(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;n<r.viewTo;n++)St(e.cm,n,"gutter")}}function Yr(e,t,r,n){if(e.cm&&!e.cm.curOp)return be(e.cm,Yr)(e,t,r,n);if(t.to.line<e.first){nl(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);nl(e,i),t={from:F(e.first,0),to:F(t.to.line+i,t.to.ch),text:[ie(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:F(o,q(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Ot(e,t.from,t.to),r||(r=co(e,t)),e.cm?lf(e.cm,t,n):ho(e,t,n),Zn(e,r,et),e.cantEdit&&An(e,F(e.firstLine(),0))&&(e.cantEdit=!1)}}function lf(e,t,r){var n=e.doc,i=e.display,o=t.from,l=t.to,a=!1,s=o.line;e.options.lineWrapping||(s=le(Je(q(n,o.line))),n.iter(s,l.line+1,function(y){if(y==i.maxLine)return a=!0,!0})),n.sel.contains(t.from,t.to)>-1&&Ll(e),ho(n,t,r,ra(e)),e.options.lineWrapping||(n.iter(s,o.line+t.text.length,function(y){var k=Mn(y);k>i.maxLineLength&&(i.maxLine=y,i.maxLineLength=k,i.maxLineChanged=!0,a=!1)}),a&&(e.curOp.updateMaxLine=!0)),js(n,o.line),rn(e,400);var u=t.text.length-(l.line-o.line)-1;t.full?Fe(e):o.line==l.line&&t.text.length==1&&!ga(e.doc,t)?St(e,o.line,"text"):Fe(e,o.line,l.line+1,u);var h=We(e,"changes"),p=We(e,"change");if(p||h){var b={from:o,to:l,text:t.text,removed:t.removed,origin:t.origin};p&&ke(e,"change",e,b),h&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(b)}e.display.selForContextMenu=null}function gr(e,t,r,n,i){var o;n||(n=r),Z(n,r)<0&&(o=[n,r],r=o[0],n=o[1]),typeof t=="string"&&(t=e.splitLines(t)),fr(e,{from:r,to:n,text:t,origin:i})}function il(e,t,r,n){r<e.line?e.line+=n:t<e.line&&(e.line=t,e.ch=0)}function ol(e,t,r,n){for(var i=0;i<e.length;++i){var o=e[i],l=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var a=0;a<o.ranges.length;a++)il(o.ranges[a].anchor,t,r,n),il(o.ranges[a].head,t,r,n);continue}for(var s=0;s<o.changes.length;++s){var u=o.changes[s];if(r<u.from.line)u.from=F(u.from.line+n,u.from.ch),u.to=F(u.to.line+n,u.to.ch);else if(t<=u.to.line){l=!1;break}}l||(e.splice(0,i+1),i=0)}}function Ma(e,t){var r=t.from.line,n=t.to.line,i=t.text.length-(n-r)-1;ol(e.done,r,n,i),ol(e.undone,r,n,i)}function Mr(e,t,r,n){var i=t,o=t;return typeof t=="number"?o=q(e,Al(e,t)):i=le(t),i==null?null:(n(o,i)&&e.cm&&St(e.cm,i,r),o)}function Nr(e){var t=this;this.lines=e,this.parent=null;for(var r=0,n=0;n<e.length;++n)e[n].parent=t,r+=e[n].height;this.height=r}Nr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var r=this,n=e,i=e+t;n<i;++n){var o=r.lines[n];r.height-=o.height,lu(o),ke(o,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,r){var n=this;this.height+=r,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var i=0;i<t.length;++i)t[i].parent=n},iterN:function(e,t,r){for(var n=this,i=e+t;e<i;++e)if(r(n.lines[e]))return!0}};function Or(e){var t=this;this.children=e;for(var r=0,n=0,i=0;i<e.length;++i){var o=e[i];r+=o.chunkSize(),n+=o.height,o.parent=t}this.size=r,this.height=n,this.parent=null}Or.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){var r=this;this.size-=t;for(var n=0;n<this.children.length;++n){var i=r.children[n],o=i.chunkSize();if(e<o){var l=Math.min(t,o-e),a=i.height;if(i.removeInner(e,l),r.height-=a-i.height,o==l&&(r.children.splice(n--,1),i.parent=null),(t-=l)==0)break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Nr))){var s=[];this.collapse(s),this.children=[new Nr(s)],this.children[0].parent=this}},collapse:function(e){for(var t=this,r=0;r<this.children.length;++r)t.children[r].collapse(e)},insertInner:function(e,t,r){var n=this;this.size+=t.length,this.height+=r;for(var i=0;i<this.children.length;++i){var o=n.children[i],l=o.chunkSize();if(e<=l){if(o.insertInner(e,t,r),o.lines&&o.lines.length>50){for(var a=o.lines.length%25+25,s=a;s<o.lines.length;){var u=new Nr(o.lines.slice(s,s+=25));o.height-=u.height,n.children.splice(++i,0,u),u.parent=n}o.lines=o.lines.slice(0,a),n.maybeSpill()}break}e-=l}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),r=new Or(t);if(e.parent){e.size-=r.size,e.height-=r.height;var i=Ce(e.parent.children,e);e.parent.children.splice(i+1,0,r)}else{var n=new Or(e.children);n.parent=e,e.children=[n,r],e=n}r.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,r){for(var n=this,i=0;i<this.children.length;++i){var o=n.children[i],l=o.chunkSize();if(e<l){var a=Math.min(t,l-e);if(o.iterN(e,a,r))return!0;if((t-=a)==0)break;e=0}else e-=l}}};var nn=function(e,t,r){var n=this;if(r)for(var i in r)r.hasOwnProperty(i)&&(n[i]=r[i]);this.doc=e,this.node=t};nn.prototype.clear=function(){var e=this,t=this.doc.cm,r=this.line.widgets,n=this.line,i=le(n);if(!(i==null||!r)){for(var o=0;o<r.length;++o)r[o]==e&&r.splice(o--,1);r.length||(n.widgets=null);var l=Vr(this);Qe(n,Math.max(0,n.height-l)),t&&(Ee(t,function(){Da(t,n,-l),St(t,i,"widget")}),ke(t,"lineWidgetCleared",t,this,i))}};nn.prototype.changed=function(){var e=this,t=this.height,r=this.doc.cm,n=this.line;this.height=null;var i=Vr(this)-t;!i||(Ct(this.doc,n)||Qe(n,n.height+i),r&&Ee(r,function(){r.curOp.forceUpdate=!0,Da(r,n,i),ke(r,"lineWidgetChanged",r,e,le(n))}))};hr(nn);function Da(e,t,r){ot(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&ao(e,r)}function af(e,t,r,n){var i=new nn(e,r,n),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Mr(e,t,"widget",function(l){var a=l.widgets||(l.widgets=[]);if(i.insertAt==null?a.push(i):a.splice(Math.min(a.length-1,Math.max(0,i.insertAt)),0,i),i.line=l,o&&!Ct(e,l)){var s=ot(l)<e.scrollTop;Qe(l,l.height+Vr(i)),s&&ao(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&ke(o,"lineWidgetAdded",o,i,typeof t=="number"?t:le(t)),i}var Aa=0,Lt=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++Aa};Lt.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){var t=this.doc.cm,r=t&&!t.curOp;if(r&&Xt(t),We(this,"clear")){var n=this.find();n&&ke(this,"clear",n.from,n.to)}for(var i=null,o=null,l=0;l<this.lines.length;++l){var a=e.lines[l],s=Kr(a.markedSpans,e);t&&!e.collapsed?St(t,le(a),"text"):t&&(s.to!=null&&(o=le(a)),s.from!=null&&(i=le(a))),a.markedSpans=Js(a.markedSpans,s),s.from==null&&e.collapsed&&!Ct(e.doc,a)&&t&&Qe(a,sr(t.display))}if(t&&this.collapsed&&!t.options.lineWrapping)for(var u=0;u<this.lines.length;++u){var h=Je(e.lines[u]),p=Mn(h);p>t.display.maxLineLength&&(t.display.maxLine=h,t.display.maxLineLength=p,t.display.maxLineChanged=!0)}i!=null&&t&&this.collapsed&&Fe(t,i,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,t&&Ca(t.doc)),t&&ke(t,"markerCleared",t,this,i,o),r&&Yt(t),this.parent&&this.parent.clear()}};Lt.prototype.find=function(e,t){var r=this;e==null&&this.type=="bookmark"&&(e=1);for(var n,i,o=0;o<this.lines.length;++o){var l=r.lines[o],a=Kr(l.markedSpans,r);if(a.from!=null&&(n=F(t?l:le(l),a.from),e==-1))return n;if(a.to!=null&&(i=F(t?l:le(l),a.to),e==1))return i}return n&&{from:n,to:i}};Lt.prototype.changed=function(){var e=this,t=this.find(-1,!0),r=this,n=this.doc.cm;!t||!n||Ee(n,function(){var i=t.line,o=le(t.line),l=Ji(n,o);if(l&&(Ql(l),n.curOp.selectionChanged=n.curOp.forceUpdate=!0),n.curOp.updateMaxLine=!0,!Ct(r.doc,i)&&r.height!=null){var a=r.height;r.height=null;var s=Vr(r)-a;s&&Qe(i,i.height+s)}ke(n,"markerChanged",n,e)})};Lt.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||Ce(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)};Lt.prototype.detachLine=function(e){if(this.lines.splice(Ce(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};hr(Lt);function cr(e,t,r,n,i){if(n&&n.shared)return sf(e,t,r,n,i);if(e.cm&&!e.cm.curOp)return be(e.cm,cr)(e,t,r,n,i);var o=new Lt(e,i),l=Z(t,r);if(n&&Ht(n,o,!1),l>0||l==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=nr("span",[o.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(_o(e,t.line,t,r,o)||t.line!=r.line&&_o(e,r.line,t,r,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Qs()}o.addToHistory&&wa(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var a=t.line,s=e.cm,u;if(e.iter(a,r.line+1,function(p){s&&o.collapsed&&!s.options.lineWrapping&&Je(p)==s.display.maxLine&&(u=!0),o.collapsed&&a!=t.line&&Qe(p,0),Vs(p,new Rn(o,a==t.line?t.ch:null,a==r.line?r.ch:null)),++a}),o.collapsed&&e.iter(t.line,r.line+1,function(p){Ct(e,p)&&Qe(p,0)}),o.clearOnEnter&&X(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Zs(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++Aa,o.atomic=!0),s){if(u&&(s.curOp.updateMaxLine=!0),o.collapsed)Fe(s,t.line,r.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var h=t.line;h<=r.line;h++)St(s,h,"text");o.atomic&&Ca(s.doc),ke(s,"markerAdded",s,o)}return o}var on=function(e,t){var r=this;this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=r};on.prototype.clear=function(){var e=this;if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var t=0;t<this.markers.length;++t)e.markers[t].clear();ke(this,"clear")}};on.prototype.find=function(e,t){return this.primary.find(e,t)};hr(on);function sf(e,t,r,n,i){n=Ht(n),n.shared=!1;var o=[cr(e,t,r,n,i)],l=o[0],a=n.widgetNode;return _t(e,function(s){a&&(n.widgetNode=a.cloneNode(!0)),o.push(cr(s,V(s,t),V(s,r),n,i));for(var u=0;u<s.linked.length;++u)if(s.linked[u].isParent)return;l=ie(o)}),new on(o,l)}function ll(e){return e.findMarks(F(e.first,0),e.clipPos(F(e.lastLine())),function(t){return t.parent})}function uf(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.find(),o=e.clipPos(i.from),l=e.clipPos(i.to);if(Z(o,l)){var a=cr(e,o,l,n.primary,n.primary.type);n.markers.push(a),a.parent=n}}}function ff(e){for(var t=function(n){var i=e[n],o=[i.primary.doc];_t(i.primary.doc,function(s){return o.push(s)});for(var l=0;l<i.markers.length;l++){var a=i.markers[l];Ce(o,a.doc)==-1&&(a.parent=null,i.markers.splice(l--,1))}},r=0;r<e.length;r++)t(r)}var cf=0,De=function(e,t,r,n,i){if(!(this instanceof De))return new De(e,t,r,n,i);r==null&&(r=0),Or.call(this,[new Nr([new ar("",null)])]),this.first=r,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=r;var o=F(r,0);this.sel=wt(o),this.history=new kn(null),this.id=++cf,this.modeOption=t,this.lineSep=n,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),ho(this,{from:o,to:o,text:e}),xe(this,wt(o),et)};De.prototype=xl(Or.prototype,{constructor:De,iter:function(e,t,r){r?this.iterN(e-this.first,t-e,r):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var r=0,n=0;n<t.length;++n)r+=t[n].height;this.insertInner(e-this.first,t,r)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=hi(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:me(function(e){var t=F(this.first,0),r=this.first+this.size-1;fr(this,{from:t,to:F(r,q(this,r).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&Er(this.cm,0,0),xe(this,wt(t),et)}),replaceRange:function(e,t,r,n){t=V(this,t),r=r?V(this,r):t,gr(this,e,t,r,n)},getRange:function(e,t,r){var n=Ot(this,V(this,e),V(this,t));return r===!1?n:n.join(r||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Ur(this,e))return q(this,e)},getLineNumber:function(e){return le(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=q(this,e)),Je(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return V(this,e)},getCursor:function(e){var t=this.sel.primary(),r;return e==null||e=="head"?r=t.head:e=="anchor"?r=t.anchor:e=="end"||e=="to"||e===!1?r=t.to():r=t.from(),r},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:me(function(e,t,r){el(this,V(this,typeof e=="number"?F(e,t||0):e),null,r)}),setSelection:me(function(e,t,r){el(this,V(this,e),V(this,t||e),r)}),extendSelection:me(function(e,t,r){jn(this,V(this,e),t&&V(this,t),r)}),extendSelections:me(function(e,t){$o(this,Oo(this,e),t)}),extendSelectionsBy:me(function(e,t){var r=Pn(this.sel.ranges,e);$o(this,Oo(this,r),t)}),setSelections:me(function(e,t,r){var n=this;if(!!e.length){for(var i=[],o=0;o<e.length;o++)i[o]=new ne(V(n,e[o].anchor),V(n,e[o].head));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),xe(this,Ge(this.cm,i,t),r)}}),addSelection:me(function(e,t,r){var n=this.sel.ranges.slice(0);n.push(new ne(V(this,e),V(this,t||e))),xe(this,Ge(this.cm,n,n.length-1),r)}),getSelection:function(e){for(var t=this,r=this.sel.ranges,n,i=0;i<r.length;i++){var o=Ot(t,r[i].from(),r[i].to());n=n?n.concat(o):o}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=this,r=[],n=this.sel.ranges,i=0;i<n.length;i++){var o=Ot(t,n[i].from(),n[i].to());e!==!1&&(o=o.join(e||t.lineSeparator())),r[i]=o}return r},replaceSelection:function(e,t,r){for(var n=[],i=0;i<this.sel.ranges.length;i++)n[i]=e;this.replaceSelections(n,t,r||"+input")},replaceSelections:me(function(e,t,r){for(var n=this,i=[],o=this.sel,l=0;l<o.ranges.length;l++){var a=o.ranges[l];i[l]={from:a.from(),to:a.to(),text:n.splitLines(e[l]),origin:r}}for(var s=t&&t!="end"&&Ju(this,i,t),u=i.length-1;u>=0;u--)fr(n,i[u]);s?ka(this,s):this.cm&&vr(this.cm)}),undo:me(function(){gn(this,"undo")}),redo:me(function(){gn(this,"redo")}),undoSelection:me(function(){gn(this,"undo",!0)}),redoSelection:me(function(){gn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,r=0,n=0;n<e.done.length;n++)e.done[n].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++r;return{undo:t,redo:r}},clearHistory:function(){this.history=new kn(this.history.maxGeneration)},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:Jt(this.history.done),undone:Jt(this.history.undone)}},setHistory:function(e){var t=this.history=new kn(this.history.maxGeneration);t.done=Jt(e.done.slice(0),null,!0),t.undone=Jt(e.undone.slice(0),null,!0)},setGutterMarker:me(function(e,t,r){return Mr(this,e,"gutter",function(n){var i=n.gutterMarkers||(n.gutterMarkers={});return i[t]=r,!r&&No(i)&&(n.gutterMarkers=null),!0})}),clearGutter:me(function(e){var t=this;this.iter(function(r){r.gutterMarkers&&r.gutterMarkers[e]&&Mr(t,r,"gutter",function(){return r.gutterMarkers[e]=null,No(r.gutterMarkers)&&(r.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Ur(this,e)||(t=e,e=q(this,e),!e))return null}else if(t=le(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:me(function(e,t,r){return Mr(this,e,t=="gutter"?"gutter":"class",function(n){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!n[i])n[i]=r;else{if(Pr(r).test(n[i]))return!1;n[i]+=" "+r}return!0})}),removeLineClass:me(function(e,t,r){return Mr(this,e,t=="gutter"?"gutter":"class",function(n){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",o=n[i];if(o)if(r==null)n[i]=null;else{var l=o.match(Pr(r));if(!l)return!1;var a=l.index+l[0].length;n[i]=o.slice(0,l.index)+(!l.index||a==o.length?"":" ")+o.slice(a)||null}else return!1;return!0})}),addLineWidget:me(function(e,t,r){return af(this,e,t,r)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,r){return cr(this,V(this,e),V(this,t),r,r&&r.type||"range")},setBookmark:function(e,t){var r={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=V(this,e),cr(this,e,e,r,"bookmark")},findMarksAt:function(e){e=V(this,e);var t=[],r=q(this,e.line).markedSpans;if(r)for(var n=0;n<r.length;++n){var i=r[n];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,r){e=V(this,e),t=V(this,t);var n=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var l=o.markedSpans;if(l)for(var a=0;a<l.length;a++){var s=l[a];!(s.to!=null&&i==e.line&&e.ch>=s.to||s.from==null&&i!=e.line||s.from!=null&&i==t.line&&s.from>=t.ch)&&(!r||r(s.marker))&&n.push(s.marker.parent||s.marker)}++i}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;n<r.length;++n)r[n].from!=null&&e.push(r[n].marker)}),e},posFromIndex:function(e){var t,r=this.first,n=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+n;if(o>e)return t=e,!0;e-=o,++r}),V(this,F(r,t))},indexFromPos:function(e){e=V(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var r=this.lineSeparator().length;return this.iter(this.first,e.line,function(n){t+=n.text.length+r}),t},copy:function(e){var t=new De(hi(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,r=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<r&&(r=e.to);var n=new De(hi(this,t,r),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(n.history=this.history),(this.linked||(this.linked=[])).push({doc:n,sharedHist:e.sharedHist}),n.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],uf(n,ll(this)),n},unlinkDoc:function(e){var t=this;if(e instanceof R&&(e=e.doc),this.linked)for(var r=0;r<this.linked.length;++r){var n=t.linked[r];if(n.doc==e){t.linked.splice(r,1),e.unlinkDoc(t),ff(ll(t));break}}if(e.history==this.history){var i=[e.id];_t(e,function(o){return i.push(o.id)},!0),e.history=new kn(null),e.history.done=Jt(this.history.done,i),e.history.undone=Jt(this.history.undone,i)}},iterLinkedDocs:function(e){_t(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Wi(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:me(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&Vu(this.cm))})});De.prototype.eachLine=De.prototype.iter;var Fa=0;function hf(e){var t=this;if(Ea(t),!(ye(t,e)||lt(t.display,e))){Ae(e),re&&(Fa=+new Date);var r=Pt(t,e,!0),n=e.dataTransfer.files;if(!(!r||t.isReadOnly()))if(n&&n.length&&window.FileReader&&window.File)for(var i=n.length,o=Array(i),l=0,a=function(b,y){if(!(t.options.allowDropFileTypes&&Ce(t.options.allowDropFileTypes,b.type)==-1)){var k=new FileReader;k.onload=be(t,function(){var S=k.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(S)&&(S=""),o[y]=S,++l==i){r=V(t.doc,r);var D={from:r,to:r,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};fr(t.doc,D),ka(t.doc,wt(r,kt(D)))}}),k.readAsText(b)}},s=0;s<i;++s)a(n[s],s);else{if(t.state.draggingText&&t.doc.sel.contains(r)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var u=e.dataTransfer.getData("Text");if(u){var h;if(t.state.draggingText&&!t.state.draggingText.copy&&(h=t.listSelections()),Zn(t.doc,wt(r,r)),h)for(var p=0;p<h.length;++p)gr(t.doc,"",h[p].anchor,h[p].head,"drag");t.replaceSelection(u,"around","paste"),t.display.input.focus()}}catch{}}}}function df(e,t){if(re&&(!e.state.draggingText||+new Date-Fa<100)){Rr(t);return}if(!(ye(e,t)||lt(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!wl)){var r=G("img",null,null,"position: fixed; left: 0; top: 0;");r.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Xe&&(r.width=r.height=1,e.display.wrapper.appendChild(r),r._top=r.offsetTop),t.dataTransfer.setDragImage(r,0,0),Xe&&r.parentNode.removeChild(r)}}function pf(e,t){var r=Pt(e,t);if(!!r){var n=document.createDocumentFragment();ia(e,r,n),e.display.dragCursor||(e.display.dragCursor=G("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),Ie(e.display.dragCursor,n)}}function Ea(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function al(e){if(!!document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),r=[],n=0;n<t.length;n++){var i=t[n].CodeMirror;i&&r.push(i)}r.length&&r[0].operation(function(){for(var o=0;o<r.length;o++)e(r[o])})}}var sl=!1;function vf(){sl||(gf(),sl=!0)}function gf(){var e;X(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,al(mf)},100))}),X(window,"blur",function(){return al($r)})}function mf(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}var Bt={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:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};for(var kr=0;kr<10;kr++)Bt[kr+48]=Bt[kr+96]=String(kr);for(var mn=65;mn<=90;mn++)Bt[mn]=String.fromCharCode(mn);for(var xr=1;xr<=12;xr++)Bt[xr+111]=Bt[xr+63235]="F"+xr;var nt={};nt.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"};nt.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"};nt.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"};nt.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"]};nt.default=Ye?nt.macDefault:nt.pcDefault;function yf(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var r,n,i,o,l=0;l<t.length-1;l++){var a=t[l];if(/^(cmd|meta|m)$/i.test(a))o=!0;else if(/^a(lt)?$/i.test(a))r=!0;else if(/^(c|ctrl|control)$/i.test(a))n=!0;else if(/^s(hift)?$/i.test(a))i=!0;else throw new Error("Unrecognized modifier name: "+a)}return r&&(e="Alt-"+e),n&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function bf(e){var t={};for(var r in e)if(e.hasOwnProperty(r)){var n=e[r];if(/^(name|fallthrough|(de|at)tach)$/.test(r))continue;if(n=="..."){delete e[r];continue}for(var i=Pn(r.split(" "),yf),o=0;o<i.length;o++){var l=void 0,a=void 0;o==i.length-1?(a=i.join(" "),l=n):(a=i.slice(0,o+1).join(" "),l="...");var s=t[a];if(!s)t[a]=l;else if(s!=l)throw new Error("Inconsistent bindings for "+a)}delete e[r]}for(var u in t)e[u]=t[u];return e}function lr(e,t,r,n){t=Fn(t);var i=t.call?t.call(e,n):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&r(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return lr(e,t.fallthrough,r,n);for(var o=0;o<t.fallthrough.length;o++){var l=lr(e,t.fallthrough[o],r,n);if(l)return l}}}function Na(e){var t=typeof e=="string"?e:Bt[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Oa(e,t,r){var n=e;return t.altKey&&n!="Alt"&&(e="Alt-"+e),(Fo?t.metaKey:t.ctrlKey)&&n!="Ctrl"&&(e="Ctrl-"+e),(Fo?t.ctrlKey:t.metaKey)&&n!="Cmd"&&(e="Cmd-"+e),!r&&t.shiftKey&&n!="Shift"&&(e="Shift-"+e),e}function Ia(e,t){if(Xe&&e.keyCode==34&&e.char)return!1;var r=Bt[e.keyCode];return r==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(r=e.code),Oa(r,e,t))}function Fn(e){return typeof e=="string"?nt[e]:e}function Vt(e,t){for(var r=e.doc.sel.ranges,n=[],i=0;i<r.length;i++){for(var o=t(r[i]);n.length&&Z(o.from,ie(n).to)<=0;){var l=n.pop();if(Z(l.from,o.from)<0){o.from=l.from;break}}n.push(o)}Ee(e,function(){for(var a=n.length-1;a>=0;a--)gr(e.doc,"",n[a].from,n[a].to,"+delete");vr(e)})}function go(e,t,r){var n=Cl(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Ai(e,t,r){var n=go(e,t.ch,r);return n==null?null:new F(t.line,n,r<0?"after":"before")}function mo(e,t,r,n,i){if(e){var o=st(r,t.doc.direction);if(o){var l=i<0?ie(o):o[0],a=i<0==(l.level==1),s=a?"after":"before",u;if(l.level>0||t.doc.direction=="rtl"){var h=dr(t,r);u=i<0?r.text.length-1:0;var p=$e(t,h,u).top;u=_r(function(b){return $e(t,h,b).top==p},i<0==(l.level==1)?l.from:l.to-1,u),s=="before"&&(u=go(r,u,1))}else u=i<0?l.to:l.from;return new F(n,u,s)}}return new F(n,i<0?r.text.length:0,i<0?"before":"after")}function wf(e,t,r,n){var i=st(t,e.doc.direction);if(!i)return Ai(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=Br(i,r.ch,r.sticky),l=i[o];if(e.doc.direction=="ltr"&&l.level%2==0&&(n>0?l.to>r.ch:l.from<r.ch))return Ai(t,r,n);var a=function(A,I){return go(t,A instanceof F?A.ch:A,I)},s,u=function(A){return e.options.lineWrapping?(s=s||dr(e,t),ta(e,t,s,A)):{begin:0,end:t.text.length}},h=u(r.sticky=="before"?a(r,-1):r.ch);if(e.doc.direction=="rtl"||l.level==1){var p=l.level==1==n<0,b=a(r,p?1:-1);if(b!=null&&(p?b<=l.to&&b<=h.end:b>=l.from&&b>=h.begin)){var y=p?"before":"after";return new F(r.line,b,y)}}var k=function(A,I,L){for(var E=function(_,v){return v?new F(r.line,a(_,1),"before"):new F(r.line,_,"after")};A>=0&&A<i.length;A+=I){var P=i[A],W=I>0==(P.level!=1),Y=W?L.begin:a(L.end,-1);if(P.from<=Y&&Y<P.to||(Y=W?P.from:a(P.to,-1),L.begin<=Y&&Y<L.end))return E(Y,W)}},S=k(o+n,n,h);if(S)return S;var D=n>0?h.end:a(h.begin,-1);return D!=null&&!(n>0&&D==t.text.length)&&(S=k(n>0?0:i.length-1,n,u(D)),S)?S:null}var jr={selectAll:La,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),et)},killLine:function(e){return Vt(e,function(t){if(t.empty()){var r=q(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line<e.lastLine()?{from:t.head,to:F(t.head.line+1,0)}:{from:t.head,to:F(t.head.line,r)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return Vt(e,function(t){return{from:F(t.from().line,0),to:V(e.doc,F(t.to().line+1,0))}})},delLineLeft:function(e){return Vt(e,function(t){return{from:F(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return Vt(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return{from:n,to:t.from()}})},delWrappedLineRight:function(e){return Vt(e,function(t){var r=e.charCoords(t.head,"div").top+5,n=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div");return{from:t.from(),to:n}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(F(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(F(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ha(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return ul(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return kf(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:r},"div")},Dr)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:r},"div")},Dr)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var r=e.cursorCoords(t.head,"div").top+5,n=e.coordsChar({left:0,top:r},"div");return n.ch<e.getLine(n.line).search(/\S/)?ul(e,t.head):n},Dr)},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,"char")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],r=e.listSelections(),n=e.options.tabSize,i=0;i<r.length;i++){var o=r[i].from(),l=Pe(e.getLine(o.line),o.ch,n);t.push(Hi(n-l%n))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return Ee(e,function(){for(var t=e.listSelections(),r=[],n=0;n<t.length;n++)if(!!t[n].empty()){var i=t[n].head,o=q(e.doc,i.line).text;if(o){if(i.ch==o.length&&(i=new F(i.line,i.ch-1)),i.ch>0)i=new F(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),F(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var l=q(e.doc,i.line-1).text;l&&(i=new F(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+l.charAt(l.length-1),F(i.line-1,l.length-1),i,"+transpose"))}}r.push(new ne(i,i))}e.setSelections(r)})},newlineAndIndent:function(e){return Ee(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;n<t.length;n++)e.indentLine(t[n].from().line,null,!0);vr(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ha(e,t){var r=q(e.doc,t),n=Je(r);return n!=r&&(t=le(n)),mo(!0,e,n,t,1)}function kf(e,t){var r=q(e.doc,t),n=nu(r);return n!=r&&(t=le(n)),mo(!0,e,r,t,-1)}function ul(e,t){var r=Ha(e,t.line),n=q(e.doc,r.line),i=st(n,e.doc.direction);if(!i||i[0].level==0){var o=Math.max(0,n.text.search(/\S/)),l=t.line==r.line&&t.ch<=o&&t.ch;return F(r.line,l?0:o,r.sticky)}return r}function xn(e,t,r){if(typeof t=="string"&&(t=jr[t],!t))return!1;e.display.input.ensurePolled();var n=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),r&&(e.display.shift=!1),i=t(e)!=zn}finally{e.display.shift=n,e.state.suppressEdits=!1}return i}function xf(e,t,r){for(var n=0;n<e.state.keyMaps.length;n++){var i=lr(t,e.state.keyMaps[n],r,e);if(i)return i}return e.options.extraKeys&&lr(t,e.options.extraKeys,r,e)||lr(t,e.options.keyMap,r,e)}var Cf=new bt;function Ir(e,t,r,n){var i=e.state.keySeq;if(i){if(Na(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:Cf.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),fl(e,i+" "+t,r,n))return!0}return fl(e,t,r,n)}function fl(e,t,r,n){var i=xf(e,t,n);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&ke(e,"keyHandled",e,t,r),(i=="handled"||i=="multi")&&(Ae(r),no(e)),!!i}function za(e,t){var r=Ia(t,!0);return r?t.shiftKey&&!e.state.keySeq?Ir(e,"Shift-"+r,t,function(n){return xn(e,n,!0)})||Ir(e,r,t,function(n){if(typeof n=="string"?/^go[A-Z]/.test(n):n.motion)return xn(e,n)}):Ir(e,r,t,function(n){return xn(e,n)}):!1}function Sf(e,t,r){return Ir(e,"'"+r+"'",t,function(n){return xn(e,n,!0)})}var Fi=null;function Pa(e){var t=this;if(t.curOp.focus=at(),!ye(t,e)){re&&ce<11&&e.keyCode==27&&(e.returnValue=!1);var r=e.keyCode;t.display.shift=r==16||e.shiftKey;var n=za(t,e);Xe&&(Fi=n?r:null,!n&&r==88&&!Rs&&(Ye?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),r==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&Lf(t)}}function Lf(e){var t=e.display.lineDiv;Ut(t,"CodeMirror-crosshair");function r(n){(n.keyCode==18||!n.altKey)&&(Rt(t,"CodeMirror-crosshair"),Oe(document,"keyup",r),Oe(document,"mouseover",r))}X(document,"keyup",r),X(document,"mouseover",r)}function Wa(e){e.keyCode==16&&(this.doc.sel.shift=!1),ye(this,e)}function _a(e){var t=this;if(!(lt(t.display,e)||ye(t,e)||e.ctrlKey&&!e.altKey||Ye&&e.metaKey)){var r=e.keyCode,n=e.charCode;if(Xe&&r==Fi){Fi=null,Ae(e);return}if(!(Xe&&(!e.which||e.which<10)&&za(t,e))){var i=String.fromCharCode(n==null?r:n);i!="\b"&&(Sf(t,e,i)||t.display.input.onKeyPress(e))}}}var Tf=400,Ei=function(e,t,r){this.time=e,this.pos=t,this.button=r};Ei.prototype.compare=function(e,t,r){return this.time+Tf>e&&Z(t,this.pos)==0&&r==this.button};var Cr,Sr;function Mf(e,t){var r=+new Date;return Sr&&Sr.compare(r,e,t)?(Cr=Sr=null,"triple"):Cr&&Cr.compare(r,e,t)?(Sr=new Ei(r,e,t),Cr=null,"double"):(Cr=new Ei(r,e,t),Sr=null,"single")}function Ba(e){var t=this,r=t.display;if(!(ye(t,e)||r.activeTouch&&r.input.supportsTouch())){if(r.input.ensurePolled(),r.shift=e.shiftKey,lt(r,e)){Le||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(!Ni(t,e)){var n=Pt(t,e),i=Ml(e),o=n?Mf(n,i):"single";window.focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(n&&Df(t,i,n,o,e))&&(i==1?n?Ff(t,n,o,e):Pi(e)==r.scroller&&Ae(e):i==2?(n&&jn(t.doc,n),setTimeout(function(){return r.input.focus()},20)):i==3&&(Ii?t.display.input.onContextMenu(e):la(t)))}}}function Df(e,t,r,n,i){var o="Click";return n=="double"?o="Double"+o:n=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,Ir(e,Oa(o,i),i,function(l){if(typeof l=="string"&&(l=jr[l]),!l)return!1;var a=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),a=l(e,r)!=zn}finally{e.state.suppressEdits=!1}return a})}function Af(e,t,r){var n=e.getOption("configureMouse"),i=n?n(e,t,r):{};if(i.unit==null){var o=Fs?r.shiftKey&&r.metaKey:r.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||r.shiftKey),i.addNew==null&&(i.addNew=Ye?r.metaKey:r.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(Ye?r.altKey:r.ctrlKey)),i}function Ff(e,t,r,n){re?setTimeout(Hn(oa,e),0):e.curOp.focus=at();var i=Af(e,r,n),o=e.doc.sel,l;e.options.dragDrop&&Ps&&!e.isReadOnly()&&r=="single"&&(l=o.contains(t))>-1&&(Z((l=o.ranges[l]).from(),t)<0||t.xRel>0)&&(Z(l.to(),t)>0||t.xRel<0)?Ef(e,n,t,i):Nf(e,n,t,i)}function Ef(e,t,r,n){var i=e.display,o=!1,l=be(e,function(u){Le&&(i.scroller.draggable=!1),e.state.draggingText=!1,Oe(i.wrapper.ownerDocument,"mouseup",l),Oe(i.wrapper.ownerDocument,"mousemove",a),Oe(i.scroller,"dragstart",s),Oe(i.scroller,"drop",l),o||(Ae(u),n.addNew||jn(e.doc,r,null,null,n.extend),Le||re&&ce==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus(),i.input.focus()},20):i.input.focus())}),a=function(u){o=o||Math.abs(t.clientX-u.clientX)+Math.abs(t.clientY-u.clientY)>=10},s=function(){return o=!0};Le&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!n.moveOnDrag,i.scroller.dragDrop&&i.scroller.dragDrop(),X(i.wrapper.ownerDocument,"mouseup",l),X(i.wrapper.ownerDocument,"mousemove",a),X(i.scroller,"dragstart",s),X(i.scroller,"drop",l),la(e),setTimeout(function(){return i.input.focus()},20)}function cl(e,t,r){if(r=="char")return new ne(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new ne(F(t.line,0),V(e.doc,F(t.line+1,0)));var n=r(e,t);return new ne(n.from,n.to)}function Nf(e,t,r,n){var i=e.display,o=e.doc;Ae(t);var l,a,s=o.sel,u=s.ranges;if(n.addNew&&!n.extend?(a=o.sel.contains(r),a>-1?l=u[a]:l=new ne(r,r)):(l=o.sel.primary(),a=o.sel.primIndex),n.unit=="rectangle")n.addNew||(l=new ne(r,r)),r=Pt(e,t,!0,!0),a=-1;else{var h=cl(e,r,n.unit);n.extend?l=po(l,h.anchor,h.head,n.extend):l=h}n.addNew?a==-1?(a=u.length,xe(o,Ge(e,u.concat([l]),a),{scroll:!1,origin:"*mouse"})):u.length>1&&u[a].empty()&&n.unit=="char"&&!n.extend?(xe(o,Ge(e,u.slice(0,a).concat(u.slice(a+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):vo(o,a,l,si):(a=0,xe(o,new He([l],0),si),s=o.sel);var p=r;function b(L){if(Z(p,L)!=0)if(p=L,n.unit=="rectangle"){for(var E=[],P=e.options.tabSize,W=Pe(q(o,r.line).text,r.ch,P),Y=Pe(q(o,L.line).text,L.ch,P),_=Math.min(W,Y),v=Math.max(W,Y),C=Math.min(r.line,L.line),d=Math.min(e.lastLine(),Math.max(r.line,L.line));C<=d;C++){var B=q(o,C).text,Q=pi(B,_,P);_==v?E.push(new ne(F(C,Q),F(C,Q))):B.length>Q&&E.push(new ne(F(C,Q),F(C,pi(B,v,P))))}E.length||E.push(new ne(r,r)),xe(o,Ge(e,s.ranges.slice(0,a).concat(E),a),{origin:"*mouse",scroll:!1}),e.scrollIntoView(L)}else{var j=l,w=cl(e,L,n.unit),T=j.anchor,x;Z(w.anchor,T)>0?(x=w.head,T=_n(j.from(),w.anchor)):(x=w.anchor,T=Wn(j.to(),w.head));var K=s.ranges.slice(0);K[a]=Of(e,new ne(V(o,T),x)),xe(o,Ge(e,K,a),si)}}var y=i.wrapper.getBoundingClientRect(),k=0;function S(L){var E=++k,P=Pt(e,L,!0,n.unit=="rectangle");if(!!P)if(Z(P,p)!=0){e.curOp.focus=at(),b(P);var W=oo(i,o);(P.line>=W.to||P.line<W.from)&&setTimeout(be(e,function(){k==E&&S(L)}),150)}else{var Y=L.clientY<y.top?-20:L.clientY>y.bottom?20:0;Y&&setTimeout(be(e,function(){k==E&&(i.scroller.scrollTop+=Y,S(L))}),50)}}function D(L){e.state.selectingText=!1,k=1/0,L&&(Ae(L),i.input.focus()),Oe(i.wrapper.ownerDocument,"mousemove",A),Oe(i.wrapper.ownerDocument,"mouseup",I),o.history.lastSelOrigin=null}var A=be(e,function(L){L.buttons===0||!Ml(L)?D(L):S(L)}),I=be(e,D);e.state.selectingText=I,X(i.wrapper.ownerDocument,"mousemove",A),X(i.wrapper.ownerDocument,"mouseup",I)}function Of(e,t){var r=t.anchor,n=t.head,i=q(e.doc,r.line);if(Z(r,n)==0&&r.sticky==n.sticky)return t;var o=st(i);if(!o)return t;var l=Br(o,r.ch,r.sticky),a=o[l];if(a.from!=r.ch&&a.to!=r.ch)return t;var s=l+(a.from==r.ch==(a.level!=1)?0:1);if(s==0||s==o.length)return t;var u;if(n.line!=r.line)u=(n.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var h=Br(o,n.ch,n.sticky),p=h-l||(n.ch-r.ch)*(a.level==1?-1:1);h==s-1||h==s?u=p<0:u=p>0}var b=o[s+(u?-1:0)],y=u==(b.level==1),k=y?b.from:b.to,S=y?"after":"before";return r.ch==k&&r.sticky==S?t:new ne(new F(r.line,k,S),n)}function Ra(e,t,r,n){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch{return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&Ae(t);var l=e.display,a=l.lineDiv.getBoundingClientRect();if(o>a.bottom||!We(e,r))return mi(t);o-=a.top-l.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var u=l.gutters.childNodes[s];if(u&&u.getBoundingClientRect().right>=i){var h=Et(e.doc,o),p=e.display.gutterSpecs[s];return de(e,r,e,h,p.className,t),mi(t)}}}function Ni(e,t){return Ra(e,t,"gutterClick",!0)}function If(e,t){lt(e.display,t)||Hf(e,t)||ye(e,t,"contextmenu")||Ii||e.display.input.onContextMenu(t)}function Hf(e,t){return We(e,"gutterContextMenu")?Ra(e,t,"gutterContextMenu",!1):!1}function Ua(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Gr(e)}var rr={toString:function(){return"CodeMirror.Init"}},Ka={},Cn={};function zf(e){var t=e.optionHandlers;function r(n,i,o,l){e.defaults[n]=i,o&&(t[n]=l?function(a,s,u){u!=rr&&o(a,s,u)}:o)}e.defineOption=r,e.Init=rr,r("value","",function(n,i){return n.setValue(i)},!0),r("mode",null,function(n,i){n.doc.modeOption=i,Mi(n)},!0),r("indentUnit",2,Mi,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){Tr(n),Gr(n),Fe(n)},!0),r("lineSeparator",null,function(n,i){if(n.doc.lineSep=i,!!i){var o=[],l=n.doc.first;n.doc.iter(function(s){for(var u=0;;){var h=s.text.indexOf(i,u);if(h==-1)break;u=h+i.length,o.push(F(l,h))}l++});for(var a=o.length-1;a>=0;a--)gr(n.doc,i,o[a],F(o[a].line,o[a].ch+i.length))}}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,i,o){n.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),o!=rr&&n.refresh()}),r("specialCharPlaceholder",uu,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",zr?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running src")},!0),r("spellcheck",!1,function(n,i){return n.getInputField().spellcheck=i},!0),r("autocorrect",!1,function(n,i){return n.getInputField().autocorrect=i},!0),r("autocapitalize",!1,function(n,i){return n.getInputField().autocapitalize=i},!0),r("rtlMoveVisually",!Es),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){Ua(n),wr(n)},!0),r("keyMap","default",function(n,i,o){var l=Fn(i),a=o!=rr&&Fn(o);a&&a.detach&&a.detach(n,l),l.attach&&l.attach(n,a||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Wf,!0),r("gutters",[],function(n,i){n.display.gutterSpecs=Ti(i,n.options.lineNumbers),wr(n)},!0),r("fixedGutter",!0,function(n,i){n.display.gutters.style.left=i?to(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return ur(n)},!0),r("scrollbarStyle","native",function(n){fa(n),ur(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),r("lineNumbers",!1,function(n,i){n.display.gutterSpecs=Ti(n.options.gutters,i),wr(n)},!0),r("firstLineNumber",1,wr,!0),r("lineNumberFormatter",function(n){return n},wr,!0),r("showCursorWhenSelecting",!1,Fr,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,i){i=="nocursor"&&($r(n),n.display.input.blur()),n.display.input.readOnlyChanged(i)}),r("disableInput",!1,function(n,i){i||n.display.input.reset()},!0),r("dragDrop",!0,Pf),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,Fr,!0),r("singleCursorHeightPerLine",!0,Fr,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Tr,!0),r("addModeClass",!1,Tr,!0),r("pollInterval",100),r("undoDepth",200,function(n,i){return n.doc.history.undoDepth=i}),r("historyEventDelay",1250),r("viewportMargin",10,function(n){return n.refresh()},!0),r("maxHighlightLength",1e4,Tr,!0),r("moveInputWithCursor",!0,function(n,i){i||n.display.input.resetPosition()}),r("tabindex",null,function(n,i){return n.display.input.getField().tabIndex=i||""}),r("autofocus",null),r("direction","ltr",function(n,i){return n.doc.setDirection(i)},!0),r("phrases",null)}function Pf(e,t,r){var n=r&&r!=rr;if(!t!=!n){var i=e.display.dragFunctions,o=t?X:Oe;o(e.display.scroller,"dragstart",i.start),o(e.display.scroller,"dragenter",i.enter),o(e.display.scroller,"dragover",i.over),o(e.display.scroller,"dragleave",i.leave),o(e.display.scroller,"drop",i.drop)}}function Wf(e){e.options.lineWrapping?(Ut(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Rt(e.display.wrapper,"CodeMirror-wrap"),Yi(e)),ro(e),Fe(e),Gr(e),setTimeout(function(){return ur(e)},100)}function R(e,t){var r=this;if(!(this instanceof R))return new R(e,t);this.options=t=t?Ht(t):{},Ht(Ka,t,!1);var n=t.value;typeof n=="string"?n=new De(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var i=new R.inputStyles[t.inputStyle](this),o=this.display=new Zu(e,n,i,t);o.wrapper.CodeMirror=this,Ua(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),fa(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 bt,keySeq:null,specialChars:null},t.autofocus&&!zr&&o.input.focus(),re&&ce<11&&setTimeout(function(){return r.display.input.reset(!0)},20),_f(this),vf(),Xt(this),this.curOp.forceUpdate=!0,ma(this,n),t.autofocus&&!zr||this.hasFocus()?setTimeout(Hn(io,this),20):$r(this);for(var l in Cn)Cn.hasOwnProperty(l)&&Cn[l](r,t[l],rr);da(this),t.finishInit&&t.finishInit(this);for(var a=0;a<Oi.length;++a)Oi[a](r);Yt(this),Le&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"&&(o.lineDiv.style.textRendering="auto"),t.onload&&t.onload(this)}R.defaults=Ka;R.optionHandlers=Cn;function _f(e){var t=e.display;X(t.scroller,"mousedown",be(e,Ba)),re&&ce<11?X(t.scroller,"dblclick",be(e,function(s){if(!ye(e,s)){var u=Pt(e,s);if(!(!u||Ni(e,s)||lt(e.display,s))){Ae(s);var h=e.findWordAt(u);jn(e.doc,h.anchor,h.head)}}})):X(t.scroller,"dblclick",function(s){return ye(e,s)||Ae(s)}),X(t.scroller,"contextmenu",function(s){return If(e,s)});var r,n={end:0};function i(){t.activeTouch&&(r=setTimeout(function(){return t.activeTouch=null},1e3),n=t.activeTouch,n.end=+new Date)}function o(s){if(s.touches.length!=1)return!1;var u=s.touches[0];return u.radiusX<=1&&u.radiusY<=1}function l(s,u){if(u.left==null)return!0;var h=u.left-s.left,p=u.top-s.top;return h*h+p*p>20*20}X(t.scroller,"touchstart",function(s){if(!ye(e,s)&&!o(s)&&!Ni(e,s)){t.input.ensurePolled(),clearTimeout(r);var u=+new Date;t.activeTouch={start:u,moved:!1,prev:u-n.end<=300?n:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),X(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),X(t.scroller,"touchend",function(s){var u=t.activeTouch;if(u&&!lt(t,s)&&u.left!=null&&!u.moved&&new Date-u.start<300){var h=e.coordsChar(t.activeTouch,"page"),p;!u.prev||l(u,u.prev)?p=new ne(h,h):!u.prev.prev||l(u,u.prev.prev)?p=e.findWordAt(h):p=new ne(F(h.line,0),V(e.doc,F(h.line+1,0))),e.setSelection(p.anchor,p.head),e.focus(),Ae(s)}i()}),X(t.scroller,"touchcancel",i),X(t.scroller,"scroll",function(){t.scroller.clientHeight&&(en(e,t.scroller.scrollTop),qt(e,t.scroller.scrollLeft,!0),de(e,"scroll",e))}),X(t.scroller,"mousewheel",function(s){return jo(e,s)}),X(t.scroller,"DOMMouseScroll",function(s){return jo(e,s)}),X(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){ye(e,s)||Rr(s)},over:function(s){ye(e,s)||(pf(e,s),Rr(s))},start:function(s){return df(e,s)},drop:be(e,hf),leave:function(s){ye(e,s)||Ea(e)}};var a=t.input.getField();X(a,"keyup",function(s){return Wa.call(e,s)}),X(a,"keydown",be(e,Pa)),X(a,"keypress",be(e,_a)),X(a,"focus",function(s){return io(e,s)}),X(a,"blur",function(s){return $r(e,s)})}var Oi=[];R.defineInitHook=function(e){return Oi.push(e)};function Hr(e,t,r,n){var i=e.doc,o;r==null&&(r="add"),r=="smart"&&(i.mode.indent?o=Jr(e,t).state:r="prev");var l=e.options.tabSize,a=q(i,t),s=Pe(a.text,null,l);a.stateAfter&&(a.stateAfter=null);var u=a.text.match(/^\s*/)[0],h;if(!n&&!/\S/.test(a.text))h=0,r="not";else if(r=="smart"&&(h=i.mode.indent(o,a.text.slice(u.length),a.text),h==zn||h>150)){if(!n)return;r="prev"}r=="prev"?t>i.first?h=Pe(q(i,t-1).text,null,l):h=0:r=="add"?h=s+e.options.indentUnit:r=="subtract"?h=s-e.options.indentUnit:typeof r=="number"&&(h=s+r),h=Math.max(0,h);var p="",b=0;if(e.options.indentWithTabs)for(var y=Math.floor(h/l);y;--y)b+=l,p+=" ";if(b<h&&(p+=Hi(h-b)),p!=u)return gr(i,p,F(t,0),F(t,u.length),"+input"),a.stateAfter=null,!0;for(var k=0;k<i.sel.ranges.length;k++){var S=i.sel.ranges[k];if(S.head.line==t&&S.head.ch<u.length){var D=F(t,u.length);vo(i,k,new ne(D,D));break}}}var Ke=null;function En(e){Ke=e}function yo(e,t,r,n,i){var o=e.doc;e.display.shift=!1,n||(n=o.sel);var l=+new Date-200,a=i=="paste"||e.state.pasteIncoming>l,s=Wi(t),u=null;if(a&&n.ranges.length>1)if(Ke&&Ke.text.join(`
`)==t){if(n.ranges.length%Ke.text.length==0){u=[];for(var h=0;h<Ke.text.length;h++)u.push(o.splitLines(Ke.text[h]))}}else s.length==n.ranges.length&&e.options.pasteLinesPerSelection&&(u=Pn(s,function(A){return[A]}));for(var p=e.curOp.updateInput,b=n.ranges.length-1;b>=0;b--){var y=n.ranges[b],k=y.from(),S=y.to();y.empty()&&(r&&r>0?k=F(k.line,k.ch-r):e.state.overwrite&&!a?S=F(S.line,Math.min(q(o,S.line).text.length,S.ch+ie(s).length)):a&&Ke&&Ke.lineWise&&Ke.text.join(`
`)==t&&(k=S=F(k.line,0)));var D={from:k,to:S,text:u?u[b%u.length]:s,origin:i||(a?"paste":e.state.cutIncoming>l?"cut":"+input")};fr(e.doc,D),ke(e,"inputRead",e,D)}t&&!a&&Ga(e,t),vr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=p),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function qa(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Ee(t,function(){return yo(t,r,0,null,"paste")}),!0}function Ga(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var i=r.ranges[n];if(!(i.head.ch>100||n&&r.ranges[n-1].head.line==i.head.line)){var o=e.getModeAt(i.head),l=!1;if(o.electricChars){for(var a=0;a<o.electricChars.length;a++)if(t.indexOf(o.electricChars.charAt(a))>-1){l=Hr(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(q(e.doc,i.head.line).text.slice(0,i.head.ch))&&(l=Hr(e,i.head.line,"smart"));l&&ke(e,"electricInput",e,i.head.line)}}}function Xa(e){for(var t=[],r=[],n=0;n<e.doc.sel.ranges.length;n++){var i=e.doc.sel.ranges[n].head.line,o={anchor:F(i,0),head:F(i+1,0)};r.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:r}}function Ya(e,t,r,n){e.setAttribute("autocorrect",r?"":"off"),e.setAttribute("autocapitalize",n?"":"off"),e.setAttribute("spellcheck",!!t)}function ja(){var e=G("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),t=G("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return Le?e.style.width="1000px":e.setAttribute("wrap","off"),Qr&&(e.style.border="1px solid black"),Ya(e),t}function Bf(e){var t=e.optionHandlers,r=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(n,i){var o=this.options,l=o[n];o[n]==i&&n!="mode"||(o[n]=i,t.hasOwnProperty(n)&&be(this,t[n])(this,i,l),de(this,"optionChange",this,n))},getOption:function(n){return this.options[n]},getDoc:function(){return this.doc},addKeyMap:function(n,i){this.state.keyMaps[i?"push":"unshift"](Fn(n))},removeKeyMap:function(n){for(var i=this.state.keyMaps,o=0;o<i.length;++o)if(i[o]==n||i[o].name==n)return i.splice(o,1),!0},addOverlay:Se(function(n,i){var o=n.token?n:e.getMode(this.options,n);if(o.startState)throw new Error("Overlays may not be stateful.");Ns(this.state.overlays,{mode:o,modeSpec:n,opaque:i&&i.opaque,priority:i&&i.priority||0},function(l){return l.priority}),this.state.modeGen++,Fe(this)}),removeOverlay:Se(function(n){for(var i=this,o=this.state.overlays,l=0;l<o.length;++l){var a=o[l].modeSpec;if(a==n||typeof n=="string"&&a.name==n){o.splice(l,1),i.state.modeGen++,Fe(i);return}}}),indentLine:Se(function(n,i,o){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),Ur(this.doc,n)&&Hr(this,n,i,o)}),indentSelection:Se(function(n){for(var i=this,o=this.doc.sel.ranges,l=-1,a=0;a<o.length;a++){var s=o[a];if(s.empty())s.head.line>l&&(Hr(i,s.head.line,n,!0),l=s.head.line,a==i.doc.sel.primIndex&&vr(i));else{var u=s.from(),h=s.to(),p=Math.max(l,u.line);l=Math.min(i.lastLine(),h.line-(h.ch?0:1))+1;for(var b=p;b<l;++b)Hr(i,b,n);var y=i.doc.sel.ranges;u.ch==0&&o.length==y.length&&y[a].from().ch>0&&vo(i.doc,a,new ne(u,y[a].to()),et)}}}),getTokenAt:function(n,i){return Ho(this,n,i)},getLineTokens:function(n,i){return Ho(this,F(n),i,!0)},getTokenTypeAt:function(n){n=V(this.doc,n);var i=El(this,q(this.doc,n.line)),o=0,l=(i.length-1)/2,a=n.ch,s;if(a==0)s=i[2];else for(;;){var u=o+l>>1;if((u?i[u*2-1]:0)>=a)l=u;else if(i[u*2+1]<a)o=u+1;else{s=i[u*2+2];break}}var h=s?s.indexOf("overlay "):-1;return h<0?s:h==0?null:s.slice(0,h-1)},getModeAt:function(n){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(n).state).mode:i},getHelper:function(n,i){return this.getHelpers(n,i)[0]},getHelpers:function(n,i){var o=this,l=[];if(!r.hasOwnProperty(i))return l;var a=r[i],s=this.getModeAt(n);if(typeof s[i]=="string")a[s[i]]&&l.push(a[s[i]]);else if(s[i])for(var u=0;u<s[i].length;u++){var h=a[s[i][u]];h&&l.push(h)}else s.helperType&&a[s.helperType]?l.push(a[s.helperType]):a[s.name]&&l.push(a[s.name]);for(var p=0;p<a._global.length;p++){var b=a._global[p];b.pred(s,o)&&Ce(l,b.val)==-1&&l.push(b.val)}return l},getStateAfter:function(n,i){var o=this.doc;return n=Al(o,n==null?o.first+o.size-1:n),Jr(this,n+1,i).state},cursorCoords:function(n,i){var o,l=this.doc.sel.primary();return n==null?o=l.head:typeof n=="object"?o=V(this.doc,n):o=n?l.from():l.to(),qe(this,o,i||"page")},charCoords:function(n,i){return xi(this,V(this.doc,n),i||"page")},coordsChar:function(n,i){return n=Ko(this,n,i||"page"),$i(this,n.left,n.top)},lineAtHeight:function(n,i){return n=Ko(this,{top:n,left:0},i||"page").top,Et(this.doc,n+this.display.viewOffset)},heightAtLine:function(n,i,o){var l=!1,a;if(typeof n=="number"){var s=this.doc.first+this.doc.size-1;n<this.doc.first?n=this.doc.first:n>s&&(n=s,l=!0),a=q(this.doc,n)}else a=n;return qn(this,a,{top:0,left:0},i||"page",o||l).top+(l?this.doc.height-ot(a):0)},defaultTextHeight:function(){return sr(this.display)},defaultCharWidth:function(){return pr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,i,o,l,a){var s=this.display;n=qe(this,V(this.doc,n));var u=n.bottom,h=n.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),l=="over")u=n.top;else if(l=="above"||l=="near"){var p=Math.max(s.wrapper.clientHeight,this.doc.height),b=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(l=="above"||n.bottom+i.offsetHeight>p)&&n.top>i.offsetHeight?u=n.top-i.offsetHeight:n.bottom+i.offsetHeight<=p&&(u=n.bottom),h+i.offsetWidth>b&&(h=b-i.offsetWidth)}i.style.top=u+"px",i.style.left=i.style.right="",a=="right"?(h=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(a=="left"?h=0:a=="middle"&&(h=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=h+"px"),o&&Hu(this,{left:h,top:u,right:h+i.offsetWidth,bottom:u+i.offsetHeight})},triggerOnKeyDown:Se(Pa),triggerOnKeyPress:Se(_a),triggerOnKeyUp:Wa,triggerOnMouseDown:Se(Ba),execCommand:function(n){if(jr.hasOwnProperty(n))return jr[n].call(null,this)},triggerElectric:Se(function(n){Ga(this,n)}),findPosH:function(n,i,o,l){var a=this,s=1;i<0&&(s=-1,i=-i);for(var u=V(this.doc,n),h=0;h<i&&(u=di(a.doc,u,s,o,l),!u.hitSide);++h);return u},moveH:Se(function(n,i){var o=this;this.extendSelectionsBy(function(l){return o.display.shift||o.doc.extend||l.empty()?di(o.doc,l.head,n,i,o.options.rtlMoveVisually):n<0?l.from():l.to()},Dr)}),deleteH:Se(function(n,i){var o=this.doc.sel,l=this.doc;o.somethingSelected()?l.replaceSelection("",null,"+delete"):Vt(this,function(a){var s=di(l,a.head,n,i,!1);return n<0?{from:s,to:a.head}:{from:a.head,to:s}})}),findPosV:function(n,i,o,l){var a=this,s=1,u=l;i<0&&(s=-1,i=-i);for(var h=V(this.doc,n),p=0;p<i;++p){var b=qe(a,h,"div");if(u==null?u=b.left:b.left=u,h=hl(a,b,s,o),h.hitSide)break}return h},moveV:Se(function(n,i){var o=this,l=this.doc,a=[],s=!this.display.shift&&!l.extend&&l.sel.somethingSelected();if(l.extendSelectionsBy(function(h){if(s)return n<0?h.from():h.to();var p=qe(o,h.head,"div");h.goalColumn!=null&&(p.left=h.goalColumn),a.push(p.left);var b=hl(o,p,n,i);return i=="page"&&h==l.sel.primary()&&ao(o,xi(o,b,"div").top-p.top),b},Dr),a.length)for(var u=0;u<l.sel.ranges.length;u++)l.sel.ranges[u].goalColumn=a[u]}),findWordAt:function(n){var i=this.doc,o=q(i,n.line).text,l=n.ch,a=n.ch;if(o){var s=this.getHelper(n,"wordChars");(n.sticky=="before"||a==o.length)&&l?--l:++a;for(var u=o.charAt(l),h=bn(u,s)?function(p){return bn(p,s)}:/\s/.test(u)?function(p){return/\s/.test(p)}:function(p){return!/\s/.test(p)&&!bn(p)};l>0&&h(o.charAt(l-1));)--l;for(;a<o.length&&h(o.charAt(a));)++a}return new ne(F(n.line,l),F(n.line,a))},toggleOverwrite:function(n){n!=null&&n==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Ut(this.display.cursorDiv,"CodeMirror-overwrite"):Rt(this.display.cursorDiv,"CodeMirror-overwrite"),de(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==at()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Se(function(n,i){Er(this,n,i)}),getScrollInfo:function(){var n=this.display.scroller;return{left:n.scrollLeft,top:n.scrollTop,height:n.scrollHeight-Ve(this)-this.display.barHeight,width:n.scrollWidth-Ve(this)-this.display.barWidth,clientHeight:Qi(this),clientWidth:Kt(this)}},scrollIntoView:Se(function(n,i){n==null?(n={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof n=="number"?n={from:F(n,0),to:null}:n.from==null&&(n={from:n,to:null}),n.to||(n.to=n.from),n.margin=i||0,n.from.line!=null?zu(this,n):aa(this,n.from,n.to,n.margin)}),setSize:Se(function(n,i){var o=this,l=function(s){return typeof s=="number"||/^\d+$/.test(String(s))?s+"px":s};n!=null&&(this.display.wrapper.style.width=l(n)),i!=null&&(this.display.wrapper.style.height=l(i)),this.options.lineWrapping&&Jl(this);var a=this.display.viewFrom;this.doc.iter(a,this.display.viewTo,function(s){if(s.widgets){for(var u=0;u<s.widgets.length;u++)if(s.widgets[u].noHScroll){St(o,a,"widget");break}}++a}),this.curOp.forceUpdate=!0,de(this,"refresh",this)}),operation:function(n){return Ee(this,n)},startOperation:function(){return Xt(this)},endOperation:function(){return Yt(this)},refresh:Se(function(){var n=this.display.cachedTextHeight;Fe(this),this.curOp.forceUpdate=!0,Gr(this),Er(this,this.doc.scrollLeft,this.doc.scrollTop),uo(this.display),(n==null||Math.abs(n-sr(this.display))>.5)&&ro(this),de(this,"refresh",this)}),swapDoc:Se(function(n){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),ma(this,n),Gr(this),this.display.input.reset(),Er(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,ke(this,"swapDoc",this,i),i}),phrase:function(n){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,n)?i[n]:n},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},hr(e),e.registerHelper=function(n,i,o){r.hasOwnProperty(n)||(r[n]=e[n]={_global:[]}),r[n][i]=o},e.registerGlobalHelper=function(n,i,o,l){e.registerHelper(n,i,l),r[n]._global.push({pred:o,val:l})}}function di(e,t,r,n,i){var o=t,l=r,a=q(e,t.line);function s(){var A=t.line+r;return A<e.first||A>=e.first+e.size?!1:(t=new F(A,t.ch,t.sticky),a=q(e,A))}function u(A){var I;if(i?I=wf(e.cm,a,t,r):I=Ai(a,t,r),I==null)if(!A&&s())t=mo(i,e.cm,a,t.line,r);else return!1;else t=I;return!0}if(n=="char")u();else if(n=="column")u(!0);else if(n=="word"||n=="group")for(var h=null,p=n=="group",b=e.cm&&e.cm.getHelper(t,"wordChars"),y=!0;!(r<0&&!u(!y));y=!1){var k=a.text.charAt(t.ch)||`
`,S=bn(k,b)?"w":p&&k==`
`?"n":!p||/\s/.test(k)?null:"p";if(p&&!y&&!S&&(S="s"),h&&h!=S){r<0&&(r=1,u(),t.sticky="after");break}if(S&&(h=S),r>0&&!u(!y))break}var D=An(e,t,o,l,!0);return yi(o,D)&&(D.hitSide=!0),D}function hl(e,t,r,n){var i=e.doc,o=t.left,l;if(n=="page"){var a=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),s=Math.max(a-.5*sr(e.display),3);l=(r>0?t.bottom:t.top)+r*s}else n=="line"&&(l=r>0?t.bottom+3:t.top-3);for(var u;u=$i(e,o,l),!!u.outside;){if(r<0?l<=0:l>=i.height){u.hitSide=!0;break}l+=r*5}return u}var ae=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new bt,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};ae.prototype.init=function(e){var t=this,r=this,n=r.cm,i=r.div=e.lineDiv;Ya(i,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize),X(i,"paste",function(l){ye(n,l)||qa(l,n)||ce<=11&&setTimeout(be(n,function(){return t.updateFromDOM()}),20)}),X(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),X(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),X(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),X(i,"touchstart",function(){return r.forceCompositionEnd()}),X(i,"input",function(){t.composing||t.readFromDOMSoon()});function o(l){if(!ye(n,l)){if(n.somethingSelected())En({lineWise:!1,text:n.getSelections()}),l.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var a=Xa(n);En({lineWise:!0,text:a.text}),l.type=="cut"&&n.operation(function(){n.setSelections(a.ranges,0,et),n.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var s=Ke.text.join(`
`);if(l.clipboardData.setData("Text",s),l.clipboardData.getData("Text")==s){l.preventDefault();return}}var u=ja(),h=u.firstChild;n.display.lineSpace.insertBefore(u,n.display.lineSpace.firstChild),h.value=Ke.text.join(`
`);var p=document.activeElement;Wr(h),setTimeout(function(){n.display.lineSpace.removeChild(u),p.focus(),p==i&&r.showPrimarySelection()},50)}}X(i,"copy",o),X(i,"cut",o)};ae.prototype.prepareSelection=function(){var e=na(this.cm,!1);return e.focus=this.cm.state.focused,e};ae.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))};ae.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()};ae.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),i=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var o=Nn(t,e.anchorNode,e.anchorOffset),l=Nn(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&l&&!l.bad&&Z(_n(o,l),n)==0&&Z(Wn(o,l),i)==0)){var a=t.display.view,s=n.line>=t.display.viewFrom&&dl(t,n)||{node:a[0].measure.map[2],offset:0},u=i.line<t.display.viewTo&&dl(t,i);if(!u){var h=a[a.length-1].measure,p=h.maps?h.maps[h.maps.length-1]:h.map;u={node:p[p.length-1],offset:p[p.length-2]-p[p.length-3]}}if(!s||!u){e.removeAllRanges();return}var b=e.rangeCount&&e.getRangeAt(0),y;try{y=It(s.node,s.offset,u.offset,u.node)}catch{}y&&(!gt&&t.state.focused?(e.collapse(s.node,s.offset),y.collapsed||(e.removeAllRanges(),e.addRange(y))):(e.removeAllRanges(),e.addRange(y)),b&&e.anchorNode==null?e.addRange(b):gt&&this.startGracePeriod()),this.rememberSelection()}};ae.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)};ae.prototype.showMultipleSelections=function(e){Ie(this.cm.display.cursorDiv,e.cursors),Ie(this.cm.display.selectionDiv,e.selection)};ae.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset};ae.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return yt(this.div,t)};ae.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&(this.selectionInEditor()||this.showSelection(this.prepareSelection(),!0),this.div.focus())};ae.prototype.blur=function(){this.div.blur()};ae.prototype.getField=function(){return this.div};ae.prototype.supportsTouch=function(){return!0};ae.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():Ee(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function t(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,t))}this.polling.set(this.cm.options.pollInterval,t)};ae.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset};ae.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(In&&On&&this.cm.display.gutterSpecs.length&&Rf(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var r=Nn(t,e.anchorNode,e.anchorOffset),n=Nn(t,e.focusNode,e.focusOffset);r&&n&&Ee(t,function(){xe(t.doc,wt(r,n),et),(r.bad||n.bad)&&(t.curOp.selectionChanged=!0)})}}};ae.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,r=e.doc.sel.primary(),n=r.from(),i=r.to();if(n.ch==0&&n.line>e.firstLine()&&(n=F(n.line-1,q(e.doc,n.line-1).length)),i.ch==q(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=F(i.line+1,0)),n.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,l,a;n.line==t.viewFrom||(o=Wt(e,n.line))==0?(l=le(t.view[0].line),a=t.view[0].node):(l=le(t.view[o].line),a=t.view[o-1].node.nextSibling);var s=Wt(e,i.line),u,h;if(s==t.view.length-1?(u=t.viewTo-1,h=t.lineDiv.lastChild):(u=le(t.view[s+1].line)-1,h=t.view[s+1].node.previousSibling),!a)return!1;for(var p=e.doc.splitLines(Uf(e,a,h,l,u)),b=Ot(e.doc,F(l,0),F(u,q(e.doc,u).text.length));p.length>1&&b.length>1;)if(ie(p)==ie(b))p.pop(),b.pop(),u--;else if(p[0]==b[0])p.shift(),b.shift(),l++;else break;for(var y=0,k=0,S=p[0],D=b[0],A=Math.min(S.length,D.length);y<A&&S.charCodeAt(y)==D.charCodeAt(y);)++y;for(var I=ie(p),L=ie(b),E=Math.min(I.length-(p.length==1?y:0),L.length-(b.length==1?y:0));k<E&&I.charCodeAt(I.length-k-1)==L.charCodeAt(L.length-k-1);)++k;if(p.length==1&&b.length==1&&l==n.line)for(;y&&y>n.ch&&I.charCodeAt(I.length-k-1)==L.charCodeAt(L.length-k-1);)y--,k++;p[p.length-1]=I.slice(0,I.length-k).replace(/^\u200b+/,""),p[0]=p[0].slice(y).replace(/\u200b+$/,"");var P=F(l,y),W=F(u,b.length?ie(b).length-k:0);if(p.length>1||p[0]||Z(P,W))return gr(e.doc,p,P,W,"+input"),!0};ae.prototype.ensurePolled=function(){this.forceCompositionEnd()};ae.prototype.reset=function(){this.forceCompositionEnd()};ae.prototype.forceCompositionEnd=function(){!this.composing||(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())};ae.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))};ae.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Ee(this.cm,function(){return Fe(e.cm)})};ae.prototype.setUneditable=function(e){e.contentEditable="false"};ae.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||be(this.cm,yo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))};ae.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")};ae.prototype.onContextMenu=function(){};ae.prototype.resetPosition=function(){};ae.prototype.needsContentAttribute=!0;function dl(e,t){var r=Ji(e,t.line);if(!r||r.hidden)return null;var n=q(e.doc,t.line),i=Xl(r,n,t.line),o=st(n,e.doc.direction),l="left";if(o){var a=Br(o,t.ch);l=a%2?"right":"left"}var s=Zl(i.map,t.ch,l);return s.offset=s.collapse=="right"?s.end:s.start,s}function Rf(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function $t(e,t){return t&&(e.bad=!0),e}function Uf(e,t,r,n,i){var o="",l=!1,a=e.doc.lineSeparator(),s=!1;function u(y){return function(k){return k.id==y}}function h(){l&&(o+=a,s&&(o+=a),l=s=!1)}function p(y){y&&(h(),o+=y)}function b(y){if(y.nodeType==1){var k=y.getAttribute("cm-text");if(k){p(k);return}var S=y.getAttribute("cm-marker"),D;if(S){var A=e.findMarks(F(n,0),F(i+1,0),u(+S));A.length&&(D=A[0].find(0))&&p(Ot(e.doc,D.from,D.to).join(a));return}if(y.getAttribute("contenteditable")=="false")return;var I=/^(pre|div|p|li|table|br)$/i.test(y.nodeName);if(!/^br$/i.test(y.nodeName)&&y.textContent.length==0)return;I&&h();for(var L=0;L<y.childNodes.length;L++)b(y.childNodes[L]);/^(pre|p)$/i.test(y.nodeName)&&(s=!0),I&&(l=!0)}else y.nodeType==3&&p(y.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;b(t),t!=r;)t=t.nextSibling,s=!1;return o}function Nn(e,t,r){var n;if(t==e.display.lineDiv){if(n=e.display.lineDiv.childNodes[r],!n)return $t(e.clipPos(F(e.display.viewTo-1)),!0);t=null,r=0}else for(n=t;;n=n.parentNode){if(!n||n==e.display.lineDiv)return null;if(n.parentNode&&n.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==n)return Kf(o,t,r)}}function Kf(e,t,r){var n=e.text.firstChild,i=!1;if(!t||!yt(n,t))return $t(F(le(e.line),0),!0);if(t==n&&(i=!0,t=n.childNodes[r],r=0,!t)){var o=e.rest?ie(e.rest):e.line;return $t(F(le(o),o.text.length),i)}var l=t.nodeType==3?t:null,a=t;for(!l&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(l=t.firstChild,r&&(r=l.nodeValue.length));a.parentNode!=n;)a=a.parentNode;var s=e.measure,u=s.maps;function h(D,A,I){for(var L=-1;L<(u?u.length:0);L++)for(var E=L<0?s.map:u[L],P=0;P<E.length;P+=3){var W=E[P+2];if(W==D||W==A){var Y=le(L<0?e.line:e.rest[L]),_=E[P]+I;return(I<0||W!=D)&&(_=E[P+(I?1:0)]),F(Y,_)}}}var p=h(l,a,r);if(p)return $t(p,i);for(var b=a.nextSibling,y=l?l.nodeValue.length-r:0;b;b=b.nextSibling){if(p=h(b,b.firstChild,0),p)return $t(F(p.line,p.ch-y),i);y+=b.textContent.length}for(var k=a.previousSibling,S=r;k;k=k.previousSibling){if(p=h(k,k.firstChild,-1),p)return $t(F(p.line,p.ch+S),i);S+=k.textContent.length}}var ve=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new bt,this.hasSelection=!1,this.composing=null};ve.prototype.init=function(e){var t=this,r=this,n=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),Qr&&(i.style.width="0px"),X(i,"input",function(){re&&ce>=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),X(i,"paste",function(l){ye(n,l)||qa(l,n)||(n.state.pasteIncoming=+new Date,r.fastPoll())});function o(l){if(!ye(n,l)){if(n.somethingSelected())En({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var a=Xa(n);En({lineWise:!0,text:a.text}),l.type=="cut"?n.setSelections(a.ranges,null,et):(r.prevInput="",i.value=a.text.join(`
`),Wr(i))}else return;l.type=="cut"&&(n.state.cutIncoming=+new Date)}}X(i,"cut",o),X(i,"copy",o),X(e.scroller,"paste",function(l){if(!(lt(e,l)||ye(n,l))){if(!i.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var a=new Event("paste");a.clipboardData=l.clipboardData,i.dispatchEvent(a)}}),X(e.lineSpace,"selectstart",function(l){lt(e,l)||Ae(l)}),X(i,"compositionstart",function(){var l=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:l,range:n.markText(l,n.getCursor("to"),{className:"CodeMirror-composing"})}}),X(i,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})};ve.prototype.createField=function(e){this.wrapper=ja(),this.textarea=this.wrapper.firstChild};ve.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=na(e);if(e.options.moveInputWithCursor){var i=qe(e,r.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),l=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+l.top-o.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+l.left-o.left))}return n};ve.prototype.showSelection=function(e){var t=this.cm,r=t.display;Ie(r.cursorDiv,e.cursors),Ie(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")};ve.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing)){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&Wr(this.textarea),re&&ce>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",re&&ce>=9&&(this.hasSelection=null))}};ve.prototype.getField=function(){return this.textarea};ve.prototype.supportsTouch=function(){return!1};ve.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!zr||at()!=this.textarea))try{this.textarea.focus()}catch{}};ve.prototype.blur=function(){this.textarea.blur()};ve.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};ve.prototype.receivedFocus=function(){this.slowPoll()};ve.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})};ve.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)};ve.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Bs(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=r.value;if(i==n&&!t.somethingSelected())return!1;if(re&&ce>=9&&this.hasSelection===i||Ye&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(o==8203&&!n&&(n="\u200B"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var l=0,a=Math.min(n.length,i.length);l<a&&n.charCodeAt(l)==i.charCodeAt(l);)++l;return Ee(t,function(){yo(t,i.slice(l),n.length-l,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
`)>-1?r.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0};ve.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)};ve.prototype.onKeyPress=function(){re&&ce>=9&&(this.hasSelection=null),this.fastPoll()};ve.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Pt(r,e),l=n.scroller.scrollTop;if(!o||Xe)return;var a=r.options.resetSelectionOnContextMenu;a&&r.doc.sel.contains(o)==-1&&be(r,xe)(r.doc,wt(o),et);var s=i.style.cssText,u=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+`px;
z-index: 1000; background: `+(re?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var p;Le&&(p=window.scrollY),n.input.focus(),Le&&window.scrollTo(null,p),n.input.reset(),r.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=y,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function b(){if(i.selectionStart!=null){var S=r.somethingSelected(),D="\u200B"+(S?i.value:"");i.value="\u21DA",i.value=D,t.prevInput=S?"":"\u200B",i.selectionStart=1,i.selectionEnd=D.length,n.selForContextMenu=r.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=u,i.style.cssText=s,re&&ce<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=l),i.selectionStart!=null)){(!re||re&&ce<9)&&b();var S=0,D=function(){n.selForContextMenu==r.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="\u200B"?be(r,La)(r):S++<10?n.detectingSelectAll=setTimeout(D,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(D,200)}}if(re&&ce>=9&&b(),Ii){Rr(e);var k=function(){Oe(window,"mouseup",k),setTimeout(y,20)};X(window,"mouseup",k)}else setTimeout(y,50)};ve.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor"};ve.prototype.setUneditable=function(){};ve.prototype.needsContentAttribute=!1;function qf(e,t){if(t=t?Ht(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var r=at();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=a.getValue()}var i;if(e.form&&(X(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var l=o.submit=function(){n(),o.submit=i,o.submit(),o.submit=l}}catch{}}t.finishInit=function(s){s.save=n,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,n(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(Oe(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var a=R(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return a}function Gf(e){e.off=Oe,e.on=X,e.wheelEventPixels=Qu,e.Doc=De,e.splitLines=Wi,e.countColumn=Pe,e.findColumn=pi,e.isWordChar=vi,e.Pass=zn,e.signal=de,e.Line=ar,e.changeEnd=kt,e.scrollbarModel=ua,e.Pos=F,e.cmpPos=Z,e.modes=_i,e.mimeModes=er,e.resolveMode=Sn,e.getMode=Bi,e.modeExtensions=ir,e.extendMode=Gs,e.copyState=zt,e.startState=Dl,e.innerMode=Ri,e.commands=jr,e.keyMap=nt,e.keyName=Ia,e.isModifierKey=Na,e.lookupKey=lr,e.normalizeKeyMap=bf,e.StringStream=pe,e.SharedTextMarker=on,e.TextMarker=Lt,e.LineWidget=nn,e.e_preventDefault=Ae,e.e_stopPropagation=Tl,e.e_stop=Rr,e.addClass=Ut,e.contains=yt,e.rmClass=Rt}zf(R);Bf(R);var Xf="iter insert remove copy getEditor constructor".split(" ");for(var yn in De.prototype)De.prototype.hasOwnProperty(yn)&&Ce(Xf,yn)<0&&(R.prototype[yn]=function(e){return function(){return e.apply(this.doc,arguments)}}(De.prototype[yn]));hr(De);R.inputStyles={textarea:ve,contenteditable:ae};R.defineMode=function(e){!R.defaults.mode&&e!="null"&&(R.defaults.mode=e),Ks.apply(this,arguments)};R.defineMIME=qs;R.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}});R.defineMIME("text/plain","null");R.defineExtension=function(e,t){R.prototype[e]=t};R.defineDocExtension=function(e,t){De.prototype[e]=t};R.fromTextArea=qf;Gf(R);R.version="5.49.2";window.CodeMirror=R;var Yf={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},jf={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};R.defineMode("xml",Zf);function Zf(e,t){var r=e.indentUnit,n={},i=t.htmlMode?Yf:jf;for(var o in i)n[o]=i[o];for(var o in t)n[o]=t[o];var l,a;function s(v,C){function d(j){return C.tokenize=j,j(v,C)}var B=v.next();if(B=="<")return v.eat("!")?v.eat("[")?v.match("CDATA[")?d(p("atom","]]>")):null:v.match("--")?d(p("comment","-->")):v.match("DOCTYPE",!0,!0)?(v.eatWhile(/[\w\._\-]/),d(b(1))):null:v.eat("?")?(v.eatWhile(/[\w\._\-]/),C.tokenize=p("meta","?>"),"meta"):(l=v.eat("/")?"closeTag":"openTag",C.tokenize=u,"tag bracket");if(B=="&"){var Q;return v.eat("#")?v.eat("x")?Q=v.eatWhile(/[a-fA-F\d]/)&&v.eat(";"):Q=v.eatWhile(/[\d]/)&&v.eat(";"):Q=v.eatWhile(/[\w\.\-:]/)&&v.eat(";"),Q?"atom":"error"}else return v.eatWhile(/[^&<]/),null}s.isInText=!0;function u(v,C){var d=v.next();if(d==">"||d=="/"&&v.eat(">"))return C.tokenize=s,l=d==">"?"endTag":"selfcloseTag","tag bracket";if(d=="=")return l="equals",null;if(d=="<"){C.tokenize=s,C.state=D,C.tagName=C.tagStart=null;var B=C.tokenize(v,C);return B?B+" tag error":"tag error"}else return/[\'\"]/.test(d)?(C.tokenize=h(d),C.stringStartCol=v.column(),C.tokenize(v,C)):(v.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function h(v){var C=function(d,B){for(;!d.eol();)if(d.next()==v){B.tokenize=u;break}return"string"};return C.isInAttribute=!0,C}function p(v,C){return function(d,B){for(;!d.eol();){if(d.match(C)){B.tokenize=s;break}d.next()}return v}}function b(v){return function(C,d){for(var B;(B=C.next())!=null;){if(B=="<")return d.tokenize=b(v+1),d.tokenize(C,d);if(B==">")if(v==1){d.tokenize=s;break}else return d.tokenize=b(v-1),d.tokenize(C,d)}return"meta"}}function y(v,C,d){this.prev=v.context,this.tagName=C,this.indent=v.indented,this.startOfLine=d,(n.doNotIndent.hasOwnProperty(C)||v.context&&v.context.noIndent)&&(this.noIndent=!0)}function k(v){v.context&&(v.context=v.context.prev)}function S(v,C){for(var d;;){if(!v.context||(d=v.context.tagName,!n.contextGrabbers.hasOwnProperty(d)||!n.contextGrabbers[d].hasOwnProperty(C)))return;k(v)}}function D(v,C,d){return v=="openTag"?(d.tagStart=C.column(),A):v=="closeTag"?I:D}function A(v,C,d){return v=="word"?(d.tagName=C.current(),a="tag",P):n.allowMissingTagName&&v=="endTag"?(a="tag bracket",P(v,C,d)):(a="error",A)}function I(v,C,d){if(v=="word"){var B=C.current();return d.context&&d.context.tagName!=B&&n.implicitlyClosed.hasOwnProperty(d.context.tagName)&&k(d),d.context&&d.context.tagName==B||n.matchClosing===!1?(a="tag",L):(a="tag error",E)}else return n.allowMissingTagName&&v=="endTag"?(a="tag bracket",L(v,C,d)):(a="error",E)}function L(v,C,d){return v!="endTag"?(a="error",L):(k(d),D)}function E(v,C,d){return a="error",L(v,C,d)}function P(v,C,d){if(v=="word")return a="attribute",W;if(v=="endTag"||v=="selfcloseTag"){var B=d.tagName,Q=d.tagStart;return d.tagName=d.tagStart=null,v=="selfcloseTag"||n.autoSelfClosers.hasOwnProperty(B)?S(d,B):(S(d,B),d.context=new y(d,B,Q==d.indented)),D}return a="error",P}function W(v,C,d){return v=="equals"?Y:(n.allowMissing||(a="error"),P(v,C,d))}function Y(v,C,d){return v=="string"?_:v=="word"&&n.allowUnquoted?(a="string",P):(a="error",P(v,C,d))}function _(v,C,d){return v=="string"?_:P(v,C,d)}return{startState:function(v){var C={tokenize:s,state:D,indented:v||0,tagName:null,tagStart:null,context:null};return v!=null&&(C.baseIndent=v),C},token:function(v,C){if(!C.tagName&&v.sol()&&(C.indented=v.indentation()),v.eatSpace())return null;l=null;var d=C.tokenize(v,C);return(d||l)&&d!="comment"&&(a=null,C.state=C.state(l||d,v,C),a&&(d=a=="error"?d+" error":a)),d},indent:function(v,C,d){var B=v.context;if(v.tokenize.isInAttribute)return v.tagStart==v.indented?v.stringStartCol+1:v.indented+r;if(B&&B.noIndent)return R.Pass;if(v.tokenize!=u&&v.tokenize!=s)return d?d.match(/^(\s*)/)[0].length:0;if(v.tagName)return n.multilineTagIndentPastTag!==!1?v.tagStart+v.tagName.length+2:v.tagStart+r*(n.multilineTagIndentFactor||1);if(n.alignCDATA&&/<!\[CDATA\[/.test(C))return 0;var Q=C&&/^<(\/)?([\w_:\.-]*)/.exec(C);if(Q&&Q[1])for(;B;)if(B.tagName==Q[2]){B=B.prev;break}else if(n.implicitlyClosed.hasOwnProperty(B.tagName))B=B.prev;else break;else if(Q)for(;B;){var j=n.contextGrabbers[B.tagName];if(j&&j.hasOwnProperty(Q[2]))B=B.prev;else break}for(;B&&B.prev&&!B.startOfLine;)B=B.prev;return B?B.indent+r:v.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:n.htmlMode?"html":"xml",helperType:n.htmlMode?"html":"xml",skipAttribute:function(v){v.state==Y&&(v.state=P)},xmlCurrentTag:function(v){return v.tagName?{name:v.tagName,close:v.type=="closeTag"}:null},xmlCurrentContext:function(v){for(var C=[],d=v.context;d;d=d.prev)d.tagName&&C.push(d.tagName);return C.reverse()}}}R.defineMIME("text/xml","xml");R.defineMIME("php","xml");R.defineMIME("vue","xml");R.defineMIME("html","xml");R.defineMIME("application/xml","xml");R.mimeModes.hasOwnProperty("text/html")||R.defineMIME("text/html",{name:"xml",htmlMode:!0});R.defineMode("css",function(e,t){var r=t.inline;t.propertyKeywords||(t=R.resolveMode("text/css"));var n=e.indentUnit,i=t.tokenHooks,o=t.documentTypes||{},l=t.mediaTypes||{},a=t.mediaFeatures||{},s=t.mediaValueKeywords||{},u=t.propertyKeywords||{},h=t.nonStandardPropertyKeywords||{},p=t.fontProperties||{},b=t.counterDescriptors||{},y=t.colorKeywords||{},k=t.valueKeywords||{},S=t.allowNested,D=t.lineComment,A=t.supportsAtComponent===!0,I,L;function E(w,T){return I=T,w}function P(w,T){var x=w.next();if(i[x]){var K=i[x](w,T);if(K!==!1)return K}if(x=="@")return w.eatWhile(/[\w\\\-]/),E("def",w.current());if(x=="="||(x=="~"||x=="|")&&w.eat("="))return E(null,"compare");if(x=='"'||x=="'")return T.tokenize=W(x),T.tokenize(w,T);if(x=="#")return w.eatWhile(/[\w\\\-]/),E("atom","hash");if(x=="!")return w.match(/^\s*\w*/),E("keyword","important");if(/\d/.test(x)||x=="."&&w.eat(/\d/))return w.eatWhile(/[\w.%]/),E("number","unit");if(x==="-"){if(/[\d.]/.test(w.peek()))return w.eatWhile(/[\w.%]/),E("number","unit");if(w.match(/^-[\w\\\-]*/))return w.eatWhile(/[\w\\\-]/),w.match(/^\s*:/,!1)?E("variable-2","variable-definition"):E("variable-2","variable");if(w.match(/^\w+-/))return E("meta","meta")}else return/[,+>*\/]/.test(x)?E(null,"select-op"):x=="."&&w.match(/^-?[_a-z][_a-z0-9-]*/i)?E("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(x)?E(null,x):w.match(/[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/.test(w.current().toLowerCase())&&(T.tokenize=Y),E("variable callee","variable")):/[\w\\\-]/.test(x)?(w.eatWhile(/[\w\\\-]/),E("property","word")):E(null,null)}function W(w){return function(T,x){for(var K=!1,m;(m=T.next())!=null;){if(m==w&&!K){w==")"&&T.backUp(1);break}K=!K&&m=="\\"}return(m==w||!K&&w!=")")&&(x.tokenize=null),E("string","string")}}function Y(w,T){return w.next(),w.match(/\s*[\"\')]/,!1)?T.tokenize=null:T.tokenize=W(")"),E(null,"(")}function _(w,T,x){this.type=w,this.indent=T,this.prev=x}function v(w,T,x,K){return w.context=new _(x,T.indentation()+(K===!1?0:n),w.context),x}function C(w){return w.context.prev&&(w.context=w.context.prev),w.context.type}function d(w,T,x){return j[x.context.type](w,T,x)}function B(w,T,x,K){for(var m=K||1;m>0;m--)x.context=x.context.prev;return d(w,T,x)}function Q(w){var T=w.current().toLowerCase();k.hasOwnProperty(T)?L="atom":y.hasOwnProperty(T)?L="keyword":L="variable"}var j={};return j.top=function(w,T,x){if(w=="{")return v(x,T,"block");if(w=="}"&&x.context.prev)return C(x);if(A&&/@component/i.test(w))return v(x,T,"atComponentBlock");if(/^@(-moz-)?document$/i.test(w))return v(x,T,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(w))return v(x,T,"atBlock");if(/^@(font-face|counter-style)/i.test(w))return x.stateArg=w,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(w))return"keyframes";if(w&&w.charAt(0)=="@")return v(x,T,"at");if(w=="hash")L="builtin";else if(w=="word")L="tag";else{if(w=="variable-definition")return"maybeprop";if(w=="interpolation")return v(x,T,"interpolation");if(w==":")return"pseudo";if(S&&w=="(")return v(x,T,"parens")}return x.context.type},j.block=function(w,T,x){if(w=="word"){var K=T.current().toLowerCase();return u.hasOwnProperty(K)?(L="property","maybeprop"):h.hasOwnProperty(K)?(L="string-2","maybeprop"):S?(L=T.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(L+=" error","maybeprop")}else return w=="meta"?"block":!S&&(w=="hash"||w=="qualifier")?(L="error","block"):j.top(w,T,x)},j.maybeprop=function(w,T,x){return w==":"?v(x,T,"prop"):d(w,T,x)},j.prop=function(w,T,x){if(w==";")return C(x);if(w=="{"&&S)return v(x,T,"propBlock");if(w=="}"||w=="{")return B(w,T,x);if(w=="(")return v(x,T,"parens");if(w=="hash"&&!/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(T.current()))L+=" error";else if(w=="word")Q(T);else if(w=="interpolation")return v(x,T,"interpolation");return"prop"},j.propBlock=function(w,T,x){return w=="}"?C(x):w=="word"?(L="property","maybeprop"):x.context.type},j.parens=function(w,T,x){return w=="{"||w=="}"?B(w,T,x):w==")"?C(x):w=="("?v(x,T,"parens"):w=="interpolation"?v(x,T,"interpolation"):(w=="word"&&Q(T),"parens")},j.pseudo=function(w,T,x){return w=="meta"?"pseudo":w=="word"?(L="variable-3",x.context.type):d(w,T,x)},j.documentTypes=function(w,T,x){return w=="word"&&o.hasOwnProperty(T.current())?(L="tag",x.context.type):j.atBlock(w,T,x)},j.atBlock=function(w,T,x){if(w=="(")return v(x,T,"atBlock_parens");if(w=="}"||w==";")return B(w,T,x);if(w=="{")return C(x)&&v(x,T,S?"block":"top");if(w=="interpolation")return v(x,T,"interpolation");if(w=="word"){var K=T.current().toLowerCase();K=="only"||K=="not"||K=="and"||K=="or"?L="keyword":l.hasOwnProperty(K)?L="attribute":a.hasOwnProperty(K)?L="property":s.hasOwnProperty(K)?L="keyword":u.hasOwnProperty(K)?L="property":h.hasOwnProperty(K)?L="string-2":k.hasOwnProperty(K)?L="atom":y.hasOwnProperty(K)?L="keyword":L="error"}return x.context.type},j.atComponentBlock=function(w,T,x){return w=="}"?B(w,T,x):w=="{"?C(x)&&v(x,T,S?"block":"top",!1):(w=="word"&&(L="error"),x.context.type)},j.atBlock_parens=function(w,T,x){return w==")"?C(x):w=="{"||w=="}"?B(w,T,x,2):j.atBlock(w,T,x)},j.restricted_atBlock_before=function(w,T,x){return w=="{"?v(x,T,"restricted_atBlock"):w=="word"&&x.stateArg=="@counter-style"?(L="variable","restricted_atBlock_before"):d(w,T,x)},j.restricted_atBlock=function(w,T,x){return w=="}"?(x.stateArg=null,C(x)):w=="word"?(x.stateArg=="@font-face"&&!p.hasOwnProperty(T.current().toLowerCase())||x.stateArg=="@counter-style"&&!b.hasOwnProperty(T.current().toLowerCase())?L="error":L="property","maybeprop"):"restricted_atBlock"},j.keyframes=function(w,T,x){return w=="word"?(L="variable","keyframes"):w=="{"?v(x,T,"top"):d(w,T,x)},j.at=function(w,T,x){return w==";"?C(x):w=="{"||w=="}"?B(w,T,x):(w=="word"?L="tag":w=="hash"&&(L="builtin"),"at")},j.interpolation=function(w,T,x){return w=="}"?C(x):w=="{"||w==";"?B(w,T,x):(w=="word"?L="variable":w!="variable"&&w!="("&&w!=")"&&(L="error"),"interpolation")},{startState:function(w){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new _(r?"block":"top",w||0,null)}},token:function(w,T){if(!T.tokenize&&w.eatSpace())return null;var x=(T.tokenize||P)(w,T);return x&&typeof x=="object"&&(I=x[1],x=x[0]),L=x,I!="comment"&&(T.state=j[T.state](I,w,T)),L},indent:function(w,T){var x=w.context,K=T&&T.charAt(0),m=x.indent;return x.type=="prop"&&(K=="}"||K==")")&&(x=x.prev),x.prev&&(K=="}"&&(x.type=="block"||x.type=="top"||x.type=="interpolation"||x.type=="restricted_atBlock")?(x=x.prev,m=x.indent):(K==")"&&(x.type=="parens"||x.type=="atBlock_parens")||K=="{"&&(x.type=="at"||x.type=="atBlock"))&&(m=Math.max(0,x.indent-n))),m},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:D,fold:"brace"}});function tt(e){for(var t={},r=0;r<e.length;++r)t[e[r].toLowerCase()]=!0;return t}var Za=["domain","regexp","url","url-prefix"],Qa=tt(Za),Ja=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],Qn=tt(Ja),Va=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],Jn=tt(Va),$a=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],bo=tt($a),es=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","place-content","place-items","place-self","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","user-select","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],Vn=tt(es),ts=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],$n=tt(ts),Qf=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],ei=tt(Qf),Jf=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],rs=tt(Jf),ns=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],ti=tt(ns),is=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","opacity","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],ri=tt(is),Vf=Za.concat(Ja).concat(Va).concat($a).concat(es).concat(ts).concat(ns).concat(is);R.registerHelper("hintWords","css",Vf);function xt(e,t){for(var r=!1,n;(n=e.next())!=null;){if(r&&n=="/"){t.tokenize=null;break}r=n=="*"}return["comment","comment"]}R.defineMIME("text/css",{documentTypes:Qa,mediaTypes:Qn,mediaFeatures:Jn,mediaValueKeywords:bo,propertyKeywords:Vn,nonStandardPropertyKeywords:$n,fontProperties:ei,counterDescriptors:rs,colorKeywords:ti,valueKeywords:ri,tokenHooks:{"/":function(e,t){return e.eat("*")?(t.tokenize=xt,xt(e,t)):!1}},name:"css"});R.defineMIME("text/x-scss",{mediaTypes:Qn,mediaFeatures:Jn,mediaValueKeywords:bo,propertyKeywords:Vn,nonStandardPropertyKeywords:$n,colorKeywords:ti,valueKeywords:ri,fontProperties:ei,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=xt,xt(e,t)):["operator","operator"]},":":function(e){return e.match(/\s*\{/,!1)?[null,null]:!1},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return e.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"});R.defineMIME("text/x-less",{mediaTypes:Qn,mediaFeatures:Jn,mediaValueKeywords:bo,propertyKeywords:Vn,nonStandardPropertyKeywords:$n,colorKeywords:ti,valueKeywords:ri,fontProperties:ei,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=xt,xt(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)?!1:(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"});R.defineMIME("text/x-gss",{documentTypes:Qa,mediaTypes:Qn,mediaFeatures:Jn,propertyKeywords:Vn,nonStandardPropertyKeywords:$n,fontProperties:ei,counterDescriptors:rs,colorKeywords:ti,valueKeywords:ri,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return e.eat("*")?(t.tokenize=xt,xt(e,t)):!1}},name:"css",helperType:"gss"});R.defineMIME("less","css");R.defineMIME("scss","css");R.defineMIME("sass","css");R.defineMIME("style","css");R.defineMode("javascript",os);R.defineMode("js",os);function os(e,t){var r=e.indentUnit,n=t.statementIndent,i=t.jsonld,o=t.json||i,l=t.typescript,a=t.wordCharacters||/[\w$\xa1-\uffff]/,s=function(){function f(Me){return{type:Me,style:"keyword"}}var g=f("keyword a"),M=f("keyword b"),N=f("keyword c"),J=f("keyword d"),te=f("operator"),fe={type:"atom",style:"atom"};return{if:f("if"),while:g,with:g,else:M,do:M,try:M,finally:M,return:J,break:J,continue:J,new:f("new"),delete:N,void:N,throw:N,debugger:f("debugger"),var:f("var"),const:f("var"),let:f("var"),function:f("function"),catch:f("catch"),for:f("for"),switch:f("switch"),case:f("case"),default:f("default"),in:te,typeof:te,instanceof:te,true:fe,false:fe,null:fe,undefined:fe,NaN:fe,Infinity:fe,this:f("this"),class:f("class"),super:f("atom"),yield:N,export:f("export"),import:f("import"),extends:N,await:N}}(),u=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function p(f){for(var g=!1,M,N=!1;(M=f.next())!=null;){if(!g){if(M=="/"&&!N)return;M=="["?N=!0:N&&M=="]"&&(N=!1)}g=!g&&M=="\\"}}var b,y;function k(f,g,M){return b=f,y=M,g}function S(f,g){var M=f.next();if(M=='"'||M=="'")return g.tokenize=D(M),g.tokenize(f,g);if(M=="."&&f.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return k("number","number");if(M=="."&&f.match(".."))return k("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(M))return k(M);if(M=="="&&f.eat(">"))return k("=>","operator");if(M=="0"&&f.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return k("number","number");if(/\d/.test(M))return f.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),k("number","number");if(M=="/")return f.eat("*")?(g.tokenize=A,A(f,g)):f.eat("/")?(f.skipToEnd(),k("comment","comment")):Ao(f,g,1)?(p(f),f.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),k("regexp","string-2")):(f.eat("="),k("operator","operator",f.current()));if(M=="`")return g.tokenize=I,I(f,g);if(M=="#")return f.skipToEnd(),k("error","error");if(M=="<"&&f.match("!--")||M=="-"&&f.match("->"))return f.skipToEnd(),k("comment","comment");if(u.test(M))return(M!=">"||!g.lexical||g.lexical.type!=">")&&(f.eat("=")?(M=="!"||M=="=")&&f.eat("="):/[<>*+\-]/.test(M)&&(f.eat(M),M==">"&&f.eat(M))),k("operator","operator",f.current());if(a.test(M)){f.eatWhile(a);var N=f.current();if(g.lastType!="."){if(s.propertyIsEnumerable(N)){var J=s[N];return k(J.type,J.style,N)}if(N=="async"&&f.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/,!1))return k("async","keyword",N)}return k("variable","variable",N)}}function D(f){return function(g,M){var N=!1,J;if(i&&g.peek()=="@"&&g.match(h))return M.tokenize=S,k("jsonld-keyword","meta");for(;(J=g.next())!=null&&!(J==f&&!N);)N=!N&&J=="\\";return N||(M.tokenize=S),k("string","string")}}function A(f,g){for(var M=!1,N;N=f.next();){if(N=="/"&&M){g.tokenize=S;break}M=N=="*"}return k("comment","comment")}function I(f,g){for(var M=!1,N;(N=f.next())!=null;){if(!M&&(N=="`"||N=="$"&&f.eat("{"))){g.tokenize=S;break}M=!M&&N=="\\"}return k("quasi","string-2",f.current())}var L="([{}])";function E(f,g){g.fatArrowAt&&(g.fatArrowAt=null);var M=f.string.indexOf("=>",f.start);if(!(M<0)){if(l){var N=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(f.string.slice(f.start,M));N&&(M=N.index)}for(var J=0,te=!1,fe=M-1;fe>=0;--fe){var Me=f.string.charAt(fe),je=L.indexOf(Me);if(je>=0&&je<3){if(!J){++fe;break}if(--J==0){Me=="("&&(te=!0);break}}else if(je>=3&&je<6)++J;else if(a.test(Me))te=!0;else if(/["'\/`]/.test(Me))for(;;--fe){if(fe==0)return;var Ss=f.string.charAt(fe-1);if(Ss==Me&&f.string.charAt(fe-2)!="\\"){fe--;break}}else if(te&&!J){++fe;break}}te&&!J&&(g.fatArrowAt=fe)}}var P={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,"jsonld-keyword":!0};function W(f,g,M,N,J,te){this.indented=f,this.column=g,this.type=M,this.prev=J,this.info=te,N!=null&&(this.align=N)}function Y(f,g){for(var M=f.localVars;M;M=M.next)if(M.name==g)return!0;for(var N=f.context;N;N=N.prev)for(var M=N.vars;M;M=M.next)if(M.name==g)return!0}function _(f,g,M,N,J){var te=f.cc;for(v.state=f,v.stream=J,v.marked=null,v.cc=te,v.style=g,f.lexical.hasOwnProperty("align")||(f.lexical.align=!0);;){var fe=te.length?te.pop():o?$:se;if(fe(M,N)){for(;te.length&&te[te.length-1].lex;)te.pop()();return v.marked?v.marked:M=="variable"&&Y(f,N)?"variable-2":g}}}var v={state:null,column:null,marked:null,cc:null};function C(){for(var f=arguments.length-1;f>=0;f--)v.cc.push(arguments[f])}function d(){return C.apply(null,arguments),!0}function B(f,g){for(var M=g;M;M=M.next)if(M.name==f)return!0;return!1}function Q(f){var g=v.state;if(v.marked="def",g.context){if(g.lexical.info=="var"&&g.context&&g.context.block){var M=j(f,g.context);if(M!=null){g.context=M;return}}else if(!B(f,g.localVars)){g.localVars=new x(f,g.localVars);return}}t.globalVars&&!B(f,g.globalVars)&&(g.globalVars=new x(f,g.globalVars))}function j(f,g){if(g)if(g.block){var M=j(f,g.prev);return M?M==g.prev?g:new T(M,g.vars,!0):null}else return B(f,g.vars)?g:new T(g.prev,new x(f,g.vars),!1);else return null}function w(f){return f=="public"||f=="private"||f=="protected"||f=="abstract"||f=="readonly"}function T(f,g,M){this.prev=f,this.vars=g,this.block=M}function x(f,g){this.name=f,this.next=g}var K=new x("this",new x("arguments",null));function m(){v.state.context=new T(v.state.context,v.state.localVars,!1),v.state.localVars=K}function c(){v.state.context=new T(v.state.context,v.state.localVars,!0),v.state.localVars=null}function z(){v.state.localVars=v.state.context.vars,v.state.context=v.state.context.prev}z.lex=!0;function H(f,g){var M=function(){var N=v.state,J=N.indented;if(N.lexical.type=="stat")J=N.lexical.indented;else for(var te=N.lexical;te&&te.type==")"&&te.align;te=te.prev)J=te.indented;N.lexical=new W(J,v.stream.column(),f,null,N.lexical,g)};return M.lex=!0,M}function O(){var f=v.state;f.lexical.prev&&(f.lexical.type==")"&&(f.indented=f.lexical.indented),f.lexical=f.lexical.prev)}O.lex=!0;function U(f){function g(M){return M==f?d():f==";"||M=="}"||M==")"||M=="]"?C():d(g)}return g}function se(f,g){return f=="var"?d(H("vardef",g),oi,U(";"),O):f=="keyword a"?d(H("form"),oe,se,O):f=="keyword b"?d(H("form"),se,O):f=="keyword d"?v.stream.match(/^\s*$/,!1)?d():d(H("stat"),ze,U(";"),O):f=="debugger"?d(U(";")):f=="{"?d(H("}"),c,an,O,z):f==";"?d():f=="if"?(v.state.lexical.info=="else"&&v.state.cc[v.state.cc.length-1]==O&&v.state.cc.pop()(),d(H("form"),oe,se,O,xo)):f=="function"?d(Ue):f=="for"?d(H("form"),Co,se,O):f=="class"||l&&g=="interface"?(v.marked="keyword",d(H("form",f=="class"?f:g),Lo,O)):f=="variable"?l&&g=="declare"?(v.marked="keyword",d(se)):l&&(g=="module"||g=="enum"||g=="type")&&v.stream.match(/^\s*\w/,!1)?(v.marked="keyword",g=="enum"?d(Do):g=="type"?d(So,U("operator"),ue,U(";")):d(H("form"),Re,U("{"),H("}"),an,O,O)):l&&g=="namespace"?(v.marked="keyword",d(H("form"),$,se,O)):l&&g=="abstract"?(v.marked="keyword",d(se)):d(H("stat"),ls):f=="switch"?d(H("form"),oe,U("{"),H("}","switch"),c,an,O,O,z):f=="case"?d($,U(":")):f=="default"?d(U(":")):f=="catch"?d(H("form"),m,ge,se,O,z):f=="export"?d(H("stat"),ys,O):f=="import"?d(H("stat"),bs,O):f=="async"?d(se):g=="@"?d($,se):C(H("stat"),$,U(";"),O)}function ge(f){if(f=="(")return d(At,U(")"))}function $(f,g){return he(f,g,!1)}function ee(f,g){return he(f,g,!0)}function oe(f){return f!="("?C():d(H(")"),$,U(")"),O)}function he(f,g,M){if(v.state.fatArrowAt==v.stream.start){var N=M?Mt:Tt;if(f=="(")return d(m,H(")"),we(At,")"),O,U("=>"),N,z);if(f=="variable")return C(m,Re,U("=>"),N,z)}var J=M?_e:ut;return P.hasOwnProperty(f)?d(J):f=="function"?d(Ue,J):f=="class"||l&&g=="interface"?(v.marked="keyword",d(H("form"),ms,O)):f=="keyword c"||f=="async"?d(M?ee:$):f=="("?d(H(")"),ze,U(")"),O,J):f=="operator"||f=="spread"?d(M?ee:$):f=="["?d(H("]"),ks,O,J):f=="{"?mr(ln,"}",null,J):f=="quasi"?C(Be,J):f=="new"?d(ct(M)):f=="import"?d($):d()}function ze(f){return f.match(/[;\}\)\],]/)?C():C($)}function ut(f,g){return f==","?d($):_e(f,g,!1)}function _e(f,g,M){var N=M==!1?ut:_e,J=M==!1?$:ee;if(f=="=>")return d(m,M?Mt:Tt,z);if(f=="operator")return/\+\+|--/.test(g)||l&&g=="!"?d(N):l&&g=="<"&&v.stream.match(/^([^>]|<.*?>)*>\s*\(/,!1)?d(H(">"),we(ue,">"),O,N):g=="?"?d($,U(":"),J):d(J);if(f=="quasi")return C(Be,N);if(f!=";"){if(f=="(")return mr(ee,")","call",N);if(f==".")return d(as,N);if(f=="[")return d(H("]"),ze,U("]"),O,N);if(l&&g=="as")return v.marked="keyword",d(ue,N);if(f=="regexp")return v.state.lastType=v.marked="operator",v.stream.backUp(v.stream.pos-v.stream.start-1),d(J)}}function Be(f,g){return f!="quasi"?C():g.slice(g.length-2)!="${"?d(Be):d($,ft)}function ft(f){if(f=="}")return v.marked="string-2",v.state.tokenize=I,d(Be)}function Tt(f){return E(v.stream,v.state),C(f=="{"?se:$)}function Mt(f){return E(v.stream,v.state),C(f=="{"?se:ee)}function ct(f){return function(g){return g=="."?d(f?ni:ht):g=="variable"&&l?d(hs,f?_e:ut):C(f?ee:$)}}function ht(f,g){if(g=="target")return v.marked="keyword",d(ut)}function ni(f,g){if(g=="target")return v.marked="keyword",d(_e)}function ls(f){return f==":"?d(O,se):C(ut,U(";"),O)}function as(f){if(f=="variable")return v.marked="property",d()}function ln(f,g){if(f=="async")return v.marked="property",d(ln);if(f=="variable"||v.style=="keyword"){if(v.marked="property",g=="get"||g=="set")return d(ss);var M;return l&&v.state.fatArrowAt==v.stream.start&&(M=v.stream.match(/^\s*:\s*/,!1))&&(v.state.fatArrowAt=v.stream.pos+M[0].length),d(Dt)}else{if(f=="number"||f=="string")return v.marked=i?"property":v.style+" property",d(Dt);if(f=="jsonld-keyword")return d(Dt);if(l&&w(g))return v.marked="keyword",d(ln);if(f=="[")return d($,jt,U("]"),Dt);if(f=="spread")return d(ee,Dt);if(g=="*")return v.marked="keyword",d(ln);if(f==":")return C(Dt)}}function ss(f){return f!="variable"?C(Dt):(v.marked="property",d(Ue))}function Dt(f){if(f==":")return d(ee);if(f=="(")return C(Ue)}function we(f,g,M){function N(J,te){if(M?M.indexOf(J)>-1:J==","){var fe=v.state.lexical;return fe.info=="call"&&(fe.pos=(fe.pos||0)+1),d(function(Me,je){return Me==g||je==g?C():C(f)},N)}return J==g||te==g?d():M&&M.indexOf(";")>-1?C(f):d(U(g))}return function(J,te){return J==g||te==g?d():C(f,N)}}function mr(f,g,M){for(var N=3;N<arguments.length;N++)v.cc.push(arguments[N]);return d(H(g,M),we(f,g),O)}function an(f){return f=="}"?d():C(se,an)}function jt(f,g){if(l){if(f==":")return d(ue);if(g=="?")return d(jt)}}function us(f,g){if(l&&(f==":"||g=="in"))return d(ue)}function wo(f){if(l&&f==":")return v.stream.match(/^\s*\w+\s+is\b/,!1)?d($,fs,ue):d(ue)}function fs(f,g){if(g=="is")return v.marked="keyword",d()}function ue(f,g){if(g=="keyof"||g=="typeof"||g=="infer")return v.marked="keyword",d(g=="typeof"?ee:ue);if(f=="variable"||g=="void")return v.marked="type",d(dt);if(g=="|"||g=="&")return d(ue);if(f=="string"||f=="number"||f=="atom")return d(dt);if(f=="[")return d(H("]"),we(ue,"]",","),O,dt);if(f=="{")return d(H("}"),we(yr,"}",",;"),O,dt);if(f=="(")return d(we(ii,")"),cs,dt);if(f=="<")return d(we(ue,">"),ue)}function cs(f){if(f=="=>")return d(ue)}function yr(f,g){if(f=="variable"||v.style=="keyword")return v.marked="property",d(yr);if(g=="?"||f=="number"||f=="string")return d(yr);if(f==":")return d(ue);if(f=="[")return d(U("variable"),us,U("]"),yr);if(f=="(")return C(Qt,yr)}function ii(f,g){return f=="variable"&&v.stream.match(/^\s*[?:]/,!1)||g=="?"?d(ii):f==":"?d(ue):f=="spread"?d(ii):C(ue)}function dt(f,g){if(g=="<")return d(H(">"),we(ue,">"),O,dt);if(g=="|"||f=="."||g=="&")return d(ue);if(f=="[")return d(ue,U("]"),dt);if(g=="extends"||g=="implements")return v.marked="keyword",d(ue);if(g=="?")return d(ue,U(":"),ue)}function hs(f,g){if(g=="<")return d(H(">"),we(ue,">"),O,dt)}function sn(){return C(ue,ds)}function ds(f,g){if(g=="=")return d(ue)}function oi(f,g){return g=="enum"?(v.marked="keyword",d(Do)):C(Re,jt,pt,vs)}function Re(f,g){if(l&&w(g))return v.marked="keyword",d(Re);if(f=="variable")return Q(g),d();if(f=="spread")return d(Re);if(f=="[")return mr(ps,"]");if(f=="{")return mr(ko,"}")}function ko(f,g){return f=="variable"&&!v.stream.match(/^\s*:/,!1)?(Q(g),d(pt)):(f=="variable"&&(v.marked="property"),f=="spread"?d(Re):f=="}"?C():f=="["?d($,U("]"),U(":"),ko):d(U(":"),Re,pt))}function ps(){return C(Re,pt)}function pt(f,g){if(g=="=")return d(ee)}function vs(f){if(f==",")return d(oi)}function xo(f,g){if(f=="keyword b"&&g=="else")return d(H("form","else"),se,O)}function Co(f,g){if(g=="await")return d(Co);if(f=="(")return d(H(")"),gs,O)}function gs(f){return f=="var"?d(oi,Zt):f=="variable"?d(Zt):C(Zt)}function Zt(f,g){return f==")"?d():f==";"?d(Zt):g=="in"||g=="of"?(v.marked="keyword",d($,Zt)):C($,Zt)}function Ue(f,g){if(g=="*")return v.marked="keyword",d(Ue);if(f=="variable")return Q(g),d(Ue);if(f=="(")return d(m,H(")"),we(At,")"),O,wo,se,z);if(l&&g=="<")return d(H(">"),we(sn,">"),O,Ue)}function Qt(f,g){if(g=="*")return v.marked="keyword",d(Qt);if(f=="variable")return Q(g),d(Qt);if(f=="(")return d(m,H(")"),we(At,")"),O,wo,z);if(l&&g=="<")return d(H(">"),we(sn,">"),O,Qt)}function So(f,g){if(f=="keyword"||f=="variable")return v.marked="type",d(So);if(g=="<")return d(H(">"),we(sn,">"),O)}function At(f,g){return g=="@"&&d($,At),f=="spread"?d(At):l&&w(g)?(v.marked="keyword",d(At)):l&&f=="this"?d(jt,pt):C(Re,jt,pt)}function ms(f,g){return f=="variable"?Lo(f,g):un(f,g)}function Lo(f,g){if(f=="variable")return Q(g),d(un)}function un(f,g){if(g=="<")return d(H(">"),we(sn,">"),O,un);if(g=="extends"||g=="implements"||l&&f==",")return g=="implements"&&(v.marked="keyword"),d(l?ue:$,un);if(f=="{")return d(H("}"),rt,O)}function rt(f,g){if(f=="async"||f=="variable"&&(g=="static"||g=="get"||g=="set"||l&&w(g))&&v.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))return v.marked="keyword",d(rt);if(f=="variable"||v.style=="keyword")return v.marked="property",d(l?fn:Ue,rt);if(f=="number"||f=="string")return d(l?fn:Ue,rt);if(f=="[")return d($,jt,U("]"),l?fn:Ue,rt);if(g=="*")return v.marked="keyword",d(rt);if(l&&f=="(")return C(Qt,rt);if(f==";"||f==",")return d(rt);if(f=="}")return d();if(g=="@")return d($,rt)}function fn(f,g){if(g=="?")return d(fn);if(f==":")return d(ue,pt);if(g=="=")return d(ee);var M=v.state.lexical.prev,N=M&&M.info=="interface";return C(N?Qt:Ue)}function ys(f,g){return g=="*"?(v.marked="keyword",d(li,U(";"))):g=="default"?(v.marked="keyword",d($,U(";"))):f=="{"?d(we(To,"}"),li,U(";")):C(se)}function To(f,g){if(g=="as")return v.marked="keyword",d(U("variable"));if(f=="variable")return C(ee,To)}function bs(f){return f=="string"?d():f=="("?C($):C(cn,Mo,li)}function cn(f,g){return f=="{"?mr(cn,"}"):(f=="variable"&&Q(g),g=="*"&&(v.marked="keyword"),d(ws))}function Mo(f){if(f==",")return d(cn,Mo)}function ws(f,g){if(g=="as")return v.marked="keyword",d(cn)}function li(f,g){if(g=="from")return v.marked="keyword",d($)}function ks(f){return f=="]"?d():C(we(ee,"]"))}function Do(){return C(H("form"),Re,U("{"),H("}"),we(xs,"}"),O,O)}function xs(){return C(Re,pt)}function Cs(f,g){return f.lastType=="operator"||f.lastType==","||u.test(g.charAt(0))||/[,.]/.test(g.charAt(0))}function Ao(f,g,M){return g.tokenize==S&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(g.lastType)||g.lastType=="quasi"&&/\{\s*$/.test(f.string.slice(0,f.pos-(M||0)))}return{startState:function(f){var g={tokenize:S,lastType:"sof",cc:[],lexical:new W((f||0)-r,0,"block",!1),localVars:t.localVars,context:t.localVars&&new T(null,null,!1),indented:f||0};return t.globalVars&&typeof t.globalVars=="object"&&(g.globalVars=t.globalVars),g},token:function(f,g){if(f.sol()&&(g.lexical.hasOwnProperty("align")||(g.lexical.align=!1),g.indented=f.indentation(),E(f,g)),g.tokenize!=A&&f.eatSpace())return null;var M=g.tokenize(f,g);return b=="comment"?M:(g.lastType=b=="operator"&&(y=="++"||y=="--")?"incdec":b,_(g,M,b,y,f))},indent:function(f,g){if(f.tokenize==A)return R.Pass;if(f.tokenize!=S)return 0;var M=g&&g.charAt(0),N=f.lexical,J;if(!/^\s*else\b/.test(g))for(var te=f.cc.length-1;te>=0;--te){var fe=f.cc[te];if(fe==O)N=N.prev;else if(fe!=xo)break}for(;(N.type=="stat"||N.type=="form")&&(M=="}"||(J=f.cc[f.cc.length-1])&&(J==ut||J==_e)&&!/^[,\.=+\-*:?[\(]/.test(g));)N=N.prev;n&&N.type==")"&&N.prev.type=="stat"&&(N=N.prev);var Me=N.type,je=M==Me;return Me=="vardef"?N.indented+(f.lastType=="operator"||f.lastType==","?N.info.length+1:0):Me=="form"&&M=="{"?N.indented:Me=="form"?N.indented+r:Me=="stat"?N.indented+(Cs(f,g)?n||r:0):N.info=="switch"&&!je&&t.doubleIndentSwitch!=!1?N.indented+(/^(?:case|default)\b/.test(g)?r:2*r):N.align?N.column+(je?0:1):N.indented+(je?0:r)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:o?null:"/*",blockCommentEnd:o?null:"*/",blockCommentContinue:o?null:" * ",lineComment:o?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:o?"json":"javascript",jsonldMode:i,jsonMode:o,expressionAllowed:Ao,skipExpression:function(f){var g=f.cc[f.cc.length-1];(g==$||g==ee)&&f.cc.pop()}}}R.registerHelper("wordChars","javascript",/[\w$]/);R.defineMIME("json",{name:"javascript",json:!0});R.defineMIME("typescript",{name:"javascript",typescript:!0});R.defineMIME("ts",{name:"javascript",typescript:!0});const $f=["js","json","python","py","react","coffeescript","dart","go","jsx"];$f.forEach(e=>{R.defineMIME(e,"javascript")});R.defineMode("markdown",function(e,t){var r=R.getMode(e,"text/html"),n=r.name=="null";function i(m){if(R.findModeByName){var c=R.findModeByName(m);c&&(m=c.mime||c.mimes[0])}var z=R.getMode(e,m);return z.name=="null"?null:z}t.highlightFormatting===void 0&&(t.highlightFormatting=!1),t.maxBlockquoteDepth===void 0&&(t.maxBlockquoteDepth=0),t.taskLists===void 0&&(t.taskLists=!1),t.strikethrough===void 0&&(t.strikethrough=!1),t.emoji===void 0&&(t.emoji=!1),t.fencedCodeBlockHighlighting===void 0&&(t.fencedCodeBlockHighlighting=!0),t.xml===void 0&&(t.xml=!0),t.tokenTypeOverrides===void 0&&(t.tokenTypeOverrides={});var o={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 l in o)o.hasOwnProperty(l)&&t.tokenTypeOverrides[l]&&(o[l]=t.tokenTypeOverrides[l]);var a=/^([*\-_])(?:\s*\1){2,}\s*$/,s=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,u=/^\[(x| )\](?=\s)/i,h=t.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ *(?:\={1,}|-{1,})\s*$/,b=/^[^#!\[\]*_\\<>` "'(~:]+/,y=/^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/,k=/^\s*\[[^\]]+?\]:.*$/,S=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,D=" ";function A(m,c,z){return c.f=c.inline=z,z(m,c)}function I(m,c,z){return c.f=c.block=z,z(m,c)}function L(m){return!m||!/\S/.test(m.string)}function E(m){if(m.linkTitle=!1,m.linkHref=!1,m.linkText=!1,m.em=!1,m.strong=!1,m.strikethrough=!1,m.quote=0,m.indentedCode=!1,m.f==W){var c=n;if(!c){var z=R.innerMode(r,m.htmlState);c=z.mode.name=="xml"&&z.state.tagStart===null&&!z.state.context&&z.state.tokenize.isInText}c&&(m.f=C,m.block=P,m.htmlState=null)}return m.trailingSpace=0,m.trailingSpaceNewLine=!1,m.prevLine=m.thisLine,m.thisLine={stream:null},null}function P(m,c){var z=m.column()===c.indentation,H=L(c.prevLine.stream),O=c.indentedCode,U=c.prevLine.hr,se=c.list!==!1,ge=(c.listStack[c.listStack.length-1]||0)+3;c.indentedCode=!1;var $=c.indentation;if(c.indentationDiff===null&&(c.indentationDiff=c.indentation,se)){for(c.list=null;$<c.listStack[c.listStack.length-1];)c.listStack.pop(),c.listStack.length?c.indentation=c.listStack[c.listStack.length-1]:c.list=!1;c.list!==!1&&(c.indentationDiff=$-c.listStack[c.listStack.length-1])}var ee=!H&&!U&&!c.prevLine.header&&(!se||!O)&&!c.prevLine.fencedCodeEnd,oe=(c.list===!1||U||H)&&c.indentation<=ge&&m.match(a),he=null;if(c.indentationDiff>=4&&(O||c.prevLine.fencedCodeEnd||c.prevLine.header||H))return m.skipToEnd(),c.indentedCode=!0,o.code;if(m.eatSpace())return null;if(z&&c.indentation<=ge&&(he=m.match(h))&&he[1].length<=6)return c.quote=0,c.header=he[1].length,c.thisLine.header=!0,t.highlightFormatting&&(c.formatting="header"),c.f=c.inline,_(c);if(c.indentation<=ge&&m.eat(">"))return c.quote=z?1:c.quote+1,t.highlightFormatting&&(c.formatting="quote"),m.eatSpace(),_(c);if(!oe&&!c.setext&&z&&c.indentation<=ge&&(he=m.match(s))){var ze=he[1]?"ol":"ul";return c.indentation=$+m.current().length,c.list=!0,c.quote=0,c.listStack.push(c.indentation),c.em=!1,c.strong=!1,c.code=!1,c.strikethrough=!1,t.taskLists&&m.match(u,!1)&&(c.taskList=!0),c.f=c.inline,t.highlightFormatting&&(c.formatting=["list","list-"+ze]),_(c)}else{if(z&&c.indentation<=ge&&(he=m.match(y,!0)))return c.quote=0,c.fencedEndRE=new RegExp(he[1]+"+ *$"),c.localMode=t.fencedCodeBlockHighlighting&&i(he[2]),c.localMode&&(c.localState=R.startState(c.localMode)),c.f=c.block=Y,t.highlightFormatting&&(c.formatting="code-block"),c.code=-1,_(c);if(c.setext||(!ee||!se)&&!c.quote&&c.list===!1&&!c.code&&!oe&&!k.test(m.string)&&(he=m.lookAhead(1))&&(he=he.match(p)))return c.setext?(c.header=c.setext,c.setext=0,m.skipToEnd(),t.highlightFormatting&&(c.formatting="header")):(c.header=he[0].charAt(0)=="="?1:2,c.setext=c.header),c.thisLine.header=!0,c.f=c.inline,_(c);if(oe)return m.skipToEnd(),c.hr=!0,c.thisLine.hr=!0,o.hr;if(m.peek()==="[")return A(m,c,w)}return A(m,c,c.inline)}function W(m,c){var z=r.token(m,c.htmlState);if(!n){var H=R.innerMode(r,c.htmlState);(H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText||c.md_inside&&m.current().indexOf(">")>-1)&&(c.f=C,c.block=P,c.htmlState=null)}return z}function Y(m,c){var z=c.listStack[c.listStack.length-1]||0,H=c.indentation<z,O=z+3;if(c.fencedEndRE&&c.indentation<=O&&(H||m.match(c.fencedEndRE))){t.highlightFormatting&&(c.formatting="code-block");var U;return H||(U=_(c)),c.localMode=c.localState=null,c.block=P,c.f=C,c.fencedEndRE=null,c.code=0,c.thisLine.fencedCodeEnd=!0,H?I(m,c,c.block):U}else return c.localMode?c.localMode.token(m,c.localState):(m.skipToEnd(),o.code)}function _(m){var c=[];if(m.formatting){c.push(o.formatting),typeof m.formatting=="string"&&(m.formatting=[m.formatting]);for(var z=0;z<m.formatting.length;z++)c.push(o.formatting+"-"+m.formatting[z]),m.formatting[z]==="header"&&c.push(o.formatting+"-"+m.formatting[z]+"-"+m.header),m.formatting[z]==="quote"&&(!t.maxBlockquoteDepth||t.maxBlockquoteDepth>=m.quote?c.push(o.formatting+"-"+m.formatting[z]+"-"+m.quote):c.push("error"))}if(m.taskOpen)return c.push("meta"),c.length?c.join(" "):null;if(m.taskClosed)return c.push("property"),c.length?c.join(" "):null;if(m.linkHref?c.push(o.linkHref,"url"):(m.strong&&c.push(o.strong),m.em&&c.push(o.em),m.strikethrough&&c.push(o.strikethrough),m.emoji&&c.push(o.emoji),m.linkText&&c.push(o.linkText),m.code&&c.push(o.code),m.image&&c.push(o.image),m.imageAltText&&c.push(o.imageAltText,"link"),m.imageMarker&&c.push(o.imageMarker)),m.header&&c.push(o.header,o.header+"-"+m.header),m.quote&&(c.push(o.quote),!t.maxBlockquoteDepth||t.maxBlockquoteDepth>=m.quote?c.push(o.quote+"-"+m.quote):c.push(o.quote+"-"+t.maxBlockquoteDepth)),m.list!==!1){var H=(m.listStack.length-1)%3;H?H===1?c.push(o.list2):c.push(o.list3):c.push(o.list1)}return m.trailingSpaceNewLine?c.push("trailing-space-new-line"):m.trailingSpace&&c.push("trailing-space-"+(m.trailingSpace%2?"a":"b")),c.length?c.join(" "):null}function v(m,c){if(m.match(b,!0))return _(c)}function C(m,c){var z=c.text(m,c);if(typeof z!="undefined")return z;if(c.list)return c.list=null,_(c);if(c.taskList){var H=m.match(u,!0)[1]===" ";return H?c.taskOpen=!0:c.taskClosed=!0,t.highlightFormatting&&(c.formatting="task"),c.taskList=!1,_(c)}if(c.taskOpen=!1,c.taskClosed=!1,c.header&&m.match(/^#+$/,!0))return t.highlightFormatting&&(c.formatting="header"),_(c);var O=m.next();if(c.linkTitle){c.linkTitle=!1;var U=O;O==="("&&(U=")"),U=String(U).replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var se="^\\s*(?:[^"+U+"\\\\]+|\\\\\\\\|\\\\.)"+U;if(m.match(new RegExp(se),!0))return o.linkHref}if(O==="`"){var ge=c.formatting;t.highlightFormatting&&(c.formatting="code"),m.eatWhile("`");var $=m.current().length;if(c.code==0&&(!c.quote||$==1))return c.code=$,_(c);if($==c.code){var ee=_(c);return c.code=0,ee}else return c.formatting=ge,_(c)}else if(c.code)return _(c);if(O==="\\"&&(m.next(),t.highlightFormatting)){var oe=_(c),he=o.formatting+"-escape";return oe?oe+" "+he:he}if(O==="!"&&m.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return c.imageMarker=!0,c.image=!0,t.highlightFormatting&&(c.formatting="image"),_(c);if(O==="["&&c.imageMarker&&m.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return c.imageMarker=!1,c.imageAltText=!0,t.highlightFormatting&&(c.formatting="image"),_(c);if(O==="]"&&c.imageAltText){t.highlightFormatting&&(c.formatting="image");var oe=_(c);return c.imageAltText=!1,c.image=!1,c.inline=c.f=B,oe}if(O==="["&&!c.image)return c.linkText&&m.match(/^.*?\]/)||(c.linkText=!0,t.highlightFormatting&&(c.formatting="link")),_(c);if(O==="]"&&c.linkText){t.highlightFormatting&&(c.formatting="link");var oe=_(c);return c.linkText=!1,c.inline=c.f=m.match(/\(.*?\)| ?\[.*?\]/,!1)?B:C,oe}if(O==="<"&&m.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){c.f=c.inline=d,t.highlightFormatting&&(c.formatting="link");var oe=_(c);return oe?oe+=" ":oe="",oe+o.linkInline}if(O==="<"&&m.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){c.f=c.inline=d,t.highlightFormatting&&(c.formatting="link");var oe=_(c);return oe?oe+=" ":oe="",oe+o.linkEmail}if(t.xml&&O==="<"&&m.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ze=m.string.indexOf(">",m.pos);if(ze!=-1){var ut=m.string.substring(m.start,ze);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ut)&&(c.md_inside=!0)}return m.backUp(1),c.htmlState=R.startState(r),I(m,c,W)}if(t.xml&&O==="<"&&m.match(/^\/\w*?>/))return c.md_inside=!1,"tag";if(O==="*"||O==="_"){for(var _e=1,Be=m.pos==1?" ":m.string.charAt(m.pos-2);_e<3&&m.eat(O);)_e++;var ft=m.peek()||" ",Tt=!/\s/.test(ft)&&(!S.test(ft)||/\s/.test(Be)||S.test(Be)),Mt=!/\s/.test(Be)&&(!S.test(Be)||/\s/.test(ft)||S.test(ft)),ct=null,ht=null;if(_e%2&&(!c.em&&Tt&&(O==="*"||!Mt||S.test(Be))?ct=!0:c.em==O&&Mt&&(O==="*"||!Tt||S.test(ft))&&(ct=!1)),_e>1&&(!c.strong&&Tt&&(O==="*"||!Mt||S.test(Be))?ht=!0:c.strong==O&&Mt&&(O==="*"||!Tt||S.test(ft))&&(ht=!1)),ht!=null||ct!=null){t.highlightFormatting&&(c.formatting=ct==null?"strong":ht==null?"em":"strong em"),ct===!0&&(c.em=O),ht===!0&&(c.strong=O);var ee=_(c);return ct===!1&&(c.em=!1),ht===!1&&(c.strong=!1),ee}}else if(O===" "&&(m.eat("*")||m.eat("_"))){if(m.peek()===" ")return _(c);m.backUp(1)}if(t.strikethrough){if(O==="~"&&m.eatWhile(O)){if(c.strikethrough){t.highlightFormatting&&(c.formatting="strikethrough");var ee=_(c);return c.strikethrough=!1,ee}else if(m.match(/^[^\s]/,!1))return c.strikethrough=!0,t.highlightFormatting&&(c.formatting="strikethrough"),_(c)}else if(O===" "&&m.match(/^~~/,!0)){if(m.peek()===" ")return _(c);m.backUp(2)}}if(t.emoji&&O===":"&&m.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){c.emoji=!0,t.highlightFormatting&&(c.formatting="emoji");var ni=_(c);return c.emoji=!1,ni}return O===" "&&(m.match(/^ +$/,!1)?c.trailingSpace++:c.trailingSpace&&(c.trailingSpaceNewLine=!0)),_(c)}function d(m,c){var z=m.next();if(z===">"){c.f=c.inline=C,t.highlightFormatting&&(c.formatting="link");var H=_(c);return H?H+=" ":H="",H+o.linkInline}return m.match(/^[^>]+/,!0),o.linkInline}function B(m,c){if(m.eatSpace())return null;var z=m.next();return z==="("||z==="["?(c.f=c.inline=j(z==="("?")":"]"),t.highlightFormatting&&(c.formatting="link-string"),c.linkHref=!0,_(c)):"error"}var Q={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function j(m){return function(c,z){var H=c.next();if(H===m){z.f=z.inline=C,t.highlightFormatting&&(z.formatting="link-string");var O=_(z);return z.linkHref=!1,O}return c.match(Q[m]),z.linkHref=!0,_(z)}}function w(m,c){return m.match(/^([^\]\\]|\\.)*\]:/,!1)?(c.f=T,m.next(),t.highlightFormatting&&(c.formatting="link"),c.linkText=!0,_(c)):A(m,c,C)}function T(m,c){if(m.match(/^\]:/,!0)){c.f=c.inline=x,t.highlightFormatting&&(c.formatting="link");var z=_(c);return c.linkText=!1,z}return m.match(/^([^\]\\]|\\.)+/,!0),o.linkText}function x(m,c){return m.eatSpace()?null:(m.match(/^[^\s]+/,!0),m.peek()===void 0?c.linkTitle=!0:m.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),c.f=c.inline=C,o.linkHref+" url")}var K={startState:function(){return{f:P,prevLine:{stream:null},thisLine:{stream:null},block:P,htmlState:null,indentation:0,inline:C,text:v,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(m){return{f:m.f,prevLine:m.prevLine,thisLine:m.thisLine,block:m.block,htmlState:m.htmlState&&R.copyState(r,m.htmlState),indentation:m.indentation,localMode:m.localMode,localState:m.localMode?R.copyState(m.localMode,m.localState):null,inline:m.inline,text:m.text,formatting:!1,linkText:m.linkText,linkTitle:m.linkTitle,linkHref:m.linkHref,code:m.code,em:m.em,strong:m.strong,strikethrough:m.strikethrough,emoji:m.emoji,header:m.header,setext:m.setext,hr:m.hr,taskList:m.taskList,list:m.list,listStack:m.listStack.slice(0),quote:m.quote,indentedCode:m.indentedCode,trailingSpace:m.trailingSpace,trailingSpaceNewLine:m.trailingSpaceNewLine,md_inside:m.md_inside,fencedEndRE:m.fencedEndRE}},token:function(m,c){if(c.formatting=!1,m!=c.thisLine.stream){if(c.header=0,c.hr=!1,m.match(/^\s*$/,!0))return E(c),null;if(c.prevLine=c.thisLine,c.thisLine={stream:m},c.taskList=!1,c.trailingSpace=0,c.trailingSpaceNewLine=!1,!c.localState&&(c.f=c.block,c.f!=W)){var z=m.match(/^\s*/,!0)[0].replace(/\t/g,D).length;if(c.indentation=z,c.indentationDiff=null,z>0)return null}}return c.f(m,c)},innerMode:function(m){return m.block==W?{state:m.htmlState,mode:r}:m.localState?{state:m.localState,mode:m.localMode}:{state:m,mode:K}},indent:function(m,c,z){return m.block==W&&r.indent?r.indent(m.htmlState,c,z):m.localState&&m.localMode.indent?m.localMode.indent(m.localState,c,z):R.Pass},blankLine:E,getType:_,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return K},"xml");R.defineMIME("text/src","markdown");R.defineMIME("text/x-src","markdown");var ec={tabSize:4,styleActiveLine:!0,lineNumbers:!0,lineWrapping:!1,line:!0,mode:"text/x-src",theme:"default",cursorHeight:.8,lineWiseCopyCut:!0};function tc(e,t){var r=document.createElement("a");if(r.setAttribute("href","data:text/plain;charset=UTF-8,"+encodeURIComponent(e)),r.setAttribute("download",t),r.style.display="none",document.createEvent){const n=document.createEvent("MouseEvents");n.initEvent("click",!0,!0),r.dispatchEvent(n)}else r.click()}var rc={strong:!0,italic:!0,overline:!0,h1:!0,h2:!0,h3:!0,h4:!1,h5:!1,h6:!1,hr:!0,quote:!0,ul:!0,ol:!0,code:!0,link:!0,image:!0,uploadImage:!1,custom_image:!1,custom_uploadImage:!1,custom_uploadFile:!1,table:!0,checked:!0,notChecked:!0,split:!0,preview:!0,fullscreen:!0,theme:!0,exportmd:!0,importmd:!0,save:!1,clear:!1,scrolling:!0,html_to_markdown:!0},nc={name:"markdown",props:{value:{type:[String,Number],default:""},theme:{type:String,default:"light"},width:{type:[Number,String],default:"auto"},height:{type:[Number,String],default:600},toolbars:{type:Object,default(){return{}}},bordered:{type:Boolean,default:!0},autoSave:{type:Boolean,default:!1},interval:{type:Number,default:1e4},exportFileName:{type:String,default:"unnamed"},markedOptions:{type:Object,default(){return{}}},copyCode:{type:Boolean,default:!0},copyBtnText:{type:String,default:"\u590D\u5236\u4EE3\u7801"},isPreview:{type:Boolean,default:!1},isCustomFullscreen:{type:Boolean,default:!1}},data(){return{currentValue:"",timeoutId:null,indexLenth:1,html:"",preview:!1,split:!0,fullscreen:!1,scrollSide:"",lastInsert:"",timerId:null,themeName:"",themeSlideDown:!1,imgSlideDown:!1,imgs:[],scrolling:!0,editorScrollHeight:0,previewImgModal:!1,previewImgSrc:"",previewImgMode:"",tocTrigger:!1,tocShow:!1,tocAction:"",tocLists:[]}},computed:{tools(){const{toolbars:e={}}=this;return{...rc,...e}}},methods:{insertLink(){this.insertContent(`
[link](href)`)},insertImage(){this.insertContent(`
![image](imgUrl)`)},insertTable(){this.insertContent(`
header 1 | header 2
---|---
row 1 col 1 | row 1 col 2
row 2 col 1 | row 2 col 2
`)},handleSave(){const{currentValue:e,themeName:t,html:r}=this;this.$emit("on-save",{theme:t,value:e,html:r})},toggleSlideDown(){this.slideDown=!this.slideDown},setThemes(e){this.themeName=e,this.themeSlideDown=!1,this.$emit("on-theme-change",e)},exportFile(){tc(this.currentValue,this.exportFileName+".md")},importFile(e){const t=e.target.files[0];if(!t)return;const{type:r}=t;if(!["text/markdown","text/src"].includes(r))return;const n=new FileReader;n.readAsText(t,{encoding:"utf-8"}),n.onload=()=>{this.currentValue=n.result,e.target.value="",this.pro&&this.editor.setOption("value",this.currentValue)},n.onerror=i=>{console.error(i)}},handlePaste(e,t){const{clipboardData:r={}}=t,{types:n=[],items:i}=r;let o=null;for(let l=0;l<n.length;l++)if(n[l]==="Files"){o=i[l];break}if(o){const l=o.getAsFile();/image/gi.test(l.type)&&(this.$emit("on-upload-image",l),t.preventDefault())}},mousescrollSide(e){this.scrollSide=e},addImageClickListener(){const{imgs:e=[]}=this;if(e.length>0)for(let t=0,r=e.length;t<r;t++)e[t].onclick=null;setTimeout(()=>{if(!!this.$refs.preview){this.imgs=this.$refs.preview.querySelectorAll("img");for(let t=0,r=this.imgs.length;t<r;t++)this.imgs[t].onclick=()=>{const n=this.imgs[t].getAttribute("src");this.previewImage(n)}}},600)},previewImage(e){const t=new Image;t.src=e,t.onload=()=>{const r=t.naturalWidth;t.naturalHeight/r>1.4?this.previewImgMode="horizontal":this.previewImgMode="vertical",this.previewImgSrc=e,this.previewImgModal=!0}},chooseImage(){const e=document.createElement("input");e.type="file",e.accept="image/*",e.onchange=()=>{const t=e.files;t[0]&&(this.$emit("on-upload-image",t[0]),e.value="")},e.click()},addCopyListener(){setTimeout(()=>{const e=document.querySelectorAll(".code-block .copy-code");this.btns=e;for(let t=0,r=e.length;t<r;t++)e[t].onclick=()=>{const n=e[t].parentNode.querySelectorAll("pre")[0].innerText,i=document.createElement("input");i.setAttribute("value",n),document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i),this.$emit("on-copy",n)}},600)},onCustom(e){this.$emit("on-custom",e)}},destroyed(){clearInterval(this.timerId)}},ic={name:"markdown-pro",mixins:[nc],data(){return{pro:!0,editor:null,lastPos:""}},mounted(){br.reset(),this.init(),this.createEditor()},methods:{init(){this.currentValue=this.value,this.themeName=this.theme,this.preview=this.isPreview,this.currentValue=this.value,!this.isPreview&&setTimeout(()=>{this.autoSave&&(this.timerId=setInterval(()=>{this.handleSave()},this.interval))},20)},createEditor(){this.editor=new R(this.$refs.codemirror,{value:this.currentValue,onload:e=>{const{doc:{height:t=0}}=e;this.editorScrollHeight=t},...ec}),this.addEditorLintener(),this.$emit("on-ready",{vm:this,insertContent:this.insertContent})},addEditorLintener(){const e=this.editor;e.on("change",t=>{this.lastPos=e.getCursor(),this.currentValue=e.getValue();const{doc:{height:r}}=t;this.editorScrollHeight=r}),e.on("scroll",this.markdownScroll),e.on("paste",this.handlePaste),e.on("keydown",(t,r)=>{r.keyCode===83?(r.metaKey||r.ctrlKey)&&(r.preventDefault(),this.handleSave()):r.keyCode===13?this.listerenKeyupEnter(r):r.keyCode===8&&this.listerenDelete(t)}),e.on("focus",()=>{this.lastPos=e.getCursor()})},insertContent(e){this.editor.replaceSelection(e),this.lastInsert=e.replace(/\n/g,"")},setCursor(e=0,t=0){const{editor:r}=this;r.setCursor(e,t),r.focus()},insertStrong(){const{editor:e,lastPos:t={}}=this,{line:r=0,ch:n=0}=t,i=e.getSelection();i?this.insertContent("**"+i+"**"):(this.insertContent("****"),this.setCursor(r,n+2))},insertItalic(){const{editor:e,lastPos:t={}}=this,{line:r=0,ch:n=0}=t,i=e.getSelection();i?this.insertContent("*"+i+"*"):(this.insertContent("**"),this.setCursor(r,n+1))},insertUnderline(){const{editor:e,lastPos:t={}}=this,{line:r=0,ch:n=0}=t,i=e.getSelection();i?this.insertContent("<u>"+i+"</u>"):(this.insertContent("<u></u>"),this.setCursor(r,n+3))},insertOverline(){const{editor:e,lastPos:t={}}=this,{line:r=0,ch:n=0}=t,i=e.getSelection();i?this.insertContent("~~"+i+"~~"):(this.insertContent("~~~~"),this.setCursor(r,n+2))},insertTitle(e){const t={1:"# ",2:"## ",3:"### ",4:"#### ",5:"##### ",6:"###### "},{editor:r,lastPos:n={}}=this,{line:i}=n,o=r.getSelection();if(o)this.insertContent(`
`+t[e]+o+`
`);else{const l=t[e];r.isClean()?(this.insertContent(l),this.setCursor(0,l.length)):(this.insertContent(`
`+l),this.setCursor(i+1,l.length))}},insertLine(){const{editor:e}=this;e.isClean()?this.insertContent(`----
`):this.insertContent(`
----
`)},insertQuote(){const{editor:e,lastPos:t={}}=this,{line:r=0}=t,n=e.getSelection();n?this.insertContent(`
> `+n+`
`):e.isClean()?(this.insertContent("> "),this.setCursor(0,3)):(this.insertContent(`
> `),this.setCursor(r+1,3))},insertUl(){const{editor:e,lastPos:t={}}=this,{line:r=0,ch:n=0}=t,i=e.getSelection();i?this.insertContent(`
- `+i+`
`):e.isClean()||n===0?(this.insertContent("- "),this.setCursor(r,3)):(this.insertContent(`
- `),this.setCursor(r+1,3))},insertOl(){const{editor:e,lastPos:t={}}=this,{line:r=0,ch:n=0}=t,i=e.getSelection();i?this.insertContent(`
1. `+i+`
`):e.isClean()||n===0?(this.insertContent("1. "),this.setCursor(r,4)):(this.insertContent(`
1. `),this.setCursor(r+1,4))},insertCode(){const{editor:e,lastPos:t={}}=this,{line:r}=t,n=e.getSelection();n?this.insertContent("\n```\n"+n+"\n```\n"):e.isClean()?(this.insertContent("```\n\n```"),this.setCursor(1,0)):(this.insertContent("\n```\n\n```"),this.setCursor(r+2,0))},insertFinished(){const{editor:e,lastPos:t={}}=this,{line:r=0,ch:n=0}=t,i=e.getSelection();i?this.insertContent(`
- [x] `+i+`
`):e.isClean()||n===0?(this.insertContent("- [x] "),this.setCursor(r,6)):(this.insertContent(`
- [x] `),this.setCursor(r+1,6))},insertNotFinished(){const{editor:e,lastPos:t={}}=this,{line:r=0,ch:n=0}=t,i=e.getSelection();i?this.insertContent(`
- [ ] `+i+`
`):e.isClean()||n===0?(this.insertContent("- [ ] "),this.setCursor(r,6)):(this.insertContent(`
- [ ] `),this.setCursor(r+1,6))},listerenKeyupEnter(e){const{lastInsert:t}=this;t&&(["-","- [ ]","- [x]"].includes(t.trim())?(e.preventDefault(),this.insertContent(`
`+t)):/^\d+\.$/.test(t.trim())&&(e.preventDefault(),this.insertContent(`
`+(parseInt(t,0)+1)+". ")))},listerenDelete(){setTimeout(()=>{const{editor:e}=this;e.isClean()||e.getValue().split(`
`).pop()===""&&(this.lastInsert="")},20)},onDelete(){const e=this.currentValue.split(`
`);e[e.length-1]===""&&(this.lastInsert="")},markdownScroll(e={}){if(this.scrolling&&this.scrollSide==="left"){const{doc:{height:t,scrollTop:r}}=e,n=this.$refs.preview,i=n.offsetHeight,o=n.scrollHeight;n.scrollTop=parseInt(r*(o-i)/(t-i),0)}},previewScroll(){if(this.scrolling&&this.scrollSide==="right"){const e=this.$refs.preview,t=e.offsetHeight,r=e.scrollHeight,n=e.scrollTop,i=parseInt(n*(this.editorScrollHeight-t)/(r-t),0);this.editor.scrollTo(0,i);const o=$A(this.$refs.preview);let l,a;o.find("h1,h2,h3,h4,h5").each((s,u)=>{if(l=$A(u),l.offset().top-o.offset().top>=0&&(a=l.attr("toc-id")))return this.tocAction=a,!1})}},redo(){const{editor:e}=this;e.redo(),setTimeout(()=>{e.refresh()},20)},tocLevel(e,t){let r=9999;return typeof t=="undefined"&&(t=this.tocLists),t.forEach(({level:n})=>{r=Math.min(r,n)}),r===9999?e:e-(r-1)},tocClick(e){this.tocAction=e.anchor;const t=$A(this.$refs.preview),r=t.find("h"+e.level+'[toc-id="'+this.tocAction+'"]');r&&t.animate({scrollTop:r.offset().top-t.offset().top+t.scrollTop()})}},watch:{currentValue(){clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{const{currentValue:e}=this;let t=Ls(e,{sanitize:!1,...this.markedOptions}).replace(/href="/gi,'target="_blank" href="');if(this.copyCode&&t!==""&&(t=t.replace(/<pre>/g,'<div class="code-block"><span class="copy-code">'+this.copyBtnText+"</span><pre>").replace(/<\/pre>/g,"</pre></div>")),/\[\[TOC\]\]/.test(t)){let r="";br.tocItems.forEach(n=>{r+=`<li class="toc-anchor-item" onclick="_goTocAction(this, '${n.level}', '${n.anchor}')"><span class="toc-link-${this.tocLevel(n.level,br.tocItems)}" title="${n.text}">${n.text}</span></li>`}),t=t.replace(/\[\[TOC\]\]/g,`<ul class="toc-anchor">${r}</ul>`)}this.html=t,this.tocLists=br.tocItems,this.tocTrigger||(this.tocShow=this.tocLists.length>1),br.reset(),this.addImageClickListener(),this.addCopyListener(),this.$emit("input",e)},30)},value(){const{value:e,currentValue:t}=this;t!==e&&(this.currentValue=e,this.editor.setOption("value",e))}}},oc=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{ref:"markdown",class:`markdown ${e.fullscreen?"fullscreen":""} ${e.bordered?"border":""}`,style:{width:e.width+(typeof e.width=="string"?"":"px"),height:e.height+(typeof e.height=="string"?"":"px")}},[r("ul",{directives:[{name:"show",rawName:"v-show",value:!e.preview,expression:"!preview"}],staticClass:"markdown-toolbars"},[r("li",[e._t("title")],2),e.tools.undo?r("li",{attrs:{name:e.$L("\u64A4\u9500")}},[r("span",{staticClass:"iconfont icon-undo",on:{click:function(n){return e.editor.undo()}}})]):e._e(),e.tools.redo?r("li",{attrs:{name:e.$L("\u91CD\u505A")},on:{click:e.redo}},[r("span",{staticClass:"iconfont icon-redo"})]):e._e(),e.tools.strong?r("li",{attrs:{name:e.$L("\u7C97\u4F53")}},[r("span",{staticClass:"iconfont icon-bold",on:{click:e.insertStrong}})]):e._e(),e.tools.italic?r("li",{attrs:{name:e.$L("\u659C\u4F53")}},[r("span",{staticClass:"iconfont icon-italic",on:{click:e.insertItalic}})]):e._e(),e.tools.overline?r("li",{attrs:{name:e.$L("\u5220\u9664\u7EBF")}},[r("span",{staticClass:"iconfont icon-overline",on:{click:e.insertOverline}})]):e._e(),e.tools.overline?r("li",{attrs:{name:e.$L("\u4E0B\u5212\u7EBF")}},[r("span",{staticClass:"iconfont icon-under-line",on:{click:e.insertUnderline}})]):e._e(),e.tools.h1?r("li",{attrs:{name:e.$L("\u6807\u98981")}},[r("span",{staticStyle:{"font-size":"16px"},on:{click:function(n){return e.insertTitle(1)}}},[e._v("h1")])]):e._e(),e.tools.h2?r("li",{attrs:{name:e.$L("\u6807\u98982")}},[r("span",{staticStyle:{"font-size":"16px"},on:{click:function(n){return e.insertTitle(2)}}},[e._v("h2")])]):e._e(),e.tools.h3?r("li",{attrs:{name:e.$L("\u6807\u98983")}},[r("span",{staticStyle:{"font-size":"16px"},on:{click:function(n){return e.insertTitle(3)}}},[e._v("h3")])]):e._e(),e.tools.h4?r("li",{attrs:{name:e.$L("\u6807\u98984")}},[r("span",{staticStyle:{"font-size":"16px"},on:{click:function(n){return e.insertTitle(4)}}},[e._v("h4")])]):e._e(),e.tools.h5?r("li",{attrs:{name:e.$L("\u6807\u98985")}},[r("span",{staticStyle:{"font-size":"16px"},on:{click:function(n){return e.insertTitle(5)}}},[e._v("h5")])]):e._e(),e.tools.h6?r("li",{attrs:{name:e.$L("\u6807\u98986")}},[r("span",{staticStyle:{"font-size":"16px"},on:{click:function(n){return e.insertTitle(6)}}},[e._v("h6")])]):e._e(),e.tools.hr?r("li",{attrs:{name:e.$L("\u5206\u5272\u7EBF")}},[r("span",{staticClass:"iconfont icon-horizontal",on:{click:e.insertLine}})]):e._e(),e.tools.quote?r("li",{attrs:{name:e.$L("\u5F15\u7528")}},[r("span",{staticClass:"iconfont icon-quote",staticStyle:{"font-size":"16px"},on:{click:e.insertQuote}})]):e._e(),e.tools.ul?r("li",{attrs:{name:e.$L("\u65E0\u5E8F\u5217\u8868")}},[r("span",{staticClass:"iconfont icon-ul",on:{click:e.insertUl}})]):e._e(),e.tools.ol?r("li",{attrs:{name:e.$L("\u6709\u5E8F\u5217\u8868")}},[r("span",{staticClass:"iconfont icon-ol",on:{click:e.insertOl}})]):e._e(),e.tools.code?r("li",{attrs:{name:e.$L("\u4EE3\u7801\u5757")}},[r("span",{staticClass:"iconfont icon-code",on:{click:e.insertCode}})]):e._e(),e.tools.notChecked?r("li",{attrs:{name:e.$L("\u672A\u5B8C\u6210\u5217\u8868")}},[r("span",{staticClass:"iconfont icon-checked-false",on:{click:e.insertNotFinished}})]):e._e(),e.tools.checked?r("li",{attrs:{name:e.$L("\u5DF2\u5B8C\u6210\u5217\u8868")}},[r("span",{staticClass:"iconfont icon-checked",on:{click:e.insertFinished}})]):e._e(),e.tools.link?r("li",{attrs:{name:e.$L("\u94FE\u63A5")}},[r("span",{staticClass:"iconfont icon-link",on:{click:e.insertLink}})]):e._e(),e.tools.image?r("li",{attrs:{name:e.$L("\u56FE\u7247")}},[r("span",{staticClass:"iconfont icon-img",on:{click:e.insertImage}})]):e._e(),e.tools.uploadImage?r("li",{attrs:{name:e.$L("\u672C\u5730\u56FE\u7247")}},[r("span",{staticClass:"iconfont icon-upload-img",on:{click:e.chooseImage}})]):e._e(),e.tools.custom_image?r("li",{attrs:{name:e.$L("\u56FE\u7247\u7A7A\u95F4")}},[r("span",{staticClass:"iconfont icon-img",on:{click:function(n){return e.onCustom("image-browse")}}})]):e._e(),e.tools.custom_uploadImage?r("li",{attrs:{name:e.$L("\u4E0A\u4F20\u56FE\u7247")}},[r("span",{staticClass:"iconfont icon-upload-img",on:{click:function(n){return e.onCustom("image-upload")}}})]):e._e(),e.tools.custom_uploadFile?r("li",{attrs:{name:e.$L("\u4E0A\u4F20\u6587\u4EF6")}},[r("span",{staticClass:"icon-svg",on:{click:function(n){return e.onCustom("file-upload")}}},[r("svg",{staticClass:"icon",attrs:{t:"1599285632421",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"45640",width:"16",height:"16"}},[r("path",{attrs:{d:"M127.519 892.879v-763.34h655.448V514.69h63.612V81.831c0-8.783-7.12-15.903-15.903-15.903H79.81c-8.783 0-15.903 7.12-15.903 15.903v858.757c0 8.783 7.12 15.903 15.903 15.903h493.993v-63.612H127.519z",fill:"#999999","p-id":"45641"}}),r("path",{attrs:{d:"M231.608 228.388h447.269V292H231.608zM231.608 384.409h447.269v63.612H231.608zM231.608 540.43h245.141v63.612H231.608zM231.608 696.451h245.141v63.612H231.608zM923.269 762.938L745.315 584.984c-3.545-3.545-8.34-5.074-12.966-4.596a15.931 15.931 0 0 0-9.848 4.616L544.586 762.918c-6.248 6.248-6.248 16.379 0 22.627l22.353 22.353c6.248 6.248 16.379 6.248 22.627 0l112.555-112.555v245.148c0 8.837 7.163 16 16 16h31.612c8.837 0 16-7.163 16-16V695.363l112.555 112.555c6.248 6.248 16.379 6.248 22.627 0l22.353-22.353c6.249-6.248 6.249-16.378 0.001-22.627z",fill:"#999999","p-id":"45642"}})])])]):e._e(),e.tools.table?r("li",{attrs:{name:e.$L("\u8868\u683C")}},[r("span",{staticClass:"iconfont icon-table",on:{click:e.insertTable}})]):e._e(),e.tools.theme?r("li",{staticClass:"shift-theme",attrs:{name:e.$L("\u4EE3\u7801\u5757\u4E3B\u9898")}},[r("div",[r("span",{staticClass:"iconfont icon-theme",on:{click:function(n){e.themeSlideDown=!e.themeSlideDown}}}),r("ul",{class:{active:e.themeSlideDown},on:{mouseleave:function(n){e.themeSlideDown=!1}}},[r("li",{on:{click:function(n){return e.setThemes("light")}}},[e._v("Light")]),r("li",{on:{click:function(n){return e.setThemes("dark")}}},[e._v("VS Code")]),r("li",{on:{click:function(n){return e.setThemes("oneDark")}}},[e._v("Atom OneDark")]),r("li",{on:{click:function(n){return e.setThemes("gitHub")}}},[e._v("GitHub")])])])]):e._e(),r("li",{directives:[{name:"show",rawName:"v-show",value:e.tools.importmd,expression:"tools.importmd"}],staticClass:"import-file",attrs:{name:e.$L("\u5BFC\u5165\u6587\u4EF6")}},[r("span",{staticClass:"iconfont icon-daoru",on:{click:e.importFile}}),r("input",{attrs:{type:"file",accept:"text/markdown"},on:{change:function(n){return e.importFile(n)}}})]),r("li",{directives:[{name:"show",rawName:"v-show",value:e.tools.exportmd,expression:"tools.exportmd"}],attrs:{name:e.$L("\u4FDD\u5B58\u5230\u672C\u5730")}},[r("span",{staticClass:"iconfont icon-download",on:{click:e.exportFile}})]),e.tools.split&&e.split?r("li",{attrs:{name:e.$L("\u5168\u5C4F\u7F16\u8F91")}},[r("span",{staticClass:"iconfont icon-md",on:{click:function(n){e.split=!1}}})]):e._e(),e.tools.split&&!e.split?r("li",{attrs:{name:e.$L("\u5206\u5C4F\u663E\u793A")}},[r("span",{staticClass:"iconfont icon-group",on:{click:function(n){e.split=!0}}})]):e._e(),e.tools.preview?r("li",{attrs:{name:e.$L("\u9884\u89C8")}},[r("span",{staticClass:"iconfont icon-preview",on:{click:function(n){e.preview=!0}}})]):e._e(),e.tools.clear?r("li",{attrs:{name:e.$L("\u6E05\u7A7A")},on:{click:function(n){e.value=""}}},[r("span",{staticClass:"iconfont icon-clear"})]):e._e(),e.tools.save?r("li",{attrs:{name:e.$L("\u4FDD\u5B58")},on:{click:e.handleSave}},[r("span",{staticClass:"iconfont icon-save"})]):e._e(),e.tools.scrolling?r("li",{attrs:{name:e.$L(e.scrolling?"\u540C\u6B65\u6EDA\u52A8:\u5F00":"\u540C\u6B65\u6EDA\u52A8:\u5173")}},[r("span",{directives:[{name:"show",rawName:"v-show",value:e.scrolling,expression:"scrolling"}],staticClass:"iconfont icon-on",on:{click:function(n){e.scrolling=!e.scrolling}}}),r("span",{directives:[{name:"show",rawName:"v-show",value:!e.scrolling,expression:"!scrolling"}],staticClass:"iconfont icon-off",on:{click:function(n){e.scrolling=!e.scrolling}}})]):e._e(),e.tools.html_to_markdown?r("li",{attrs:{name:e.$L("html\u8F6Cmarkdown")},on:{click:function(n){return e.onCustom("html2md")}}},[r("span",{staticStyle:{width:"auto","font-size":"14px",padding:"0 6px"}},[e._v("HTML2MD")])]):e._e(),r("li",{staticClass:"right"},[r("ul",[r("li",{attrs:{name:e.$L("\u83DC\u5355")},on:{click:function(n){e.tocTrigger=!0}}},[r("span",{directives:[{name:"show",rawName:"v-show",value:e.tocShow,expression:"tocShow"}],staticClass:"icon-svg",on:{click:function(n){e.tocShow=!e.tocShow}}},[r("svg",{staticClass:"icon",attrs:{t:"1611551476626",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4615",width:"22",height:"22"}},[r("path",{attrs:{d:"M370.1 371.5h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.1-2.6 5.7-5.7 5.7z m333.5-7.6H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.2-2.7 5.7-5.8 5.7zM370.1 712.4h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.2-2.6 5.7-5.7 5.7z m333.5-7.5H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.1-2.7 5.7-5.8 5.7zM370.1 542.5h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.1-2.6 5.7-5.7 5.7z m333.5-7.6H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.2-2.7 5.7-5.8 5.7z","p-id":"4616",fill:"#1890ff"}}),r("path",{attrs:{d:"M847.1 560.4V250.1s0-24.7-14-46.4c-10.8-16.8-30-31.8-64.2-31.8h-261c-0.2 0-0.3 0-0.5 0.1H255s-78.1 0-78.1 78.1l0.1 213.4V774s0 24.7 13.9 46.3c10.8 16.8 30 31.8 64.2 31.8h261.1c0.2 0 0.3 0 0.5-0.1H769s78.1 0 78.1-78.1l-0.1-213.4 0.1-0.1z m-39 213.6c-1.3 38.5-38.9 39-38.9 39h-514c-1.3-0.1-2.5-0.2-3.8-0.3-5.4-1.1-15.7-4.1-23.9-11.7-9-9.7-11.2-22.3-11.7-26.1v-0.7l0.1-524.2c1.3-38.5 38.9-39 38.9-39h514c1.3 0.1 2.5 0.2 3.7 0.3 5.4 1.1 15.7 4.1 23.9 11.7 9 9.7 11.2 22.2 11.7 26 0 0.2 0 0.5 0.1 0.7l-0.1 524.3z","p-id":"4617",fill:"#1890ff"}})])]),r("span",{directives:[{name:"show",rawName:"v-show",value:!e.tocShow,expression:"!tocShow"}],staticClass:"icon-svg",on:{click:function(n){e.tocShow=!e.tocShow}}},[r("svg",{staticClass:"icon",attrs:{t:"1611551476626",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4615",width:"22",height:"22"}},[r("path",{attrs:{d:"M370.1 371.5h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.1-2.6 5.7-5.7 5.7z m333.5-7.6H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.2-2.7 5.7-5.8 5.7zM370.1 712.4h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.2-2.6 5.7-5.7 5.7z m333.5-7.5H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.1-2.7 5.7-5.8 5.7zM370.1 542.5h-49.6c-3.1 0-5.7-2.5-5.7-5.7v-49.6c0-3.1 2.5-5.7 5.7-5.7h49.6c3.1 0 5.7 2.5 5.7 5.7v49.6c0 3.1-2.6 5.7-5.7 5.7z m333.5-7.6H460.5c-3.1 0-5.7-2.5-5.7-5.7v-34.5c0-3.1 2.5-5.7 5.7-5.7h243.2c3.1 0 5.7 2.5 5.7 5.7v34.5c-0.1 3.2-2.7 5.7-5.8 5.7z","p-id":"4616",fill:"#777777"}}),r("path",{attrs:{d:"M847.1 560.4V250.1s0-24.7-14-46.4c-10.8-16.8-30-31.8-64.2-31.8h-261c-0.2 0-0.3 0-0.5 0.1H255s-78.1 0-78.1 78.1l0.1 213.4V774s0 24.7 13.9 46.3c10.8 16.8 30 31.8 64.2 31.8h261.1c0.2 0 0.3 0 0.5-0.1H769s78.1 0 78.1-78.1l-0.1-213.4 0.1-0.1z m-39 213.6c-1.3 38.5-38.9 39-38.9 39h-514c-1.3-0.1-2.5-0.2-3.8-0.3-5.4-1.1-15.7-4.1-23.9-11.7-9-9.7-11.2-22.3-11.7-26.1v-0.7l0.1-524.2c1.3-38.5 38.9-39 38.9-39h514c1.3 0.1 2.5 0.2 3.7 0.3 5.4 1.1 15.7 4.1 23.9 11.7 9 9.7 11.2 22.2 11.7 26 0 0.2 0 0.5 0.1 0.7l-0.1 524.3z","p-id":"4617",fill:"#777777"}})])])]),e.tools.fullscreen&&!e.fullscreen?r("li",{attrs:{name:e.$L("\u5168\u5C4F")}},[r("span",{staticClass:"iconfont icon-fullscreen",on:{click:function(n){e.fullscreen=!e.fullscreen}}})]):e._e(),e.tools.fullscreen&&e.fullscreen?r("li",{attrs:{name:e.$L("\u9000\u51FA\u5168\u5C4F")}},[r("span",{staticClass:"iconfont icon-quite",on:{click:function(n){e.fullscreen=!e.fullscreen}}})]):e._e(),e.tools.custom_fullscreen&&!e.isCustomFullscreen?r("li",{attrs:{name:e.$L("\u5168\u5C4F")}},[r("span",{staticClass:"iconfont icon-fullscreen",on:{click:function(n){return e.onCustom("fullscreen")}}})]):e._e(),e.tools.custom_fullscreen&&e.isCustomFullscreen?r("li",{attrs:{name:e.$L("\u9000\u51FA\u5168\u5C4F")}},[r("span",{staticClass:"iconfont icon-quite",on:{click:function(n){return e.onCustom("fullscreen")}}})]):e._e()])])]),r("div",{directives:[{name:"show",rawName:"v-show",value:e.preview&&!e.isPreview,expression:"preview && !isPreview"}],staticClass:"close-preview",on:{click:function(n){e.preview=!1}}},[r("span",{staticClass:"iconfont icon-close"})]),r("div",{staticClass:"markdown-content",style:{background:e.preview?"#fff":""}},[r("div",{directives:[{name:"show",rawName:"v-show",value:!e.preview,expression:"!preview"}],ref:"codemirror",staticClass:"codemirror",on:{mouseenter:function(n){return e.mousescrollSide("left")}}}),r("div",{directives:[{name:"show",rawName:"v-show",value:e.preview?e.preview:e.split,expression:"preview ? preview : split"}],ref:"preview",class:`markdown-preview ${"markdown-theme-"+e.themeName}`,on:{scroll:e.previewScroll,mouseenter:function(n){return e.mousescrollSide("right")}}},[r("div",{ref:"previewInner",domProps:{innerHTML:e._s(e.html)}})]),r("ul",{directives:[{name:"show",rawName:"v-show",value:e.tocShow,expression:"tocShow"}],staticClass:"toc-anchor"},e._l(e.tocLists,function(n){return r("li",{key:n.anchor,staticClass:"toc-anchor-item",on:{click:function(i){return e.tocClick(n)}}},[r("span",{class:`toc-link-${e.tocLevel(n.level)}${e.tocAction==n.anchor?" toc-link-action":""}`,attrs:{anchor:n.anchor,title:n.text}},[e._v(e._s(n.text))])])}),0)]),r("div",{class:["preview-img",e.previewImgModal?"active":""]},[r("span",{staticClass:"close icon-close iconfont",on:{click:function(n){e.previewImgModal=!1}}}),r("img",{class:[e.previewImgMode],attrs:{src:e.previewImgSrc,alt:""}})])])},lc=[];const ac=ic,pl={};var sc=gl(ac,oc,lc,!1,uc,"58b06fa2",null,null);function uc(e){for(let t in pl)this[t]=pl[t]}var fc=function(){return sc.exports}(),cc=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"mdeditor-wrapper"},[r("div",{staticClass:"mdeditor-box"},[r("MarkdownPro",{ref:"md1",attrs:{height:e.height,toolbars:e.toolbars,copyBtnText:e.$L("\u590D\u5236\u4EE3\u7801"),"is-custom-fullscreen":e.transfer},on:{"on-custom":e.customClick,"on-upload-image":e.handleUploadImageUpload},model:{value:e.content,callback:function(n){e.content=n},expression:"content"}}),r("ImgUpload",{ref:"myUpload",staticClass:"upload-control",attrs:{type:"callback",uploadIng:e.uploadIng,num:"50"},on:{"update:uploadIng":function(n){e.uploadIng=n},"update:upload-ing":function(n){e.uploadIng=n},"on-callback":e.editorImage}}),r("Upload",{ref:"fileUpload",staticClass:"upload-control",attrs:{name:"files",action:e.actionUrl,headers:e.headers,multiple:"",format:e.uploadFormat,"show-upload-list":!1,"max-size":e.maxSize,"on-progress":e.handleProgress,"on-success":e.handleSuccess,"on-error":e.handleError,"on-format-error":e.handleFormatError,"on-exceeded-size":e.handleMaxSize,"before-upload":e.handleBeforeUpload}})],1),e.uploadIng>0?r("Spin",{attrs:{fix:""}},[r("Icon",{staticClass:"icon-loading",attrs:{type:"ios-loading"}}),r("div",[e._v(e._s(e.$L("\u6B63\u5728\u4E0A\u4F20\u6587\u4EF6...")))])],1):e._e(),r("Modal",{staticClass:"mdeditor-transfer",attrs:{"footer-hide":"",fullscreen:"",transfer:"",closable:!1},model:{value:e.transfer,callback:function(n){e.transfer=n},expression:"transfer"}},[r("div",{staticClass:"mdeditor-transfer-body"},[e.transfer?r("MarkdownPro",{ref:"md2",attrs:{toolbars:e.toolbars,copyBtnText:e.$L("\u590D\u5236\u4EE3\u7801"),"is-custom-fullscreen":e.transfer,height:"100%"},on:{"on-custom":e.customClick,"on-upload-image":e.handleUploadImageUpload},model:{value:e.content,callback:function(n){e.content=n},expression:"content"}}):e._e()],1),e.uploadIng>0?r("Spin",{attrs:{fix:""}},[r("Icon",{staticClass:"icon-loading",attrs:{type:"ios-loading"}}),r("div",[e._v(e._s(e.$L("\u6B63\u5728\u4E0A\u4F20\u6587\u4EF6...")))])],1):e._e()],1),r("Modal",{attrs:{title:e.$L("html\u8F6Cmarkdown"),okText:e.$L("\u8F6C\u6362\u6210markdown"),width:"680","class-name":"simple-modal",transfer:""},on:{"on-ok":e.htmlOk},model:{value:e.html2md,callback:function(n){e.html2md=n},expression:"html2md"}},[r("Input",{attrs:{type:"textarea",rows:14,placeholder:e.$L("\u8BF7\u8F93\u5165html\u4EE3\u7801...")},model:{value:e.htmlValue,callback:function(n){e.htmlValue=n},expression:"htmlValue"}})],1)],1)},hc=[];const dc={name:"MDEditor",components:{ImgUpload:Ts,MarkdownPro:fc},props:{value:{default:""},height:{default:380},toolbars:{type:Object,default:()=>({strong:!0,italic:!0,overline:!0,h1:!0,h2:!0,h3:!0,h4:!1,h5:!1,h6:!1,hr:!0,quote:!0,ul:!0,ol:!0,code:!0,link:!0,image:!1,uploadImage:!1,table:!0,checked:!0,notChecked:!0,split:!0,preview:!0,fullscreen:!1,theme:!1,exportmd:!1,importmd:!1,save:!1,clear:!1,scrolling:!0,html_to_markdown:!0,custom_image:!0,custom_uploadImage:!0,custom_uploadFile:!0,custom_fullscreen:!0})}},data(){return{content:"",transfer:!1,html2md:!1,htmlValue:"",uploadIng:0,uploadFormat:["jpg","jpeg","webp","png","gif","doc","docx","xls","xlsx","ppt","pptx","txt","esp","pdf","rar","zip","gz","ai","avi","bmp","cdr","eps","mov","mp3","mp4","pr","psd","svg","tif"],actionUrl:$A.apiUrl("system/fileupload"),maxSize:1024e3}},mounted(){this.content=this.value},activated(){this.content=this.value},computed:{headers(){return{fd:$A.getSessionStorageString("userWsFd"),token:this.userToken}}},watch:{value(e){e==null&&(e=""),this.content=e},content(e){this.$emit("input",e)}},methods:{editorImage(e){for(let t=0;t<e.length;t++){let r=e[t];typeof r=="object"&&typeof r.url=="string"&&(this.transfer?this.$refs.md2.insertContent(`
![image](`+r.url+")"):this.$refs.md1.insertContent(`
![image](`+r.url+")"))}},customClick(e){switch(e){case"image-browse":{this.$refs.myUpload.browsePicture();break}case"image-upload":{this.$refs.myUpload.handleClick();break}case"file-upload":{this.$refs.fileUpload.handleClick();break}case"fullscreen":{this.transfer=!this.transfer;break}case"html2md":{this.html2md=!0;break}}},htmlOk(){$A.loadScript("js/html2md.js").then(e=>{this.transfer?this.$refs.md2.insertContent(`
`+toMarkdown(this.htmlValue,{gfm:!0})):this.$refs.md1.insertContent(`
`+toMarkdown(this.htmlValue,{gfm:!0})),this.htmlValue=""}).catch(e=>{$A.modalError("\u7EC4\u4EF6\u52A0\u8F7D\u5931\u8D25\uFF01")})},handleUploadImageUpload(e){this.$refs.myUpload.handleManual(e)},handleProgress(e,t){t._uploadIng===void 0&&(t._uploadIng=!0,this.uploadIng++)},handleSuccess(e,t){if(this.uploadIng--,e.ret===1){let r=`[${e.data.name} (${$A.bytesToSize(e.data.size*1024)})](${e.data.url})`;this.transfer?this.$refs.md2.insertContent(r):this.$refs.md1.insertContent(r)}else $A.modalWarning({title:"\u4E0A\u4F20\u5931\u8D25",content:"\u6587\u4EF6 "+t.name+" \u4E0A\u4F20\u5931\u8D25\uFF0C"+e.msg})},handleError(){this.uploadIng--},handleFormatError(e){$A.modalWarning({title:"\u6587\u4EF6\u683C\u5F0F\u4E0D\u6B63\u786E",content:"\u6587\u4EF6 "+e.name+" \u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u4EC5\u652F\u6301\u4E0A\u4F20\uFF1A"+this.uploadFormat.join(",")})},handleMaxSize(e){$A.modalWarning({title:"\u8D85\u51FA\u6587\u4EF6\u5927\u5C0F\u9650\u5236",content:"\u6587\u4EF6 "+e.name+" \u592A\u5927\uFF0C\u4E0D\u80FD\u8D85\u8FC7\uFF1A"+$A.bytesToSize(this.maxSize*1024)+"\u3002"})},handleBeforeUpload(){return!0}}},vl={};var pc=gl(dc,cc,hc,!1,vc,"2897aaf0",null,null);function vc(e){for(let t in vl)this[t]=vl[t]}var $c=function(){return pc.exports}();export{$c as default};