import{_ as Qp}from"./app-a286a7cc.js";import{ae as ed,af as td,ag as Hc,b as L1,ah as jc,B as yo,c as $r,m as zr,r as jn,o as E1,x as Ua,G as nd,H as Ht,I as hn,Q as N1,U as rd,F as Ft,O as Br,W as fl,M as Bi,K as Ss,Z as ho,$ as zc,ad as $a,ai as id,aj as sd,ak as od,al as ad,am as ld,an as ud,ao as cd,h as Ts,ap as qc,aq as P1,N as Uc,u as Rt,J as Lo,P as Wi,T as fd,L as O1,S as hd,ar as $c,as as pd,at as dd}from"./framework-2050cf2c.js";const md=["onMousedown"],gd=$r({__name:"SplitPane",props:{layout:null},setup(n){const o=n,l=Ts(()=>o.layout==="vertical"),c=jn(),h=zr("store"),k=jn(h.initialShowOutput),I=L1({dragging:!1,split:50}),S=Ts(()=>{const{split:_}=I;return _<20?20:_>80?80:_});let w=0,x=0;function y(_){I.dragging=!0,w=l.value?_.pageY:_.pageX,x=S.value}function E(_){if(I.dragging){const F=l.value?_.pageY:_.pageX,D=l.value?c.value.offsetHeight:c.value.offsetWidth,H=F-w;I.split=x+~~(H/D*100)}}function L(){I.dragging=!1}return(_,F)=>(Ht(),hn("div",{ref_key:"container",ref:c,class:Wi(["split-pane",{dragging:I.dragging,"show-output":k.value,vertical:Rt(l)}]),onMousemove:E,onMouseup:L,onMouseleave:L},[Ft("div",{class:"left",style:Uc({[Rt(l)?"height":"width"]:Rt(S)+"%"})},[qc(_.$slots,"left",{},void 0,!0),Ft("div",{class:"dragger",onMousedown:P1(y,["prevent"])},null,40,md)],4),Ft("div",{class:"right",style:Uc({[Rt(l)?"height":"width"]:100-Rt(S)+"%"})},[qc(_.$slots,"right",{},void 0,!0)],4),Ft("button",{class:"toggler",onClick:F[0]||(F[0]=D=>k.value=!k.value)},Lo(k.value?"< Code":"Output >"),1)],34))}}),hi=(n,o)=>{const l=n.__vccOpts||n;for(const[c,h]of o)l[c]=h;return l},vd=hi(gd,[["__scopeId","data-v-3102671e"]]),D1=n=>(pd("data-v-cbb0a4e5"),n=n(),dd(),n),kd=["onClick"],yd={class:"label"},bd=["onClick"],wd=D1(()=>Ft("svg",{class:"icon",width:"12",height:"12",viewBox:"0 0 24 24"},[Ft("line",{stroke:"#999",x1:"18",y1:"6",x2:"6",y2:"18"}),Ft("line",{stroke:"#999",x1:"6",y1:"6",x2:"18",y2:"18"})],-1)),xd=[wd],_d={key:0,class:"file pending"},Sd=["onKeyup"],Td={key:1,class:"import-map-wrapper"},Id=D1(()=>Ft("span",{class:"label"},"Import Map",-1)),Cd=[Id],Ad=$r({__name:"FileSelector",setup(n){const o=zr("store"),l=jn(!1),c=jn("Comp.vue"),h="import-map.json",k=zr("import-map"),I=Ts(()=>Object.entries(o.state.files).filter(([_,F])=>_!==h&&!F.hidden).map(([_])=>_));function S(){let _=0,F="Comp.vue";for(;;){let D=!1;for(const H in o.state.files)if(H===F){D=!0,F=`Comp${++_}.vue`;break}if(!D)break}c.value=F,l.value=!0}function w(){l.value=!1}function x({el:_}){_.focus()}function y(){if(!l.value)return;const _=c.value;if(!/\.(vue|js|ts|css)$/.test(_)){o.state.errors=["Playground only supports *.vue, *.js, *.ts, *.css files."];return}if(_ in o.state.files){o.state.errors=[`File "${_}" already exists.`];return}o.state.errors=[],w(),o.addFile(_)}const E=jn(null);function L(_){_.preventDefault();const F=E.value,H=30*((Math.abs(_.deltaX)>=Math.abs(_.deltaY)?_.deltaX:_.deltaY)>0?1:-1);F.scrollTo({left:F.scrollLeft+H})}return(_,F)=>(Ht(),hn("div",{class:Wi(["file-selector",{"has-import-map":Rt(k)}]),onWheel:L,ref_key:"fileSel",ref:E},[(Ht(!0),hn(Ss,null,O1(Rt(I),(D,H)=>(Ht(),hn("div",{class:Wi(["file",{active:Rt(o).state.activeFile.filename===D}]),onClick:O=>Rt(o).setActive(D)},[Ft("span",yd,Lo(D===h?"Import Map":D),1),H>0?(Ht(),hn("span",{key:0,class:"remove",onClick:P1(O=>Rt(o).deleteFile(D),["stop"])},xd,8,bd)):Bi("",!0)],10,kd))),256)),l.value?(Ht(),hn("div",_d,[N1(Ft("input",{"onUpdate:modelValue":F[0]||(F[0]=D=>c.value=D),spellcheck:"false",onBlur:y,onKeyup:[$c(y,["enter"]),$c(w,["esc"])],onVnodeMounted:x},null,40,Sd),[[hd,c.value]])])):Bi("",!0),Ft("button",{class:"add",onClick:S},"+"),Rt(k)?(Ht(),hn("div",Td,[Ft("div",{class:Wi(["file import-map",{active:Rt(o).state.activeFile.filename===h}]),onClick:F[1]||(F[1]=D=>Rt(o).setActive(h))},Cd,2)])):Bi("",!0)],34))}}),Ld=hi(Ad,[["__scopeId","data-v-cbb0a4e5"]]);var jt=Uint8Array,yn=Uint16Array,Eo=Uint32Array,No=new jt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Po=new jt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),Ga=new jt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),M1=function(n,o){for(var l=new yn(31),c=0;c<31;++c)l[c]=o+=1<>>1|(gt&21845)<<1;Rr=(Rr&52428)>>>2|(Rr&13107)<<2,Rr=(Rr&61680)>>>4|(Rr&3855)<<4,Xa[gt]=((Rr&65280)>>>8|(Rr&255)<<8)>>>1}var er=function(n,o,l){for(var c=n.length,h=0,k=new yn(o);h>>w]=x}else for(S=new yn(c),h=0;h>>15-n[h]);return S},qr=new jt(288);for(var gt=0;gt<144;++gt)qr[gt]=8;for(var gt=144;gt<256;++gt)qr[gt]=9;for(var gt=256;gt<280;++gt)qr[gt]=7;for(var gt=280;gt<288;++gt)qr[gt]=8;var Is=new jt(32);for(var gt=0;gt<32;++gt)Is[gt]=5;var Nd=er(qr,9,0),Pd=er(qr,9,1),Od=er(Is,5,0),Dd=er(Is,5,1),Ma=function(n){for(var o=n[0],l=1;lo&&(o=n[l]);return o},Wn=function(n,o,l){var c=o/8|0;return(n[c]|n[c+1]<<8)>>(o&7)&l},Ra=function(n,o){var l=o/8|0;return(n[l]|n[l+1]<<8|n[l+2]<<16)>>(o&7)},hl=function(n){return(n+7)/8|0},Oo=function(n,o,l){(o==null||o<0)&&(o=0),(l==null||l>n.length)&&(l=n.length);var c=new(n.BYTES_PER_ELEMENT==2?yn:n.BYTES_PER_ELEMENT==4?Eo:jt)(l-o);return c.set(n.subarray(o,l)),c},Md=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],Hn=function(n,o,l){var c=new Error(o||Md[n]);if(c.code=n,Error.captureStackTrace&&Error.captureStackTrace(c,Hn),!l)throw c;return c},Rd=function(n,o,l){var c=n.length;if(!c||l&&l.f&&!l.l)return o||new jt(0);var h=!o||l,k=!l||l.i;l||(l={}),o||(o=new jt(c*3));var I=function(z){var V=o.length;if(z>V){var ee=new jt(Math.max(V*2,z));ee.set(o),o=ee}},S=l.f||0,w=l.p||0,x=l.b||0,y=l.l,E=l.d,L=l.m,_=l.n,F=c*8;do{if(!y){S=Wn(n,w,1);var D=Wn(n,w+1,3);if(w+=3,D)if(D==1)y=Pd,E=Dd,L=9,_=5;else if(D==2){var M=Wn(n,w,31)+257,B=Wn(n,w+10,15)+4,$=M+Wn(n,w+5,31)+1;w+=14;for(var ae=new jt($),ue=new jt(19),te=0;te>>4;if(H<16)ae[te++]=H;else{var G=0,K=0;for(H==16?(K=3+Wn(n,w,3),w+=2,G=ae[te-1]):H==17?(K=3+Wn(n,w,7),w+=3):H==18&&(K=11+Wn(n,w,127),w+=7);K--;)ae[te++]=G}}var b=ae.subarray(0,M),se=ae.subarray(M);L=Ma(b),_=Ma(se),y=er(b,L,1),E=er(se,_,1)}else Hn(1);else{var H=hl(w)+4,O=n[H-4]|n[H-3]<<8,T=H+O;if(T>c){k&&Hn(0);break}h&&I(x+O),o.set(n.subarray(H,T),x),l.b=x+=O,l.p=w=T*8,l.f=S;continue}if(w>F){k&&Hn(0);break}}h&&I(x+131072);for(var J=(1<>>4;if(w+=G&15,w>F){k&&Hn(0);break}if(G||Hn(2),Ne<256)o[x++]=Ne;else if(Ne==256){Oe=w,y=null;break}else{var Fe=Ne-254;if(Ne>264){var te=Ne-257,tt=No[te];Fe=Wn(n,w,(1<>>4;ze||Hn(3),w+=ze&15;var se=Ed[qe];if(qe>3){var tt=Po[qe];se+=Ra(n,w)&(1<F){k&&Hn(0);break}h&&I(x+131072);for(var X=x+Fe;x>>8},vs=function(n,o,l){l<<=o&7;var c=o/8|0;n[c]|=l,n[c+1]|=l>>>8,n[c+2]|=l>>>16},Fa=function(n,o){for(var l=[],c=0;cL&&(L=k[c].s);var _=new yn(L+1),F=Va(l[y-1],_,0);if(F>o){var c=0,D=0,H=F-o,O=1<o)D+=O-(1<>>=H;D>0;){var M=k[c].s;_[M]=0&&D;--c){var B=k[c].s;_[B]==o&&(--_[B],++D)}F=o}return[new jt(_),F]},Va=function(n,o,l){return n.s==-1?Math.max(Va(n.l,o,l+1),Va(n.r,o,l+1)):o[n.s]=l},Kc=function(n){for(var o=n.length;o&&!n[--o];);for(var l=new yn(++o),c=0,h=n[0],k=1,I=function(w){l[c++]=w},S=1;S<=o;++S)if(n[S]==h&&S!=o)++k;else{if(!h&&k>2){for(;k>138;k-=138)I(32754);k>2&&(I(k>10?k-11<<5|28690:k-3<<5|12305),k=0)}else if(k>3){for(I(h),--k;k>6;k-=6)I(8304);k>2&&(I(k-3<<5|8208),k=0)}for(;k--;)I(h);k=1,h=n[S]}return[l.subarray(0,c),o]},ks=function(n,o){for(var l=0,c=0;c>>8,n[h+2]=n[h]^255,n[h+3]=n[h+1]^255;for(var k=0;k4&&!ge[Ga[Te-1]];--Te);var G=x+5<<3,K=ks(h,qr)+ks(k,Is)+I,b=ks(h,L)+ks(k,D)+I+14+3*Te+ks(ue,ge)+(2*ue[16]+3*ue[17]+7*ue[18]);if(G<=K&&G<=b)return Ya(o,y,n.subarray(w,w+x));var se,J,le,Oe;if(kr(o,y,1+(b15&&(kr(o,y,ze[te]>>>5&127),y+=ze[te]>>>12)}}else se=Nd,J=qr,le=Od,Oe=Is;for(var te=0;te255){var qe=c[te]>>>18&31;vs(o,y,se[qe+257]),y+=J[qe+257],qe>7&&(kr(o,y,c[te]>>>23&31),y+=No[qe]);var X=c[te]&31;vs(o,y,le[X]),y+=Oe[X],X>3&&(vs(o,y,c[te]>>>5&8191),y+=Po[X])}else vs(o,y,se[c[te]]),y+=J[c[te]];return vs(o,y,se[256]),y+J[256]},Fd=new Eo([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),pl=new jt(0),Bd=function(n,o,l,c,h,k){var I=n.length,S=new jt(c+I+5*(1+Math.ceil(I/7e3))+h),w=S.subarray(c,S.length-h),x=0;if(!o||I<8)for(var y=0;y<=I;y+=65535){var E=y+65535;E>=I&&(w[x>>3]=k),x=Ya(w,x+1,n.subarray(y,E))}else{for(var L=Fd[o-1],_=L>>>13,F=L&8191,D=(1<7e3||ge>24576)&&se>423){x=Xc(n,w,0,$,ae,ue,ye,ge,Te,y-Te,x),ge=te=ye=0,Te=y;for(var J=0;J<286;++J)ae[J]=0;for(var J=0;J<30;++J)ue[J]=0}var le=2,Oe=0,Ne=F,Fe=K-b&32767;if(se>2&&G==B(y-Fe))for(var tt=Math.min(_,se)-1,ze=Math.min(32767,y),qe=Math.min(258,se);Fe<=ze&&--Ne&&K!=b;){if(n[y+le]==n[y+le-Fe]){for(var X=0;Xle){if(le=X,Oe=Fe,X>tt)break;for(var z=Math.min(Fe,X-2),V=0,J=0;JV&&(V=ve,b=ee)}}}K=b,b=H[K],Fe+=K-b+32768&32767}if(Oe){$[ge++]=268435456|Ka[le]<<18|Gc[Oe];var pe=Ka[le]&31,De=Gc[Oe]&31;ye+=No[pe]+Po[De],++ae[257+pe],++ue[De],ke=y+le,++te}else $[ge++]=n[y],++ae[n[y]]}}x=Xc(n,w,k,$,ae,ue,ye,ge,Te,y-Te,x),!k&&x&7&&(x=Ya(w,x+1,pl))}return Oo(S,0,c+hl(x)+h)},Wd=function(){var n=1,o=0;return{p:function(l){for(var c=n,h=o,k=l.length|0,I=0;I!=k;){for(var S=Math.min(I+2655,k);I>16),h=(h&65535)+15*(h>>16)}n=c,o=h},d:function(){return n%=65521,o%=65521,(n&255)<<24|n>>>8<<16|(o&255)<<8|o>>>8}}},Hd=function(n,o,l,c,h){return Bd(n,o.level==null?6:o.level,o.mem==null?Math.ceil(Math.max(8,Math.min(13,Math.log(n.length)))*1.5):12+o.mem,l,c,!h)},jd=function(n,o,l){for(;l;++o)n[o]=l,l>>>=8},zd=function(n,o){var l=o.level,c=l==0?0:l<6?1:l==9?3:2;n[0]=120,n[1]=c<<6|(c?32-2*c:1)},qd=function(n){((n[0]&15)!=8||n[0]>>>4>7||(n[0]<<8|n[1])%31)&&Hn(6,"invalid zlib data"),n[1]&32&&Hn(6,"invalid zlib data: preset dictionaries not supported")};function Ud(n,o){o||(o={});var l=Wd();l.p(n);var c=Hd(n,o,2,4);return zd(c,o),jd(c,c.length-4,l.d()),c}function $d(n,o){return Rd((qd(n),n.subarray(2,-4)),o)}var Vc=typeof TextEncoder<"u"&&new TextEncoder,Ja=typeof TextDecoder<"u"&&new TextDecoder,Gd=0;try{Ja.decode(pl,{stream:!0}),Gd=1}catch{}var Kd=function(n){for(var o="",l=0;;){var c=n[l++],h=(c>127)+(c>223)+(c>239);if(l+h>n.length)return[o,Oo(n,l-1)];h?h==3?(c=((c&15)<<18|(n[l++]&63)<<12|(n[l++]&63)<<6|n[l++]&63)-65536,o+=String.fromCharCode(55296|c>>10,56320|c&1023)):h&1?o+=String.fromCharCode((c&31)<<6|n[l++]&63):o+=String.fromCharCode((c&15)<<12|(n[l++]&63)<<6|n[l++]&63):o+=String.fromCharCode(c)}};function W1(n,o){if(o){for(var l=new jt(n.length),c=0;c>1)),I=0,S=function(y){k[I++]=y},c=0;ck.length){var w=new jt(I+8+(h-c<<1));w.set(k),k=w}var x=n.charCodeAt(c);x<128||o?S(x):x<2048?(S(192|x>>6),S(128|x&63)):x>55295&&x<57344?(x=65536+(x&1023<<10)|n.charCodeAt(++c)&1023,S(240|x>>18),S(128|x>>12&63),S(128|x>>6&63),S(128|x&63)):(S(224|x>>12),S(128|x>>6&63),S(128|x&63))}return Oo(k,0,I)}function H1(n,o){if(o){for(var l="",c=0;c{l&&clearTimeout(l),l=setTimeout(()=>{n(...c)},o)}}function Xd(n){const o=W1(n),l=Ud(o,{level:9}),c=H1(l,!0);return btoa(c)}function Vd(n){const o=atob(n);if(o.startsWith("xÚ")){const l=W1(o,!0),c=$d(l);return H1(c)}return decodeURIComponent(escape(o))}var li=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ba={exports:{}},Yc;function wn(){return Yc||(Yc=1,function(n,o){(function(l,c){n.exports=c()})(li,function(){var l=navigator.userAgent,c=navigator.platform,h=/gecko\/\d/i.test(l),k=/MSIE \d/.test(l),I=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(l),S=/Edge\/(\d+)/.exec(l),w=k||I||S,x=w&&(k?document.documentMode||6:+(S||I)[1]),y=!S&&/WebKit\//.test(l),E=y&&/Qt\/\d+\.\d+/.test(l),L=!S&&/Chrome\//.test(l),_=/Opera\//.test(l),F=/Apple Computer/.test(navigator.vendor),D=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(l),H=/PhantomJS/.test(l),O=F&&(/Mobile\/\w+/.test(l)||navigator.maxTouchPoints>2),T=/Android/.test(l),M=O||T||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(l),B=O||/Mac/.test(c),$=/\bCrOS\b/.test(l),ae=/win/i.test(c),ue=_&&l.match(/Version\/(\d*\.\d*)/);ue&&(ue=Number(ue[1])),ue&&ue>=15&&(_=!1,y=!0);var te=B&&(E||_&&(ue==null||ue<12.11)),ye=h||w&&x>=9;function ge(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var ke=function(e,t){var i=e.className,r=ge(t).exec(i);if(r){var a=i.slice(r.index+r[0].length);e.className=i.slice(0,r.index)+(a?r[1]+a:"")}};function Te(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function G(e,t){return Te(e).appendChild(t)}function K(e,t,i,r){var a=document.createElement(e);if(i&&(a.className=i),r&&(a.style.cssText=r),typeof t=="string")a.appendChild(document.createTextNode(t));else if(t)for(var u=0;u=t)return f+(t-u);f+=p-u,f+=i-f%i,u=p+1}}var X=function(){this.id=null,this.f=null,this.time=0,this.handler=tt(this.onTimeout,this)};X.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},X.prototype.set=function(e,t){this.f=t;var i=+new Date+e;(!this.id||i=t)return r+Math.min(f,t-a);if(a+=u-r,a+=i-a%i,r=u+1,a>=t)return r}}var Ze=[""];function Je(e){for(;Ze.length<=e;)Ze.push(Ae(Ze)+" ");return Ze[e]}function Ae(e){return e[e.length-1]}function He(e,t){for(var i=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||rn.test(e))}function U(e,t){return t?t.source.indexOf("\\w")>-1&&nt(e)?!0:t.test(e):nt(e)}function he(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var Q=/[\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 Xe(e){return e.charCodeAt(0)>=768&&Q.test(e)}function It(e,t,i){for(;(i<0?t>0:ti?-1:1;;){if(t==i)return t;var a=(t+i)/2,u=r<0?Math.ceil(a):Math.floor(a);if(u==t)return e(u)?t:i;e(u)?i=u:t=u+r}}function Kr(e,t,i,r){if(!e)return r(t,i,"ltr",0);for(var a=!1,u=0;ut||t==i&&f.to==t)&&(r(Math.max(f.from,t),Math.min(f.to,i),f.level==1?"rtl":"ltr",u),a=!0)}a||r(t,i,"ltr")}var Ut=null;function ft(e,t,i){var r;Ut=null;for(var a=0;at)return a;u.to==t&&(u.from!=u.to&&i=="before"?r=a:Ut=a),u.from==t&&(u.from!=u.to&&i!="before"?r=a:Ut=a)}return r??Ut}var On=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(g){return g<=247?e.charAt(g):1424<=g&&g<=1524?"R":1536<=g&&g<=1785?t.charAt(g-1536):1774<=g&&g<=2220?"r":8192<=g&&g<=8203?"w":g==8204?"b":"L"}var r=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,a=/[stwN]/,u=/[LRr]/,f=/[Lb1n]/,p=/[1n]/;function m(g,A,N){this.level=g,this.from=A,this.to=N}return function(g,A){var N=A=="ltr"?"L":"R";if(g.length==0||A=="ltr"&&!r.test(g))return!1;for(var j=g.length,W=[],Y=0;Y-1&&(r[t]=a.slice(0,u).concat(a.slice(u+1)))}}}function Me(e,t){var i=$n(e,t);if(i.length)for(var r=Array.prototype.slice.call(arguments,2),a=0;a0}function dn(e){e.prototype.on=function(t,i){Ee(this,t,i)},e.prototype.off=function(t,i){Lt(this,t,i)}}function _t(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Kn(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function $t(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function Dn(e){_t(e),Kn(e)}function An(e){return e.target||e.srcElement}function xr(e){var t=e.which;return t==null&&(e.button&1?t=1:e.button&2?t=3:e.button&4&&(t=2)),B&&e.ctrlKey&&t==1&&(t=3),t}var or=function(){if(w&&x<9)return!1;var e=K("div");return"draggable"in e||"dragDrop"in e}(),Et;function _r(e){if(Et==null){var t=K("span","​");G(e,K("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Et=t.offsetWidth<=1&&t.offsetHeight>2&&!(w&&x<8))}var i=Et?K("span","​"):K("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return i.setAttribute("cm-text",""),i}var ar;function mn(e){if(ar!=null)return ar;var t=G(e,document.createTextNode("AخA")),i=se(t,0,1).getBoundingClientRect(),r=se(t,1,2).getBoundingClientRect();return Te(e),!i||i.left==i.right?!1:ar=r.right-i.right<3}var lr=` b`.split(/\n/).length!=3?function(e){for(var t=0,i=[],r=e.length;t<=r;){var a=e.indexOf(` `,t);a==-1&&(a=e.length);var u=e.slice(t,e.charAt(a-1)=="\r"?a-1:a),f=u.indexOf("\r");f!=-1?(i.push(u.slice(0,f)),t+=f+1):(i.push(u),t=a+1)}return i}: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},Tr=function(){var e=K("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),ur=null;function Ln(e){if(ur!=null)return ur;var t=G(e,K("span","x")),i=t.getBoundingClientRect(),r=se(t,0,1).getBoundingClientRect();return ur=Math.abs(i.left-r.left)>1}var Zt={},Gt={};function Ir(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Zt[e]=t}function _n(e,t){Gt[e]=t}function Xn(e){if(typeof e=="string"&&Gt.hasOwnProperty(e))e=Gt[e];else if(e&&typeof e.name=="string"&&Gt.hasOwnProperty(e.name)){var t=Gt[e.name];typeof t=="string"&&(t={name:t}),e=lt(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Xn("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Xn("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Vn(e,t){t=Xn(t);var i=Zt[t.name];if(!i)return Vn(e,"text/plain");var r=i(e,t);if(sn.hasOwnProperty(t.name)){var a=sn[t.name];for(var u in a)a.hasOwnProperty(u)&&(r.hasOwnProperty(u)&&(r["_"+u]=r[u]),r[u]=a[u])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var f in t.modeProps)r[f]=t.modeProps[f];return r}var sn={};function on(e,t){var i=sn.hasOwnProperty(e)?sn[e]:sn[e]={};ze(t,i)}function Kt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var i={};for(var r in t){var a=t[r];a instanceof Array&&(a=a.concat([])),i[r]=a}return i}function cr(e,t){for(var i;e.innerMode&&(i=e.innerMode(t),!(!i||i.mode==e));)t=i.state,e=i.mode;return i||{mode:e,state:t}}function Xr(e,t,i){return e.startState?e.startState(t,i):!0}var dt=function(e,t,i){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=i};dt.prototype.eol=function(){return this.pos>=this.string.length},dt.prototype.sol=function(){return this.pos==this.lineStart},dt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},dt.prototype.next=function(){if(this.post},dt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},dt.prototype.skipToEnd=function(){this.pos=this.string.length},dt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},dt.prototype.backUp=function(e){this.pos-=e},dt.prototype.column=function(){return this.lastColumnPos0?null:(u&&t!==!1&&(this.pos+=u[0].length),u)}},dt.prototype.current=function(){return this.string.slice(this.start,this.pos)},dt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},dt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},dt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function Ce(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var i=e;!i.lines;)for(var r=0;;++r){var a=i.children[r],u=a.chunkSize();if(t=e.first&&ti?ce(i,Ce(e,i).text.length):Xt(t,Ce(e,t.line).text.length)}function Xt(e,t){var i=e.ch;return i==null||i>t?ce(e.line,t):i<0?ce(e.line,0):e}function Sn(e,t){for(var i=[],r=0;rthis.maxLookAhead&&(this.maxLookAhead=e),t},Yn.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}},Yn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Yn.fromSaved=function(e,t,i){return t instanceof mi?new Yn(e,Kt(e.mode,t.state),i,t.lookAhead):new Yn(e,Kt(e.mode,t),i)},Yn.prototype.save=function(e){var t=e!==!1?Kt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new mi(t,this.maxLookAhead):t};function zl(e,t,i,r){var a=[e.state.modeGen],u={};Xl(e,t.text,e.doc.mode,i,function(g,A){return a.push(g,A)},u,r);for(var f=i.state,p=function(g){i.baseTokens=a;var A=e.state.overlays[g],N=1,j=0;i.state=!0,Xl(e,t.text,A.mode,i,function(W,Y){for(var re=N;jW&&a.splice(N,1,W,a[N+1],me),N+=2,j=Math.min(W,me)}if(Y)if(A.opaque)a.splice(re,N-re,W,"overlay "+Y),N=re+2;else for(;ree.options.maxHighlightLength&&Kt(e.doc.mode,r.state),u=zl(e,t,r);a&&(r.state=a),t.stateAfter=r.save(!a),t.styles=u.styles,u.classes?t.styleClasses=u.classes:t.styleClasses&&(t.styleClasses=null),i===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function Ui(e,t,i){var r=e.doc,a=e.display;if(!r.mode.startState)return new Yn(r,!0,t);var u=th(e,t,i),f=u>r.first&&Ce(r,u-1).stateAfter,p=f?Yn.fromSaved(r,f,u):new Yn(r,Xr(r.mode),u);return r.iter(u,t,function(m){qo(e,m.text,p);var g=p.line;m.stateAfter=g==t-1||g%5==0||g>=a.viewFrom&&gt.start)return u}throw new Error("Mode "+e.name+" failed to advance stream.")}var $l=function(e,t,i){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=i};function Gl(e,t,i,r){var a=e.doc,u=a.mode,f;t=Se(a,t);var p=Ce(a,t.line),m=Ui(e,t.line,i),g=new dt(p.text,e.options.tabSize,m),A;for(r&&(A=[]);(r||g.pose.options.maxHighlightLength?(p=!1,f&&qo(e,t,r,A.pos),A.pos=t.length,N=null):N=Kl(Uo(i,A,r.state,j),u),j){var W=j[0].name;W&&(N="m-"+(N?W+" "+N:W))}if(!p||g!=N){for(;mf;--p){if(p<=u.first)return u.first;var m=Ce(u,p-1),g=m.stateAfter;if(g&&(!i||p+(g instanceof mi?g.lookAhead:0)<=u.modeFrontier))return p;var A=qe(m.text,null,e.options.tabSize);(a==null||r>A)&&(a=p-1,r=A)}return a}function nh(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontieri;r--){var a=Ce(e,r).stateAfter;if(a&&(!(a instanceof mi)||r+a.lookAhead=t:u.to>t);(r||(r=[])).push(new Fs(f,u.from,m?null:u.to))}}return r}function lh(e,t,i){var r;if(e)for(var a=0;a=t:u.to>t);if(p||u.from==t&&f.type=="bookmark"&&(!i||u.marker.insertLeft)){var m=u.from==null||(f.inclusiveLeft?u.from<=t:u.from0&&p)for(var Ie=0;Ie0)){var A=[m,1],N=v(g.from,p.from),j=v(g.to,p.to);(N<0||!f.inclusiveLeft&&!N)&&A.push({from:g.from,to:p.from}),(j>0||!f.inclusiveRight&&!j)&&A.push({from:p.to,to:g.to}),a.splice.apply(a,A),m+=A.length-3}}return a}function Jl(e){var t=e.markedSpans;if(t){for(var i=0;it)&&(!r||Go(r,u.marker)<0)&&(r=u.marker)}return r}function tu(e,t,i,r,a){var u=Ce(e,t),f=hr&&u.markedSpans;if(f)for(var p=0;p=0&&N<=0||A<=0&&N>=0)&&(A<=0&&(m.marker.inclusiveRight&&a.inclusiveLeft?v(g.to,i)>=0:v(g.to,i)>0)||A>=0&&(m.marker.inclusiveRight&&a.inclusiveLeft?v(g.from,r)<=0:v(g.from,r)<0)))return!0}}}function Mn(e){for(var t;t=eu(e);)e=t.find(-1,!0).line;return e}function fh(e){for(var t;t=Hs(e);)e=t.find(1,!0).line;return e}function hh(e){for(var t,i;t=Hs(e);)e=t.find(1,!0).line,(i||(i=[])).push(e);return i}function Ko(e,t){var i=Ce(e,t),r=Mn(i);return i==r?t:rt(r)}function nu(e,t){if(t>e.lastLine())return t;var i=Ce(e,t),r;if(!Cr(e,i))return t;for(;r=Hs(i);)i=r.find(1,!0).line;return rt(i)+1}function Cr(e,t){var i=hr&&t.markedSpans;if(i){for(var r=void 0,a=0;at.maxLineLength&&(t.maxLineLength=a,t.maxLine=r)})}var gi=function(e,t,i){this.text=e,Zl(this,t),this.height=i?i(this):1};gi.prototype.lineNo=function(){return rt(this)},dn(gi);function ph(e,t,i,r){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Jl(e),Zl(e,i);var a=r?r(e):1;a!=e.height&&Qt(e,a)}function dh(e){e.parent=null,Jl(e)}var mh={},gh={};function ru(e,t){if(!e||/^\s*$/.test(e))return null;var i=t.addModeClass?gh:mh;return i[e]||(i[e]=e.replace(/\S+/g,"cm-$&"))}function iu(e,t){var i=b("span",null,null,y?"padding-right: .1px":null),r={pre:b("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var a=0;a<=(t.rest?t.rest.length:0);a++){var u=a?t.rest[a-1]:t.line,f=void 0;r.pos=0,r.addToken=kh,mn(e.display.measure)&&(f=Bt(u,e.doc.direction))&&(r.addToken=bh(r.addToken,f)),r.map=[];var p=t!=e.display.externalMeasured&&rt(u);wh(u,r,ql(e,u,p)),u.styleClasses&&(u.styleClasses.bgClass&&(r.bgClass=Ne(u.styleClasses.bgClass,r.bgClass||"")),u.styleClasses.textClass&&(r.textClass=Ne(u.styleClasses.textClass,r.textClass||""))),r.map.length==0&&r.map.push(0,0,r.content.appendChild(_r(e.display.measure))),a==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(y){var m=r.content.lastChild;(/\bcm-tab\b/.test(m.className)||m.querySelector&&m.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Me(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Ne(r.pre.className,r.textClass||"")),r}function vh(e){var t=K("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function kh(e,t,i,r,a,u,f){if(t){var p=e.splitSpaces?yh(t,e.trailingSpace):t,m=e.cm.state.specialChars,g=!1,A;if(!m.test(t))e.col+=t.length,A=document.createTextNode(p),e.map.push(e.pos,e.pos+t.length,A),w&&x<9&&(g=!0),e.pos+=t.length;else{A=document.createDocumentFragment();for(var N=0;;){m.lastIndex=N;var j=m.exec(t),W=j?j.index-N:t.length-N;if(W){var Y=document.createTextNode(p.slice(N,N+W));w&&x<9?A.appendChild(K("span",[Y])):A.appendChild(Y),e.map.push(e.pos,e.pos+W,Y),e.col+=W,e.pos+=W}if(!j)break;N+=W+1;var re=void 0;if(j[0]==" "){var me=e.cm.options.tabSize,be=me-e.col%me;re=A.appendChild(K("span",Je(be),"cm-tab")),re.setAttribute("role","presentation"),re.setAttribute("cm-text"," "),e.col+=be}else j[0]=="\r"||j[0]==` `?(re=A.appendChild(K("span",j[0]=="\r"?"␍":"␤","cm-invalidchar")),re.setAttribute("cm-text",j[0]),e.col+=1):(re=e.cm.options.specialCharPlaceholder(j[0]),re.setAttribute("cm-text",j[0]),w&&x<9?A.appendChild(K("span",[re])):A.appendChild(re),e.col+=1);e.map.push(e.pos,e.pos+1,re),e.pos++}}if(e.trailingSpace=p.charCodeAt(t.length-1)==32,i||r||a||g||u||f){var _e=i||"";r&&(_e+=r),a&&(_e+=a);var we=K("span",[A],_e,u);if(f)for(var Ie in f)f.hasOwnProperty(Ie)&&Ie!="style"&&Ie!="class"&&we.setAttribute(Ie,f[Ie]);return e.content.appendChild(we)}e.content.appendChild(A)}}function yh(e,t){if(e.length>1&&!/ /.test(e))return e;for(var i=t,r="",a=0;ag&&N.from<=g));j++);if(N.to>=A)return e(i,r,a,u,f,p,m);e(i,r.slice(0,N.to-g),a,u,null,p,m),u=null,r=r.slice(N.to-g),g=N.to}}}function su(e,t,i,r){var a=!r&&i.widgetNode;a&&e.map.push(e.pos,e.pos+t,a),!r&&e.cm.display.input.needsContentAttribute&&(a||(a=e.content.appendChild(document.createElement("span"))),a.setAttribute("cm-marker",i.id)),a&&(e.cm.display.input.setUneditable(a),e.content.appendChild(a)),e.pos+=t,e.trailingSpace=!1}function wh(e,t,i){var r=e.markedSpans,a=e.text,u=0;if(!r){for(var f=1;fm||Ve.collapsed&&Le.to==m&&Le.from==m)){if(Le.to!=null&&Le.to!=m&&W>Le.to&&(W=Le.to,re=""),Ve.className&&(Y+=" "+Ve.className),Ve.css&&(j=(j?j+";":"")+Ve.css),Ve.startStyle&&Le.from==m&&(me+=" "+Ve.startStyle),Ve.endStyle&&Le.to==W&&(Ie||(Ie=[])).push(Ve.endStyle,Le.to),Ve.title&&((_e||(_e={})).title=Ve.title),Ve.attributes)for(var ut in Ve.attributes)(_e||(_e={}))[ut]=Ve.attributes[ut];Ve.collapsed&&(!be||Go(be.marker,Ve)<0)&&(be=Le)}else Le.from>m&&W>Le.from&&(W=Le.from)}if(Ie)for(var Dt=0;Dt=p)break;for(var vn=Math.min(p,W);;){if(A){var un=m+A.length;if(!be){var St=un>vn?A.slice(0,vn-m):A;t.addToken(t,St,N?N+Y:Y,me,m+St.length==W?re:"",j,_e)}if(un>=vn){A=A.slice(vn-m),m=vn;break}m=un,me=""}A=a.slice(u,u=i[g++]),N=ru(i[g++],t.cm.options)}}}function ou(e,t,i){this.line=t,this.rest=hh(t),this.size=this.rest?rt(Ae(this.rest))-i+1:1,this.node=this.text=null,this.hidden=Cr(e,t)}function zs(e,t,i){for(var r=[],a,u=t;u2&&u.push((m.bottom+g.top)/2-i.top)}}u.push(i.bottom-i.top)}}function pu(e,t,i){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};if(e.rest){for(var r=0;ri)return{map:e.measure.maps[a],cache:e.measure.caches[a],before:!0}}}function Ph(e,t){t=Mn(t);var i=rt(t),r=e.display.externalMeasured=new ou(e.doc,t,i);r.lineN=i;var a=r.built=iu(e,r);return r.text=a.pre,G(e.display.lineMeasure,a.pre),r}function du(e,t,i,r){return Zn(e,ki(e,t),i,r)}function Qo(e,t){if(t>=e.display.viewFrom&&t=i.lineN&&tt)&&(u=m-p,a=u-1,t>=m&&(f="right")),a!=null){if(r=e[g+2],p==m&&i==(r.insertLeft?"left":"right")&&(f=i),i=="left"&&a==0)for(;g&&e[g-2]==e[g-3]&&e[g-1].insertLeft;)r=e[(g-=3)+2],f="left";if(i=="right"&&a==m-p)for(;g=0&&(i=e[a]).left==i.right;a--);return i}function Dh(e,t,i,r){var a=gu(t.map,i,r),u=a.node,f=a.start,p=a.end,m=a.collapse,g;if(u.nodeType==3){for(var A=0;A<4;A++){for(;f&&Xe(t.line.text.charAt(a.coverStart+f));)--f;for(;a.coverStart+p0&&(m=r="right");var N;e.options.lineWrapping&&(N=u.getClientRects()).length>1?g=N[r=="right"?N.length-1:0]:g=u.getBoundingClientRect()}if(w&&x<9&&!f&&(!g||!g.left&&!g.right)){var j=u.parentNode.getClientRects()[0];j?g={left:j.left,right:j.left+bi(e.display),top:j.top,bottom:j.bottom}:g=mu}for(var W=g.top-t.rect.top,Y=g.bottom-t.rect.top,re=(W+Y)/2,me=t.view.measure.heights,be=0;be=r.text.length?(m=r.text.length,g="before"):m<=0&&(m=0,g="after"),!p)return f(g=="before"?m-1:m,g=="before");function A(Y,re,me){var be=p[re],_e=be.level==1;return f(me?Y-1:Y,_e!=me)}var N=ft(p,m,g),j=Ut,W=A(m,N,g=="before");return j!=null&&(W.other=A(m,j,g!="before")),W}function xu(e,t){var i=0;t=Se(e.doc,t),e.options.lineWrapping||(i=bi(e.display)*t.ch);var r=Ce(e.doc,t.line),a=pr(r)+qs(e.display);return{left:i,right:i,top:a,bottom:a+r.height}}function ta(e,t,i,r,a){var u=ce(e,t,i);return u.xRel=a,r&&(u.outside=r),u}function na(e,t,i){var r=e.doc;if(i+=e.display.viewOffset,i<0)return ta(r.first,0,null,-1,-1);var a=Nn(r,i),u=r.first+r.size-1;if(a>u)return ta(r.first+r.size-1,Ce(r,u).text.length,null,1,1);t<0&&(t=0);for(var f=Ce(r,a);;){var p=Rh(e,f,a,t,i),m=ch(f,p.ch+(p.xRel>0||p.outside>0?1:0));if(!m)return p;var g=m.find(1);if(g.line==a)return g;f=Ce(r,a=g.line)}}function _u(e,t,i,r){r-=ea(t);var a=t.text.length,u=pn(function(f){return Zn(e,i,f-1).bottom<=r},a,0);return a=pn(function(f){return Zn(e,i,f).top>r},u,a),{begin:u,end:a}}function Su(e,t,i,r){i||(i=ki(e,t));var a=Us(e,t,Zn(e,i,r),"line").top;return _u(e,t,i,a)}function ra(e,t,i,r){return e.bottom<=i?!1:e.top>i?!0:(r?e.left:e.right)>t}function Rh(e,t,i,r,a){a-=pr(t);var u=ki(e,t),f=ea(t),p=0,m=t.text.length,g=!0,A=Bt(t,e.doc.direction);if(A){var N=(e.options.lineWrapping?Bh:Fh)(e,t,i,u,A,r,a);g=N.level!=1,p=g?N.from:N.to-1,m=g?N.to:N.from-1}var j=null,W=null,Y=pn(function(Pe){var Le=Zn(e,u,Pe);return Le.top+=f,Le.bottom+=f,ra(Le,r,a,!1)?(Le.top<=a&&Le.left<=r&&(j=Pe,W=Le),!0):!1},p,m),re,me,be=!1;if(W){var _e=r-W.left=Ie.bottom?1:0}return Y=It(t.text,Y,1),ta(i,Y,me,be,r-re)}function Fh(e,t,i,r,a,u,f){var p=pn(function(N){var j=a[N],W=j.level!=1;return ra(Rn(e,ce(i,W?j.to:j.from,W?"before":"after"),"line",t,r),u,f,!0)},0,a.length-1),m=a[p];if(p>0){var g=m.level!=1,A=Rn(e,ce(i,g?m.from:m.to,g?"after":"before"),"line",t,r);ra(A,u,f,!0)&&A.top>f&&(m=a[p-1])}return m}function Bh(e,t,i,r,a,u,f){var p=_u(e,t,r,f),m=p.begin,g=p.end;/\s/.test(t.text.charAt(g-1))&&g--;for(var A=null,N=null,j=0;j=g||W.to<=m)){var Y=W.level!=1,re=Zn(e,r,Y?Math.min(g,W.to)-1:Math.max(m,W.from)).right,me=reme)&&(A=W,N=me)}}return A||(A=a[a.length-1]),A.fromg&&(A={from:A.from,to:g,level:A.level}),A}var Zr;function yi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Zr==null){Zr=K("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Zr.appendChild(document.createTextNode("x")),Zr.appendChild(K("br"));Zr.appendChild(document.createTextNode("x"))}G(e.measure,Zr);var i=Zr.offsetHeight/50;return i>3&&(e.cachedTextHeight=i),Te(e.measure),i||1}function bi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=K("span","xxxxxxxxxx"),i=K("pre",[t],"CodeMirror-line-like");G(e.measure,i);var r=t.getBoundingClientRect(),a=(r.right-r.left)/10;return a>2&&(e.cachedCharWidth=a),a||10}function ia(e){for(var t=e.display,i={},r={},a=t.gutters.clientLeft,u=t.gutters.firstChild,f=0;u;u=u.nextSibling,++f){var p=e.display.gutterSpecs[f].className;i[p]=u.offsetLeft+u.clientLeft+a,r[p]=u.clientWidth}return{fixedPos:sa(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function sa(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function Tu(e){var t=yi(e.display),i=e.options.lineWrapping,r=i&&Math.max(5,e.display.scroller.clientWidth/bi(e.display)-3);return function(a){if(Cr(e.doc,a))return 0;var u=0;if(a.widgets)for(var f=0;f0&&(g=Ce(e.doc,m.line).text).length==m.ch){var A=qe(g,g.length,e.options.tabSize)-g.length;m=ce(m.line,Math.max(0,Math.round((u-hu(e.display).left)/bi(e.display))-A))}return m}function ei(e,t){if(t>=e.display.viewTo||(t-=e.display.viewFrom,t<0))return null;for(var i=e.display.view,r=0;rt)&&(a.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=a.viewTo)hr&&Ko(e.doc,t)a.viewFrom?Lr(e):(a.viewFrom+=r,a.viewTo+=r);else if(t<=a.viewFrom&&i>=a.viewTo)Lr(e);else if(t<=a.viewFrom){var u=Gs(e,i,i+r,1);u?(a.view=a.view.slice(u.index),a.viewFrom=u.lineN,a.viewTo+=r):Lr(e)}else if(i>=a.viewTo){var f=Gs(e,t,t,-1);f?(a.view=a.view.slice(0,f.index),a.viewTo=f.lineN):Lr(e)}else{var p=Gs(e,t,t,-1),m=Gs(e,i,i+r,1);p&&m?(a.view=a.view.slice(0,p.index).concat(zs(e,p.lineN,m.lineN)).concat(a.view.slice(m.index)),a.viewTo+=r):Lr(e)}var g=a.externalMeasured;g&&(i=a.lineN&&t=r.viewTo)){var u=r.view[ei(e,t)];if(u.node!=null){var f=u.changes||(u.changes=[]);z(f,i)==-1&&f.push(i)}}}function Lr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gs(e,t,i,r){var a=ei(e,t),u,f=e.display.view;if(!hr||i==e.doc.first+e.doc.size)return{index:a,lineN:i};for(var p=e.display.viewFrom,m=0;m0){if(a==f.length-1)return null;u=p+f[a].size-t,a++}else u=p-t;t+=u,i+=u}for(;Ko(e.doc,i)!=i;){if(a==(r<0?0:f.length-1))return null;i+=r*f[a-(r<0?1:0)].size,a+=r}return{index:a,lineN:i}}function Wh(e,t,i){var r=e.display,a=r.view;a.length==0||t>=r.viewTo||i<=r.viewFrom?(r.view=zs(e,t,i),r.viewFrom=t):(r.viewFrom>t?r.view=zs(e,t,r.viewFrom).concat(r.view):r.viewFromi&&(r.view=r.view.slice(0,ei(e,i)))),r.viewTo=i}function Iu(e){for(var t=e.display.view,i=0,r=0;r=e.display.viewTo||m.to().line0?f:e.defaultCharWidth())+"px"}if(r.other){var p=i.appendChild(K("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));p.style.display="",p.style.left=r.other.left+"px",p.style.top=r.other.top+"px",p.style.height=(r.other.bottom-r.other.top)*.85+"px"}}function Ks(e,t){return e.top-t.top||e.left-t.left}function Hh(e,t,i){var r=e.display,a=e.doc,u=document.createDocumentFragment(),f=hu(e.display),p=f.left,m=Math.max(r.sizerWidth,Jr(e)-r.sizer.offsetLeft)-f.right,g=a.direction=="ltr";function A(we,Ie,Pe,Le){Ie<0&&(Ie=0),Ie=Math.round(Ie),Le=Math.round(Le),u.appendChild(K("div",null,"CodeMirror-selected","position: absolute; left: "+we+`px; top: `+Ie+"px; width: "+(Pe??m-we)+`px; height: `+(Le-Ie)+"px"))}function N(we,Ie,Pe){var Le=Ce(a,we),Ve=Le.text.length,ut,Dt;function vt(St,cn){return $s(e,ce(we,St),"div",Le,cn)}function vn(St,cn,Wt){var Ct=Su(e,Le,null,St),Tt=cn=="ltr"==(Wt=="after")?"left":"right",yt=Wt=="after"?Ct.begin:Ct.end-(/\s/.test(Le.text.charAt(Ct.end-1))?2:1);return vt(yt,Tt)[Tt]}var un=Bt(Le,a.direction);return Kr(un,Ie||0,Pe??Ve,function(St,cn,Wt,Ct){var Tt=Wt=="ltr",yt=vt(St,Tt?"left":"right"),fn=vt(cn-1,Tt?"right":"left"),Oi=Ie==null&&St==0,Mr=Pe==null&&cn==Ve,Yt=Ct==0,Qn=!un||Ct==un.length-1;if(fn.top-yt.top<=3){var Mt=(g?Oi:Mr)&&Yt,Oa=(g?Mr:Oi)&&Qn,vr=Mt?p:(Tt?yt:fn).left,si=Oa?m:(Tt?fn:yt).right;A(vr,yt.top,si-vr,yt.bottom)}else{var oi,tn,Di,Da;Tt?(oi=g&&Oi&&Yt?p:yt.left,tn=g?m:vn(St,Wt,"before"),Di=g?p:vn(cn,Wt,"after"),Da=g&&Mr&&Qn?m:fn.right):(oi=g?vn(St,Wt,"before"):p,tn=!g&&Oi&&Yt?m:yt.right,Di=!g&&Mr&&Qn?p:fn.left,Da=g?vn(cn,Wt,"after"):m),A(oi,yt.top,tn-oi,yt.bottom),yt.bottom0?t.blinker=setInterval(function(){e.hasFocus()||wi(e),t.cursorDiv.style.visibility=(i=!i)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function Au(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||ca(e))}function ua(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&wi(e))},100)}function ca(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),e.options.readOnly!="nocursor"&&(e.state.focused||(Me(e,"focus",e,t),e.state.focused=!0,Oe(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),y&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),la(e))}function wi(e,t){e.state.delayingBlurEvent||(e.state.focused&&(Me(e,"blur",e,t),e.state.focused=!1,ke(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function Xs(e){for(var t=e.display,i=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),a=t.lineDiv.getBoundingClientRect().top,u=0,f=0;f.005||W<-.005)&&(ae.display.sizerWidth){var re=Math.ceil(A/bi(e.display));re>e.display.maxLineLength&&(e.display.maxLineLength=re,e.display.maxLine=p.line,e.display.maxLineChanged=!0)}}}Math.abs(u)>2&&(t.scroller.scrollTop+=u)}function Lu(e){if(e.widgets)for(var t=0;t=f&&(u=Nn(t,pr(Ce(t,m))-e.wrapper.clientHeight),f=m)}return{from:u,to:Math.max(f,u+1)}}function jh(e,t){if(!pt(e,"scrollCursorIntoView")){var i=e.display,r=i.sizer.getBoundingClientRect(),a=null;if(t.top+r.top<0?a=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(a=!1),a!=null&&!H){var u=K("div","​",null,`position: absolute; top: `+(t.top-i.viewOffset-qs(e.display))+`px; height: `+(t.bottom-t.top+Jn(e)+i.barHeight)+`px; left: `+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(u),u.scrollIntoView(a),e.display.lineSpace.removeChild(u)}}}function zh(e,t,i,r){r==null&&(r=0);var a;!e.options.lineWrapping&&t==i&&(i=t.sticky=="before"?ce(t.line,t.ch+1,"before"):t,t=t.ch?ce(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t);for(var u=0;u<5;u++){var f=!1,p=Rn(e,t),m=!i||i==t?p:Rn(e,i);a={left:Math.min(p.left,m.left),top:Math.min(p.top,m.top)-r,right:Math.max(p.left,m.left),bottom:Math.max(p.bottom,m.bottom)+r};var g=fa(e,a),A=e.doc.scrollTop,N=e.doc.scrollLeft;if(g.scrollTop!=null&&(Zi(e,g.scrollTop),Math.abs(e.doc.scrollTop-A)>1&&(f=!0)),g.scrollLeft!=null&&(ti(e,g.scrollLeft),Math.abs(e.doc.scrollLeft-N)>1&&(f=!0)),!f)break}return a}function qh(e,t){var i=fa(e,t);i.scrollTop!=null&&Zi(e,i.scrollTop),i.scrollLeft!=null&&ti(e,i.scrollLeft)}function fa(e,t){var i=e.display,r=yi(e.display);t.top<0&&(t.top=0);var a=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:i.scroller.scrollTop,u=Zo(e),f={};t.bottom-t.top>u&&(t.bottom=t.top+u);var p=e.doc.height+Jo(i),m=t.topp-r;if(t.topa+u){var A=Math.min(t.top,(g?p:t.bottom)-u);A!=a&&(f.scrollTop=A)}var N=e.options.fixedGutter?0:i.gutters.offsetWidth,j=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:i.scroller.scrollLeft-N,W=Jr(e)-i.gutters.offsetWidth,Y=t.right-t.left>W;return Y&&(t.right=t.left+W),t.left<10?f.scrollLeft=0:t.leftW+j-3&&(f.scrollLeft=t.right+(Y?0:10)-W),f}function ha(e,t){t!=null&&(Ys(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t)}function xi(e){Ys(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Ji(e,t,i){(t!=null||i!=null)&&Ys(e),t!=null&&(e.curOp.scrollLeft=t),i!=null&&(e.curOp.scrollTop=i)}function Uh(e,t){Ys(e),e.curOp.scrollToPos=t}function Ys(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var i=xu(e,t.from),r=xu(e,t.to);Eu(e,i,r,t.margin)}}function Eu(e,t,i,r){var a=fa(e,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-r,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+r});Ji(e,a.scrollLeft,a.scrollTop)}function Zi(e,t){Math.abs(e.doc.scrollTop-t)<2||(h||da(e,{top:t}),Nu(e,t,!0),h&&da(e),ts(e,100))}function Nu(e,t,i){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),!(e.display.scroller.scrollTop==t&&!i)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function ti(e,t,i,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),!((i?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r)&&(e.doc.scrollLeft=t,Ru(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Qi(e){var t=e.display,i=t.gutters.offsetWidth,r=Math.round(e.doc.height+Jo(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?i:0,docHeight:r,scrollHeight:r+Jn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var ni=function(e,t,i){this.cm=i;var r=this.vert=K("div",[K("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),a=this.horiz=K("div",[K("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=a.tabIndex=-1,e(r),e(a),Ee(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ee(a,"scroll",function(){a.clientWidth&&t(a.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,w&&x<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};ni.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,i=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(i){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var a=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+a)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=i?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var u=e.viewWidth-e.barLeft-(i?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+u)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(r==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:i?r:0,bottom:t?r:0}},ni.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},ni.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},ni.prototype.zeroWidthHack=function(){var e=B&&!D?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new X,this.disableVert=new X},ni.prototype.enableZeroWidthBar=function(e,t,i){e.style.pointerEvents="auto";function r(){var a=e.getBoundingClientRect(),u=i=="vert"?document.elementFromPoint(a.right-1,(a.top+a.bottom)/2):document.elementFromPoint((a.right+a.left)/2,a.bottom-1);u!=e?e.style.pointerEvents="none":t.set(1e3,r)}t.set(1e3,r)},ni.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var es=function(){};es.prototype.update=function(){return{bottom:0,right:0}},es.prototype.setScrollLeft=function(){},es.prototype.setScrollTop=function(){},es.prototype.clear=function(){};function _i(e,t){t||(t=Qi(e));var i=e.display.barWidth,r=e.display.barHeight;Pu(e,t);for(var a=0;a<4&&i!=e.display.barWidth||r!=e.display.barHeight;a++)i!=e.display.barWidth&&e.options.lineWrapping&&Xs(e),Pu(e,Qi(e)),i=e.display.barWidth,r=e.display.barHeight}function Pu(e,t){var i=e.display,r=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=r.right)+"px",i.sizer.style.paddingBottom=(i.barHeight=r.bottom)+"px",i.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(i.scrollbarFiller.style.display="block",i.scrollbarFiller.style.height=r.bottom+"px",i.scrollbarFiller.style.width=r.right+"px"):i.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(i.gutterFiller.style.display="block",i.gutterFiller.style.height=r.bottom+"px",i.gutterFiller.style.width=t.gutterWidth+"px"):i.gutterFiller.style.display=""}var Ou={native:ni,null:es};function Du(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&ke(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ou[e.options.scrollbarStyle](function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),Ee(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,i){i=="horizontal"?ti(e,t):Zi(e,t)},e),e.display.scrollbars.addClass&&Oe(e.display.wrapper,e.display.scrollbars.addClass)}var $h=0;function ri(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:++$h,markArrays:null},xh(e.curOp)}function ii(e){var t=e.curOp;t&&Sh(t,function(i){for(var r=0;r=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Js(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Xh(e){e.updatedDisplay=e.mustUpdate&&pa(e.cm,e.update)}function Vh(e){var t=e.cm,i=t.display;e.updatedDisplay&&Xs(t),e.barMeasure=Qi(t),i.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=du(t,i.maxLine,i.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+e.adjustWidthTo+Jn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+e.adjustWidthTo-Jr(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=i.input.prepareSelection())}function Yh(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)){var i=+new Date+e.options.workTime,r=Ui(e,t.highlightFrontier),a=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),function(u){if(r.line>=e.display.viewFrom){var f=u.styles,p=u.text.length>e.options.maxHighlightLength?Kt(t.mode,r.state):null,m=zl(e,u,r,!0);p&&(r.state=p),u.styles=m.styles;var g=u.styleClasses,A=m.classes;A?u.styleClasses=A:g&&(u.styleClasses=null);for(var N=!f||f.length!=u.styles.length||g!=A&&(!g||!A||g.bgClass!=A.bgClass||g.textClass!=A.textClass),j=0;!N&&ji)return ts(e,e.options.workDelay),!0}),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),a.length&&gn(e,function(){for(var u=0;u=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&Iu(e)==0)return!1;Fu(e)&&(Lr(e),t.dims=ia(e));var a=r.first+r.size,u=Math.max(t.visible.from-e.options.viewportMargin,r.first),f=Math.min(a,t.visible.to+e.options.viewportMargin);i.viewFromf&&i.viewTo-f<20&&(f=Math.min(a,i.viewTo)),hr&&(u=Ko(e.doc,u),f=nu(e.doc,f));var p=u!=i.viewFrom||f!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Wh(e,u,f),i.viewOffset=pr(Ce(e.doc,i.viewFrom)),e.display.mover.style.top=i.viewOffset+"px";var m=Iu(e);if(!p&&m==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo))return!1;var g=ep(e);return m>4&&(i.lineDiv.style.display="none"),np(e,i.updateLineNumbers,t.dims),m>4&&(i.lineDiv.style.display=""),i.renderedView=i.view,tp(g),Te(i.cursorDiv),Te(i.selectionDiv),i.gutters.style.height=i.sizer.style.minHeight=0,p&&(i.lastWrapHeight=t.wrapperHeight,i.lastWrapWidth=t.wrapperWidth,ts(e,400)),i.updateLineNumbers=null,!0}function Mu(e,t){for(var i=t.viewport,r=!0;;r=!1){if(!r||!e.options.lineWrapping||t.oldDisplayWidth==Jr(e)){if(i&&i.top!=null&&(i={top:Math.min(e.doc.height+Jo(e.display)-Zo(e),i.top)}),t.visible=Vs(e.display,e.doc,i),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else r&&(t.visible=Vs(e.display,e.doc,i));if(!pa(e,t))break;Xs(e);var a=Qi(e);Yi(e),_i(e,a),ga(e,a),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 da(e,t){var i=new Js(e,t);if(pa(e,i)){Xs(e),Mu(e,i);var r=Qi(e);Yi(e),_i(e,r),ga(e,r),i.finish()}}function np(e,t,i){var r=e.display,a=e.options.lineNumbers,u=r.lineDiv,f=u.firstChild;function p(Y){var re=Y.nextSibling;return y&&B&&e.display.currentWheelTarget==Y?Y.style.display="none":Y.parentNode.removeChild(Y),re}for(var m=r.view,g=r.viewFrom,A=0;A-1&&(W=!1),au(e,N,g,i)),W&&(Te(N.lineNumber),N.lineNumber.appendChild(document.createTextNode(Yr(e.options,g)))),f=N.node.nextSibling}g+=N.size}for(;f;)f=p(f)}function ma(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",Nt(e,"gutterChanged",e)}function ga(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+Jn(e)+"px"}function Ru(e){var t=e.display,i=t.view;if(!(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))){for(var r=sa(t)-t.scroller.scrollLeft+e.doc.scrollLeft,a=t.gutters.offsetWidth,u=r+"px",f=0;fp.clientWidth,g=p.scrollHeight>p.clientHeight;if(r&&m||a&&g){if(a&&B&&y){e:for(var A=t.target,N=f.view;A!=p;A=A.parentNode)for(var j=0;j=0&&v(e,r.to())<=0)return i}return-1};var it=function(e,t){this.anchor=e,this.head=t};it.prototype.from=function(){return Be(this.anchor,this.head)},it.prototype.to=function(){return de(this.anchor,this.head)},it.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Fn(e,t,i){var r=e&&e.options.selectionsMayTouch,a=t[i];t.sort(function(j,W){return v(j.from(),W.from())}),i=z(t,a);for(var u=1;u0:m>=0){var g=Be(p.from(),f.from()),A=de(p.to(),f.to()),N=p.empty()?f.from()==f.head:p.from()==p.head;u<=i&&--i,t.splice(--u,2,new it(N?A:g,N?g:A))}}return new Tn(t,i)}function Er(e,t){return new Tn([new it(e,t||e)],0)}function Nr(e){return e.text?ce(e.from.line+e.text.length-1,Ae(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function ju(e,t){if(v(e,t.from)<0)return e;if(v(e,t.to)<=0)return Nr(t);var i=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Nr(t).ch-t.to.ch),ce(i,r)}function ka(e,t){for(var i=[],r=0;r1&&e.remove(p.line+1,Y-1),e.insert(p.line+1,be)}Nt(e,"change",e,t)}function Pr(e,t,i){function r(a,u,f){if(a.linked)for(var p=0;p1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Ae(e.done)}function Ku(e,t,i,r){var a=e.history;a.undone.length=0;var u=+new Date,f,p;if((a.lastOp==r||a.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&a.lastModTime>u-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(f=ap(a,a.lastOp==r)))p=Ae(f.changes),v(t.from,t.to)==0&&v(t.from,p.to)==0?p.to=Nr(t):f.changes.push(wa(e,t));else{var m=Ae(a.done);for((!m||!m.ranges)&&eo(e.sel,a.done),f={changes:[wa(e,t)],generation:a.generation},a.done.push(f);a.done.length>a.undoDepth;)a.done.shift(),a.done[0].ranges||a.done.shift()}a.done.push(i),a.generation=++a.maxGeneration,a.lastModTime=a.lastSelTime=u,a.lastOp=a.lastSelOp=r,a.lastOrigin=a.lastSelOrigin=t.origin,p||Me(e,"historyAdded")}function lp(e,t,i,r){var a=t.charAt(0);return a=="*"||a=="+"&&i.ranges.length==r.ranges.length&&i.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function up(e,t,i,r){var a=e.history,u=r&&r.origin;i==a.lastSelOp||u&&a.lastSelOrigin==u&&(a.lastModTime==a.lastSelTime&&a.lastOrigin==u||lp(e,u,Ae(a.done),t))?a.done[a.done.length-1]=t:eo(t,a.done),a.lastSelTime=+new Date,a.lastSelOrigin=u,a.lastSelOp=i,r&&r.clearRedo!==!1&&Gu(a.undone)}function eo(e,t){var i=Ae(t);i&&i.ranges&&i.equals(e)||t.push(e)}function Xu(e,t,i,r){var a=t["spans_"+e.id],u=0;e.iter(Math.max(e.first,i),Math.min(e.first+e.size,r),function(f){f.markedSpans&&((a||(a=t["spans_"+e.id]={}))[u]=f.markedSpans),++u})}function cp(e){if(!e)return null;for(var t,i=0;i-1&&(Ae(p)[N]=g[N],delete g[N])}}return r}function xa(e,t,i,r){if(r){var a=e.anchor;if(i){var u=v(t,a)<0;u!=v(i,a)<0?(a=t,t=i):u!=v(t,i)<0&&(t=i)}return new it(a,t)}else return new it(i||t,t)}function to(e,t,i,r,a){a==null&&(a=e.cm&&(e.cm.display.shift||e.extend)),Vt(e,new Tn([xa(e.sel.primary(),t,i,a)],0),r)}function Yu(e,t,i){for(var r=[],a=e.cm&&(e.cm.display.shift||e.extend),u=0;u=t.ch:p.to>t.ch))){if(a&&(Me(m,"beforeCursorEnter"),m.explicitlyCleared))if(u.markedSpans){--f;continue}else break;if(!m.atomic)continue;if(i){var N=m.find(r<0?1:-1),j=void 0;if((r<0?A:g)&&(N=nc(e,N,-r,N&&N.line==t.line?u:null)),N&&N.line==t.line&&(j=v(N,i))&&(r<0?j<0:j>0))return Ti(e,N,t,r,a)}var W=m.find(r<0?-1:1);return(r<0?g:A)&&(W=nc(e,W,r,W.line==t.line?u:null)),W?Ti(e,W,t,r,a):null}}return t}function ro(e,t,i,r,a){var u=r||1,f=Ti(e,t,i,u,a)||!a&&Ti(e,t,i,u,!0)||Ti(e,t,i,-u,a)||!a&&Ti(e,t,i,-u,!0);return f||(e.cantEdit=!0,ce(e.first,0))}function nc(e,t,i,r){return i<0&&t.ch==0?t.line>e.first?Se(e,ce(t.line-1)):null:i>0&&t.ch==(r||Ce(e,t.line)).text.length?t.line=0;--a)sc(e,{from:r[a].from,to:r[a].to,text:a?[""]:t.text,origin:t.origin});else sc(e,t)}}function sc(e,t){if(!(t.text.length==1&&t.text[0]==""&&v(t.from,t.to)==0)){var i=ka(e,t);Ku(e,t,i,e.cm?e.cm.curOp.id:NaN),is(e,t,i,$o(e,t));var r=[];Pr(e,function(a,u){!u&&z(r,a.history)==-1&&(uc(a.history,t),r.push(a.history)),is(a,t,null,$o(a,t))})}}function io(e,t,i){var r=e.cm&&e.cm.state.suppressEdits;if(!(r&&!i)){for(var a=e.history,u,f=e.sel,p=t=="undo"?a.done:a.undone,m=t=="undo"?a.undone:a.done,g=0;g=0;--W){var Y=j(W);if(Y)return Y.v}}}}function oc(e,t){if(t!=0&&(e.first+=t,e.sel=new Tn(He(e.sel.ranges,function(a){return new it(ce(a.anchor.line+t,a.anchor.ch),ce(a.head.line+t,a.head.ch))}),e.sel.primIndex),e.cm)){an(e.cm,e.first,e.first-t,t);for(var i=e.cm.display,r=i.viewFrom;re.lastLine())){if(t.from.lineu&&(t={from:t.from,to:ce(u,Ce(e,u).text.length),text:[t.text[0]],origin:t.origin}),t.removed=En(e,t.from,t.to),i||(i=ka(e,t)),e.cm?pp(e.cm,t,r):ba(e,t,r),no(e,i,fe),e.cantEdit&&ro(e,ce(e.firstLine(),0))&&(e.cantEdit=!1)}}function pp(e,t,i){var r=e.doc,a=e.display,u=t.from,f=t.to,p=!1,m=u.line;e.options.lineWrapping||(m=rt(Mn(Ce(r,u.line))),r.iter(m,f.line+1,function(W){if(W==a.maxLine)return p=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Gn(e),ba(r,t,i,Tu(e)),e.options.lineWrapping||(r.iter(m,u.line+t.text.length,function(W){var Y=js(W);Y>a.maxLineLength&&(a.maxLine=W,a.maxLineLength=Y,a.maxLineChanged=!0,p=!1)}),p&&(e.curOp.updateMaxLine=!0)),nh(r,u.line),ts(e,400);var g=t.text.length-(f.line-u.line)-1;t.full?an(e):u.line==f.line&&t.text.length==1&&!qu(e.doc,t)?Ar(e,u.line,"text"):an(e,u.line,f.line+1,g);var A=wt(e,"changes"),N=wt(e,"change");if(N||A){var j={from:u,to:f,text:t.text,removed:t.removed,origin:t.origin};N&&Nt(e,"change",e,j),A&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(j)}e.display.selForContextMenu=null}function Ci(e,t,i,r,a){var u;r||(r=i),v(r,i)<0&&(u=[r,i],i=u[0],r=u[1]),typeof t=="string"&&(t=e.splitLines(t)),Ii(e,{from:i,to:r,text:t,origin:a})}function ac(e,t,i,r){i1||!(this.children[0]instanceof os))){var p=[];this.collapse(p),this.children=[new os(p)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var f=a.lines.length%25+25,p=f;p10);e.parent.maybeSpill()}},iterN:function(e,t,i){for(var r=0;re.display.maxLineLength&&(e.display.maxLine=g,e.display.maxLineLength=A,e.display.maxLineChanged=!0)}r!=null&&e&&this.collapsed&&an(e,r,a+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&ec(e.doc)),e&&Nt(e,"markerCleared",e,this,r,a),t&&ii(e),this.parent&&this.parent.clear()}},Or.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var i,r,a=0;a0||f==0&&u.clearWhenEmpty!==!1)return u;if(u.replacedWith&&(u.collapsed=!0,u.widgetNode=b("span",[u.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||u.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(u.widgetNode.insertLeft=!0)),u.collapsed){if(tu(e,t.line,t,i,u)||t.line!=i.line&&tu(e,i.line,t,i,u))throw new Error("Inserting collapsed marker partially overlapping an existing one");ih()}u.addToHistory&&Ku(e,{from:t,to:i,origin:"markText"},e.sel,NaN);var p=t.line,m=e.cm,g;if(e.iter(p,i.line+1,function(N){m&&u.collapsed&&!m.options.lineWrapping&&Mn(N)==m.display.maxLine&&(g=!0),u.collapsed&&p!=t.line&&Qt(N,0),oh(N,new Fs(u,p==t.line?t.ch:null,p==i.line?i.ch:null),e.cm&&e.cm.curOp),++p}),u.collapsed&&e.iter(t.line,i.line+1,function(N){Cr(e,N)&&Qt(N,0)}),u.clearOnEnter&&Ee(u,"beforeCursorEnter",function(){return u.clear()}),u.readOnly&&(rh(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),u.collapsed&&(u.id=++fc,u.atomic=!0),m){if(g&&(m.curOp.updateMaxLine=!0),u.collapsed)an(m,t.line,i.line+1);else if(u.className||u.startStyle||u.endStyle||u.css||u.attributes||u.title)for(var A=t.line;A<=i.line;A++)Ar(m,A,"text");u.atomic&&ec(m.doc),Nt(m,"markerAdded",m,u)}return u}var us=function(e,t){this.markers=e,this.primary=t;for(var i=0;i=0;m--)Ii(this,r[m]);p?Zu(this,p):this.cm&&xi(this.cm)}),undo:Ot(function(){io(this,"undo")}),redo:Ot(function(){io(this,"redo")}),undoSelection:Ot(function(){io(this,"undo",!0)}),redoSelection:Ot(function(){io(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,i=0,r=0;r=e.ch)&&t.push(a.marker.parent||a.marker)}return t},findMarks:function(e,t,i){e=Se(this,e),t=Se(this,t);var r=[],a=e.line;return this.iter(e.line,t.line+1,function(u){var f=u.markedSpans;if(f)for(var p=0;p=m.to||m.from==null&&a!=e.line||m.from!=null&&a==t.line&&m.from>=t.ch)&&(!i||i(m.marker))&&r.push(m.marker.parent||m.marker)}++a}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var i=t.markedSpans;if(i)for(var r=0;re)return t=e,!0;e-=u,++i}),Se(this,ce(i,t))},indexFromPos:function(e){e=Se(this,e);var t=e.ch;if(e.linet&&(t=e.from),e.to!=null&&e.to-1){t.state.draggingText(e),setTimeout(function(){return t.display.input.focus()},20);return}try{var A=e.dataTransfer.getData("Text");if(A){var N;if(t.state.draggingText&&!t.state.draggingText.copy&&(N=t.listSelections()),no(t.doc,Er(i,i)),N)for(var j=0;j=0;p--)Ci(e.doc,"",r[p].from,r[p].to,"+delete");xi(e)})}function Sa(e,t,i){var r=It(e.text,t+i,i);return r<0||r>e.text.length?null:r}function Ta(e,t,i){var r=Sa(e,t.ch,i);return r==null?null:new ce(t.line,r,i<0?"after":"before")}function Ia(e,t,i,r,a){if(e){t.doc.direction=="rtl"&&(a=-a);var u=Bt(i,t.doc.direction);if(u){var f=a<0?Ae(u):u[0],p=a<0==(f.level==1),m=p?"after":"before",g;if(f.level>0||t.doc.direction=="rtl"){var A=ki(t,i);g=a<0?i.text.length-1:0;var N=Zn(t,A,g).top;g=pn(function(j){return Zn(t,A,j).top==N},a<0==(f.level==1)?f.from:f.to-1,g),m=="before"&&(g=Sa(i,g,1))}else g=a<0?f.to:f.from;return new ce(r,g,m)}}return new ce(r,a<0?i.text.length:0,a<0?"before":"after")}function Cp(e,t,i,r){var a=Bt(t,e.doc.direction);if(!a)return Ta(t,i,r);i.ch>=t.text.length?(i.ch=t.text.length,i.sticky="before"):i.ch<=0&&(i.ch=0,i.sticky="after");var u=ft(a,i.ch,i.sticky),f=a[u];if(e.doc.direction=="ltr"&&f.level%2==0&&(r>0?f.to>i.ch:f.from=f.from&&j>=A.begin)){var W=N?"before":"after";return new ce(i.line,j,W)}}var Y=function(be,_e,we){for(var Ie=function(ut,Dt){return Dt?new ce(i.line,p(ut,1),"before"):new ce(i.line,ut,"after")};be>=0&&be0==(Pe.level!=1),Ve=Le?we.begin:p(we.end,-1);if(Pe.from<=Ve&&Ve0?A.end:p(A.begin,-1);return me!=null&&!(r>0&&me==t.text.length)&&(re=Y(r>0?0:a.length-1,r,g(me)),re)?re:null}var hs={selectAll:rc,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),fe)},killLine:function(e){return Ei(e,function(t){if(t.empty()){var i=Ce(e.doc,t.head.line).text.length;return t.head.ch==i&&t.head.line0)a=new ce(a.line,a.ch+1),e.replaceRange(u.charAt(a.ch-1)+u.charAt(a.ch-2),ce(a.line,a.ch-2),a,"+transpose");else if(a.line>e.doc.first){var f=Ce(e.doc,a.line-1).text;f&&(a=new ce(a.line,1),e.replaceRange(u.charAt(0)+e.doc.lineSeparator()+f.charAt(f.length-1),ce(a.line-1,f.length-1),a,"+transpose"))}}i.push(new it(a,a))}e.setSelections(i)})},newlineAndIndent:function(e){return gn(e,function(){for(var t=e.listSelections(),i=t.length-1;i>=0;i--)e.replaceRange(e.doc.lineSeparator(),t[i].anchor,t[i].head,"+input");t=e.listSelections();for(var r=0;re&&v(t,this.pos)==0&&i==this.button};var ds,ms;function Dp(e,t){var i=+new Date;return ms&&ms.compare(i,e,t)?(ds=ms=null,"triple"):ds&&ds.compare(i,e,t)?(ms=new Aa(i,e,t),ds=null,"double"):(ds=new Aa(i,e,t),ms=null,"single")}function Cc(e){var t=this,i=t.display;if(!(pt(t,e)||i.activeTouch&&i.input.supportsTouch())){if(i.input.ensurePolled(),i.shift=e.shiftKey,dr(i,e)){y||(i.scroller.draggable=!1,setTimeout(function(){return i.scroller.draggable=!0},100));return}if(!La(t,e)){var r=Qr(t,e),a=xr(e),u=r?Dp(r,a):"single";window.focus(),a==1&&t.state.selectingText&&t.state.selectingText(e),!(r&&Mp(t,a,r,u,e))&&(a==1?r?Fp(t,r,u,e):An(e)==i.scroller&&_t(e):a==2?(r&&to(t.doc,r),setTimeout(function(){return i.input.focus()},20)):a==3&&(ye?t.display.input.onContextMenu(e):ua(t)))}}}function Mp(e,t,i,r,a){var u="Click";return r=="double"?u="Double"+u:r=="triple"&&(u="Triple"+u),u=(t==1?"Left":t==2?"Middle":"Right")+u,ps(e,kc(u,a),a,function(f){if(typeof f=="string"&&(f=hs[f]),!f)return!1;var p=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),p=f(e,i)!=ee}finally{e.state.suppressEdits=!1}return p})}function Rp(e,t,i){var r=e.getOption("configureMouse"),a=r?r(e,t,i):{};if(a.unit==null){var u=$?i.shiftKey&&i.metaKey:i.altKey;a.unit=u?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(a.extend==null||e.doc.extend)&&(a.extend=e.doc.extend||i.shiftKey),a.addNew==null&&(a.addNew=B?i.metaKey:i.ctrlKey),a.moveOnDrag==null&&(a.moveOnDrag=!(B?i.altKey:i.ctrlKey)),a}function Fp(e,t,i,r){w?setTimeout(tt(Au,e),0):e.curOp.focus=le();var a=Rp(e,i,r),u=e.doc.sel,f;e.options.dragDrop&&or&&!e.isReadOnly()&&i=="single"&&(f=u.contains(t))>-1&&(v((f=u.ranges[f]).from(),t)<0||t.xRel>0)&&(v(f.to(),t)>0||t.xRel<0)?Bp(e,r,t,a):Wp(e,r,t,a)}function Bp(e,t,i,r){var a=e.display,u=!1,f=Pt(e,function(g){y&&(a.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:ua(e)),Lt(a.wrapper.ownerDocument,"mouseup",f),Lt(a.wrapper.ownerDocument,"mousemove",p),Lt(a.scroller,"dragstart",m),Lt(a.scroller,"drop",f),u||(_t(g),r.addNew||to(e.doc,i,null,null,r.extend),y&&!F||w&&x==9?setTimeout(function(){a.wrapper.ownerDocument.body.focus({preventScroll:!0}),a.input.focus()},20):a.input.focus())}),p=function(g){u=u||Math.abs(t.clientX-g.clientX)+Math.abs(t.clientY-g.clientY)>=10},m=function(){return u=!0};y&&(a.scroller.draggable=!0),e.state.draggingText=f,f.copy=!r.moveOnDrag,Ee(a.wrapper.ownerDocument,"mouseup",f),Ee(a.wrapper.ownerDocument,"mousemove",p),Ee(a.scroller,"dragstart",m),Ee(a.scroller,"drop",f),e.state.delayingBlurEvent=!0,setTimeout(function(){return a.input.focus()},20),a.scroller.dragDrop&&a.scroller.dragDrop()}function Ac(e,t,i){if(i=="char")return new it(t,t);if(i=="word")return e.findWordAt(t);if(i=="line")return new it(ce(t.line,0),Se(e.doc,ce(t.line+1,0)));var r=i(e,t);return new it(r.from,r.to)}function Wp(e,t,i,r){w&&ua(e);var a=e.display,u=e.doc;_t(t);var f,p,m=u.sel,g=m.ranges;if(r.addNew&&!r.extend?(p=u.sel.contains(i),p>-1?f=g[p]:f=new it(i,i)):(f=u.sel.primary(),p=u.sel.primIndex),r.unit=="rectangle")r.addNew||(f=new it(i,i)),i=Qr(e,t,!0,!0),p=-1;else{var A=Ac(e,i,r.unit);r.extend?f=xa(f,A.anchor,A.head,r.extend):f=A}r.addNew?p==-1?(p=g.length,Vt(u,Fn(e,g.concat([f]),p),{scroll:!1,origin:"*mouse"})):g.length>1&&g[p].empty()&&r.unit=="char"&&!r.extend?(Vt(u,Fn(e,g.slice(0,p).concat(g.slice(p+1)),0),{scroll:!1,origin:"*mouse"}),m=u.sel):_a(u,p,f,ve):(p=0,Vt(u,new Tn([f],0),ve),m=u.sel);var N=i;function j(we){if(v(N,we)!=0)if(N=we,r.unit=="rectangle"){for(var Ie=[],Pe=e.options.tabSize,Le=qe(Ce(u,i.line).text,i.ch,Pe),Ve=qe(Ce(u,we.line).text,we.ch,Pe),ut=Math.min(Le,Ve),Dt=Math.max(Le,Ve),vt=Math.min(i.line,we.line),vn=Math.min(e.lastLine(),Math.max(i.line,we.line));vt<=vn;vt++){var un=Ce(u,vt).text,St=De(un,ut,Pe);ut==Dt?Ie.push(new it(ce(vt,St),ce(vt,St))):un.length>St&&Ie.push(new it(ce(vt,St),ce(vt,De(un,Dt,Pe))))}Ie.length||Ie.push(new it(i,i)),Vt(u,Fn(e,m.ranges.slice(0,p).concat(Ie),p),{origin:"*mouse",scroll:!1}),e.scrollIntoView(we)}else{var cn=f,Wt=Ac(e,we,r.unit),Ct=cn.anchor,Tt;v(Wt.anchor,Ct)>0?(Tt=Wt.head,Ct=Be(cn.from(),Wt.anchor)):(Tt=Wt.anchor,Ct=de(cn.to(),Wt.head));var yt=m.ranges.slice(0);yt[p]=Hp(e,new it(Se(u,Ct),Tt)),Vt(u,Fn(e,yt,p),ve)}}var W=a.wrapper.getBoundingClientRect(),Y=0;function re(we){var Ie=++Y,Pe=Qr(e,we,!0,r.unit=="rectangle");if(Pe)if(v(Pe,N)!=0){e.curOp.focus=le(),j(Pe);var Le=Vs(a,u);(Pe.line>=Le.to||Pe.lineW.bottom?20:0;Ve&&setTimeout(Pt(e,function(){Y==Ie&&(a.scroller.scrollTop+=Ve,re(we))}),50)}}function me(we){e.state.selectingText=!1,Y=1/0,we&&(_t(we),a.input.focus()),Lt(a.wrapper.ownerDocument,"mousemove",be),Lt(a.wrapper.ownerDocument,"mouseup",_e),u.history.lastSelOrigin=null}var be=Pt(e,function(we){we.buttons===0||!xr(we)?me(we):re(we)}),_e=Pt(e,me);e.state.selectingText=_e,Ee(a.wrapper.ownerDocument,"mousemove",be),Ee(a.wrapper.ownerDocument,"mouseup",_e)}function Hp(e,t){var i=t.anchor,r=t.head,a=Ce(e.doc,i.line);if(v(i,r)==0&&i.sticky==r.sticky)return t;var u=Bt(a);if(!u)return t;var f=ft(u,i.ch,i.sticky),p=u[f];if(p.from!=i.ch&&p.to!=i.ch)return t;var m=f+(p.from==i.ch==(p.level!=1)?0:1);if(m==0||m==u.length)return t;var g;if(r.line!=i.line)g=(r.line-i.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var A=ft(u,r.ch,r.sticky),N=A-f||(r.ch-i.ch)*(p.level==1?-1:1);A==m-1||A==m?g=N<0:g=N>0}var j=u[m+(g?-1:0)],W=g==(j.level==1),Y=W?j.from:j.to,re=W?"after":"before";return i.ch==Y&&i.sticky==re?t:new it(new ce(i.line,Y,re),r)}function Lc(e,t,i,r){var a,u;if(t.touches)a=t.touches[0].clientX,u=t.touches[0].clientY;else try{a=t.clientX,u=t.clientY}catch{return!1}if(a>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&_t(t);var f=e.display,p=f.lineDiv.getBoundingClientRect();if(u>p.bottom||!wt(e,i))return $t(t);u-=p.top-f.viewOffset;for(var m=0;m=a){var A=Nn(e.doc,u),N=e.display.gutterSpecs[m];return Me(e,i,e,A,N.className,t),$t(t)}}}function La(e,t){return Lc(e,t,"gutterClick",!0)}function Ec(e,t){dr(e.display,t)||jp(e,t)||pt(e,t,"contextmenu")||ye||e.display.input.onContextMenu(t)}function jp(e,t){return wt(e,"gutterContextMenu")?Lc(e,t,"gutterContextMenu",!1):!1}function Nc(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Vi(e)}var Ni={toString:function(){return"CodeMirror.Init"}},Pc={},lo={};function zp(e){var t=e.optionHandlers;function i(r,a,u,f){e.defaults[r]=a,u&&(t[r]=f?function(p,m,g){g!=Ni&&u(p,m,g)}:u)}e.defineOption=i,e.Init=Ni,i("value","",function(r,a){return r.setValue(a)},!0),i("mode",null,function(r,a){r.doc.modeOption=a,ya(r)},!0),i("indentUnit",2,ya,!0),i("indentWithTabs",!1),i("smartIndent",!0),i("tabSize",4,function(r){rs(r),Vi(r),an(r)},!0),i("lineSeparator",null,function(r,a){if(r.doc.lineSep=a,!!a){var u=[],f=r.doc.first;r.doc.iter(function(m){for(var g=0;;){var A=m.text.indexOf(a,g);if(A==-1)break;g=A+a.length,u.push(ce(f,A))}f++});for(var p=u.length-1;p>=0;p--)Ci(r.doc,a,u[p],ce(u[p].line,u[p].ch+a.length))}}),i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(r,a,u){r.state.specialChars=new RegExp(a.source+(a.test(" ")?"":"| "),"g"),u!=Ni&&r.refresh()}),i("specialCharPlaceholder",vh,function(r){return r.refresh()},!0),i("electricChars",!0),i("inputStyle",M?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),i("spellcheck",!1,function(r,a){return r.getInputField().spellcheck=a},!0),i("autocorrect",!1,function(r,a){return r.getInputField().autocorrect=a},!0),i("autocapitalize",!1,function(r,a){return r.getInputField().autocapitalize=a},!0),i("rtlMoveVisually",!ae),i("wholeLineUpdateBefore",!0),i("theme","default",function(r){Nc(r),ns(r)},!0),i("keyMap","default",function(r,a,u){var f=oo(a),p=u!=Ni&&oo(u);p&&p.detach&&p.detach(r,f),f.attach&&f.attach(r,p||null)}),i("extraKeys",null),i("configureMouse",null),i("lineWrapping",!1,Up,!0),i("gutters",[],function(r,a){r.display.gutterSpecs=va(a,r.options.lineNumbers),ns(r)},!0),i("fixedGutter",!0,function(r,a){r.display.gutters.style.left=a?sa(r.display)+"px":"0",r.refresh()},!0),i("coverGutterNextToScrollbar",!1,function(r){return _i(r)},!0),i("scrollbarStyle","native",function(r){Du(r),_i(r),r.display.scrollbars.setScrollTop(r.doc.scrollTop),r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)},!0),i("lineNumbers",!1,function(r,a){r.display.gutterSpecs=va(r.options.gutters,a),ns(r)},!0),i("firstLineNumber",1,ns,!0),i("lineNumberFormatter",function(r){return r},ns,!0),i("showCursorWhenSelecting",!1,Yi,!0),i("resetSelectionOnContextMenu",!0),i("lineWiseCopyCut",!0),i("pasteLinesPerSelection",!0),i("selectionsMayTouch",!1),i("readOnly",!1,function(r,a){a=="nocursor"&&(wi(r),r.display.input.blur()),r.display.input.readOnlyChanged(a)}),i("screenReaderLabel",null,function(r,a){a=a===""?null:a,r.display.input.screenReaderLabelChanged(a)}),i("disableInput",!1,function(r,a){a||r.display.input.reset()},!0),i("dragDrop",!0,qp),i("allowDropFileTypes",null),i("cursorBlinkRate",530),i("cursorScrollMargin",0),i("cursorHeight",1,Yi,!0),i("singleCursorHeightPerLine",!0,Yi,!0),i("workTime",100),i("workDelay",100),i("flattenSpans",!0,rs,!0),i("addModeClass",!1,rs,!0),i("pollInterval",100),i("undoDepth",200,function(r,a){return r.doc.history.undoDepth=a}),i("historyEventDelay",1250),i("viewportMargin",10,function(r){return r.refresh()},!0),i("maxHighlightLength",1e4,rs,!0),i("moveInputWithCursor",!0,function(r,a){a||r.display.input.resetPosition()}),i("tabindex",null,function(r,a){return r.display.input.getField().tabIndex=a||""}),i("autofocus",null),i("direction","ltr",function(r,a){return r.doc.setDirection(a)},!0),i("phrases",null)}function qp(e,t,i){var r=i&&i!=Ni;if(!t!=!r){var a=e.display.dragFunctions,u=t?Ee:Lt;u(e.display.scroller,"dragstart",a.start),u(e.display.scroller,"dragenter",a.enter),u(e.display.scroller,"dragover",a.over),u(e.display.scroller,"dragleave",a.leave),u(e.display.scroller,"drop",a.drop)}}function Up(e){e.options.lineWrapping?(Oe(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(ke(e.display.wrapper,"CodeMirror-wrap"),Vo(e)),oa(e),an(e),Vi(e),setTimeout(function(){return _i(e)},100)}function mt(e,t){var i=this;if(!(this instanceof mt))return new mt(e,t);this.options=t=t?ze(t):{},ze(Pc,t,!1);var r=t.value;typeof r=="string"?r=new ln(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var a=new mt.inputStyles[t.inputStyle](this),u=this.display=new rp(e,r,a,t);u.wrapper.CodeMirror=this,Nc(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Du(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 X,keySeq:null,specialChars:null},t.autofocus&&!M&&u.input.focus(),w&&x<11&&setTimeout(function(){return i.display.input.reset(!0)},20),$p(this),xp(),ri(this),this.curOp.forceUpdate=!0,Uu(this,r),t.autofocus&&!M||this.hasFocus()?setTimeout(function(){i.hasFocus()&&!i.state.focused&&ca(i)},20):wi(this);for(var f in lo)lo.hasOwnProperty(f)&&lo[f](this,t[f],Ni);Fu(this),t.finishInit&&t.finishInit(this);for(var p=0;p20*20}Ee(t.scroller,"touchstart",function(m){if(!pt(e,m)&&!u(m)&&!La(e,m)){t.input.ensurePolled(),clearTimeout(i);var g=+new Date;t.activeTouch={start:g,moved:!1,prev:g-r.end<=300?r:null},m.touches.length==1&&(t.activeTouch.left=m.touches[0].pageX,t.activeTouch.top=m.touches[0].pageY)}}),Ee(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ee(t.scroller,"touchend",function(m){var g=t.activeTouch;if(g&&!dr(t,m)&&g.left!=null&&!g.moved&&new Date-g.start<300){var A=e.coordsChar(t.activeTouch,"page"),N;!g.prev||f(g,g.prev)?N=new it(A,A):!g.prev.prev||f(g,g.prev.prev)?N=e.findWordAt(A):N=new it(ce(A.line,0),Se(e.doc,ce(A.line+1,0))),e.setSelection(N.anchor,N.head),e.focus(),_t(m)}a()}),Ee(t.scroller,"touchcancel",a),Ee(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Zi(e,t.scroller.scrollTop),ti(e,t.scroller.scrollLeft,!0),Me(e,"scroll",e))}),Ee(t.scroller,"mousewheel",function(m){return Hu(e,m)}),Ee(t.scroller,"DOMMouseScroll",function(m){return Hu(e,m)}),Ee(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(m){pt(e,m)||Dn(m)},over:function(m){pt(e,m)||(wp(e,m),Dn(m))},start:function(m){return bp(e,m)},drop:Pt(e,yp),leave:function(m){pt(e,m)||dc(e)}};var p=t.input.getField();Ee(p,"keyup",function(m){return Tc.call(e,m)}),Ee(p,"keydown",Pt(e,Sc)),Ee(p,"keypress",Pt(e,Ic)),Ee(p,"focus",function(m){return ca(e,m)}),Ee(p,"blur",function(m){return wi(e,m)})}var Ea=[];mt.defineInitHook=function(e){return Ea.push(e)};function gs(e,t,i,r){var a=e.doc,u;i==null&&(i="add"),i=="smart"&&(a.mode.indent?u=Ui(e,t).state:i="prev");var f=e.options.tabSize,p=Ce(a,t),m=qe(p.text,null,f);p.stateAfter&&(p.stateAfter=null);var g=p.text.match(/^\s*/)[0],A;if(!r&&!/\S/.test(p.text))A=0,i="not";else if(i=="smart"&&(A=a.mode.indent(u,p.text.slice(g.length),p.text),A==ee||A>150)){if(!r)return;i="prev"}i=="prev"?t>a.first?A=qe(Ce(a,t-1).text,null,f):A=0:i=="add"?A=m+e.options.indentUnit:i=="subtract"?A=m-e.options.indentUnit:typeof i=="number"&&(A=m+i),A=Math.max(0,A);var N="",j=0;if(e.options.indentWithTabs)for(var W=Math.floor(A/f);W;--W)j+=f,N+=" ";if(jf,m=lr(t),g=null;if(p&&r.ranges.length>1)if(Bn&&Bn.text.join(` `)==t){if(r.ranges.length%Bn.text.length==0){g=[];for(var A=0;A=0;j--){var W=r.ranges[j],Y=W.from(),re=W.to();W.empty()&&(i&&i>0?Y=ce(Y.line,Y.ch-i):e.state.overwrite&&!p?re=ce(re.line,Math.min(Ce(u,re.line).text.length,re.ch+Ae(m).length)):p&&Bn&&Bn.lineWise&&Bn.text.join(` `)==m.join(` `)&&(Y=re=ce(Y.line,0)));var me={from:Y,to:re,text:g?g[j%g.length]:m,origin:a||(p?"paste":e.state.cutIncoming>f?"cut":"+input")};Ii(e.doc,me),Nt(e,"inputRead",e,me)}t&&!p&&Dc(e,t),xi(e),e.curOp.updateInput<2&&(e.curOp.updateInput=N),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Oc(e,t){var i=e.clipboardData&&e.clipboardData.getData("Text");if(i)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&gn(t,function(){return Na(t,i,0,null,"paste")}),!0}function Dc(e,t){if(!(!e.options.electricChars||!e.options.smartIndent))for(var i=e.doc.sel,r=i.ranges.length-1;r>=0;r--){var a=i.ranges[r];if(!(a.head.ch>100||r&&i.ranges[r-1].head.line==a.head.line)){var u=e.getModeAt(a.head),f=!1;if(u.electricChars){for(var p=0;p-1){f=gs(e,a.head.line,"smart");break}}else u.electricInput&&u.electricInput.test(Ce(e.doc,a.head.line).text.slice(0,a.head.ch))&&(f=gs(e,a.head.line,"smart"));f&&Nt(e,"electricInput",e,a.head.line)}}}function Mc(e){for(var t=[],i=[],r=0;ru&&(gs(this,p.head.line,r,!0),u=p.head.line,f==this.doc.sel.primIndex&&xi(this));else{var m=p.from(),g=p.to(),A=Math.max(u,m.line);u=Math.min(this.lastLine(),g.line-(g.ch?0:1))+1;for(var N=A;N0&&_a(this.doc,f,new it(m,j[f].to()),fe)}}}),getTokenAt:function(r,a){return Gl(this,r,a)},getLineTokens:function(r,a){return Gl(this,ce(r),a,!0)},getTokenTypeAt:function(r){r=Se(this.doc,r);var a=ql(this,Ce(this.doc,r.line)),u=0,f=(a.length-1)/2,p=r.ch,m;if(p==0)m=a[2];else for(;;){var g=u+f>>1;if((g?a[g*2-1]:0)>=p)f=g;else if(a[g*2+1]m&&(r=m,f=!0),p=Ce(this.doc,r)}else p=r;return Us(this,p,{top:0,left:0},a||"page",u||f).top+(f?this.doc.height-pr(p):0)},defaultTextHeight:function(){return yi(this.display)},defaultCharWidth:function(){return bi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,a,u,f,p){var m=this.display;r=Rn(this,Se(this.doc,r));var g=r.bottom,A=r.left;if(a.style.position="absolute",a.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(a),m.sizer.appendChild(a),f=="over")g=r.top;else if(f=="above"||f=="near"){var N=Math.max(m.wrapper.clientHeight,this.doc.height),j=Math.max(m.sizer.clientWidth,m.lineSpace.clientWidth);(f=="above"||r.bottom+a.offsetHeight>N)&&r.top>a.offsetHeight?g=r.top-a.offsetHeight:r.bottom+a.offsetHeight<=N&&(g=r.bottom),A+a.offsetWidth>j&&(A=j-a.offsetWidth)}a.style.top=g+"px",a.style.left=a.style.right="",p=="right"?(A=m.sizer.clientWidth-a.offsetWidth,a.style.right="0px"):(p=="left"?A=0:p=="middle"&&(A=(m.sizer.clientWidth-a.offsetWidth)/2),a.style.left=A+"px"),u&&qh(this,{left:A,top:g,right:A+a.offsetWidth,bottom:g+a.offsetHeight})},triggerOnKeyDown:en(Sc),triggerOnKeyPress:en(Ic),triggerOnKeyUp:Tc,triggerOnMouseDown:en(Cc),execCommand:function(r){if(hs.hasOwnProperty(r))return hs[r].call(null,this)},triggerElectric:en(function(r){Dc(this,r)}),findPosH:function(r,a,u,f){var p=1;a<0&&(p=-1,a=-a);for(var m=Se(this.doc,r),g=0;g0&&A(u.charAt(f-1));)--f;for(;p.5||this.options.lineWrapping)&&oa(this),Me(this,"refresh",this)}),swapDoc:en(function(r){var a=this.doc;return a.cm=null,this.state.selectingText&&this.state.selectingText(),Uu(this,r),Vi(this),this.display.input.reset(),Ji(this,r.scrollLeft,r.scrollTop),this.curOp.forceScroll=!0,Nt(this,"swapDoc",this,a),a}),phrase:function(r){var a=this.options.phrases;return a&&Object.prototype.hasOwnProperty.call(a,r)?a[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}},dn(e),e.registerHelper=function(r,a,u){i.hasOwnProperty(r)||(i[r]=e[r]={_global:[]}),i[r][a]=u},e.registerGlobalHelper=function(r,a,u,f){e.registerHelper(r,a,f),i[r]._global.push({pred:u,val:f})}}function Pa(e,t,i,r,a){var u=t,f=i,p=Ce(e,t.line),m=a&&e.direction=="rtl"?-i:i;function g(){var _e=t.line+m;return _e=e.first+e.size?!1:(t=new ce(_e,t.ch,t.sticky),p=Ce(e,_e))}function A(_e){var we;if(r=="codepoint"){var Ie=p.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN(Ie))we=null;else{var Pe=i>0?Ie>=55296&&Ie<56320:Ie>=56320&&Ie<57343;we=new ce(t.line,Math.max(0,Math.min(p.text.length,t.ch+i*(Pe?2:1))),-i)}}else a?we=Cp(e.cm,p,t,i):we=Ta(p,t,i);if(we==null)if(!_e&&g())t=Ia(a,e.cm,p,t.line,m);else return!1;else t=we;return!0}if(r=="char"||r=="codepoint")A();else if(r=="column")A(!0);else if(r=="word"||r=="group")for(var N=null,j=r=="group",W=e.cm&&e.cm.getHelper(t,"wordChars"),Y=!0;!(i<0&&!A(!Y));Y=!1){var re=p.text.charAt(t.ch)||` `,me=U(re,W)?"w":j&&re==` `?"n":!j||/\s/.test(re)?null:"p";if(j&&!Y&&!me&&(me="s"),N&&N!=me){i<0&&(i=1,A(),t.sticky="after");break}if(me&&(N=me),i>0&&!A(!Y))break}var be=ro(e,t,u,f,!0);return P(u,be)&&(be.hitSide=!0),be}function Bc(e,t,i,r){var a=e.doc,u=t.left,f;if(r=="page"){var p=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),m=Math.max(p-.5*yi(e.display),3);f=(i>0?t.bottom:t.top)+i*m}else r=="line"&&(f=i>0?t.bottom+3:t.top-3);for(var g;g=na(e,u,f),!!g.outside;){if(i<0?f<=0:f>=a.height){g.hitSide=!0;break}f+=i*5}return g}var at=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new X,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};at.prototype.init=function(e){var t=this,i=this,r=i.cm,a=i.div=e.lineDiv;a.contentEditable=!0,Rc(a,r.options.spellcheck,r.options.autocorrect,r.options.autocapitalize);function u(p){for(var m=p.target;m;m=m.parentNode){if(m==a)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(m.className))break}return!1}Ee(a,"paste",function(p){!u(p)||pt(r,p)||Oc(p,r)||x<=11&&setTimeout(Pt(r,function(){return t.updateFromDOM()}),20)}),Ee(a,"compositionstart",function(p){t.composing={data:p.data,done:!1}}),Ee(a,"compositionupdate",function(p){t.composing||(t.composing={data:p.data,done:!1})}),Ee(a,"compositionend",function(p){t.composing&&(p.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ee(a,"touchstart",function(){return i.forceCompositionEnd()}),Ee(a,"input",function(){t.composing||t.readFromDOMSoon()});function f(p){if(!(!u(p)||pt(r,p))){if(r.somethingSelected())uo({lineWise:!1,text:r.getSelections()}),p.type=="cut"&&r.replaceSelection("",null,"cut");else if(r.options.lineWiseCopyCut){var m=Mc(r);uo({lineWise:!0,text:m.text}),p.type=="cut"&&r.operation(function(){r.setSelections(m.ranges,0,fe),r.replaceSelection("",null,"cut")})}else return;if(p.clipboardData){p.clipboardData.clearData();var g=Bn.text.join(` `);if(p.clipboardData.setData("Text",g),p.clipboardData.getData("Text")==g){p.preventDefault();return}}var A=Fc(),N=A.firstChild;r.display.lineSpace.insertBefore(A,r.display.lineSpace.firstChild),N.value=Bn.text.join(` `);var j=le();Fe(N),setTimeout(function(){r.display.lineSpace.removeChild(A),j.focus(),j==a&&i.showPrimarySelection()},50)}}Ee(a,"copy",f),Ee(a,"cut",f)},at.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},at.prototype.prepareSelection=function(){var e=Cu(this.cm,!1);return e.focus=le()==this.div,e},at.prototype.showSelection=function(e,t){!e||!this.cm.display.view.length||((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},at.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},at.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,i=t.doc.sel.primary(),r=i.from(),a=i.to();if(t.display.viewTo==t.display.viewFrom||r.line>=t.display.viewTo||a.line=t.display.viewFrom&&Wc(t,r)||{node:p[0].measure.map[2],offset:0},g=a.linee.firstLine()&&(r=ce(r.line-1,Ce(e.doc,r.line-1).length)),a.ch==Ce(e.doc,a.line).text.length&&a.linet.viewTo-1)return!1;var u,f,p;r.line==t.viewFrom||(u=ei(e,r.line))==0?(f=rt(t.view[0].line),p=t.view[0].node):(f=rt(t.view[u].line),p=t.view[u-1].node.nextSibling);var m=ei(e,a.line),g,A;if(m==t.view.length-1?(g=t.viewTo-1,A=t.lineDiv.lastChild):(g=rt(t.view[m+1].line)-1,A=t.view[m+1].node.previousSibling),!p)return!1;for(var N=e.doc.splitLines(Xp(e,p,A,f,g)),j=En(e.doc,ce(f,0),ce(g,Ce(e.doc,g).text.length));N.length>1&&j.length>1;)if(Ae(N)==Ae(j))N.pop(),j.pop(),g--;else if(N[0]==j[0])N.shift(),j.shift(),f++;else break;for(var W=0,Y=0,re=N[0],me=j[0],be=Math.min(re.length,me.length);Wr.ch&&_e.charCodeAt(_e.length-Y-1)==we.charCodeAt(we.length-Y-1);)W--,Y++;N[N.length-1]=_e.slice(0,_e.length-Y).replace(/^\u200b+/,""),N[0]=N[0].slice(W).replace(/\u200b+$/,"");var Pe=ce(f,W),Le=ce(g,j.length?Ae(j).length-Y:0);if(N.length>1||N[0]||v(Pe,Le))return Ci(e.doc,N,Pe,Le,"+input"),!0},at.prototype.ensurePolled=function(){this.forceCompositionEnd()},at.prototype.reset=function(){this.forceCompositionEnd()},at.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},at.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))},at.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&gn(this.cm,function(){return an(e.cm)})},at.prototype.setUneditable=function(e){e.contentEditable="false"},at.prototype.onKeyPress=function(e){e.charCode==0||this.composing||(e.preventDefault(),this.cm.isReadOnly()||Pt(this.cm,Na)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0))},at.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},at.prototype.onContextMenu=function(){},at.prototype.resetPosition=function(){},at.prototype.needsContentAttribute=!0;function Wc(e,t){var i=Qo(e,t.line);if(!i||i.hidden)return null;var r=Ce(e.doc,t.line),a=pu(i,r,t.line),u=Bt(r,e.doc.direction),f="left";if(u){var p=ft(u,t.ch);f=p%2?"right":"left"}var m=gu(a.map,t.ch,f);return m.offset=m.collapse=="right"?m.end:m.start,m}function Kp(e){for(var t=e;t;t=t.parentNode)if(/CodeMirror-gutter-wrapper/.test(t.className))return!0;return!1}function Pi(e,t){return t&&(e.bad=!0),e}function Xp(e,t,i,r,a){var u="",f=!1,p=e.doc.lineSeparator(),m=!1;function g(W){return function(Y){return Y.id==W}}function A(){f&&(u+=p,m&&(u+=p),f=m=!1)}function N(W){W&&(A(),u+=W)}function j(W){if(W.nodeType==1){var Y=W.getAttribute("cm-text");if(Y){N(Y);return}var re=W.getAttribute("cm-marker"),me;if(re){var be=e.findMarks(ce(r,0),ce(a+1,0),g(+re));be.length&&(me=be[0].find(0))&&N(En(e.doc,me.from,me.to).join(p));return}if(W.getAttribute("contenteditable")=="false")return;var _e=/^(pre|div|p|li|table|br)$/i.test(W.nodeName);if(!/^br$/i.test(W.nodeName)&&W.textContent.length==0)return;_e&&A();for(var we=0;we=9&&t.hasSelection&&(t.hasSelection=null),i.poll()}),Ee(a,"paste",function(f){pt(r,f)||Oc(f,r)||(r.state.pasteIncoming=+new Date,i.fastPoll())});function u(f){if(!pt(r,f)){if(r.somethingSelected())uo({lineWise:!1,text:r.getSelections()});else if(r.options.lineWiseCopyCut){var p=Mc(r);uo({lineWise:!0,text:p.text}),f.type=="cut"?r.setSelections(p.ranges,null,fe):(i.prevInput="",a.value=p.text.join(` `),Fe(a))}else return;f.type=="cut"&&(r.state.cutIncoming=+new Date)}}Ee(a,"cut",u),Ee(a,"copy",u),Ee(e.scroller,"paste",function(f){if(!(dr(e,f)||pt(r,f))){if(!a.dispatchEvent){r.state.pasteIncoming=+new Date,i.focus();return}var p=new Event("paste");p.clipboardData=f.clipboardData,a.dispatchEvent(p)}}),Ee(e.lineSpace,"selectstart",function(f){dr(e,f)||_t(f)}),Ee(a,"compositionstart",function(){var f=r.getCursor("from");i.composing&&i.composing.range.clear(),i.composing={start:f,range:r.markText(f,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ee(a,"compositionend",function(){i.composing&&(i.poll(),i.composing.range.clear(),i.composing=null)})},xt.prototype.createField=function(e){this.wrapper=Fc(),this.textarea=this.wrapper.firstChild},xt.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},xt.prototype.prepareSelection=function(){var e=this.cm,t=e.display,i=e.doc,r=Cu(e);if(e.options.moveInputWithCursor){var a=Rn(e,i.sel.primary().head,"div"),u=t.wrapper.getBoundingClientRect(),f=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,a.top+f.top-u.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,a.left+f.left-u.left))}return r},xt.prototype.showSelection=function(e){var t=this.cm,i=t.display;G(i.cursorDiv,e.cursors),G(i.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},xt.prototype.reset=function(e){if(!(this.contextMenuPending||this.composing)){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i,t.state.focused&&Fe(this.textarea),w&&x>=9&&(this.hasSelection=i)}else e||(this.prevInput=this.textarea.value="",w&&x>=9&&(this.hasSelection=null))}},xt.prototype.getField=function(){return this.textarea},xt.prototype.supportsTouch=function(){return!1},xt.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!M||le()!=this.textarea))try{this.textarea.focus()}catch{}},xt.prototype.blur=function(){this.textarea.blur()},xt.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},xt.prototype.receivedFocus=function(){this.slowPoll()},xt.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},xt.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function i(){var r=t.poll();!r&&!e?(e=!0,t.polling.set(60,i)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,i)},xt.prototype.poll=function(){var e=this,t=this.cm,i=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Sr(i)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var a=i.value;if(a==r&&!t.somethingSelected())return!1;if(w&&x>=9&&this.hasSelection===a||B&&/[\uf700-\uf7ff]/.test(a))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var u=a.charCodeAt(0);if(u==8203&&!r&&(r="​"),u==8666)return this.reset(),this.cm.execCommand("undo")}for(var f=0,p=Math.min(r.length,a.length);f1e3||a.indexOf(` `)>-1?i.value=e.prevInput="":e.prevInput=a,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},xt.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},xt.prototype.onKeyPress=function(){w&&x>=9&&(this.hasSelection=null),this.fastPoll()},xt.prototype.onContextMenu=function(e){var t=this,i=t.cm,r=i.display,a=t.textarea;t.contextMenuPending&&t.contextMenuPending();var u=Qr(i,e),f=r.scroller.scrollTop;if(!u||_)return;var p=i.options.resetSelectionOnContextMenu;p&&i.doc.sel.contains(u)==-1&&Pt(i,Vt)(i.doc,Er(u),fe);var m=a.style.cssText,g=t.wrapper.style.cssText,A=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",a.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-A.top-5)+"px; left: "+(e.clientX-A.left-5)+`px; z-index: 1000; background: `+(w?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var N;y&&(N=window.scrollY),r.input.focus(),y&&window.scrollTo(null,N),r.input.reset(),i.somethingSelected()||(a.value=t.prevInput=" "),t.contextMenuPending=W,r.selForContextMenu=i.doc.sel,clearTimeout(r.detectingSelectAll);function j(){if(a.selectionStart!=null){var re=i.somethingSelected(),me="​"+(re?a.value:"");a.value="⇚",a.value=me,t.prevInput=re?"":"​",a.selectionStart=1,a.selectionEnd=me.length,r.selForContextMenu=i.doc.sel}}function W(){if(t.contextMenuPending==W&&(t.contextMenuPending=!1,t.wrapper.style.cssText=g,a.style.cssText=m,w&&x<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=f),a.selectionStart!=null)){(!w||w&&x<9)&&j();var re=0,me=function(){r.selForContextMenu==i.doc.sel&&a.selectionStart==0&&a.selectionEnd>0&&t.prevInput=="​"?Pt(i,rc)(i):re++<10?r.detectingSelectAll=setTimeout(me,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(me,200)}}if(w&&x>=9&&j(),ye){Dn(e);var Y=function(){Lt(window,"mouseup",Y),setTimeout(W,20)};Ee(window,"mouseup",Y)}else setTimeout(W,50)},xt.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},xt.prototype.setUneditable=function(){},xt.prototype.needsContentAttribute=!1;function Yp(e,t){if(t=t?ze(t):{},t.value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),t.autofocus==null){var i=le();t.autofocus=i==e||e.getAttribute("autofocus")!=null&&i==document.body}function r(){e.value=p.getValue()}var a;if(e.form&&(Ee(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var u=e.form;a=u.submit;try{var f=u.submit=function(){r(),u.submit=a,u.submit(),u.submit=f}}catch{}}t.finishInit=function(m){m.save=r,m.getTextArea=function(){return e},m.toTextArea=function(){m.toTextArea=isNaN,r(),e.parentNode.removeChild(m.getWrapperElement()),e.style.display="",e.form&&(Lt(e.form,"submit",r),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=a))}},e.style.display="none";var p=mt(function(m){return e.parentNode.insertBefore(m,e.nextSibling)},t);return p}function Jp(e){e.off=Lt,e.on=Ee,e.wheelEventPixels=ip,e.Doc=ln,e.splitLines=lr,e.countColumn=qe,e.findColumn=De,e.isWordChar=nt,e.Pass=ee,e.signal=Me,e.Line=gi,e.changeEnd=Nr,e.scrollbarModel=Ou,e.Pos=ce,e.cmpPos=v,e.modes=Zt,e.mimeModes=Gt,e.resolveMode=Xn,e.getMode=Vn,e.modeExtensions=sn,e.extendMode=on,e.copyState=Kt,e.startState=Xr,e.innerMode=cr,e.commands=hs,e.keyMap=gr,e.keyName=yc,e.isModifierKey=vc,e.lookupKey=Li,e.normalizeKeyMap=Ip,e.StringStream=dt,e.SharedTextMarker=us,e.TextMarker=Or,e.LineWidget=ls,e.e_preventDefault=_t,e.e_stopPropagation=Kn,e.e_stop=Dn,e.addClass=Oe,e.contains=J,e.rmClass=ke,e.keyNames=Dr}zp(mt),Gp(mt);var Zp="iter insert remove copy getEditor constructor".split(" ");for(var fo in ln.prototype)ln.prototype.hasOwnProperty(fo)&&z(Zp,fo)<0&&(mt.prototype[fo]=function(e){return function(){return e.apply(this.doc,arguments)}}(ln.prototype[fo]));return dn(ln),mt.inputStyles={textarea:xt,contenteditable:at},mt.defineMode=function(e){!mt.defaults.mode&&e!="null"&&(mt.defaults.mode=e),Ir.apply(this,arguments)},mt.defineMIME=_n,mt.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),mt.defineMIME("text/plain","null"),mt.defineExtension=function(e,t){mt.prototype[e]=t},mt.defineDocExtension=function(e,t){ln.prototype[e]=t},mt.fromTextArea=Yp,Jp(mt),mt.version="5.65.3",mt})}(Ba)),Ba.exports}var Yd=wn(),Jc={exports:{}},Zc;function z1(){return Zc||(Zc=1,function(n,o){(function(l){l(wn())})(function(l){l.defineMode("javascript",function(c,h){var k=c.indentUnit,I=h.statementIndent,S=h.jsonld,w=h.json||S,x=h.trackScope!==!1,y=h.typescript,E=h.wordCharacters||/[\w$\xa1-\uffff]/,L=function(){function v(Xt){return{type:Xt,style:"keyword"}}var P=v("keyword a"),ne=v("keyword b"),de=v("keyword c"),Be=v("keyword d"),Qe=v("operator"),Se={type:"atom",style:"atom"};return{if:v("if"),while:P,with:P,else:ne,do:ne,try:ne,finally:ne,return:Be,break:Be,continue:Be,new:v("new"),delete:de,void:de,throw:de,debugger:v("debugger"),var:v("var"),const:v("var"),let:v("var"),function:v("function"),catch:v("catch"),for:v("for"),switch:v("switch"),case:v("case"),default:v("default"),in:Qe,typeof:Qe,instanceof:Qe,true:Se,false:Se,null:Se,undefined:Se,NaN:Se,Infinity:Se,this:v("this"),class:v("class"),super:v("atom"),yield:de,export:v("export"),import:v("import"),extends:de,await:de}}(),_=/[+\-*&%=<>!?|~^@]/,F=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function D(v){for(var P=!1,ne,de=!1;(ne=v.next())!=null;){if(!P){if(ne=="/"&&!de)return;ne=="["?de=!0:de&&ne=="]"&&(de=!1)}P=!P&&ne=="\\"}}var H,O;function T(v,P,ne){return H=v,O=ne,P}function M(v,P){var ne=v.next();if(ne=='"'||ne=="'")return P.tokenize=B(ne),P.tokenize(v,P);if(ne=="."&&v.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return T("number","number");if(ne=="."&&v.match(".."))return T("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(ne))return T(ne);if(ne=="="&&v.eat(">"))return T("=>","operator");if(ne=="0"&&v.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return T("number","number");if(/\d/.test(ne))return v.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),T("number","number");if(ne=="/")return v.eat("*")?(P.tokenize=$,$(v,P)):v.eat("/")?(v.skipToEnd(),T("comment","comment")):ce(v,P,1)?(D(v),v.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),T("regexp","string-2")):(v.eat("="),T("operator","operator",v.current()));if(ne=="`")return P.tokenize=ae,ae(v,P);if(ne=="#"&&v.peek()=="!")return v.skipToEnd(),T("meta","meta");if(ne=="#"&&v.eatWhile(E))return T("variable","property");if(ne=="<"&&v.match("!--")||ne=="-"&&v.match("->")&&!/\S/.test(v.string.slice(0,v.start)))return v.skipToEnd(),T("comment","comment");if(_.test(ne))return(ne!=">"||!P.lexical||P.lexical.type!=">")&&(v.eat("=")?(ne=="!"||ne=="=")&&v.eat("="):/[<>*+\-|&?]/.test(ne)&&(v.eat(ne),ne==">"&&v.eat(ne))),ne=="?"&&v.eat(".")?T("."):T("operator","operator",v.current());if(E.test(ne)){v.eatWhile(E);var de=v.current();if(P.lastType!="."){if(L.propertyIsEnumerable(de)){var Be=L[de];return T(Be.type,Be.style,de)}if(de=="async"&&v.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return T("async","keyword",de)}return T("variable","variable",de)}}function B(v){return function(P,ne){var de=!1,Be;if(S&&P.peek()=="@"&&P.match(F))return ne.tokenize=M,T("jsonld-keyword","meta");for(;(Be=P.next())!=null&&!(Be==v&&!de);)de=!de&&Be=="\\";return de||(ne.tokenize=M),T("string","string")}}function $(v,P){for(var ne=!1,de;de=v.next();){if(de=="/"&&ne){P.tokenize=M;break}ne=de=="*"}return T("comment","comment")}function ae(v,P){for(var ne=!1,de;(de=v.next())!=null;){if(!ne&&(de=="`"||de=="$"&&v.eat("{"))){P.tokenize=M;break}ne=!ne&&de=="\\"}return T("quasi","string-2",v.current())}var ue="([{}])";function te(v,P){P.fatArrowAt&&(P.fatArrowAt=null);var ne=v.string.indexOf("=>",v.start);if(!(ne<0)){if(y){var de=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(v.string.slice(v.start,ne));de&&(ne=de.index)}for(var Be=0,Qe=!1,Se=ne-1;Se>=0;--Se){var Xt=v.string.charAt(Se),Sn=ue.indexOf(Xt);if(Sn>=0&&Sn<3){if(!Be){++Se;break}if(--Be==0){Xt=="("&&(Qe=!0);break}}else if(Sn>=3&&Sn<6)++Be;else if(E.test(Xt))Qe=!0;else if(/["'\/`]/.test(Xt))for(;;--Se){if(Se==0)return;var mi=v.string.charAt(Se-1);if(mi==Xt&&v.string.charAt(Se-2)!="\\"){Se--;break}}else if(Qe&&!Be){++Se;break}}Qe&&!Be&&(P.fatArrowAt=Se)}}var ye={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function ge(v,P,ne,de,Be,Qe){this.indented=v,this.column=P,this.type=ne,this.prev=Be,this.info=Qe,de!=null&&(this.align=de)}function ke(v,P){if(!x)return!1;for(var ne=v.localVars;ne;ne=ne.next)if(ne.name==P)return!0;for(var de=v.context;de;de=de.prev)for(var ne=de.vars;ne;ne=ne.next)if(ne.name==P)return!0}function Te(v,P,ne,de,Be){var Qe=v.cc;for(G.state=v,G.stream=Be,G.marked=null,G.cc=Qe,G.style=P,v.lexical.hasOwnProperty("align")||(v.lexical.align=!0);;){var Se=Qe.length?Qe.pop():w?pe:fe;if(Se(ne,de)){for(;Qe.length&&Qe[Qe.length-1].lex;)Qe.pop()();return G.marked?G.marked:ne=="variable"&&ke(v,de)?"variable-2":P}}}var G={state:null,column:null,marked:null,cc:null};function K(){for(var v=arguments.length-1;v>=0;v--)G.cc.push(arguments[v])}function b(){return K.apply(null,arguments),!0}function se(v,P){for(var ne=P;ne;ne=ne.next)if(ne.name==v)return!0;return!1}function J(v){var P=G.state;if(G.marked="def",!!x){if(P.context){if(P.lexical.info=="var"&&P.context&&P.context.block){var ne=le(v,P.context);if(ne!=null){P.context=ne;return}}else if(!se(v,P.localVars)){P.localVars=new Fe(v,P.localVars);return}}h.globalVars&&!se(v,P.globalVars)&&(P.globalVars=new Fe(v,P.globalVars))}}function le(v,P){if(P)if(P.block){var ne=le(v,P.prev);return ne?ne==P.prev?P:new Ne(ne,P.vars,!0):null}else return se(v,P.vars)?P:new Ne(P.prev,new Fe(v,P.vars),!1);else return null}function Oe(v){return v=="public"||v=="private"||v=="protected"||v=="abstract"||v=="readonly"}function Ne(v,P,ne){this.prev=v,this.vars=P,this.block=ne}function Fe(v,P){this.name=v,this.next=P}var tt=new Fe("this",new Fe("arguments",null));function ze(){G.state.context=new Ne(G.state.context,G.state.localVars,!1),G.state.localVars=tt}function qe(){G.state.context=new Ne(G.state.context,G.state.localVars,!0),G.state.localVars=null}ze.lex=qe.lex=!0;function X(){G.state.localVars=G.state.context.vars,G.state.context=G.state.context.prev}X.lex=!0;function z(v,P){var ne=function(){var de=G.state,Be=de.indented;if(de.lexical.type=="stat")Be=de.lexical.indented;else for(var Qe=de.lexical;Qe&&Qe.type==")"&&Qe.align;Qe=Qe.prev)Be=Qe.indented;de.lexical=new ge(Be,G.stream.column(),v,null,de.lexical,P)};return ne.lex=!0,ne}function V(){var v=G.state;v.lexical.prev&&(v.lexical.type==")"&&(v.indented=v.lexical.indented),v.lexical=v.lexical.prev)}V.lex=!0;function ee(v){function P(ne){return ne==v?b():v==";"||ne=="}"||ne==")"||ne=="]"?K():b(P)}return P}function fe(v,P){return v=="var"?b(z("vardef",P),or,ee(";"),V):v=="keyword a"?b(z("form"),Ze,fe,V):v=="keyword b"?b(z("form"),fe,V):v=="keyword d"?G.stream.match(/^\s*$/,!1)?b():b(z("stat"),Ae,ee(";"),V):v=="debugger"?b(ee(";")):v=="{"?b(z("}"),qe,Bt,V,X):v==";"?b():v=="if"?(G.state.lexical.info=="else"&&G.state.cc[G.state.cc.length-1]==V&&G.state.cc.pop()(),b(z("form"),Ze,fe,V,Sr)):v=="function"?b(Zt):v=="for"?b(z("form"),qe,Tr,fe,X,V):v=="class"||y&&P=="interface"?(G.marked="keyword",b(z("form",v=="class"?v:P),Vn,V)):v=="variable"?y&&P=="declare"?(G.marked="keyword",b(fe)):y&&(P=="module"||P=="enum"||P=="type")&&G.stream.match(/^\s*\w/,!1)?(G.marked="keyword",P=="enum"?b(Nn):P=="type"?b(Ir,ee("operator"),Me,ee(";")):b(z("form"),Et,ee("{"),z("}"),Bt,V,V)):y&&P=="namespace"?(G.marked="keyword",b(z("form"),pe,fe,V)):y&&P=="abstract"?(G.marked="keyword",b(fe)):b(z("stat"),Xe):v=="switch"?b(z("form"),Ze,ee("{"),z("}","switch"),qe,Bt,V,V,X):v=="case"?b(pe,ee(":")):v=="default"?b(ee(":")):v=="catch"?b(z("form"),ze,ve,fe,V,X):v=="export"?b(z("stat"),cr,V):v=="import"?b(z("stat"),dt,V):v=="async"?b(fe):P=="@"?b(pe,fe):K(z("stat"),pe,ee(";"),V)}function ve(v){if(v=="(")return b(_n,ee(")"))}function pe(v,P){return Je(v,P,!1)}function De(v,P){return Je(v,P,!0)}function Ze(v){return v!="("?K():b(z(")"),Ae,ee(")"),V)}function Je(v,P,ne){if(G.state.fatArrowAt==G.stream.start){var de=ne?nt:rn;if(v=="(")return b(ze,z(")"),ft(_n,")"),V,ee("=>"),de,X);if(v=="variable")return K(ze,Et,ee("=>"),de,X)}var Be=ne?Ke:He;return ye.hasOwnProperty(v)?b(Be):v=="function"?b(Zt,Be):v=="class"||y&&P=="interface"?(G.marked="keyword",b(z("form"),Xn,V)):v=="keyword c"||v=="async"?b(ne?De:pe):v=="("?b(z(")"),Ae,ee(")"),V,Be):v=="operator"||v=="spread"?b(ne?De:pe):v=="["?b(z("]"),rt,V,Be):v=="{"?On(pn,"}",null,Be):v=="quasi"?K(ot,Be):v=="new"?b(U(ne)):b()}function Ae(v){return v.match(/[;\}\)\],]/)?K():K(pe)}function He(v,P){return v==","?b(Ae):Ke(v,P,!1)}function Ke(v,P,ne){var de=ne==!1?He:Ke,Be=ne==!1?pe:De;if(v=="=>")return b(ze,ne?nt:rn,X);if(v=="operator")return/\+\+|--/.test(P)||y&&P=="!"?b(de):y&&P=="<"&&G.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?b(z(">"),ft(Me,">"),V,de):P=="?"?b(pe,ee(":"),Be):b(Be);if(v=="quasi")return K(ot,de);if(v!=";"){if(v=="(")return On(De,")","call",de);if(v==".")return b(It,de);if(v=="[")return b(z("]"),Ae,ee("]"),V,de);if(y&&P=="as")return G.marked="keyword",b(Me,de);if(v=="regexp")return G.state.lastType=G.marked="operator",G.stream.backUp(G.stream.pos-G.stream.start-1),b(Be)}}function ot(v,P){return v!="quasi"?K():P.slice(P.length-2)!="${"?b(ot):b(Ae,lt)}function lt(v){if(v=="}")return G.marked="string-2",G.state.tokenize=ae,b(ot)}function rn(v){return te(G.stream,G.state),K(v=="{"?fe:pe)}function nt(v){return te(G.stream,G.state),K(v=="{"?fe:De)}function U(v){return function(P){return P=="."?b(v?Q:he):P=="variable"&&y?b(Dn,v?Ke:He):K(v?De:pe)}}function he(v,P){if(P=="target")return G.marked="keyword",b(He)}function Q(v,P){if(P=="target")return G.marked="keyword",b(Ke)}function Xe(v){return v==":"?b(V,fe):K(He,ee(";"),V)}function It(v){if(v=="variable")return G.marked="property",b()}function pn(v,P){if(v=="async")return G.marked="property",b(pn);if(v=="variable"||G.style=="keyword"){if(G.marked="property",P=="get"||P=="set")return b(Kr);var ne;return y&&G.state.fatArrowAt==G.stream.start&&(ne=G.stream.match(/^\s*:\s*/,!1))&&(G.state.fatArrowAt=G.stream.pos+ne[0].length),b(Ut)}else{if(v=="number"||v=="string")return G.marked=S?"property":G.style+" property",b(Ut);if(v=="jsonld-keyword")return b(Ut);if(y&&Oe(P))return G.marked="keyword",b(pn);if(v=="[")return b(pe,xn,ee("]"),Ut);if(v=="spread")return b(De,Ut);if(P=="*")return G.marked="keyword",b(pn);if(v==":")return K(Ut)}}function Kr(v){return v!="variable"?K(Ut):(G.marked="property",b(Zt))}function Ut(v){if(v==":")return b(De);if(v=="(")return K(Zt)}function ft(v,P,ne){function de(Be,Qe){if(ne?ne.indexOf(Be)>-1:Be==","){var Se=G.state.lexical;return Se.info=="call"&&(Se.pos=(Se.pos||0)+1),b(function(Xt,Sn){return Xt==P||Sn==P?K():K(v)},de)}return Be==P||Qe==P?b():ne&&ne.indexOf(";")>-1?K(v):b(ee(P))}return function(Be,Qe){return Be==P||Qe==P?b():K(v,de)}}function On(v,P,ne){for(var de=3;de"),Me);if(v=="quasi")return K(dn,$t)}function pt(v){if(v=="=>")return b(Me)}function Gn(v){return v.match(/[\}\)\]]/)?b():v==","||v==";"?b(Gn):K(wt,Gn)}function wt(v,P){if(v=="variable"||G.style=="keyword")return G.marked="property",b(wt);if(P=="?"||v=="number"||v=="string")return b(wt);if(v==":")return b(Me);if(v=="[")return b(ee("variable"),Ee,ee("]"),wt);if(v=="(")return K(Gt,wt);if(!v.match(/[;\}\)\],]/))return b()}function dn(v,P){return v!="quasi"?K():P.slice(P.length-2)!="${"?b(dn):b(Me,_t)}function _t(v){if(v=="}")return G.marked="string-2",G.state.tokenize=ae,b(dn)}function Kn(v,P){return v=="variable"&&G.stream.match(/^\s*[?:]/,!1)||P=="?"?b(Kn):v==":"?b(Me):v=="spread"?b(Kn):K(Me)}function $t(v,P){if(P=="<")return b(z(">"),ft(Me,">"),V,$t);if(P=="|"||v=="."||P=="&")return b(Me);if(v=="[")return b(Me,ee("]"),$t);if(P=="extends"||P=="implements")return G.marked="keyword",b(Me);if(P=="?")return b(Me,ee(":"),Me)}function Dn(v,P){if(P=="<")return b(z(">"),ft(Me,">"),V,$t)}function An(){return K(Me,xr)}function xr(v,P){if(P=="=")return b(Me)}function or(v,P){return P=="enum"?(G.marked="keyword",b(Nn)):K(Et,xn,mn,lr)}function Et(v,P){if(y&&Oe(P))return G.marked="keyword",b(Et);if(v=="variable")return J(P),b();if(v=="spread")return b(Et);if(v=="[")return On(ar,"]");if(v=="{")return On(_r,"}")}function _r(v,P){return v=="variable"&&!G.stream.match(/^\s*:/,!1)?(J(P),b(mn)):(v=="variable"&&(G.marked="property"),v=="spread"?b(Et):v=="}"?K():v=="["?b(pe,ee("]"),ee(":"),_r):b(ee(":"),Et,mn))}function ar(){return K(Et,mn)}function mn(v,P){if(P=="=")return b(De)}function lr(v){if(v==",")return b(or)}function Sr(v,P){if(v=="keyword b"&&P=="else")return b(z("form","else"),fe,V)}function Tr(v,P){if(P=="await")return b(Tr);if(v=="(")return b(z(")"),ur,V)}function ur(v){return v=="var"?b(or,Ln):v=="variable"?b(Ln):K(Ln)}function Ln(v,P){return v==")"?b():v==";"?b(Ln):P=="in"||P=="of"?(G.marked="keyword",b(pe,Ln)):K(pe,Ln)}function Zt(v,P){if(P=="*")return G.marked="keyword",b(Zt);if(v=="variable")return J(P),b(Zt);if(v=="(")return b(ze,z(")"),ft(_n,")"),V,$n,fe,X);if(y&&P=="<")return b(z(">"),ft(An,">"),V,Zt)}function Gt(v,P){if(P=="*")return G.marked="keyword",b(Gt);if(v=="variable")return J(P),b(Gt);if(v=="(")return b(ze,z(")"),ft(_n,")"),V,$n,X);if(y&&P=="<")return b(z(">"),ft(An,">"),V,Gt)}function Ir(v,P){if(v=="keyword"||v=="variable")return G.marked="type",b(Ir);if(P=="<")return b(z(">"),ft(An,">"),V)}function _n(v,P){return P=="@"&&b(pe,_n),v=="spread"?b(_n):y&&Oe(P)?(G.marked="keyword",b(_n)):y&&v=="this"?b(xn,mn):K(Et,xn,mn)}function Xn(v,P){return v=="variable"?Vn(v,P):sn(v,P)}function Vn(v,P){if(v=="variable")return J(P),b(sn)}function sn(v,P){if(P=="<")return b(z(">"),ft(An,">"),V,sn);if(P=="extends"||P=="implements"||y&&v==",")return P=="implements"&&(G.marked="keyword"),b(y?Me:pe,sn);if(v=="{")return b(z("}"),on,V)}function on(v,P){if(v=="async"||v=="variable"&&(P=="static"||P=="get"||P=="set"||y&&Oe(P))&&G.stream.match(/^\s+[\w$\xa1-\uffff]/,!1))return G.marked="keyword",b(on);if(v=="variable"||G.style=="keyword")return G.marked="property",b(Kt,on);if(v=="number"||v=="string")return b(Kt,on);if(v=="[")return b(pe,xn,ee("]"),Kt,on);if(P=="*")return G.marked="keyword",b(on);if(y&&v=="(")return K(Gt,on);if(v==";"||v==",")return b(on);if(v=="}")return b();if(P=="@")return b(pe,on)}function Kt(v,P){if(P=="!"||P=="?")return b(Kt);if(v==":")return b(Me,mn);if(P=="=")return b(De);var ne=G.state.lexical.prev,de=ne&&ne.info=="interface";return K(de?Gt:Zt)}function cr(v,P){return P=="*"?(G.marked="keyword",b(Qt,ee(";"))):P=="default"?(G.marked="keyword",b(pe,ee(";"))):v=="{"?b(ft(Xr,"}"),Qt,ee(";")):K(fe)}function Xr(v,P){if(P=="as")return G.marked="keyword",b(ee("variable"));if(v=="variable")return K(De,Xr)}function dt(v){return v=="string"?b():v=="("?K(pe):v=="."?K(He):K(Ce,En,Qt)}function Ce(v,P){return v=="{"?On(Ce,"}"):(v=="variable"&&J(P),P=="*"&&(G.marked="keyword"),b(Vr))}function En(v){if(v==",")return b(Ce,En)}function Vr(v,P){if(P=="as")return G.marked="keyword",b(Ce)}function Qt(v,P){if(P=="from")return G.marked="keyword",b(pe)}function rt(v){return v=="]"?b():K(ft(De,"]"))}function Nn(){return K(z("form"),Et,ee("{"),z("}"),ft(fr,"}"),V,V)}function fr(){return K(Et,mn)}function Yr(v,P){return v.lastType=="operator"||v.lastType==","||_.test(P.charAt(0))||/[,.]/.test(P.charAt(0))}function ce(v,P,ne){return P.tokenize==M&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(P.lastType)||P.lastType=="quasi"&&/\{\s*$/.test(v.string.slice(0,v.pos-(ne||0)))}return{startState:function(v){var P={tokenize:M,lastType:"sof",cc:[],lexical:new ge((v||0)-k,0,"block",!1),localVars:h.localVars,context:h.localVars&&new Ne(null,null,!1),indented:v||0};return h.globalVars&&typeof h.globalVars=="object"&&(P.globalVars=h.globalVars),P},token:function(v,P){if(v.sol()&&(P.lexical.hasOwnProperty("align")||(P.lexical.align=!1),P.indented=v.indentation(),te(v,P)),P.tokenize!=$&&v.eatSpace())return null;var ne=P.tokenize(v,P);return H=="comment"?ne:(P.lastType=H=="operator"&&(O=="++"||O=="--")?"incdec":H,Te(P,ne,H,O,v))},indent:function(v,P){if(v.tokenize==$||v.tokenize==ae)return l.Pass;if(v.tokenize!=M)return 0;var ne=P&&P.charAt(0),de=v.lexical,Be;if(!/^\s*else\b/.test(P))for(var Qe=v.cc.length-1;Qe>=0;--Qe){var Se=v.cc[Qe];if(Se==V)de=de.prev;else if(Se!=Sr&&Se!=X)break}for(;(de.type=="stat"||de.type=="form")&&(ne=="}"||(Be=v.cc[v.cc.length-1])&&(Be==He||Be==Ke)&&!/^[,\.=+\-*:?[\(]/.test(P));)de=de.prev;I&&de.type==")"&&de.prev.type=="stat"&&(de=de.prev);var Xt=de.type,Sn=ne==Xt;return Xt=="vardef"?de.indented+(v.lastType=="operator"||v.lastType==","?de.info.length+1:0):Xt=="form"&&ne=="{"?de.indented:Xt=="form"?de.indented+k:Xt=="stat"?de.indented+(Yr(v,P)?I||k:0):de.info=="switch"&&!Sn&&h.doubleIndentSwitch!=!1?de.indented+(/^(?:case|default)\b/.test(P)?k:2*k):de.align?de.column+(Sn?0:1):de.indented+(Sn?0:k)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:w?null:"/*",blockCommentEnd:w?null:"*/",blockCommentContinue:w?null:" * ",lineComment:w?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:w?"json":"javascript",jsonldMode:S,jsonMode:w,expressionAllowed:ce,skipExpression:function(v){Te(v,"atom","atom","true",new l.StringStream("",2,null))}}}),l.registerHelper("wordChars","javascript",/[\w$]/),l.defineMIME("text/javascript","javascript"),l.defineMIME("text/ecmascript","javascript"),l.defineMIME("application/javascript","javascript"),l.defineMIME("application/x-javascript","javascript"),l.defineMIME("application/ecmascript","javascript"),l.defineMIME("application/json",{name:"javascript",json:!0}),l.defineMIME("application/x-json",{name:"javascript",json:!0}),l.defineMIME("application/manifest+json",{name:"javascript",json:!0}),l.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),l.defineMIME("text/typescript",{name:"javascript",typescript:!0}),l.defineMIME("application/typescript",{name:"javascript",typescript:!0})})}()),Jc.exports}z1();var Qc={exports:{}},e1;function q1(){return e1||(e1=1,function(n,o){(function(l){l(wn())})(function(l){l.defineMode("css",function(ge,ke){var Te=ke.inline;ke.propertyKeywords||(ke=l.resolveMode("text/css"));var G=ge.indentUnit,K=ke.tokenHooks,b=ke.documentTypes||{},se=ke.mediaTypes||{},J=ke.mediaFeatures||{},le=ke.mediaValueKeywords||{},Oe=ke.propertyKeywords||{},Ne=ke.nonStandardPropertyKeywords||{},Fe=ke.fontProperties||{},tt=ke.counterDescriptors||{},ze=ke.colorKeywords||{},qe=ke.valueKeywords||{},X=ke.allowNested,z=ke.lineComment,V=ke.supportsAtComponent===!0,ee=ge.highlightNonStandardPropertyKeywords!==!1,fe,ve;function pe(U,he){return fe=he,U}function De(U,he){var Q=U.next();if(K[Q]){var Xe=K[Q](U,he);if(Xe!==!1)return Xe}if(Q=="@")return U.eatWhile(/[\w\\\-]/),pe("def",U.current());if(Q=="="||(Q=="~"||Q=="|")&&U.eat("="))return pe(null,"compare");if(Q=='"'||Q=="'")return he.tokenize=Ze(Q),he.tokenize(U,he);if(Q=="#")return U.eatWhile(/[\w\\\-]/),pe("atom","hash");if(Q=="!")return U.match(/^\s*\w*/),pe("keyword","important");if(/\d/.test(Q)||Q=="."&&U.eat(/\d/))return U.eatWhile(/[\w.%]/),pe("number","unit");if(Q==="-"){if(/[\d.]/.test(U.peek()))return U.eatWhile(/[\w.%]/),pe("number","unit");if(U.match(/^-[\w\\\-]*/))return U.eatWhile(/[\w\\\-]/),U.match(/^\s*:/,!1)?pe("variable-2","variable-definition"):pe("variable-2","variable");if(U.match(/^\w+-/))return pe("meta","meta")}else return/[,+>*\/]/.test(Q)?pe(null,"select-op"):Q=="."&&U.match(/^-?[_a-z][_a-z0-9-]*/i)?pe("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(Q)?pe(null,Q):U.match(/^[\w-.]+(?=\()/)?(/^(url(-prefix)?|domain|regexp)$/i.test(U.current())&&(he.tokenize=Je),pe("variable callee","variable")):/[\w\\\-]/.test(Q)?(U.eatWhile(/[\w\\\-]/),pe("property","word")):pe(null,null)}function Ze(U){return function(he,Q){for(var Xe=!1,It;(It=he.next())!=null;){if(It==U&&!Xe){U==")"&&he.backUp(1);break}Xe=!Xe&&It=="\\"}return(It==U||!Xe&&U!=")")&&(Q.tokenize=null),pe("string","string")}}function Je(U,he){return U.next(),U.match(/^\s*[\"\')]/,!1)?he.tokenize=null:he.tokenize=Ze(")"),pe(null,"(")}function Ae(U,he,Q){this.type=U,this.indent=he,this.prev=Q}function He(U,he,Q,Xe){return U.context=new Ae(Q,he.indentation()+(Xe===!1?0:G),U.context),Q}function Ke(U){return U.context.prev&&(U.context=U.context.prev),U.context.type}function ot(U,he,Q){return nt[Q.context.type](U,he,Q)}function lt(U,he,Q,Xe){for(var It=Xe||1;It>0;It--)Q.context=Q.context.prev;return ot(U,he,Q)}function rn(U){var he=U.current().toLowerCase();qe.hasOwnProperty(he)?ve="atom":ze.hasOwnProperty(he)?ve="keyword":ve="variable"}var nt={};return nt.top=function(U,he,Q){if(U=="{")return He(Q,he,"block");if(U=="}"&&Q.context.prev)return Ke(Q);if(V&&/@component/i.test(U))return He(Q,he,"atComponentBlock");if(/^@(-moz-)?document$/i.test(U))return He(Q,he,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/i.test(U))return He(Q,he,"atBlock");if(/^@(font-face|counter-style)/i.test(U))return Q.stateArg=U,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(U))return"keyframes";if(U&&U.charAt(0)=="@")return He(Q,he,"at");if(U=="hash")ve="builtin";else if(U=="word")ve="tag";else{if(U=="variable-definition")return"maybeprop";if(U=="interpolation")return He(Q,he,"interpolation");if(U==":")return"pseudo";if(X&&U=="(")return He(Q,he,"parens")}return Q.context.type},nt.block=function(U,he,Q){if(U=="word"){var Xe=he.current().toLowerCase();return Oe.hasOwnProperty(Xe)?(ve="property","maybeprop"):Ne.hasOwnProperty(Xe)?(ve=ee?"string-2":"property","maybeprop"):X?(ve=he.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(ve+=" error","maybeprop")}else return U=="meta"?"block":!X&&(U=="hash"||U=="qualifier")?(ve="error","block"):nt.top(U,he,Q)},nt.maybeprop=function(U,he,Q){return U==":"?He(Q,he,"prop"):ot(U,he,Q)},nt.prop=function(U,he,Q){if(U==";")return Ke(Q);if(U=="{"&&X)return He(Q,he,"propBlock");if(U=="}"||U=="{")return lt(U,he,Q);if(U=="(")return He(Q,he,"parens");if(U=="hash"&&!/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(he.current()))ve+=" error";else if(U=="word")rn(he);else if(U=="interpolation")return He(Q,he,"interpolation");return"prop"},nt.propBlock=function(U,he,Q){return U=="}"?Ke(Q):U=="word"?(ve="property","maybeprop"):Q.context.type},nt.parens=function(U,he,Q){return U=="{"||U=="}"?lt(U,he,Q):U==")"?Ke(Q):U=="("?He(Q,he,"parens"):U=="interpolation"?He(Q,he,"interpolation"):(U=="word"&&rn(he),"parens")},nt.pseudo=function(U,he,Q){return U=="meta"?"pseudo":U=="word"?(ve="variable-3",Q.context.type):ot(U,he,Q)},nt.documentTypes=function(U,he,Q){return U=="word"&&b.hasOwnProperty(he.current())?(ve="tag",Q.context.type):nt.atBlock(U,he,Q)},nt.atBlock=function(U,he,Q){if(U=="(")return He(Q,he,"atBlock_parens");if(U=="}"||U==";")return lt(U,he,Q);if(U=="{")return Ke(Q)&&He(Q,he,X?"block":"top");if(U=="interpolation")return He(Q,he,"interpolation");if(U=="word"){var Xe=he.current().toLowerCase();Xe=="only"||Xe=="not"||Xe=="and"||Xe=="or"?ve="keyword":se.hasOwnProperty(Xe)?ve="attribute":J.hasOwnProperty(Xe)?ve="property":le.hasOwnProperty(Xe)?ve="keyword":Oe.hasOwnProperty(Xe)?ve="property":Ne.hasOwnProperty(Xe)?ve=ee?"string-2":"property":qe.hasOwnProperty(Xe)?ve="atom":ze.hasOwnProperty(Xe)?ve="keyword":ve="error"}return Q.context.type},nt.atComponentBlock=function(U,he,Q){return U=="}"?lt(U,he,Q):U=="{"?Ke(Q)&&He(Q,he,X?"block":"top",!1):(U=="word"&&(ve="error"),Q.context.type)},nt.atBlock_parens=function(U,he,Q){return U==")"?Ke(Q):U=="{"||U=="}"?lt(U,he,Q,2):nt.atBlock(U,he,Q)},nt.restricted_atBlock_before=function(U,he,Q){return U=="{"?He(Q,he,"restricted_atBlock"):U=="word"&&Q.stateArg=="@counter-style"?(ve="variable","restricted_atBlock_before"):ot(U,he,Q)},nt.restricted_atBlock=function(U,he,Q){return U=="}"?(Q.stateArg=null,Ke(Q)):U=="word"?(Q.stateArg=="@font-face"&&!Fe.hasOwnProperty(he.current().toLowerCase())||Q.stateArg=="@counter-style"&&!tt.hasOwnProperty(he.current().toLowerCase())?ve="error":ve="property","maybeprop"):"restricted_atBlock"},nt.keyframes=function(U,he,Q){return U=="word"?(ve="variable","keyframes"):U=="{"?He(Q,he,"top"):ot(U,he,Q)},nt.at=function(U,he,Q){return U==";"?Ke(Q):U=="{"||U=="}"?lt(U,he,Q):(U=="word"?ve="tag":U=="hash"&&(ve="builtin"),"at")},nt.interpolation=function(U,he,Q){return U=="}"?Ke(Q):U=="{"||U==";"?lt(U,he,Q):(U=="word"?ve="variable":U!="variable"&&U!="("&&U!=")"&&(ve="error"),"interpolation")},{startState:function(U){return{tokenize:null,state:Te?"block":"top",stateArg:null,context:new Ae(Te?"block":"top",U||0,null)}},token:function(U,he){if(!he.tokenize&&U.eatSpace())return null;var Q=(he.tokenize||De)(U,he);return Q&&typeof Q=="object"&&(fe=Q[1],Q=Q[0]),ve=Q,fe!="comment"&&(he.state=nt[he.state](fe,U,he)),ve},indent:function(U,he){var Q=U.context,Xe=he&&he.charAt(0),It=Q.indent;return Q.type=="prop"&&(Xe=="}"||Xe==")")&&(Q=Q.prev),Q.prev&&(Xe=="}"&&(Q.type=="block"||Q.type=="top"||Q.type=="interpolation"||Q.type=="restricted_atBlock")?(Q=Q.prev,It=Q.indent):(Xe==")"&&(Q.type=="parens"||Q.type=="atBlock_parens")||Xe=="{"&&(Q.type=="at"||Q.type=="atBlock"))&&(It=Math.max(0,Q.indent-G))),It},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",blockCommentContinue:" * ",lineComment:z,fold:"brace"}});function c(ge){for(var ke={},Te=0;Te")):null:b.match("--")?J(H("comment","-->")):b.match("DOCTYPE",!0,!0)?(b.eatWhile(/[\w\._\-]/),J(O(1))):null:b.eat("?")?(b.eatWhile(/[\w\._\-]/),se.tokenize=H("meta","?>"),"meta"):(E=b.eat("/")?"closeTag":"openTag",se.tokenize=F,"tag bracket");if(le=="&"){var Oe;return b.eat("#")?b.eat("x")?Oe=b.eatWhile(/[a-fA-F\d]/)&&b.eat(";"):Oe=b.eatWhile(/[\d]/)&&b.eat(";"):Oe=b.eatWhile(/[\w\.\-:]/)&&b.eat(";"),Oe?"atom":"error"}else return b.eatWhile(/[^&<]/),null}_.isInText=!0;function F(b,se){var J=b.next();if(J==">"||J=="/"&&b.eat(">"))return se.tokenize=_,E=J==">"?"endTag":"selfcloseTag","tag bracket";if(J=="=")return E="equals",null;if(J=="<"){se.tokenize=_,se.state=ae,se.tagName=se.tagStart=null;var le=se.tokenize(b,se);return le?le+" tag error":"tag error"}else return/[\'\"]/.test(J)?(se.tokenize=D(J),se.stringStartCol=b.column(),se.tokenize(b,se)):(b.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function D(b){var se=function(J,le){for(;!J.eol();)if(J.next()==b){le.tokenize=F;break}return"string"};return se.isInAttribute=!0,se}function H(b,se){return function(J,le){for(;!J.eol();){if(J.match(se)){le.tokenize=_;break}J.next()}return b}}function O(b){return function(se,J){for(var le;(le=se.next())!=null;){if(le=="<")return J.tokenize=O(b+1),J.tokenize(se,J);if(le==">")if(b==1){J.tokenize=_;break}else return J.tokenize=O(b-1),J.tokenize(se,J)}return"meta"}}function T(b){return b&&b.toLowerCase()}function M(b,se,J){this.prev=b.context,this.tagName=se||"",this.indent=b.indented,this.startOfLine=J,(w.doNotIndent.hasOwnProperty(se)||b.context&&b.context.noIndent)&&(this.noIndent=!0)}function B(b){b.context&&(b.context=b.context.prev)}function $(b,se){for(var J;;){if(!b.context||(J=b.context.tagName,!w.contextGrabbers.hasOwnProperty(T(J))||!w.contextGrabbers[T(J)].hasOwnProperty(T(se))))return;B(b)}}function ae(b,se,J){return b=="openTag"?(J.tagStart=se.column(),ue):b=="closeTag"?te:ae}function ue(b,se,J){return b=="word"?(J.tagName=se.current(),L="tag",ke):w.allowMissingTagName&&b=="endTag"?(L="tag bracket",ke(b,se,J)):(L="error",ue)}function te(b,se,J){if(b=="word"){var le=se.current();return J.context&&J.context.tagName!=le&&w.implicitlyClosed.hasOwnProperty(T(J.context.tagName))&&B(J),J.context&&J.context.tagName==le||w.matchClosing===!1?(L="tag",ye):(L="tag error",ge)}else return w.allowMissingTagName&&b=="endTag"?(L="tag bracket",ye(b,se,J)):(L="error",ge)}function ye(b,se,J){return b!="endTag"?(L="error",ye):(B(J),ae)}function ge(b,se,J){return L="error",ye(b,se,J)}function ke(b,se,J){if(b=="word")return L="attribute",Te;if(b=="endTag"||b=="selfcloseTag"){var le=J.tagName,Oe=J.tagStart;return J.tagName=J.tagStart=null,b=="selfcloseTag"||w.autoSelfClosers.hasOwnProperty(T(le))?$(J,le):($(J,le),J.context=new M(J,le,Oe==J.indented)),ae}return L="error",ke}function Te(b,se,J){return b=="equals"?G:(w.allowMissing||(L="error"),ke(b,se,J))}function G(b,se,J){return b=="string"?K:b=="word"&&w.allowUnquoted?(L="string",ke):(L="error",ke(b,se,J))}function K(b,se,J){return b=="string"?K:ke(b,se,J)}return{startState:function(b){var se={tokenize:_,state:ae,indented:b||0,tagName:null,tagStart:null,context:null};return b!=null&&(se.baseIndent=b),se},token:function(b,se){if(!se.tagName&&b.sol()&&(se.indented=b.indentation()),b.eatSpace())return null;E=null;var J=se.tokenize(b,se);return(J||E)&&J!="comment"&&(L=null,se.state=se.state(E||J,b,se),L&&(J=L=="error"?J+" error":L)),J},indent:function(b,se,J){var le=b.context;if(b.tokenize.isInAttribute)return b.tagStart==b.indented?b.stringStartCol+1:b.indented+S;if(le&&le.noIndent)return l.Pass;if(b.tokenize!=F&&b.tokenize!=_)return J?J.match(/^(\s*)/)[0].length:0;if(b.tagName)return w.multilineTagIndentPastTag!==!1?b.tagStart+b.tagName.length+2:b.tagStart+S*(w.multilineTagIndentFactor||1);if(w.alignCDATA&&/$/,blockCommentStart:"",configuration:w.htmlMode?"html":"xml",helperType:w.htmlMode?"html":"xml",skipAttribute:function(b){b.state==G&&(b.state=ke)},xmlCurrentTag:function(b){return b.tagName?{name:b.tagName,close:b.type=="closeTag"}:null},xmlCurrentContext:function(b){for(var se=[],J=b.context;J;J=J.prev)se.push(J.tagName);return se.reverse()}}}),l.defineMIME("text/xml","xml"),l.defineMIME("application/xml","xml"),l.mimeModes.hasOwnProperty("text/html")||l.defineMIME("text/html",{name:"xml",htmlMode:!0})})}()),t1.exports}(function(n,o){(function(l){l(wn(),Jd(),z1(),q1())})(function(l){var c={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 h(E,L,_){var F=E.current(),D=F.search(L);return D>-1?E.backUp(F.length-D):F.match(/<\/?$/)&&(E.backUp(F.length),E.match(L,!1)||E.match(F)),_}var k={};function I(E){var L=k[E];return L||(k[E]=new RegExp("\\s+"+E+`\\s*=\\s*('|")?([^'"]+)('|")?\\s*`))}function S(E,L){var _=E.match(I(L));return _?/^\s*(.*?)\s*$/.exec(_[2])[1]:""}function w(E,L){return new RegExp((L?"^":"")+"","i")}function x(E,L){for(var _ in E)for(var F=L[_]||(L[_]=[]),D=E[_],H=D.length-1;H>=0;H--)F.unshift(D[H])}function y(E,L){for(var _=0;_=0;O--)F.script.unshift(["type",H[O].matches,H[O].mode]);function T(M,B){var $=_.token(M,B.htmlState),ae=/\btag\b/.test($),ue;if(ae&&!/[<>\s\/]/.test(M.current())&&(ue=B.htmlState.tagName&&B.htmlState.tagName.toLowerCase())&&F.hasOwnProperty(ue))B.inTag=ue+" ";else if(B.inTag&&ae&&/>$/.test(M.current())){var te=/^([\S]+) (.*)/.exec(B.inTag);B.inTag=null;var ye=M.current()==">"&&y(F[te[1]],te[2]),ge=l.getMode(E,ye),ke=w(te[1],!0),Te=w(te[1],!1);B.token=function(G,K){return G.match(ke,!1)?(K.token=T,K.localState=K.localMode=null,null):h(G,Te,K.localMode.token(G,K.localState))},B.localMode=ge,B.localState=l.startState(ge,_.indent(B.htmlState,"",""))}else B.inTag&&(B.inTag+=M.current(),M.eol()&&(B.inTag+=" "));return $}return{startState:function(){var M=l.startState(_);return{token:T,inTag:null,localMode:null,localState:null,htmlState:M}},copyState:function(M){var B;return M.localState&&(B=l.copyState(M.localMode,M.localState)),{token:M.token,inTag:M.inTag,localMode:M.localMode,localState:B,htmlState:l.copyState(_,M.htmlState)}},token:function(M,B){return B.token(M,B)},indent:function(M,B,$){return!M.localMode||/^\s*<\//.test(B)?_.indent(M.htmlState,B,$):M.localMode.indent?M.localMode.indent(M.localState,B,$):l.Pass},innerMode:function(M){return{state:M.localState||M.htmlState,mode:M.localMode||_}}}},"xml","javascript","css"),l.defineMIME("text/html","htmlmixed")})})();(function(n,o){(function(l){l(wn())})(function(l){var c={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},h=l.Pos;l.defineOption("autoCloseBrackets",!1,function(O,T,M){M&&M!=l.Init&&(O.removeKeyMap(I),O.state.closeBrackets=null),T&&(S(k(T,"pairs")),O.state.closeBrackets=T,O.addKeyMap(I))});function k(O,T){return T=="pairs"&&typeof O=="string"?O:typeof O=="object"&&O[T]!=null?O[T]:c[T]}var I={Backspace:y,Enter:E};function S(O){for(var T=0;T=0;$--){var ue=B[$].head;O.replaceRange("",h(ue.line,ue.ch-1),h(ue.line,ue.ch+1),"+delete")}}function E(O){var T=x(O),M=T&&k(T,"explode");if(!M||O.getOption("disableInput"))return l.Pass;for(var B=O.listSelections(),$=0;$0?{line:ue.head.line,ch:ue.head.ch+T}:{line:ue.head.line-1};M.push({anchor:te,head:te})}O.setSelections(M,$)}function _(O){var T=l.cmpPos(O.anchor,O.head)>0;return{anchor:new h(O.anchor.line,O.anchor.ch+(T?-1:1)),head:new h(O.head.line,O.head.ch+(T?1:-1))}}function F(O,T){var M=x(O);if(!M||O.getOption("disableInput"))return l.Pass;var B=k(M,"pairs"),$=B.indexOf(T);if($==-1)return l.Pass;for(var ae=k(M,"closeBefore"),ue=k(M,"triples"),te=B.charAt($+1)==T,ye=O.listSelections(),ge=$%2==0,ke,Te=0;Te=0&&O.getRange(K,h(K.line,K.ch+3))==T+T+T?b="skipThree":b="skip";else if(te&&K.ch>1&&ue.indexOf(T)>=0&&O.getRange(h(K.line,K.ch-2),K)==T+T){if(K.ch>2&&/\bstring/.test(O.getTokenTypeAt(h(K.line,K.ch-2))))return l.Pass;b="addFour"}else if(te){var J=K.ch==0?" ":O.getRange(h(K.line,K.ch-1),K);if(!l.isWordChar(se)&&J!=T&&!l.isWordChar(J))b="both";else return l.Pass}else if(ge&&(se.length===0||/\s/.test(se)||ae.indexOf(se)>-1))b="both";else return l.Pass;if(!ke)ke=b;else if(ke!=b)return l.Pass}var le=$%2?B.charAt($-1):T,Oe=$%2?T:B.charAt($+1);O.operation(function(){if(ke=="skip")L(O,1);else if(ke=="skipThree")L(O,3);else if(ke=="surround"){for(var Ne=O.getSelections(),Fe=0;Fe=T.max))return T.ch=0,T.text=T.cm.getLine(++T.line),!0}function E(T){if(!(T.line<=T.min))return T.text=T.cm.getLine(--T.line),T.ch=T.text.length,!0}function L(T){for(;;){var M=T.text.indexOf(">",T.ch);if(M==-1){if(y(T))continue;return}if(!x(T,M+1)){T.ch=M+1;continue}var B=T.text.lastIndexOf("/",M),$=B>-1&&!/\S/.test(T.text.slice(B+1,M));return T.ch=M+1,$?"selfClose":"regular"}}function _(T){for(;;){var M=T.ch?T.text.lastIndexOf("<",T.ch-1):-1;if(M==-1){if(E(T))continue;return}if(!x(T,M+1)){T.ch=M;continue}S.lastIndex=M,T.ch=M;var B=S.exec(T.text);if(B&&B.index==M)return B}}function F(T){for(;;){S.lastIndex=T.ch;var M=S.exec(T.text);if(!M){if(y(T))continue;return}if(!x(T,M.index+1)){T.ch=M.index+1;continue}return T.ch=M.index+M[0].length,M}}function D(T){for(;;){var M=T.ch?T.text.lastIndexOf(">",T.ch-1):-1;if(M==-1){if(E(T))continue;return}if(!x(T,M+1)){T.ch=M;continue}var B=T.text.lastIndexOf("/",M),$=B>-1&&!/\S/.test(T.text.slice(B+1,M));return T.ch=M+1,$?"selfClose":"regular"}}function H(T,M){for(var B=[];;){var $=F(T),ae,ue=T.line,te=T.ch-($?$[0].length:0);if(!$||!(ae=L(T)))return;if(ae!="selfClose")if($[1]){for(var ye=B.length-1;ye>=0;--ye)if(B[ye]==$[2]){B.length=ye;break}if(ye<0&&(!M||M==$[2]))return{tag:$[2],from:c(ue,te),to:c(T.line,T.ch)}}else B.push($[2])}}function O(T,M){for(var B=[];;){var $=D(T);if(!$)return;if($=="selfClose"){_(T);continue}var ae=T.line,ue=T.ch,te=_(T);if(!te)return;if(te[1])B.push(te[2]);else{for(var ye=B.length-1;ye>=0;--ye)if(B[ye]==te[2]){B.length=ye;break}if(ye<0&&(!M||M==te[2]))return{tag:te[2],from:c(T.line,T.ch),to:c(ae,ue)}}}}l.registerHelper("fold","xml",function(T,M){for(var B=new w(T,M.line,0);;){var $=F(B);if(!$||B.line!=M.line)return;var ae=L(B);if(!ae)return;if(!$[1]&&ae!="selfClose"){var ue=c(B.line,B.ch),te=H(B,$[2]);return te&&h(te.from,ue)>0?{from:ue,to:te.from}:null}}}),l.findMatchingTag=function(T,M,B){var $=new w(T,M.line,M.ch,B);if(!($.text.indexOf(">")==-1&&$.text.indexOf("<")==-1)){var ae=L($),ue=ae&&c($.line,$.ch),te=ae&&_($);if(!(!ae||!te||h($,M)>0)){var ye={from:c($.line,$.ch),to:ue,tag:te[2]};return ae=="selfClose"?{open:ye,close:null,at:"open"}:te[1]?{open:O($,te[2]),close:ye,at:"close"}:($=new w(T,ue.line,ue.ch,B),{open:ye,close:H($,te[2]),at:"open"})}}},l.findEnclosingTag=function(T,M,B,$){for(var ae=new w(T,M.line,M.ch,B);;){var ue=O(ae,$);if(!ue)break;var te=new w(T,M.line,M.ch,B),ye=H(te,ue.tag);if(ye)return{open:ue,close:ye}}},l.scanForClosingTag=function(T,M,B,$){var ae=new w(T,M.line,M.ch,$?{from:0,to:$}:null);return H(ae,B)}})}()),r1.exports}(function(n,o){(function(l){l(wn(),Zd())})(function(l){l.defineOption("autoCloseTags",!1,function(y,E,L){if(L!=l.Init&&L&&y.removeKeyMap("autoCloseTags"),!!E){var _={name:"autoCloseTags"};(typeof E!="object"||E.whenClosing!==!1)&&(_["'/'"]=function(F){return S(F)}),(typeof E!="object"||E.whenOpening!==!1)&&(_["'>'"]=function(F){return k(F)}),y.addKeyMap(_)}});var c=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],h=["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 k(y){if(y.getOption("disableInput"))return l.Pass;for(var E=y.listSelections(),L=[],_=y.getOption("autoCloseTags"),F=0;FD.ch&&(B=B.slice(0,B.length-H.end+D.ch));var te=B.toLowerCase();if(!B||H.type=="string"&&(H.end!=D.ch||!/[\"\']/.test(H.string.charAt(H.string.length-1))||H.string.length==1)||H.type=="tag"&&M.close||H.string.indexOf("/")==D.ch-H.start-1||ae&&w(ae,te)>-1||x(y,O.mode.xmlCurrentContext&&O.mode.xmlCurrentContext(T)||[],B,D,!0))return l.Pass;var ye=typeof _=="object"&&_.emptyTags;if(ye&&w(ye,B)>-1){L[F]={text:"/>",newPos:l.Pos(D.line,D.ch+2)};continue}var ge=ue&&w(ue,te)>-1;L[F]={indent:ge,text:">"+(ge?` `:"")+"",newPos:ge?l.Pos(D.line+1,0):l.Pos(D.line,D.ch+1)}}for(var ke=typeof _=="object"&&_.dontIndentOnAutoClose,F=E.length-1;F>=0;F--){var Te=L[F];y.replaceRange(Te.text,E[F].head,E[F].anchor,"+insert");var G=y.listSelections().slice(0);G[F]={head:Te.newPos,anchor:Te.newPos},y.setSelections(G),!ke&&Te.indent&&(y.indentLine(Te.newPos.line,null,!0),y.indentLine(Te.newPos.line+1,null,!0))}}function I(y,E){for(var L=y.listSelections(),_=[],F=E?"/":""&&(ae+=">"),_[O]=ae}if(y.replaceSelections(_),L=y.listSelections(),!H)for(var O=0;O=0&&E[T]==L;T--)++O;_=H.to;for(var T=1;T=0;D--){var H=_[D].from(),O=_[D].to();H.line>=L||(O.line>=L&&(O=k(L,0)),L=H.line,F==null?E.uncomment(H,O,y)?F="un":(E.lineComment(H,O,y),F="line"):F=="un"?E.uncomment(H,O,y):E.lineComment(H,O,y))}});function w(y,E,L){return/\bstring\b/.test(y.getTokenTypeAt(k(E.line,0)))&&!/^[\'\"\`]/.test(L)}function x(y,E){var L=y.getMode();return L.useInnerComments===!1||!L.innerMode?L:y.getModeAt(E)}l.defineExtension("lineComment",function(y,E,L){L||(L=c);var _=this,F=x(_,y),D=_.getLine(y.line);if(!(D==null||w(_,y,D))){var H=L.lineComment||F.lineComment;if(!H){(L.blockCommentStart||F.blockCommentStart)&&(L.fullLines=!0,_.blockComment(y,E,L));return}var O=Math.min(E.ch!=0||E.line==y.line?E.line+1:E.line,_.lastLine()+1),T=L.padding==null?" ":L.padding,M=L.commentBlankLines||y.line==E.line;_.operation(function(){if(L.indent){for(var B=null,$=y.line;$ue.length)&&(B=ue)}for(var $=y.line;$O||_.operation(function(){if(L.fullLines!=!1){var M=h.test(_.getLine(O));_.replaceRange(T+H,k(O)),_.replaceRange(D+T,k(y.line,0));var B=L.blockCommentLead||F.blockCommentLead;if(B!=null)for(var $=y.line+1;$<=O;++$)($!=O||M)&&_.replaceRange(B+T,k($,0))}else{var ae=I(_.getCursor("to"),E)==0,ue=!_.somethingSelected();_.replaceRange(H,E),ae&&_.setSelection(ue?E:_.getCursor("from"),E),_.replaceRange(D,y)}})}}),l.defineExtension("uncomment",function(y,E,L){L||(L=c);var _=this,F=x(_,y),D=Math.min(E.ch!=0||E.line==y.line?E.line:E.line-1,_.lastLine()),H=Math.min(y.line,D),O=L.lineComment||F.lineComment,T=[],M=L.padding==null?" ":L.padding,B;e:{if(!O)break e;for(var $=H;$<=D;++$){var ae=_.getLine($),ue=ae.indexOf(O);if(ue>-1&&!/comment/.test(_.getTokenTypeAt(k($,ue+1)))&&(ue=-1),ue==-1&&h.test(ae)||ue>-1&&h.test(ae.slice(0,ue)))break e;T.push(ae)}if(_.operation(function(){for(var Ne=H;Ne<=D;++Ne){var Fe=T[Ne-H],tt=Fe.indexOf(O),ze=tt+O.length;tt<0||(Fe.slice(ze,ze+M.length)==M&&(ze+=M.length),B=!0,_.replaceRange("",k(Ne,tt),k(Ne,ze)))}}),B)return!0}var te=L.blockCommentStart||F.blockCommentStart,ye=L.blockCommentEnd||F.blockCommentEnd;if(!te||!ye)return!1;var ge=L.blockCommentLead||F.blockCommentLead,ke=_.getLine(H),Te=ke.indexOf(te);if(Te==-1)return!1;var G=D==H?ke:_.getLine(D),K=G.indexOf(ye,D==H?Te+te.length:0),b=k(H,Te+1),se=k(D,K+1);if(K==-1||!/comment/.test(_.getTokenTypeAt(b))||!/comment/.test(_.getTokenTypeAt(se))||_.getRange(b,se,` `).indexOf(ye)>-1)return!1;var J=ke.lastIndexOf(te,y.ch),le=J==-1?-1:ke.slice(0,y.ch).indexOf(ye,J+te.length);if(J!=-1&&le!=-1&&le+ye.length!=y.ch)return!1;le=G.indexOf(ye,E.ch);var Oe=G.slice(E.ch).lastIndexOf(te,le-E.ch);return J=le==-1||Oe==-1?-1:E.ch+Oe,le!=-1&&J!=-1&&J!=E.ch?!1:(_.operation(function(){_.replaceRange("",k(D,K-(M&&G.slice(K-M.length,K)==M?M.length:0)),k(D,K+ye.length));var Ne=Te+te.length;if(M&&ke.slice(Ne,Ne+M.length)==M&&(Ne+=M.length),_.replaceRange("",k(H,Te),k(H,Ne)),ge)for(var Fe=H+1;Fe<=D;++Fe){var tt=_.getLine(Fe),ze=tt.indexOf(ge);if(!(ze==-1||h.test(tt.slice(0,ze)))){var qe=ze+ge.length;M&&tt.slice(qe,qe+M.length)==M&&(qe+=M.length),_.replaceRange("",k(Fe,ze),k(Fe,qe))}}}),!0)})})})();var Qd={exports:{}};(function(n,o){(function(l){l(wn())})(function(l){function c(S,w,x,y){if(x&&x.call){var E=x;x=null}else var E=I(S,x,"rangeFinder");typeof w=="number"&&(w=l.Pos(w,0));var L=I(S,x,"minFoldSize");function _(O){var T=E(S,w);if(!T||T.to.line-T.from.lineS.firstLine();)w=l.Pos(w.line-1,0),F=_(!1);if(!(!F||F.cleared||y==="unfold")){var D=h(S,x,F);l.on(D,"mousedown",function(O){H.clear(),l.e_preventDefault(O)});var H=S.markText(F.from,F.to,{replacedWith:D,clearOnEnter:I(S,x,"clearOnEnter"),__isFold:!0});H.on("clear",function(O,T){l.signal(S,"unfold",S,O,T)}),l.signal(S,"fold",S,F.from,F.to)}}function h(S,w,x){var y=I(S,w,"widget");if(typeof y=="function"&&(y=y(x.from,x.to)),typeof y=="string"){var E=document.createTextNode(y);y=document.createElement("span"),y.appendChild(E),y.className="CodeMirror-foldmarker"}else y&&(y=y.cloneNode(!0));return y}l.newFoldFunction=function(S,w){return function(x,y){c(x,y,{rangeFinder:S,widget:w})}},l.defineExtension("foldCode",function(S,w,x){c(this,S,w,x)}),l.defineExtension("isFolded",function(S){for(var w=this.findMarksAt(S),x=0;x=B){if(ue&&ge&&ue.test(ge.className))return;ye=S(T.indicatorOpen)}}!ye&&!ge||D.setGutterMarker(te,T.gutter,ye)})}function x(D){return new RegExp("(^|\\s)"+D+"(?:$|\\s)\\s*")}function y(D){var H=D.getViewport(),O=D.state.foldGutter;O&&(D.operation(function(){w(D,H.from,H.to)}),O.from=H.from,O.to=H.to)}function E(D,H,O){var T=D.state.foldGutter;if(T){var M=T.options;if(O==M.gutter){var B=I(D,H);B?B.clear():D.foldCode(c(H,0),M)}}}function L(D){var H=D.state.foldGutter;if(H){var O=H.options;H.from=H.to=0,clearTimeout(H.changeUpdate),H.changeUpdate=setTimeout(function(){y(D)},O.foldOnChangeTimeSpan||600)}}function _(D){var H=D.state.foldGutter;if(H){var O=H.options;clearTimeout(H.changeUpdate),H.changeUpdate=setTimeout(function(){var T=D.getViewport();H.from==H.to||T.from-H.to>20||H.from-T.to>20?y(D):D.operation(function(){T.fromH.to&&(w(D,H.to,T.to),H.to=T.to)})},O.updateViewportTimeSpan||400)}}function F(D,H){var O=D.state.foldGutter;if(O){var T=H.line;T>=O.from&&Th.lastLine())return null;var _=h.getTokenAt(l.Pos(L,1));if(/\S/.test(_.string)||(_=h.getTokenAt(l.Pos(L,_.end+1))),_.type!="keyword"||_.string!="import")return null;for(var F=L,D=Math.min(h.lastLine(),L+10);F<=D;++F){var H=h.getLine(F),O=H.indexOf(";");if(O!=-1)return{startCh:_.end,end:l.Pos(F,O)}}}var S=k.line,w=I(S),x;if(!w||I(S-1)||(x=I(S-2))&&x.end.line==S-1)return null;for(var y=w.end;;){var E=I(y.line+1);if(E==null)break;y=E.end}return{from:h.clipPos(l.Pos(S,w.startCh+1)),to:y}}),l.registerHelper("fold","include",function(h,k){function I(E){if(Eh.lastLine())return null;var L=h.getTokenAt(l.Pos(E,1));if(/\S/.test(L.string)||(L=h.getTokenAt(l.Pos(E,L.end+1))),L.type=="meta"&&L.string.slice(0,8)=="#include")return L.start+8}var S=k.line,w=I(S);if(w==null||I(S-1)!=null)return null;for(var x=S;;){var y=I(x+1);if(y==null)break;++x}return{from:l.Pos(S,w+1),to:h.clipPos(l.Pos(x))}})})})();(function(n,o){(function(l){l(wn())})(function(l){function c(h,k){var I=h.getLine(k),S=I.search(/\S/);return S==-1||/\bcomment\b/.test(h.getTokenTypeAt(l.Pos(k,S+1)))?-1:l.countColumn(I,null,h.getOption("tabSize"))}l.registerHelper("fold","indent",function(h,k){var I=c(h,k.line);if(!(I<0)){for(var S=null,w=k.line+1,x=h.lastLine();w<=x;++w){var y=c(h,w);if(y!=-1)if(y>I)S=w;else break}if(S)return{from:l.Pos(k.line,h.getLine(k.line).length),to:l.Pos(S,h.getLine(S).length)}}})})})();(function(n,o){(function(l){l(wn())})(function(l){l.registerGlobalHelper("fold","comment",function(c){return c.blockCommentStart&&c.blockCommentEnd},function(c,h){var k=c.getModeAt(h),I=k.blockCommentStart,S=k.blockCommentEnd;if(!I||!S)return;for(var w=h.line,x=c.getLine(w),y,E=h.ch,L=0;;){var _=E<=0?-1:x.lastIndexOf(I,E-1);if(_==-1){if(L==1)return;L=1,E=x.length;continue}if(L==1&&_{const k={autoCloseBrackets:!0,autoCloseTags:!0,foldGutter:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"]},I=Yd(c.value,{value:"",mode:l.mode,readOnly:l.readonly,tabSize:2,lineWrapping:!0,lineNumbers:!0,...k});I.on("change",()=>{o("change",I.getValue())}),yo(()=>{const S=I.getValue();l.value!==S&&I.setValue(l.value)}),yo(()=>{I.setOption("mode",l.mode)}),setTimeout(()=>{I.refresh()},50),h&&window.addEventListener("resize",j1(()=>{I.refresh()}))}),(k,I)=>(Ht(),hn("div",{class:"editor",ref_key:"el",ref:c},null,512))}}),em=$r({__name:"Message",props:["err","warn"],setup(n){const o=n,l=jn(!1);Ua(()=>[o.err,o.warn],()=>{l.value=!1});function c(h){if(typeof h=="string")return h;{let k=h.message;const I=h.loc;return I&&I.start&&(k=`(${I.start.line}:${I.start.column}) `+k),k}}return(h,k)=>(Ht(),fl(fd,{name:"fade"},{default:$a(()=>[!l.value&&(n.err||n.warn)?(Ht(),hn("div",{key:0,class:Wi(["msg",n.err?"err":"warn"])},[Ft("pre",null,Lo(c(n.err||n.warn)),1),Ft("button",{class:"dismiss",onClick:k[0]||(k[0]=I=>l.value=!0)},"✕")],2)):Bi("",!0)]),_:1}))}}),Za=hi(em,[["__scopeId","data-v-92411507"]]),tm={class:"editor-container"},nm=$r({__name:"Editor",setup(n){const o=zr("store"),l=j1(h=>{o.state.activeFile.code=h},250),c=Ts(()=>{const{filename:h}=o.state.activeFile;return h.endsWith(".vue")||h.endsWith(".html")?"htmlmixed":h.endsWith(".css")?"css":"javascript"});return(h,k)=>(Ht(),hn(Ss,null,[Br(Ld),Ft("div",tm,[Br(U1,{onChange:Rt(l),value:Rt(o).state.activeFile.code,mode:Rt(c)},null,8,["onChange","value","mode"]),Br(Za,{err:Rt(o).state.errors[0]},null,8,["err"])])],64))}}),rm=hi(nm,[["__scopeId","data-v-0384e940"]]),im=`