物管理前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

40 lines
280 KiB

import"./helpers-CjmtV6uB.js";import"./common-CalHcBJp.js";import{j as Fu}from"./index-C8mAaM2V.js";import{Q as Eu,t as Ol,H as Wu,d as Nl,c as Iu,o as Pl,f as Bu,al as Hu,i as zu,v as Ru,E as dl,am as Ku,b as _u,an as pl,h as vl}from"./index-bVOhw2NF.js";import{c as Uu,i as Gu,d as qu,g as Xu}from"./vue-repl-jaFwbjhK.js";function uf(){const We=(H,z)=>{z.addEventListener("message",H)},Ie=(H,z,V)=>{V.postMessage({type:H,data:z})};function y(H){var B;const z=document.getElementById(H.id);if(!z)return;const V=(B=z.querySelector(".iframe-container iframe"))==null?void 0:B.contentWindow;if(!V){Eu(y.bind(null,H));return}const{click:re,dblclick:I,mouseenter:D,mouseleave:_,change:T}=Fu();We(C=>{const{type:M,data:W}=C.data;if(M==="inited")Ol(()=>H.props.datasets,Z=>{Z&&Ie("update",Wu(Z),V)},{immediate:!0,deep:!0}),H.isRemote&&H.config&&Ie("config",JSON.parse(H.config),V);else if(M==="hookEmitEvent"){const{eventType:Z,value:O}=W;Z==="click"?re(H.props.datasets,O,H):Z==="dblclick"?I(H.props.datasets,O,H):Z==="mouseenter"?D(H.props.datasets,O,H):Z==="mouseleave"?_(H.props.datasets,O,H):Z==="change"&&T(H.props.datasets,O,H)}},V)}return{init:y}}var Ml={exports:{}};(function(We,Ie){(function(y,H){We.exports=H()})(Uu,function(){var y=navigator.userAgent,H=navigator.platform,z=/gecko\/\d/i.test(y),V=/MSIE \d/.test(y),re=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(y),I=/Edge\/(\d+)/.exec(y),D=V||re||I,_=D&&(V?document.documentMode||6:+(I||re)[1]),T=!I&&/WebKit\//.test(y),B=T&&/Qt\/\d+\.\d+/.test(y),C=!I&&/Chrome\/(\d+)/.exec(y),M=C&&+C[1],W=/Opera\//.test(y),Z=/Apple Computer/.test(navigator.vendor),O=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(y),S=/PhantomJS/.test(y),v=Z&&(/Mobile\/\w+/.test(y)||navigator.maxTouchPoints>2),g=/Android/.test(y),u=v||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(y),p=v||/Mac/.test(H),m=/\bCrOS\b/.test(y),w=/win/i.test(H),d=W&&y.match(/Version\/(\d*\.\d*)/);d&&(d=Number(d[1])),d&&d>=15&&(W=!1,T=!0);var L=p&&(B||W&&(d==null||d<12.11)),F=z||D&&_>=9;function N(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var U=function(e,t){var n=e.className,r=N(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function A(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function G(e,t){return A(e).appendChild(t)}function c(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),typeof t=="string")i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function Q(e,t,n,r){var i=c(e,t,n,r);return i.setAttribute("role","presentation"),i}var j;document.createRange?j=function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:j=function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch{return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};function ne(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 fe(e){var t=e.ownerDocument||e,n;try{n=e.activeElement}catch{n=t.body||null}for(;n&&n.shadowRoot&&n.shadowRoot.activeElement;)n=n.shadowRoot.activeElement;return n}function ce(e,t){var n=e.className;N(t).test(n)||(e.className+=(n?" ":"")+t)}function we(e,t){for(var n=e.split(" "),r=0;r<n.length;r++)n[r]&&!N(n[r]).test(t)&&(t+=" "+n[r]);return t}var Be=function(e){e.select()};v?Be=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:D&&(Be=function(e){try{e.select()}catch{}});function Me(e){return e.display.wrapper.ownerDocument}function Ge(e){return Ee(e.display.wrapper)}function Ee(e){return e.getRootNode?e.getRootNode():e.ownerDocument}function me(e){return Me(e).defaultView}function ge(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function xe(e,t,n){t||(t={});for(var r in e)e.hasOwnProperty(r)&&(n!==!1||!t.hasOwnProperty(r))&&(t[r]=e[r]);return t}function Le(e,t,n,r,i){t==null&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=r||0,a=i||0;;){var l=e.indexOf(" ",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=n-a%n,o=l+1}}var be=function(){this.id=null,this.f=null,this.time=0,this.handler=ge(this.onTimeout,this)};be.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},be.prototype.set=function(e,t){this.f=t;var n=+new Date+e;(!this.id||n<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=n)};function he(e,t){for(var n=0;n<e.length;++n)if(e[n]==t)return n;return-1}var it=50,Mt={toString:function(){return"CodeMirror.Pass"}},dt={scroll:!1},Lt={origin:"*mouse"},Ae={origin:"+move"};function Xe(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",r);o==-1&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}}var pt=[""];function Tt(e){for(;pt.length<=e;)pt.push(Ce(pt)+" ");return pt[e]}function Ce(e){return e[e.length-1]}function De(e,t){for(var n=[],r=0;r<e.length;r++)n[r]=t(e[r],r);return n}function R(e,t,n){for(var r=0,i=n(t);r<e.length&&n(e[r])<=i;)r++;e.splice(r,0,t)}function te(){}function X(e,t){var n;return Object.create?n=Object.create(e):(te.prototype=e,n=new te),t&&xe(t,n),n}var Te=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function at(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Te.test(e))}function jt(e,t){return t?t.source.indexOf("\\w")>-1&&at(e)?!0:t.test(e):at(e)}function In(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Yt=/[\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 je(e){return e.charCodeAt(0)>=768&&Yt.test(e)}function nr(e,t,n){for(;(n<0?t>0:t<e.length)&&je(e.charAt(t));)t+=n;return t}function Kt(e,t,n){for(var r=t>n?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}function ir(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<n&&a.to>t||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),a.level==1?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}var br=null;function or(e,t,n){var r;br=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&&n=="before"?r=i:br=i),o.from==t&&(o.from!=o.to&&n!="before"?r=i:br=i)}return r??br}var gi=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function n(f){return f<=247?e.charAt(f):1424<=f&&f<=1524?"R":1536<=f&&f<=1785?t.charAt(f-1536):1774<=f&&f<=2220?"r":8192<=f&&f<=8203?"w":f==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,o=/[LRr]/,a=/[Lb1n]/,l=/[1n]/;function s(f,b,k){this.level=f,this.from=b,this.to=k}return function(f,b){var k=b=="ltr"?"L":"R";if(f.length==0||b=="ltr"&&!r.test(f))return!1;for(var E=f.length,P=[],q=0;q<E;++q)P.push(n(f.charCodeAt(q)));for(var J=0,ee=k;J<E;++J){var ie=P[J];ie=="m"?P[J]=ee:ee=ie}for(var le=0,oe=k;le<E;++le){var se=P[le];se=="1"&&oe=="r"?P[le]="n":o.test(se)&&(oe=se,se=="r"&&(P[le]="R"))}for(var ve=1,de=P[0];ve<E-1;++ve){var ke=P[ve];ke=="+"&&de=="1"&&P[ve+1]=="1"?P[ve]="1":ke==","&&de==P[ve+1]&&(de=="1"||de=="n")&&(P[ve]=de),de=ke}for(var Fe=0;Fe<E;++Fe){var tt=P[Fe];if(tt==",")P[Fe]="N";else if(tt=="%"){var ze=void 0;for(ze=Fe+1;ze<E&&P[ze]=="%";++ze);for(var Ct=Fe&&P[Fe-1]=="!"||ze<E&&P[ze]=="1"?"1":"N",bt=Fe;bt<ze;++bt)P[bt]=Ct;Fe=ze-1}}for(var Ye=0,xt=k;Ye<E;++Ye){var ot=P[Ye];xt=="L"&&ot=="1"?P[Ye]="L":o.test(ot)&&(xt=ot)}for(var Qe=0;Qe<E;++Qe)if(i.test(P[Qe])){var Ze=void 0;for(Ze=Qe+1;Ze<E&&i.test(P[Ze]);++Ze);for(var Ue=(Qe?P[Qe-1]:k)=="L",kt=(Ze<E?P[Ze]:k)=="L",rn=Ue==kt?Ue?"L":"R":k,yr=Qe;yr<Ze;++yr)P[yr]=rn;Qe=Ze-1}for(var ft=[],Xt,rt=0;rt<E;)if(a.test(P[rt])){var fo=rt;for(++rt;rt<E&&a.test(P[rt]);++rt);ft.push(new s(0,fo,rt))}else{var rr=rt,Nr=ft.length,Pr=b=="rtl"?1:0;for(++rt;rt<E&&P[rt]!="L";++rt);for(var ht=rr;ht<rt;)if(l.test(P[ht])){rr<ht&&(ft.splice(Nr,0,new s(1,rr,ht)),Nr+=Pr);var nn=ht;for(++ht;ht<rt&&l.test(P[ht]);++ht);ft.splice(Nr,0,new s(2,nn,ht)),Nr+=Pr,rr=ht}else++ht;rr<rt&&ft.splice(Nr,0,new s(1,rr,rt))}return b=="ltr"&&(ft[0].level==1&&(Xt=f.match(/^\s+/))&&(ft[0].from=Xt[0].length,ft.unshift(new s(0,0,Xt[0].length))),Ce(ft).level==1&&(Xt=f.match(/\s+$/))&&(Ce(ft).to-=Xt[0].length,ft.push(new s(0,E-Xt[0].length,E)))),b=="rtl"?ft.reverse():ft}}();function Se(e,t){var n=e.order;return n==null&&(n=e.order=gi(e.text,t)),n}var Bn=[],pe=function(e,t,n){if(e.addEventListener)e.addEventListener(t,n,!1);else if(e.attachEvent)e.attachEvent("on"+t,n);else{var r=e._handlers||(e._handlers={});r[t]=(r[t]||Bn).concat(n)}};function Zt(e,t){return e._handlers&&e._handlers[t]||Bn}function lt(e,t,n){if(e.removeEventListener)e.removeEventListener(t,n,!1);else if(e.detachEvent)e.detachEvent("on"+t,n);else{var r=e._handlers,i=r&&r[t];if(i){var o=he(i,n);o>-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function Re(e,t){var n=Zt(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i<n.length;++i)n[i].apply(null,r)}function Ke(e,t,n){return typeof t=="string"&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),Re(e,n||t.type,e,t),vt(t)||t.codemirrorIgnore}function Nt(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var n=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),r=0;r<t.length;++r)he(n,t[r])==-1&&n.push(t[r])}function wt(e,t){return Zt(e,t).length>0}function Dt(e){e.prototype.on=function(t,n){pe(this,t,n)},e.prototype.off=function(t,n){lt(this,t,n)}}function st(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Mr(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function vt(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ar(e){st(e),Mr(e)}function on(e){return e.target||e.srcElement}function Ft(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),p&&e.ctrlKey&&t==1&&(t=3),t}var mi=function(){if(D&&_<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),Dr;function Hn(e){if(Dr==null){var t=c("span","​");G(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Dr=t.offsetWidth<=1&&t.offsetHeight>2&&!(D&&_<8))}var n=Dr?c("span","​"):c("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}var an;function lr(e){if(an!=null)return an;var t=G(e,document.createTextNode("AخA")),n=j(t,0,1).getBoundingClientRect(),r=j(t,1,2).getBoundingClientRect();return A(e),!n||n.left==n.right?!1:an=r.right-n.right<3}var Pt=`
b`.split(/\n/).length!=3?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf(`
`,t);i==-1&&(i=e.length);var o=e.slice(t,e.charAt(i-1)=="\r"?i-1:i),a=o.indexOf("\r");a!=-1?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},sr=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},zn=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Et=null;function yi(e){if(Et!=null)return Et;var t=G(e,c("span","x")),n=t.getBoundingClientRect(),r=j(t,0,1).getBoundingClientRect();return Et=Math.abs(n.left-r.left)>1}var Fr={},Wt={};function It(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Fr[e]=t}function xr(e,t){Wt[e]=t}function Er(e){if(typeof e=="string"&&Wt.hasOwnProperty(e))e=Wt[e];else if(e&&typeof e.name=="string"&&Wt.hasOwnProperty(e.name)){var t=Wt[e.name];typeof t=="string"&&(t={name:t}),e=X(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Er("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Er("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Wr(e,t){t=Er(t);var n=Fr[t.name];if(!n)return Wr(e,"text/plain");var r=n(e,t);if(ur.hasOwnProperty(t.name)){var i=ur[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var ur={};function Ir(e,t){var n=ur.hasOwnProperty(e)?ur[e]:ur[e]={};xe(t,n)}function _t(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function ln(e,t){for(var n;e.innerMode&&(n=e.innerMode(t),!(!n||n.mode==e));)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Br(e,t,n){return e.startState?e.startState(t,n):!0}var _e=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};_e.prototype.eol=function(){return this.pos>=this.string.length},_e.prototype.sol=function(){return this.pos==this.lineStart},_e.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},_e.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},_e.prototype.eat=function(e){var t=this.string.charAt(this.pos),n;if(typeof e=="string"?n=t==e:n=t&&(e.test?e.test(t):e(t)),n)return++this.pos,t},_e.prototype.eatWhile=function(e){for(var t=this.pos;this.eat(e););return this.pos>t},_e.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},_e.prototype.skipToEnd=function(){this.pos=this.string.length},_e.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},_e.prototype.backUp=function(e){this.pos-=e},_e.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=Le(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?Le(this.string,this.lineStart,this.tabSize):0)},_e.prototype.indentation=function(){return Le(this.string,null,this.tabSize)-(this.lineStart?Le(this.string,this.lineStart,this.tabSize):0)},_e.prototype.match=function(e,t,n){if(typeof e=="string"){var r=function(a){return n?a.toLowerCase():a},i=this.string.substr(this.pos,e.length);if(r(i)==r(e))return t!==!1&&(this.pos+=e.length),!0}else{var o=this.string.slice(this.pos).match(e);return o&&o.index>0?null:(o&&t!==!1&&(this.pos+=o[0].length),o)}},_e.prototype.current=function(){return this.string.slice(this.start,this.pos)},_e.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},_e.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},_e.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ue(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t<o){n=i;break}t-=o}return n.lines[t]}function Qt(e,t,n){var r=[],i=t.line;return e.iter(t.line,n.line+1,function(o){var a=o.text;i==n.line&&(a=a.slice(0,n.ch)),i==t.line&&(a=a.slice(t.ch)),r.push(a),++i}),r}function sn(e,t,n){var r=[];return e.iter(t,n,function(i){r.push(i.text)}),r}function At(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function h(e){if(e.parent==null)return null;for(var t=e.parent,n=he(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var i=0;r.children[i]!=t;++i)n+=r.children[i].chunkSize();return n+t.first}function x(e,t){var n=e.first;e:do{for(var r=0;r<e.children.length;++r){var i=e.children[r],o=i.height;if(t<o){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a],s=l.height;if(t<s)break;t-=s}return n+a}function Y(e,t){return t>=e.first&&t<e.first+e.size}function $(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function K(e,t,n){if(n===void 0&&(n=null),!(this instanceof K))return new K(e,t,n);this.line=e,this.ch=t,this.sticky=n}function ae(e,t){return e.line-t.line||e.ch-t.ch}function Oe(e,t){return e.sticky==t.sticky&&ae(e,t)==0}function Je(e){return K(e.line,e.ch)}function gt(e,t){return ae(e,t)<0?t:e}function Hr(e,t){return ae(e,t)<0?e:t}function po(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ye(e,t){if(t.line<e.first)return K(e.first,0);var n=e.first+e.size-1;return t.line>n?K(n,ue(e,n).text.length):El(t,ue(e,t.line).text.length)}function El(e,t){var n=e.ch;return n==null||n>t?K(e.line,t):n<0?K(e.line,0):e}function vo(e,t){for(var n=[],r=0;r<t.length;r++)n[r]=ye(e,t[r]);return n}var Rn=function(e,t){this.state=e,this.lookAhead=t},Ut=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};Ut.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return t!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},Ut.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Ut.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Ut.fromSaved=function(e,t,n){return t instanceof Rn?new Ut(e,_t(e.mode,t.state),n,t.lookAhead):new Ut(e,_t(e.mode,t),n)},Ut.prototype.save=function(e){var t=e!==!1?_t(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Rn(t,this.maxLookAhead):t};function go(e,t,n,r){var i=[e.state.modeGen],o={};wo(e,t.text,e.doc.mode,n,function(f,b){return i.push(f,b)},o,r);for(var a=n.state,l=function(f){n.baseTokens=i;var b=e.state.overlays[f],k=1,E=0;n.state=!0,wo(e,t.text,b.mode,n,function(P,q){for(var J=k;E<P;){var ee=i[k];ee>P&&i.splice(k,1,P,i[k+1],ee),k+=2,E=Math.min(P,ee)}if(q)if(b.opaque)i.splice(J,k-J,P,"overlay "+q),k=J+2;else for(;J<k;J+=2){var ie=i[J+1];i[J+1]=(ie?ie+" ":"")+"overlay "+q}},o),n.state=a,n.baseTokens=null,n.baseTokenPos=1},s=0;s<e.state.overlays.length;++s)l(s);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function mo(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=un(e,h(t)),i=t.text.length>e.options.maxHighlightLength&&_t(e.doc.mode,r.state),o=go(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function un(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new Ut(r,!0,t);var o=Wl(e,t,n),a=o>r.first&&ue(r,o-1).stateAfter,l=a?Ut.fromSaved(r,a,o):new Ut(r,Br(r.mode),o);return r.iter(o,t,function(s){bi(e,s.text,l);var f=l.line;s.stateAfter=f==t-1||f%5==0||f>=i.viewFrom&&f<i.viewTo?l.save():null,l.nextLine()}),n&&(r.modeFrontier=l.line),l}function bi(e,t,n,r){var i=e.doc.mode,o=new _e(t,e.options.tabSize,n);for(o.start=o.pos=r||0,t==""&&yo(i,n.state);!o.eol();)xi(i,o,n.state),o.start=o.pos}function yo(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var n=ln(e,t);if(n.mode.blankLine)return n.mode.blankLine(n.state)}}function xi(e,t,n,r){for(var i=0;i<10;i++){r&&(r[0]=ln(e,n).mode);var o=e.token(t,n);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}var bo=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function xo(e,t,n,r){var i=e.doc,o=i.mode,a;t=ye(i,t);var l=ue(i,t.line),s=un(e,t.line,n),f=new _e(l.text,e.options.tabSize,s),b;for(r&&(b=[]);(r||f.pos<t.ch)&&!f.eol();)f.start=f.pos,a=xi(o,f,s.state),r&&b.push(new bo(f,a,_t(i.mode,s.state)));return r?b:new bo(f,a,s.state)}function ko(e,t){if(e)for(;;){var n=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!n)break;e=e.slice(0,n.index)+e.slice(n.index+n[0].length);var r=n[1]?"bgClass":"textClass";t[r]==null?t[r]=n[2]:new RegExp("(?:^|\\s)"+n[2]+"(?:$|\\s)").test(t[r])||(t[r]+=" "+n[2])}return e}function wo(e,t,n,r,i,o,a){var l=n.flattenSpans;l==null&&(l=e.options.flattenSpans);var s=0,f=null,b=new _e(t,e.options.tabSize,r),k,E=e.options.addModeClass&&[null];for(t==""&&ko(yo(n,r.state),o);!b.eol();){if(b.pos>e.options.maxHighlightLength?(l=!1,a&&bi(e,t,r,b.pos),b.pos=t.length,k=null):k=ko(xi(n,b,r.state,E),o),E){var P=E[0].name;P&&(k="m-"+(k?P+" "+k:P))}if(!l||f!=k){for(;s<b.start;)s=Math.min(b.start,s+5e3),i(s,f);f=k}b.start=b.pos}for(;s<b.pos;){var q=Math.min(b.pos,s+5e3);i(q,f),s=q}}function Wl(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=ue(o,l-1),f=s.stateAfter;if(f&&(!n||l+(f instanceof Rn?f.lookAhead:0)<=o.modeFrontier))return l;var b=Le(s.text,null,e.options.tabSize);(i==null||r>b)&&(i=l-1,r=b)}return i}function Il(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontier<t-10)){for(var n=e.first,r=t-1;r>n;r--){var i=ue(e,r).stateAfter;if(i&&(!(i instanceof Rn)||r+i.lookAhead<t)){n=r+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,n)}}var So=!1,Jt=!1;function Bl(){So=!0}function Hl(){Jt=!0}function Kn(e,t,n){this.marker=e,this.from=t,this.to=n}function fn(e,t){if(e)for(var n=0;n<e.length;++n){var r=e[n];if(r.marker==t)return r}}function zl(e,t){for(var n,r=0;r<e.length;++r)e[r]!=t&&(n||(n=[])).push(e[r]);return n}function Rl(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}function Kl(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=o.from==null||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&a.type=="bookmark"&&(!n||!o.marker.insertLeft)){var s=o.to==null||(a.inclusiveRight?o.to>=t:o.to>t);(r||(r=[])).push(new Kn(a,o.from,s?null:o.to))}}return r}function _l(e,t,n){var r;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=o.to==null||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&a.type=="bookmark"&&(!n||o.marker.insertLeft)){var s=o.from==null||(a.inclusiveLeft?o.from<=t:o.from<t);(r||(r=[])).push(new Kn(a,s?null:o.from-t,o.to==null?null:o.to-t))}}return r}function ki(e,t){if(t.full)return null;var n=Y(e,t.from.line)&&ue(e,t.from.line).markedSpans,r=Y(e,t.to.line)&&ue(e,t.to.line).markedSpans;if(!n&&!r)return null;var i=t.from.ch,o=t.to.ch,a=ae(t.from,t.to)==0,l=Kl(n,i,a),s=_l(r,o,a),f=t.text.length==1,b=Ce(t.text).length+(f?i:0);if(l)for(var k=0;k<l.length;++k){var E=l[k];if(E.to==null){var P=fn(s,E.marker);P?f&&(E.to=P.to==null?null:P.to+b):E.to=i}}if(s)for(var q=0;q<s.length;++q){var J=s[q];if(J.to!=null&&(J.to+=b),J.from==null){var ee=fn(l,J.marker);ee||(J.from=b,f&&(l||(l=[])).push(J))}else J.from+=b,f&&(l||(l=[])).push(J)}l&&(l=Co(l)),s&&s!=l&&(s=Co(s));var ie=[l];if(!f){var le=t.text.length-2,oe;if(le>0&&l)for(var se=0;se<l.length;++se)l[se].to==null&&(oe||(oe=[])).push(new Kn(l[se].marker,null,null));for(var ve=0;ve<le;++ve)ie.push(oe);ie.push(s)}return ie}function Co(e){for(var t=0;t<e.length;++t){var n=e[t];n.from!=null&&n.from==n.to&&n.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function Ul(e,t,n){var r=null;if(e.iter(t.line,n.line+1,function(P){if(P.markedSpans)for(var q=0;q<P.markedSpans.length;++q){var J=P.markedSpans[q].marker;J.readOnly&&(!r||he(r,J)==-1)&&(r||(r=[])).push(J)}}),!r)return null;for(var i=[{from:t,to:n}],o=0;o<r.length;++o)for(var a=r[o],l=a.find(0),s=0;s<i.length;++s){var f=i[s];if(!(ae(f.to,l.from)<0||ae(f.from,l.to)>0)){var b=[s,1],k=ae(f.from,l.from),E=ae(f.to,l.to);(k<0||!a.inclusiveLeft&&!k)&&b.push({from:f.from,to:l.from}),(E>0||!a.inclusiveRight&&!E)&&b.push({from:l.to,to:f.to}),i.splice.apply(i,b),s+=b.length-3}}return i}function Lo(e){var t=e.markedSpans;if(t){for(var n=0;n<t.length;++n)t[n].marker.detachLine(e);e.markedSpans=null}}function To(e,t){if(t){for(var n=0;n<t.length;++n)t[n].marker.attachLine(e);e.markedSpans=t}}function _n(e){return e.inclusiveLeft?-1:0}function Un(e){return e.inclusiveRight?1:0}function wi(e,t){var n=e.lines.length-t.lines.length;if(n!=0)return n;var r=e.find(),i=t.find(),o=ae(r.from,i.from)||_n(e)-_n(t);if(o)return-o;var a=ae(r.to,i.to)||Un(e)-Un(t);return a||t.id-e.id}function Ao(e,t){var n=Jt&&e.markedSpans,r;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&(t?i.from:i.to)==null&&(!r||wi(r,i.marker)<0)&&(r=i.marker);return r}function Oo(e){return Ao(e,!0)}function Gn(e){return Ao(e,!1)}function Gl(e,t){var n=Jt&&e.markedSpans,r;if(n)for(var i=0;i<n.length;++i){var o=n[i];o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!r||wi(r,o.marker)<0)&&(r=o.marker)}return r}function No(e,t,n,r,i){var o=ue(e,t),a=Jt&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var f=s.marker.find(0),b=ae(f.from,n)||_n(s.marker)-_n(i),k=ae(f.to,r)||Un(s.marker)-Un(i);if(!(b>=0&&k<=0||b<=0&&k>=0)&&(b<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ae(f.to,n)>=0:ae(f.to,n)>0)||b>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?ae(f.from,r)<=0:ae(f.from,r)<0)))return!0}}}function Bt(e){for(var t;t=Oo(e);)e=t.find(-1,!0).line;return e}function ql(e){for(var t;t=Gn(e);)e=t.find(1,!0).line;return e}function Xl(e){for(var t,n;t=Gn(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function Si(e,t){var n=ue(e,t),r=Bt(n);return n==r?t:h(r)}function Po(e,t){if(t>e.lastLine())return t;var n=ue(e,t),r;if(!fr(e,n))return t;for(;r=Gn(n);)n=r.find(1,!0).line;return h(n)+1}function fr(e,t){var n=Jt&&t.markedSpans;if(n){for(var r=void 0,i=0;i<n.length;++i)if(r=n[i],!!r.marker.collapsed){if(r.from==null)return!0;if(!r.marker.widgetNode&&r.from==0&&r.marker.inclusiveLeft&&Ci(e,t,r))return!0}}}function Ci(e,t,n){if(n.to==null){var r=n.marker.find(1,!0);return Ci(e,r.line,fn(r.line.markedSpans,n.marker))}if(n.marker.inclusiveRight&&n.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==n.to&&(i.to==null||i.to!=n.from)&&(i.marker.inclusiveLeft||n.marker.inclusiveRight)&&Ci(e,t,i))return!0}function Vt(e){e=Bt(e);for(var t=0,n=e.parent,r=0;r<n.lines.length;++r){var i=n.lines[r];if(i==e)break;t+=i.height}for(var o=n.parent;o;n=o,o=n.parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==n)break;t+=l.height}return t}function qn(e){if(e.height==0)return 0;for(var t=e.text.length,n,r=e;n=Oo(r);){var i=n.find(0,!0);r=i.from.line,t+=i.from.ch-i.to.ch}for(r=e;n=Gn(r);){var o=n.find(0,!0);t-=r.text.length-o.from.ch,r=o.to.line,t+=r.text.length-o.to.ch}return t}function Li(e){var t=e.display,n=e.doc;t.maxLine=ue(n,n.first),t.maxLineLength=qn(t.maxLine),t.maxLineChanged=!0,n.iter(function(r){var i=qn(r);i>t.maxLineLength&&(t.maxLineLength=i,t.maxLine=r)})}var zr=function(e,t,n){this.text=e,To(this,t),this.height=n?n(this):1};zr.prototype.lineNo=function(){return h(this)},Dt(zr);function jl(e,t,n,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Lo(e),To(e,n);var i=r?r(e):1;i!=e.height&&At(e,i)}function Yl(e){e.parent=null,Lo(e)}var Zl={},Ql={};function Mo(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Ql:Zl;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Do(e,t){var n=Q("span",null,null,T?"padding-right: .1px":null),r={pre:Q("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=Vl,lr(e.display.measure)&&(a=Se(o,e.doc.direction))&&(r.addToken=es(r.addToken,a)),r.map=[];var l=t!=e.display.externalMeasured&&h(o);ts(o,r,mo(e,o,l)),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=we(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=we(o.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(Hn(e.display.measure))),i==0?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(T){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Re(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=we(r.pre.className,r.textClass||"")),r}function Jl(e){var t=c("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Vl(e,t,n,r,i,o,a){if(t){var l=e.splitSpaces?$l(t,e.trailingSpace):t,s=e.cm.state.specialChars,f=!1,b;if(!s.test(t))e.col+=t.length,b=document.createTextNode(l),e.map.push(e.pos,e.pos+t.length,b),D&&_<9&&(f=!0),e.pos+=t.length;else{b=document.createDocumentFragment();for(var k=0;;){s.lastIndex=k;var E=s.exec(t),P=E?E.index-k:t.length-k;if(P){var q=document.createTextNode(l.slice(k,k+P));D&&_<9?b.appendChild(c("span",[q])):b.appendChild(q),e.map.push(e.pos,e.pos+P,q),e.col+=P,e.pos+=P}if(!E)break;k+=P+1;var J=void 0;if(E[0]==" "){var ee=e.cm.options.tabSize,ie=ee-e.col%ee;J=b.appendChild(c("span",Tt(ie),"cm-tab")),J.setAttribute("role","presentation"),J.setAttribute("cm-text"," "),e.col+=ie}else E[0]=="\r"||E[0]==`
`?(J=b.appendChild(c("span",E[0]=="\r"?"␍":"␤","cm-invalidchar")),J.setAttribute("cm-text",E[0]),e.col+=1):(J=e.cm.options.specialCharPlaceholder(E[0]),J.setAttribute("cm-text",E[0]),D&&_<9?b.appendChild(c("span",[J])):b.appendChild(J),e.col+=1);e.map.push(e.pos,e.pos+1,J),e.pos++}}if(e.trailingSpace=l.charCodeAt(t.length-1)==32,n||r||i||f||o||a){var le=n||"";r&&(le+=r),i&&(le+=i);var oe=c("span",[b],le,o);if(a)for(var se in a)a.hasOwnProperty(se)&&se!="style"&&se!="class"&&oe.setAttribute(se,a[se]);return e.content.appendChild(oe)}e.content.appendChild(b)}}function $l(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;i<e.length;i++){var o=e.charAt(i);o==" "&&n&&(i==e.length-1||e.charCodeAt(i+1)==32)&&(o=" "),r+=o,n=o==" "}return r}function es(e,t){return function(n,r,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var f=n.pos,b=f+r.length;;){for(var k=void 0,E=0;E<t.length&&(k=t[E],!(k.to>f&&k.from<=f));E++);if(k.to>=b)return e(n,r,i,o,a,l,s);e(n,r.slice(0,k.to-f),i,o,null,l,s),o=null,r=r.slice(k.to-f),f=k.to}}}function Fo(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function ts(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(!r){for(var a=1;a<n.length;a+=2)t.addToken(t,i.slice(o,o=n[a]),Mo(n[a+1],t.cm.options));return}for(var l=i.length,s=0,f=1,b="",k,E,P=0,q,J,ee,ie,le;;){if(P==s){q=J=ee=E="",le=null,ie=null,P=1/0;for(var oe=[],se=void 0,ve=0;ve<r.length;++ve){var de=r[ve],ke=de.marker;if(ke.type=="bookmark"&&de.from==s&&ke.widgetNode)oe.push(ke);else if(de.from<=s&&(de.to==null||de.to>s||ke.collapsed&&de.to==s&&de.from==s)){if(de.to!=null&&de.to!=s&&P>de.to&&(P=de.to,J=""),ke.className&&(q+=" "+ke.className),ke.css&&(E=(E?E+";":"")+ke.css),ke.startStyle&&de.from==s&&(ee+=" "+ke.startStyle),ke.endStyle&&de.to==P&&(se||(se=[])).push(ke.endStyle,de.to),ke.title&&((le||(le={})).title=ke.title),ke.attributes)for(var Fe in ke.attributes)(le||(le={}))[Fe]=ke.attributes[Fe];ke.collapsed&&(!ie||wi(ie.marker,ke)<0)&&(ie=de)}else de.from>s&&P>de.from&&(P=de.from)}if(se)for(var tt=0;tt<se.length;tt+=2)se[tt+1]==P&&(J+=" "+se[tt]);if(!ie||ie.from==s)for(var ze=0;ze<oe.length;++ze)Fo(t,0,oe[ze]);if(ie&&(ie.from||0)==s){if(Fo(t,(ie.to==null?l+1:ie.to)-s,ie.marker,ie.from==null),ie.to==null)return;ie.to==s&&(ie=!1)}}if(s>=l)break;for(var Ct=Math.min(l,P);;){if(b){var bt=s+b.length;if(!ie){var Ye=bt>Ct?b.slice(0,Ct-s):b;t.addToken(t,Ye,k?k+q:q,ee,s+Ye.length==P?J:"",E,le)}if(bt>=Ct){b=b.slice(Ct-s),s=Ct;break}s=bt,ee=""}b=i.slice(o,o=n[f++]),k=Mo(n[f++],t.cm.options)}}}function Eo(e,t,n){this.line=t,this.rest=Xl(t),this.size=this.rest?h(Ce(this.rest))-n+1:1,this.node=this.text=null,this.hidden=fr(e,t)}function Xn(e,t,n){for(var r=[],i,o=t;o<n;o=i){var a=new Eo(e.doc,ue(e.doc,o),o);i=o+a.size,r.push(a)}return r}var Rr=null;function rs(e){Rr?Rr.ops.push(e):e.ownsGroup=Rr={ops:[e],delayedCallbacks:[]}}function ns(e){var t=e.delayedCallbacks,n=0;do{for(;n<t.length;n++)t[n].call(null);for(var r=0;r<e.ops.length;r++){var i=e.ops[r];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(n<t.length)}function is(e,t){var n=e.ownsGroup;if(n)try{ns(n)}finally{Rr=null,t(n)}}var cn=null;function Ve(e,t){var n=Zt(e,t);if(n.length){var r=Array.prototype.slice.call(arguments,2),i;Rr?i=Rr.delayedCallbacks:cn?i=cn:(i=cn=[],setTimeout(os,0));for(var o=function(l){i.push(function(){return n[l].apply(null,r)})},a=0;a<n.length;++a)o(a)}}function os(){var e=cn;cn=null;for(var t=0;t<e.length;++t)e[t]()}function Wo(e,t,n,r){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];o=="text"?ls(e,t):o=="gutter"?Bo(e,t,n,r):o=="class"?Ti(e,t):o=="widget"&&ss(e,t,r)}t.changes=null}function hn(e){return e.node==e.text&&(e.node=c("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),D&&_<8&&(e.node.style.zIndex=2)),e.node}function as(e,t){var n=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(n&&(n+=" CodeMirror-linebackground"),t.background)n?t.background.className=n:(t.background.parentNode.removeChild(t.background),t.background=null);else if(n){var r=hn(t);t.background=r.insertBefore(c("div",null,n),r.firstChild),e.display.input.setUneditable(t.background)}}function Io(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Do(e,t)}function ls(e,t){var n=t.text.className,r=Io(e,t);t.text==t.node&&(t.node=r.pre),t.text.parentNode.replaceChild(r.pre,t.text),t.text=r.pre,r.bgClass!=t.bgClass||r.textClass!=t.textClass?(t.bgClass=r.bgClass,t.textClass=r.textClass,Ti(e,t)):n&&(t.text.className=n)}function Ti(e,t){as(e,t),t.line.wrapClass?hn(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var n=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=n||""}function Bo(e,t,n,r){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=hn(t);t.gutterBackground=c("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=hn(t),l=t.gutter=c("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(l.setAttribute("aria-hidden","true"),e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),e.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])&&(t.lineNumber=l.appendChild(c("div",$(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.display.gutterSpecs.length;++s){var f=e.display.gutterSpecs[s].className,b=o.hasOwnProperty(f)&&o[f];b&&l.appendChild(c("div",[b],"CodeMirror-gutter-elt","left: "+r.gutterLeft[f]+"px; width: "+r.gutterWidth[f]+"px"))}}}function ss(e,t,n){t.alignable&&(t.alignable=null);for(var r=N("CodeMirror-linewidget"),i=t.node.firstChild,o=void 0;i;i=o)o=i.nextSibling,r.test(i.className)&&t.node.removeChild(i);Ho(e,t,n)}function us(e,t,n,r){var i=Io(e,t);return t.text=t.node=i.pre,i.bgClass&&(t.bgClass=i.bgClass),i.textClass&&(t.textClass=i.textClass),Ti(e,t),Bo(e,t,n,r),Ho(e,t,r),t.node}function Ho(e,t,n){if(zo(e,t.line,t,n,!0),t.rest)for(var r=0;r<t.rest.length;r++)zo(e,t.rest[r],t,n,!1)}function zo(e,t,n,r,i){if(t.widgets)for(var o=hn(n),a=0,l=t.widgets;a<l.length;++a){var s=l[a],f=c("div",[s.node],"CodeMirror-linewidget"+(s.className?" "+s.className:""));s.handleMouseEvents||f.setAttribute("cm-ignore-events","true"),fs(s,f,n,r),e.display.input.setUneditable(f),i&&s.above?o.insertBefore(f,n.gutter||n.text):o.appendChild(f),Ve(s,"redraw")}}function fs(e,t,n,r){if(e.noHScroll){(n.alignable||(n.alignable=[])).push(t);var i=r.wrapperWidth;t.style.left=r.fixedPos+"px",e.coverGutter||(i-=r.gutterTotalWidth,t.style.paddingLeft=r.gutterTotalWidth+"px"),t.style.width=i+"px"}e.coverGutter&&(t.style.zIndex=5,t.style.position="relative",e.noHScroll||(t.style.marginLeft=-r.gutterTotalWidth+"px"))}function dn(e){if(e.height!=null)return e.height;var t=e.doc.cm;if(!t)return 0;if(!ne(document.body,e.node)){var n="position: relative;";e.coverGutter&&(n+="margin-left: -"+t.display.gutters.offsetWidth+"px;"),e.noHScroll&&(n+="width: "+t.display.wrapper.clientWidth+"px;"),G(t.display.measure,c("div",[e.node],null,n))}return e.height=e.node.parentNode.offsetHeight}function $t(e,t){for(var n=on(t);n!=e.wrapper;n=n.parentNode)if(!n||n.nodeType==1&&n.getAttribute("cm-ignore-events")=="true"||n.parentNode==e.sizer&&n!=e.mover)return!0}function jn(e){return e.lineSpace.offsetTop}function Ai(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Ro(e){if(e.cachedPaddingH)return e.cachedPaddingH;var t=G(e.measure,c("pre","x","CodeMirror-line-like")),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r={left:parseInt(n.paddingLeft),right:parseInt(n.paddingRight)};return!isNaN(r.left)&&!isNaN(r.right)&&(e.cachedPaddingH=r),r}function Gt(e){return it-e.display.nativeBarWidth}function kr(e){return e.display.scroller.clientWidth-Gt(e)-e.display.barWidth}function Oi(e){return e.display.scroller.clientHeight-Gt(e)-e.display.barHeight}function cs(e,t,n){var r=e.options.lineWrapping,i=r&&kr(e);if(!t.measure.heights||r&&t.measure.width!=i){var o=t.measure.heights=[];if(r){t.measure.width=i;for(var a=t.text.firstChild.getClientRects(),l=0;l<a.length-1;l++){var s=a[l],f=a[l+1];Math.abs(s.bottom-f.bottom)>2&&o.push((s.bottom+f.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ko(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;r<e.rest.length;r++)if(e.rest[r]==t)return{map:e.measure.maps[r],cache:e.measure.caches[r]};for(var i=0;i<e.rest.length;i++)if(h(e.rest[i])>n)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function hs(e,t){t=Bt(t);var n=h(t),r=e.display.externalMeasured=new Eo(e.doc,t,n);r.lineN=n;var i=r.built=Do(e,r);return r.text=i.pre,G(e.display.lineMeasure,i.pre),r}function _o(e,t,n,r){return qt(e,Kr(e,t),n,r)}function Ni(e,t){if(t>=e.display.viewFrom&&t<e.display.viewTo)return e.display.view[Cr(e,t)];var n=e.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size)return n}function Kr(e,t){var n=h(t),r=Ni(e,n);r&&!r.text?r=null:r&&r.changes&&(Wo(e,r,n,Ei(e)),e.curOp.forceUpdate=!0),r||(r=hs(e,t));var i=Ko(r,t,n);return{line:t,view:r,rect:null,map:i.map,cache:i.cache,before:i.before,hasHeights:!1}}function qt(e,t,n,r,i){t.before&&(n=-1);var o=n+(r||""),a;return t.cache.hasOwnProperty(o)?a=t.cache[o]:(t.rect||(t.rect=t.view.text.getBoundingClientRect()),t.hasHeights||(cs(e,t.view,t.rect),t.hasHeights=!0),a=ps(e,t,n,r),a.bogus||(t.cache[o]=a)),{left:a.left,right:a.right,top:i?a.rtop:a.top,bottom:i?a.rbottom:a.bottom}}var Uo={left:0,right:0,top:0,bottom:0};function Go(e,t,n){for(var r,i,o,a,l,s,f=0;f<e.length;f+=3)if(l=e[f],s=e[f+1],t<l?(i=0,o=1,a="left"):t<s?(i=t-l,o=i+1):(f==e.length-3||t==s&&e[f+3]>t)&&(o=s-l,i=o-1,t>=s&&(a="right")),i!=null){if(r=e[f+2],l==s&&n==(r.insertLeft?"left":"right")&&(a=n),n=="left"&&i==0)for(;f&&e[f-2]==e[f-3]&&e[f-1].insertLeft;)r=e[(f-=3)+2],a="left";if(n=="right"&&i==s-l)for(;f<e.length-3&&e[f+3]==e[f+4]&&!e[f+5].insertLeft;)r=e[(f+=3)+2],a="right";break}return{node:r,start:i,end:o,collapse:a,coverStart:l,coverEnd:s}}function ds(e,t){var n=Uo;if(t=="left")for(var r=0;r<e.length&&(n=e[r]).left==n.right;r++);else for(var i=e.length-1;i>=0&&(n=e[i]).left==n.right;i--);return n}function ps(e,t,n,r){var i=Go(t.map,n,r),o=i.node,a=i.start,l=i.end,s=i.collapse,f;if(o.nodeType==3){for(var b=0;b<4;b++){for(;a&&je(t.line.text.charAt(i.coverStart+a));)--a;for(;i.coverStart+l<i.coverEnd&&je(t.line.text.charAt(i.coverStart+l));)++l;if(D&&_<9&&a==0&&l==i.coverEnd-i.coverStart?f=o.parentNode.getBoundingClientRect():f=ds(j(o,a,l).getClientRects(),r),f.left||f.right||a==0)break;l=a,a=a-1,s="right"}D&&_<11&&(f=vs(e.display.measure,f))}else{a>0&&(s=r="right");var k;e.options.lineWrapping&&(k=o.getClientRects()).length>1?f=k[r=="right"?k.length-1:0]:f=o.getBoundingClientRect()}if(D&&_<9&&!a&&(!f||!f.left&&!f.right)){var E=o.parentNode.getClientRects()[0];E?f={left:E.left,right:E.left+Ur(e.display),top:E.top,bottom:E.bottom}:f=Uo}for(var P=f.top-t.rect.top,q=f.bottom-t.rect.top,J=(P+q)/2,ee=t.view.measure.heights,ie=0;ie<ee.length-1&&!(J<ee[ie]);ie++);var le=ie?ee[ie-1]:0,oe=ee[ie],se={left:(s=="right"?f.right:f.left)-t.rect.left,right:(s=="left"?f.left:f.right)-t.rect.left,top:le,bottom:oe};return!f.left&&!f.right&&(se.bogus=!0),e.options.singleCursorHeightPerLine||(se.rtop=P,se.rbottom=q),se}function vs(e,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!yi(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}function qo(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 Xo(e){e.display.externalMeasure=null,A(e.display.lineMeasure);for(var t=0;t<e.display.view.length;t++)qo(e.display.view[t])}function pn(e){Xo(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function jo(e){return C&&g?-(e.body.getBoundingClientRect().left-parseInt(getComputedStyle(e.body).marginLeft)):e.defaultView.pageXOffset||(e.documentElement||e.body).scrollLeft}function Yo(e){return C&&g?-(e.body.getBoundingClientRect().top-parseInt(getComputedStyle(e.body).marginTop)):e.defaultView.pageYOffset||(e.documentElement||e.body).scrollTop}function Pi(e){var t=Bt(e),n=t.widgets,r=0;if(n)for(var i=0;i<n.length;++i)n[i].above&&(r+=dn(n[i]));return r}function Yn(e,t,n,r,i){if(!i){var o=Pi(t);n.top+=o,n.bottom+=o}if(r=="line")return n;r||(r="local");var a=Vt(t);if(r=="local"?a+=jn(e.display):a-=e.display.viewOffset,r=="page"||r=="window"){var l=e.display.lineSpace.getBoundingClientRect();a+=l.top+(r=="window"?0:Yo(Me(e)));var s=l.left+(r=="window"?0:jo(Me(e)));n.left+=s,n.right+=s}return n.top+=a,n.bottom+=a,n}function Zo(e,t,n){if(n=="div")return t;var r=t.left,i=t.top;if(n=="page")r-=jo(Me(e)),i-=Yo(Me(e));else if(n=="local"||!n){var o=e.display.sizer.getBoundingClientRect();r+=o.left,i+=o.top}var a=e.display.lineSpace.getBoundingClientRect();return{left:r-a.left,top:i-a.top}}function Zn(e,t,n,r,i){return r||(r=ue(e.doc,t.line)),Yn(e,r,_o(e,r,t.ch,i),n)}function Ht(e,t,n,r,i,o){r=r||ue(e.doc,t.line),i||(i=Kr(e,r));function a(q,J){var ee=qt(e,i,q,J?"right":"left",o);return J?ee.left=ee.right:ee.right=ee.left,Yn(e,r,ee,n)}var l=Se(r,e.doc.direction),s=t.ch,f=t.sticky;if(s>=r.text.length?(s=r.text.length,f="before"):s<=0&&(s=0,f="after"),!l)return a(f=="before"?s-1:s,f=="before");function b(q,J,ee){var ie=l[J],le=ie.level==1;return a(ee?q-1:q,le!=ee)}var k=or(l,s,f),E=br,P=b(s,k,f=="before");return E!=null&&(P.other=b(s,E,f!="before")),P}function Qo(e,t){var n=0;t=ye(e.doc,t),e.options.lineWrapping||(n=Ur(e.display)*t.ch);var r=ue(e.doc,t.line),i=Vt(r)+jn(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Mi(e,t,n,r,i){var o=K(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Di(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return Mi(r.first,0,null,-1,-1);var i=x(r,n),o=r.first+r.size-1;if(i>o)return Mi(r.first+r.size-1,ue(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=ue(r,i);;){var l=gs(e,a,i,t,n),s=Gl(a,l.ch+(l.xRel>0||l.outside>0?1:0));if(!s)return l;var f=s.find(1);if(f.line==i)return f;a=ue(r,i=f.line)}}function Jo(e,t,n,r){r-=Pi(t);var i=t.text.length,o=Kt(function(a){return qt(e,n,a-1).bottom<=r},i,0);return i=Kt(function(a){return qt(e,n,a).top>r},o,i),{begin:o,end:i}}function Vo(e,t,n,r){n||(n=Kr(e,t));var i=Yn(e,t,qt(e,n,r),"line").top;return Jo(e,t,n,i)}function Fi(e,t,n,r){return e.bottom<=n?!1:e.top>n?!0:(r?e.left:e.right)>t}function gs(e,t,n,r,i){i-=Vt(t);var o=Kr(e,t),a=Pi(t),l=0,s=t.text.length,f=!0,b=Se(t,e.doc.direction);if(b){var k=(e.options.lineWrapping?ys:ms)(e,t,n,o,b,r,i);f=k.level!=1,l=f?k.from:k.to-1,s=f?k.to:k.from-1}var E=null,P=null,q=Kt(function(ve){var de=qt(e,o,ve);return de.top+=a,de.bottom+=a,Fi(de,r,i,!1)?(de.top<=i&&de.left<=r&&(E=ve,P=de),!0):!1},l,s),J,ee,ie=!1;if(P){var le=r-P.left<P.right-r,oe=le==f;q=E+(oe?0:1),ee=oe?"after":"before",J=le?P.left:P.right}else{!f&&(q==s||q==l)&&q++,ee=q==0?"after":q==t.text.length?"before":qt(e,o,q-(f?1:0)).bottom+a<=i==f?"after":"before";var se=Ht(e,K(n,q,ee),"line",t,o);J=se.left,ie=i<se.top?-1:i>=se.bottom?1:0}return q=nr(t.text,q,1),Mi(n,q,ee,ie,r-J)}function ms(e,t,n,r,i,o,a){var l=Kt(function(k){var E=i[k],P=E.level!=1;return Fi(Ht(e,K(n,P?E.to:E.from,P?"before":"after"),"line",t,r),o,a,!0)},0,i.length-1),s=i[l];if(l>0){var f=s.level!=1,b=Ht(e,K(n,f?s.from:s.to,f?"after":"before"),"line",t,r);Fi(b,o,a,!0)&&b.top>a&&(s=i[l-1])}return s}function ys(e,t,n,r,i,o,a){var l=Jo(e,t,r,a),s=l.begin,f=l.end;/\s/.test(t.text.charAt(f-1))&&f--;for(var b=null,k=null,E=0;E<i.length;E++){var P=i[E];if(!(P.from>=f||P.to<=s)){var q=P.level!=1,J=qt(e,r,q?Math.min(f,P.to)-1:Math.max(s,P.from)).right,ee=J<o?o-J+1e9:J-o;(!b||k>ee)&&(b=P,k=ee)}}return b||(b=i[i.length-1]),b.from<s&&(b={from:s,to:b.to,level:b.level}),b.to>f&&(b={from:b.from,to:f,level:b.level}),b}var wr;function _r(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(wr==null){wr=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)wr.appendChild(document.createTextNode("x")),wr.appendChild(c("br"));wr.appendChild(document.createTextNode("x"))}G(e.measure,wr);var n=wr.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),A(e.measure),n||1}function Ur(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),n=c("pre",[t],"CodeMirror-line-like");G(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function Ei(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var l=e.display.gutterSpecs[a].className;n[l]=o.offsetLeft+o.clientLeft+i,r[l]=o.clientWidth}return{fixedPos:Wi(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function Wi(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function $o(e){var t=_r(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/Ur(e.display)-3);return function(i){if(fr(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a<i.widgets.length;a++)i.widgets[a].height&&(o+=i.widgets[a].height);return n?o+(Math.ceil(i.text.length/r)||1)*t:o+t}}function Ii(e){var t=e.doc,n=$o(e);t.iter(function(r){var i=n(r);i!=r.height&&At(r,i)})}function Sr(e,t,n,r){var i=e.display;if(!n&&on(t).getAttribute("cm-not-content")=="true")return null;var o,a,l=i.lineSpace.getBoundingClientRect();try{o=t.clientX-l.left,a=t.clientY-l.top}catch{return null}var s=Di(e,o,a),f;if(r&&s.xRel>0&&(f=ue(e.doc,s.line).text).length==s.ch){var b=Le(f,f.length,e.options.tabSize)-f.length;s=K(s.line,Math.max(0,Math.round((o-Ro(e.display).left)/Ur(e.display))-b))}return s}function Cr(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var n=e.display.view,r=0;r<n.length;r++)if(t-=n[r].size,t<0)return r}function mt(e,t,n,r){t==null&&(t=e.doc.first),n==null&&(n=e.doc.first+e.doc.size),r||(r=0);var i=e.display;if(r&&n<i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>t)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Jt&&Si(e.doc,t)<i.viewTo&&hr(e);else if(n<=i.viewFrom)Jt&&Po(e.doc,n+r)>i.viewFrom?hr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)hr(e);else if(t<=i.viewFrom){var o=Qn(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):hr(e)}else if(n>=i.viewTo){var a=Qn(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):hr(e)}else{var l=Qn(e,t,t,-1),s=Qn(e,n,n+r,1);l&&s?(i.view=i.view.slice(0,l.index).concat(Xn(e,l.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):hr(e)}var f=i.externalMeasured;f&&(n<f.lineN?f.lineN+=r:t<f.lineN+f.size&&(i.externalMeasured=null))}function cr(e,t,n){e.curOp.viewChanged=!0;var r=e.display,i=e.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size&&(r.externalMeasured=null),!(t<r.viewFrom||t>=r.viewTo)){var o=r.view[Cr(e,t)];if(o.node!=null){var a=o.changes||(o.changes=[]);he(a,n)==-1&&a.push(n)}}}function hr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Qn(e,t,n,r){var i=Cr(e,t),o,a=e.display.view;if(!Jt||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var l=e.display.viewFrom,s=0;s<i;s++)l+=a[s].size;if(l!=t){if(r>0){if(i==a.length-1)return null;o=l+a[i].size-t,i++}else o=l-t;t+=o,n+=o}for(;Si(e.doc,n)!=n;){if(i==(r<0?0:a.length-1))return null;n+=r*a[i-(r<0?1:0)].size,i+=r}return{index:i,lineN:n}}function bs(e,t,n){var r=e.display,i=r.view;i.length==0||t>=r.viewTo||n<=r.viewFrom?(r.view=Xn(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Xn(e,t,r.viewFrom).concat(r.view):r.viewFrom<t&&(r.view=r.view.slice(Cr(e,t))),r.viewFrom=t,r.viewTo<n?r.view=r.view.concat(Xn(e,r.viewTo,n)):r.viewTo>n&&(r.view=r.view.slice(0,Cr(e,n)))),r.viewTo=n}function ea(e){for(var t=e.display.view,n=0,r=0;r<t.length;r++){var i=t[r];!i.hidden&&(!i.node||i.changes)&&++n}return n}function vn(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ta(e,t){t===void 0&&(t=!0);var n=e.doc,r={},i=r.cursors=document.createDocumentFragment(),o=r.selection=document.createDocumentFragment(),a=e.options.$customCursor;a&&(t=!0);for(var l=0;l<n.sel.ranges.length;l++)if(!(!t&&l==n.sel.primIndex)){var s=n.sel.ranges[l];if(!(s.from().line>=e.display.viewTo||s.to().line<e.display.viewFrom)){var f=s.empty();if(a){var b=a(e,s);b&&Bi(e,b,i)}else(f||e.options.showCursorWhenSelecting)&&Bi(e,s.head,i);f||xs(e,s,o)}}return r}function Bi(e,t,n){var r=Ht(e,t,"div",null,null,!e.options.singleCursorHeightPerLine),i=n.appendChild(c("div"," ","CodeMirror-cursor"));if(i.style.left=r.left+"px",i.style.top=r.top+"px",i.style.height=Math.max(0,r.bottom-r.top)*e.options.cursorHeight+"px",/\bcm-fat-cursor\b/.test(e.getWrapperElement().className)){var o=Zn(e,t,"div",null,null),a=o.right-o.left;i.style.width=(a>0?a:e.defaultCharWidth())+"px"}if(r.other){var l=n.appendChild(c("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));l.style.display="",l.style.left=r.other.left+"px",l.style.top=r.other.top+"px",l.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Jn(e,t){return e.top-t.top||e.left-t.left}function xs(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=Ro(e.display),l=a.left,s=Math.max(r.sizerWidth,kr(e)-r.sizer.offsetLeft)-a.right,f=i.direction=="ltr";function b(oe,se,ve,de){se<0&&(se=0),se=Math.round(se),de=Math.round(de),o.appendChild(c("div",null,"CodeMirror-selected","position: absolute; left: "+oe+`px;
top: `+se+"px; width: "+(ve??s-oe)+`px;
height: `+(de-se)+"px"))}function k(oe,se,ve){var de=ue(i,oe),ke=de.text.length,Fe,tt;function ze(Ye,xt){return Zn(e,K(oe,Ye),"div",de,xt)}function Ct(Ye,xt,ot){var Qe=Vo(e,de,null,Ye),Ze=xt=="ltr"==(ot=="after")?"left":"right",Ue=ot=="after"?Qe.begin:Qe.end-(/\s/.test(de.text.charAt(Qe.end-1))?2:1);return ze(Ue,Ze)[Ze]}var bt=Se(de,i.direction);return ir(bt,se||0,ve??ke,function(Ye,xt,ot,Qe){var Ze=ot=="ltr",Ue=ze(Ye,Ze?"left":"right"),kt=ze(xt-1,Ze?"right":"left"),rn=se==null&&Ye==0,yr=ve==null&&xt==ke,ft=Qe==0,Xt=!bt||Qe==bt.length-1;if(kt.top-Ue.top<=3){var rt=(f?rn:yr)&&ft,fo=(f?yr:rn)&&Xt,rr=rt?l:(Ze?Ue:kt).left,Nr=fo?s:(Ze?kt:Ue).right;b(rr,Ue.top,Nr-rr,Ue.bottom)}else{var Pr,ht,nn,co;Ze?(Pr=f&&rn&&ft?l:Ue.left,ht=f?s:Ct(Ye,ot,"before"),nn=f?l:Ct(xt,ot,"after"),co=f&&yr&&Xt?s:kt.right):(Pr=f?Ct(Ye,ot,"before"):l,ht=!f&&rn&&ft?s:Ue.right,nn=!f&&yr&&Xt?l:kt.left,co=f?Ct(xt,ot,"after"):s),b(Pr,Ue.top,ht-Pr,Ue.bottom),Ue.bottom<kt.top&&b(l,Ue.bottom,null,kt.top),b(nn,kt.top,co-nn,kt.bottom)}(!Fe||Jn(Ue,Fe)<0)&&(Fe=Ue),Jn(kt,Fe)<0&&(Fe=kt),(!tt||Jn(Ue,tt)<0)&&(tt=Ue),Jn(kt,tt)<0&&(tt=kt)}),{start:Fe,end:tt}}var E=t.from(),P=t.to();if(E.line==P.line)k(E.line,E.ch,P.ch);else{var q=ue(i,E.line),J=ue(i,P.line),ee=Bt(q)==Bt(J),ie=k(E.line,E.ch,ee?q.text.length+1:null).end,le=k(P.line,ee?0:null,P.ch).start;ee&&(ie.top<le.top-2?(b(ie.right,ie.top,null,ie.bottom),b(l,le.top,le.left,le.bottom)):b(ie.right,ie.top,le.left-ie.right,ie.bottom)),ie.bottom<le.top&&b(l,ie.bottom,null,le.top)}n.appendChild(o)}function Hi(e){if(e.state.focused){var t=e.display;clearInterval(t.blinker);var n=!0;t.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?t.blinker=setInterval(function(){e.hasFocus()||Gr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function ra(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Ri(e))}function zi(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&Gr(e))},100)}function Ri(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Re(e,"focus",e,t),e.state.focused=!0,ce(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),T&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Hi(e))}function Gr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Re(e,"blur",e,t),e.state.focused=!1,U(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Vn(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,a=0;a<t.view.length;a++){var l=t.view[a],s=e.options.lineWrapping,f=void 0,b=0;if(!l.hidden){if(i+=l.line.height,D&&_<8){var k=l.node.offsetTop+l.node.offsetHeight;f=k-n,n=k}else{var E=l.node.getBoundingClientRect();f=E.bottom-E.top,!s&&l.text.firstChild&&(b=l.text.firstChild.getBoundingClientRect().right-E.left-1)}var P=l.line.height-f;if((P>.005||P<-.005)&&(i<r&&(o-=P),At(l.line,f),na(l.line),l.rest))for(var q=0;q<l.rest.length;q++)na(l.rest[q]);if(b>e.display.sizerWidth){var J=Math.ceil(b/Ur(e.display));J>e.display.maxLineLength&&(e.display.maxLineLength=J,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function na(e){if(e.widgets)for(var t=0;t<e.widgets.length;++t){var n=e.widgets[t],r=n.node.parentNode;r&&(n.height=r.offsetHeight)}}function $n(e,t,n){var r=n&&n.top!=null?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-jn(e));var i=n&&n.bottom!=null?n.bottom:r+e.wrapper.clientHeight,o=x(t,r),a=x(t,i);if(n&&n.ensure){var l=n.ensure.from.line,s=n.ensure.to.line;l<o?(o=l,a=x(t,Vt(ue(t,l))+e.wrapper.clientHeight)):Math.min(s,t.lastLine())>=a&&(o=x(t,Vt(ue(t,s))-e.wrapper.clientHeight),a=s)}return{from:o,to:Math.max(a,o+1)}}function ks(e,t){if(!Ke(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null,o=n.wrapper.ownerDocument;if(t.top+r.top<0?i=!0:t.bottom+r.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)&&(i=!1),i!=null&&!S){var a=c("div","​",null,`position: absolute;
top: `+(t.top-n.viewOffset-jn(e.display))+`px;
height: `+(t.bottom-t.top+Gt(e)+n.barHeight)+`px;
left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(a),a.scrollIntoView(i),e.display.lineSpace.removeChild(a)}}}function ws(e,t,n,r){r==null&&(r=0);var i;!e.options.lineWrapping&&t==n&&(n=t.sticky=="before"?K(t.line,t.ch+1,"before"):t,t=t.ch?K(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,l=Ht(e,t),s=!n||n==t?l:Ht(e,n);i={left:Math.min(l.left,s.left),top:Math.min(l.top,s.top)-r,right:Math.max(l.left,s.left),bottom:Math.max(l.bottom,s.bottom)+r};var f=Ki(e,i),b=e.doc.scrollTop,k=e.doc.scrollLeft;if(f.scrollTop!=null&&(mn(e,f.scrollTop),Math.abs(e.doc.scrollTop-b)>1&&(a=!0)),f.scrollLeft!=null&&(Lr(e,f.scrollLeft),Math.abs(e.doc.scrollLeft-k)>1&&(a=!0)),!a)break}return i}function Ss(e,t){var n=Ki(e,t);n.scrollTop!=null&&mn(e,n.scrollTop),n.scrollLeft!=null&&Lr(e,n.scrollLeft)}function Ki(e,t){var n=e.display,r=_r(e.display);t.top<0&&(t.top=0);var i=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:n.scroller.scrollTop,o=Oi(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var l=e.doc.height+Ai(n),s=t.top<r,f=t.bottom>l-r;if(t.top<i)a.scrollTop=s?0:t.top;else if(t.bottom>i+o){var b=Math.min(t.top,(f?l:t.bottom)-o);b!=i&&(a.scrollTop=b)}var k=e.options.fixedGutter?0:n.gutters.offsetWidth,E=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:n.scroller.scrollLeft-k,P=kr(e)-n.gutters.offsetWidth,q=t.right-t.left>P;return q&&(t.right=t.left+P),t.left<10?a.scrollLeft=0:t.left<E?a.scrollLeft=Math.max(0,t.left+k-(q?0:10)):t.right>P+E-3&&(a.scrollLeft=t.right+(q?0:10)-P),a}function _i(e,t){t!=null&&(ei(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function qr(e){ei(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function gn(e,t,n){(t!=null||n!=null)&&ei(e),t!=null&&(e.curOp.scrollLeft=t),n!=null&&(e.curOp.scrollTop=n)}function Cs(e,t){ei(e),e.curOp.scrollToPos=t}function ei(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=Qo(e,t.from),r=Qo(e,t.to);ia(e,n,r,t.margin)}}function ia(e,t,n,r){var i=Ki(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});gn(e,i.scrollLeft,i.scrollTop)}function mn(e,t){Math.abs(e.doc.scrollTop-t)<2||(z||Gi(e,{top:t}),oa(e,t,!0),z&&Gi(e),xn(e,100))}function oa(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Lr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,fa(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function yn(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Ai(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Gt(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var Tr=function(e,t,n){this.cm=n;var r=this.vert=c("div",[c("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=c("div",[c("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),pe(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),pe(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,D&&_<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Tr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},Tr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Tr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Tr.prototype.zeroWidthHack=function(){var e=p&&!O?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new be,this.disableVert=new be},Tr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="";function r(){var i=e.getBoundingClientRect(),o=n=="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.visibility="hidden":t.set(1e3,r)}t.set(1e3,r)},Tr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var bn=function(){};bn.prototype.update=function(){return{bottom:0,right:0}},bn.prototype.setScrollLeft=function(){},bn.prototype.setScrollTop=function(){},bn.prototype.clear=function(){};function Xr(e,t){t||(t=yn(e));var n=e.display.barWidth,r=e.display.barHeight;aa(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Vn(e),aa(e,yn(e)),n=e.display.barWidth,r=e.display.barHeight}function aa(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}var la={native:Tr,null:bn};function sa(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&U(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new la[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),pe(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,n){n=="horizontal"?Lr(e,t):mn(e,t)},e),e.display.scrollbars.addClass&&ce(e.display.wrapper,e.display.scrollbars.addClass)}var Ls=0;function Ar(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Ls,markArrays:null},rs(e.curOp)}function Or(e){var t=e.curOp;t&&is(t,function(n){for(var r=0;r<n.ops.length;r++)n.ops[r].cm.curOp=null;Ts(n)})}function Ts(e){for(var t=e.ops,n=0;n<t.length;n++)As(t[n]);for(var r=0;r<t.length;r++)Os(t[r]);for(var i=0;i<t.length;i++)Ns(t[i]);for(var o=0;o<t.length;o++)Ps(t[o]);for(var a=0;a<t.length;a++)Ms(t[a])}function As(e){var t=e.cm,n=t.display;Fs(t),e.updateMaxLine&&Li(t),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<n.viewFrom||e.scrollToPos.to.line>=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new ti(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Os(e){e.updatedDisplay=e.mustUpdate&&Ui(e.cm,e.update)}function Ns(e){var t=e.cm,n=t.display;e.updatedDisplay&&Vn(t),e.barMeasure=yn(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=_o(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Gt(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-kr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Ps(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<t.doc.scrollLeft&&Lr(t,Math.min(t.display.scroller.scrollLeft,e.maxScrollLeft),!0),t.display.maxLineChanged=!1);var n=e.focus&&e.focus==fe(Ge(t));e.preparedSelection&&t.display.input.showSelection(e.preparedSelection,n),(e.updatedDisplay||e.startHeight!=t.doc.height)&&Xr(t,e.barMeasure),e.updatedDisplay&&Xi(t,e.barMeasure),e.selectionChanged&&Hi(t),t.state.focused&&e.updateInput&&t.display.input.reset(e.typing),n&&ra(e.cm)}function Ms(e){var t=e.cm,n=t.display,r=t.doc;if(e.updatedDisplay&&ua(t,e.update),n.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(n.wheelStartX=n.wheelStartY=null),e.scrollTop!=null&&oa(t,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Lr(t,e.scrollLeft,!0,!0),e.scrollToPos){var i=ws(t,ye(r,e.scrollToPos.from),ye(r,e.scrollToPos.to),e.scrollToPos.margin);ks(t,i)}var o=e.maybeHiddenMarkers,a=e.maybeUnhiddenMarkers;if(o)for(var l=0;l<o.length;++l)o[l].lines.length||Re(o[l],"hide");if(a)for(var s=0;s<a.length;++s)a[s].lines.length&&Re(a[s],"unhide");n.wrapper.offsetHeight&&(r.scrollTop=t.display.scroller.scrollTop),e.changeObjs&&Re(t,"changes",t,e.changeObjs),e.update&&e.update.finish()}function St(e,t){if(e.curOp)return t();Ar(e);try{return t()}finally{Or(e)}}function $e(e,t){return function(){if(e.curOp)return t.apply(e,arguments);Ar(e);try{return t.apply(e,arguments)}finally{Or(e)}}}function ct(e){return function(){if(this.curOp)return e.apply(this,arguments);Ar(this);try{return e.apply(this,arguments)}finally{Or(this)}}}function et(e){return function(){var t=this.cm;if(!t||t.curOp)return e.apply(this,arguments);Ar(t);try{return e.apply(this,arguments)}finally{Or(t)}}}function xn(e,t){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(t,ge(Ds,e))}function Ds(e){var t=e.doc;if(!(t.highlightFrontier>=e.display.viewTo)){var n=+new Date+e.options.workTime,r=un(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(r.line>=e.display.viewFrom){var a=o.styles,l=o.text.length>e.options.maxHighlightLength?_t(t.mode,r.state):null,s=go(e,o,r,!0);l&&(r.state=l),o.styles=s.styles;var f=o.styleClasses,b=s.classes;b?o.styleClasses=b:f&&(o.styleClasses=null);for(var k=!a||a.length!=o.styles.length||f!=b&&(!f||!b||f.bgClass!=b.bgClass||f.textClass!=b.textClass),E=0;!k&&E<a.length;++E)k=a[E]!=o.styles[E];k&&i.push(r.line),o.stateAfter=r.save(),r.nextLine()}else o.text.length<=e.options.maxHighlightLength&&bi(e,o.text,r),o.stateAfter=r.line%5==0?r.save():null,r.nextLine();if(+new Date>n)return xn(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&St(e,function(){for(var o=0;o<i.length;o++)cr(e,i[o],"text")})}}var ti=function(e,t,n){var r=e.display;this.viewport=t,this.visible=$n(r,e.doc,t),this.editorIsHidden=!r.wrapper.offsetWidth,this.wrapperHeight=r.wrapper.clientHeight,this.wrapperWidth=r.wrapper.clientWidth,this.oldDisplayWidth=kr(e),this.force=n,this.dims=Ei(e),this.events=[]};ti.prototype.signal=function(e,t){wt(e,t)&&this.events.push(arguments)},ti.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Re.apply(null,this.events[e])};function Fs(e){var t=e.display;!t.scrollbarsClipped&&t.scroller.offsetWidth&&(t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth,t.heightForcer.style.height=Gt(e)+"px",t.sizer.style.marginBottom=-t.nativeBarWidth+"px",t.sizer.style.borderRightWidth=Gt(e)+"px",t.scrollbarsClipped=!0)}function Es(e){if(e.hasFocus())return null;var t=fe(Ge(e));if(!t||!ne(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=me(e).getSelection();r.anchorNode&&r.extend&&ne(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}function Ws(e){if(!(!e||!e.activeElt||e.activeElt==fe(Ee(e.activeElt)))&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&ne(document.body,e.anchorNode)&&ne(document.body,e.focusNode))){var t=e.activeElt.ownerDocument,n=t.defaultView.getSelection(),r=t.createRange();r.setEnd(e.anchorNode,e.anchorOffset),r.collapse(!1),n.removeAllRanges(),n.addRange(r),n.extend(e.focusNode,e.focusOffset)}}function Ui(e,t){var n=e.display,r=e.doc;if(t.editorIsHidden)return hr(e),!1;if(!t.force&&t.visible.from>=n.viewFrom&&t.visible.to<=n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&ea(e)==0)return!1;ca(e)&&(hr(e),t.dims=Ei(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>a&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Jt&&(o=Si(e.doc,o),a=Po(e.doc,a));var l=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;bs(e,o,a),n.viewOffset=Vt(ue(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var s=ea(e);if(!l&&s==0&&!t.force&&n.renderedView==n.view&&(n.updateLineNumbers==null||n.updateLineNumbers>=n.viewTo))return!1;var f=Es(e);return s>4&&(n.lineDiv.style.display="none"),Is(e,n.updateLineNumbers,t.dims),s>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,Ws(f),A(n.cursorDiv),A(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,l&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,xn(e,400)),n.updateLineNumbers=null,!0}function ua(e,t){for(var n=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==kr(e)){if(n&&n.top!=null&&(n={top:Math.min(e.doc.height+Ai(e.display)-Oi(e),n.top)}),t.visible=$n(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=$n(e.display,e.doc,n));if(!Ui(e,t))break;Vn(e);var i=yn(e);vn(e),Xr(e,i),Xi(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 Gi(e,t){var n=new ti(e,t);if(Ui(e,n)){Vn(e),ua(e,n);var r=yn(e);vn(e),Xr(e,r),Xi(e,r),n.finish()}}function Is(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function l(q){var J=q.nextSibling;return T&&p&&e.display.currentWheelTarget==q?q.style.display="none":q.parentNode.removeChild(q),J}for(var s=r.view,f=r.viewFrom,b=0;b<s.length;b++){var k=s[b];if(!k.hidden)if(!k.node||k.node.parentNode!=o){var E=us(e,k,f,n);o.insertBefore(E,a)}else{for(;a!=k.node;)a=l(a);var P=i&&t!=null&&t<=f&&k.lineNumber;k.changes&&(he(k.changes,"gutter")>-1&&(P=!1),Wo(e,k,f,n)),P&&(A(k.lineNumber),k.lineNumber.appendChild(document.createTextNode($(e.options,f)))),a=k.node.nextSibling}f+=k.size}for(;a;)a=l(a)}function qi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Ve(e,"gutterChanged",e)}function Xi(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+Gt(e)+"px"}function fa(e){var t=e.display,n=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=Wi(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a<n.length;a++)if(!n[a].hidden){e.options.fixedGutter&&(n[a].gutter&&(n[a].gutter.style.left=o),n[a].gutterBackground&&(n[a].gutterBackground.style.left=o));var l=n[a].alignable;if(l)for(var s=0;s<l.length;s++)l[s].style.left=o}e.options.fixedGutter&&(t.gutters.style.left=r+i+"px")}}function ca(e){if(!e.options.lineNumbers)return!1;var t=e.doc,n=$(e.options,t.first+t.size-1),r=e.display;if(n.length!=r.lineNumChars){var i=r.measure.appendChild(c("div",[c("div",n)],"CodeMirror-linenumber CodeMirror-gutter-elt")),o=i.firstChild.offsetWidth,a=i.offsetWidth-o;return r.lineGutter.style.width="",r.lineNumInnerWidth=Math.max(o,r.lineGutter.offsetWidth-a)+1,r.lineNumWidth=r.lineNumInnerWidth+a,r.lineNumChars=r.lineNumInnerWidth?n.length:-1,r.lineGutter.style.width=r.lineNumWidth+"px",qi(e.display),!0}return!1}function ji(e,t){for(var n=[],r=!1,i=0;i<e.length;i++){var o=e[i],a=null;if(typeof o!="string"&&(a=o.style,o=o.className),o=="CodeMirror-linenumbers")if(t)r=!0;else continue;n.push({className:o,style:a})}return t&&!r&&n.push({className:"CodeMirror-linenumbers",style:null}),n}function ha(e){var t=e.gutters,n=e.gutterSpecs;A(t),e.lineGutter=null;for(var r=0;r<n.length;++r){var i=n[r],o=i.className,a=i.style,l=t.appendChild(c("div",null,"CodeMirror-gutter "+o));a&&(l.style.cssText=a),o=="CodeMirror-linenumbers"&&(e.lineGutter=l,l.style.width=(e.lineNumWidth||1)+"px")}t.style.display=n.length?"":"none",qi(e)}function kn(e){ha(e.display),mt(e),fa(e)}function Bs(e,t,n,r){var i=this;this.input=n,i.scrollbarFiller=c("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=c("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=Q("div",null,"CodeMirror-code"),i.selectionDiv=c("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=c("div",null,"CodeMirror-cursors"),i.measure=c("div",null,"CodeMirror-measure"),i.lineMeasure=c("div",null,"CodeMirror-measure"),i.lineSpace=Q("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=Q("div",[i.lineSpace],"CodeMirror-lines");i.mover=c("div",[o],null,"position: relative"),i.sizer=c("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=c("div",null,null,"position: absolute; height: "+it+"px; width: 1px;"),i.gutters=c("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=c("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=c("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),C&&M>=105&&(i.wrapper.style.clipPath="inset(0px)"),i.wrapper.setAttribute("translate","no"),D&&_<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),!T&&!(z&&u)&&(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=ji(r.gutters,r.lineNumbers),ha(i),n.init(i)}var ri=0,er=null;D?er=-.53:z?er=15:C?er=-.7:Z&&(er=-1/3);function da(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return t==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),n==null&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:n==null&&(n=e.wheelDelta),{x:t,y:n}}function Hs(e){var t=da(e);return t.x*=er,t.y*=er,t}function pa(e,t){C&&M==102&&(e.display.chromeScrollHack==null?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout(function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""},100));var n=da(t),r=n.x,i=n.y,o=er;t.deltaMode===0&&(r=t.deltaX,i=t.deltaY,o=1);var a=e.display,l=a.scroller,s=l.scrollWidth>l.clientWidth,f=l.scrollHeight>l.clientHeight;if(r&&s||i&&f){if(i&&p&&T){e:for(var b=t.target,k=a.view;b!=l;b=b.parentNode)for(var E=0;E<k.length;E++)if(k[E].node==b){e.display.currentWheelTarget=b;break e}}if(r&&!z&&!W&&o!=null){i&&f&&mn(e,Math.max(0,l.scrollTop+i*o)),Lr(e,Math.max(0,l.scrollLeft+r*o)),(!i||i&&f)&&st(t),a.wheelStartX=null;return}if(i&&o!=null){var P=i*o,q=e.doc.scrollTop,J=q+a.wrapper.clientHeight;P<0?q=Math.max(0,q+P-50):J=Math.min(e.doc.height,J+P+50),Gi(e,{top:q,bottom:J})}ri<20&&t.deltaMode!==0&&(a.wheelStartX==null?(a.wheelStartX=l.scrollLeft,a.wheelStartY=l.scrollTop,a.wheelDX=r,a.wheelDY=i,setTimeout(function(){if(a.wheelStartX!=null){var ee=l.scrollLeft-a.wheelStartX,ie=l.scrollTop-a.wheelStartY,le=ie&&a.wheelDY&&ie/a.wheelDY||ee&&a.wheelDX&&ee/a.wheelDX;a.wheelStartX=a.wheelStartY=null,le&&(er=(er*ri+le)/(ri+1),++ri)}},200)):(a.wheelDX+=r,a.wheelDY+=i))}}var Ot=function(e,t){this.ranges=e,this.primIndex=t};Ot.prototype.primary=function(){return this.ranges[this.primIndex]},Ot.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t<this.ranges.length;t++){var n=this.ranges[t],r=e.ranges[t];if(!Oe(n.anchor,r.anchor)||!Oe(n.head,r.head))return!1}return!0},Ot.prototype.deepCopy=function(){for(var e=[],t=0;t<this.ranges.length;t++)e[t]=new Ne(Je(this.ranges[t].anchor),Je(this.ranges[t].head));return new Ot(e,this.primIndex)},Ot.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},Ot.prototype.contains=function(e,t){t||(t=e);for(var n=0;n<this.ranges.length;n++){var r=this.ranges[n];if(ae(t,r.from())>=0&&ae(e,r.to())<=0)return n}return-1};var Ne=function(e,t){this.anchor=e,this.head=t};Ne.prototype.from=function(){return Hr(this.anchor,this.head)},Ne.prototype.to=function(){return gt(this.anchor,this.head)},Ne.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function zt(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort(function(E,P){return ae(E.from(),P.from())}),n=he(t,i);for(var o=1;o<t.length;o++){var a=t[o],l=t[o-1],s=ae(l.to(),a.from());if(r&&!a.empty()?s>0:s>=0){var f=Hr(l.from(),a.from()),b=gt(l.to(),a.to()),k=l.empty()?a.from()==a.head:l.from()==l.head;o<=n&&--n,t.splice(--o,2,new Ne(k?b:f,k?f:b))}}return new Ot(t,n)}function dr(e,t){return new Ot([new Ne(e,t||e)],0)}function pr(e){return e.text?K(e.from.line+e.text.length-1,Ce(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function va(e,t){if(ae(e,t.from)<0)return e;if(ae(e,t.to)<=0)return pr(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=pr(t).ch-t.to.ch),K(n,r)}function Yi(e,t){for(var n=[],r=0;r<e.sel.ranges.length;r++){var i=e.sel.ranges[r];n.push(new Ne(va(i.anchor,t),va(i.head,t)))}return zt(e.cm,n,e.sel.primIndex)}function ga(e,t,n){return e.line==t.line?K(n.line,e.ch-t.ch+n.ch):K(n.line+(e.line-t.line),e.ch)}function zs(e,t,n){for(var r=[],i=K(e.first,0),o=i,a=0;a<t.length;a++){var l=t[a],s=ga(l.from,i,o),f=ga(pr(l),i,o);if(i=l.to,o=f,n=="around"){var b=e.sel.ranges[a],k=ae(b.head,b.anchor)<0;r[a]=new Ne(k?f:s,k?s:f)}else r[a]=new Ne(s,s)}return new Ot(r,e.sel.primIndex)}function Zi(e){e.doc.mode=Wr(e.options,e.doc.modeOption),wn(e)}function wn(e){e.doc.iter(function(t){t.stateAfter&&(t.stateAfter=null),t.styles&&(t.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,xn(e,100),e.state.modeGen++,e.curOp&&mt(e)}function ma(e,t){return t.from.ch==0&&t.to.ch==0&&Ce(t.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Qi(e,t,n,r){function i(le){return n?n[le]:null}function o(le,oe,se){jl(le,oe,se,r),Ve(le,"change",le,t)}function a(le,oe){for(var se=[],ve=le;ve<oe;++ve)se.push(new zr(f[ve],i(ve),r));return se}var l=t.from,s=t.to,f=t.text,b=ue(e,l.line),k=ue(e,s.line),E=Ce(f),P=i(f.length-1),q=s.line-l.line;if(t.full)e.insert(0,a(0,f.length)),e.remove(f.length,e.size-f.length);else if(ma(e,t)){var J=a(0,f.length-1);o(k,k.text,P),q&&e.remove(l.line,q),J.length&&e.insert(l.line,J)}else if(b==k)if(f.length==1)o(b,b.text.slice(0,l.ch)+E+b.text.slice(s.ch),P);else{var ee=a(1,f.length-1);ee.push(new zr(E+b.text.slice(s.ch),P,r)),o(b,b.text.slice(0,l.ch)+f[0],i(0)),e.insert(l.line+1,ee)}else if(f.length==1)o(b,b.text.slice(0,l.ch)+f[0]+k.text.slice(s.ch),i(0)),e.remove(l.line+1,q);else{o(b,b.text.slice(0,l.ch)+f[0],i(0)),o(k,E+k.text.slice(s.ch),P);var ie=a(1,f.length-1);q>1&&e.remove(l.line+1,q-1),e.insert(l.line+1,ie)}Ve(e,"change",e,t)}function vr(e,t,n){function r(i,o,a){if(i.linked)for(var l=0;l<i.linked.length;++l){var s=i.linked[l];if(s.doc!=o){var f=a&&s.sharedHist;n&&!f||(t(s.doc,f),r(s.doc,i,f))}}}r(e,null,!0)}function ya(e,t){if(t.cm)throw new Error("This document is already in use.");e.doc=t,t.cm=e,Ii(e),Zi(e),ba(e),e.options.direction=t.direction,e.options.lineWrapping||Li(e),e.options.mode=t.modeOption,mt(e)}function ba(e){(e.doc.direction=="rtl"?ce:U)(e.display.lineDiv,"CodeMirror-rtl")}function Rs(e){St(e,function(){ba(e),mt(e)})}function ni(e){this.done=[],this.undone=[],this.undoDepth=e?e.undoDepth:1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=e?e.maxGeneration:1}function Ji(e,t){var n={from:Je(t.from),to:pr(t),text:Qt(e,t.from,t.to)};return wa(e,n,t.from.line,t.to.line+1),vr(e,function(r){return wa(r,n,t.from.line,t.to.line+1)},!0),n}function xa(e){for(;e.length;){var t=Ce(e);if(t.ranges)e.pop();else break}}function Ks(e,t){if(t)return xa(e.done),Ce(e.done);if(e.done.length&&!Ce(e.done).ranges)return Ce(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ce(e.done)}function ka(e,t,n,r){var i=e.history;i.undone.length=0;var o=+new Date,a,l;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&i.lastModTime>o-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(a=Ks(i,i.lastOp==r)))l=Ce(a.changes),ae(t.from,t.to)==0&&ae(t.from,l.to)==0?l.to=pr(t):a.changes.push(Ji(e,t));else{var s=Ce(i.done);for((!s||!s.ranges)&&ii(e.sel,i.done),a={changes:[Ji(e,t)],generation:i.generation},i.done.push(a);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=o,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,l||Re(e,"historyAdded")}function _s(e,t,n,r){var i=t.charAt(0);return i=="*"||i=="+"&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function Us(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||_s(e,o,Ce(i.done),t))?i.done[i.done.length-1]=t:ii(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&xa(i.undone)}function ii(e,t){var n=Ce(t);n&&n.ranges&&n.equals(e)||t.push(e)}function wa(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(a){a.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=a.markedSpans),++o})}function Gs(e){if(!e)return null;for(var t,n=0;n<e.length;++n)e[n].marker.explicitlyCleared?t||(t=e.slice(0,n)):t&&t.push(e[n]);return t?t.length?t:null:e}function qs(e,t){var n=t["spans_"+e.id];if(!n)return null;for(var r=[],i=0;i<t.text.length;++i)r.push(Gs(n[i]));return r}function Sa(e,t){var n=qs(e,t),r=ki(e,t);if(!n)return r;if(!r)return n;for(var i=0;i<n.length;++i){var o=n[i],a=r[i];if(o&&a)e:for(var l=0;l<a.length;++l){for(var s=a[l],f=0;f<o.length;++f)if(o[f].marker==s.marker)continue e;o.push(s)}else a&&(n[i]=a)}return n}function jr(e,t,n){for(var r=[],i=0;i<e.length;++i){var o=e[i];if(o.ranges){r.push(n?Ot.prototype.deepCopy.call(o):o);continue}var a=o.changes,l=[];r.push({changes:l});for(var s=0;s<a.length;++s){var f=a[s],b=void 0;if(l.push({from:f.from,to:f.to,text:f.text}),t)for(var k in f)(b=k.match(/^spans_(\d+)$/))&&he(t,Number(b[1]))>-1&&(Ce(l)[k]=f[k],delete f[k])}}return r}function Vi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=ae(t,i)<0;o!=ae(n,i)<0?(i=t,t=n):o!=ae(t,n)<0&&(t=n)}return new Ne(i,t)}else return new Ne(n||t,t)}function oi(e,t,n,r,i){i==null&&(i=e.cm&&(e.cm.display.shift||e.extend)),ut(e,new Ot([Vi(e.sel.primary(),t,n,i)],0),r)}function Ca(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o<e.sel.ranges.length;o++)r[o]=Vi(e.sel.ranges[o],t[o],null,i);var a=zt(e.cm,r,e.sel.primIndex);ut(e,a,n)}function $i(e,t,n,r){var i=e.sel.ranges.slice(0);i[t]=n,ut(e,zt(e.cm,i,e.sel.primIndex),r)}function La(e,t,n,r){ut(e,dr(t,n),r)}function Xs(e,t,n){var r={ranges:t.ranges,update:function(i){this.ranges=[];for(var o=0;o<i.length;o++)this.ranges[o]=new Ne(ye(e,i[o].anchor),ye(e,i[o].head))},origin:n&&n.origin};return Re(e,"beforeSelectionChange",e,r),e.cm&&Re(e.cm,"beforeSelectionChange",e.cm,r),r.ranges!=t.ranges?zt(e.cm,r.ranges,r.ranges.length-1):t}function Ta(e,t,n){var r=e.history.done,i=Ce(r);i&&i.ranges?(r[r.length-1]=t,ai(e,t,n)):ut(e,t,n)}function ut(e,t,n){ai(e,t,n),Us(e,e.sel,e.cm?e.cm.curOp.id:NaN,n)}function ai(e,t,n){(wt(e,"beforeSelectionChange")||e.cm&&wt(e.cm,"beforeSelectionChange"))&&(t=Xs(e,t,n));var r=n&&n.bias||(ae(t.primary().head,e.sel.primary().head)<0?-1:1);Aa(e,Na(e,t,r,!0)),!(n&&n.scroll===!1)&&e.cm&&e.cm.getOption("readOnly")!="nocursor"&&qr(e.cm)}function Aa(e,t){t.equals(e.sel)||(e.sel=t,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Nt(e.cm)),Ve(e,"cursorActivity",e))}function Oa(e){Aa(e,Na(e,e.sel,null,!1))}function Na(e,t,n,r){for(var i,o=0;o<t.ranges.length;o++){var a=t.ranges[o],l=t.ranges.length==e.sel.ranges.length&&e.sel.ranges[o],s=li(e,a.anchor,l&&l.anchor,n,r),f=a.head==a.anchor?s:li(e,a.head,l&&l.head,n,r);(i||s!=a.anchor||f!=a.head)&&(i||(i=t.ranges.slice(0,o)),i[o]=new Ne(s,f))}return i?zt(e.cm,i,t.primIndex):t}function Yr(e,t,n,r,i){var o=ue(e,t.line);if(o.markedSpans)for(var a=0;a<o.markedSpans.length;++a){var l=o.markedSpans[a],s=l.marker,f="selectLeft"in s?!s.selectLeft:s.inclusiveLeft,b="selectRight"in s?!s.selectRight:s.inclusiveRight;if((l.from==null||(f?l.from<=t.ch:l.from<t.ch))&&(l.to==null||(b?l.to>=t.ch:l.to>t.ch))){if(i&&(Re(s,"beforeCursorEnter"),s.explicitlyCleared))if(o.markedSpans){--a;continue}else break;if(!s.atomic)continue;if(n){var k=s.find(r<0?1:-1),E=void 0;if((r<0?b:f)&&(k=Pa(e,k,-r,k&&k.line==t.line?o:null)),k&&k.line==t.line&&(E=ae(k,n))&&(r<0?E<0:E>0))return Yr(e,k,t,r,i)}var P=s.find(r<0?-1:1);return(r<0?f:b)&&(P=Pa(e,P,r,P.line==t.line?o:null)),P?Yr(e,P,t,r,i):null}}return t}function li(e,t,n,r,i){var o=r||1,a=Yr(e,t,n,o,i)||!i&&Yr(e,t,n,o,!0)||Yr(e,t,n,-o,i)||!i&&Yr(e,t,n,-o,!0);return a||(e.cantEdit=!0,K(e.first,0))}function Pa(e,t,n,r){return n<0&&t.ch==0?t.line>e.first?ye(e,K(t.line-1)):null:n>0&&t.ch==(r||ue(e,t.line)).text.length?t.line<e.first+e.size-1?K(t.line+1,0):null:new K(t.line,t.ch+n)}function Ma(e){e.setSelection(K(e.firstLine(),0),K(e.lastLine()),dt)}function Da(e,t,n){var r={canceled:!1,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return r.canceled=!0}};return n&&(r.update=function(i,o,a,l){i&&(r.from=ye(e,i)),o&&(r.to=ye(e,o)),a&&(r.text=a),l!==void 0&&(r.origin=l)}),Re(e,"beforeChange",e,r),e.cm&&Re(e.cm,"beforeChange",e.cm,r),r.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:r.from,to:r.to,text:r.text,origin:r.origin}}function Zr(e,t,n){if(e.cm){if(!e.cm.curOp)return $e(e.cm,Zr)(e,t,n);if(e.cm.state.suppressEdits)return}if(!((wt(e,"beforeChange")||e.cm&&wt(e.cm,"beforeChange"))&&(t=Da(e,t,!0),!t))){var r=So&&!n&&Ul(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)Fa(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else Fa(e,t)}}function Fa(e,t){if(!(t.text.length==1&&t.text[0]==""&&ae(t.from,t.to)==0)){var n=Yi(e,t);ka(e,t,n,e.cm?e.cm.curOp.id:NaN),Sn(e,t,n,ki(e,t));var r=[];vr(e,function(i,o){!o&&he(r,i.history)==-1&&(Ba(i.history,t),r.push(i.history)),Sn(i,t,null,ki(i,t))})}}function si(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!n)){for(var i=e.history,o,a=e.sel,l=t=="undo"?i.done:i.undone,s=t=="undo"?i.undone:i.done,f=0;f<l.length&&(o=l[f],!(n?o.ranges&&!o.equals(e.sel):!o.ranges));f++);if(f!=l.length){for(i.lastOrigin=i.lastSelOrigin=null;;)if(o=l.pop(),o.ranges){if(ii(o,s),n&&!o.equals(e.sel)){ut(e,o,{clearRedo:!1});return}a=o}else if(r){l.push(o);return}else break;var b=[];ii(a,s),s.push({changes:b,generation:i.generation}),i.generation=o.generation||++i.maxGeneration;for(var k=wt(e,"beforeChange")||e.cm&&wt(e.cm,"beforeChange"),E=function(J){var ee=o.changes[J];if(ee.origin=t,k&&!Da(e,ee,!1))return l.length=0,{};b.push(Ji(e,ee));var ie=J?Yi(e,ee):Ce(l);Sn(e,ee,ie,Sa(e,ee)),!J&&e.cm&&e.cm.scrollIntoView({from:ee.from,to:pr(ee)});var le=[];vr(e,function(oe,se){!se&&he(le,oe.history)==-1&&(Ba(oe.history,ee),le.push(oe.history)),Sn(oe,ee,null,Sa(oe,ee))})},P=o.changes.length-1;P>=0;--P){var q=E(P);if(q)return q.v}}}}function Ea(e,t){if(t!=0&&(e.first+=t,e.sel=new Ot(De(e.sel.ranges,function(i){return new Ne(K(i.anchor.line+t,i.anchor.ch),K(i.head.line+t,i.head.ch))}),e.sel.primIndex),e.cm)){mt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;r<n.viewTo;r++)cr(e.cm,r,"gutter")}}function Sn(e,t,n,r){if(e.cm&&!e.cm.curOp)return $e(e.cm,Sn)(e,t,n,r);if(t.to.line<e.first){Ea(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);Ea(e,i),t={from:K(e.first,0),to:K(t.to.line+i,t.to.ch),text:[Ce(t.text)],origin:t.origin}}var o=e.lastLine();t.to.line>o&&(t={from:t.from,to:K(o,ue(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=Qt(e,t.from,t.to),n||(n=Yi(e,t)),e.cm?js(e.cm,t,r):Qi(e,t,r),ai(e,n,dt),e.cantEdit&&li(e,K(e.firstLine(),0))&&(e.cantEdit=!1)}}function js(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,l=!1,s=o.line;e.options.lineWrapping||(s=h(Bt(ue(r,o.line))),r.iter(s,a.line+1,function(P){if(P==i.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Nt(e),Qi(r,t,n,$o(e)),e.options.lineWrapping||(r.iter(s,o.line+t.text.length,function(P){var q=qn(P);q>i.maxLineLength&&(i.maxLine=P,i.maxLineLength=q,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),Il(r,o.line),xn(e,400);var f=t.text.length-(a.line-o.line)-1;t.full?mt(e):o.line==a.line&&t.text.length==1&&!ma(e.doc,t)?cr(e,o.line,"text"):mt(e,o.line,a.line+1,f);var b=wt(e,"changes"),k=wt(e,"change");if(k||b){var E={from:o,to:a,text:t.text,removed:t.removed,origin:t.origin};k&&Ve(e,"change",e,E),b&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(E)}e.display.selForContextMenu=null}function Qr(e,t,n,r,i){var o;r||(r=n),ae(r,n)<0&&(o=[r,n],n=o[0],r=o[1]),typeof t=="string"&&(t=e.splitLines(t)),Zr(e,{from:n,to:r,text:t,origin:i})}function Wa(e,t,n,r){n<e.line?e.line+=r:t<e.line&&(e.line=t,e.ch=0)}function Ia(e,t,n,r){for(var i=0;i<e.length;++i){var o=e[i],a=!0;if(o.ranges){o.copied||(o=e[i]=o.deepCopy(),o.copied=!0);for(var l=0;l<o.ranges.length;l++)Wa(o.ranges[l].anchor,t,n,r),Wa(o.ranges[l].head,t,n,r);continue}for(var s=0;s<o.changes.length;++s){var f=o.changes[s];if(n<f.from.line)f.from=K(f.from.line+r,f.from.ch),f.to=K(f.to.line+r,f.to.ch);else if(t<=f.to.line){a=!1;break}}a||(e.splice(0,i+1),i=0)}}function Ba(e,t){var n=t.from.line,r=t.to.line,i=t.text.length-(r-n)-1;Ia(e.done,n,r,i),Ia(e.undone,n,r,i)}function Cn(e,t,n,r){var i=t,o=t;return typeof t=="number"?o=ue(e,po(e,t)):i=h(t),i==null?null:(r(o,i)&&e.cm&&cr(e.cm,i,n),o)}function Ln(e){this.lines=e,this.parent=null;for(var t=0,n=0;n<e.length;++n)e[n].parent=this,t+=e[n].height;this.height=t}Ln.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,t){for(var n=e,r=e+t;n<r;++n){var i=this.lines[n];this.height-=i.height,Yl(i),Ve(i,"delete")}this.lines.splice(e,t)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,t,n){this.height+=n,this.lines=this.lines.slice(0,e).concat(t).concat(this.lines.slice(e));for(var r=0;r<t.length;++r)t[r].parent=this},iterN:function(e,t,n){for(var r=e+t;e<r;++e)if(n(this.lines[e]))return!0}};function Tn(e){this.children=e;for(var t=0,n=0,r=0;r<e.length;++r){var i=e[r];t+=i.chunkSize(),n+=i.height,i.parent=this}this.size=t,this.height=n,this.parent=null}Tn.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;n<this.children.length;++n){var r=this.children[n],i=r.chunkSize();if(e<i){var o=Math.min(t,i-e),a=r.height;if(r.removeInner(e,o),this.height-=a-r.height,i==o&&(this.children.splice(n--,1),r.parent=null),(t-=o)==0)break;e=0}else e-=i}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Ln))){var l=[];this.collapse(l),this.children=[new Ln(l)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t<this.children.length;++t)this.children[t].collapse(e)},insertInner:function(e,t,n){this.size+=t.length,this.height+=n;for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<=o){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(var a=i.lines.length%25+25,l=a;l<i.lines.length;){var s=new Ln(i.lines.slice(l,l+=25));i.height-=s.height,this.children.splice(++r,0,s),s.parent=this}i.lines=i.lines.slice(0,a),this.maybeSpill()}break}e-=o}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Tn(t);if(e.parent){e.size-=n.size,e.height-=n.height;var i=he(e.parent.children,e);e.parent.children.splice(i+1,0,n)}else{var r=new Tn(e.children);r.parent=e,e.children=[r,n],e=r}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r<this.children.length;++r){var i=this.children[r],o=i.chunkSize();if(e<o){var a=Math.min(t,o-e);if(i.iterN(e,a,n))return!0;if((t-=a)==0)break;e=0}else e-=o}}};var An=function(e,t,n){if(n)for(var r in n)n.hasOwnProperty(r)&&(this[r]=n[r]);this.doc=e,this.node=t};An.prototype.clear=function(){var e=this.doc.cm,t=this.line.widgets,n=this.line,r=h(n);if(!(r==null||!t)){for(var i=0;i<t.length;++i)t[i]==this&&t.splice(i--,1);t.length||(n.widgets=null);var o=dn(this);At(n,Math.max(0,n.height-o)),e&&(St(e,function(){Ha(e,n,-o),cr(e,r,"widget")}),Ve(e,"lineWidgetCleared",e,this,r))}},An.prototype.changed=function(){var e=this,t=this.height,n=this.doc.cm,r=this.line;this.height=null;var i=dn(this)-t;i&&(fr(this.doc,r)||At(r,r.height+i),n&&St(n,function(){n.curOp.forceUpdate=!0,Ha(n,r,i),Ve(n,"lineWidgetChanged",n,e,h(r))}))},Dt(An);function Ha(e,t,n){Vt(t)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&_i(e,n)}function Ys(e,t,n,r){var i=new An(e,n,r),o=e.cm;return o&&i.noHScroll&&(o.display.alignWidgets=!0),Cn(e,t,"widget",function(a){var l=a.widgets||(a.widgets=[]);if(i.insertAt==null?l.push(i):l.splice(Math.min(l.length,Math.max(0,i.insertAt)),0,i),i.line=a,o&&!fr(e,a)){var s=Vt(a)<e.scrollTop;At(a,a.height+dn(i)),s&&_i(o,i.height),o.curOp.forceUpdate=!0}return!0}),o&&Ve(o,"lineWidgetAdded",o,i,typeof t=="number"?t:h(t)),i}var za=0,gr=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++za};gr.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Ar(e),wt(this,"clear")){var n=this.find();n&&Ve(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;o<this.lines.length;++o){var a=this.lines[o],l=fn(a.markedSpans,this);e&&!this.collapsed?cr(e,h(a),"text"):e&&(l.to!=null&&(i=h(a)),l.from!=null&&(r=h(a))),a.markedSpans=zl(a.markedSpans,l),l.from==null&&this.collapsed&&!fr(this.doc,a)&&e&&At(a,_r(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var s=0;s<this.lines.length;++s){var f=Bt(this.lines[s]),b=qn(f);b>e.display.maxLineLength&&(e.display.maxLine=f,e.display.maxLineLength=b,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&mt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Oa(e.doc)),e&&Ve(e,"markerCleared",e,this,r,i),t&&Or(e),this.parent&&this.parent.clear()}},gr.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var n,r,i=0;i<this.lines.length;++i){var o=this.lines[i],a=fn(o.markedSpans,this);if(a.from!=null&&(n=K(t?o:h(o),a.from),e==-1))return n;if(a.to!=null&&(r=K(t?o:h(o),a.to),e==1))return r}return n&&{from:n,to:r}},gr.prototype.changed=function(){var e=this,t=this.find(-1,!0),n=this,r=this.doc.cm;!t||!r||St(r,function(){var i=t.line,o=h(t.line),a=Ni(r,o);if(a&&(qo(a),r.curOp.selectionChanged=r.curOp.forceUpdate=!0),r.curOp.updateMaxLine=!0,!fr(n.doc,i)&&n.height!=null){var l=n.height;n.height=null;var s=dn(n)-l;s&&At(i,i.height+s)}Ve(r,"markerChanged",r,e)})},gr.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(!t.maybeHiddenMarkers||he(t.maybeHiddenMarkers,this)==-1)&&(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},gr.prototype.detachLine=function(e){if(this.lines.splice(he(this.lines,e),1),!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}},Dt(gr);function Jr(e,t,n,r,i){if(r&&r.shared)return Zs(e,t,n,r,i);if(e.cm&&!e.cm.curOp)return $e(e.cm,Jr)(e,t,n,r,i);var o=new gr(e,i),a=ae(t,n);if(r&&xe(r,o,!1),a>0||a==0&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Q("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(No(e,t.line,t,n,o)||t.line!=n.line&&No(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Hl()}o.addToHistory&&ka(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var l=t.line,s=e.cm,f;if(e.iter(l,n.line+1,function(k){s&&o.collapsed&&!s.options.lineWrapping&&Bt(k)==s.display.maxLine&&(f=!0),o.collapsed&&l!=t.line&&At(k,0),Rl(k,new Kn(o,l==t.line?t.ch:null,l==n.line?n.ch:null),e.cm&&e.cm.curOp),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(k){fr(e,k)&&At(k,0)}),o.clearOnEnter&&pe(o,"beforeCursorEnter",function(){return o.clear()}),o.readOnly&&(Bl(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++za,o.atomic=!0),s){if(f&&(s.curOp.updateMaxLine=!0),o.collapsed)mt(s,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var b=t.line;b<=n.line;b++)cr(s,b,"text");o.atomic&&Oa(s.doc),Ve(s,"markerAdded",s,o)}return o}var On=function(e,t){this.markers=e,this.primary=t;for(var n=0;n<e.length;++n)e[n].parent=this};On.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ve(this,"clear")}},On.prototype.find=function(e,t){return this.primary.find(e,t)},Dt(On);function Zs(e,t,n,r,i){r=xe(r),r.shared=!1;var o=[Jr(e,t,n,r,i)],a=o[0],l=r.widgetNode;return vr(e,function(s){l&&(r.widgetNode=l.cloneNode(!0)),o.push(Jr(s,ye(s,t),ye(s,n),r,i));for(var f=0;f<s.linked.length;++f)if(s.linked[f].isParent)return;a=Ce(o)}),new On(o,a)}function Ra(e){return e.findMarks(K(e.first,0),e.clipPos(K(e.lastLine())),function(t){return t.parent})}function Qs(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.find(),o=e.clipPos(i.from),a=e.clipPos(i.to);if(ae(o,a)){var l=Jr(e,o,a,r.primary,r.primary.type);r.markers.push(l),l.parent=r}}}function Js(e){for(var t=function(r){var i=e[r],o=[i.primary.doc];vr(i.primary.doc,function(s){return o.push(s)});for(var a=0;a<i.markers.length;a++){var l=i.markers[a];he(o,l.doc)==-1&&(l.parent=null,i.markers.splice(a--,1))}},n=0;n<e.length;n++)t(n)}var Vs=0,yt=function(e,t,n,r,i){if(!(this instanceof yt))return new yt(e,t,n,r,i);n==null&&(n=0),Tn.call(this,[new Ln([new zr("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=n;var o=K(n,0);this.sel=dr(o),this.history=new ni(null),this.id=++Vs,this.modeOption=t,this.lineSep=r,this.direction=i=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Qi(this,{from:o,to:o,text:e}),ut(this,dr(o),dt)};yt.prototype=X(Tn.prototype,{constructor:yt,iter:function(e,t,n){n?this.iterN(e-this.first,t-e,n):this.iterN(this.first,this.first+this.size,e)},insert:function(e,t){for(var n=0,r=0;r<t.length;++r)n+=t[r].height;this.insertInner(e-this.first,t,n)},remove:function(e,t){this.removeInner(e-this.first,t)},getValue:function(e){var t=sn(this,this.first,this.first+this.size);return e===!1?t:t.join(e||this.lineSeparator())},setValue:et(function(e){var t=K(this.first,0),n=this.first+this.size-1;Zr(this,{from:t,to:K(n,ue(this,n).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&gn(this.cm,0,0),ut(this,dr(t),dt)}),replaceRange:function(e,t,n,r){t=ye(this,t),n=n?ye(this,n):t,Qr(this,e,t,n,r)},getRange:function(e,t,n){var r=Qt(this,ye(this,e),ye(this,t));return n===!1?r:n===""?r.join(""):r.join(n||this.lineSeparator())},getLine:function(e){var t=this.getLineHandle(e);return t&&t.text},getLineHandle:function(e){if(Y(this,e))return ue(this,e)},getLineNumber:function(e){return h(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ue(this,e)),Bt(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return ye(this,e)},getCursor:function(e){var t=this.sel.primary(),n;return e==null||e=="head"?n=t.head:e=="anchor"?n=t.anchor:e=="end"||e=="to"||e===!1?n=t.to():n=t.from(),n},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:et(function(e,t,n){La(this,ye(this,typeof e=="number"?K(e,t||0):e),null,n)}),setSelection:et(function(e,t,n){La(this,ye(this,e),ye(this,t||e),n)}),extendSelection:et(function(e,t,n){oi(this,ye(this,e),t&&ye(this,t),n)}),extendSelections:et(function(e,t){Ca(this,vo(this,e),t)}),extendSelectionsBy:et(function(e,t){var n=De(this.sel.ranges,e);Ca(this,vo(this,n),t)}),setSelections:et(function(e,t,n){if(e.length){for(var r=[],i=0;i<e.length;i++)r[i]=new Ne(ye(this,e[i].anchor),ye(this,e[i].head||e[i].anchor));t==null&&(t=Math.min(e.length-1,this.sel.primIndex)),ut(this,zt(this.cm,r,t),n)}}),addSelection:et(function(e,t,n){var r=this.sel.ranges.slice(0);r.push(new Ne(ye(this,e),ye(this,t||e))),ut(this,zt(this.cm,r,r.length-1),n)}),getSelection:function(e){for(var t=this.sel.ranges,n,r=0;r<t.length;r++){var i=Qt(this,t[r].from(),t[r].to());n=n?n.concat(i):i}return e===!1?n:n.join(e||this.lineSeparator())},getSelections:function(e){for(var t=[],n=this.sel.ranges,r=0;r<n.length;r++){var i=Qt(this,n[r].from(),n[r].to());e!==!1&&(i=i.join(e||this.lineSeparator())),t[r]=i}return t},replaceSelection:function(e,t,n){for(var r=[],i=0;i<this.sel.ranges.length;i++)r[i]=e;this.replaceSelections(r,t,n||"+input")},replaceSelections:et(function(e,t,n){for(var r=[],i=this.sel,o=0;o<i.ranges.length;o++){var a=i.ranges[o];r[o]={from:a.from(),to:a.to(),text:this.splitLines(e[o]),origin:n}}for(var l=t&&t!="end"&&zs(this,r,t),s=r.length-1;s>=0;s--)Zr(this,r[s]);l?Ta(this,l):this.cm&&qr(this.cm)}),undo:et(function(){si(this,"undo")}),redo:et(function(){si(this,"redo")}),undoSelection:et(function(){si(this,"undo",!0)}),redoSelection:et(function(){si(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r<e.done.length;r++)e.done[r].ranges||++t;for(var i=0;i<e.undone.length;i++)e.undone[i].ranges||++n;return{undo:t,redo:n}},clearHistory:function(){var e=this;this.history=new ni(this.history),vr(this,function(t){return t.history=e.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(e){return e&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(e){return this.history.generation==(e||this.cleanGeneration)},getHistory:function(){return{done:jr(this.history.done),undone:jr(this.history.undone)}},setHistory:function(e){var t=this.history=new ni(this.history);t.done=jr(e.done.slice(0),null,!0),t.undone=jr(e.undone.slice(0),null,!0)},setGutterMarker:et(function(e,t,n){return Cn(this,e,"gutter",function(r){var i=r.gutterMarkers||(r.gutterMarkers={});return i[t]=n,!n&&In(i)&&(r.gutterMarkers=null),!0})}),clearGutter:et(function(e){var t=this;this.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&Cn(t,n,"gutter",function(){return n.gutterMarkers[e]=null,In(n.gutterMarkers)&&(n.gutterMarkers=null),!0})})}),lineInfo:function(e){var t;if(typeof e=="number"){if(!Y(this,e)||(t=e,e=ue(this,e),!e))return null}else if(t=h(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:et(function(e,t,n){return Cn(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[i])r[i]=n;else{if(N(n).test(r[i]))return!1;r[i]+=" "+n}return!0})}),removeLineClass:et(function(e,t,n){return Cn(this,e,t=="gutter"?"gutter":"class",function(r){var i=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass",o=r[i];if(o)if(n==null)r[i]=null;else{var a=o.match(N(n));if(!a)return!1;var l=a.index+a[0].length;r[i]=o.slice(0,a.index)+(!a.index||l==o.length?"":" ")+o.slice(l)||null}else return!1;return!0})}),addLineWidget:et(function(e,t,n){return Ys(this,e,t,n)}),removeLineWidget:function(e){e.clear()},markText:function(e,t,n){return Jr(this,ye(this,e),ye(this,t),n,n&&n.type||"range")},setBookmark:function(e,t){var n={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:!1,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};return e=ye(this,e),Jr(this,e,e,n,"bookmark")},findMarksAt:function(e){e=ye(this,e);var t=[],n=ue(this,e.line).markedSpans;if(n)for(var r=0;r<n.length;++r){var i=n[r];(i.from==null||i.from<=e.ch)&&(i.to==null||i.to>=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ye(this,e),t=ye(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var l=0;l<a.length;l++){var s=a[l];!(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)&&(!n||n(s.marker))&&r.push(s.marker.parent||s.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;r<n.length;++r)n[r].from!=null&&e.push(n[r].marker)}),e},posFromIndex:function(e){var t,n=this.first,r=this.lineSeparator().length;return this.iter(function(i){var o=i.text.length+r;if(o>e)return t=e,!0;e-=o,++n}),ye(this,K(n,t))},indexFromPos:function(e){e=ye(this,e);var t=e.ch;if(e.line<this.first||e.ch<0)return 0;var n=this.lineSeparator().length;return this.iter(this.first,e.line,function(r){t+=r.text.length+n}),t},copy:function(e){var t=new yt(sn(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return t.scrollTop=this.scrollTop,t.scrollLeft=this.scrollLeft,t.sel=this.sel,t.extend=!1,e&&(t.history.undoDepth=this.history.undoDepth,t.setHistory(this.getHistory())),t},linkedDoc:function(e){e||(e={});var t=this.first,n=this.first+this.size;e.from!=null&&e.from>t&&(t=e.from),e.to!=null&&e.to<n&&(n=e.to);var r=new yt(sn(this,t,n),e.mode||this.modeOption,t,this.lineSep,this.direction);return e.sharedHist&&(r.history=this.history),(this.linked||(this.linked=[])).push({doc:r,sharedHist:e.sharedHist}),r.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],Qs(r,Ra(this)),r},unlinkDoc:function(e){if(e instanceof He&&(e=e.doc),this.linked)for(var t=0;t<this.linked.length;++t){var n=this.linked[t];if(n.doc==e){this.linked.splice(t,1),e.unlinkDoc(this),Js(Ra(this));break}}if(e.history==this.history){var r=[e.id];vr(e,function(i){return r.push(i.id)},!0),e.history=new ni(null),e.history.done=jr(this.history.done,r),e.history.undone=jr(this.history.undone,r)}},iterLinkedDocs:function(e){vr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):Pt(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:et(function(e){e!="rtl"&&(e="ltr"),e!=this.direction&&(this.direction=e,this.iter(function(t){return t.order=null}),this.cm&&Rs(this.cm))})}),yt.prototype.eachLine=yt.prototype.iter;var Ka=0;function $s(e){var t=this;if(_a(t),!(Ke(t,e)||$t(t.display,e))){st(e),D&&(Ka=+new Date);var n=Sr(t,e,!0),r=e.dataTransfer.files;if(!(!n||t.isReadOnly()))if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,l=function(){++a==i&&$e(t,function(){n=ye(t.doc,n);var P={from:n,to:n,text:t.doc.splitLines(o.filter(function(q){return q!=null}).join(t.doc.lineSeparator())),origin:"paste"};Zr(t.doc,P),Ta(t.doc,dr(ye(t.doc,n),ye(t.doc,pr(P))))})()},s=function(P,q){if(t.options.allowDropFileTypes&&he(t.options.allowDropFileTypes,P.type)==-1){l();return}var J=new FileReader;J.onerror=function(){return l()},J.onload=function(){var ee=J.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(ee)){l();return}o[q]=ee,l()},J.readAsText(P)},f=0;f<r.length;f++)s(r[f],f);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var b=e.dataTransfer.getData("Text");if(b){var k;if(t.state.draggingText&&!t.state.draggingText.copy&&(k=t.listSelections()),ai(t.doc,dr(n,n)),k)for(var E=0;E<k.length;++E)Qr(t.doc,"",k[E].anchor,k[E].head,"drag");t.replaceSelection(b,"around","paste"),t.display.input.focus()}}catch{}}}}function eu(e,t){if(D&&(!e.state.draggingText||+new Date-Ka<100)){ar(t);return}if(!(Ke(e,t)||$t(e.display,t))&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!Z)){var n=c("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",W&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),W&&n.parentNode.removeChild(n)}}function tu(e,t){var n=Sr(e,t);if(n){var r=document.createDocumentFragment();Bi(e,n,r),e.display.dragCursor||(e.display.dragCursor=c("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),G(e.display.dragCursor,r)}}function _a(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function Ua(e){if(document.getElementsByClassName){for(var t=document.getElementsByClassName("CodeMirror"),n=[],r=0;r<t.length;r++){var i=t[r].CodeMirror;i&&n.push(i)}n.length&&n[0].operation(function(){for(var o=0;o<n.length;o++)e(n[o])})}}var Ga=!1;function ru(){Ga||(nu(),Ga=!0)}function nu(){var e;pe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,Ua(iu)},100))}),pe(window,"blur",function(){return Ua(Gr)})}function iu(e){var t=e.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize()}for(var mr={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Nn=0;Nn<10;Nn++)mr[Nn+48]=mr[Nn+96]=String(Nn);for(var ui=65;ui<=90;ui++)mr[ui]=String.fromCharCode(ui);for(var Pn=1;Pn<=12;Pn++)mr[Pn+111]=mr[Pn+63235]="F"+Pn;var tr={};tr.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"},tr.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"},tr.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},tr.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"]},tr.default=p?tr.macDefault:tr.pcDefault;function ou(e){var t=e.split(/-(?!$)/);e=t[t.length-1];for(var n,r,i,o,a=0;a<t.length-1;a++){var l=t[a];if(/^(cmd|meta|m)$/i.test(l))o=!0;else if(/^a(lt)?$/i.test(l))n=!0;else if(/^(c|ctrl|control)$/i.test(l))r=!0;else if(/^s(hift)?$/i.test(l))i=!0;else throw new Error("Unrecognized modifier name: "+l)}return n&&(e="Alt-"+e),r&&(e="Ctrl-"+e),o&&(e="Cmd-"+e),i&&(e="Shift-"+e),e}function au(e){var t={};for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];if(/^(name|fallthrough|(de|at)tach)$/.test(n))continue;if(r=="..."){delete e[n];continue}for(var i=De(n.split(" "),ou),o=0;o<i.length;o++){var a=void 0,l=void 0;o==i.length-1?(l=i.join(" "),a=r):(l=i.slice(0,o+1).join(" "),a="...");var s=t[l];if(!s)t[l]=a;else if(s!=a)throw new Error("Inconsistent bindings for "+l)}delete e[n]}for(var f in t)e[f]=t[f];return e}function Vr(e,t,n,r){t=fi(t);var i=t.call?t.call(e,r):t[e];if(i===!1)return"nothing";if(i==="...")return"multi";if(i!=null&&n(i))return"handled";if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]")return Vr(e,t.fallthrough,n,r);for(var o=0;o<t.fallthrough.length;o++){var a=Vr(e,t.fallthrough[o],n,r);if(a)return a}}}function qa(e){var t=typeof e=="string"?e:mr[e.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function Xa(e,t,n){var r=e;return t.altKey&&r!="Alt"&&(e="Alt-"+e),(L?t.metaKey:t.ctrlKey)&&r!="Ctrl"&&(e="Ctrl-"+e),(L?t.ctrlKey:t.metaKey)&&r!="Mod"&&(e="Cmd-"+e),!n&&t.shiftKey&&r!="Shift"&&(e="Shift-"+e),e}function ja(e,t){if(W&&e.keyCode==34&&e.char)return!1;var n=mr[e.keyCode];return n==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(n=e.code),Xa(n,e,t))}function fi(e){return typeof e=="string"?tr[e]:e}function $r(e,t){for(var n=e.doc.sel.ranges,r=[],i=0;i<n.length;i++){for(var o=t(n[i]);r.length&&ae(o.from,Ce(r).to)<=0;){var a=r.pop();if(ae(a.from,o.from)<0){o.from=a.from;break}}r.push(o)}St(e,function(){for(var l=r.length-1;l>=0;l--)Qr(e.doc,"",r[l].from,r[l].to,"+delete");qr(e)})}function eo(e,t,n){var r=nr(e.text,t+n,n);return r<0||r>e.text.length?null:r}function to(e,t,n){var r=eo(e,t.ch,n);return r==null?null:new K(t.line,r,n<0?"after":"before")}function ro(e,t,n,r,i){if(e){t.doc.direction=="rtl"&&(i=-i);var o=Se(n,t.doc.direction);if(o){var a=i<0?Ce(o):o[0],l=i<0==(a.level==1),s=l?"after":"before",f;if(a.level>0||t.doc.direction=="rtl"){var b=Kr(t,n);f=i<0?n.text.length-1:0;var k=qt(t,b,f).top;f=Kt(function(E){return qt(t,b,E).top==k},i<0==(a.level==1)?a.from:a.to-1,f),s=="before"&&(f=eo(n,f,1))}else f=i<0?a.to:a.from;return new K(r,f,s)}}return new K(r,i<0?n.text.length:0,i<0?"before":"after")}function lu(e,t,n,r){var i=Se(t,e.doc.direction);if(!i)return to(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=or(i,n.ch,n.sticky),a=i[o];if(e.doc.direction=="ltr"&&a.level%2==0&&(r>0?a.to>n.ch:a.from<n.ch))return to(t,n,r);var l=function(ie,le){return eo(t,ie instanceof K?ie.ch:ie,le)},s,f=function(ie){return e.options.lineWrapping?(s=s||Kr(e,t),Vo(e,t,s,ie)):{begin:0,end:t.text.length}},b=f(n.sticky=="before"?l(n,-1):n.ch);if(e.doc.direction=="rtl"||a.level==1){var k=a.level==1==r<0,E=l(n,k?1:-1);if(E!=null&&(k?E<=a.to&&E<=b.end:E>=a.from&&E>=b.begin)){var P=k?"before":"after";return new K(n.line,E,P)}}var q=function(ie,le,oe){for(var se=function(Fe,tt){return tt?new K(n.line,l(Fe,1),"before"):new K(n.line,Fe,"after")};ie>=0&&ie<i.length;ie+=le){var ve=i[ie],de=le>0==(ve.level!=1),ke=de?oe.begin:l(oe.end,-1);if(ve.from<=ke&&ke<ve.to||(ke=de?ve.from:l(ve.to,-1),oe.begin<=ke&&ke<oe.end))return se(ke,de)}},J=q(o+r,r,b);if(J)return J;var ee=r>0?b.end:l(b.begin,-1);return ee!=null&&!(r>0&&ee==t.text.length)&&(J=q(r>0?0:i.length-1,r,f(ee)),J)?J:null}var Mn={selectAll:Ma,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),dt)},killLine:function(e){return $r(e,function(t){if(t.empty()){var n=ue(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line<e.lastLine()?{from:t.head,to:K(t.head.line+1,0)}:{from:t.head,to:K(t.head.line,n)}}else return{from:t.from(),to:t.to()}})},deleteLine:function(e){return $r(e,function(t){return{from:K(t.from().line,0),to:ye(e.doc,K(t.to().line+1,0))}})},delLineLeft:function(e){return $r(e,function(t){return{from:K(t.from().line,0),to:t.from()}})},delWrappedLineLeft:function(e){return $r(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return{from:r,to:t.from()}})},delWrappedLineRight:function(e){return $r(e,function(t){var n=e.charCoords(t.head,"div").top+5,r=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div");return{from:t.from(),to:r}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(K(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(K(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(t){return Ya(e,t.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(t){return Za(e,t.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(t){return su(e,t.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:n},"div")},Ae)},goLineLeft:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5;return e.coordsChar({left:0,top:n},"div")},Ae)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(t){var n=e.cursorCoords(t.head,"div").top+5,r=e.coordsChar({left:0,top:n},"div");return r.ch<e.getLine(r.line).search(/\S/)?Za(e,t.head):r},Ae)},goLineUp:function(e){return e.moveV(-1,"line")},goLineDown:function(e){return e.moveV(1,"line")},goPageUp:function(e){return e.moveV(-1,"page")},goPageDown:function(e){return e.moveV(1,"page")},goCharLeft:function(e){return e.moveH(-1,"char")},goCharRight:function(e){return e.moveH(1,"char")},goColumnLeft:function(e){return e.moveH(-1,"column")},goColumnRight:function(e){return e.moveH(1,"column")},goWordLeft:function(e){return e.moveH(-1,"word")},goGroupRight:function(e){return e.moveH(1,"group")},goGroupLeft:function(e){return e.moveH(-1,"group")},goWordRight:function(e){return e.moveH(1,"word")},delCharBefore:function(e){return e.deleteH(-1,"codepoint")},delCharAfter:function(e){return e.deleteH(1,"char")},delWordBefore:function(e){return e.deleteH(-1,"word")},delWordAfter:function(e){return e.deleteH(1,"word")},delGroupBefore:function(e){return e.deleteH(-1,"group")},delGroupAfter:function(e){return e.deleteH(1,"group")},indentAuto:function(e){return e.indentSelection("smart")},indentMore:function(e){return e.indentSelection("add")},indentLess:function(e){return e.indentSelection("subtract")},insertTab:function(e){return e.replaceSelection(" ")},insertSoftTab:function(e){for(var t=[],n=e.listSelections(),r=e.options.tabSize,i=0;i<n.length;i++){var o=n[i].from(),a=Le(e.getLine(o.line),o.ch,r);t.push(Tt(r-a%r))}e.replaceSelections(t)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return St(e,function(){for(var t=e.listSelections(),n=[],r=0;r<t.length;r++)if(t[r].empty()){var i=t[r].head,o=ue(e.doc,i.line).text;if(o){if(i.ch==o.length&&(i=new K(i.line,i.ch-1)),i.ch>0)i=new K(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),K(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=ue(e.doc,i.line-1).text;a&&(i=new K(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),K(i.line-1,a.length-1),i,"+transpose"))}}n.push(new Ne(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){return St(e,function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r<t.length;r++)e.indentLine(t[r].from().line,null,!0);qr(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function Ya(e,t){var n=ue(e.doc,t),r=Bt(n);return r!=n&&(t=h(r)),ro(!0,e,r,t,1)}function su(e,t){var n=ue(e.doc,t),r=ql(n);return r!=n&&(t=h(r)),ro(!0,e,n,t,-1)}function Za(e,t){var n=Ya(e,t.line),r=ue(e.doc,n.line),i=Se(r,e.doc.direction);if(!i||i[0].level==0){var o=Math.max(n.ch,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return K(n.line,a?0:o,n.sticky)}return n}function ci(e,t,n){if(typeof t=="string"&&(t=Mn[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,i=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),i=t(e)!=Mt}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function uu(e,t,n){for(var r=0;r<e.state.keyMaps.length;r++){var i=Vr(t,e.state.keyMaps[r],n,e);if(i)return i}return e.options.extraKeys&&Vr(t,e.options.extraKeys,n,e)||Vr(t,e.options.keyMap,n,e)}var fu=new be;function Dn(e,t,n,r){var i=e.state.keySeq;if(i){if(qa(t))return"handled";if(/\'$/.test(t)?e.state.keySeq=null:fu.set(50,function(){e.state.keySeq==i&&(e.state.keySeq=null,e.display.input.reset())}),Qa(e,i+" "+t,n,r))return!0}return Qa(e,t,n,r)}function Qa(e,t,n,r){var i=uu(e,t,r);return i=="multi"&&(e.state.keySeq=t),i=="handled"&&Ve(e,"keyHandled",e,t,n),(i=="handled"||i=="multi")&&(st(n),Hi(e)),!!i}function Ja(e,t){var n=ja(t,!0);return n?t.shiftKey&&!e.state.keySeq?Dn(e,"Shift-"+n,t,function(r){return ci(e,r,!0)})||Dn(e,n,t,function(r){if(typeof r=="string"?/^go[A-Z]/.test(r):r.motion)return ci(e,r)}):Dn(e,n,t,function(r){return ci(e,r)}):!1}function cu(e,t,n){return Dn(e,"'"+n+"'",t,function(r){return ci(e,r,!0)})}var no=null;function Va(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&(t.curOp.focus=fe(Ge(t)),!Ke(t,e))){D&&_<11&&e.keyCode==27&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=n==16||e.shiftKey;var r=Ja(t,e);W&&(no=r?n:null,!r&&n==88&&!zn&&(p?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),z&&!p&&!r&&n==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),n==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)&&hu(t)}}function hu(e){var t=e.display.lineDiv;ce(t,"CodeMirror-crosshair");function n(r){(r.keyCode==18||!r.altKey)&&(U(t,"CodeMirror-crosshair"),lt(document,"keyup",n),lt(document,"mouseover",n))}pe(document,"keyup",n),pe(document,"mouseover",n)}function $a(e){e.keyCode==16&&(this.doc.sel.shift=!1),Ke(this,e)}function el(e){var t=this;if(!(e.target&&e.target!=t.display.input.getField())&&!($t(t.display,e)||Ke(t,e)||e.ctrlKey&&!e.altKey||p&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(W&&n==no){no=null,st(e);return}if(!(W&&(!e.which||e.which<10)&&Ja(t,e))){var i=String.fromCharCode(r??n);i!="\b"&&(cu(t,e,i)||t.display.input.onKeyPress(e))}}}var du=400,io=function(e,t,n){this.time=e,this.pos=t,this.button=n};io.prototype.compare=function(e,t,n){return this.time+du>e&&ae(t,this.pos)==0&&n==this.button};var Fn,En;function pu(e,t){var n=+new Date;return En&&En.compare(n,e,t)?(Fn=En=null,"triple"):Fn&&Fn.compare(n,e,t)?(En=new io(n,e,t),Fn=null,"double"):(Fn=new io(n,e,t),En=null,"single")}function tl(e){var t=this,n=t.display;if(!(Ke(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.input.ensurePolled(),n.shift=e.shiftKey,$t(n,e)){T||(n.scroller.draggable=!1,setTimeout(function(){return n.scroller.draggable=!0},100));return}if(!oo(t,e)){var r=Sr(t,e),i=Ft(e),o=r?pu(r,i):"single";me(t).focus(),i==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&vu(t,i,r,o,e))&&(i==1?r?mu(t,r,o,e):on(e)==n.scroller&&st(e):i==2?(r&&oi(t.doc,r),setTimeout(function(){return n.input.focus()},20)):i==3&&(F?t.display.input.onContextMenu(e):zi(t)))}}}function vu(e,t,n,r,i){var o="Click";return r=="double"?o="Double"+o:r=="triple"&&(o="Triple"+o),o=(t==1?"Left":t==2?"Middle":"Right")+o,Dn(e,Xa(o,i),i,function(a){if(typeof a=="string"&&(a=Mn[a]),!a)return!1;var l=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),l=a(e,n)!=Mt}finally{e.state.suppressEdits=!1}return l})}function gu(e,t,n){var r=e.getOption("configureMouse"),i=r?r(e,t,n):{};if(i.unit==null){var o=m?n.shiftKey&&n.metaKey:n.altKey;i.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(i.extend==null||e.doc.extend)&&(i.extend=e.doc.extend||n.shiftKey),i.addNew==null&&(i.addNew=p?n.metaKey:n.ctrlKey),i.moveOnDrag==null&&(i.moveOnDrag=!(p?n.altKey:n.ctrlKey)),i}function mu(e,t,n,r){D?setTimeout(ge(ra,e),0):e.curOp.focus=fe(Ge(e));var i=gu(e,n,r),o=e.doc.sel,a;e.options.dragDrop&&mi&&!e.isReadOnly()&&n=="single"&&(a=o.contains(t))>-1&&(ae((a=o.ranges[a]).from(),t)<0||t.xRel>0)&&(ae(a.to(),t)>0||t.xRel<0)?yu(e,r,t,i):bu(e,r,t,i)}function yu(e,t,n,r){var i=e.display,o=!1,a=$e(e,function(f){T&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:zi(e)),lt(i.wrapper.ownerDocument,"mouseup",a),lt(i.wrapper.ownerDocument,"mousemove",l),lt(i.scroller,"dragstart",s),lt(i.scroller,"drop",a),o||(st(f),r.addNew||oi(e.doc,n,null,null,r.extend),T&&!Z||D&&_==9?setTimeout(function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()},20):i.input.focus())}),l=function(f){o=o||Math.abs(t.clientX-f.clientX)+Math.abs(t.clientY-f.clientY)>=10},s=function(){return o=!0};T&&(i.scroller.draggable=!0),e.state.draggingText=a,a.copy=!r.moveOnDrag,pe(i.wrapper.ownerDocument,"mouseup",a),pe(i.wrapper.ownerDocument,"mousemove",l),pe(i.scroller,"dragstart",s),pe(i.scroller,"drop",a),e.state.delayingBlurEvent=!0,setTimeout(function(){return i.input.focus()},20),i.scroller.dragDrop&&i.scroller.dragDrop()}function rl(e,t,n){if(n=="char")return new Ne(t,t);if(n=="word")return e.findWordAt(t);if(n=="line")return new Ne(K(t.line,0),ye(e.doc,K(t.line+1,0)));var r=n(e,t);return new Ne(r.from,r.to)}function bu(e,t,n,r){D&&zi(e);var i=e.display,o=e.doc;st(t);var a,l,s=o.sel,f=s.ranges;if(r.addNew&&!r.extend?(l=o.sel.contains(n),l>-1?a=f[l]:a=new Ne(n,n)):(a=o.sel.primary(),l=o.sel.primIndex),r.unit=="rectangle")r.addNew||(a=new Ne(n,n)),n=Sr(e,t,!0,!0),l=-1;else{var b=rl(e,n,r.unit);r.extend?a=Vi(a,b.anchor,b.head,r.extend):a=b}r.addNew?l==-1?(l=f.length,ut(o,zt(e,f.concat([a]),l),{scroll:!1,origin:"*mouse"})):f.length>1&&f[l].empty()&&r.unit=="char"&&!r.extend?(ut(o,zt(e,f.slice(0,l).concat(f.slice(l+1)),0),{scroll:!1,origin:"*mouse"}),s=o.sel):$i(o,l,a,Lt):(l=0,ut(o,new Ot([a],0),Lt),s=o.sel);var k=n;function E(oe){if(ae(k,oe)!=0)if(k=oe,r.unit=="rectangle"){for(var se=[],ve=e.options.tabSize,de=Le(ue(o,n.line).text,n.ch,ve),ke=Le(ue(o,oe.line).text,oe.ch,ve),Fe=Math.min(de,ke),tt=Math.max(de,ke),ze=Math.min(n.line,oe.line),Ct=Math.min(e.lastLine(),Math.max(n.line,oe.line));ze<=Ct;ze++){var bt=ue(o,ze).text,Ye=Xe(bt,Fe,ve);Fe==tt?se.push(new Ne(K(ze,Ye),K(ze,Ye))):bt.length>Ye&&se.push(new Ne(K(ze,Ye),K(ze,Xe(bt,tt,ve))))}se.length||se.push(new Ne(n,n)),ut(o,zt(e,s.ranges.slice(0,l).concat(se),l),{origin:"*mouse",scroll:!1}),e.scrollIntoView(oe)}else{var xt=a,ot=rl(e,oe,r.unit),Qe=xt.anchor,Ze;ae(ot.anchor,Qe)>0?(Ze=ot.head,Qe=Hr(xt.from(),ot.anchor)):(Ze=ot.anchor,Qe=gt(xt.to(),ot.head));var Ue=s.ranges.slice(0);Ue[l]=xu(e,new Ne(ye(o,Qe),Ze)),ut(o,zt(e,Ue,l),Lt)}}var P=i.wrapper.getBoundingClientRect(),q=0;function J(oe){var se=++q,ve=Sr(e,oe,!0,r.unit=="rectangle");if(ve)if(ae(ve,k)!=0){e.curOp.focus=fe(Ge(e)),E(ve);var de=$n(i,o);(ve.line>=de.to||ve.line<de.from)&&setTimeout($e(e,function(){q==se&&J(oe)}),150)}else{var ke=oe.clientY<P.top?-20:oe.clientY>P.bottom?20:0;ke&&setTimeout($e(e,function(){q==se&&(i.scroller.scrollTop+=ke,J(oe))}),50)}}function ee(oe){e.state.selectingText=!1,q=1/0,oe&&(st(oe),i.input.focus()),lt(i.wrapper.ownerDocument,"mousemove",ie),lt(i.wrapper.ownerDocument,"mouseup",le),o.history.lastSelOrigin=null}var ie=$e(e,function(oe){oe.buttons===0||!Ft(oe)?ee(oe):J(oe)}),le=$e(e,ee);e.state.selectingText=le,pe(i.wrapper.ownerDocument,"mousemove",ie),pe(i.wrapper.ownerDocument,"mouseup",le)}function xu(e,t){var n=t.anchor,r=t.head,i=ue(e.doc,n.line);if(ae(n,r)==0&&n.sticky==r.sticky)return t;var o=Se(i);if(!o)return t;var a=or(o,n.ch,n.sticky),l=o[a];if(l.from!=n.ch&&l.to!=n.ch)return t;var s=a+(l.from==n.ch==(l.level!=1)?0:1);if(s==0||s==o.length)return t;var f;if(r.line!=n.line)f=(r.line-n.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var b=or(o,r.ch,r.sticky),k=b-a||(r.ch-n.ch)*(l.level==1?-1:1);b==s-1||b==s?f=k<0:f=k>0}var E=o[s+(f?-1:0)],P=f==(E.level==1),q=P?E.from:E.to,J=P?"after":"before";return n.ch==q&&n.sticky==J?t:new Ne(new K(n.line,q,J),r)}function nl(e,t,n,r){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;r&&st(t);var a=e.display,l=a.lineDiv.getBoundingClientRect();if(o>l.bottom||!wt(e,n))return vt(t);o-=l.top-a.viewOffset;for(var s=0;s<e.display.gutterSpecs.length;++s){var f=a.gutters.childNodes[s];if(f&&f.getBoundingClientRect().right>=i){var b=x(e.doc,o),k=e.display.gutterSpecs[s];return Re(e,n,e,b,k.className,t),vt(t)}}}function oo(e,t){return nl(e,t,"gutterClick",!0)}function il(e,t){$t(e.display,t)||ku(e,t)||Ke(e,t,"contextmenu")||F||e.display.input.onContextMenu(t)}function ku(e,t){return wt(e,"gutterContextMenu")?nl(e,t,"gutterContextMenu",!1):!1}function ol(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),pn(e)}var en={toString:function(){return"CodeMirror.Init"}},al={},hi={};function wu(e){var t=e.optionHandlers;function n(r,i,o,a){e.defaults[r]=i,o&&(t[r]=a?function(l,s,f){f!=en&&o(l,s,f)}:o)}e.defineOption=n,e.Init=en,n("value","",function(r,i){return r.setValue(i)},!0),n("mode",null,function(r,i){r.doc.modeOption=i,Zi(r)},!0),n("indentUnit",2,Zi,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,function(r){wn(r),pn(r),mt(r)},!0),n("lineSeparator",null,function(r,i){if(r.doc.lineSep=i,!!i){var o=[],a=r.doc.first;r.doc.iter(function(s){for(var f=0;;){var b=s.text.indexOf(i,f);if(b==-1)break;f=b+i.length,o.push(K(a,b))}a++});for(var l=o.length-1;l>=0;l--)Qr(r.doc,i,o[l],K(o[l].line,o[l].ch+i.length))}}),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,function(r,i,o){r.state.specialChars=new RegExp(i.source+(i.test(" ")?"":"| "),"g"),o!=en&&r.refresh()}),n("specialCharPlaceholder",Jl,function(r){return r.refresh()},!0),n("electricChars",!0),n("inputStyle",u?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),n("spellcheck",!1,function(r,i){return r.getInputField().spellcheck=i},!0),n("autocorrect",!1,function(r,i){return r.getInputField().autocorrect=i},!0),n("autocapitalize",!1,function(r,i){return r.getInputField().autocapitalize=i},!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",function(r){ol(r),kn(r)},!0),n("keyMap","default",function(r,i,o){var a=fi(i),l=o!=en&&fi(o);l&&l.detach&&l.detach(r,a),a.attach&&a.attach(r,l||null)}),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Cu,!0),n("gutters",[],function(r,i){r.display.gutterSpecs=ji(i,r.options.lineNumbers),kn(r)},!0),n("fixedGutter",!0,function(r,i){r.display.gutters.style.left=i?Wi(r.display)+"px":"0",r.refresh()},!0),n("coverGutterNextToScrollbar",!1,function(r){return Xr(r)},!0),n("scrollbarStyle","native",function(r){sa(r),Xr(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),n("lineNumbers",!1,function(r,i){r.display.gutterSpecs=ji(r.options.gutters,i),kn(r)},!0),n("firstLineNumber",1,kn,!0),n("lineNumberFormatter",function(r){return r},kn,!0),n("showCursorWhenSelecting",!1,vn,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,function(r,i){i=="nocursor"&&(Gr(r),r.display.input.blur()),r.display.input.readOnlyChanged(i)}),n("screenReaderLabel",null,function(r,i){i=i===""?null:i,r.display.input.screenReaderLabelChanged(i)}),n("disableInput",!1,function(r,i){i||r.display.input.reset()},!0),n("dragDrop",!0,Su),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,vn,!0),n("singleCursorHeightPerLine",!0,vn,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,wn,!0),n("addModeClass",!1,wn,!0),n("pollInterval",100),n("undoDepth",200,function(r,i){return r.doc.history.undoDepth=i}),n("historyEventDelay",1250),n("viewportMargin",10,function(r){return r.refresh()},!0),n("maxHighlightLength",1e4,wn,!0),n("moveInputWithCursor",!0,function(r,i){i||r.display.input.resetPosition()}),n("tabindex",null,function(r,i){return r.display.input.getField().tabIndex=i||""}),n("autofocus",null),n("direction","ltr",function(r,i){return r.doc.setDirection(i)},!0),n("phrases",null)}function Su(e,t,n){var r=n&&n!=en;if(!t!=!r){var i=e.display.dragFunctions,o=t?pe:lt;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 Cu(e){e.options.lineWrapping?(ce(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(U(e.display.wrapper,"CodeMirror-wrap"),Li(e)),Ii(e),mt(e),pn(e),setTimeout(function(){return Xr(e)},100)}function He(e,t){var n=this;if(!(this instanceof He))return new He(e,t);this.options=t=t?xe(t):{},xe(al,t,!1);var r=t.value;typeof r=="string"?r=new yt(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new He.inputStyles[t.inputStyle](this),o=this.display=new Bs(e,r,i,t);o.wrapper.CodeMirror=this,ol(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),sa(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 be,keySeq:null,specialChars:null},t.autofocus&&!u&&o.input.focus(),D&&_<11&&setTimeout(function(){return n.display.input.reset(!0)},20),Lu(this),ru(),Ar(this),this.curOp.forceUpdate=!0,ya(this,r),t.autofocus&&!u||this.hasFocus()?setTimeout(function(){n.hasFocus()&&!n.state.focused&&Ri(n)},20):Gr(this);for(var a in hi)hi.hasOwnProperty(a)&&hi[a](this,t[a],en);ca(this),t.finishInit&&t.finishInit(this);for(var l=0;l<ao.length;++l)ao[l](this);Or(this),T&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"&&(o.lineDiv.style.textRendering="auto")}He.defaults=al,He.optionHandlers=hi;function Lu(e){var t=e.display;pe(t.scroller,"mousedown",$e(e,tl)),D&&_<11?pe(t.scroller,"dblclick",$e(e,function(s){if(!Ke(e,s)){var f=Sr(e,s);if(!(!f||oo(e,s)||$t(e.display,s))){st(s);var b=e.findWordAt(f);oi(e.doc,b.anchor,b.head)}}})):pe(t.scroller,"dblclick",function(s){return Ke(e,s)||st(s)}),pe(t.scroller,"contextmenu",function(s){return il(e,s)}),pe(t.input.getField(),"contextmenu",function(s){t.scroller.contains(s.target)||il(e,s)});var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout(function(){return t.activeTouch=null},1e3),r=t.activeTouch,r.end=+new Date)}function o(s){if(s.touches.length!=1)return!1;var f=s.touches[0];return f.radiusX<=1&&f.radiusY<=1}function a(s,f){if(f.left==null)return!0;var b=f.left-s.left,k=f.top-s.top;return b*b+k*k>20*20}pe(t.scroller,"touchstart",function(s){if(!Ke(e,s)&&!o(s)&&!oo(e,s)){t.input.ensurePolled(),clearTimeout(n);var f=+new Date;t.activeTouch={start:f,moved:!1,prev:f-r.end<=300?r:null},s.touches.length==1&&(t.activeTouch.left=s.touches[0].pageX,t.activeTouch.top=s.touches[0].pageY)}}),pe(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),pe(t.scroller,"touchend",function(s){var f=t.activeTouch;if(f&&!$t(t,s)&&f.left!=null&&!f.moved&&new Date-f.start<300){var b=e.coordsChar(t.activeTouch,"page"),k;!f.prev||a(f,f.prev)?k=new Ne(b,b):!f.prev.prev||a(f,f.prev.prev)?k=e.findWordAt(b):k=new Ne(K(b.line,0),ye(e.doc,K(b.line+1,0))),e.setSelection(k.anchor,k.head),e.focus(),st(s)}i()}),pe(t.scroller,"touchcancel",i),pe(t.scroller,"scroll",function(){t.scroller.clientHeight&&(mn(e,t.scroller.scrollTop),Lr(e,t.scroller.scrollLeft,!0),Re(e,"scroll",e))}),pe(t.scroller,"mousewheel",function(s){return pa(e,s)}),pe(t.scroller,"DOMMouseScroll",function(s){return pa(e,s)}),pe(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(s){Ke(e,s)||ar(s)},over:function(s){Ke(e,s)||(tu(e,s),ar(s))},start:function(s){return eu(e,s)},drop:$e(e,$s),leave:function(s){Ke(e,s)||_a(e)}};var l=t.input.getField();pe(l,"keyup",function(s){return $a.call(e,s)}),pe(l,"keydown",$e(e,Va)),pe(l,"keypress",$e(e,el)),pe(l,"focus",function(s){return Ri(e,s)}),pe(l,"blur",function(s){return Gr(e,s)})}var ao=[];He.defineInitHook=function(e){return ao.push(e)};function Wn(e,t,n,r){var i=e.doc,o;n==null&&(n="add"),n=="smart"&&(i.mode.indent?o=un(e,t).state:n="prev");var a=e.options.tabSize,l=ue(i,t),s=Le(l.text,null,a);l.stateAfter&&(l.stateAfter=null);var f=l.text.match(/^\s*/)[0],b;if(!r&&!/\S/.test(l.text))b=0,n="not";else if(n=="smart"&&(b=i.mode.indent(o,l.text.slice(f.length),l.text),b==Mt||b>150)){if(!r)return;n="prev"}n=="prev"?t>i.first?b=Le(ue(i,t-1).text,null,a):b=0:n=="add"?b=s+e.options.indentUnit:n=="subtract"?b=s-e.options.indentUnit:typeof n=="number"&&(b=s+n),b=Math.max(0,b);var k="",E=0;if(e.options.indentWithTabs)for(var P=Math.floor(b/a);P;--P)E+=a,k+=" ";if(E<b&&(k+=Tt(b-E)),k!=f)return Qr(i,k,K(t,0),K(t,f.length),"+input"),l.stateAfter=null,!0;for(var q=0;q<i.sel.ranges.length;q++){var J=i.sel.ranges[q];if(J.head.line==t&&J.head.ch<f.length){var ee=K(t,f.length);$i(i,q,new Ne(ee,ee));break}}}var Rt=null;function di(e){Rt=e}function lo(e,t,n,r,i){var o=e.doc;e.display.shift=!1,r||(r=o.sel);var a=+new Date-200,l=i=="paste"||e.state.pasteIncoming>a,s=Pt(t),f=null;if(l&&r.ranges.length>1)if(Rt&&Rt.text.join(`
`)==t){if(r.ranges.length%Rt.text.length==0){f=[];for(var b=0;b<Rt.text.length;b++)f.push(o.splitLines(Rt.text[b]))}}else s.length==r.ranges.length&&e.options.pasteLinesPerSelection&&(f=De(s,function(ie){return[ie]}));for(var k=e.curOp.updateInput,E=r.ranges.length-1;E>=0;E--){var P=r.ranges[E],q=P.from(),J=P.to();P.empty()&&(n&&n>0?q=K(q.line,q.ch-n):e.state.overwrite&&!l?J=K(J.line,Math.min(ue(o,J.line).text.length,J.ch+Ce(s).length)):l&&Rt&&Rt.lineWise&&Rt.text.join(`
`)==s.join(`
`)&&(q=J=K(q.line,0)));var ee={from:q,to:J,text:f?f[E%f.length]:s,origin:i||(l?"paste":e.state.cutIncoming>a?"cut":"+input")};Zr(e.doc,ee),Ve(e,"inputRead",e,ee)}t&&!l&&sl(e,t),qr(e),e.curOp.updateInput<2&&(e.curOp.updateInput=k),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ll(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()&&St(t,function(){return lo(t,n,0,null,"paste")}),!0}function sl(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var l=0;l<o.electricChars.length;l++)if(t.indexOf(o.electricChars.charAt(l))>-1){a=Wn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(ue(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Wn(e,i.head.line,"smart"));a&&Ve(e,"electricInput",e,i.head.line)}}}function ul(e){for(var t=[],n=[],r=0;r<e.doc.sel.ranges.length;r++){var i=e.doc.sel.ranges[r].head.line,o={anchor:K(i,0),head:K(i+1,0)};n.push(o),t.push(e.getRange(o.anchor,o.head))}return{text:t,ranges:n}}function so(e,t,n,r){e.setAttribute("autocorrect",n?"on":"off"),e.setAttribute("autocapitalize",r?"on":"off"),e.setAttribute("spellcheck",!!t)}function fl(){var e=c("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none"),t=c("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return T?e.style.width="1000px":e.setAttribute("wrap","off"),v&&(e.style.border="1px solid black"),t}function Tu(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){me(this).focus(),this.display.input.focus()},setOption:function(r,i){var o=this.options,a=o[r];o[r]==i&&r!="mode"||(o[r]=i,t.hasOwnProperty(r)&&$e(this,t[r])(this,i,a),Re(this,"optionChange",this,r))},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,i){this.state.keyMaps[i?"push":"unshift"](fi(r))},removeKeyMap:function(r){for(var i=this.state.keyMaps,o=0;o<i.length;++o)if(i[o]==r||i[o].name==r)return i.splice(o,1),!0},addOverlay:ct(function(r,i){var o=r.token?r:e.getMode(this.options,r);if(o.startState)throw new Error("Overlays may not be stateful.");R(this.state.overlays,{mode:o,modeSpec:r,opaque:i&&i.opaque,priority:i&&i.priority||0},function(a){return a.priority}),this.state.modeGen++,mt(this)}),removeOverlay:ct(function(r){for(var i=this.state.overlays,o=0;o<i.length;++o){var a=i[o].modeSpec;if(a==r||typeof r=="string"&&a.name==r){i.splice(o,1),this.state.modeGen++,mt(this);return}}}),indentLine:ct(function(r,i,o){typeof i!="string"&&typeof i!="number"&&(i==null?i=this.options.smartIndent?"smart":"prev":i=i?"add":"subtract"),Y(this.doc,r)&&Wn(this,r,i,o)}),indentSelection:ct(function(r){for(var i=this.doc.sel.ranges,o=-1,a=0;a<i.length;a++){var l=i[a];if(l.empty())l.head.line>o&&(Wn(this,l.head.line,r,!0),o=l.head.line,a==this.doc.sel.primIndex&&qr(this));else{var s=l.from(),f=l.to(),b=Math.max(o,s.line);o=Math.min(this.lastLine(),f.line-(f.ch?0:1))+1;for(var k=b;k<o;++k)Wn(this,k,r);var E=this.doc.sel.ranges;s.ch==0&&i.length==E.length&&E[a].from().ch>0&&$i(this.doc,a,new Ne(s,E[a].to()),dt)}}}),getTokenAt:function(r,i){return xo(this,r,i)},getLineTokens:function(r,i){return xo(this,K(r),i,!0)},getTokenTypeAt:function(r){r=ye(this.doc,r);var i=mo(this,ue(this.doc,r.line)),o=0,a=(i.length-1)/2,l=r.ch,s;if(l==0)s=i[2];else for(;;){var f=o+a>>1;if((f?i[f*2-1]:0)>=l)a=f;else if(i[f*2+1]<l)o=f+1;else{s=i[f*2+2];break}}var b=s?s.indexOf("overlay "):-1;return b<0?s:b==0?null:s.slice(0,b-1)},getModeAt:function(r){var i=this.doc.mode;return i.innerMode?e.innerMode(i,this.getTokenAt(r).state).mode:i},getHelper:function(r,i){return this.getHelpers(r,i)[0]},getHelpers:function(r,i){var o=[];if(!n.hasOwnProperty(i))return o;var a=n[i],l=this.getModeAt(r);if(typeof l[i]=="string")a[l[i]]&&o.push(a[l[i]]);else if(l[i])for(var s=0;s<l[i].length;s++){var f=a[l[i][s]];f&&o.push(f)}else l.helperType&&a[l.helperType]?o.push(a[l.helperType]):a[l.name]&&o.push(a[l.name]);for(var b=0;b<a._global.length;b++){var k=a._global[b];k.pred(l,this)&&he(o,k.val)==-1&&o.push(k.val)}return o},getStateAfter:function(r,i){var o=this.doc;return r=po(o,r??o.first+o.size-1),un(this,r+1,i).state},cursorCoords:function(r,i){var o,a=this.doc.sel.primary();return r==null?o=a.head:typeof r=="object"?o=ye(this.doc,r):o=r?a.from():a.to(),Ht(this,o,i||"page")},charCoords:function(r,i){return Zn(this,ye(this.doc,r),i||"page")},coordsChar:function(r,i){return r=Zo(this,r,i||"page"),Di(this,r.left,r.top)},lineAtHeight:function(r,i){return r=Zo(this,{top:r,left:0},i||"page").top,x(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,i,o){var a=!1,l;if(typeof r=="number"){var s=this.doc.first+this.doc.size-1;r<this.doc.first?r=this.doc.first:r>s&&(r=s,a=!0),l=ue(this.doc,r)}else l=r;return Yn(this,l,{top:0,left:0},i||"page",o||a).top+(a?this.doc.height-Vt(l):0)},defaultTextHeight:function(){return _r(this.display)},defaultCharWidth:function(){return Ur(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,i,o,a,l){var s=this.display;r=Ht(this,ye(this.doc,r));var f=r.bottom,b=r.left;if(i.style.position="absolute",i.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(i),s.sizer.appendChild(i),a=="over")f=r.top;else if(a=="above"||a=="near"){var k=Math.max(s.wrapper.clientHeight,this.doc.height),E=Math.max(s.sizer.clientWidth,s.lineSpace.clientWidth);(a=="above"||r.bottom+i.offsetHeight>k)&&r.top>i.offsetHeight?f=r.top-i.offsetHeight:r.bottom+i.offsetHeight<=k&&(f=r.bottom),b+i.offsetWidth>E&&(b=E-i.offsetWidth)}i.style.top=f+"px",i.style.left=i.style.right="",l=="right"?(b=s.sizer.clientWidth-i.offsetWidth,i.style.right="0px"):(l=="left"?b=0:l=="middle"&&(b=(s.sizer.clientWidth-i.offsetWidth)/2),i.style.left=b+"px"),o&&Ss(this,{left:b,top:f,right:b+i.offsetWidth,bottom:f+i.offsetHeight})},triggerOnKeyDown:ct(Va),triggerOnKeyPress:ct(el),triggerOnKeyUp:$a,triggerOnMouseDown:ct(tl),execCommand:function(r){if(Mn.hasOwnProperty(r))return Mn[r].call(null,this)},triggerElectric:ct(function(r){sl(this,r)}),findPosH:function(r,i,o,a){var l=1;i<0&&(l=-1,i=-i);for(var s=ye(this.doc,r),f=0;f<i&&(s=uo(this.doc,s,l,o,a),!s.hitSide);++f);return s},moveH:ct(function(r,i){var o=this;this.extendSelectionsBy(function(a){return o.display.shift||o.doc.extend||a.empty()?uo(o.doc,a.head,r,i,o.options.rtlMoveVisually):r<0?a.from():a.to()},Ae)}),deleteH:ct(function(r,i){var o=this.doc.sel,a=this.doc;o.somethingSelected()?a.replaceSelection("",null,"+delete"):$r(this,function(l){var s=uo(a,l.head,r,i,!1);return r<0?{from:s,to:l.head}:{from:l.head,to:s}})}),findPosV:function(r,i,o,a){var l=1,s=a;i<0&&(l=-1,i=-i);for(var f=ye(this.doc,r),b=0;b<i;++b){var k=Ht(this,f,"div");if(s==null?s=k.left:k.left=s,f=cl(this,k,l,o),f.hitSide)break}return f},moveV:ct(function(r,i){var o=this,a=this.doc,l=[],s=!this.display.shift&&!a.extend&&a.sel.somethingSelected();if(a.extendSelectionsBy(function(b){if(s)return r<0?b.from():b.to();var k=Ht(o,b.head,"div");b.goalColumn!=null&&(k.left=b.goalColumn),l.push(k.left);var E=cl(o,k,r,i);return i=="page"&&b==a.sel.primary()&&_i(o,Zn(o,E,"div").top-k.top),E},Ae),l.length)for(var f=0;f<a.sel.ranges.length;f++)a.sel.ranges[f].goalColumn=l[f]}),findWordAt:function(r){var i=this.doc,o=ue(i,r.line).text,a=r.ch,l=r.ch;if(o){var s=this.getHelper(r,"wordChars");(r.sticky=="before"||l==o.length)&&a?--a:++l;for(var f=o.charAt(a),b=jt(f,s)?function(k){return jt(k,s)}:/\s/.test(f)?function(k){return/\s/.test(k)}:function(k){return!/\s/.test(k)&&!jt(k)};a>0&&b(o.charAt(a-1));)--a;for(;l<o.length&&b(o.charAt(l));)++l}return new Ne(K(r.line,a),K(r.line,l))},toggleOverwrite:function(r){r!=null&&r==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?ce(this.display.cursorDiv,"CodeMirror-overwrite"):U(this.display.cursorDiv,"CodeMirror-overwrite"),Re(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==fe(Ge(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:ct(function(r,i){gn(this,r,i)}),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Gt(this)-this.display.barHeight,width:r.scrollWidth-Gt(this)-this.display.barWidth,clientHeight:Oi(this),clientWidth:kr(this)}},scrollIntoView:ct(function(r,i){r==null?(r={from:this.doc.sel.primary().head,to:null},i==null&&(i=this.options.cursorScrollMargin)):typeof r=="number"?r={from:K(r,0),to:null}:r.from==null&&(r={from:r,to:null}),r.to||(r.to=r.from),r.margin=i||0,r.from.line!=null?Cs(this,r):ia(this,r.from,r.to,r.margin)}),setSize:ct(function(r,i){var o=this,a=function(s){return typeof s=="number"||/^\d+$/.test(String(s))?s+"px":s};r!=null&&(this.display.wrapper.style.width=a(r)),i!=null&&(this.display.wrapper.style.height=a(i)),this.options.lineWrapping&&Xo(this);var l=this.display.viewFrom;this.doc.iter(l,this.display.viewTo,function(s){if(s.widgets){for(var f=0;f<s.widgets.length;f++)if(s.widgets[f].noHScroll){cr(o,l,"widget");break}}++l}),this.curOp.forceUpdate=!0,Re(this,"refresh",this)}),operation:function(r){return St(this,r)},startOperation:function(){return Ar(this)},endOperation:function(){return Or(this)},refresh:ct(function(){var r=this.display.cachedTextHeight;mt(this),this.curOp.forceUpdate=!0,pn(this),gn(this,this.doc.scrollLeft,this.doc.scrollTop),qi(this.display),(r==null||Math.abs(r-_r(this.display))>.5||this.options.lineWrapping)&&Ii(this),Re(this,"refresh",this)}),swapDoc:ct(function(r){var i=this.doc;return i.cm=null,this.state.selectingText&&this.state.selectingText(),ya(this,r),pn(this),this.display.input.reset(),gn(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Ve(this,"swapDoc",this,i),i}),phrase:function(r){var i=this.options.phrases;return i&&Object.prototype.hasOwnProperty.call(i,r)?i[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Dt(e),e.registerHelper=function(r,i,o){n.hasOwnProperty(r)||(n[r]=e[r]={_global:[]}),n[r][i]=o},e.registerGlobalHelper=function(r,i,o,a){e.registerHelper(r,i,a),n[r]._global.push({pred:o,val:a})}}function uo(e,t,n,r,i){var o=t,a=n,l=ue(e,t.line),s=i&&e.direction=="rtl"?-n:n;function f(){var le=t.line+s;return le<e.first||le>=e.first+e.size?!1:(t=new K(le,t.ch,t.sticky),l=ue(e,le))}function b(le){var oe;if(r=="codepoint"){var se=l.text.charCodeAt(t.ch+(n>0?0:-1));if(isNaN(se))oe=null;else{var ve=n>0?se>=55296&&se<56320:se>=56320&&se<57343;oe=new K(t.line,Math.max(0,Math.min(l.text.length,t.ch+n*(ve?2:1))),-n)}}else i?oe=lu(e.cm,l,t,n):oe=to(l,t,n);if(oe==null)if(!le&&f())t=ro(i,e.cm,l,t.line,s);else return!1;else t=oe;return!0}if(r=="char"||r=="codepoint")b();else if(r=="column")b(!0);else if(r=="word"||r=="group")for(var k=null,E=r=="group",P=e.cm&&e.cm.getHelper(t,"wordChars"),q=!0;!(n<0&&!b(!q));q=!1){var J=l.text.charAt(t.ch)||`
`,ee=jt(J,P)?"w":E&&J==`
`?"n":!E||/\s/.test(J)?null:"p";if(E&&!q&&!ee&&(ee="s"),k&&k!=ee){n<0&&(n=1,b(),t.sticky="after");break}if(ee&&(k=ee),n>0&&!b(!q))break}var ie=li(e,t,o,a,!0);return Oe(o,ie)&&(ie.hitSide=!0),ie}function cl(e,t,n,r){var i=e.doc,o=t.left,a;if(r=="page"){var l=Math.min(e.display.wrapper.clientHeight,me(e).innerHeight||i(e).documentElement.clientHeight),s=Math.max(l-.5*_r(e.display),3);a=(n>0?t.bottom:t.top)+n*s}else r=="line"&&(a=n>0?t.bottom+3:t.top-3);for(var f;f=Di(e,o,a),!!f.outside;){if(n<0?a<=0:a>=i.height){f.hitSide=!0;break}a+=n*5}return f}var Pe=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new be,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Pe.prototype.init=function(e){var t=this,n=this,r=n.cm,i=n.div=e.lineDiv;i.contentEditable=!0,so(i,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function o(l){for(var s=l.target;s;s=s.parentNode){if(s==i)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(s.className))break}return!1}pe(i,"paste",function(l){!o(l)||Ke(r,l)||ll(l,r)||_<=11&&setTimeout($e(r,function(){return t.updateFromDOM()}),20)}),pe(i,"compositionstart",function(l){t.composing={data:l.data,done:!1}}),pe(i,"compositionupdate",function(l){t.composing||(t.composing={data:l.data,done:!1})}),pe(i,"compositionend",function(l){t.composing&&(l.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),pe(i,"touchstart",function(){return n.forceCompositionEnd()}),pe(i,"input",function(){t.composing||t.readFromDOMSoon()});function a(l){if(!(!o(l)||Ke(r,l))){if(r.somethingSelected())di({lineWise:!1,text:r.getSelections()}),l.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var s=ul(r);di({lineWise:!0,text:s.text}),l.type=="cut"&&r.operation(function(){r.setSelections(s.ranges,0,dt),r.replaceSelection("",null,"cut")})}else return;if(l.clipboardData){l.clipboardData.clearData();var f=Rt.text.join(`
`);if(l.clipboardData.setData("Text",f),l.clipboardData.getData("Text")==f){l.preventDefault();return}}var b=fl(),k=b.firstChild;so(k),r.display.lineSpace.insertBefore(b,r.display.lineSpace.firstChild),k.value=Rt.text.join(`
`);var E=fe(Ee(i));Be(k),setTimeout(function(){r.display.lineSpace.removeChild(b),E.focus(),E==i&&n.showPrimarySelection()},50)}}pe(i,"copy",a),pe(i,"cut",a)},Pe.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Pe.prototype.prepareSelection=function(){var e=ta(this.cm,!1);return e.focus=fe(Ee(this.div))==this.div,e},Pe.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},Pe.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Pe.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,n=t.doc.sel.primary(),r=n.from(),i=n.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||i.line<t.display.viewFrom){e.removeAllRanges();return}var o=pi(t,e.anchorNode,e.anchorOffset),a=pi(t,e.focusNode,e.focusOffset);if(!(o&&!o.bad&&a&&!a.bad&&ae(Hr(o,a),r)==0&&ae(gt(o,a),i)==0)){var l=t.display.view,s=r.line>=t.display.viewFrom&&hl(t,r)||{node:l[0].measure.map[2],offset:0},f=i.line<t.display.viewTo&&hl(t,i);if(!f){var b=l[l.length-1].measure,k=b.maps?b.maps[b.maps.length-1]:b.map;f={node:k[k.length-1],offset:k[k.length-2]-k[k.length-3]}}if(!s||!f){e.removeAllRanges();return}var E=e.rangeCount&&e.getRangeAt(0),P;try{P=j(s.node,s.offset,f.offset,f.node)}catch{}P&&(!z&&t.state.focused?(e.collapse(s.node,s.offset),P.collapsed||(e.removeAllRanges(),e.addRange(P))):(e.removeAllRanges(),e.addRange(P)),E&&e.anchorNode==null?e.addRange(E):z&&this.startGracePeriod()),this.rememberSelection()}},Pe.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)},Pe.prototype.showMultipleSelections=function(e){G(this.cm.display.cursorDiv,e.cursors),G(this.cm.display.selectionDiv,e.selection)},Pe.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Pe.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return ne(this.div,t)},Pe.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||fe(Ee(this.div))!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Pe.prototype.blur=function(){this.div.blur()},Pe.prototype.getField=function(){return this.div},Pe.prototype.supportsTouch=function(){return!0},Pe.prototype.receivedFocus=function(){var e=this,t=this;this.selectionInEditor()?setTimeout(function(){return e.pollSelection()},20):St(this.cm,function(){return t.cm.curOp.selectionChanged=!0});function n(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},Pe.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Pe.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var e=this.getSelection(),t=this.cm;if(g&&C&&this.cm.display.gutterSpecs.length&&Au(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var n=pi(t,e.anchorNode,e.anchorOffset),r=pi(t,e.focusNode,e.focusOffset);n&&r&&St(t,function(){ut(t.doc,dr(n,r),dt),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}}},Pe.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.ch==0&&r.line>e.firstLine()&&(r=K(r.line-1,ue(e.doc,r.line-1).length)),i.ch==ue(e.doc,i.line).text.length&&i.line<e.lastLine()&&(i=K(i.line+1,0)),r.line<t.viewFrom||i.line>t.viewTo-1)return!1;var o,a,l;r.line==t.viewFrom||(o=Cr(e,r.line))==0?(a=h(t.view[0].line),l=t.view[0].node):(a=h(t.view[o].line),l=t.view[o-1].node.nextSibling);var s=Cr(e,i.line),f,b;if(s==t.view.length-1?(f=t.viewTo-1,b=t.lineDiv.lastChild):(f=h(t.view[s+1].line)-1,b=t.view[s+1].node.previousSibling),!l)return!1;for(var k=e.doc.splitLines(Ou(e,l,b,a,f)),E=Qt(e.doc,K(a,0),K(f,ue(e.doc,f).text.length));k.length>1&&E.length>1;)if(Ce(k)==Ce(E))k.pop(),E.pop(),f--;else if(k[0]==E[0])k.shift(),E.shift(),a++;else break;for(var P=0,q=0,J=k[0],ee=E[0],ie=Math.min(J.length,ee.length);P<ie&&J.charCodeAt(P)==ee.charCodeAt(P);)++P;for(var le=Ce(k),oe=Ce(E),se=Math.min(le.length-(k.length==1?P:0),oe.length-(E.length==1?P:0));q<se&&le.charCodeAt(le.length-q-1)==oe.charCodeAt(oe.length-q-1);)++q;if(k.length==1&&E.length==1&&a==r.line)for(;P&&P>r.ch&&le.charCodeAt(le.length-q-1)==oe.charCodeAt(oe.length-q-1);)P--,q++;k[k.length-1]=le.slice(0,le.length-q).replace(/^\u200b+/,""),k[0]=k[0].slice(P).replace(/\u200b+$/,"");var ve=K(a,P),de=K(f,E.length?Ce(E).length-q:0);if(k.length>1||k[0]||ae(ve,de))return Qr(e.doc,k,ve,de,"+input"),!0},Pe.prototype.ensurePolled=function(){this.forceCompositionEnd()},Pe.prototype.reset=function(){this.forceCompositionEnd()},Pe.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Pe.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))},Pe.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&St(this.cm,function(){return mt(e.cm)})},Pe.prototype.setUneditable=function(e){e.contentEditable="false"},Pe.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||$e(this.cm,lo)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},Pe.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Pe.prototype.onContextMenu=function(){},Pe.prototype.resetPosition=function(){},Pe.prototype.needsContentAttribute=!0;function hl(e,t){var n=Ni(e,t.line);if(!n||n.hidden)return null;var r=ue(e.doc,t.line),i=Ko(n,r,t.line),o=Se(r,e.doc.direction),a="left";if(o){var l=or(o,t.ch);a=l%2?"right":"left"}var s=Go(i.map,t.ch,a);return s.offset=s.collapse=="right"?s.end:s.start,s}function Au(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function tn(e,t){return t&&(e.bad=!0),e}function Ou(e,t,n,r,i){var o="",a=!1,l=e.doc.lineSeparator(),s=!1;function f(P){return function(q){return q.id==P}}function b(){a&&(o+=l,s&&(o+=l),a=s=!1)}function k(P){P&&(b(),o+=P)}function E(P){if(P.nodeType==1){var q=P.getAttribute("cm-text");if(q){k(q);return}var J=P.getAttribute("cm-marker"),ee;if(J){var ie=e.findMarks(K(r,0),K(i+1,0),f(+J));ie.length&&(ee=ie[0].find(0))&&k(Qt(e.doc,ee.from,ee.to).join(l));return}if(P.getAttribute("contenteditable")=="false")return;var le=/^(pre|div|p|li|table|br)$/i.test(P.nodeName);if(!/^br$/i.test(P.nodeName)&&P.textContent.length==0)return;le&&b();for(var oe=0;oe<P.childNodes.length;oe++)E(P.childNodes[oe]);/^(pre|p)$/i.test(P.nodeName)&&(s=!0),le&&(a=!0)}else P.nodeType==3&&k(P.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;E(t),t!=n;)t=t.nextSibling,s=!1;return o}function pi(e,t,n){var r;if(t==e.display.lineDiv){if(r=e.display.lineDiv.childNodes[n],!r)return tn(e.clipPos(K(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i<e.display.view.length;i++){var o=e.display.view[i];if(o.node==r)return Nu(o,t,n)}}function Nu(e,t,n){var r=e.text.firstChild,i=!1;if(!t||!ne(r,t))return tn(K(h(e.line),0),!0);if(t==r&&(i=!0,t=r.childNodes[n],n=0,!t)){var o=e.rest?Ce(e.rest):e.line;return tn(K(h(o),o.text.length),i)}var a=t.nodeType==3?t:null,l=t;for(!a&&t.childNodes.length==1&&t.firstChild.nodeType==3&&(a=t.firstChild,n&&(n=a.nodeValue.length));l.parentNode!=r;)l=l.parentNode;var s=e.measure,f=s.maps;function b(ee,ie,le){for(var oe=-1;oe<(f?f.length:0);oe++)for(var se=oe<0?s.map:f[oe],ve=0;ve<se.length;ve+=3){var de=se[ve+2];if(de==ee||de==ie){var ke=h(oe<0?e.line:e.rest[oe]),Fe=se[ve]+le;return(le<0||de!=ee)&&(Fe=se[ve+(le?1:0)]),K(ke,Fe)}}}var k=b(a,l,n);if(k)return tn(k,i);for(var E=l.nextSibling,P=a?a.nodeValue.length-n:0;E;E=E.nextSibling){if(k=b(E,E.firstChild,0),k)return tn(K(k.line,k.ch-P),i);P+=E.textContent.length}for(var q=l.previousSibling,J=n;q;q=q.previousSibling){if(k=b(q,q.firstChild,-1),k)return tn(K(k.line,k.ch+J),i);J+=q.textContent.length}}var qe=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new be,this.hasSelection=!1,this.composing=null,this.resetting=!1};qe.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),v&&(i.style.width="0px"),pe(i,"input",function(){D&&_>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()}),pe(i,"paste",function(a){Ke(r,a)||ll(a,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())});function o(a){if(!Ke(r,a)){if(r.somethingSelected())di({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var l=ul(r);di({lineWise:!0,text:l.text}),a.type=="cut"?r.setSelections(l.ranges,null,dt):(n.prevInput="",i.value=l.text.join(`
`),Be(i))}else return;a.type=="cut"&&(r.state.cutIncoming=+new Date)}}pe(i,"cut",o),pe(i,"copy",o),pe(e.scroller,"paste",function(a){if(!($t(e,a)||Ke(r,a))){if(!i.dispatchEvent){r.state.pasteIncoming=+new Date,n.focus();return}var l=new Event("paste");l.clipboardData=a.clipboardData,i.dispatchEvent(l)}}),pe(e.lineSpace,"selectstart",function(a){$t(e,a)||st(a)}),pe(i,"compositionstart",function(){var a=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:a,range:r.markText(a,r.getCursor("to"),{className:"CodeMirror-composing"})}}),pe(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},qe.prototype.createField=function(e){this.wrapper=fl(),this.textarea=this.wrapper.firstChild;var t=this.cm.options;so(this.textarea,t.spellcheck,t.autocorrect,t.autocapitalize)},qe.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},qe.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=ta(e);if(e.options.moveInputWithCursor){var i=Ht(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},qe.prototype.showSelection=function(e){var t=this.cm,n=t.display;G(n.cursorDiv,e.cursors),G(n.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},qe.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing&&e)){var t=this.cm;if(this.resetting=!0,t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&Be(this.textarea),D&&_>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",D&&_>=9&&(this.hasSelection=null));this.resetting=!1}},qe.prototype.getField=function(){return this.textarea},qe.prototype.supportsTouch=function(){return!1},qe.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!u||fe(Ee(this.textarea))!=this.textarea))try{this.textarea.focus()}catch{}},qe.prototype.blur=function(){this.textarea.blur()},qe.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},qe.prototype.receivedFocus=function(){this.slowPoll()},qe.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},qe.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function n(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,n)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,n)},qe.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||sr(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(D&&_>=9&&this.hasSelection===i||p&&/[\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&&!r&&(r="​"),o==8666)return this.reset(),this.cm.execCommand("undo")}for(var a=0,l=Math.min(r.length,i.length);a<l&&r.charCodeAt(a)==i.charCodeAt(a);)++a;return St(t,function(){lo(t,i.slice(a),r.length-a,null,e.composing?"*compose":null),i.length>1e3||i.indexOf(`
`)>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},qe.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},qe.prototype.onKeyPress=function(){D&&_>=9&&(this.hasSelection=null),this.fastPoll()},qe.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=Sr(n,e),a=r.scroller.scrollTop;if(!o||W)return;var l=n.options.resetSelectionOnContextMenu;l&&n.doc.sel.contains(o)==-1&&$e(n,ut)(n.doc,dr(o),dt);var s=i.style.cssText,f=t.wrapper.style.cssText,b=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",i.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-b.top-5)+"px; left: "+(e.clientX-b.left-5)+`px;
z-index: 1000; background: `+(D?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var k;T&&(k=i.ownerDocument.defaultView.scrollY),r.input.focus(),T&&i.ownerDocument.defaultView.scrollTo(null,k),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=P,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll);function E(){if(i.selectionStart!=null){var J=n.somethingSelected(),ee="​"+(J?i.value:"");i.value="⇚",i.value=ee,t.prevInput=J?"":"​",i.selectionStart=1,i.selectionEnd=ee.length,r.selForContextMenu=n.doc.sel}}function P(){if(t.contextMenuPending==P&&(t.contextMenuPending=!1,t.wrapper.style.cssText=f,i.style.cssText=s,D&&_<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=a),i.selectionStart!=null)){(!D||D&&_<9)&&E();var J=0,ee=function(){r.selForContextMenu==n.doc.sel&&i.selectionStart==0&&i.selectionEnd>0&&t.prevInput=="​"?$e(n,Ma)(n):J++<10?r.detectingSelectAll=setTimeout(ee,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(ee,200)}}if(D&&_>=9&&E(),F){ar(e);var q=function(){lt(window,"mouseup",q),setTimeout(P,20)};pe(window,"mouseup",q)}else setTimeout(P,50)},qe.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},qe.prototype.setUneditable=function(){},qe.prototype.needsContentAttribute=!1;function Pu(e,t){if(t=t?xe(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var n=fe(Ee(e));t.autofocus=n==e||e.getAttribute("autofocus")!=null&&n==document.body}function r(){e.value=l.getValue()}var i;if(e.form&&(pe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch{}}t.finishInit=function(s){s.save=r,s.getTextArea=function(){return e},s.toTextArea=function(){s.toTextArea=isNaN,r(),e.parentNode.removeChild(s.getWrapperElement()),e.style.display="",e.form&&(lt(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=i))}},e.style.display="none";var l=He(function(s){return e.parentNode.insertBefore(s,e.nextSibling)},t);return l}function Mu(e){e.off=lt,e.on=pe,e.wheelEventPixels=Hs,e.Doc=yt,e.splitLines=Pt,e.countColumn=Le,e.findColumn=Xe,e.isWordChar=at,e.Pass=Mt,e.signal=Re,e.Line=zr,e.changeEnd=pr,e.scrollbarModel=la,e.Pos=K,e.cmpPos=ae,e.modes=Fr,e.mimeModes=Wt,e.resolveMode=Er,e.getMode=Wr,e.modeExtensions=ur,e.extendMode=Ir,e.copyState=_t,e.startState=Br,e.innerMode=ln,e.commands=Mn,e.keyMap=tr,e.keyName=ja,e.isModifierKey=qa,e.lookupKey=Vr,e.normalizeKeyMap=au,e.StringStream=_e,e.SharedTextMarker=On,e.TextMarker=gr,e.LineWidget=An,e.e_preventDefault=st,e.e_stopPropagation=Mr,e.e_stop=ar,e.addClass=ce,e.contains=ne,e.rmClass=U,e.keyNames=mr}wu(He),Tu(He);var Du="iter insert remove copy getEditor constructor".split(" ");for(var vi in yt.prototype)yt.prototype.hasOwnProperty(vi)&&he(Du,vi)<0&&(He.prototype[vi]=function(e){return function(){return e.apply(this.doc,arguments)}}(yt.prototype[vi]));return Dt(yt),He.inputStyles={textarea:qe,contenteditable:Pe},He.defineMode=function(e){!He.defaults.mode&&e!="null"&&(He.defaults.mode=e),It.apply(this,arguments)},He.defineMIME=xr,He.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),He.defineMIME("text/plain","null"),He.defineExtension=function(e,t){He.prototype[e]=t},He.defineDocExtension=function(e,t){yt.prototype[e]=t},He.fromTextArea=Pu,Mu(He),He.version="5.65.18",He})})(Ml);var nt=Ml.exports;const ju=Xu(nt);var Yu={exports:{}};(function(We,Ie){(function(y){y(nt)})(function(y){y.defineMode("javascript",function(H,z){var V=H.indentUnit,re=z.statementIndent,I=z.jsonld,D=z.json||I,_=z.trackScope!==!1,T=z.typescript,B=z.wordCharacters||/[\w$\xa1-\uffff]/,C=function(){function h(Je){return{type:Je,style:"keyword"}}var x=h("keyword a"),Y=h("keyword b"),$=h("keyword c"),K=h("keyword d"),ae=h("operator"),Oe={type:"atom",style:"atom"};return{if:h("if"),while:x,with:x,else:Y,do:Y,try:Y,finally:Y,return:K,break:K,continue:K,new:h("new"),delete:$,void:$,throw:$,debugger:h("debugger"),var:h("var"),const:h("var"),let:h("var"),function:h("function"),catch:h("catch"),for:h("for"),switch:h("switch"),case:h("case"),default:h("default"),in:ae,typeof:ae,instanceof:ae,true:Oe,false:Oe,null:Oe,undefined:Oe,NaN:Oe,Infinity:Oe,this:h("this"),class:h("class"),super:h("atom"),yield:$,export:h("export"),import:h("import"),extends:$,await:$}}(),M=/[+\-*&%=<>!?|~^@]/,W=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function Z(h){for(var x=!1,Y,$=!1;(Y=h.next())!=null;){if(!x){if(Y=="/"&&!$)return;Y=="["?$=!0:$&&Y=="]"&&($=!1)}x=!x&&Y=="\\"}}var O,S;function v(h,x,Y){return O=h,S=Y,x}function g(h,x){var Y=h.next();if(Y=='"'||Y=="'")return x.tokenize=u(Y),x.tokenize(h,x);if(Y=="."&&h.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return v("number","number");if(Y=="."&&h.match(".."))return v("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(Y))return v(Y);if(Y=="="&&h.eat(">"))return v("=>","operator");if(Y=="0"&&h.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return v("number","number");if(/\d/.test(Y))return h.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),v("number","number");if(Y=="/")return h.eat("*")?(x.tokenize=p,p(h,x)):h.eat("/")?(h.skipToEnd(),v("comment","comment")):At(h,x,1)?(Z(h),h.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),v("regexp","string-2")):(h.eat("="),v("operator","operator",h.current()));if(Y=="`")return x.tokenize=m,m(h,x);if(Y=="#"&&h.peek()=="!")return h.skipToEnd(),v("meta","meta");if(Y=="#"&&h.eatWhile(B))return v("variable","property");if(Y=="<"&&h.match("!--")||Y=="-"&&h.match("->")&&!/\S/.test(h.string.slice(0,h.start)))return h.skipToEnd(),v("comment","comment");if(M.test(Y))return(Y!=">"||!x.lexical||x.lexical.type!=">")&&(h.eat("=")?(Y=="!"||Y=="=")&&h.eat("="):/[<>*+\-|&?]/.test(Y)&&(h.eat(Y),Y==">"&&h.eat(Y))),Y=="?"&&h.eat(".")?v("."):v("operator","operator",h.current());if(B.test(Y)){h.eatWhile(B);var $=h.current();if(x.lastType!="."){if(C.propertyIsEnumerable($)){var K=C[$];return v(K.type,K.style,$)}if($=="async"&&h.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return v("async","keyword",$)}return v("variable","variable",$)}}function u(h){return function(x,Y){var $=!1,K;if(I&&x.peek()=="@"&&x.match(W))return Y.tokenize=g,v("jsonld-keyword","meta");for(;(K=x.next())!=null&&!(K==h&&!$);)$=!$&&K=="\\";return $||(Y.tokenize=g),v("string","string")}}function p(h,x){for(var Y=!1,$;$=h.next();){if($=="/"&&Y){x.tokenize=g;break}Y=$=="*"}return v("comment","comment")}function m(h,x){for(var Y=!1,$;($=h.next())!=null;){if(!Y&&($=="`"||$=="$"&&h.eat("{"))){x.tokenize=g;break}Y=!Y&&$=="\\"}return v("quasi","string-2",h.current())}var w="([{}])";function d(h,x){x.fatArrowAt&&(x.fatArrowAt=null);var Y=h.string.indexOf("=>",h.start);if(!(Y<0)){if(T){var $=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(h.string.slice(h.start,Y));$&&(Y=$.index)}for(var K=0,ae=!1,Oe=Y-1;Oe>=0;--Oe){var Je=h.string.charAt(Oe),gt=w.indexOf(Je);if(gt>=0&&gt<3){if(!K){++Oe;break}if(--K==0){Je=="("&&(ae=!0);break}}else if(gt>=3&&gt<6)++K;else if(B.test(Je))ae=!0;else if(/["'\/`]/.test(Je))for(;;--Oe){if(Oe==0)return;var Hr=h.string.charAt(Oe-1);if(Hr==Je&&h.string.charAt(Oe-2)!="\\"){Oe--;break}}else if(ae&&!K){++Oe;break}}ae&&!K&&(x.fatArrowAt=Oe)}}var L={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function F(h,x,Y,$,K,ae){this.indented=h,this.column=x,this.type=Y,this.prev=K,this.info=ae,$!=null&&(this.align=$)}function N(h,x){if(!_)return!1;for(var Y=h.localVars;Y;Y=Y.next)if(Y.name==x)return!0;for(var $=h.context;$;$=$.prev)for(var Y=$.vars;Y;Y=Y.next)if(Y.name==x)return!0}function U(h,x,Y,$,K){var ae=h.cc;for(A.state=h,A.stream=K,A.marked=null,A.cc=ae,A.style=x,h.lexical.hasOwnProperty("align")||(h.lexical.align=!0);;){var Oe=ae.length?ae.pop():D?he:Le;if(Oe(Y,$)){for(;ae.length&&ae[ae.length-1].lex;)ae.pop()();return A.marked?A.marked:Y=="variable"&&N(h,$)?"variable-2":x}}}var A={state:null,column:null,marked:null,cc:null};function G(){for(var h=arguments.length-1;h>=0;h--)A.cc.push(arguments[h])}function c(){return G.apply(null,arguments),!0}function Q(h,x){for(var Y=x;Y;Y=Y.next)if(Y.name==h)return!0;return!1}function j(h){var x=A.state;if(A.marked="def",!!_){if(x.context){if(x.lexical.info=="var"&&x.context&&x.context.block){var Y=ne(h,x.context);if(Y!=null){x.context=Y;return}}else if(!Q(h,x.localVars)){x.localVars=new we(h,x.localVars);return}}z.globalVars&&!Q(h,x.globalVars)&&(x.globalVars=new we(h,x.globalVars))}}function ne(h,x){if(x)if(x.block){var Y=ne(h,x.prev);return Y?Y==x.prev?x:new ce(Y,x.vars,!0):null}else return Q(h,x.vars)?x:new ce(x.prev,new we(h,x.vars),!1);else return null}function fe(h){return h=="public"||h=="private"||h=="protected"||h=="abstract"||h=="readonly"}function ce(h,x,Y){this.prev=h,this.vars=x,this.block=Y}function we(h,x){this.name=h,this.next=x}var Be=new we("this",new we("arguments",null));function Me(){A.state.context=new ce(A.state.context,A.state.localVars,!1),A.state.localVars=Be}function Ge(){A.state.context=new ce(A.state.context,A.state.localVars,!0),A.state.localVars=null}Me.lex=Ge.lex=!0;function Ee(){A.state.localVars=A.state.context.vars,A.state.context=A.state.context.prev}Ee.lex=!0;function me(h,x){var Y=function(){var $=A.state,K=$.indented;if($.lexical.type=="stat")K=$.lexical.indented;else for(var ae=$.lexical;ae&&ae.type==")"&&ae.align;ae=ae.prev)K=ae.indented;$.lexical=new F(K,A.stream.column(),h,null,$.lexical,x)};return Y.lex=!0,Y}function ge(){var h=A.state;h.lexical.prev&&(h.lexical.type==")"&&(h.indented=h.lexical.indented),h.lexical=h.lexical.prev)}ge.lex=!0;function xe(h){function x(Y){return Y==h?c():h==";"||Y=="}"||Y==")"||Y=="]"?G():c(x)}return x}function Le(h,x){return h=="var"?c(me("vardef",x),Mr,xe(";"),ge):h=="keyword a"?c(me("form"),Mt,Le,ge):h=="keyword b"?c(me("form"),Le,ge):h=="keyword d"?A.stream.match(/^\s*$/,!1)?c():c(me("stat"),Lt,xe(";"),ge):h=="debugger"?c(xe(";")):h=="{"?c(me("}"),Ge,Kt,ge,Ee):h==";"?c():h=="if"?(A.state.lexical.info=="else"&&A.state.cc[A.state.cc.length-1]==ge&&A.state.cc.pop()(),c(me("form"),Mt,Le,ge,Dr)):h=="function"?c(Pt):h=="for"?c(me("form"),Ge,Hn,Le,Ee,ge):h=="class"||T&&x=="interface"?(A.marked="keyword",c(me("form",h=="class"?h:x),Fr,ge)):h=="variable"?T&&x=="declare"?(A.marked="keyword",c(Le)):T&&(x=="module"||x=="enum"||x=="type")&&A.stream.match(/^\s*\w/,!1)?(A.marked="keyword",x=="enum"?c(ue):x=="type"?c(zn,xe("operator"),Se,xe(";")):c(me("form"),vt,xe("{"),me("}"),Kt,ge,ge)):T&&x=="namespace"?(A.marked="keyword",c(me("form"),he,Le,ge)):T&&x=="abstract"?(A.marked="keyword",c(Le)):c(me("stat"),Te):h=="switch"?c(me("form"),Mt,xe("{"),me("}","switch"),Ge,Kt,ge,ge,Ee):h=="case"?c(he,xe(":")):h=="default"?c(xe(":")):h=="catch"?c(me("form"),Me,be,Le,ge,Ee):h=="export"?c(me("stat"),Er,ge):h=="import"?c(me("stat"),ur,ge):h=="async"?c(Le):x=="@"?c(he,Le):G(me("stat"),he,xe(";"),ge)}function be(h){if(h=="(")return c(Et,xe(")"))}function he(h,x){return dt(h,x,!1)}function it(h,x){return dt(h,x,!0)}function Mt(h){return h!="("?G():c(me(")"),Lt,xe(")"),ge)}function dt(h,x,Y){if(A.state.fatArrowAt==A.stream.start){var $=Y?De:Ce;if(h=="(")return c(Me,me(")"),je(Et,")"),ge,xe("=>"),$,Ee);if(h=="variable")return G(Me,vt,xe("=>"),$,Ee)}var K=Y?Xe:Ae;return L.hasOwnProperty(h)?c(K):h=="function"?c(Pt,K):h=="class"||T&&x=="interface"?(A.marked="keyword",c(me("form"),yi,ge)):h=="keyword c"||h=="async"?c(Y?it:he):h=="("?c(me(")"),Lt,xe(")"),ge,K):h=="operator"||h=="spread"?c(Y?it:he):h=="["?c(me("]"),_e,ge,K):h=="{"?nr(jt,"}",null,K):h=="quasi"?G(pt,K):h=="new"?c(R(Y)):c()}function Lt(h){return h.match(/[;\}\)\],]/)?G():G(he)}function Ae(h,x){return h==","?c(Lt):Xe(h,x,!1)}function Xe(h,x,Y){var $=Y==!1?Ae:Xe,K=Y==!1?he:it;if(h=="=>")return c(Me,Y?De:Ce,Ee);if(h=="operator")return/\+\+|--/.test(x)||T&&x=="!"?c($):T&&x=="<"&&A.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?c(me(">"),je(Se,">"),ge,$):x=="?"?c(he,xe(":"),K):c(K);if(h=="quasi")return G(pt,$);if(h!=";"){if(h=="(")return nr(it,")","call",$);if(h==".")return c(at,$);if(h=="[")return c(me("]"),Lt,xe("]"),ge,$);if(T&&x=="as")return A.marked="keyword",c(Se,$);if(h=="regexp")return A.state.lastType=A.marked="operator",A.stream.backUp(A.stream.pos-A.stream.start-1),c(K)}}function pt(h,x){return h!="quasi"?G():x.slice(x.length-2)!="${"?c(pt):c(Lt,Tt)}function Tt(h){if(h=="}")return A.marked="string-2",A.state.tokenize=m,c(pt)}function Ce(h){return d(A.stream,A.state),G(h=="{"?Le:he)}function De(h){return d(A.stream,A.state),G(h=="{"?Le:it)}function R(h){return function(x){return x=="."?c(h?X:te):x=="variable"&&T?c(wt,h?Xe:Ae):G(h?it:he)}}function te(h,x){if(x=="target")return A.marked="keyword",c(Ae)}function X(h,x){if(x=="target")return A.marked="keyword",c(Xe)}function Te(h){return h==":"?c(ge,Le):G(Ae,xe(";"),ge)}function at(h){if(h=="variable")return A.marked="property",c()}function jt(h,x){if(h=="async")return A.marked="property",c(jt);if(h=="variable"||A.style=="keyword"){if(A.marked="property",x=="get"||x=="set")return c(In);var Y;return T&&A.state.fatArrowAt==A.stream.start&&(Y=A.stream.match(/^\s*:\s*/,!1))&&(A.state.fatArrowAt=A.stream.pos+Y[0].length),c(Yt)}else{if(h=="number"||h=="string")return A.marked=I?"property":A.style+" property",c(Yt);if(h=="jsonld-keyword")return c(Yt);if(T&&fe(x))return A.marked="keyword",c(jt);if(h=="[")return c(he,ir,xe("]"),Yt);if(h=="spread")return c(it,Yt);if(x=="*")return A.marked="keyword",c(jt);if(h==":")return G(Yt)}}function In(h){return h!="variable"?G(Yt):(A.marked="property",c(Pt))}function Yt(h){if(h==":")return c(it);if(h=="(")return G(Pt)}function je(h,x,Y){function $(K,ae){if(Y?Y.indexOf(K)>-1:K==","){var Oe=A.state.lexical;return Oe.info=="call"&&(Oe.pos=(Oe.pos||0)+1),c(function(Je,gt){return Je==x||gt==x?G():G(h)},$)}return K==x||ae==x?c():Y&&Y.indexOf(";")>-1?G(h):c(xe(x))}return function(K,ae){return K==x||ae==x?c():G(h,$)}}function nr(h,x,Y){for(var $=3;$<arguments.length;$++)A.cc.push(arguments[$]);return c(me(x,Y),je(h,x),ge)}function Kt(h){return h=="}"?c():G(Le,Kt)}function ir(h,x){if(T){if(h==":")return c(Se);if(x=="?")return c(ir)}}function br(h,x){if(T&&(h==":"||x=="in"))return c(Se)}function or(h){if(T&&h==":")return A.stream.match(/^\s*\w+\s+is\b/,!1)?c(he,gi,Se):c(Se)}function gi(h,x){if(x=="is")return A.marked="keyword",c()}function Se(h,x){if(x=="keyof"||x=="typeof"||x=="infer"||x=="readonly")return A.marked="keyword",c(x=="typeof"?it:Se);if(h=="variable"||x=="void")return A.marked="type",c(Nt);if(x=="|"||x=="&")return c(Se);if(h=="string"||h=="number"||h=="atom")return c(Nt);if(h=="[")return c(me("]"),je(Se,"]",","),ge,Nt);if(h=="{")return c(me("}"),pe,ge,Nt);if(h=="(")return c(je(Ke,")"),Bn,Nt);if(h=="<")return c(je(Se,">"),Se);if(h=="quasi")return G(lt,Nt)}function Bn(h){if(h=="=>")return c(Se)}function pe(h){return h.match(/[\}\)\]]/)?c():h==","||h==";"?c(pe):G(Zt,pe)}function Zt(h,x){if(h=="variable"||A.style=="keyword")return A.marked="property",c(Zt);if(x=="?"||h=="number"||h=="string")return c(Zt);if(h==":")return c(Se);if(h=="[")return c(xe("variable"),br,xe("]"),Zt);if(h=="(")return G(sr,Zt);if(!h.match(/[;\}\)\],]/))return c()}function lt(h,x){return h!="quasi"?G():x.slice(x.length-2)!="${"?c(lt):c(Se,Re)}function Re(h){if(h=="}")return A.marked="string-2",A.state.tokenize=m,c(lt)}function Ke(h,x){return h=="variable"&&A.stream.match(/^\s*[?:]/,!1)||x=="?"?c(Ke):h==":"?c(Se):h=="spread"?c(Ke):G(Se)}function Nt(h,x){if(x=="<")return c(me(">"),je(Se,">"),ge,Nt);if(x=="|"||h=="."||x=="&")return c(Se);if(h=="[")return c(Se,xe("]"),Nt);if(x=="extends"||x=="implements")return A.marked="keyword",c(Se);if(x=="?")return c(Se,xe(":"),Se)}function wt(h,x){if(x=="<")return c(me(">"),je(Se,">"),ge,Nt)}function Dt(){return G(Se,st)}function st(h,x){if(x=="=")return c(Se)}function Mr(h,x){return x=="enum"?(A.marked="keyword",c(ue)):G(vt,ir,Ft,mi)}function vt(h,x){if(T&&fe(x))return A.marked="keyword",c(vt);if(h=="variable")return j(x),c();if(h=="spread")return c(vt);if(h=="[")return nr(on,"]");if(h=="{")return nr(ar,"}")}function ar(h,x){return h=="variable"&&!A.stream.match(/^\s*:/,!1)?(j(x),c(Ft)):(h=="variable"&&(A.marked="property"),h=="spread"?c(vt):h=="}"?G():h=="["?c(he,xe("]"),xe(":"),ar):c(xe(":"),vt,Ft))}function on(){return G(vt,Ft)}function Ft(h,x){if(x=="=")return c(it)}function mi(h){if(h==",")return c(Mr)}function Dr(h,x){if(h=="keyword b"&&x=="else")return c(me("form","else"),Le,ge)}function Hn(h,x){if(x=="await")return c(Hn);if(h=="(")return c(me(")"),an,ge)}function an(h){return h=="var"?c(Mr,lr):h=="variable"?c(lr):G(lr)}function lr(h,x){return h==")"?c():h==";"?c(lr):x=="in"||x=="of"?(A.marked="keyword",c(he,lr)):G(he,lr)}function Pt(h,x){if(x=="*")return A.marked="keyword",c(Pt);if(h=="variable")return j(x),c(Pt);if(h=="(")return c(Me,me(")"),je(Et,")"),ge,or,Le,Ee);if(T&&x=="<")return c(me(">"),je(Dt,">"),ge,Pt)}function sr(h,x){if(x=="*")return A.marked="keyword",c(sr);if(h=="variable")return j(x),c(sr);if(h=="(")return c(Me,me(")"),je(Et,")"),ge,or,Ee);if(T&&x=="<")return c(me(">"),je(Dt,">"),ge,sr)}function zn(h,x){if(h=="keyword"||h=="variable")return A.marked="type",c(zn);if(x=="<")return c(me(">"),je(Dt,">"),ge)}function Et(h,x){return x=="@"&&c(he,Et),h=="spread"?c(Et):T&&fe(x)?(A.marked="keyword",c(Et)):T&&h=="this"?c(ir,Ft):G(vt,ir,Ft)}function yi(h,x){return h=="variable"?Fr(h,x):Wt(h,x)}function Fr(h,x){if(h=="variable")return j(x),c(Wt)}function Wt(h,x){if(x=="<")return c(me(">"),je(Dt,">"),ge,Wt);if(x=="extends"||x=="implements"||T&&h==",")return x=="implements"&&(A.marked="keyword"),c(T?Se:he,Wt);if(h=="{")return c(me("}"),It,ge)}function It(h,x){if(h=="async"||h=="variable"&&(x=="static"||x=="get"||x=="set"||T&&fe(x))&&A.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return A.marked="keyword",c(It);if(h=="variable"||A.style=="keyword")return A.marked="property",c(xr,It);if(h=="number"||h=="string")return c(xr,It);if(h=="[")return c(he,ir,xe("]"),xr,It);if(x=="*")return A.marked="keyword",c(It);if(T&&h=="(")return G(sr,It);if(h==";"||h==",")return c(It);if(h=="}")return c();if(x=="@")return c(he,It)}function xr(h,x){if(x=="!"||x=="?")return c(xr);if(h==":")return c(Se,Ft);if(x=="=")return c(it);var Y=A.state.lexical.prev,$=Y&&Y.info=="interface";return G($?sr:Pt)}function Er(h,x){return x=="*"?(A.marked="keyword",c(Br,xe(";"))):x=="default"?(A.marked="keyword",c(he,xe(";"))):h=="{"?c(je(Wr,"}"),Br,xe(";")):G(Le)}function Wr(h,x){if(x=="as")return A.marked="keyword",c(xe("variable"));if(h=="variable")return G(it,Wr)}function ur(h){return h=="string"?c():h=="("?G(he):h=="."?G(Ae):G(Ir,_t,Br)}function Ir(h,x){return h=="{"?nr(Ir,"}"):(h=="variable"&&j(x),x=="*"&&(A.marked="keyword"),c(ln))}function _t(h){if(h==",")return c(Ir,_t)}function ln(h,x){if(x=="as")return A.marked="keyword",c(Ir)}function Br(h,x){if(x=="from")return A.marked="keyword",c(he)}function _e(h){return h=="]"?c():G(je(it,"]"))}function ue(){return G(me("form"),vt,xe("{"),me("}"),je(Qt,"}"),ge,ge)}function Qt(){return G(vt,Ft)}function sn(h,x){return h.lastType=="operator"||h.lastType==","||M.test(x.charAt(0))||/[,.]/.test(x.charAt(0))}function At(h,x,Y){return x.tokenize==g&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(x.lastType)||x.lastType=="quasi"&&/\{\s*$/.test(h.string.slice(0,h.pos-(Y||0)))}return{startState:function(h){var x={tokenize:g,lastType:"sof",cc:[],lexical:new F((h||0)-V,0,"block",!1),localVars:z.localVars,context:z.localVars&&new ce(null,null,!1),indented:h||0};return z.globalVars&&typeof z.globalVars=="object"&&(x.globalVars=z.globalVars),x},token:function(h,x){if(h.sol()&&(x.lexical.hasOwnProperty("align")||(x.lexical.align=!1),x.indented=h.indentation(),d(h,x)),x.tokenize!=p&&h.eatSpace())return null;var Y=x.tokenize(h,x);return O=="comment"?Y:(x.lastType=O=="operator"&&(S=="++"||S=="--")?"incdec":O,U(x,Y,O,S,h))},indent:function(h,x){if(h.tokenize==p||h.tokenize==m)return y.Pass;if(h.tokenize!=g)return 0;var Y=x&&x.charAt(0),$=h.lexical,K;if(!/^\s*else\b/.test(x))for(var ae=h.cc.length-1;ae>=0;--ae){var Oe=h.cc[ae];if(Oe==ge)$=$.prev;else if(Oe!=Dr&&Oe!=Ee)break}for(;($.type=="stat"||$.type=="form")&&(Y=="}"||(K=h.cc[h.cc.length-1])&&(K==Ae||K==Xe)&&!/^[,\.=+\-*:?[\(]/.test(x));)$=$.prev;re&&$.type==")"&&$.prev.type=="stat"&&($=$.prev);var Je=$.type,gt=Y==Je;return Je=="vardef"?$.indented+(h.lastType=="operator"||h.lastType==","?$.info.length+1:0):Je=="form"&&Y=="{"?$.indented:Je=="form"?$.indented+V:Je=="stat"?$.indented+(sn(h,x)?re||V:0):$.info=="switch"&&!gt&&z.doubleIndentSwitch!=!1?$.indented+(/^(?:case|default)\b/.test(x)?V:2*V):$.align?$.column+(gt?0:1):$.indented+(gt?0:V)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:D?null:"/*",blockCommentEnd:D?null:"*/",blockCommentContinue:D?null:" * ",lineComment:D?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:D?"json":"javascript",jsonldMode:I,jsonMode:D,expressionAllowed:At,skipExpression:function(h){U(h,"atom","atom","true",new y.StringStream("",2,null))}}}),y.registerHelper("wordChars","javascript",/[\w$]/),y.defineMIME("text/javascript","javascript"),y.defineMIME("text/ecmascript","javascript"),y.defineMIME("application/javascript","javascript"),y.defineMIME("application/x-javascript","javascript"),y.defineMIME("application/ecmascript","javascript"),y.defineMIME("application/json",{name:"javascript",json:!0}),y.defineMIME("application/x-json",{name:"javascript",json:!0}),y.defineMIME("application/manifest+json",{name:"javascript",json:!0}),y.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),y.defineMIME("text/typescript",{name:"javascript",typescript:!0}),y.defineMIME("application/typescript",{name:"javascript",typescript:!0})})})();var Zu=Yu.exports,gl={exports:{}},ml;function Dl(){return ml||(ml=1,function(We,Ie){(function(y){y(nt)})(function(y){y.defineMode("css",function(F,N){var U=N.inline;N.propertyKeywords||(N=y.resolveMode("text/css"));var A=F.indentUnit,G=N.tokenHooks,c=N.documentTypes||{},Q=N.mediaTypes||{},j=N.mediaFeatures||{},ne=N.mediaValueKeywords||{},fe=N.propertyKeywords||{},ce=N.nonStandardPropertyKeywords||{},we=N.fontProperties||{},Be=N.counterDescriptors||{},Me=N.colorKeywords||{},Ge=N.valueKeywords||{},Ee=N.allowNested,me=N.lineComment,ge=N.supportsAtComponent===!0,xe=F.highlightNonStandardPropertyKeywords!==!1,Le,be;function he(R,te){return Le=te,R}function it(R,te){var X=R.next();if(G[X]){var Te=G[X](R,te);if(Te!==!1)return Te}if(X=="@")return R.eatWhile(/[\w\\\-]/),he("def",R.current());if(X=="="||(X=="~"||X=="|")&&R.eat("="))return he(null,"compare");if(X=='"'||X=="'")return te.tokenize=Mt(X),te.tokenize(R,te);if(X=="#")return R.eatWhile(/[\w\\\-]/),he("atom","hash");if(X=="!")return R.match(/^\s*\w*/),he("keyword","important");if(/\d/.test(X)||X=="."&&R.eat(/\d/))return R.eatWhile(/[\w.%]/),he("number","unit");if(X==="-"){if(/[\d.]/.test(R.peek()))return R.eatWhile(/[\w.%]/),he("number","unit");if(R.match(/^-[\w\\\-]*/))return R.eatWhile(/[\w\\\-]/),R.match(/^\s*:/,!1)?he("variable-2","variable-definition"):he("variable-2","variable");if(R.match(/^\w+-/))return he("meta","meta")}else return/[,+>*\/]/.test(X)?he(null,"select-op"):X=="."&&R.match(/^-?[_a-z][_a-z0-9-]*/i)?he("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(X)?he(null,X):R.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(R.current())&&(te.tokenize=dt),he("variable callee","variable")):/[\w\\\-]/.test(X)?(R.eatWhile(/[\w\\\-]/),he("property","word")):he(null,null)}function Mt(R){return function(te,X){for(var Te=!1,at;(at=te.next())!=null;){if(at==R&&!Te){R==")"&&te.backUp(1);break}Te=!Te&&at=="\\"}return(at==R||!Te&&R!=")")&&(X.tokenize=null),he("string","string")}}function dt(R,te){return R.next(),R.match(/^\s*[\"\')]/,!1)?te.tokenize=null:te.tokenize=Mt(")"),he(null,"(")}function Lt(R,te,X){this.type=R,this.indent=te,this.prev=X}function Ae(R,te,X,Te){return R.context=new Lt(X,te.indentation()+(Te===!1?0:A),R.context),X}function Xe(R){return R.context.prev&&(R.context=R.context.prev),R.context.type}function pt(R,te,X){return De[X.context.type](R,te,X)}function Tt(R,te,X,Te){for(var at=Te||1;at>0;at--)X.context=X.context.prev;return pt(R,te,X)}function Ce(R){var te=R.current().toLowerCase();Ge.hasOwnProperty(te)?be="atom":Me.hasOwnProperty(te)?be="keyword":be="variable"}var De={};return De.top=function(R,te,X){if(R=="{")return Ae(X,te,"block");if(R=="}"&&X.context.prev)return Xe(X);if(ge&&/@component/i.test(R))return Ae(X,te,"atComponentBlock");if(/^@(-moz-)?document$/i.test(R))return Ae(X,te,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(R))return Ae(X,te,"atBlock");if(/^@(font-face|counter-style)/i.test(R))return X.stateArg=R,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(R))return"keyframes";if(R&&R.charAt(0)=="@")return Ae(X,te,"at");if(R=="hash")be="builtin";else if(R=="word")be="tag";else{if(R=="variable-definition")return"maybeprop";if(R=="interpolation")return Ae(X,te,"interpolation");if(R==":")return"pseudo";if(Ee&&R=="(")return Ae(X,te,"parens")}return X.context.type},De.block=function(R,te,X){if(R=="word"){var Te=te.current().toLowerCase();return fe.hasOwnProperty(Te)?(be="property","maybeprop"):ce.hasOwnProperty(Te)?(be=xe?"string-2":"property","maybeprop"):Ee?(be=te.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(be+=" error","maybeprop")}else return R=="meta"?"block":!Ee&&(R=="hash"||R=="qualifier")?(be="error","block"):De.top(R,te,X)},De.maybeprop=function(R,te,X){return R==":"?Ae(X,te,"prop"):pt(R,te,X)},De.prop=function(R,te,X){if(R==";")return Xe(X);if(R=="{"&&Ee)return Ae(X,te,"propBlock");if(R=="}"||R=="{")return Tt(R,te,X);if(R=="(")return Ae(X,te,"parens");if(R=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(te.current()))be+=" error";else if(R=="word")Ce(te);else if(R=="interpolation")return Ae(X,te,"interpolation");return"prop"},De.propBlock=function(R,te,X){return R=="}"?Xe(X):R=="word"?(be="property","maybeprop"):X.context.type},De.parens=function(R,te,X){return R=="{"||R=="}"?Tt(R,te,X):R==")"?Xe(X):R=="("?Ae(X,te,"parens"):R=="interpolation"?Ae(X,te,"interpolation"):(R=="word"&&Ce(te),"parens")},De.pseudo=function(R,te,X){return R=="meta"?"pseudo":R=="word"?(be="variable-3",X.context.type):pt(R,te,X)},De.documentTypes=function(R,te,X){return R=="word"&&c.hasOwnProperty(te.current())?(be="tag",X.context.type):De.atBlock(R,te,X)},De.atBlock=function(R,te,X){if(R=="(")return Ae(X,te,"atBlock_parens");if(R=="}"||R==";")return Tt(R,te,X);if(R=="{")return Xe(X)&&Ae(X,te,Ee?"block":"top");if(R=="interpolation")return Ae(X,te,"interpolation");if(R=="word"){var Te=te.current().toLowerCase();Te=="only"||Te=="not"||Te=="and"||Te=="or"?be="keyword":Q.hasOwnProperty(Te)?be="attribute":j.hasOwnProperty(Te)?be="property":ne.hasOwnProperty(Te)?be="keyword":fe.hasOwnProperty(Te)?be="property":ce.hasOwnProperty(Te)?be=xe?"string-2":"property":Ge.hasOwnProperty(Te)?be="atom":Me.hasOwnProperty(Te)?be="keyword":be="error"}return X.context.type},De.atComponentBlock=function(R,te,X){return R=="}"?Tt(R,te,X):R=="{"?Xe(X)&&Ae(X,te,Ee?"block":"top",!1):(R=="word"&&(be="error"),X.context.type)},De.atBlock_parens=function(R,te,X){return R==")"?Xe(X):R=="{"||R=="}"?Tt(R,te,X,2):De.atBlock(R,te,X)},De.restricted_atBlock_before=function(R,te,X){return R=="{"?Ae(X,te,"restricted_atBlock"):R=="word"&&X.stateArg=="@counter-style"?(be="variable","restricted_atBlock_before"):pt(R,te,X)},De.restricted_atBlock=function(R,te,X){return R=="}"?(X.stateArg=null,Xe(X)):R=="word"?(X.stateArg=="@font-face"&&!we.hasOwnProperty(te.current().toLowerCase())||X.stateArg=="@counter-style"&&!Be.hasOwnProperty(te.current().toLowerCase())?be="error":be="property","maybeprop"):"restricted_atBlock"},De.keyframes=function(R,te,X){return R=="word"?(be="variable","keyframes"):R=="{"?Ae(X,te,"top"):pt(R,te,X)},De.at=function(R,te,X){return R==";"?Xe(X):R=="{"||R=="}"?Tt(R,te,X):(R=="word"?be="tag":R=="hash"&&(be="builtin"),"at")},De.interpolation=function(R,te,X){return R=="}"?Xe(X):R=="{"||R==";"?Tt(R,te,X):(R=="word"?be="variable":R!="variable"&&R!="("&&R!=")"&&(be="error"),"interpolation")},{startState:function(R){return{tokenize:null,state:U?"block":"top",stateArg:null,context:new Lt(U?"block":"top",R||0,null)}},token:function(R,te){if(!te.tokenize&&R.eatSpace())return null;var X=(te.tokenize||it)(R,te);return X&&typeof X=="object"&&(Le=X[1],X=X[0]),be=X,Le!="comment"&&(te.state=De[te.state](Le,R,te)),be},indent:function(R,te){var X=R.context,Te=te&&te.charAt(0),at=X.indent;return X.type=="prop"&&(Te=="}"||Te==")")&&(X=X.prev),X.prev&&(Te=="}"&&(X.type=="block"||X.type=="top"||X.type=="interpolation"||X.type=="restricted_atBlock")?(X=X.prev,at=X.indent):(Te==")"&&(X.type=="parens"||X.type=="atBlock_parens")||Te=="{"&&(X.type=="at"||X.type=="atBlock"))&&(at=Math.max(0,X.indent-A))),at},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:me,fold:"brace"}});function H(F){for(var N={},U=0;U<F.length;++U)N[F[U].toLowerCase()]=!0;return N}var z=["domain","regexp","url","url-prefix"],V=H(z),re=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],I=H(re),D=["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","prefers-color-scheme","dynamic-range","video-dynamic-range"],_=H(D),T=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive","dark","light","standard","high"],B=H(T),C=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","all","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","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","binding","bleed","block-size","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","contain","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-content","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","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-variation-settings","font-weight","gap","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","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","left","letter-spacing","line-break","line-height","line-height-step","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","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","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","rotate","rotation","rotation-point","row-gap","ruby-align","ruby-overhang","ruby-position","ruby-span","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-type","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-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-orientation","text-outline","text-overflow","text-rendering","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","touch-action","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","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","writing-mode","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","paint-order","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"],M=H(C),W=["accent-color","aspect-ratio","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","content-visibility","margin-block","margin-block-end","margin-block-start","margin-inline","margin-inline-end","margin-inline-start","overflow-anchor","overscroll-behavior","padding-block","padding-block-end","padding-block-start","padding-inline","padding-inline-end","padding-inline-start","scroll-snap-stop","scrollbar-3d-light-color","scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-track-color","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","shape-inside","zoom"],Z=H(W),O=["font-display","font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],S=H(O),v=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],g=H(v),u=["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","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","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","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","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","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],p=H(u),m=["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","axis-pan","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","blur","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","brightness","bullets","button","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","conic-gradient","contain","content","contents","content-box","context-menu","continuous","contrast","copy","counter","counters","cover","crop","cross","crosshair","cubic-bezier","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","drop-shadow","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","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","grayscale","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","hue-rotate","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","manipulation","match","matrix","matrix3d","media-play-button","media-slider","media-sliderthumb","media-volume-slider","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiple_mask_images","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","pinch-zoom","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","repeating-conic-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","saturate","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","sepia","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","stroke-box","sub","subpixel-antialiased","svg_masks","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","unidirectional-pan","unset","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","view-box","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"],w=H(m),d=z.concat(re).concat(D).concat(T).concat(C).concat(W).concat(u).concat(m);y.registerHelper("hintWords","css",d);function L(F,N){for(var U=!1,A;(A=F.next())!=null;){if(U&&A=="/"){N.tokenize=null;break}U=A=="*"}return["comment","comment"]}y.defineMIME("text/css",{documentTypes:V,mediaTypes:I,mediaFeatures:_,mediaValueKeywords:B,propertyKeywords:M,nonStandardPropertyKeywords:Z,fontProperties:S,counterDescriptors:g,colorKeywords:p,valueKeywords:w,tokenHooks:{"/":function(F,N){return F.eat("*")?(N.tokenize=L,L(F,N)):!1}},name:"css"}),y.defineMIME("text/x-scss",{mediaTypes:I,mediaFeatures:_,mediaValueKeywords:B,propertyKeywords:M,nonStandardPropertyKeywords:Z,colorKeywords:p,valueKeywords:w,fontProperties:S,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(F,N){return F.eat("/")?(F.skipToEnd(),["comment","comment"]):F.eat("*")?(N.tokenize=L,L(F,N)):["operator","operator"]},":":function(F){return F.match(/^\s*\{/,!1)?[null,null]:!1},$:function(F){return F.match(/^[\w-]+/),F.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(F){return F.eat("{")?[null,"interpolation"]:!1}},name:"css",helperType:"scss"}),y.defineMIME("text/x-less",{mediaTypes:I,mediaFeatures:_,mediaValueKeywords:B,propertyKeywords:M,nonStandardPropertyKeywords:Z,colorKeywords:p,valueKeywords:w,fontProperties:S,allowNested:!0,lineComment:"//",tokenHooks:{"/":function(F,N){return F.eat("/")?(F.skipToEnd(),["comment","comment"]):F.eat("*")?(N.tokenize=L,L(F,N)):["operator","operator"]},"@":function(F){return F.eat("{")?[null,"interpolation"]:F.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/i,!1)?!1:(F.eatWhile(/[\w\\\-]/),F.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),y.defineMIME("text/x-gss",{documentTypes:V,mediaTypes:I,mediaFeatures:_,propertyKeywords:M,nonStandardPropertyKeywords:Z,fontProperties:S,counterDescriptors:g,colorKeywords:p,valueKeywords:w,supportsAtComponent:!0,tokenHooks:{"/":function(F,N){return F.eat("*")?(N.tokenize=L,L(F,N)):!1}},name:"css",helperType:"gss"})})}()),gl.exports}Dl();var yl={exports:{}},bl;function Qu(){return bl||(bl=1,function(We,Ie){(function(y){y(nt)})(function(y){var H={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},z={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};y.defineMode("xml",function(V,re){var I=V.indentUnit,D={},_=re.htmlMode?H:z;for(var T in _)D[T]=_[T];for(var T in re)D[T]=re[T];var B,C;function M(c,Q){function j(ce){return Q.tokenize=ce,ce(c,Q)}var ne=c.next();if(ne=="<")return c.eat("!")?c.eat("[")?c.match("CDATA[")?j(O("atom","]]>")):null:c.match("--")?j(O("comment","-->")):c.match("DOCTYPE",!0,!0)?(c.eatWhile(/[\w\._\-]/),j(S(1))):null:c.eat("?")?(c.eatWhile(/[\w\._\-]/),Q.tokenize=O("meta","?>"),"meta"):(B=c.eat("/")?"closeTag":"openTag",Q.tokenize=W,"tag bracket");if(ne=="&"){var fe;return c.eat("#")?c.eat("x")?fe=c.eatWhile(/[a-fA-F\d]/)&&c.eat(";"):fe=c.eatWhile(/[\d]/)&&c.eat(";"):fe=c.eatWhile(/[\w\.\-:]/)&&c.eat(";"),fe?"atom":"error"}else return c.eatWhile(/[^&<]/),null}M.isInText=!0;function W(c,Q){var j=c.next();if(j==">"||j=="/"&&c.eat(">"))return Q.tokenize=M,B=j==">"?"endTag":"selfcloseTag","tag bracket";if(j=="=")return B="equals",null;if(j=="<"){Q.tokenize=M,Q.state=m,Q.tagName=Q.tagStart=null;var ne=Q.tokenize(c,Q);return ne?ne+" tag error":"tag error"}else return/[\'\"]/.test(j)?(Q.tokenize=Z(j),Q.stringStartCol=c.column(),Q.tokenize(c,Q)):(c.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Z(c){var Q=function(j,ne){for(;!j.eol();)if(j.next()==c){ne.tokenize=W;break}return"string"};return Q.isInAttribute=!0,Q}function O(c,Q){return function(j,ne){for(;!j.eol();){if(j.match(Q)){ne.tokenize=M;break}j.next()}return c}}function S(c){return function(Q,j){for(var ne;(ne=Q.next())!=null;){if(ne=="<")return j.tokenize=S(c+1),j.tokenize(Q,j);if(ne==">")if(c==1){j.tokenize=M;break}else return j.tokenize=S(c-1),j.tokenize(Q,j)}return"meta"}}function v(c){return c&&c.toLowerCase()}function g(c,Q,j){this.prev=c.context,this.tagName=Q||"",this.indent=c.indented,this.startOfLine=j,(D.doNotIndent.hasOwnProperty(Q)||c.context&&c.context.noIndent)&&(this.noIndent=!0)}function u(c){c.context&&(c.context=c.context.prev)}function p(c,Q){for(var j;;){if(!c.context||(j=c.context.tagName,!D.contextGrabbers.hasOwnProperty(v(j))||!D.contextGrabbers[v(j)].hasOwnProperty(v(Q))))return;u(c)}}function m(c,Q,j){return c=="openTag"?(j.tagStart=Q.column(),w):c=="closeTag"?d:m}function w(c,Q,j){return c=="word"?(j.tagName=Q.current(),C="tag",N):D.allowMissingTagName&&c=="endTag"?(C="tag bracket",N(c,Q,j)):(C="error",w)}function d(c,Q,j){if(c=="word"){var ne=Q.current();return j.context&&j.context.tagName!=ne&&D.implicitlyClosed.hasOwnProperty(v(j.context.tagName))&&u(j),j.context&&j.context.tagName==ne||D.matchClosing===!1?(C="tag",L):(C="tag error",F)}else return D.allowMissingTagName&&c=="endTag"?(C="tag bracket",L(c,Q,j)):(C="error",F)}function L(c,Q,j){return c!="endTag"?(C="error",L):(u(j),m)}function F(c,Q,j){return C="error",L(c,Q,j)}function N(c,Q,j){if(c=="word")return C="attribute",U;if(c=="endTag"||c=="selfcloseTag"){var ne=j.tagName,fe=j.tagStart;return j.tagName=j.tagStart=null,c=="selfcloseTag"||D.autoSelfClosers.hasOwnProperty(v(ne))?p(j,ne):(p(j,ne),j.context=new g(j,ne,fe==j.indented)),m}return C="error",N}function U(c,Q,j){return c=="equals"?A:(D.allowMissing||(C="error"),N(c,Q,j))}function A(c,Q,j){return c=="string"?G:c=="word"&&D.allowUnquoted?(C="string",N):(C="error",N(c,Q,j))}function G(c,Q,j){return c=="string"?G:N(c,Q,j)}return{startState:function(c){var Q={tokenize:M,state:m,indented:c||0,tagName:null,tagStart:null,context:null};return c!=null&&(Q.baseIndent=c),Q},token:function(c,Q){if(!Q.tagName&&c.sol()&&(Q.indented=c.indentation()),c.eatSpace())return null;B=null;var j=Q.tokenize(c,Q);return(j||B)&&j!="comment"&&(C=null,Q.state=Q.state(B||j,c,Q),C&&(j=C=="error"?j+" error":C)),j},indent:function(c,Q,j){var ne=c.context;if(c.tokenize.isInAttribute)return c.tagStart==c.indented?c.stringStartCol+1:c.indented+I;if(ne&&ne.noIndent)return y.Pass;if(c.tokenize!=W&&c.tokenize!=M)return j?j.match(/^(\s*)/)[0].length:0;if(c.tagName)return D.multilineTagIndentPastTag!==!1?c.tagStart+c.tagName.length+2:c.tagStart+I*(D.multilineTagIndentFactor||1);if(D.alignCDATA&&/<!\[CDATA\[/.test(Q))return 0;var fe=Q&&/^<(\/)?([\w_:\.-]*)/.exec(Q);if(fe&&fe[1])for(;ne;)if(ne.tagName==fe[2]){ne=ne.prev;break}else if(D.implicitlyClosed.hasOwnProperty(v(ne.tagName)))ne=ne.prev;else break;else if(fe)for(;ne;){var ce=D.contextGrabbers[v(ne.tagName)];if(ce&&ce.hasOwnProperty(v(fe[2])))ne=ne.prev;else break}for(;ne&&ne.prev&&!ne.startOfLine;)ne=ne.prev;return ne?ne.indent+I:c.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:D.htmlMode?"html":"xml",helperType:D.htmlMode?"html":"xml",skipAttribute:function(c){c.state==A&&(c.state=N)},xmlCurrentTag:function(c){return c.tagName?{name:c.tagName,close:c.type=="closeTag"}:null},xmlCurrentContext:function(c){for(var Q=[],j=c.context;j;j=j.prev)Q.push(j.tagName);return Q.reverse()}}}),y.defineMIME("text/xml","xml"),y.defineMIME("application/xml","xml"),y.mimeModes.hasOwnProperty("text/html")||y.defineMIME("text/html",{name:"xml",htmlMode:!0})})}()),yl.exports}(function(We,Ie){(function(y){y(nt,Qu(),Zu,Dl())})(function(y){var H={script:[["lang",/(javascript|babel)/i,"javascript"],["type",/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i,"javascript"],["type",/./,"text/plain"],[null,null,"javascript"]],style:[["lang",/^css$/i,"css"],["type",/^(text\/)?(x-)?(stylesheet|css)$/i,"css"],["type",/./,"text/plain"],[null,null,"css"]]};function z(B,C,M){var W=B.current(),Z=W.search(C);return Z>-1?B.backUp(W.length-Z):W.match(/<\/?$/)&&(B.backUp(W.length),B.match(C,!1)||B.match(W)),M}var V={};function re(B){var C=V[B];return C||(V[B]=new RegExp("\\s+"+B+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function I(B,C){var M=B.match(re(C));return M?/^\s*(.*?)\s*$/.exec(M[2])[1]:""}function D(B,C){return new RegExp((C?"^":"")+"</\\s*"+B+"\\s*>","i")}function _(B,C){for(var M in B)for(var W=C[M]||(C[M]=[]),Z=B[M],O=Z.length-1;O>=0;O--)W.unshift(Z[O])}function T(B,C){for(var M=0;M<B.length;M++){var W=B[M];if(!W[0]||W[1].test(I(C,W[0])))return W[2]}}y.defineMode("htmlmixed",function(B,C){var M=y.getMode(B,{name:"xml",htmlMode:!0,multilineTagIndentFactor:C.multilineTagIndentFactor,multilineTagIndentPastTag:C.multilineTagIndentPastTag,allowMissingTagName:C.allowMissingTagName}),W={},Z=C&&C.tags,O=C&&C.scriptTypes;if(_(H,W),Z&&_(Z,W),O)for(var S=O.length-1;S>=0;S--)W.script.unshift(["type",O[S].matches,O[S].mode]);function v(g,u){var p=M.token(g,u.htmlState),m=/\btag\b/.test(p),w;if(m&&!/[<>\s\/]/.test(g.current())&&(w=u.htmlState.tagName&&u.htmlState.tagName.toLowerCase())&&W.hasOwnProperty(w))u.inTag=w+" ";else if(u.inTag&&m&&/>$/.test(g.current())){var d=/^([\S]+) (.*)/.exec(u.inTag);u.inTag=null;var L=g.current()==">"&&T(W[d[1]],d[2]),F=y.getMode(B,L),N=D(d[1],!0),U=D(d[1],!1);u.token=function(A,G){return A.match(N,!1)?(G.token=v,G.localState=G.localMode=null,null):z(A,U,G.localMode.token(A,G.localState))},u.localMode=F,u.localState=y.startState(F,M.indent(u.htmlState,"",""))}else u.inTag&&(u.inTag+=g.current(),g.eol()&&(u.inTag+=" "));return p}return{startState:function(){var g=y.startState(M);return{token:v,inTag:null,localMode:null,localState:null,htmlState:g}},copyState:function(g){var u;return g.localState&&(u=y.copyState(g.localMode,g.localState)),{token:g.token,inTag:g.inTag,localMode:g.localMode,localState:u,htmlState:y.copyState(M,g.htmlState)}},token:function(g,u){return u.token(g,u)},indent:function(g,u,p){return!g.localMode||/^\s*<\//.test(u)?M.indent(g.htmlState,u,p):g.localMode.indent?g.localMode.indent(g.localState,u,p):y.Pass},innerMode:function(g){return{state:g.localState||g.htmlState,mode:g.localMode||M}}}},"xml","javascript","css"),y.defineMIME("text/html","htmlmixed")})})();(function(We,Ie){(function(y){y(nt)})(function(y){var H={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},z=y.Pos;y.defineOption("autoCloseBrackets",!1,function(S,v,g){g&&g!=y.Init&&(S.removeKeyMap(re),S.state.closeBrackets=null),v&&(I(V(v,"pairs")),S.state.closeBrackets=v,S.addKeyMap(re))});function V(S,v){return v=="pairs"&&typeof S=="string"?S:typeof S=="object"&&S[v]!=null?S[v]:H[v]}var re={Backspace:T,Enter:B};function I(S){for(var v=0;v<S.length;v++){var g=S.charAt(v),u="'"+g+"'";re[u]||(re[u]=D(g))}}I(H.pairs+"`");function D(S){return function(v){return W(v,S)}}function _(S){var v=S.state.closeBrackets;if(!v||v.override)return v;var g=S.getModeAt(S.getCursor());return g.closeBrackets||v}function T(S){var v=_(S);if(!v||S.getOption("disableInput"))return y.Pass;for(var g=V(v,"pairs"),u=S.listSelections(),p=0;p<u.length;p++){if(!u[p].empty())return y.Pass;var m=Z(S,u[p].head);if(!m||g.indexOf(m)%2!=0)return y.Pass}for(var p=u.length-1;p>=0;p--){var w=u[p].head;S.replaceRange("",z(w.line,w.ch-1),z(w.line,w.ch+1),"+delete")}}function B(S){var v=_(S),g=v&&V(v,"explode");if(!g||S.getOption("disableInput"))return y.Pass;for(var u=S.listSelections(),p=0;p<u.length;p++){if(!u[p].empty())return y.Pass;var m=Z(S,u[p].head);if(!m||g.indexOf(m)%2!=0)return y.Pass}S.operation(function(){var w=S.lineSeparator()||`
`;S.replaceSelection(w+w,null),C(S,-1),u=S.listSelections();for(var d=0;d<u.length;d++){var L=u[d].head.line;S.indentLine(L,null,!0),S.indentLine(L+1,null,!0)}})}function C(S,v){for(var g=[],u=S.listSelections(),p=0,m=0;m<u.length;m++){var w=u[m];w.head==S.getCursor()&&(p=m);var d=w.head.ch||v>0?{line:w.head.line,ch:w.head.ch+v}:{line:w.head.line-1};g.push({anchor:d,head:d})}S.setSelections(g,p)}function M(S){var v=y.cmpPos(S.anchor,S.head)>0;return{anchor:new z(S.anchor.line,S.anchor.ch+(v?-1:1)),head:new z(S.head.line,S.head.ch+(v?1:-1))}}function W(S,v){var g=_(S);if(!g||S.getOption("disableInput"))return y.Pass;var u=V(g,"pairs"),p=u.indexOf(v);if(p==-1)return y.Pass;for(var m=V(g,"closeBefore"),w=V(g,"triples"),d=u.charAt(p+1)==v,L=S.listSelections(),F=p%2==0,N,U=0;U<L.length;U++){var A=L[U],G=A.head,c,Q=S.getRange(G,z(G.line,G.ch+1));if(F&&!A.empty())c="surround";else if((d||!F)&&Q==v)d&&O(S,G)?c="both":w.indexOf(v)>=0&&S.getRange(G,z(G.line,G.ch+3))==v+v+v?c="skipThree":c="skip";else if(d&&G.ch>1&&w.indexOf(v)>=0&&S.getRange(z(G.line,G.ch-2),G)==v+v){if(G.ch>2&&/\bstring/.test(S.getTokenTypeAt(z(G.line,G.ch-2))))return y.Pass;c="addFour"}else if(d){var j=G.ch==0?" ":S.getRange(z(G.line,G.ch-1),G);if(!y.isWordChar(Q)&&j!=v&&!y.isWordChar(j))c="both";else return y.Pass}else if(F&&(Q.length===0||/\s/.test(Q)||m.indexOf(Q)>-1))c="both";else return y.Pass;if(!N)N=c;else if(N!=c)return y.Pass}var ne=p%2?u.charAt(p-1):v,fe=p%2?v:u.charAt(p+1);S.operation(function(){if(N=="skip")C(S,1);else if(N=="skipThree")C(S,3);else if(N=="surround"){for(var ce=S.getSelections(),we=0;we<ce.length;we++)ce[we]=ne+ce[we]+fe;S.replaceSelections(ce,"around"),ce=S.listSelections().slice();for(var we=0;we<ce.length;we++)ce[we]=M(ce[we]);S.setSelections(ce)}else N=="both"?(S.replaceSelection(ne+fe,null),S.triggerElectric(ne+fe),C(S,-1)):N=="addFour"&&(S.replaceSelection(ne+ne+ne+ne,"before"),C(S,1))})}function Z(S,v){var g=S.getRange(z(v.line,v.ch-1),z(v.line,v.ch+1));return g.length==2?g:null}function O(S,v){var g=S.getTokenAt(z(v.line,v.ch+1));return/\bstring/.test(g.type)&&g.start==v.ch&&(v.ch==0||!/\bstring/.test(S.getTokenTypeAt(v)))}})})();var xl={exports:{}},kl;function Ju(){return kl||(kl=1,function(We,Ie){(function(y){y(nt)})(function(y){var H=y.Pos;function z(v,g){return v.line-g.line||v.ch-g.ch}var V="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",re=V+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",I=new RegExp("<(/?)(["+V+"]["+re+"]*)","g");function D(v,g,u,p){this.line=g,this.ch=u,this.cm=v,this.text=v.getLine(g),this.min=p?Math.max(p.from,v.firstLine()):v.firstLine(),this.max=p?Math.min(p.to-1,v.lastLine()):v.lastLine()}function _(v,g){var u=v.cm.getTokenTypeAt(H(v.line,g));return u&&/\btag\b/.test(u)}function T(v){if(!(v.line>=v.max))return v.ch=0,v.text=v.cm.getLine(++v.line),!0}function B(v){if(!(v.line<=v.min))return v.text=v.cm.getLine(--v.line),v.ch=v.text.length,!0}function C(v){for(;;){var g=v.text.indexOf(">",v.ch);if(g==-1){if(T(v))continue;return}if(!_(v,g+1)){v.ch=g+1;continue}var u=v.text.lastIndexOf("/",g),p=u>-1&&!/\S/.test(v.text.slice(u+1,g));return v.ch=g+1,p?"selfClose":"regular"}}function M(v){for(;;){var g=v.ch?v.text.lastIndexOf("<",v.ch-1):-1;if(g==-1){if(B(v))continue;return}if(!_(v,g+1)){v.ch=g;continue}I.lastIndex=g,v.ch=g;var u=I.exec(v.text);if(u&&u.index==g)return u}}function W(v){for(;;){I.lastIndex=v.ch;var g=I.exec(v.text);if(!g){if(T(v))continue;return}if(!_(v,g.index+1)){v.ch=g.index+1;continue}return v.ch=g.index+g[0].length,g}}function Z(v){for(;;){var g=v.ch?v.text.lastIndexOf(">",v.ch-1):-1;if(g==-1){if(B(v))continue;return}if(!_(v,g+1)){v.ch=g;continue}var u=v.text.lastIndexOf("/",g),p=u>-1&&!/\S/.test(v.text.slice(u+1,g));return v.ch=g+1,p?"selfClose":"regular"}}function O(v,g){for(var u=[];;){var p=W(v),m,w=v.line,d=v.ch-(p?p[0].length:0);if(!p||!(m=C(v)))return;if(m!="selfClose")if(p[1]){for(var L=u.length-1;L>=0;--L)if(u[L]==p[2]){u.length=L;break}if(L<0&&(!g||g==p[2]))return{tag:p[2],from:H(w,d),to:H(v.line,v.ch)}}else u.push(p[2])}}function S(v,g){for(var u=[];;){var p=Z(v);if(!p)return;if(p=="selfClose"){M(v);continue}var m=v.line,w=v.ch,d=M(v);if(!d)return;if(d[1])u.push(d[2]);else{for(var L=u.length-1;L>=0;--L)if(u[L]==d[2]){u.length=L;break}if(L<0&&(!g||g==d[2]))return{tag:d[2],from:H(v.line,v.ch),to:H(m,w)}}}}y.registerHelper("fold","xml",function(v,g){for(var u=new D(v,g.line,0);;){var p=W(u);if(!p||u.line!=g.line)return;var m=C(u);if(!m)return;if(!p[1]&&m!="selfClose"){var w=H(u.line,u.ch),d=O(u,p[2]);return d&&z(d.from,w)>0?{from:w,to:d.from}:null}}}),y.findMatchingTag=function(v,g,u){var p=new D(v,g.line,g.ch,u);if(!(p.text.indexOf(">")==-1&&p.text.indexOf("<")==-1)){var m=C(p),w=m&&H(p.line,p.ch),d=m&&M(p);if(!(!m||!d||z(p,g)>0)){var L={from:H(p.line,p.ch),to:w,tag:d[2]};return m=="selfClose"?{open:L,close:null,at:"open"}:d[1]?{open:S(p,d[2]),close:L,at:"close"}:(p=new D(v,w.line,w.ch,u),{open:L,close:O(p,d[2]),at:"open"})}}},y.findEnclosingTag=function(v,g,u,p){for(var m=new D(v,g.line,g.ch,u);;){var w=S(m,p);if(!w)break;var d=new D(v,g.line,g.ch,u),L=O(d,w.tag);if(L)return{open:w,close:L}}},y.scanForClosingTag=function(v,g,u,p){var m=new D(v,g.line,g.ch,p?{from:0,to:p}:null);return O(m,u)}})}()),xl.exports}(function(We,Ie){(function(y){y(nt,Ju())})(function(y){y.defineOption("autoCloseTags",!1,function(T,B,C){if(C!=y.Init&&C&&T.removeKeyMap("autoCloseTags"),!!B){var M={name:"autoCloseTags"};(typeof B!="object"||B.whenClosing!==!1)&&(M["'/'"]=function(W){return I(W)}),(typeof B!="object"||B.whenOpening!==!1)&&(M["'>'"]=function(W){return V(W)}),T.addKeyMap(M)}});var H=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],z=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function V(T){if(T.getOption("disableInput"))return y.Pass;for(var B=T.listSelections(),C=[],M=T.getOption("autoCloseTags"),W=0;W<B.length;W++){if(!B[W].empty())return y.Pass;var Z=B[W].head,O=T.getTokenAt(Z),S=y.innerMode(T.getMode(),O.state),v=S.state,g=S.mode.xmlCurrentTag&&S.mode.xmlCurrentTag(v),u=g&&g.name;if(!u)return y.Pass;var p=S.mode.configuration=="html",m=typeof M=="object"&&M.dontCloseTags||p&&H,w=typeof M=="object"&&M.indentTags||p&&z;O.end>Z.ch&&(u=u.slice(0,u.length-O.end+Z.ch));var d=u.toLowerCase();if(!u||O.type=="string"&&(O.end!=Z.ch||!/[\"\']/.test(O.string.charAt(O.string.length-1))||O.string.length==1)||O.type=="tag"&&g.close||O.string.indexOf("/")==Z.ch-O.start-1||m&&D(m,d)>-1||_(T,S.mode.xmlCurrentContext&&S.mode.xmlCurrentContext(v)||[],u,Z,!0))return y.Pass;var L=typeof M=="object"&&M.emptyTags;if(L&&D(L,u)>-1){C[W]={text:"/>",newPos:y.Pos(Z.line,Z.ch+2)};continue}var F=w&&D(w,d)>-1;C[W]={indent:F,text:">"+(F?`
`:"")+"</"+u+">",newPos:F?y.Pos(Z.line+1,0):y.Pos(Z.line,Z.ch+1)}}for(var N=typeof M=="object"&&M.dontIndentOnAutoClose,W=B.length-1;W>=0;W--){var U=C[W];T.replaceRange(U.text,B[W].head,B[W].anchor,"+insert");var A=T.listSelections().slice(0);A[W]={head:U.newPos,anchor:U.newPos},T.setSelections(A),!N&&U.indent&&(T.indentLine(U.newPos.line,null,!0),T.indentLine(U.newPos.line+1,null,!0))}}function re(T,B){for(var C=T.listSelections(),M=[],W=B?"/":"</",Z=T.getOption("autoCloseTags"),O=typeof Z=="object"&&Z.dontIndentOnSlash,S=0;S<C.length;S++){if(!C[S].empty())return y.Pass;var v=C[S].head,g=T.getTokenAt(v),u=y.innerMode(T.getMode(),g.state),p=u.state;if(B&&(g.type=="string"||g.string.charAt(0)!="<"||g.start!=v.ch-1))return y.Pass;var m,w=u.mode.name!="xml"&&T.getMode().name=="htmlmixed";if(w&&u.mode.name=="javascript")m=W+"script";else if(w&&u.mode.name=="css")m=W+"style";else{var d=u.mode.xmlCurrentContext&&u.mode.xmlCurrentContext(p),L=d.length?d[d.length-1]:"";if(!d||d.length&&_(T,d,L,v))return y.Pass;m=W+L}T.getLine(v.line).charAt(g.end)!=">"&&(m+=">"),M[S]=m}if(T.replaceSelections(M),C=T.listSelections(),!O)for(var S=0;S<C.length;S++)(S==C.length-1||C[S].head.line<C[S+1].head.line)&&T.indentLine(C[S].head.line)}function I(T){return T.getOption("disableInput")?y.Pass:re(T,!0)}y.commands.closeTag=function(T){return re(T)};function D(T,B){if(T.indexOf)return T.indexOf(B);for(var C=0,M=T.length;C<M;++C)if(T[C]==B)return C;return-1}function _(T,B,C,M,W){if(!y.scanForClosingTag)return!1;var Z=Math.min(T.lastLine()+1,M.line+500),O=y.scanForClosingTag(T,M,null,Z);if(!O||O.tag!=C)return!1;for(var S=W?1:0,v=B.length-1;v>=0&&B[v]==C;v--)++S;M=O.to;for(var v=1;v<S;v++){var g=y.scanForClosingTag(T,M,null,Z);if(!g||g.tag!=C)return!1;M=g.to}return!0}})})();(function(We,Ie){(function(y){y(nt)})(function(y){var H={},z=/[^\s\u00a0]/,V=y.Pos,re=y.cmpPos;function I(T){var B=T.search(z);return B==-1?0:B}y.commands.toggleComment=function(T){T.toggleComment()},y.defineExtension("toggleComment",function(T){T||(T=H);for(var B=this,C=1/0,M=this.listSelections(),W=null,Z=M.length-1;Z>=0;Z--){var O=M[Z].from(),S=M[Z].to();O.line>=C||(S.line>=C&&(S=V(C,0)),C=O.line,W==null?B.uncomment(O,S,T)?W="un":(B.lineComment(O,S,T),W="line"):W=="un"?B.uncomment(O,S,T):B.lineComment(O,S,T))}});function D(T,B,C){return/\bstring\b/.test(T.getTokenTypeAt(V(B.line,0)))&&!/^[\'\"\`]/.test(C)}function _(T,B){var C=T.getMode();return C.useInnerComments===!1||!C.innerMode?C:T.getModeAt(B)}y.defineExtension("lineComment",function(T,B,C){C||(C=H);var M=this,W=_(M,T),Z=M.getLine(T.line);if(!(Z==null||D(M,T,Z))){var O=C.lineComment||W.lineComment;if(!O){(C.blockCommentStart||W.blockCommentStart)&&(C.fullLines=!0,M.blockComment(T,B,C));return}var S=Math.min(B.ch!=0||B.line==T.line?B.line+1:B.line,M.lastLine()+1),v=C.padding==null?" ":C.padding,g=C.commentBlankLines||T.line==B.line;M.operation(function(){if(C.indent){for(var u=null,p=T.line;p<S;++p){var m=M.getLine(p),w=m.search(z)===-1?m:m.slice(0,I(m));(u==null||u.length>w.length)&&(u=w)}for(var p=T.line;p<S;++p){var m=M.getLine(p),d=u.length;!g&&!z.test(m)||(m.slice(0,d)!=u&&(d=I(m)),M.replaceRange(u+O+v,V(p,0),V(p,d)))}}else for(var p=T.line;p<S;++p)(g||z.test(M.getLine(p)))&&M.replaceRange(O+v,V(p,0))})}}),y.defineExtension("blockComment",function(T,B,C){C||(C=H);var M=this,W=_(M,T),Z=C.blockCommentStart||W.blockCommentStart,O=C.blockCommentEnd||W.blockCommentEnd;if(!Z||!O){(C.lineComment||W.lineComment)&&C.fullLines!=!1&&M.lineComment(T,B,C);return}if(!/\bcomment\b/.test(M.getTokenTypeAt(V(T.line,0)))){var S=Math.min(B.line,M.lastLine());S!=T.line&&B.ch==0&&z.test(M.getLine(S))&&--S;var v=C.padding==null?" ":C.padding;T.line>S||M.operation(function(){if(C.fullLines!=!1){var g=z.test(M.getLine(S));M.replaceRange(v+O,V(S)),M.replaceRange(Z+v,V(T.line,0));var u=C.blockCommentLead||W.blockCommentLead;if(u!=null)for(var p=T.line+1;p<=S;++p)(p!=S||g)&&M.replaceRange(u+v,V(p,0))}else{var m=re(M.getCursor("to"),B)==0,w=!M.somethingSelected();M.replaceRange(O,B),m&&M.setSelection(w?B:M.getCursor("from"),B),M.replaceRange(Z,T)}})}}),y.defineExtension("uncomment",function(T,B,C){C||(C=H);var M=this,W=_(M,T),Z=Math.min(B.ch!=0||B.line==T.line?B.line:B.line-1,M.lastLine()),O=Math.min(T.line,Z),S=C.lineComment||W.lineComment,v=[],g=C.padding==null?" ":C.padding,u;e:{if(!S)break e;for(var p=O;p<=Z;++p){var m=M.getLine(p),w=m.indexOf(S);if(w>-1&&!/comment/.test(M.getTokenTypeAt(V(p,w+1)))&&(w=-1),w==-1&&z.test(m)||w>-1&&z.test(m.slice(0,w)))break e;v.push(m)}if(M.operation(function(){for(var ce=O;ce<=Z;++ce){var we=v[ce-O],Be=we.indexOf(S),Me=Be+S.length;Be<0||(we.slice(Me,Me+g.length)==g&&(Me+=g.length),u=!0,M.replaceRange("",V(ce,Be),V(ce,Me)))}}),u)return!0}var d=C.blockCommentStart||W.blockCommentStart,L=C.blockCommentEnd||W.blockCommentEnd;if(!d||!L)return!1;var F=C.blockCommentLead||W.blockCommentLead,N=M.getLine(O),U=N.indexOf(d);if(U==-1)return!1;var A=Z==O?N:M.getLine(Z),G=A.indexOf(L,Z==O?U+d.length:0),c=V(O,U+1),Q=V(Z,G+1);if(G==-1||!/comment/.test(M.getTokenTypeAt(c))||!/comment/.test(M.getTokenTypeAt(Q))||M.getRange(c,Q,`
`).indexOf(L)>-1)return!1;var j=N.lastIndexOf(d,T.ch),ne=j==-1?-1:N.slice(0,T.ch).indexOf(L,j+d.length);if(j!=-1&&ne!=-1&&ne+L.length!=T.ch)return!1;ne=A.indexOf(L,B.ch);var fe=A.slice(B.ch).lastIndexOf(d,ne-B.ch);return j=ne==-1||fe==-1?-1:B.ch+fe,ne!=-1&&j!=-1&&j!=B.ch?!1:(M.operation(function(){M.replaceRange("",V(Z,G-(g&&A.slice(G-g.length,G)==g?g.length:0)),V(Z,G+L.length));var ce=U+d.length;if(g&&N.slice(ce,ce+g.length)==g&&(ce+=g.length),M.replaceRange("",V(O,U),V(O,ce)),F)for(var we=O+1;we<=Z;++we){var Be=M.getLine(we),Me=Be.indexOf(F);if(!(Me==-1||z.test(Be.slice(0,Me)))){var Ge=Me+F.length;g&&Be.slice(Ge,Ge+g.length)==g&&(Ge+=g.length),M.replaceRange("",V(we,Me),V(we,Ge))}}}),!0)})})})();var Vu={exports:{}};(function(We,Ie){(function(y){y(nt)})(function(y){function H(I,D,_,T){if(_&&_.call){var B=_;_=null}else var B=re(I,_,"rangeFinder");typeof D=="number"&&(D=y.Pos(D,0));var C=re(I,_,"minFoldSize");function M(S){var v=B(I,D);if(!v||v.to.line-v.from.line<C)return null;if(T==="fold")return v;for(var g=I.findMarksAt(v.from),u=0;u<g.length;++u)if(g[u].__isFold){if(!S)return null;v.cleared=!0,g[u].clear()}return v}var W=M(!0);if(re(I,_,"scanUp"))for(;!W&&D.line>I.firstLine();)D=y.Pos(D.line-1,0),W=M(!1);if(!(!W||W.cleared||T==="unfold")){var Z=z(I,_,W);y.on(Z,"mousedown",function(S){O.clear(),y.e_preventDefault(S)});var O=I.markText(W.from,W.to,{replacedWith:Z,clearOnEnter:re(I,_,"clearOnEnter"),__isFold:!0});O.on("clear",function(S,v){y.signal(I,"unfold",I,S,v)}),y.signal(I,"fold",I,W.from,W.to)}}function z(I,D,_){var T=re(I,D,"widget");if(typeof T=="function"&&(T=T(_.from,_.to)),typeof T=="string"){var B=document.createTextNode(T);T=document.createElement("span"),T.appendChild(B),T.className="CodeMirror-foldmarker"}else T&&(T=T.cloneNode(!0));return T}y.newFoldFunction=function(I,D){return function(_,T){H(_,T,{rangeFinder:I,widget:D})}},y.defineExtension("foldCode",function(I,D,_){H(this,I,D,_)}),y.defineExtension("isFolded",function(I){for(var D=this.findMarksAt(I),_=0;_<D.length;++_)if(D[_].__isFold)return!0}),y.commands.toggleFold=function(I){I.foldCode(I.getCursor())},y.commands.fold=function(I){I.foldCode(I.getCursor(),null,"fold")},y.commands.unfold=function(I){I.foldCode(I.getCursor(),{scanUp:!1},"unfold")},y.commands.foldAll=function(I){I.operation(function(){for(var D=I.firstLine(),_=I.lastLine();D<=_;D++)I.foldCode(y.Pos(D,0),{scanUp:!1},"fold")})},y.commands.unfoldAll=function(I){I.operation(function(){for(var D=I.firstLine(),_=I.lastLine();D<=_;D++)I.foldCode(y.Pos(D,0),{scanUp:!1},"unfold")})},y.registerHelper("fold","combine",function(){var I=Array.prototype.slice.call(arguments,0);return function(D,_){for(var T=0;T<I.length;++T){var B=I[T](D,_);if(B)return B}}}),y.registerHelper("fold","auto",function(I,D){for(var _=I.getHelpers(D,"fold"),T=0;T<_.length;T++){var B=_[T](I,D);if(B)return B}});var V={rangeFinder:y.fold.auto,widget:"↔",minFoldSize:0,scanUp:!1,clearOnEnter:!0};y.defineOption("foldOptions",null);function re(I,D,_){if(D&&D[_]!==void 0)return D[_];var T=I.options.foldOptions;return T&&T[_]!==void 0?T[_]:V[_]}y.defineExtension("foldOption",function(I,D){return re(this,I,D)})})})();var $u=Vu.exports;(function(We,Ie){(function(y){y(nt,$u)})(function(y){y.defineOption("foldGutter",!1,function(O,S,v){v&&v!=y.Init&&(O.clearGutter(O.state.foldGutter.options.gutter),O.state.foldGutter=null,O.off("gutterClick",B),O.off("changes",M),O.off("viewportChange",W),O.off("fold",Z),O.off("unfold",Z),O.off("swapDoc",M),O.off("optionChange",C)),S&&(O.state.foldGutter=new z(V(S)),T(O),O.on("gutterClick",B),O.on("changes",M),O.on("viewportChange",W),O.on("fold",Z),O.on("unfold",Z),O.on("swapDoc",M),O.on("optionChange",C))});var H=y.Pos;function z(O){this.options=O,this.from=this.to=0}function V(O){return O===!0&&(O={}),O.gutter==null&&(O.gutter="CodeMirror-foldgutter"),O.indicatorOpen==null&&(O.indicatorOpen="CodeMirror-foldgutter-open"),O.indicatorFolded==null&&(O.indicatorFolded="CodeMirror-foldgutter-folded"),O}function re(O,S){for(var v=O.findMarks(H(S,0),H(S+1,0)),g=0;g<v.length;++g)if(v[g].__isFold){var u=v[g].find(-1);if(u&&u.line===S)return v[g]}}function I(O){if(typeof O=="string"){var S=document.createElement("div");return S.className=O+" CodeMirror-guttermarker-subtle",S}else return O.cloneNode(!0)}function D(O,S,v){var g=O.state.foldGutter.options,u=S-1,p=O.foldOption(g,"minFoldSize"),m=O.foldOption(g,"rangeFinder"),w=typeof g.indicatorFolded=="string"&&_(g.indicatorFolded),d=typeof g.indicatorOpen=="string"&&_(g.indicatorOpen);O.eachLine(S,v,function(L){++u;var F=null,N=L.gutterMarkers;if(N&&(N=N[g.gutter]),re(O,u)){if(w&&N&&w.test(N.className))return;F=I(g.indicatorFolded)}else{var U=H(u,0),A=m&&m(O,U);if(A&&A.to.line-A.from.line>=p){if(d&&N&&d.test(N.className))return;F=I(g.indicatorOpen)}}!F&&!N||O.setGutterMarker(L,g.gutter,F)})}function _(O){return new RegExp("(^|\\s)"+O+"(?:$|\\s)\\s*")}function T(O){var S=O.getViewport(),v=O.state.foldGutter;v&&(O.operation(function(){D(O,S.from,S.to)}),v.from=S.from,v.to=S.to)}function B(O,S,v){var g=O.state.foldGutter;if(g){var u=g.options;if(v==u.gutter){var p=re(O,S);p?p.clear():O.foldCode(H(S,0),u)}}}function C(O,S){S=="mode"&&M(O)}function M(O){var S=O.state.foldGutter;if(S){var v=S.options;S.from=S.to=0,clearTimeout(S.changeUpdate),S.changeUpdate=setTimeout(function(){T(O)},v.foldOnChangeTimeSpan||600)}}function W(O){var S=O.state.foldGutter;if(S){var v=S.options;clearTimeout(S.changeUpdate),S.changeUpdate=setTimeout(function(){var g=O.getViewport();S.from==S.to||g.from-S.to>20||S.from-g.to>20?T(O):O.operation(function(){g.from<S.from&&(D(O,g.from,S.from),S.from=g.from),g.to>S.to&&(D(O,S.to,g.to),S.to=g.to)})},v.updateViewportTimeSpan||400)}}function Z(O,S){var v=O.state.foldGutter;if(v){var g=S.line;g>=v.from&&g<v.to&&D(O,g,g+1)}}})})();(function(We,Ie){(function(y){y(nt)})(function(y){function H(z){return function(V,re){var I=re.line,D=V.getLine(I);function _(Z){for(var O,S=re.ch,v=0;;){var g=S<=0?-1:D.lastIndexOf(Z[0],S-1);if(g==-1){if(v==1)break;v=1,S=D.length;continue}if(v==1&&g<re.ch)break;if(O=V.getTokenTypeAt(y.Pos(I,g+1)),!/^(comment|string)/.test(O))return{ch:g+1,tokenType:O,pair:Z};S=g-1}}function T(Z){var O=1,S=V.lastLine(),v,g=Z.ch,u;e:for(var p=I;p<=S;++p)for(var m=V.getLine(p),w=p==I?g:0;;){var d=m.indexOf(Z.pair[0],w),L=m.indexOf(Z.pair[1],w);if(d<0&&(d=m.length),L<0&&(L=m.length),w=Math.min(d,L),w==m.length)break;if(V.getTokenTypeAt(y.Pos(p,w+1))==Z.tokenType){if(w==d)++O;else if(!--O){v=p,u=w;break e}}++w}return v==null||I==v?null:{from:y.Pos(I,g),to:y.Pos(v,u)}}for(var B=[],C=0;C<z.length;C++){var M=_(z[C]);M&&B.push(M)}B.sort(function(Z,O){return Z.ch-O.ch});for(var C=0;C<B.length;C++){var W=T(B[C]);if(W)return W}return null}}y.registerHelper("fold","brace",H([["{","}"],["[","]"]])),y.registerHelper("fold","brace-paren",H([["{","}"],["[","]"],["(",")"]])),y.registerHelper("fold","import",function(z,V){function re(C){if(C<z.firstLine()||C>z.lastLine())return null;var M=z.getTokenAt(y.Pos(C,1));if(/\S/.test(M.string)||(M=z.getTokenAt(y.Pos(C,M.end+1))),M.type!="keyword"||M.string!="import")return null;for(var W=C,Z=Math.min(z.lastLine(),C+10);W<=Z;++W){var O=z.getLine(W),S=O.indexOf(";");if(S!=-1)return{startCh:M.end,end:y.Pos(W,S)}}}var I=V.line,D=re(I),_;if(!D||re(I-1)||(_=re(I-2))&&_.end.line==I-1)return null;for(var T=D.end;;){var B=re(T.line+1);if(B==null)break;T=B.end}return{from:z.clipPos(y.Pos(I,D.startCh+1)),to:T}}),y.registerHelper("fold","include",function(z,V){function re(B){if(B<z.firstLine()||B>z.lastLine())return null;var C=z.getTokenAt(y.Pos(B,1));if(/\S/.test(C.string)||(C=z.getTokenAt(y.Pos(B,C.end+1))),C.type=="meta"&&C.string.slice(0,8)=="#include")return C.start+8}var I=V.line,D=re(I);if(D==null||re(I-1)!=null)return null;for(var _=I;;){var T=re(_+1);if(T==null)break;++_}return{from:y.Pos(I,D+1),to:z.clipPos(y.Pos(_))}})})})();(function(We,Ie){(function(y){y(nt)})(function(y){function H(z,V){var re=z.getLine(V),I=re.search(/\S/);return I==-1||/\bcomment\b/.test(z.getTokenTypeAt(y.Pos(V,I+1)))?-1:y.countColumn(re,null,z.getOption("tabSize"))}y.registerHelper("fold","indent",function(z,V){var re=H(z,V.line);if(!(re<0)){for(var I=null,D=V.line+1,_=z.lastLine();D<=_;++D){var T=H(z,D);if(T!=-1)if(T>re)I=D;else break}if(I)return{from:y.Pos(V.line,z.getLine(V.line).length),to:y.Pos(I,z.getLine(I).length)}}})})})();(function(We,Ie){(function(y){y(nt)})(function(y){y.registerGlobalHelper("fold","comment",function(H){return H.blockCommentStart&&H.blockCommentEnd},function(H,z){var V=H.getModeAt(z),re=V.blockCommentStart,I=V.blockCommentEnd;if(!(!re||!I)){for(var D=z.line,_=H.getLine(D),T,B=z.ch,C=0;;){var M=B<=0?-1:_.lastIndexOf(re,B-1);if(M==-1){if(C==1)return;C=1,B=_.length;continue}if(C==1&&M<z.ch)return;if(/comment/.test(H.getTokenTypeAt(y.Pos(D,M+1)))&&(M==0||_.slice(M-I.length,M)==I||!/comment/.test(H.getTokenTypeAt(y.Pos(D,M))))){T=M+re.length;break}B=M-1}var W=1,Z=H.lastLine(),O,S;e:for(var v=D;v<=Z;++v)for(var g=H.getLine(v),u=v==D?T:0;;){var p=g.indexOf(re,u),m=g.indexOf(I,u);if(p<0&&(p=g.length),m<0&&(m=g.length),u=Math.min(p,m),u==g.length)break;if(u==p)++W;else if(!--W){O=v,S=u;break e}++u}if(!(O==null||D==O&&S==T))return{from:y.Pos(D,T),to:y.Pos(O,S)}}})})})();var wl={exports:{}},Sl;function ho(){return Sl||(Sl=1,function(We,Ie){(function(y){y(nt)})(function(y){var H=y.Pos;function z(v){var g=v.flags;return g??(v.ignoreCase?"i":"")+(v.global?"g":"")+(v.multiline?"m":"")}function V(v,g){for(var u=z(v),p=u,m=0;m<g.length;m++)p.indexOf(g.charAt(m))==-1&&(p+=g.charAt(m));return u==p?v:new RegExp(v.source,p)}function re(v){return/\\s|\\n|\n|\\W|\\D|\[\^/.test(v.source)}function I(v,g,u){g=V(g,"g");for(var p=u.line,m=u.ch,w=v.lastLine();p<=w;p++,m=0){g.lastIndex=m;var d=v.getLine(p),L=g.exec(d);if(L)return{from:H(p,L.index),to:H(p,L.index+L[0].length),match:L}}}function D(v,g,u){if(!re(g))return I(v,g,u);g=V(g,"gm");for(var p,m=1,w=u.line,d=v.lastLine();w<=d;){for(var L=0;L<m&&!(w>d);L++){var F=v.getLine(w++);p=p==null?F:p+`
`+F}m=m*2,g.lastIndex=u.ch;var N=g.exec(p);if(N){var U=p.slice(0,N.index).split(`
`),A=N[0].split(`
`),G=u.line+U.length-1,c=U[U.length-1].length;return{from:H(G,c),to:H(G+A.length-1,A.length==1?c+A[0].length:A[A.length-1].length),match:N}}}}function _(v,g,u){for(var p,m=0;m<=v.length;){g.lastIndex=m;var w=g.exec(v);if(!w)break;var d=w.index+w[0].length;if(d>v.length-u)break;(!p||d>p.index+p[0].length)&&(p=w),m=w.index+1}return p}function T(v,g,u){g=V(g,"g");for(var p=u.line,m=u.ch,w=v.firstLine();p>=w;p--,m=-1){var d=v.getLine(p),L=_(d,g,m<0?0:d.length-m);if(L)return{from:H(p,L.index),to:H(p,L.index+L[0].length),match:L}}}function B(v,g,u){if(!re(g))return T(v,g,u);g=V(g,"gm");for(var p,m=1,w=v.getLine(u.line).length-u.ch,d=u.line,L=v.firstLine();d>=L;){for(var F=0;F<m&&d>=L;F++){var N=v.getLine(d--);p=p==null?N:N+`
`+p}m*=2;var U=_(p,g,w);if(U){var A=p.slice(0,U.index).split(`
`),G=U[0].split(`
`),c=d+A.length,Q=A[A.length-1].length;return{from:H(c,Q),to:H(c+G.length-1,G.length==1?Q+G[0].length:G[G.length-1].length),match:U}}}}var C,M;String.prototype.normalize?(C=function(v){return v.normalize("NFD").toLowerCase()},M=function(v){return v.normalize("NFD")}):(C=function(v){return v.toLowerCase()},M=function(v){return v});function W(v,g,u,p){if(v.length==g.length)return u;for(var m=0,w=u+Math.max(0,v.length-g.length);;){if(m==w)return m;var d=m+w>>1,L=p(v.slice(0,d)).length;if(L==u)return d;L>u?w=d:m=d+1}}function Z(v,g,u,p){if(!g.length)return null;var m=p?C:M,w=m(g).split(/\r|\n\r?/);e:for(var d=u.line,L=u.ch,F=v.lastLine()+1-w.length;d<=F;d++,L=0){var N=v.getLine(d).slice(L),U=m(N);if(w.length==1){var A=U.indexOf(w[0]);if(A==-1)continue e;var u=W(N,U,A,m)+L;return{from:H(d,W(N,U,A,m)+L),to:H(d,W(N,U,A+w[0].length,m)+L)}}else{var G=U.length-w[0].length;if(U.slice(G)!=w[0])continue e;for(var c=1;c<w.length-1;c++)if(m(v.getLine(d+c))!=w[c])continue e;var Q=v.getLine(d+w.length-1),j=m(Q),ne=w[w.length-1];if(j.slice(0,ne.length)!=ne)continue e;return{from:H(d,W(N,U,G,m)+L),to:H(d+w.length-1,W(Q,j,ne.length,m))}}}}function O(v,g,u,p){if(!g.length)return null;var m=p?C:M,w=m(g).split(/\r|\n\r?/);e:for(var d=u.line,L=u.ch,F=v.firstLine()-1+w.length;d>=F;d--,L=-1){var N=v.getLine(d);L>-1&&(N=N.slice(0,L));var U=m(N);if(w.length==1){var A=U.lastIndexOf(w[0]);if(A==-1)continue e;return{from:H(d,W(N,U,A,m)),to:H(d,W(N,U,A+w[0].length,m))}}else{var G=w[w.length-1];if(U.slice(0,G.length)!=G)continue e;for(var c=1,u=d-w.length+1;c<w.length-1;c++)if(m(v.getLine(u+c))!=w[c])continue e;var Q=v.getLine(d+1-w.length),j=m(Q);if(j.slice(j.length-w[0].length)!=w[0])continue e;return{from:H(d+1-w.length,W(Q,j,Q.length-w[0].length,m)),to:H(d,W(N,U,G.length,m))}}}}function S(v,g,u,p){this.atOccurrence=!1,this.afterEmptyMatch=!1,this.doc=v,u=u?v.clipPos(u):H(0,0),this.pos={from:u,to:u};var m;typeof p=="object"?m=p.caseFold:(m=p,p=null),typeof g=="string"?(m==null&&(m=!1),this.matches=function(w,d){return(w?O:Z)(v,g,d,m)}):(g=V(g,"gm"),!p||p.multiline!==!1?this.matches=function(w,d){return(w?B:D)(v,g,d)}:this.matches=function(w,d){return(w?T:I)(v,g,d)})}S.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(v){var g=this.doc.clipPos(v?this.pos.from:this.pos.to);if(this.afterEmptyMatch&&this.atOccurrence&&(g=H(g.line,g.ch),v?(g.ch--,g.ch<0&&(g.line--,g.ch=(this.doc.getLine(g.line)||"").length)):(g.ch++,g.ch>(this.doc.getLine(g.line)||"").length&&(g.ch=0,g.line++)),y.cmpPos(g,this.doc.clipPos(g))!=0))return this.atOccurrence=!1;var u=this.matches(v,g);if(this.afterEmptyMatch=u&&y.cmpPos(u.from,u.to)==0,u)return this.pos=u,this.atOccurrence=!0,this.pos.match||!0;var p=H(v?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:p,to:p},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(v,g){if(this.atOccurrence){var u=y.splitLines(v);this.doc.replaceRange(u,this.pos.from,this.pos.to,g),this.pos.to=H(this.pos.from.line+u.length-1,u[u.length-1].length+(u.length==1?this.pos.from.ch:0))}}},y.defineExtension("getSearchCursor",function(v,g,u){return new S(this.doc,v,g,u)}),y.defineDocExtension("getSearchCursor",function(v,g,u){return new S(this,v,g,u)}),y.defineExtension("selectMatches",function(v,g){for(var u=[],p=this.getSearchCursor(v,this.getCursor("from"),g);p.findNext()&&!(y.cmpPos(p.to(),this.getCursor("to"))>0);)u.push({anchor:p.from(),head:p.to()});u.length&&this.setSelections(u,0)})})}()),wl.exports}var Cl={exports:{}},Ll;function Fl(){return Ll||(Ll=1,function(We,Ie){(function(y){y(nt)})(function(y){function H(V,re,I){var D=V.getWrapperElement(),_;return _=D.appendChild(document.createElement("div")),I?_.className="CodeMirror-dialog CodeMirror-dialog-bottom":_.className="CodeMirror-dialog CodeMirror-dialog-top",typeof re=="string"?_.innerHTML=re:_.appendChild(re),y.addClass(D,"dialog-opened"),_}function z(V,re){V.state.currentNotificationClose&&V.state.currentNotificationClose(),V.state.currentNotificationClose=re}y.defineExtension("openDialog",function(V,re,I){I||(I={}),z(this,null);var D=H(this,V,I.bottom),_=!1,T=this;function B(W){if(typeof W=="string")C.value=W;else{if(_)return;_=!0,y.rmClass(D.parentNode,"dialog-opened"),D.parentNode.removeChild(D),T.focus(),I.onClose&&I.onClose(D)}}var C=D.getElementsByTagName("input")[0],M;return C?(C.focus(),I.value&&(C.value=I.value,I.selectValueOnOpen!==!1&&C.select()),I.onInput&&y.on(C,"input",function(W){I.onInput(W,C.value,B)}),I.onKeyUp&&y.on(C,"keyup",function(W){I.onKeyUp(W,C.value,B)}),y.on(C,"keydown",function(W){I&&I.onKeyDown&&I.onKeyDown(W,C.value,B)||((W.keyCode==27||I.closeOnEnter!==!1&&W.keyCode==13)&&(C.blur(),y.e_stop(W),B()),W.keyCode==13&&re(C.value,W))}),I.closeOnBlur!==!1&&y.on(D,"focusout",function(W){W.relatedTarget!==null&&B()})):(M=D.getElementsByTagName("button")[0])&&(y.on(M,"click",function(){B(),T.focus()}),I.closeOnBlur!==!1&&y.on(M,"blur",B),M.focus()),B}),y.defineExtension("openConfirm",function(V,re,I){z(this,null);var D=H(this,V,I&&I.bottom),_=D.getElementsByTagName("button"),T=!1,B=this,C=1;function M(){T||(T=!0,y.rmClass(D.parentNode,"dialog-opened"),D.parentNode.removeChild(D),B.focus())}_[0].focus();for(var W=0;W<_.length;++W){var Z=_[W];(function(O){y.on(Z,"click",function(S){y.e_preventDefault(S),M(),O&&O(B)})})(re[W]),y.on(Z,"blur",function(){--C,setTimeout(function(){C<=0&&M()},200)}),y.on(Z,"focus",function(){++C})}}),y.defineExtension("openNotification",function(V,re){z(this,B);var I=H(this,V,re&&re.bottom),D=!1,_,T=re&&typeof re.duration<"u"?re.duration:5e3;function B(){D||(D=!0,clearTimeout(_),y.rmClass(I.parentNode,"dialog-opened"),I.parentNode.removeChild(I))}return y.on(I,"click",function(C){y.e_preventDefault(C),B()}),T&&(_=setTimeout(B,T)),B})})}()),Cl.exports}(function(We,Ie){(function(y){y(nt,ho(),Fl())})(function(y){y.defineOption("search",{bottom:!1});function H(d,L){return typeof d=="string"?d=new RegExp(d.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),L?"gi":"g"):d.global||(d=new RegExp(d.source,d.ignoreCase?"gi":"g")),{token:function(F){d.lastIndex=F.pos;var N=d.exec(F.string);if(N&&N.index==F.pos)return F.pos+=N[0].length||1,"searching";N?F.pos=N.index:F.skipToEnd()}}}function z(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function V(d){return d.state.search||(d.state.search=new z)}function re(d){return typeof d=="string"&&d==d.toLowerCase()}function I(d,L,F){return d.getSearchCursor(L,F,{caseFold:re(L),multiline:!0})}function D(d,L,F,N,U){d.openDialog(L,N,{value:F,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){O(d)},onKeyDown:U,bottom:d.options.search.bottom})}function _(d,L,F,N,U){d.openDialog?d.openDialog(L,U,{value:N,selectValueOnOpen:!0,bottom:d.options.search.bottom}):U(prompt(F,N))}function T(d,L,F,N){d.openConfirm?d.openConfirm(L,N):confirm(F)&&N[0]()}function B(d){return d.replace(/\\([nrt\\])/g,function(L,F){return F=="n"?`
`:F=="r"?"\r":F=="t"?" ":F=="\\"?"\\":L})}function C(d){var L=d.match(/^\/(.*)\/([a-z]*)$/);if(L)try{d=new RegExp(L[1],L[2].indexOf("i")==-1?"":"i")}catch{}else d=B(d);return(typeof d=="string"?d=="":d.test(""))&&(d=/x^/),d}function M(d,L,F){L.queryText=F,L.query=C(F),d.removeOverlay(L.overlay,re(L.query)),L.overlay=H(L.query,re(L.query)),d.addOverlay(L.overlay),d.showMatchesOnScrollbar&&(L.annotate&&(L.annotate.clear(),L.annotate=null),L.annotate=d.showMatchesOnScrollbar(L.query,re(L.query)))}function W(d,L,F,N){var U=V(d);if(U.query)return Z(d,L);var A=d.getSelection()||U.lastQuery;if(A instanceof RegExp&&A.source=="x^"&&(A=null),F&&d.openDialog){var G=null,c=function(Q,j){y.e_stop(j),Q&&(Q!=U.queryText&&(M(d,U,Q),U.posFrom=U.posTo=d.getCursor()),G&&(G.style.opacity=1),Z(d,j.shiftKey,function(ne,fe){var ce;fe.line<3&&document.querySelector&&(ce=d.display.wrapper.querySelector(".CodeMirror-dialog"))&&ce.getBoundingClientRect().bottom-4>d.cursorCoords(fe,"window").top&&((G=ce).style.opacity=.4)}))};D(d,v(d),A,c,function(Q,j){var ne=y.keyName(Q),fe=d.getOption("extraKeys"),ce=fe&&fe[ne]||y.keyMap[d.getOption("keyMap")][ne];ce=="findNext"||ce=="findPrev"||ce=="findPersistentNext"||ce=="findPersistentPrev"?(y.e_stop(Q),M(d,V(d),j),d.execCommand(ce)):(ce=="find"||ce=="findPersistent")&&(y.e_stop(Q),c(j,Q))}),N&&A&&(M(d,U,A),Z(d,L))}else _(d,v(d),"Search for:",A,function(Q){Q&&!U.query&&d.operation(function(){M(d,U,Q),U.posFrom=U.posTo=d.getCursor(),Z(d,L)})})}function Z(d,L,F){d.operation(function(){var N=V(d),U=I(d,N.query,L?N.posFrom:N.posTo);!U.find(L)&&(U=I(d,N.query,L?y.Pos(d.lastLine()):y.Pos(d.firstLine(),0)),!U.find(L))||(d.setSelection(U.from(),U.to()),d.scrollIntoView({from:U.from(),to:U.to()},20),N.posFrom=U.from(),N.posTo=U.to(),F&&F(U.from(),U.to()))})}function O(d){d.operation(function(){var L=V(d);L.lastQuery=L.query,L.query&&(L.query=L.queryText=null,d.removeOverlay(L.overlay),L.annotate&&(L.annotate.clear(),L.annotate=null))})}function S(d,L){var F=d?document.createElement(d):document.createDocumentFragment();for(var N in L)F[N]=L[N];for(var U=2;U<arguments.length;U++){var A=arguments[U];F.appendChild(typeof A=="string"?document.createTextNode(A):A)}return F}function v(d){var L=S("label",{className:"CodeMirror-search-label"},d.phrase("Search:"),S("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field",id:"CodeMirror-search-field"}));return L.setAttribute("for","CodeMirror-search-field"),S("",null,L," ",S("span",{style:"color: #666",className:"CodeMirror-search-hint"},d.phrase("(Use /re/ syntax for regexp search)")))}function g(d){return S("",null," ",S("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"})," ",S("span",{style:"color: #666",className:"CodeMirror-search-hint"},d.phrase("(Use /re/ syntax for regexp search)")))}function u(d){return S("",null,S("span",{className:"CodeMirror-search-label"},d.phrase("With:"))," ",S("input",{type:"text",style:"width: 10em",className:"CodeMirror-search-field"}))}function p(d){return S("",null,S("span",{className:"CodeMirror-search-label"},d.phrase("Replace?"))," ",S("button",{},d.phrase("Yes"))," ",S("button",{},d.phrase("No"))," ",S("button",{},d.phrase("All"))," ",S("button",{},d.phrase("Stop")))}function m(d,L,F){d.operation(function(){for(var N=I(d,L);N.findNext();)if(typeof L!="string"){var U=d.getRange(N.from(),N.to()).match(L);N.replace(F.replace(/\$(\d)/g,function(A,G){return U[G]}))}else N.replace(F)})}function w(d,L){if(!d.getOption("readOnly")){var F=d.getSelection()||V(d).lastQuery,N=L?d.phrase("Replace all:"):d.phrase("Replace:"),U=S("",null,S("span",{className:"CodeMirror-search-label"},N),g(d));_(d,U,N,F,function(A){A&&(A=C(A),_(d,u(d),d.phrase("Replace with:"),"",function(G){if(G=B(G),L)m(d,A,G);else{O(d);var c=I(d,A,d.getCursor("from")),Q=function(){var ne=c.from(),fe;!(fe=c.findNext())&&(c=I(d,A),!(fe=c.findNext())||ne&&c.from().line==ne.line&&c.from().ch==ne.ch)||(d.setSelection(c.from(),c.to()),d.scrollIntoView({from:c.from(),to:c.to()}),T(d,p(d),d.phrase("Replace?"),[function(){j(fe)},Q,function(){m(d,A,G)}]))},j=function(ne){c.replace(typeof A=="string"?G:G.replace(/\$(\d)/g,function(fe,ce){return ne[ce]})),Q()};Q()}}))})}}y.commands.find=function(d){O(d),W(d)},y.commands.findPersistent=function(d){O(d),W(d,!1,!0)},y.commands.findPersistentNext=function(d){W(d,!1,!0,!0)},y.commands.findPersistentPrev=function(d){W(d,!0,!0,!0)},y.commands.findNext=W,y.commands.findPrev=function(d){W(d,!0)},y.commands.clearSearch=O,y.commands.replace=w,y.commands.replaceAll=function(d){w(d,!0)}})})();ho();Fl();var Tl={exports:{}},Al;function ef(){return Al||(Al=1,function(We,Ie){(function(y){y(nt)})(function(y){var H=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),z=y.Pos,V={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function re(C){return C&&C.bracketRegex||/[(){}[\]]/}function I(C,M,W){var Z=C.getLineHandle(M.line),O=M.ch-1,S=W&&W.afterCursor;S==null&&(S=/(^| )cm-fat-cursor($| )/.test(C.getWrapperElement().className));var v=re(W),g=!S&&O>=0&&v.test(Z.text.charAt(O))&&V[Z.text.charAt(O)]||v.test(Z.text.charAt(O+1))&&V[Z.text.charAt(++O)];if(!g)return null;var u=g.charAt(1)==">"?1:-1;if(W&&W.strict&&u>0!=(O==M.ch))return null;var p=C.getTokenTypeAt(z(M.line,O+1)),m=D(C,z(M.line,O+(u>0?1:0)),u,p,W);return m==null?null:{from:z(M.line,O),to:m&&m.pos,match:m&&m.ch==g.charAt(0),forward:u>0}}function D(C,M,W,Z,O){for(var S=O&&O.maxScanLineLength||1e4,v=O&&O.maxScanLines||1e3,g=[],u=re(O),p=W>0?Math.min(M.line+v,C.lastLine()+1):Math.max(C.firstLine()-1,M.line-v),m=M.line;m!=p;m+=W){var w=C.getLine(m);if(w){var d=W>0?0:w.length-1,L=W>0?w.length:-1;if(!(w.length>S))for(m==M.line&&(d=M.ch-(W<0?1:0));d!=L;d+=W){var F=w.charAt(d);if(u.test(F)&&(Z===void 0||(C.getTokenTypeAt(z(m,d+1))||"")==(Z||""))){var N=V[F];if(N&&N.charAt(1)==">"==W>0)g.push(F);else if(g.length)g.pop();else return{pos:z(m,d),ch:F}}}}}return m-W==(W>0?C.lastLine():C.firstLine())?!1:null}function _(C,M,W){for(var Z=C.state.matchBrackets.maxHighlightLineLength||1e3,O=W&&W.highlightNonMatching,S=[],v=C.listSelections(),g=0;g<v.length;g++){var u=v[g].empty()&&I(C,v[g].head,W);if(u&&(u.match||O!==!1)&&C.getLine(u.from.line).length<=Z){var p=u.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";S.push(C.markText(u.from,z(u.from.line,u.from.ch+1),{className:p})),u.to&&C.getLine(u.to.line).length<=Z&&S.push(C.markText(u.to,z(u.to.line,u.to.ch+1),{className:p}))}}if(S.length){H&&C.state.focused&&C.focus();var m=function(){C.operation(function(){for(var w=0;w<S.length;w++)S[w].clear()})};if(M)setTimeout(m,800);else return m}}function T(C){C.operation(function(){C.state.matchBrackets.currentlyHighlighted&&(C.state.matchBrackets.currentlyHighlighted(),C.state.matchBrackets.currentlyHighlighted=null),C.state.matchBrackets.currentlyHighlighted=_(C,!1,C.state.matchBrackets)})}function B(C){C.state.matchBrackets&&C.state.matchBrackets.currentlyHighlighted&&(C.state.matchBrackets.currentlyHighlighted(),C.state.matchBrackets.currentlyHighlighted=null)}y.defineOption("matchBrackets",!1,function(C,M,W){W&&W!=y.Init&&(C.off("cursorActivity",T),C.off("focus",T),C.off("blur",B),B(C)),M&&(C.state.matchBrackets=typeof M=="object"?M:{},C.on("cursorActivity",T),C.on("focus",T),C.on("blur",B))}),y.defineExtension("matchBrackets",function(){_(this,!0)}),y.defineExtension("findMatchingBracket",function(C,M,W){return(W||typeof M=="boolean")&&(W?(W.strict=M,M=W):M=M?{strict:!0}:null),I(this,C,M)}),y.defineExtension("scanForBracket",function(C,M,W,Z){return D(this,C,M,W,Z)})})}()),Tl.exports}(function(We,Ie){(function(y){y(nt,ho(),ef())})(function(y){var H=y.commands,z=y.Pos;function V(u,p,m){if(m<0&&p.ch==0)return u.clipPos(z(p.line-1));var w=u.getLine(p.line);if(m>0&&p.ch>=w.length)return u.clipPos(z(p.line+1,0));for(var d="start",L,F=p.ch,N=F,U=m<0?0:w.length,A=0;N!=U;N+=m,A++){var G=w.charAt(m<0?N-1:N),c=G!="_"&&y.isWordChar(G)?"w":"o";if(c=="w"&&G.toUpperCase()==G&&(c="W"),d=="start")c!="o"?(d="in",L=c):F=N+m;else if(d=="in"&&L!=c){if(L=="w"&&c=="W"&&m<0&&N--,L=="W"&&c=="w"&&m>0)if(N==F+1){L="w";continue}else N--;break}}return z(p.line,N)}function re(u,p){u.extendSelectionsBy(function(m){return u.display.shift||u.doc.extend||m.empty()?V(u.doc,m.head,p):p<0?m.from():m.to()})}H.goSubwordLeft=function(u){re(u,-1)},H.goSubwordRight=function(u){re(u,1)},H.scrollLineUp=function(u){var p=u.getScrollInfo();if(!u.somethingSelected()){var m=u.lineAtHeight(p.top+p.clientHeight,"local");u.getCursor().line>=m&&u.execCommand("goLineUp")}u.scrollTo(null,p.top-u.defaultTextHeight())},H.scrollLineDown=function(u){var p=u.getScrollInfo();if(!u.somethingSelected()){var m=u.lineAtHeight(p.top,"local")+1;u.getCursor().line<=m&&u.execCommand("goLineDown")}u.scrollTo(null,p.top+u.defaultTextHeight())},H.splitSelectionByLine=function(u){for(var p=u.listSelections(),m=[],w=0;w<p.length;w++)for(var d=p[w].from(),L=p[w].to(),F=d.line;F<=L.line;++F)L.line>d.line&&F==L.line&&L.ch==0||m.push({anchor:F==d.line?d:z(F,0),head:F==L.line?L:z(F)});u.setSelections(m,0)},H.singleSelectionTop=function(u){var p=u.listSelections()[0];u.setSelection(p.anchor,p.head,{scroll:!1})},H.selectLine=function(u){for(var p=u.listSelections(),m=[],w=0;w<p.length;w++){var d=p[w];m.push({anchor:z(d.from().line,0),head:z(d.to().line+1,0)})}u.setSelections(m)};function I(u,p){if(u.isReadOnly())return y.Pass;u.operation(function(){for(var m=u.listSelections().length,w=[],d=-1,L=0;L<m;L++){var F=u.listSelections()[L].head;if(!(F.line<=d)){var N=z(F.line+(p?0:1),0);u.replaceRange(`
`,N,null,"+insertLine"),u.indentLine(N.line,null,!0),w.push({head:N,anchor:N}),d=F.line+1}}u.setSelections(w)}),u.execCommand("indentAuto")}H.insertLineAfter=function(u){return I(u,!1)},H.insertLineBefore=function(u){return I(u,!0)};function D(u,p){for(var m=p.ch,w=m,d=u.getLine(p.line);m&&y.isWordChar(d.charAt(m-1));)--m;for(;w<d.length&&y.isWordChar(d.charAt(w));)++w;return{from:z(p.line,m),to:z(p.line,w),word:d.slice(m,w)}}H.selectNextOccurrence=function(u){var p=u.getCursor("from"),m=u.getCursor("to"),w=u.state.sublimeFindFullWord==u.doc.sel;if(y.cmpPos(p,m)==0){var d=D(u,p);if(!d.word)return;u.setSelection(d.from,d.to),w=!0}else{var L=u.getRange(p,m),F=w?new RegExp("\\b"+L+"\\b"):L,N=u.getSearchCursor(F,m),U=N.findNext();if(U||(N=u.getSearchCursor(F,z(u.firstLine(),0)),U=N.findNext()),!U||T(u.listSelections(),N.from(),N.to()))return;u.addSelection(N.from(),N.to())}w&&(u.state.sublimeFindFullWord=u.doc.sel)},H.skipAndSelectNextOccurrence=function(u){var p=u.getCursor("anchor"),m=u.getCursor("head");H.selectNextOccurrence(u),y.cmpPos(p,m)!=0&&u.doc.setSelections(u.doc.listSelections().filter(function(w){return w.anchor!=p||w.head!=m}))};function _(u,p){for(var m=u.listSelections(),w=[],d=0;d<m.length;d++){var L=m[d],F=u.findPosV(L.anchor,p,"line",L.anchor.goalColumn),N=u.findPosV(L.head,p,"line",L.head.goalColumn);F.goalColumn=L.anchor.goalColumn!=null?L.anchor.goalColumn:u.cursorCoords(L.anchor,"div").left,N.goalColumn=L.head.goalColumn!=null?L.head.goalColumn:u.cursorCoords(L.head,"div").left;var U={anchor:F,head:N};w.push(L),w.push(U)}u.setSelections(w)}H.addCursorToPrevLine=function(u){_(u,-1)},H.addCursorToNextLine=function(u){_(u,1)};function T(u,p,m){for(var w=0;w<u.length;w++)if(y.cmpPos(u[w].from(),p)==0&&y.cmpPos(u[w].to(),m)==0)return!0;return!1}var B="(){}[]";function C(u){for(var p=u.listSelections(),m=[],w=0;w<p.length;w++){var d=p[w],L=d.head,F=u.scanForBracket(L,-1);if(!F)return!1;for(;;){var N=u.scanForBracket(L,1);if(!N)return!1;if(N.ch==B.charAt(B.indexOf(F.ch)+1)){var U=z(F.pos.line,F.pos.ch+1);if(y.cmpPos(U,d.from())==0&&y.cmpPos(N.pos,d.to())==0){if(F=u.scanForBracket(F.pos,-1),!F)return!1}else{m.push({anchor:U,head:N.pos});break}}L=z(N.pos.line,N.pos.ch+1)}}return u.setSelections(m),!0}H.selectScope=function(u){C(u)||u.execCommand("selectAll")},H.selectBetweenBrackets=function(u){if(!C(u))return y.Pass};function M(u){return u?/\bpunctuation\b/.test(u)?u:void 0:null}H.goToBracket=function(u){u.extendSelectionsBy(function(p){var m=u.scanForBracket(p.head,1,M(u.getTokenTypeAt(p.head)));if(m&&y.cmpPos(m.pos,p.head)!=0)return m.pos;var w=u.scanForBracket(p.head,-1,M(u.getTokenTypeAt(z(p.head.line,p.head.ch+1))));return w&&z(w.pos.line,w.pos.ch+1)||p.head})},H.swapLineUp=function(u){if(u.isReadOnly())return y.Pass;for(var p=u.listSelections(),m=[],w=u.firstLine()-1,d=[],L=0;L<p.length;L++){var F=p[L],N=F.from().line-1,U=F.to().line;d.push({anchor:z(F.anchor.line-1,F.anchor.ch),head:z(F.head.line-1,F.head.ch)}),F.to().ch==0&&!F.empty()&&--U,N>w?m.push(N,U):m.length&&(m[m.length-1]=U),w=U}u.operation(function(){for(var A=0;A<m.length;A+=2){var G=m[A],c=m[A+1],Q=u.getLine(G);u.replaceRange("",z(G,0),z(G+1,0),"+swapLine"),c>u.lastLine()?u.replaceRange(`
`+Q,z(u.lastLine()),null,"+swapLine"):u.replaceRange(Q+`
`,z(c,0),null,"+swapLine")}u.setSelections(d),u.scrollIntoView()})},H.swapLineDown=function(u){if(u.isReadOnly())return y.Pass;for(var p=u.listSelections(),m=[],w=u.lastLine()+1,d=p.length-1;d>=0;d--){var L=p[d],F=L.to().line+1,N=L.from().line;L.to().ch==0&&!L.empty()&&F--,F<w?m.push(F,N):m.length&&(m[m.length-1]=N),w=N}u.operation(function(){for(var U=m.length-2;U>=0;U-=2){var A=m[U],G=m[U+1],c=u.getLine(A);A==u.lastLine()?u.replaceRange("",z(A-1),z(A),"+swapLine"):u.replaceRange("",z(A,0),z(A+1,0),"+swapLine"),u.replaceRange(c+`
`,z(G,0),null,"+swapLine")}u.scrollIntoView()})},H.toggleCommentIndented=function(u){u.toggleComment({indent:!0})},H.joinLines=function(u){for(var p=u.listSelections(),m=[],w=0;w<p.length;w++){for(var d=p[w],L=d.from(),F=L.line,N=d.to().line;w<p.length-1&&p[w+1].from().line==N;)N=p[++w].to().line;m.push({start:F,end:N,anchor:!d.empty()&&L})}u.operation(function(){for(var U=0,A=[],G=0;G<m.length;G++){for(var c=m[G],Q=c.anchor&&z(c.anchor.line-U,c.anchor.ch),j,ne=c.start;ne<=c.end;ne++){var fe=ne-U;ne==c.end&&(j=z(fe,u.getLine(fe).length+1)),fe<u.lastLine()&&(u.replaceRange(" ",z(fe),z(fe+1,/^\s*/.exec(u.getLine(fe+1))[0].length)),++U)}A.push({anchor:Q||j,head:j})}u.setSelections(A,0)})},H.duplicateLine=function(u){u.operation(function(){for(var p=u.listSelections().length,m=0;m<p;m++){var w=u.listSelections()[m];w.empty()?u.replaceRange(u.getLine(w.head.line)+`
`,z(w.head.line,0)):u.replaceRange(u.getRange(w.from(),w.to()),w.from())}u.scrollIntoView()})};function W(u,p,m){if(u.isReadOnly())return y.Pass;for(var w=u.listSelections(),d=[],L,F=0;F<w.length;F++){var N=w[F];if(!N.empty()){for(var U=N.from().line,A=N.to().line;F<w.length-1&&w[F+1].from().line==A;)A=w[++F].to().line;w[F].to().ch||A--,d.push(U,A)}}d.length?L=!0:d.push(u.firstLine(),u.lastLine()),u.operation(function(){for(var G=[],c=0;c<d.length;c+=2){var Q=d[c],j=d[c+1],ne=z(Q,0),fe=z(j),ce=u.getRange(ne,fe,!1);p?ce.sort(function(we,Be){return we<Be?-m:we==Be?0:m}):ce.sort(function(we,Be){var Me=we.toUpperCase(),Ge=Be.toUpperCase();return Me!=Ge&&(we=Me,Be=Ge),we<Be?-m:we==Be?0:m}),u.replaceRange(ce,ne,fe),L&&G.push({anchor:ne,head:z(j+1,0)})}L&&u.setSelections(G,0)})}H.sortLines=function(u){W(u,!0,1)},H.reverseSortLines=function(u){W(u,!0,-1)},H.sortLinesInsensitive=function(u){W(u,!1,1)},H.reverseSortLinesInsensitive=function(u){W(u,!1,-1)},H.nextBookmark=function(u){var p=u.state.sublimeBookmarks;if(p)for(;p.length;){var m=p.shift(),w=m.find();if(w)return p.push(m),u.setSelection(w.from,w.to)}},H.prevBookmark=function(u){var p=u.state.sublimeBookmarks;if(p)for(;p.length;){p.unshift(p.pop());var m=p[p.length-1].find();if(!m)p.pop();else return u.setSelection(m.from,m.to)}},H.toggleBookmark=function(u){for(var p=u.listSelections(),m=u.state.sublimeBookmarks||(u.state.sublimeBookmarks=[]),w=0;w<p.length;w++){for(var d=p[w].from(),L=p[w].to(),F=p[w].empty()?u.findMarksAt(d):u.findMarks(d,L),N=0;N<F.length;N++)if(F[N].sublimeBookmark){F[N].clear();for(var U=0;U<m.length;U++)m[U]==F[N]&&m.splice(U--,1);break}N==F.length&&m.push(u.markText(d,L,{sublimeBookmark:!0,clearWhenEmpty:!1}))}},H.clearBookmarks=function(u){var p=u.state.sublimeBookmarks;if(p)for(var m=0;m<p.length;m++)p[m].clear();p.length=0},H.selectBookmarks=function(u){var p=u.state.sublimeBookmarks,m=[];if(p)for(var w=0;w<p.length;w++){var d=p[w].find();d?m.push({anchor:d.from,head:d.to}):p.splice(w--,0)}m.length&&u.setSelections(m,0)};function Z(u,p){u.operation(function(){for(var m=u.listSelections(),w=[],d=[],L=0;L<m.length;L++){var F=m[L];F.empty()?(w.push(L),d.push("")):d.push(p(u.getRange(F.from(),F.to())))}u.replaceSelections(d,"around","case");for(var L=w.length-1,N;L>=0;L--){var F=m[w[L]];if(!(N&&y.cmpPos(F.head,N)>0)){var U=D(u,F.head);N=U.from,u.replaceRange(p(U.word),U.from,U.to)}}})}H.smartBackspace=function(u){if(u.somethingSelected())return y.Pass;u.operation(function(){for(var p=u.listSelections(),m=u.getOption("indentUnit"),w=p.length-1;w>=0;w--){var d=p[w].head,L=u.getRange({line:d.line,ch:0},d),F=y.countColumn(L,null,u.getOption("tabSize")),N=u.findPosH(d,-1,"char",!1);if(L&&!/\S/.test(L)&&F%m==0){var U=new z(d.line,y.findColumn(L,F-m,m));U.ch!=d.ch&&(N=U)}u.replaceRange("",N,d,"+delete")}})},H.delLineRight=function(u){u.operation(function(){for(var p=u.listSelections(),m=p.length-1;m>=0;m--)u.replaceRange("",p[m].anchor,z(p[m].to().line),"+delete");u.scrollIntoView()})},H.upcaseAtCursor=function(u){Z(u,function(p){return p.toUpperCase()})},H.downcaseAtCursor=function(u){Z(u,function(p){return p.toLowerCase()})},H.setSublimeMark=function(u){u.state.sublimeMark&&u.state.sublimeMark.clear(),u.state.sublimeMark=u.setBookmark(u.getCursor())},H.selectToSublimeMark=function(u){var p=u.state.sublimeMark&&u.state.sublimeMark.find();p&&u.setSelection(u.getCursor(),p)},H.deleteToSublimeMark=function(u){var p=u.state.sublimeMark&&u.state.sublimeMark.find();if(p){var m=u.getCursor(),w=p;if(y.cmpPos(m,w)>0){var d=w;w=m,m=d}u.state.sublimeKilled=u.getRange(m,w),u.replaceRange("",m,w)}},H.swapWithSublimeMark=function(u){var p=u.state.sublimeMark&&u.state.sublimeMark.find();p&&(u.state.sublimeMark.clear(),u.state.sublimeMark=u.setBookmark(u.getCursor()),u.setCursor(p))},H.sublimeYank=function(u){u.state.sublimeKilled!=null&&u.replaceSelection(u.state.sublimeKilled,null,"paste")},H.showInCenter=function(u){var p=u.cursorCoords(null,"local");u.scrollTo(null,(p.top+p.bottom)/2-u.getScrollInfo().clientHeight/2)};function O(u){var p=u.getCursor("from"),m=u.getCursor("to");if(y.cmpPos(p,m)==0){var w=D(u,p);if(!w.word)return;p=w.from,m=w.to}return{from:p,to:m,query:u.getRange(p,m),word:w}}function S(u,p){var m=O(u);if(m){var w=m.query,d=u.getSearchCursor(w,p?m.to:m.from);(p?d.findNext():d.findPrevious())?u.setSelection(d.from(),d.to()):(d=u.getSearchCursor(w,p?z(u.firstLine(),0):u.clipPos(z(u.lastLine()))),(p?d.findNext():d.findPrevious())?u.setSelection(d.from(),d.to()):m.word&&u.setSelection(m.from,m.to))}}H.findUnder=function(u){S(u,!0)},H.findUnderPrevious=function(u){S(u,!1)},H.findAllUnder=function(u){var p=O(u);if(p){for(var m=u.getSearchCursor(p.query),w=[],d=-1;m.findNext();)w.push({anchor:m.from(),head:m.to()}),m.from().line<=p.from.line&&m.from().ch<=p.from.ch&&d++;u.setSelections(w,d)}};var v=y.keyMap;v.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Shift-F5":"reverseSortLines","Cmd-F5":"sortLinesInsensitive","Shift-Cmd-F5":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},y.normalizeKeyMap(v.macSublime),v.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Shift-F9":"reverseSortLines","Ctrl-F9":"sortLinesInsensitive","Shift-Ctrl-F9":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},y.normalizeKeyMap(v.pcSublime);var g=v.default==v.macDefault;v.sublime=g?v.macSublime:v.pcSublime})})();const tf=["onKeydown"],rf=Nl({__name:"CodeMirror",props:{mode:{default:"htmlmixed"},value:{default:""},readonly:{type:Boolean,default:!1}},emits:["change"],setup(We,{emit:Ie}){const y=We,H=Ie,z=Hu("container"),{autoResize:V,autoSave:re}=zu(Gu);let I;const D=()=>{H("change",I.getValue())};return Ru(()=>{const _=y.readonly?{}:{autoCloseBrackets:!0,autoCloseTags:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],keyMap:"sublime"};I=ju(z.value,{value:"",mode:y.mode,readOnly:y.readonly,tabSize:2,lineWrapping:!0,lineNumbers:!0,..._}),dl(()=>{const T=I.getValue();y.value!==T&&I.setValue(y.value)}),dl(()=>{I.setOption("mode",y.mode)}),setTimeout(()=>{I.refresh()},50),V.value&&window.addEventListener("resize",qu(()=>{I.refresh()})),Ol(re,T=>{T&&(I.on("change",D),Ku(()=>I.off("change",D)))},{immediate:!0})}),(_,T)=>(Pl(),_u("div",{ref:"container",class:"editor",onKeydown:[pl(vl(D,["ctrl","prevent"]),["s"]),pl(vl(D,["meta","prevent"]),["s"])]},null,40,tf))}}),ff=Nl({editorType:"codemirror",__name:"CodeMirrorEditor",props:{value:{},filename:{},readonly:{type:Boolean},mode:{}},emits:["change"],setup(We,{emit:Ie}){const y=We,H=Ie,z=I=>{H("change",I)},V={css:"css",html:"htmlmixed",js:{name:"javascript"},json:{name:"javascript",json:!0},ts:{name:"javascript",typescript:!0},vue:"htmlmixed"},re=Iu(()=>{const{mode:I,filename:D}=y,_=V[I||D.split(".").pop()];return D.lastIndexOf(".")!==-1&&_?_:V.js});return(I,D)=>(Pl(),Bu(rf,{value:I.value,mode:re.value,readonly:I.readonly,onChange:z},null,8,["value","mode","readonly"]))}});export{ff as _,uf as u};