vendor: 8,570 bytes, line 1
1import{b as De,F as j,E as A,c as f,I as nt,g as rt,d as Be,e as oe,T as ot,A as it,f as ge,h as ue,j as q,D as fn,s as we,N as Se,S as I,l as dn,m as mn,n as $,o as Ae,i as pn,V as lt,P as gn,q as Re,r as yn,t as k,u as st,v as xn,w as kn,x as Sn,y as L,a as ct,R as at,z as y,B as An,G as bn,H as Cn,W as Mn,J as vn,K as Ln,L as ht,M as Dn,O as ut,Q as Bn,U as wn,X as ft,Y as Rn,Z as En,_ as Tn,$ as In,k as dt,a0 as On,a1 as mt}from"./index-CwuUgzMm.js";import{c as Pn,a as Fn,b as Wn,d as qn}from"./index-Ib9CInT6.js";const Nn=t=>{let{state:e}=t,r=e.doc.lineAt(e.selection.main.from),n=Te(t.state,r.from);return n.line?Vn(t):n.block?Un(t):!1};function Ee(t,e){return({state:r,dispatch:n})=>{if(r.readOnly)return!1;let o=t(e,r);return o?(n(r.update(o)),!0):!1}}const Vn=Ee(Gn,0),$n=Ee(pt,0),Un=Ee((t,e)=>pt(t,e,Hn(e)),0);function Te(t,e){let r=t.languageDataAt("commentTokens",e,1);return r.length?r[0]:{}}const J=50;function zn(t,{open:e,close:r},n,o){let i=t.sliceDoc(n-J,n),l=t.sliceDoc(o,o+J),s=/\s*$/.exec(i)[0].length,c=/^\s*/.exec(l)[0].length,a=i.length-s;if(i.slice(a-e.length,a)==e&&l.slice(c,c+r.length)==r)return{open:{pos:n-s,margin:s&&1},close:{pos:o+c,margin:c&&1}};let h,u;o-n<=2*J?h=u=t.sliceDoc(n,o):(h=t.sliceDoc(n,n+J),u=t.sliceDoc(o-J,o));let d=/^\s*/.exec(h)[0].length,m=/\s*$/.exec(u)[0].length,p=u.length-m-r.length;return h.slice(d,d+e.length)==e&&u.slice(p,p+r.length)==r?{open:{pos:n+d+e.length,margin:/\s/.test(h.charAt(d+e.length))?1:0},close:{pos:o-m-r.length,margin:/\s/.test(u.charAt(p-1))?1:0}}:null}function Hn(t){let e=[];for(let r of t.selection.ranges){let n=t.doc.lineAt(r.from),o=r.to<=n.to?n:t.doc.lineAt(r.to);o.from>n.from&&o.from==r.to&&(o=r.to==n.to+1?n:t.doc.lineAt(r.to-1));let i=e.length-1;i>=0&&e[i].to>n.from?e[i].to=o.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:o.to})}return e}function pt(t,e,r=e.selection.ranges){let n=r.map(i=>Te(e,i.from).block);if(!n.every(i=>i))return null;let o=r.map((i,l)=>zn(e,n[l],i.from,i.to));if(t!=2&&!o.every(i=>i))return{changes:e.changes(r.map((i,l)=>o[l]?[]:[{from:i.from,insert:n[l].open+" "},{from:i.to,insert:" "+n[l].close}]))};if(t!=1&&o.some(i=>i)){let i=[];for(let l=0,s;l<o.length;l++)if(s=o[l]){let c=n[l],{open:a,close:h}=s;i.push({from:a.pos-c.open.length,to:a.pos+a.margin},{from:h.pos-h.margin,to:h.pos+c.close.length})}return{changes:i}}return null}function Gn(t,e,r=e.selection.ranges){let n=[],o=-1;e:for(let{from:i,to:l}of r){let s=n.length,c=1e9,a;for(let h=i;h<=l;){let u=e.doc.lineAt(h);if(a==null&&(a=Te(e,u.from).line,!a))continue e;if(u.from>o&&(i==l||l>u.from)){o=u.from;let d=/^\s*/.exec(u.text)[0].length,m=d==u.length,p=u.text.slice(d,d+a.length)==a?d:-1;d<u.text.length&&d<c&&(c=d),n.push({line:u,comment:p,token:a,indent:d,empty:m,single:!1})}h=u.to+1}if(c<1e9)for(let h=s;h<n.length;h++)n[h].indent<n[h].line.text.length&&(n[h].indent=c);n.length==s+1&&(n[s].single=!0)}if(t!=2&&n.some(i=>i.comment<0&&(!i.empty||i.single))){let i=[];for(let{line:s,token:c,indent:a,empty:h,single:u}of n)(u||!h)&&i.push({from:s.from+a,insert:c+" "});let l=e.changes(i);return{changes:l,selection:e.selection.map(l,1)}}else if(t!=1&&n.some(i=>i.comment>=0)){let i=[];for(let{line:l,comment:s,token:c}of n)if(s>=0){let a=l.from+s,h=a+c.length;l.text[h-l.from]==" "&&h++,i.push({from:a,to:h})}return{changes:i}}return null}const be=it.define(),Jn=it.define(),Kn=j.define(),gt=j.define({combine(t){return ue(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,r)=>r},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,r)=>(n,o)=>e(n,o)||r(n,o)})}}),yt=De.define({create(){return T.empty},update(t,e){let r=e.state.facet(gt),n=e.annotation(be);if(n){let c=C.fromTransaction(e,n.selection),a=n.side,h=a==0?t.undone:t.done;return c?h=ie(h,h.length,r.minDepth,c):h=At(h,e.startState.selection),new T(a==0?n.rest:h,a==0?h:n.rest)}let o=e.annotation(Jn);if((o=="full"||o=="before")&&(t=t.isolate()),e.annotation(ge.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let i=C.fromTransaction(e),l=e.annotation(ge.time),s=e.annotation(ge.userEvent);return i?t=t.addChanges(i,l,s,r,e):e.selection&&(t=t.addSelection(e.startState.selection,l,s,r.newGroupDelay)),(o=="full"||o=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new T(t.done.map(C.fromJSON),t.undone.map(C.fromJSON))}});function xt(t={}){return[yt,gt.of(t),A.domEventHandlers({beforeinput(e,r){let n=e.inputType=="historyUndo"?kt:e.inputType=="historyRedo"?Ce:null;return n?(e.preventDefault(),n(r)):!1}})]}function fe(t,e){return function({state:r,dispatch:n}){if(!e&&r.readOnly)return!1;let o=r.field(yt,!1);if(!o)return!1;let i=o.pop(t,r,e);return i?(n(i),!0):!1}}const kt=fe(0,!1),Ce=fe(1,!1),_n=fe(0,!0),Qn=fe(1,!0);class C{constructor(e,r,n,o,i){this.changes=e,this.effects=r,this.mapped=n,this.startSelection=o,this.selectionsAfter=i}setSelAfter(e){return new C(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,r,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(r=this.mapped)===null||r===void 0?void 0:r.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(o=>o.toJSON())}}static fromJSON(e){return new C(e.changes&&dn.fromJSON(e.changes),[],e.mapped&&mn.fromJSON(e.mapped),e.startSelection&&f.fromJSON(e.startSelection),e.selectionsAfter.map(f.fromJSON))}static fromTransaction(e,r){let n=D;for(let o of e.startState.facet(Kn)){let i=o(e);i.length&&(n=n.concat(i))}return!n.length&&e.changes.empty?null:new C(e.changes.invert(e.startState.doc),n,void 0,r||e.startState.selection,D)}static selection(e){return new C(void 0,D,void 0,void 0,e)}}function ie(t,e,r,n){let o=e+1>r+20?e-r-1:0,i=t.slice(o,e);return i.push(n),i}function jn(t,e){let r=[],n=!1;return t.iterChangedRanges((o,i)=>r.push(o,i)),e.iterChangedRanges((o,i,l,s)=>{for(let c=0;c<r.length;){let a=r[c++],h=r[c++];s>=a&&l<=h&&(n=!0)}}),n}function Yn(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((r,n)=>r.empty!=e.ranges[n].empty).length===0}function St(t,e){return t.length?e.length?t.concat(e):t:e}const D=[],Zn=200;function At(t,e){if(t.length){let r=t[t.length-1],n=r.selectionsAfter.slice(Math.max(0,r.selectionsAfter.length-Zn));return n.length&&n[n.length-1].eq(e)?t:(n.push(e),ie(t,t.length-1,1e9,r.setSelAfter(n)))}else return[C.selection([e])]}function Xn(t){let e=t[t.length-1],r=t.slice();return r[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),r}function ye(t,e){if(!t.length)return t;let r=t.length,n=D;for(;r;){let o=er(t[r-1],e,n);if(o.changes&&!o.changes.empty||o.effects.length){let i=t.slice(0,r);return i[r-1]=o,i}else e=o.mapped,r--,n=o.selectionsAfter}return n.length?[C.selection(n)]:D}function er(t,e,r){let n=St(t.selectionsAfter.length?t.selectionsAfter.map(s=>s.map(e)):D,r);if(!t.changes)return C.selection(n);let o=t.changes.map(e),i=e.mapDesc(t.changes,!0),l=t.mapped?t.mapped.composeDesc(i):i;return new C(o,I.mapEffects(t.effects,e),l,t.startSelection.map(i),n)}const tr=/^(input\.type|delete)($|\.)/;class T{constructor(e,r,n=0,o=void 0){this.done=e,this.undone=r,this.prevTime=n,this.prevUserEvent=o}isolate(){return this.prevTime?new T(this.done,this.undone):this}addChanges(e,r,n,o,i){let l=this.done,s=l[l.length-1];return s&&s.changes&&!s.changes.empty&&e.changes&&(!n||tr.test(n))&&(!s.selectionsAfter.length&&r-this.prevTime<o.newGroupDelay&&o.joinToEvent(i,jn(s.changes,e.changes))||n=="input.type.compose")?l=ie(l,l.length-1,o.minDepth,new C(e.changes.compose(s.changes),St(I.mapEffects(e.effects,s.changes),s.effects),s.mapped,s.startSelection,D)):l=ie(l,l.length,o.minDepth,e),new T(l,D,r,n)}addSelection(e,r,n,o){let i=this.done.length?this.done[this.done.length-1].selectionsAfter:D;return i.length>0&&r-this.prevTime<o&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&Yn(i[i.length-1],e)?this:new T(At(this.done,e),this.undone,r,n)}addMapping(e){return new T(ye(this.done,e),ye(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,r,n){let o=e==0?this.done:this.undone;if(o.length==0)return null;let i=o[o.length-1],l=i.selectionsAfter[0]||(i.startSelection?i.startSelection.map(i.changes.invertedDesc,1):r.selection);if(n&&i.selectionsAfter.length)return r.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:be.of({side:e,rest:Xn(o),selection:l}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(i.changes){let s=o.length==1?D:o.slice(0,o.length-1);
1return i.mapped&&(s=ye(s,i.mapped)),r.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:be.of({side:e,rest:s,selection:l}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}T.empty=new T(D,D);const bt=[{key:"Mod-z",run:kt,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Ce,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Ce,preventDefault:!0},{key:"Mod-u",run:_n,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Qn,preventDefault:!0}];function H(t,e){return f.create(t.ranges.map(e),t.mainIndex)}function w(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function R({state:t,dispatch:e},r){let n=H(t.selection,r);return n.eq(t.selection,!0)?!1:(e(w(t,n)),!0)}function de(t,e){return f.cursor(e?t.to:t.from)}function Ct(t,e){return R(t,r=>r.empty?t.moveByChar(r,e):de(r,e))}function b(t){return t.textDirectionAt(t.state.selection.main.head)==fn.LTR}const Mt=t=>Ct(t,!b(t)),vt=t=>Ct(t,b(t));function Lt(t,e){return R(t,r=>r.empty?t.moveByGroup(r,e):de(r,e))}const nr=t=>Lt(t,!b(t)),rr=t=>Lt(t,b(t));function or(t,e,r){if(e.type.prop(r))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function me(t,e,r){let n=we(t).resolveInner(e.head),o=r?Se.closedBy:Se.openedBy;for(let c=e.head;;){let a=r?n.childAfter(c):n.childBefore(c);if(!a)break;or(t,a,o)?n=a:c=r?a.to:a.from}let i=n.type.prop(o),l,s;return i&&(l=r?$(t,n.from,1):$(t,n.to,-1))&&l.matched?s=r?l.end.to:l.end.from:s=r?n.to:n.from,f.cursor(s,r?-1:1)}const ir=t=>R(t,e=>me(t.state,e,!b(t))),lr=t=>R(t,e=>me(t.state,e,b(t)));function Dt(t,e){return R(t,r=>{if(!r.empty)return de(r,e);let n=t.moveVertically(r,e);return n.head!=r.head?n:t.moveToLineBoundary(r,e)})}const Bt=t=>Dt(t,!1),wt=t=>Dt(t,!0);function Rt(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,r=0,n=0,o;if(e){for(let i of t.state.facet(A.scrollMargins)){let l=i(t);l?.top&&(r=Math.max(l?.top,r)),l?.bottom&&(n=Math.max(l?.bottom,n))}o=t.scrollDOM.clientHeight-r-n}else o=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:r,marginBottom:n,selfScroll:e,height:Math.max(t.defaultLineHeight,o-5)}}function Et(t,e){let r=Rt(t),{state:n}=t,o=H(n.selection,l=>l.empty?t.moveVertically(l,e,r.height):de(l,e));if(o.eq(n.selection))return!1;let i;if(r.selfScroll){let l=t.coordsAtPos(n.selection.main.head),s=t.scrollDOM.getBoundingClientRect(),c=s.top+r.marginTop,a=s.bottom-r.marginBottom;l&&l.top>c&&l.bottom<a&&(i=A.scrollIntoView(o.main.head,{y:"start",yMargin:l.top-c}))}return t.dispatch(w(n,o),{effects:i}),!0}const $e=t=>Et(t,!1),Me=t=>Et(t,!0);function F(t,e,r){let n=t.lineBlockAt(e.head),o=t.moveToLineBoundary(e,r);if(o.head==e.head&&o.head!=(r?n.to:n.from)&&(o=t.moveToLineBoundary(e,r,!1)),!r&&o.head==n.from&&n.length){let i=/^\s*/.exec(t.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;i&&e.head!=n.from+i&&(o=f.cursor(n.from+i))}return o}const sr=t=>R(t,e=>F(t,e,!0)),cr=t=>R(t,e=>F(t,e,!1)),ar=t=>R(t,e=>F(t,e,!b(t))),hr=t=>R(t,e=>F(t,e,b(t))),ur=t=>R(t,e=>f.cursor(t.lineBlockAt(e.head).from,1)),fr=t=>R(t,e=>f.cursor(t.lineBlockAt(e.head).to,-1));function dr(t,e,r){let n=!1,o=H(t.selection,i=>{let l=$(t,i.head,-1)||$(t,i.head,1)||i.head>0&&$(t,i.head-1,1)||i.head<t.doc.length&&$(t,i.head+1,-1);if(!l||!l.end)return i;n=!0;let s=l.start.from==i.head?l.end.to:l.end.from;return f.cursor(s)});return n?(e(w(t,o)),!0):!1}const mr=({state:t,dispatch:e})=>dr(t,e);function B(t,e,r){let n=H(t.state.selection,o=>{o.undirectional&&o.head>=o.anchor!=e&&(o=f.range(o.head,o.anchor));let i=r(o);return f.range(o.anchor,i.head,i.goalColumn,i.bidiLevel||void 0,i.assoc)});return n.eq(t.state.selection)?!1:(t.dispatch(w(t.state,n)),!0)}function Tt(t,e){return B(t,e,r=>t.moveByChar(r,e))}const It=t=>Tt(t,!b(t)),Ot=t=>Tt(t,b(t));function Pt(t,e){return B(t,e,r=>t.moveByGroup(r,e))}const pr=t=>Pt(t,!b(t)),gr=t=>Pt(t,b(t)),yr=t=>{let e=!b(t);return B(t,e,r=>me(t.state,r,e))},xr=t=>{let e=b(t);return B(t,e,r=>me(t.state,r,e))};function Ft(t,e){return B(t,e,r=>t.moveVertically(r,e))}const Wt=t=>Ft(t,!1),qt=t=>Ft(t,!0);function Nt(t,e){return B(t,e,r=>t.moveVertically(r,e,Rt(t).height))}const Ue=t=>Nt(t,!1),ze=t=>Nt(t,!0),kr=t=>B(t,!0,e=>F(t,e,!0)),Sr=t=>B(t,!1,e=>F(t,e,!1)),Ar=t=>{let e=!b(t);return B(t,e,r=>F(t,r,e))},br=t=>{let e=b(t);return B(t,e,r=>F(t,r,e))},Cr=t=>B(t,!1,e=>f.cursor(t.lineBlockAt(e.head).from)),Mr=t=>B(t,!0,e=>f.cursor(t.lineBlockAt(e.head).to)),He=({state:t,dispatch:e})=>(e(w(t,{anchor:0})),!0),Ge=({state:t,dispatch:e})=>(e(w(t,{anchor:t.doc.length})),!0),Je=({state:t,dispatch:e})=>(e(w(t,{anchor:t.selection.main.anchor,head:0})),!0),Ke=({state:t,dispatch:e})=>(e(w(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),vr=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),Lr=({state:t,dispatch:e})=>{let r=pe(t).map(({from:n,to:o})=>f.range(n,Math.min(o+1,t.doc.length)));return e(t.update({selection:f.create(r),userEvent:"select"})),!0},Dr=({state:t,dispatch:e})=>{let r=H(t.selection,n=>{let o=we(t),i=o.resolveStack(n.from,1);if(n.empty){let l=o.resolveStack(n.from,-1);l.node.from>=i.node.from&&l.node.to<=i.node.to&&(i=l)}for(let l=i;l;l=l.next){let{node:s}=l;if((s.from<n.from&&s.to>=n.to||s.to>n.to&&s.from<=n.from)&&l.next)return f.range(s.to,s.from)}return n});return r.eq(t.selection)?!1:(e(w(t,r)),!0)};function Vt(t,e){let{state:r}=t,n=r.selection,o=r.selection.ranges.slice();for(let i of r.selection.ranges){let l=r.doc.lineAt(i.head);if(e?l.to<t.state.doc.length:l.from>0)for(let s=i;;){let c=t.moveVertically(s,e);if(c.head<l.from||c.head>l.to){o.some(a=>a.head==c.head)||o.push(c);break}else{if(c.head==s.head)break;s=c}}}return o.length==n.ranges.length?!1:(t.dispatch(w(r,f.create(o,o.length-1))),!0)}const Br=t=>Vt(t,!1),wr=t=>Vt(t,!0),Rr=({state:t,dispatch:e})=>{let r=t.selection,n=null;return r.ranges.length>1?n=f.create([r.main]):r.main.empty||(n=f.create([f.cursor(r.main.head)])),n?(e(w(t,n)),!0):!1};function Y(t,e){if(t.state.readOnly)return!1;let r="delete.selection",{state:n}=t,o=n.changeByRange(i=>{let{from:l,to:s}=i;
vendor: 39,579 bytes, lines 1-2
1if(l==s){let c=e(i);c<l?(r="delete.backward",c=ee(t,c,!1)):c>l&&(r="delete.forward",c=ee(t,c,!0)),l=Math.min(l,c),s=Math.max(s,c)}else l=ee(t,l,!1),s=ee(t,s,!0);return l==s?{range:i}:{changes:{from:l,to:s},range:f.cursor(l,l<i.head?-1:1)}});return o.changes.empty?!1:(t.dispatch(n.update(o,{scrollIntoView:!0,userEvent:r,effects:r=="delete.selection"?A.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function ee(t,e,r){if(t instanceof A)for(let n of t.state.facet(A.atomicRanges).map(o=>o(t)))n.between(e,e,(o,i)=>{o<e&&i>e&&(e=r?i:o)});return e}const $t=(t,e,r)=>Y(t,n=>{let o=n.from,{state:i}=t,l=i.doc.lineAt(o),s,c;if(r&&!e&&o>l.from&&o<l.from+200&&!/[^ \t]/.test(s=l.text.slice(0,o-l.from))){if(s[s.length-1]==" ")return o-1;let a=Be(s,i.tabSize),h=a%Ae(i)||Ae(i);for(let u=0;u<h&&s[s.length-1-u]==" ";u++)o--;c=o}else c=q(l.text,o-l.from,e,e)+l.from,c==o&&l.number!=(e?i.doc.lines:1)?c+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(l.text.slice(c-l.from,o-l.from))&&(c=q(l.text,c-l.from,!1,!1)+l.from);return c}),ve=t=>$t(t,!1,!0),Ut=t=>$t(t,!0,!1),zt=(t,e)=>Y(t,r=>{let n=r.head,{state:o}=t,i=o.doc.lineAt(n),l=o.charCategorizer(n);for(let s=null;;){if(n==(e?i.to:i.from)){n==r.head&&i.number!=(e?o.doc.lines:1)&&(n+=e?1:-1);break}let c=q(i.text,n-i.from,e)+i.from,a=i.text.slice(Math.min(n,c)-i.from,Math.max(n,c)-i.from),h=l(a);if(s!=null&&h!=s)break;(a!=" "||n!=r.head)&&(s=h),n=c}return n}),Ht=t=>zt(t,!1),Er=t=>zt(t,!0),Tr=t=>Y(t,e=>{let r=t.lineBlockAt(e.head).to;return e.head<r?r:Math.min(t.state.doc.length,e.head+1)}),Ir=t=>Y(t,e=>{let r=t.moveToLineBoundary(e,!1).head;return e.head>r?r:Math.max(0,e.head-1)}),Or=t=>Y(t,e=>{let r=t.moveToLineBoundary(e,!0).head;return e.head<r?r:Math.min(t.state.doc.length,e.head+1)}),Pr=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:ot.of(["",""])},range:f.cursor(n.from)}));return e(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0},Fr=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{if(!n.empty||n.from==0||n.from==t.doc.length)return{range:n};let o=n.from,i=t.doc.lineAt(o),l=o==i.from?o-1:q(i.text,o-i.from,!1)+i.from,s=o==i.to?o+1:q(i.text,o-i.from,!0)+i.from;return{changes:{from:l,to:s,insert:t.doc.slice(o,s).append(t.doc.slice(l,o))},range:f.cursor(s)}});return r.changes.empty?!1:(e(t.update(r,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function pe(t){let e=[],r=-1;for(let n of t.selection.ranges){let o=t.doc.lineAt(n.from),i=t.doc.lineAt(n.to);if(!n.empty&&n.to==i.from&&(i=t.doc.lineAt(n.to-1)),r>=o.number){let l=e[e.length-1];l.to=i.to,l.ranges.push(n)}else e.push({from:o.from,to:i.to,ranges:[n]});r=i.number+1}return e}function Gt(t,e,r){if(t.readOnly)return!1;let n=[],o=[];for(let i of pe(t)){if(r?i.to==t.doc.length:i.from==0)continue;let l=t.doc.lineAt(r?i.to+1:i.from-1),s=l.length+1;if(r){n.push({from:i.to,to:l.to},{from:i.from,insert:l.text+t.lineBreak});for(let c of i.ranges)o.push(f.range(Math.min(t.doc.length,c.anchor+s),Math.min(t.doc.length,c.head+s)))}else{n.push({from:l.from,to:i.from},{from:i.to,insert:t.lineBreak+l.text});for(let c of i.ranges)o.push(f.range(c.anchor-s,c.head-s))}}return n.length?(e(t.update({changes:n,scrollIntoView:!0,selection:f.create(o,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const Wr=({state:t,dispatch:e})=>Gt(t,e,!1),qr=({state:t,dispatch:e})=>Gt(t,e,!0);function Jt(t,e,r){if(t.readOnly)return!1;let n=[];for(let i of pe(t))r?n.push({from:i.from,insert:t.doc.slice(i.from,i.to)+t.lineBreak}):n.push({from:i.to,insert:t.lineBreak+t.doc.slice(i.from,i.to)});let o=t.changes(n);return e(t.update({changes:o,selection:t.selection.map(o,r?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Nr=({state:t,dispatch:e})=>Jt(t,e,!1),Vr=({state:t,dispatch:e})=>Jt(t,e,!0),$r=t=>{if(t.state.readOnly)return!1;let{state:e}=t,r=e.changes(pe(e).map(({from:o,to:i})=>(o>0?o--:i<e.doc.length&&i++,{from:o,to:i}))),n=H(e.selection,o=>{let i;if(t.lineWrapping){let l=t.lineBlockAt(o.head),s=t.coordsAtPos(o.head,o.assoc||1);s&&(i=l.bottom+t.documentTop-s.bottom+t.defaultLineHeight/2)}return t.moveVertically(o,!0,i)}).map(r);return t.dispatch({changes:r,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function Ur(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let r=we(t).resolveInner(e),n=r.childBefore(e),o=r.childAfter(e),i;return n&&o&&n.to<=e&&o.from>=e&&(i=n.type.prop(Se.closedBy))&&i.indexOf(o.name)>-1&&t.doc.lineAt(n.to).from==t.doc.lineAt(o.from).from&&!/\S/.test(t.sliceDoc(n.to,o.from))?{from:n.to,to:o.from}:null}const _e=Kt(!1),zr=Kt(!0);function Kt(t){return({state:e,dispatch:r})=>{if(e.readOnly)return!1;let n=e.changeByRange(o=>{let{from:i,to:l}=o,s=e.doc.lineAt(i),c=!t&&i==l&&Ur(e,i);t&&(i=l=(l<=s.to?s:e.doc.lineAt(l)).to);let a=new nt(e,{simulateBreak:i,simulateDoubleBreak:!!c}),h=rt(a,i);for(h==null&&(h=Be(/^\s*/.exec(e.doc.lineAt(i).text)[0],e.tabSize));l<s.to&&/\s/.test(s.text[l-s.from]);)l++;c?{from:i,to:l}=c:i>s.from&&i<s.from+100&&!/\S/.test(s.text.slice(0,i))&&(i=s.from);let u=["",oe(e,h)];return c&&u.push(oe(e,a.lineIndent(s.from,-1))),{changes:{from:i,to:l,insert:ot.of(u)},range:f.cursor(i+1+u[1].length)}});return r(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function Ie(t,e){let r=-1;return t.changeByRange(n=>{let o=[];for(let l=n.from;l<=n.to;){let s=t.doc.lineAt(l);s.number>r&&(n.empty||n.to>s.from)&&(e(s,o,n),r=s.number),l=s.to+1}let i=t.changes(o);return{changes:o,range:f.range(i.mapPos(n.anchor,1),i.mapPos(n.head,1))}})}const Hr=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=Object.create(null),n=new nt(t,{overrideIndentation:i=>{let l=r[i];return l??-1}}),o=Ie(t,(i,l,s)=>{let c=rt(n,i.from);if(c==null)return;/\S/.test(i.text)||(c=0);let a=/^\s*/.exec(i.text)[0],h=oe(t,c);(a!=h||s.from<i.from+a.length)&&(r[i.from]=c,l.push({from:i.from,to:i.from+a.length,insert:h}))});return o.changes.empty||e(t.update(o,{userEvent:"indent"})),!0},_t=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Ie(t,(r,n)=>{n.push({from:r.from,insert:t.facet(pn)})}),{userEvent:"input.indent"})),!0),Qt=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(Ie(t,(r,n)=>{let o=/^\s*/.exec(r.text)[0];if(!o)return;let i=Be(o,t.tabSize),l=0,s=oe(t,Math.max(0,i-Ae(t)));for(;l<o.length&&l<s.length&&o.charCodeAt(l)==s.charCodeAt(l);)l++;n.push({from:r.from+l,to:r.from+o.length,insert:s.slice(l)})}),{userEvent:"delete.dedent"})),!0),Gr=t=>(t.setTabFocusMode(),!0),Jr=[{key:"Ctrl-b",run:Mt,shift:It,preventDefault:!0},{key:"Ctrl-f",run:vt,shift:Ot},{key:"Ctrl-p",run:Bt,shift:Wt},{key:"Ctrl-n",run:wt,shift:qt},{key:"Ctrl-a",run:ur,shift:Cr},{key:"Ctrl-e",run:fr,shift:Mr},{key:"Ctrl-d",run:Ut},{key:"Ctrl-h",run:ve},{key:"Ctrl-k",run:Tr},{key:"Ctrl-Alt-h",run:Ht},{key:"Ctrl-o",run:Pr},{key:"Ctrl-t",run:Fr},{key:"Ctrl-v",run:Me}],Kr=[{key:"ArrowLeft",run:Mt,shift:It,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:nr,shift:pr,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:ar,shift:Ar,preventDefault:!0},{key:"ArrowRight",run:vt,shift:Ot,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:rr,shift:gr,preventDefault:!0},{mac:"Cmd-ArrowRight",run:hr,shift:br,preventDefault:!0},{key:"ArrowUp",run:Bt,shift:Wt,preventDefault:!0},{mac:"Cmd-ArrowUp",run:He,shift:Je},{mac:"Ctrl-ArrowUp",run:$e,shift:Ue},{key:"ArrowDown",run:wt,shift:qt,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Ge,shift:Ke},{mac:"Ctrl-ArrowDown",run:Me,shift:ze},{key:"PageUp",run:$e,shift:Ue},{key:"PageDown",run:Me,shift:ze},{key:"Home",run:cr,shift:Sr,preventDefault:!0},{key:"Mod-Home",run:He,shift:Je},{key:"End",run:sr,shift:kr,preventDefault:!0},{key:"Mod-End",run:Ge,shift:Ke},{key:"Enter",run:_e,shift:_e},{key:"Mod-a",run:vr},{key:"Backspace",run:ve,shift:ve,preventDefault:!0},{key:"Delete",run:Ut,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Ht,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:Er,preventDefault:!0},{mac:"Mod-Backspace",run:Ir,preventDefault:!0},{mac:"Mod-Delete",run:Or,preventDefault:!0}].concat(Jr.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),jt=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:ir,shift:yr},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:lr,shift:xr},{key:"Alt-ArrowUp",run:Wr},{key:"Shift-Alt-ArrowUp",run:Nr},{key:"Alt-ArrowDown",run:qr},{key:"Shift-Alt-ArrowDown",run:Vr},{key:"Mod-Alt-ArrowUp",run:Br},{key:"Mod-Alt-ArrowDown",run:wr},{key:"Escape",run:Rr},{key:"Mod-Enter",run:zr},{key:"Alt-l",mac:"Ctrl-l",run:Lr},{key:"Mod-i",run:Dr,preventDefault:!0},{key:"Mod-[",run:Qt},{key:"Mod-]",run:_t},{key:"Mod-Alt-\\",run:Hr},{key:"Shift-Mod-k",run:$r},{key:"Shift-Mod-\\",run:mr},{key:"Mod-/",run:Nn},{key:"Alt-A",run:$n},{key:"Ctrl-m",mac:"Shift-Alt-m",run:Gr}].concat(Kr),Uo={key:"Tab",run:_t,shift:Qt},Qe=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class z{constructor(e,r,n=0,o=e.length,i,l){this.test=l,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,o),this.bufferStart=n,this.normalize=i?s=>i(Qe(s)):Qe,this.query=this.normalize(r)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return xn(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let r=Sn(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=kn(e);let o=this.normalize(r);if(o.length)for(let i=0,l=n,s=!0;;i++){let c=o.charCodeAt(i),a=this.match(c,l,s,this.bufferPos+this.bufferStart,i==o.length-1);if(a)return this.value=a,this;if(i==o.length-1)break;s&&i<r.length&&r.charCodeAt(i)==c?l++:s=!1}}}match(e,r,n,o,i){let l=null;for(let s=0;s<this.matches.length;){let c=this.matches[s],a=!1;this.query.charCodeAt(c.index)==e&&(c.index==this.query.length-1?l={from:c.from,to:o,precise:i&&c.precise}:(c.index++,a=!0)),a?s++:this.matches.splice(s,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?l={from:r,to:o,precise:n&&i}:this.matches.push({from:r,index:1,precise:n})),l&&this.test&&!this.test(l.from,l.to,this.buffer,this.bufferStart)&&(l=null),l}}typeof Symbol<"u"&&(z.prototype[Symbol.iterator]=function(){return this});const Yt={from:-1,to:-1,match:/.*/.exec(""),precise:!0},Oe="gm"+(/x/.unicode==null?"":"u");class Zt{constructor(e,r,n,o=0,i=e.length){if(this.text=e,this.to=i,this.curLine="",this.done=!1,this.value=Yt,/\\[sWDnr]|\n|\r|\[\^/.test(r))return new Xt(e,r,n,o,i);this.re=new RegExp(r,Oe+(n?.ignoreCase?"i":"")),this.test=n?.test,this.iter=e.iter();let l=e.lineAt(o);this.curLineStart=l.from,this.matchPos=le(e,o),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let r=this.matchPos<=this.to&&this.re.exec(this.curLine);if(r){let n=this.curLineStart+r.index,o=n+r[0].length;if(this.matchPos=le(this.text,o+(n==o?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<o||n>this.value.to)&&(!this.test||this.test(n,o,r)))return this.value={from:n,to:o,precise:!0,match:r},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const xe=new WeakMap;class U{constructor(e,r){this.from=e,this.text=r}get to(){return this.from+this.text.length}static get(e,r,n){let o=xe.get(e);if(!o||o.from>=n||o.to<=r){let s=new U(r,e.sliceString(r,n));return xe.set(e,s),s}if(o.from==r&&o.to==n)return o;let{text:i,from:l}=o;return l>r&&(i=e.sliceString(r,l)+i,l=r),o.to<n&&(i+=e.sliceString(o.to,n)),xe.set(e,new U(l,i)),new U(r,i.slice(r-l,n-l))}}class Xt{constructor(e,r,n,o,i){this.text=e,this.to=i,this.done=!1,this.value=Yt,this.matchPos=le(e,o),this.re=new RegExp(r,Oe+(n?.ignoreCase?"i":"")),this.test=n?.test,this.flat=U.get(e,o,this.chunkEnd(o+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,r=this.re.exec(this.flat.text);if(r&&!r[0]&&r.index==e&&(this.re.lastIndex=e+1,r=this.re.exec(this.flat.text)),r){let n=this.flat.from+r.index,o=n+r[0].length;if((this.flat.to>=this.to||r.index+r[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,o,r)))return this.value={from:n,to:o,precise:!0,match:r},this.matchPos=le(this.text,o+(n==o?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=U.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Zt.prototype[Symbol.iterator]=Xt.prototype[Symbol.iterator]=function(){return this});function _r(t){try{return new RegExp(t,Oe),!0}catch{return!1}}function le(t,e){if(e>=t.length)return e;let r=t.lineAt(e),n;for(;e<r.to&&(n=r.text.charCodeAt(e-r.from))>=56320&&n<57344;)e++;return e}const Qr=t=>{let{state:e}=t,r=String(e.doc.lineAt(t.state.selection.main.head).number),{close:n,result:o}=yn(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:r},focus:!0,submitLabel:e.phrase("go")});return o.then(i=>{let l=i&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(i.elements.line.value);if(!l){t.dispatch({effects:n});return}let s=e.doc.lineAt(e.selection.main.head),[,c,a,h,u]=l,d=h?+h.slice(1):0,m=a?+a:s.number;if(a&&u){let x=m/100;c&&(x=x*(c=="-"?-1:1)+s.number/e.doc.lines),m=Math.round(e.doc.lines*x)}else a&&c&&(m=m*(c=="-"?-1:1)+s.number);let p=e.doc.line(Math.max(1,Math.min(e.doc.lines,m))),S=f.cursor(p.from+Math.max(0,Math.min(d,p.length)));t.dispatch({effects:[n,A.scrollIntoView(S.from,{y:"center"})],selection:S})}),!0},jr={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Yr=j.define({combine(t){return ue(t,jr,{highlightWordAroundCursor:(e,r)=>e||r,minSelectionLength:Math.min,maxMatches:Math.min})}});function Zr(t){return[ro,no]}const Xr=k.mark({class:"cm-selectionMatch"}),eo=k.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function je(t,e,r,n){return(r==0||t(e.sliceDoc(r-1,r))!=L.Word)&&(n==e.doc.length||t(e.sliceDoc(n,n+1))!=L.Word)}function to(t,e,r,n){return t(e.sliceDoc(r,r+1))==L.Word&&t(e.sliceDoc(n-1,n))==L.Word}const no=lt.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(Yr),{state:r}=t,n=r.selection;if(n.ranges.length>1)return k.none;let o=n.main,i,l=null;if(o.empty){if(!e.highlightWordAroundCursor)return k.none;let c=r.wordAt(o.head);if(!c)return k.none;l=r.charCategorizer(o.head),i=r.sliceDoc(c.from,c.to)}else{let c=o.to-o.from;if(c<e.minSelectionLength||c>200)return k.none;if(e.wholeWords){if(i=r.sliceDoc(o.from,o.to),l=r.charCategorizer(o.head),!(je(l,r,o.from,o.to)&&to(l,r,o.from,o.to)))return k.none}else if(i=r.sliceDoc(o.from,o.to),!i)return k.none}let s=[];for(let c of t.visibleRanges){let a=new z(r.doc,i,c.from,c.to);for(;!a.next().done;){let{from:h,to:u}=a.value;if((!l||je(l,r,h,u))&&(o.empty&&h<=o.from&&u>=o.to?s.push(eo.range(h,u)):(h>=o.to||u<=o.from)&&s.push(Xr.range(h,u)),s.length>e.maxMatches))return k.none}}return k.set(s)}},{decorations:t=>t.decorations}),ro=A.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),oo=({state:t,dispatch:e})=>{let{selection:r}=t,n=f.create(r.ranges.map(o=>t.wordAt(o.head)||f.cursor(o.head)),r.mainIndex);return n.eq(r)?!1:(e(t.update({selection:n})),!0)};function io(t,e){let{main:r,ranges:n}=t.selection,o=t.wordAt(r.head),i=o&&o.from==r.from&&o.to==r.to;for(let l=!1,s=new z(t.doc,e,n[n.length-1].to);;)if(s.next(),s.done){if(l)return null;s=new z(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),l=!0}else{if(l&&n.some(c=>c.from==s.value.from))continue;if(i){let c=t.wordAt(s.value.from);if(!c||c.from!=s.value.from||c.to!=s.value.to)continue}return s.value}}const lo=({state:t,dispatch:e})=>{let{ranges:r}=t.selection;if(r.some(i=>i.from===i.to))return oo({state:t,dispatch:e});let n=t.sliceDoc(r[0].from,r[0].to);if(t.selection.ranges.some(i=>t.sliceDoc(i.from,i.to)!=n))return!1;let o=io(t,n);return o?(e(t.update({selection:t.selection.addRange(f.range(o.from,o.to),!1),effects:A.scrollIntoView(o.to)})),!0):!1},G=j.define({combine(t){return ue(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Ao(e),scrollToMatch:e=>A.scrollIntoView(e)})}});class en{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||_r(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(r,n)=>n=="n"?` 2`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new fo(this):new ao(this)}getCursor(e,r=0,n){let o=e.doc?e:ct.create({doc:e});return n==null&&(n=o.doc.length),this.regexp?V(this,o,r,n):N(this,o,r,n)}}class tn{constructor(e){this.spec=e}}function so(t,e,r){return(n,o,i,l)=>{if(r&&!r(n,o,i,l))return!1;let s=n>=l&&o<=l+i.length?i.slice(n-l,o-l):e.doc.sliceString(n,o);return t(s,e,n,o)}}function N(t,e,r,n){let o;return t.wholeWord&&(o=co(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(o=so(t.test,e,o)),new z(e.doc,t.unquoted,r,n,t.caseSensitive?void 0:i=>i.toLowerCase(),o)}function co(t,e){return(r,n,o,i)=>((i>r||i+o.length<n)&&(i=Math.max(0,r-2),o=t.sliceString(i,Math.min(t.length,n+2))),(e(se(o,r-i))!=L.Word||e(ce(o,r-i))!=L.Word)&&(e(ce(o,n-i))!=L.Word||e(se(o,n-i))!=L.Word))}class ao extends tn{constructor(e){super(e)}nextMatch(e,r,n){let o=N(this.spec,e,n,e.doc.length).nextOverlapping();if(o.done){let i=Math.min(e.doc.length,r+this.spec.unquoted.length);o=N(this.spec,e,0,i).nextOverlapping()}return o.done||o.value.from==r&&o.value.to==n?null:o.value}prevMatchInRange(e,r,n){for(let o=n;;){let i=Math.max(r,o-1e4-this.spec.unquoted.length),l=N(this.spec,e,i,o),s=null;for(;!l.nextOverlapping().done;)s=l.value;if(s)return s;if(i==r)return null;o-=1e4}}prevMatch(e,r,n){let o=this.prevMatchInRange(e,0,r);return o||(o=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),o&&(o.from!=r||o.to!=n)?o:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,r){let n=N(this.spec,e,0,e.doc.length),o=[];for(;!n.next().done;){if(o.length>=r)return null;o.push(n.value)}return o}highlight(e,r,n,o){let i=N(this.spec,e,Math.max(0,r-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)o(i.value.from,i.value.to)}}function ho(t,e,r){return(n,o,i)=>(!r||r(n,o,i))&&t(i[0],e,n,o)}function V(t,e,r,n){let o;return t.wholeWord&&(o=uo(e.charCategorizer(e.selection.main.head))),t.test&&(o=ho(t.test,e,o)),new Zt(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:o},r,n)}function se(t,e){return t.slice(q(t,e,!1),e)}function ce(t,e){return t.slice(e,q(t,e))}function uo(t){return(e,r,n)=>!n[0].length||(t(se(n.input,n.index))!=L.Word||t(ce(n.input,n.index))!=L.Word)&&(t(ce(n.input,n.index+n[0].length))!=L.Word||t(se(n.input,n.index+n[0].length))!=L.Word)}class fo extends tn{nextMatch(e,r,n){let o=V(this.spec,e,n,e.doc.length).next();return o.done&&(o=V(this.spec,e,0,r).next()),o.done?null:o.value}prevMatchInRange(e,r,n){for(let o=1;;o++){let i=Math.max(r,n-o*1e4),l=V(this.spec,e,i,n),s=null;for(;!l.next().done;)s=l.value;if(s&&(i==r||s.from>i+10))return s;if(i==r)return null}}prevMatch(e,r,n){return this.prevMatchInRange(e,0,r)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(r,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let o=n.length;o>0;o--){let i=+n.slice(0,o);if(i>0&&i<e.match.length)return e.match[i]+n.slice(o)}return r})}matchAll(e,r){let n=V(this.spec,e,0,e.doc.length),o=[];for(;!n.next().done;){if(o.length>=r)return null;o.push(n.value)}return o}highlight(e,r,n,o){let i=V(this.spec,e,Math.max(0,r-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)o(i.value.from,i.value.to)}}const K=I.define(),Pe=I.define(),O=De.define({create(t){return new ke(Le(t).create(),null)},update(t,e){for(let r of e.effects)r.is(K)?t=new ke(r.value.create(),t.panel):r.is(Pe)&&(t=new ke(t.query,r.value?Fe:null));return t},provide:t=>st.from(t,e=>e.panel)});class ke{constructor(e,r){this.query=e,this.panel=r}}const mo=k.mark({class:"cm-searchMatch"}),po=k.mark({class:"cm-searchMatch cm-searchMatch-selected"}),go=lt.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(O))}update(t){let e=t.state.field(O);(e!=t.startState.field(O)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return k.none;let{view:r}=this,n=new at;for(let o=0,i=r.visibleRanges,l=i.length;o<l;o++){let{from:s,to:c}=i[o];for(;o<l-1&&c>i[o+1].from-500;)c=i[++o].to;t.highlight(r.state,s,c,(a,h)=>{let u=r.state.selection.ranges.some(d=>d.from==a&&d.to==h);n.add(a,h,u?po:mo)})}return n.finish()}},{decorations:t=>t.decorations});function Z(t){return e=>{let r=e.state.field(O,!1);return r&&r.query.spec.valid?t(e,r):on(e)}}const ae=Z((t,{query:e})=>{let{to:r}=t.state.selection.main,n=e.nextMatch(t.state,r,r);if(!n)return!1;let o=f.single(n.from,n.to),i=t.state.facet(G);return t.dispatch({selection:o,effects:[We(t,n),i.scrollToMatch(o.main,t)],userEvent:"select.search"}),rn(t),!0}),he=Z((t,{query:e})=>{let{state:r}=t,{from:n}=r.selection.main,o=e.prevMatch(r,n,n);if(!o)return!1;let i=f.single(o.from,o.to),l=t.state.facet(G);return t.dispatch({selection:i,effects:[We(t,o),l.scrollToMatch(i.main,t)],userEvent:"select.search"}),rn(t),!0}),yo=Z((t,{query:e})=>{let r=e.matchAll(t.state,1e3);return!r||!r.length?!1:(t.dispatch({selection:f.create(r.map(n=>f.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),xo=({state:t,dispatch:e})=>{let r=t.selection;if(r.ranges.length>1||r.main.empty)return!1;let{from:n,to:o}=r.main,i=[],l=0;for(let s=new z(t.doc,t.sliceDoc(n,o));!s.next().done;){if(i.length>1e3)return!1;s.value.from==n&&(l=i.length),i.push(f.range(s.value.from,s.value.to))}return e(t.update({selection:f.create(i,l),userEvent:"select.search.matches"})),!0},Ye=Z((t,{query:e})=>{let{state:r}=t,{from:n,to:o}=r.selection.main;if(r.readOnly)return!1;let i=e.nextMatch(r,n,n);if(!i)return!1;let l=i,s=[],c,a,h=[];l.precise?l.from==n&&l.to==o&&(a=r.toText(e.getReplacement(l)),s.push({from:l.from,to:l.to,insert:a}),l=e.nextMatch(r,l.from,l.to),h.push(A.announce.of(r.phrase("replaced match on line $",r.doc.lineAt(n).number)+"."))):l=e.nextMatch(r,l.from,l.to);let u=t.state.changes(s);return l&&(c=f.single(l.from,l.to).map(u),h.push(We(t,l)),h.push(r.facet(G).scrollToMatch(c.main,t))),t.dispatch({changes:u,selection:c,effects:h,userEvent:"input.replace"}),!0}),ko=Z((t,{query:e})=>{if(t.state.readOnly)return!1;let r=[];for(let o of e.matchAll(t.state,1e9)){let{from:i,to:l,precise:s}=o;s&&r.push({from:i,to:l,insert:e.getReplacement(o)})}if(!r.length)return!1;let n=t.state.phrase("replaced $ matches",r.length)+".";return t.dispatch({changes:r,effects:A.announce.of(n),userEvent:"input.replace.all"}),!0});function Fe(t){return t.state.facet(G).createPanel(t)}function Le(t,e){var r,n,o,i,l;let s=t.selection.main,c=s.empty||s.to>s.from+100?"":t.sliceDoc(s.from,s.to);if(e&&!c)return e;let a=t.facet(G);return new en({search:((r=e?.literal)!==null&&r!==void 0?r:a.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(n=e?.caseSensitive)!==null&&n!==void 0?n:a.caseSensitive,literal:(o=e?.literal)!==null&&o!==void 0?o:a.literal,regexp:(i=e?.regexp)!==null&&i!==void 0?i:a.regexp,wholeWord:(l=e?.wholeWord)!==null&&l!==void 0?l:a.wholeWord})}function nn(t){let e=Re(t,Fe);return e&&e.dom.querySelector("[main-field]")}function rn(t){let e=nn(t);e&&e==t.root.activeElement&&e.select()}const on=t=>{let e=t.state.field(O,!1);if(e&&e.panel){let r=nn(t);if(r&&r!=t.root.activeElement){let n=Le(t.state,e.query.spec);n.valid&&t.dispatch({effects:K.of(n)}),r.focus(),r.select()}}else t.dispatch({effects:[Pe.of(!0),e?K.of(Le(t.state,e.query.spec)):I.appendConfig.of(Co)]});return!0},ln=t=>{let e=t.state.field(O,!1);if(!e||!e.panel)return!1;let r=Re(t,Fe);return r&&r.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:Pe.of(!1)}),!0},So=[{key:"Mod-f",run:on,scope:"editor search-panel"},{key:"F3",run:ae,shift:he,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:ae,shift:he,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:ln,scope:"editor search-panel"},{key:"Mod-Shift-l",run:xo},{key:"Mod-Alt-g",run:Qr},{key:"Mod-d",run:lo,preventDefault:!0}];class Ao{constructor(e){this.view=e;let r=this.query=e.state.field(O).query.spec;this.commit=this.commit.bind(this),this.searchField=y("input",{value:r.search,placeholder:M(e,"Find"),"aria-label":M(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=y("input",{value:r.replace,placeholder:M(e,"Replace"),"aria-label":M(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=y("input",{type:"checkbox",name:"case",form:"",checked:r.caseSensitive,onchange:this.commit}),this.reField=y("input",{type:"checkbox",name:"re",form:"",checked:r.regexp,onchange:this.commit}),this.wordField=y("input",{type:"checkbox",name:"word",form:"",checked:r.wholeWord,onchange:this.commit});function n(o,i,l){return y("button",{class:"cm-button",name:o,onclick:i,type:"button"},l)}this.dom=y("div",{onkeydown:o=>this.keydown(o),class:"cm-search"},[this.searchField,n("next",()=>ae(e),[M(e,"next")]),n("prev",()=>he(e),[M(e,"previous")]),n("select",()=>yo(e),[M(e,"all")]),y("label",null,[this.caseField,M(e,"match case")]),y("label",null,[this.reField,M(e,"regexp")]),y("label",null,[this.wordField,M(e,"by word")]),...e.state.readOnly?[]:[y("br"),this.replaceField,n("replace",()=>Ye(e),[M(e,"replace")]),n("replaceAll",()=>ko(e),[M(e,"replace all")])],y("button",{name:"close",onclick:()=>ln(e),"aria-label":M(e,"close"),type:"button"},["Ã"])])}commit(){let e=new en({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:K.of(e)}))}keydown(e){An(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?he:ae)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Ye(this.view))}update(e){for(let r of e.transactions)for(let n of r.effects)n.is(K)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(G).top}}function M(t,e){return t.state.phrase(e)}const te=30,ne=/[\s\.,:;?!]/;function We(t,{from:e,to:r}){let n=t.state.doc.lineAt(e),o=t.state.doc.lineAt(r).to,i=Math.max(n.from,e-te),l=Math.min(o,r+te),s=t.state.sliceDoc(i,l);if(i!=n.from){for(let c=0;c<te;c++)if(!ne.test(s[c+1])&&ne.test(s[c])){s=s.slice(c);break}}if(l!=o){for(let c=s.length-1;c>s.length-te;c--)if(!ne.test(s[c-1])&&ne.test(s[c])){s=s.slice(0,c);break}}return A.announce.of(`${t.state.phrase("current match")}. ${s} ${t.state.phrase("on line")} ${n.number}.`)}const bo=A.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Co=[O,gn.low(go),bo];class Ze{constructor(e,r,n){this.from=e,this.to=r,this.diagnostic=n}}class W{constructor(e,r,n){this.diagnostics=e,this.panel=r,this.selected=n}static init(e,r,n){let o=n.facet(_).markerFilter;o&&(e=o(e,n));let i=e.slice().sort((m,p)=>m.from-p.from||m.to-p.to),l=new at,s=[],c=0,a=n.doc.iter(),h=0,u=n.doc.length;for(let m=0;;){let p=m==i.length?null:i[m];if(!p&&!s.length)break;let S,x;if(s.length)S=c,x=s.reduce((g,E)=>Math.min(g,E.to),p&&p.from>S?p.from:1e8);else{if(S=p.from,S>u)break;x=p.to,s.push(p),m++}for(;m<i.length;){let g=i[m];if(g.from==S&&(g.to>g.from||g.to==S))s.push(g),m++,x=Math.min(g.to,x);else{x=Math.min(g.from,x);break}}x=Math.min(x,u);let X=!1;if(s.some(g=>g.from==S&&(g.to==x||x==u))&&(X=S==x,!X&&x-S<10)){let g=S-(h+a.value.length);g>0&&(a.next(g),h=S);for(let E=S;;){if(E>=x){X=!0;break}if(!a.lineBreak&&h+a.value.length>E)break;E=h+a.value.length,h+=a.value.length,a.next()}}let Ne=Fo(s);if(X)l.add(S,S,k.widget({widget:new To(Ne),diagnostics:s.slice()}));else{let g=s.reduce((E,Ve)=>Ve.markClass?E+" "+Ve.markClass:E,"");l.add(S,x,k.mark({class:"cm-lintRange cm-lintRange-"+Ne+g,diagnostics:s.slice(),inclusiveEnd:s.some(E=>E.to>x)}))}if(c=x,c==u)break;for(let g=0;g<s.length;g++)s[g].to<=c&&s.splice(g--,1)}let d=l.finish();return new W(d,r,P(d))}}function P(t,e=null,r=0){let n=null;return t.between(r,1e9,(o,i,{spec:l})=>{if(!(e&&l.diagnostics.indexOf(e)<0))if(!n)n=new Ze(o,i,e||l.diagnostics[0]);else{if(l.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new Ze(n.from,i,n.diagnostic)}}),n}function Mo(t,e){let r=e.pos,n=e.end||r,o=t.state.facet(_).hideOn(t,r,n);if(o!=null)return o;let i=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(l=>l.is(sn))||t.changes.touchesRange(i.from,Math.max(i.to,n)))}function vo(t,e){return t.field(v,!1)?e:e.concat(I.appendConfig.of(Wo))}const sn=I.define(),qe=I.define(),cn=I.define(),v=De.define({create(){return new W(k.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let r=t.diagnostics.map(e.changes),n=null,o=t.panel;if(t.selected){let i=e.changes.mapPos(t.selected.from,1);n=P(r,t.selected.diagnostic,i)||P(r,null,i)}!r.size&&o&&e.state.facet(_).autoPanel&&(o=null),t=new W(r,o,n)}for(let r of e.effects)if(r.is(sn)){let n=e.state.facet(_).autoPanel?r.value.length?Q.open:null:t.panel;t=W.init(r.value,n,e.state)}else r.is(qe)?t=new W(t.diagnostics,r.value?Q.open:null,t.selected):r.is(cn)&&(t=new W(t.diagnostics,t.panel,r.value));return t},provide:t=>[st.from(t,e=>e.panel),A.decorations.from(t,e=>e.diagnostics)]}),Lo=k.mark({class:"cm-lintRange cm-lintRange-active"});function Do(t,e,r){let{diagnostics:n}=t.state.field(v),o,i=-1,l=-1;n.between(e-(r<0?1:0),e+(r>0?1:0),(c,a,{spec:h})=>{if(e>=c&&e<=a&&(c==a||(e>c||r>0)&&(e<a||r<0)))return o=h.diagnostics,i=c,l=a,!1});let s=t.state.facet(_).tooltipFilter;return o&&s&&(o=s(o,t.state)),o?{pos:i,end:l,above:!0,create(){return{dom:Bo(t,o)}}}:null}function Bo(t,e){return y("ul",{class:"cm-tooltip-lint"},e.map(r=>hn(t,r,!1)))}const wo=t=>{let e=t.state.field(v,!1);(!e||!e.panel)&&t.dispatch({effects:vo(t.state,[qe.of(!0)])});let r=Re(t,Q.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},Xe=t=>{let e=t.state.field(v,!1);return!e||!e.panel?!1:(t.dispatch({effects:qe.of(!1)}),!0)},Ro=t=>{let e=t.state.field(v,!1);if(!e)return!1;let r=t.state.selection.main,n=P(e.diagnostics,null,r.to+1);return!n&&(n=P(e.diagnostics,null,0),!n||n.from==r.from&&n.to==r.to)?!1:(t.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),bn(t,n.from,1,{tooltip:un,until:o=>o.docChanged||o.newSelection.main.head<n.from||o.newSelection.main.head>n.to}),!0)},Eo=[{key:"Mod-Shift-m",run:wo,preventDefault:!0},{key:"F8",run:Ro}],_=j.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...ue(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:et,tooltipFilter:et,needsRefresh:(e,r)=>e?r?n=>e(n)||r(n):e:r,hideOn:(e,r)=>e?r?(n,o,i)=>e(n,o,i)||r(n,o,i):e:r,autoPanel:(e,r)=>e||r})}}});function et(t,e){return t?e?(r,n)=>e(t(r,n),n):t:e}function an(t){let e=[];if(t)e:for(let{name:r}of t){for(let n=0;n<r.length;n++){let o=r[n];if(/[a-zA-Z]/.test(o)&&!e.some(i=>i.toLowerCase()==o.toLowerCase())){e.push(o);continue e}}e.push("")}return e}function hn(t,e,r){var n;let o=r?an(e.actions):[];return y("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},y("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((i,l)=>{let s=!1,c=m=>{if(m.preventDefault(),s)return;s=!0;let p=P(t.state.field(v).diagnostics,e);p&&i.apply(t,p.from,p.to)},{name:a}=i,h=o[l]?a.indexOf(o[l]):-1,u=h<0?a:[a.slice(0,h),y("u",a.slice(h,h+1)),a.slice(h+1)],d=i.markClass?" "+i.markClass:"";return y("button",{type:"button",class:"cm-diagnosticAction"+d,onclick:c,onmousedown:c,"aria-label":` Action: ${a}${h<0?"":` (access key "${o[l]})"`}.`},u)}),e.source&&y("div",{class:"cm-diagnosticSource"},e.source))}class To extends Mn{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return y("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class tt{constructor(e,r){this.diagnostic=r,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=hn(e,r,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Q{constructor(e){this.view=e,this.items=[];let r=o=>{if(!(o.ctrlKey||o.altKey||o.metaKey)){if(o.keyCode==27)Xe(this.view),this.view.focus();else if(o.keyCode==38||o.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(o.keyCode==40||o.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(o.keyCode==36)this.moveSelection(0);else if(o.keyCode==35)this.moveSelection(this.items.length-1);else if(o.keyCode==13)this.view.focus();else if(o.keyCode>=65&&o.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:i}=this.items[this.selectedIndex],l=an(i.actions);for(let s=0;s<l.length;s++)if(l[s].toUpperCase().charCodeAt(0)==o.keyCode){let c=P(this.view.state.field(v).diagnostics,i);c&&i.actions[s].apply(e,c.from,c.to)}}else return;o.preventDefault()}},n=o=>{for(let i=0;i<this.items.length;i++)this.items[i].dom.contains(o.target)&&this.moveSelection(i)};this.list=y("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:r,onclick:n}),this.dom=y("div",{class:"cm-panel-lint"},this.list,y("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Xe(this.view)},"Ã")),this.update()}get selectedIndex(){let e=this.view.state.field(v).selected;if(!e)return-1;for(let r=0;r<this.items.length;r++)if(this.items[r].diagnostic==e.diagnostic)return r;return-1}update(){let{diagnostics:e,selected:r}=this.view.state.field(v),n=0,o=!1,i=null,l=new Set;for(e.between(0,this.view.state.doc.length,(s,c,{spec:a})=>{for(let h of a.diagnostics){if(l.has(h))continue;l.add(h);let u=-1,d;for(let m=n;m<this.items.length;m++)if(this.items[m].diagnostic==h){u=m;break}u<0?(d=new tt(this.view,h),this.items.splice(n,0,d),o=!0):(d=this.items[u],u>n&&(this.items.splice(n,u-n),o=!0)),r&&d.diagnostic==r.diagnostic?d.dom.hasAttribute("aria-selected")||(d.dom.setAttribute("aria-selected","true"),i=d):d.dom.hasAttribute("aria-selected")&&d.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)o=!0,this.items.pop();this.items.length==0&&(this.items.push(new tt(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),o=!0),i?(this.list.setAttribute("aria-activedescendant",i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:s,panel:c})=>{let a=c.height/this.list.offsetHeight;s.top<c.top?this.list.scrollTop-=(c.top-s.top)/a:s.bottom>c.bottom&&(this.list.scrollTop+=(s.bottom-c.bottom)/a)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),o&&this.sync()}sync(){let e=this.list.firstChild;function r(){let n=e;e=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)r();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)r()}moveSelection(e){if(this.selectedIndex<0)return;let r=this.view.state.field(v),n=P(r.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:cn.of(n)})}static open(e){return new Q(e)}}function Io(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function re(t){return Io(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const Oo=A.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:re("#f11")},".cm-lintRange-warning":{backgroundImage:re("orange")},".cm-lintRange-info":{backgroundImage:re("#999")},".cm-lintRange-hint":{backgroundImage:re("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});
2function Po(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function Fo(t){let e="hint",r=1;for(let n of t){let o=Po(n.severity);o>r&&(r=o,e=n.severity)}return e}const un=Cn(Do,{hideOn:Mo}),Wo=[v,A.decorations.compute([v],t=>{let{selected:e,panel:r}=t.field(v);return!e||!r||e.from==e.to?k.none:k.set([Lo.range(e.from,e.to)])}),un,Oo],qo=[vn(),Ln(),ht(),xt(),Dn(),ut(),Bn(),ct.allowMultipleSelections.of(!0),wn(),ft(mt,{fallback:!0}),Rn(),Pn(),Fn(),En(),Tn(),In(),Zr(),dt.of([...Wn,...jt,...So,...bt,...On,...qn,...Eo])],No=[ht(),xt(),ut(),ft(mt,{fallback:!0}),dt.of([...jt,...bt])],zo=Object.freeze(Object.defineProperty({__proto__:null,EditorView:A,basicSetup:qo,minimalSetup:No},Symbol.toStringTag,{value:"Module"}));export{zo as a,qo as b,Uo as i};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.