PageSourceSearch

https://streamlit.io/_next/static/chunks/71269-2c28ea8d768e0f1b.js

js streamlit.io collected 2026-09-24 07:55:05 UTC 287,648 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[71269,34155],{61339:function(e,t,n){"use strict";n.d(t,{j:function(){return createTheme}});var i=n(47421),r=n(59119),createTheme=e=>{var{theme:t,settings:n={},styles:s=[]}=e,o={".cm-gutters":{}},a={};n.background&&(a.backgroundColor=n.background),n.backgroundImage&&(a.backgroundImage=n.backgroundImage),n.foreground&&(a.color=n.foreground),n.fontSize&&(a.fontSize=n.fontSize),(n.background||n.foreground)&&(o["&"]=a),n.fontFamily&&(o["&.cm-editor .cm-scroller"]={fontFamily:n.fontFamily}),n.gutterBackground&&(o[".cm-gutters"].backgroundColor=n.gutterBackground),n.gutterForeground&&(o[".cm-gutters"].color=n.gutterForeground),n.gutterBorder&&(o[".cm-gutters"].borderRightColor=n.gutterBorder),n.caret&&(o[".cm-content"]={caretColor:n.caret},o[".cm-cursor, .cm-dropCursor"]={borderLeftColor:n.caret});var l={};n.gutterActiveForeground&&(l.color=n.gutterActiveForeground),n.lineHighlight&&(o[".cm-activeLine"]={backgroundColor:n.lineHighlight},l.backgroundColor=n.lineHighlight),o[".cm-activeLineGutter"]=l,n.selection&&(o["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:n.selection+" !important"}),n.selectionMatch&&(o["& .cm-selectionMatch"]={backgroundColor:n.selectionMatch});var h=i.tk.theme(o,{dark:"dark"===t}),c=r.Qf.define(s);return[h,(0,r.nF)(c)]}},95089:function(e,t,n){"use strict";n.d(t,{ZP:function(){return eW}});var i=n(87462),r=n(63366),s=n(67294),o=n(78120),a=n(47421),l=n(59119),h=n(41113);function command(e,t){return({state:n,dispatch:i})=>{if(n.readOnly)return!1;let r=e(t,n);return!!r&&(i(n.update(r)),!0)}}let c=command(function(e,t,n=t.selection.ranges){let i=[],r=-1;for(let{from:e,to:s}of n){let n=i.length,o=1e9,a=getConfig(t,e).line;if(a){for(let n=e;n<=s;){let l=t.doc.lineAt(n);if(l.from>r&&(e==s||s>l.from)){r=l.from;let e=/^\s*/.exec(l.text)[0].length,t=e==l.length,n=l.text.slice(e,e+a.length)==a?e:-1;e<l.text.length&&e<o&&(o=e),i.push({line:l,comment:n,token:a,indent:e,empty:t,single:!1})}n=l.to+1}if(o<1e9)for(let e=n;e<i.length;e++)i[e].indent<i[e].line.text.length&&(i[e].indent=o);i.length==n+1&&(i[n].single=!0)}}if(2!=e&&i.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:r,empty:s,single:o}of i)(o||!s)&&e.push({from:t.from+r,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&i.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:r}of i)if(n>=0){let i=t.from+n,s=i+r.length;" "==t.text[s-t.from]&&s++,e.push({from:i,to:s})}return{changes:e}}return null},0),u=command(changeBlockComment,0),d=command((e,t)=>changeBlockComment(e,t,function(e){let t=[];for(let n of e.selection.ranges){let i=e.doc.lineAt(n.from),r=n.to<=i.to?i:e.doc.lineAt(n.to),s=t.length-1;s>=0&&t[s].to>i.from?t[s].to=r.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return t}(t)),0);function getConfig(e,t){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function changeBlockComment(e,t,n=t.selection.ranges){let i=n.map(e=>getConfig(t,e.from).block);if(!i.every(e=>e))return null;let r=n.map((e,n)=>(function(e,{open:t,close:n},i,r){let s,o,a=e.sliceDoc(i-50,i),l=e.sliceDoc(r,r+50),h=/\s*$/.exec(a)[0].length,c=/^\s*/.exec(l)[0].length,u=a.length-h;if(a.slice(u-t.length,u)==t&&l.slice(c,c+n.length)==n)return{open:{pos:i-h,margin:h&&1},close:{pos:r+c,margin:c&&1}};r-i<=100?s=o=e.sliceDoc(i,r):(s=e.sliceDoc(i,i+50),o=e.sliceDoc(r-50,r));let d=/^\s*/.exec(s)[0].length,f=/\s*$/.exec(o)[0].length,p=o.length-f-n.length;return s.slice(d,d+t.length)==t&&o.slice(p,p+n.length)==n?{open:{pos:i+d+t.length,margin:/\s/.test(s.charAt(d+t.length))?1:0},close:{pos:r-f-n.length,margin:/\s/.test(o.charAt(p-1))?1:0}}:null})(t,i[n],e.from,e.to));if(2!=e&&!r.every(e=>e))return{changes:t.changes(n.map((e,t)=>r[t]?[]:[{from:e.from,insert:i[t].open+" "},{from:e.to,insert:" "+i[t].close}]))};if(1!=e&&r.some(e=>e)){let e=[];for(let t=0,n;t<r.length;t++)if(n=r[t]){let r=i[t],{open:s,close:o}=n;e.push({from:s.pos-r.open.length,to:s.pos+s.margin},{from:o.pos-o.margin,to:o.pos+r.close.length})}return{changes:e}}return null}let f=o.q6.define(),p=o.q6.define(),O=o.r$.define(),g=o.r$.define({combine:e=>(0,o.BO)(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>
1t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,i)=>e(n,i)||t(n,i)})}),m=o.QQ.define({create:()=>HistoryState.empty,update(e,t){let n=t.state.facet(g),i=t.annotation(f);if(i){let r=HistEvent.fromTransaction(t,i.selection),s=i.side,o=0==s?e.undone:e.done;return o=r?updateBranch(o,o.length,n.minDepth,r):addSelection(o,t.startState.selection),new HistoryState(0==s?i.rest:o,0==s?o:i.rest)}let r=t.annotation(p);if(("full"==r||"before"==r)&&(e=e.isolate()),!1===t.annotation(o.YW.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let s=HistEvent.fromTransaction(t),a=t.annotation(o.YW.time),l=t.annotation(o.YW.userEvent);return s?e=e.addChanges(s,a,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,a,l,n.newGroupDelay)),("full"==r||"after"==r)&&(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new HistoryState(e.done.map(HistEvent.fromJSON),e.undone.map(HistEvent.fromJSON))});function cmd(e,t){return function({state:n,dispatch:i}){if(!t&&n.readOnly)return!1;let r=n.field(m,!1);if(!r)return!1;let s=r.pop(e,n,t);return!!s&&(i(s),!0)}}let S=cmd(0,!1),y=cmd(1,!1),k=cmd(0,!0),v=cmd(1,!0);let HistEvent=class HistEvent{constructor(e,t,n,i,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=i,this.selectionsAfter=r}setSelAfter(e){return new HistEvent(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(e=>e.toJSON())}}static fromJSON(e){return new HistEvent(e.changes&&o.as.fromJSON(e.changes),[],e.mapped&&o.n0.fromJSON(e.mapped),e.startSelection&&o.jT.fromJSON(e.startSelection),e.selectionsAfter.map(o.jT.fromJSON))}static fromTransaction(e,t){let n=x;for(let t of e.startState.facet(O)){let i=t(e);i.length&&(n=n.concat(i))}return!n.length&&e.changes.empty?null:new HistEvent(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,x)}static selection(e){return new HistEvent(void 0,x,void 0,void 0,e)}};function updateBranch(e,t,n,i){let r=t+1>n+20?t-n-1:0,s=e.slice(r,t);return s.push(i),s}function conc(e,t){return e.length?t.length?e.concat(t):e:t}let x=[];function addSelection(e,t){if(!e.length)return[HistEvent.selection([t])];{let n=e[e.length-1],i=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),updateBranch(e,e.length-1,1e9,n.setSelAfter(i)))}}function addMappingToBranch(e,t){if(!e.length)return e;let n=e.length,i=x;for(;n;){let r=function(e,t,n){let i=conc(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):x,n);if(!e.changes)return HistEvent.selection(i);let r=e.changes.map(t),s=t.mapDesc(e.changes,!0),a=e.mapped?e.mapped.composeDesc(s):s;return new HistEvent(r,o.Py.mapEffects(e.effects,t),a,e.startSelection.map(s),i)}(e[n-1],t,i);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,n);return t[n-1]=r,t}t=r.mapped,n--,i=r.selectionsAfter}return i.length?[HistEvent.selection(i)]:x}let T=/^(input\.type|delete)($|\.)/;let HistoryState=class HistoryState{constructor(e,t,n=0,i){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=i}isolate(){return this.prevTime?new HistoryState(this.done,this.undone):this}addChanges(e,t,n,i,r){var s,o;let a,l,h=this.done,c=h[h.length-1];return h=c&&c.changes&&!c.changes.empty&&e.changes&&(!n||T.test(n))&&(!c.selectionsAfter.length&&t-this.prevTime<i.newGroupDelay&&i.joinToEvent(r,(s=c.changes,o=e.changes,a=[],l=!1,s.iterChangedRanges((e,t)=>a.push(e,t)),o.iterChangedRanges((e,t,n,i)=>{for(let e=0;e<a.length;){let t=a[e++],r=a[e++];i>=t&&n<=r&&(l=!0)}}),l))||"input.type.compose"==n)?updateBranch(h,h.length-1,i.minDepth,new HistEvent(e.changes.compose(c.changes),conc(e.effects,c.effects),c.mapped,c.startSelection,x)):updateBranch(h,h.length,i.minDepth,e),new HistoryState(h,x,t,n)}addSelection(e,t,n,i){var r;let s=this.done.length?this.done[this.done.length-1].selectionsAfter:x;return s.length>0&&t-this.prevTime<i&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(r=s[s.length-1]).ranges.length==e.ranges.length&&0===r.ranges.filter((t,
1n)=>t.empty!=e.ranges[n].empty).length?this:new HistoryState(addSelection(this.done,e),this.undone,t,n)}addMapping(e){return new HistoryState(addMappingToBranch(this.done,e),addMappingToBranch(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let i=0==e?this.done:this.undone;if(0==i.length)return null;let r=i[i.length-1],s=r.selectionsAfter[0]||t.selection;if(n&&r.selectionsAfter.length){let n,o;return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:f.of({side:e,rest:(n=i[i.length-1],(o=i.slice())[i.length-1]=n.setSelAfter(n.selectionsAfter.slice(0,n.selectionsAfter.length-1)),o),selection:s}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0})}if(!r.changes)return null;{let n=1==i.length?x:i.slice(0,i.length-1);return r.mapped&&(n=addMappingToBranch(n,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:f.of({side:e,rest:n,selection:s}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}};HistoryState.empty=new HistoryState(x,x);let Q=[{key:"Mod-z",run:S,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:y,preventDefault:!0},{linux:"Ctrl-Shift-z",run:y,preventDefault:!0},{key:"Mod-u",run:k,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:v,preventDefault:!0}];function updateSel(e,t){return o.jT.create(e.ranges.map(t),e.mainIndex)}function setSel(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function moveSel({state:e,dispatch:t},n){let i=updateSel(e.selection,n);return!i.eq(e.selection,!0)&&(t(setSel(e,i)),!0)}function rangeEnd(e,t){return o.jT.cursor(t?e.to:e.from)}function cursorByChar(e,t){return moveSel(e,n=>n.empty?e.moveByChar(n,t):rangeEnd(n,t))}function ltrAtCursor(e){return e.textDirectionAt(e.state.selection.main.head)==a.Nm.LTR}let cursorCharLeft=e=>cursorByChar(e,!ltrAtCursor(e)),cursorCharRight=e=>cursorByChar(e,ltrAtCursor(e));function cursorByGroup(e,t){return moveSel(e,n=>n.empty?e.moveByGroup(n,t):rangeEnd(n,t))}function moveBySyntax(e,t,n){let i,r,s=(0,l.qz)(e).resolveInner(t.head),a=n?h.md.closedBy:h.md.openedBy;for(let i=t.head;;){let t=n?s.childAfter(i):s.childBefore(i);if(!t)break;!function(e,t,n){if(t.type.prop(n))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}(e,t,a)?i=n?t.to:t.from:s=t}return r=s.type.prop(a)&&(i=n?(0,l.Um)(e,s.from,1):(0,l.Um)(e,s.to,-1))&&i.matched?n?i.end.to:i.end.from:n?s.to:s.from,o.jT.cursor(r,n?-1:1)}function cursorByLine(e,t){return moveSel(e,n=>{if(!n.empty)return rangeEnd(n,t);let i=e.moveVertically(n,t);return i.head!=n.head?i:e.moveToLineBoundary(n,t)})}"undefined"!=typeof Intl&&Intl.Segmenter;let cursorLineUp=e=>cursorByLine(e,!1),cursorLineDown=e=>cursorByLine(e,!0);function pageInfo(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,i=0,r;if(t){for(let t of e.state.facet(a.tk.scrollMargins)){let r=t(e);(null==r?void 0:r.top)&&(n=Math.max(null==r?void 0:r.top,n)),(null==r?void 0:r.bottom)&&(i=Math.max(null==r?void 0:r.bottom,i))}r=e.scrollDOM.clientHeight-n-i}else r=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:i,selfScroll:t,height:Math.max(e.defaultLineHeight,r-5)}}function cursorByPage(e,t){let n,i=pageInfo(e),{state:r}=e,s=updateSel(r.selection,n=>n.empty?e.moveVertically(n,t,i.height):rangeEnd(n,t));if(s.eq(r.selection))return!1;if(i.selfScroll){let t=e.coordsAtPos(r.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),l=o.top+i.marginTop,h=o.bottom-i.marginBottom;t&&t.top>l&&t.bottom<h&&(n=a.tk.scrollIntoView(s.main.head,{y:"start",yMargin:t.top-l}))}return e.dispatch(setSel(r,s),{effects:n}),!0}let cursorPageUp=e=>cursorByPage(e,!1),cursorPageDown=e=>cursorByPage(e,!0);function moveByLineBoundary(e,t,n){let i=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?i.to:i.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==i.from&&i.length){let n=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;n&&t.head!=i.from+n&&(r=o.jT.cursor(i.from+n))}return r}function extendSel(e,t){let n=updateSel(e.state.selection,e=>{let n=t(e);return o.jT.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return!n.eq(e.state.selection)&&(e.dispatch(setSel(e.state,n)),!0)}function selectByChar(e,t){return extendSel(e,n=>e.moveByChar(n,t))}let selectCharLeft=e=>selectByChar(e,!ltrAtCursor(e)),selectCharRight=e=>selectByChar(e,ltrAtCursor(e));function selectByGroup(e,t){return extendSel(e,n=>e.moveByGroup(n,t))}function selectByLine(e,t){return extendSel(e,n=>e.moveVertically(n,t))}let selectLineUp=e=>selectByLine(e,!1),selectLineDown=e=>selectByLine(e,!0);function selectByPage(e,t){return extendSel(e,n=>e.moveVertically(n,t,pageInfo(e).height))}let selectPageUp=e=>selectByPage(e,!1),selectPageDown=e=>selectByPage(e,!0),cursorDocStart=({state:e,dispatch:t})=>(t(setSel(e,{anchor:0})),!0),cursorDocEnd=({state:e,dispatch:t})=>(t(setSel(e,{anchor:e.doc.length})),!0),selectDocStart=({state:e,dispatch:t})=>(t(setSel(e,{anchor:e.selection.main.anchor,head:0})),!0),selectDocEnd=({state:e,dispatch:t})=>(t(setSel(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function deleteBy(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:i}=e,r=i.changeByRange(i=>{let{from:r,to:s}=i;
1if(r==s){let o=t(i);o<r?(n="delete.backward",o=skipAtomic(e,o,!1)):o>r&&(n="delete.forward",o=skipAtomic(e,o,!0)),r=Math.min(r,o),s=Math.max(s,o)}else r=skipAtomic(e,r,!1),s=skipAtomic(e,s,!0);return r==s?{range:i}:{changes:{from:r,to:s},range:o.jT.cursor(r,r<i.head?-1:1)}});return!r.changes.empty&&(e.dispatch(i.update(r,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?a.tk.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function skipAtomic(e,t,n){if(e instanceof a.tk)for(let i of e.state.facet(a.tk.atomicRanges).map(t=>t(e)))i.between(t,t,(e,i)=>{e<t&&i>t&&(t=n?i:e)});return t}let deleteByChar=(e,t,n)=>deleteBy(e,i=>{let r=i.from,{state:s}=e,a=s.doc.lineAt(r),h,c;if(n&&!t&&r>a.from&&r<a.from+200&&!/[^ \t]/.test(h=a.text.slice(0,r-a.from))){if("	"==h[h.length-1])return r-1;let e=(0,o.IS)(h,s.tabSize)%(0,l.y1)(s)||(0,l.y1)(s);for(let t=0;t<e&&" "==h[h.length-1-t];t++)r--;c=r}else(c=(0,o.cp)(a.text,r-a.from,t,t)+a.from)==r&&a.number!=(t?s.doc.lines:1)?c+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(a.text.slice(c-a.from,r-a.from))&&(c=(0,o.cp)(a.text,c-a.from,!1,!1)+a.from);return c}),deleteCharBackward=e=>deleteByChar(e,!1,!0),deleteCharForward=e=>deleteByChar(e,!0,!1),deleteByGroup=(e,t)=>deleteBy(e,n=>{let i=n.head,{state:r}=e,s=r.doc.lineAt(i),a=r.charCategorizer(i);for(let e=null;;){if(i==(t?s.to:s.from)){i==n.head&&s.number!=(t?r.doc.lines:1)&&(i+=t?1:-1);break}let l=(0,o.cp)(s.text,i-s.from,t)+s.from,h=s.text.slice(Math.min(i,l)-s.from,Math.max(i,l)-s.from),c=a(h);if(null!=e&&c!=e)break;(" "!=h||i!=n.head)&&(e=c),i=l}return i}),deleteGroupBackward=e=>deleteByGroup(e,!1);function selectedLineBlocks(e){let t=[],n=-1;for(let i of e.selection.ranges){let r=e.doc.lineAt(i.from),s=e.doc.lineAt(i.to);if(i.empty||i.to!=s.from||(s=e.doc.lineAt(i.to-1)),n>=r.number){let e=t[t.length-1];e.to=s.to,e.ranges.push(i)}else t.push({from:r.from,to:s.to,ranges:[i]});n=s.number+1}return t}function moveLine(e,t,n){if(e.readOnly)return!1;let i=[],r=[];for(let t of selectedLineBlocks(e)){if(n?t.to==e.doc.length:0==t.from)continue;let s=e.doc.lineAt(n?t.to+1:t.from-1),a=s.length+1;if(n)for(let n of(i.push({from:t.to,to:s.to},{from:t.from,insert:s.text+e.lineBreak}),t.ranges))r.push(o.jT.range(Math.min(e.doc.length,n.anchor+a),Math.min(e.doc.length,n.head+a)));else for(let n of(i.push({from:s.from,to:t.from},{from:t.to,insert:e.lineBreak+s.text}),t.ranges))r.push(o.jT.range(n.anchor-a,n.head-a))}return!!i.length&&(t(e.update({changes:i,scrollIntoView:!0,selection:o.jT.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function copyLine(e,t,n){if(e.readOnly)return!1;let i=[];for(let t of selectedLineBlocks(e))n?i.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):i.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}let b=newlineAndIndent(!1),w=newlineAndIndent(!0);function newlineAndIndent(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{let{from:i,to:r}=n,s=t.doc.lineAt(i),a=!e&&i==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=(0,l.qz)(e).resolveInner(t),i=n.childBefore(t),r=n.childAfter(t),s;return i&&r&&i.to<=t&&r.from>=t&&(s=i.type.prop(h.md.closedBy))&&s.indexOf(r.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(r.from).from&&!/\S/.test(e.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}(t,i);e&&(i=r=(r<=s.to?s:t.doc.lineAt(r)).to);let c=new l.Gn(t,{simulateBreak:i,simulateDoubleBreak:!!a}),u=(0,l.K0)(c,i);for(null==u&&(u=(0,o.IS)(/^\s*/.exec(t.doc.lineAt(i).text)[0],t.tabSize));r<s.to&&/\s/.test(s.text[r-s.from]);)r++;a?{from:i,to:r}=a:i>s.from&&i<s.from+100&&!/\S/.test(s.text.slice(0,i))&&(i=s.from);let d=["",(0,l.SS)(t,u)];return a&&d.push((0,l.SS)(t,c.lineIndent(s.from,-1))),{changes:{from:i,to:r,insert:o.xv.of(d)},range:o.jT.cursor(i+1+d[1].length)}});return n(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function changeBySelectedLine(e,t){let n=-1;return e.changeByRange(i=>{let r=[];for(let s=i.from;s<=i.to;){let o=e.doc.lineAt(s);o.number>n&&(i.empty||i.to>o.from)&&(t(o,r,i),n=o.number),s=o.to+1}let s=e.changes(r);return{changes:r,range:o.jT.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}let indentMore=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(changeBySelectedLine(e,(t,n)=>{n.push({from:t.from,insert:e.facet(l.c)})}),{userEvent:"input.indent"})),!0),indentLess=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(changeBySelectedLine(e,(t,n)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let r=(0,o.IS)(i,e.tabSize),s=0,a=(0,l.SS)(e,Math.max(0,r-(0,l.y1)(e)));for(;
1s<i.length&&s<a.length&&i.charCodeAt(s)==a.charCodeAt(s);)s++;n.push({from:t.from+s,to:t.from+i.length,insert:a.slice(s)})}),{userEvent:"delete.dedent"})),!0),P=[{key:"Ctrl-b",run:cursorCharLeft,shift:selectCharLeft,preventDefault:!0},{key:"Ctrl-f",run:cursorCharRight,shift:selectCharRight},{key:"Ctrl-p",run:cursorLineUp,shift:selectLineUp},{key:"Ctrl-n",run:cursorLineDown,shift:selectLineDown},{key:"Ctrl-a",run:e=>moveSel(e,t=>o.jT.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>extendSel(e,t=>o.jT.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>moveSel(e,t=>o.jT.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>extendSel(e,t=>o.jT.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:deleteCharForward},{key:"Ctrl-h",run:deleteCharBackward},{key:"Ctrl-k",run:e=>deleteBy(e,t=>{let n=e.lineBlockAt(t.head).to;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})},{key:"Ctrl-Alt-h",run:deleteGroupBackward},{key:"Ctrl-o",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:o.xv.of(["",""])},range:o.jT.cursor(e.from)}));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,i=e.doc.lineAt(n),r=n==i.from?n-1:(0,o.cp)(i.text,n-i.from,!1)+i.from,s=n==i.to?n+1:(0,o.cp)(i.text,n-i.from,!0)+i.from;return{changes:{from:r,to:s,insert:e.doc.slice(n,s).append(e.doc.slice(r,n))},range:o.jT.cursor(s)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:cursorPageDown}],C=[{key:"ArrowLeft",run:cursorCharLeft,shift:selectCharLeft,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>cursorByGroup(e,!ltrAtCursor(e)),shift:e=>selectByGroup(e,!ltrAtCursor(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>moveSel(e,t=>moveByLineBoundary(e,t,!ltrAtCursor(e))),shift:e=>extendSel(e,t=>moveByLineBoundary(e,t,!ltrAtCursor(e))),preventDefault:!0},{key:"ArrowRight",run:cursorCharRight,shift:selectCharRight,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>cursorByGroup(e,ltrAtCursor(e)),shift:e=>selectByGroup(e,ltrAtCursor(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>moveSel(e,t=>moveByLineBoundary(e,t,ltrAtCursor(e))),shift:e=>extendSel(e,t=>moveByLineBoundary(e,t,ltrAtCursor(e))),preventDefault:!0},{key:"ArrowUp",run:cursorLineUp,shift:selectLineUp,preventDefault:!0},{mac:"Cmd-ArrowUp",run:cursorDocStart,shift:selectDocStart},{mac:"Ctrl-ArrowUp",run:cursorPageUp,shift:selectPageUp},{key:"ArrowDown",run:cursorLineDown,shift:selectLineDown,preventDefault:!0},{mac:"Cmd-ArrowDown",run:cursorDocEnd,shift:selectDocEnd},{mac:"Ctrl-ArrowDown",run:cursorPageDown,shift:selectPageDown},{key:"PageUp",run:cursorPageUp,shift:selectPageUp},{key:"PageDown",run:cursorPageDown,shift:selectPageDown},{key:"Home",run:e=>moveSel(e,t=>moveByLineBoundary(e,t,!1)),shift:e=>extendSel(e,t=>moveByLineBoundary(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:cursorDocStart,shift:selectDocStart},{key:"End",run:e=>moveSel(e,t=>moveByLineBoundary(e,t,!0)),shift:e=>extendSel(e,t=>moveByLineBoundary(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:cursorDocEnd,shift:selectDocEnd},{key:"Enter",run:b},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:deleteCharBackward,shift:deleteCharBackward},{key:"Delete",run:deleteCharForward},{key:"Mod-Backspace",mac:"Alt-Backspace",run:deleteGroupBackward},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>deleteByGroup(e,!0)},{mac:"Mod-Backspace",run:e=>deleteBy(e,t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)})},{mac:"Mod-Delete",run:e=>deleteBy(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})}].concat(P.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),R=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>moveSel(e,t=>moveBySyntax(e.state,t,!ltrAtCursor(e))),shift:e=>extendSel(e,t=>moveBySyntax(e.state,t,!ltrAtCursor(e)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>moveSel(e,t=>moveBySyntax(e.state,t,ltrAtCursor(e))),shift:e=>extendSel(e,t=>moveBySyntax(e.state,t,ltrAtCursor(e)))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>moveLine(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>copyLine(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>moveLine(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>copyLine(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,i=null;return n.ranges.length>1?i=o.jT.create([n.main]):n.main.empty||(i=o.jT.create([o.jT.cursor(n.main.head)])),!!i&&(t(setSel(e,i)),!0)}},{key:"Mod-Enter",run:w},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=selectedLineBlocks(e).map(({from:t,to:n})=>o.jT.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:o.jT.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=updateSel(e.selection,t=>{var n;let i=(0,l.qz)(e).resolveStack(t.from,1);for(let e=i;e;e=e.next){let{node:i}=e;if((i.from<t.from&&i.to>=t.to||i.to>t.to&&i.from<=t.from)&&(null===(n=i.parent)||void 0===n?void 0:n.parent))return o.jT.range(i.to,i.from)}return t});return t(setSel(e,n)),!0},preventDefault:!0},{key:"Mod-[",run:indentLess},{key:"Mod-]",run:indentMore},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),i=new l.Gn(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),r=changeBySelectedLine(e,(t,r,s)=>{let o=(0,l.K0)(i,t.from);if(null==o)return;/\S/.test(t.text)||(o=0);let a=/^\s*/.exec(t.text)[0],h=(0,l.SS)(e,o);(a!=h||s.from<t.from+a.length)&&(n[t.from]=o,r.push({from:t.from,to:t.from+a.length,insert:h}))});return r.changes.empty||t(e.update(r,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(selectedLineBlocks(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),i=updateSel(t.selection,t=>{let n;if(e.lineWrapping){let i=e.lineBlockAt(t.head),r=e.coordsAtPos(t.head,t.assoc||1);r&&(n=i.bottom+e.documentTop-r.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>{let n,i;return n=!1,i=updateSel(e.selection,t=>{let i=(0,l.Um)(e,t.head,-1)||(0,l.Um)(e,t.head,1)||t.head>0&&(0,l.Um)(e,t.head-1,1)||t.head<e.doc.length&&(0,l.Um)(e,t.head+1,-1);if(!i||!i.end)return t;n=!0;let r=i.start.from==t.head?i.end.to:i.end.from;return o.jT.cursor(r)}),!!n&&(t(setSel(e,i)),!0)}},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),i=getConfig(e.state,n.from);return i.line?c(e):!!i.block&&d(e)}},{key:"Alt-A",run:u}].concat(C),q={key:"Tab",run:indentMore,shift:indentLess};function crelt(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var i in n)if(Object.prototype.hasOwnProperty.call(n,i)){var r=n[i];"string"==typeof r?e.setAttribute(i,r):null!=r&&(e[i]=r)}t++}for(;t<arguments.length;t++)!function add(e,t){if("string"==typeof t)e.appendChild(document.createTextNode(t));else if(null==t);else if(null!=t.nodeType)e.appendChild(t);else if(Array.isArray(t))for(var n=0;n<t.length;n++)add(e,t[n]);else throw RangeError("Unsupported child node: "+t)}(e,arguments[t]);return e}let A="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;let SearchCursor=class SearchCursor{constructor(e,t,n=0,i=e.length,r,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter
1=e.iterRange(n,i),this.bufferStart=n,this.normalize=r?e=>r(A(e)):A,this.query=this.normalize(t)}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(0,o.gm)(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 t=(0,o.bg)(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=(0,o.nZ)(e);let i=this.normalize(t);for(let e=0,r=n;;e++){let s=i.charCodeAt(e),o=this.match(s,r,this.bufferPos+this.bufferStart);if(e==i.length-1){if(o)return this.value=o,this;break}r==n&&e<t.length&&t.charCodeAt(e)==s&&r++}}}match(e,t,n){let i=null;for(let t=0;t<this.matches.length;t+=2){let r=this.matches[t],s=!1;this.query.charCodeAt(r)==e&&(r==this.query.length-1?i={from:this.matches[t+1],to:n}:(this.matches[t]++,s=!0)),s||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(1==this.query.length?i={from:t,to:n}:this.matches.push(1,t)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}};"undefined"!=typeof Symbol&&(SearchCursor.prototype[Symbol.iterator]=function(){return this});let $={from:-1,to:-1,match:/.*/.exec("")},E="gm"+(null==/x/.unicode?"":"u");let RegExpCursor=class RegExpCursor{constructor(e,t,n,i=0,r=e.length){if(this.text=e,this.to=r,this.curLine="",this.done=!1,this.value=$,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new MultilineRegExpCursor(e,t,n,i,r);this.re=new RegExp(t,E+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter=e.iter();let s=e.lineAt(i);this.curLineStart=s.from,this.matchPos=toCharEnd(e,i),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 t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,i=n+t[0].length;if(this.matchPos=toCharEnd(this.text,i+(n==i?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<i||n>this.value.to)&&(!this.test||this.test(n,i,t)))return this.value={from:n,to:i,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}};let z=new WeakMap;let FlattenedDoc=class FlattenedDoc{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let i=z.get(e);if(!i||i.from>=n||i.to<=t){let i=new FlattenedDoc(t,e.sliceString(t,n));return z.set(e,i),i}if(i.from==t&&i.to==n)return i;let{text:r,from:s}=i;return s>t&&(r=e.sliceString(t,s)+r,s=t),i.to<n&&(r+=e.sliceString(i.to,n)),z.set(e,new FlattenedDoc(s,r)),new FlattenedDoc(t,r.slice(t-s,n-s))}};let MultilineRegExpCursor=class MultilineRegExpCursor{constructor(e,t,n,i,r){this.text=e,this.to=r,this.done=!1,this.value=$,this.matchPos=toCharEnd(e,i),this.re=new RegExp(t,E+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=FlattenedDoc.get(e,i,this.chunkEnd(i+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,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=toCharEnd(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=FlattenedDoc.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}};function toCharEnd(e,t){if(t>=e.length)return t;let n=e.lineAt(t),i;for(;t<n.to&&(i=n.text.charCodeAt(t-n.from))>=56320&&i<57344;)t++;return t}function createLineDialog(e){let t=crelt("input",{class:"cm-textfield",name:"line",value:String(e.state.doc.lineAt(e.state.selection.main.head).number)});
1function go(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:i}=e,r=i.doc.lineAt(i.selection.main.head),[,s,l,h,c]=n,u=h?+h.slice(1):0,d=l?+l:r.number;if(l&&c){let e=d/100;s&&(e=e*("-"==s?-1:1)+r.number/i.doc.lines),d=Math.round(i.doc.lines*e)}else l&&s&&(d=d*("-"==s?-1:1)+r.number);let f=i.doc.line(Math.max(1,Math.min(i.doc.lines,d))),p=o.jT.cursor(f.from+Math.max(0,Math.min(u,f.length)));e.dispatch({effects:[W.of(!1),a.tk.scrollIntoView(p.from,{y:"center"})],selection:p}),e.focus()}return{dom:crelt("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:W.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),go())},onsubmit:e=>{e.preventDefault(),go()}},crelt("label",e.state.phrase("Go to line"),": ",t)," ",crelt("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(RegExpCursor.prototype[Symbol.iterator]=MultilineRegExpCursor.prototype[Symbol.iterator]=function(){return this});let W=o.Py.define(),I=o.QQ.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(W)&&(e=n.value);return e},provide:e=>a.mH.from(e,e=>e?createLineDialog:null)}),B=a.tk.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),_={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},X=o.r$.define({combine:e=>(0,o.BO)(e,_,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),D=a.p.mark({class:"cm-selectionMatch"}),N=a.p.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function insideWordBoundaries(e,t,n,i){return(0==n||e(t.sliceDoc(n-1,n))!=o.D0.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=o.D0.Word)}let L=a.lg.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(X),{state:n}=e,i=n.selection;if(i.ranges.length>1)return a.p.none;let r=i.main,s,l=null;if(r.empty){if(!t.highlightWordAroundCursor)return a.p.none;let e=n.wordAt(r.head);if(!e)return a.p.none;l=n.charCategorizer(r.head),s=n.sliceDoc(e.from,e.to)}else{let e=r.to-r.from;if(e<t.minSelectionLength||e>200)return a.p.none;if(t.wholeWords){var h,c,u;if(s=n.sliceDoc(r.from,r.to),!(insideWordBoundaries(l=n.charCategorizer(r.head),n,r.from,r.to)&&(h=l,c=r.from,u=r.to,h(n.sliceDoc(c,c+1))==o.D0.Word&&h(n.sliceDoc(u-1,u))==o.D0.Word)))return a.p.none}else if(!(s=n.sliceDoc(r.from,r.to)))return a.p.none}let d=[];for(let i of e.visibleRanges){let e=new SearchCursor(n.doc,s,i.from,i.to);for(;!e.next().done;){let{from:i,to:s}=e.value;if((!l||insideWordBoundaries(l,n,i,s))&&(r.empty&&i<=r.from&&s>=r.to?d.push(N.range(i,s)):(i>=r.to||s<=r.from)&&d.push(D.range(i,s)),d.length>t.maxMatches))return a.p.none}}return a.p.set(d)}},{decorations:e=>e.decorations}),U=a.tk.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),selectWord=({state:e,dispatch:t})=>{let{selection:n}=e,i=o.jT.create(n.ranges.map(t=>e.wordAt(t.head)||o.jT.cursor(t.head)),n.mainIndex);return!i.eq(n)&&(t(e.update({selection:i})),!0)},j=o.r$.define({combine:e=>(0,o.BO)(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new SearchPanel(e),scrollToMatch:e=>a.tk.scrollIntoView(e)})});let SearchQuery=class SearchQuery{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||function(e){try{return new RegExp(e,E),!0}catch(e){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"	":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new RegExpQuery(this):new StringQuery(this)}getCursor(e,t=0,n){let i=e.doc?e:o.yy.create({doc:e});return null==n&&(n=i.doc.length),this.regexp?regexpCursor(this,i,t,n):stringCursor(this,i,t,n)}};let QueryType=class QueryType{constructor(e){this.spec=e}};function stringCursor(e,t,n,i){var r,s;return new SearchCursor(t.doc,e.unquoted,n,i,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?(r=t.doc,s=t.charCategorizer(t.selection.main.head),(e,t,n,i)=>((i>e||i+n.length<t)&&(i=Math.max(0,e-2),n=r.sliceString(i,Math.min(r.length,t+2))),(s(ch
1arBefore(n,e-i))!=o.D0.Word||s(charAfter(n,e-i))!=o.D0.Word)&&(s(charAfter(n,t-i))!=o.D0.Word||s(charBefore(n,t-i))!=o.D0.Word))):void 0)}let StringQuery=class StringQuery extends QueryType{constructor(e){super(e)}nextMatch(e,t,n){let i=stringCursor(this.spec,e,n,e.doc.length).nextOverlapping();return i.done&&(i=stringCursor(this.spec,e,0,t).nextOverlapping()),i.done?null:i.value}prevMatchInRange(e,t,n){for(let i=n;;){let n=Math.max(t,i-1e4-this.spec.unquoted.length),r=stringCursor(this.spec,e,n,i),s=null;for(;!r.nextOverlapping().done;)s=r.value;if(s)return s;if(n==t)return null;i-=1e4}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=stringCursor(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let r=stringCursor(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}};function regexpCursor(e,t,n,i){var r;return new RegExpCursor(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(r=t.charCategorizer(t.selection.main.head),(e,t,n)=>!n[0].length||(r(charBefore(n.input,n.index))!=o.D0.Word||r(charAfter(n.input,n.index))!=o.D0.Word)&&(r(charAfter(n.input,n.index+n[0].length))!=o.D0.Word||r(charBefore(n.input,n.index+n[0].length))!=o.D0.Word)):void 0},n,i)}function charBefore(e,t){return e.slice((0,o.cp)(e,t,!1),t)}function charAfter(e,t){return e.slice(t,(0,o.cp)(e,t))}let RegExpQuery=class RegExpQuery extends QueryType{nextMatch(e,t,n){let i=regexpCursor(this.spec,e,n,e.doc.length).next();return i.done&&(i=regexpCursor(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,n){for(let i=1;;i++){let r=Math.max(t,n-1e4*i),s=regexpCursor(this.spec,e,r,n),o=null;for(;!s.next().done;)o=s.value;if(o&&(r==t||o.from>r+10))return o;if(r==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(t,n)=>"$"==n?"$":"&"==n?e.match[0]:"0"!=n&&+n<e.match.length?e.match[n]:t)}matchAll(e,t){let n=regexpCursor(this.spec,e,0,e.doc.length),i=[];for(;!n.next().done;){if(i.length>=t)return null;i.push(n.value)}return i}highlight(e,t,n,i){let r=regexpCursor(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)i(r.value.from,r.value.to)}};let M=o.Py.define(),V=o.Py.define(),G=o.QQ.define({create:e=>new SearchState(defaultQuery(e).create(),null),update(e,t){for(let n of t.effects)n.is(M)?e=new SearchState(n.value.create(),e.panel):n.is(V)&&(e=new SearchState(e.query,n.value?createSearchPanel:null));return e},provide:e=>a.mH.from(e,e=>e.panel)});let SearchState=class SearchState{constructor(e,t){this.query=e,this.panel=t}};let F=a.p.mark({class:"cm-searchMatch"}),J=a.p.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Z=a.lg.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(G))}update(e){let t=e.state.field(G);(t!=e.startState.field(G)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return a.p.none;let{view:n}=this,i=new o.f_;for(let t=0,r=n.visibleRanges,s=r.length;t<s;t++){let{from:o,to:a}=r[t];for(;t<s-1&&a>r[t+1].from-500;)a=r[++t].to;e.highlight(n.state,o,a,(e,t)=>{let r=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);i.add(e,t,r?J:F)})}return i.finish()}},{decorations:e=>e.decorations});function searchCommand(e){return t=>{let n=t.state.field(G,!1);return n&&n.query.spec.valid?e(t,n):openSearchPanel(t)}}let Y=searchCommand((e,{query:t})=>{let{to:n}=e.state.selection.main,i=t.nextMatch(e.state,n,n);if(!i)return!1;let r=o.jT.single(i.from,i.to),s=e.state.facet(j);return e.dispatch({selection:r,effects:[announceMatch(e,i),s.scrollToMatch(r.main,e)],userEvent:"select.search"}),selectSearchInput(e),!0}),H=searchCommand((e,{query:t})=>{let{state:n}=e,{from:i}=n.selection.main,r=t.prevMatch(n,i,i);if(!r)return!1;let s=o.jT.single(r.from,r.to),a=e.state.facet(j);return e.dispatch({selection:s,effects:[announceMatch(e,r),a.scrollToMatch(s.main,e)],userEvent:"select.search"}),selectSearchInput(e),!0}),K=searchCommand((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!!n&&!!n.length&&(e.dispatch({selection:o.jT.create(n.map(e=>o.jT.range(e.from,e.to))),userEvent:"select.search.matches"}),!0)}),ee=searchCommand((e,{query:t})=>{let{state:n}=e,{from:i,to:r}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,i,i);if(!s)return!1;let l=[],h,c,u=[];
1if(s.from==i&&s.to==r&&(c=n.toText(t.getReplacement(s)),l.push({from:s.from,to:s.to,insert:c}),s=t.nextMatch(n,s.from,s.to),u.push(a.tk.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(i).number)+"."))),s){let t=0==l.length||l[0].from>=s.to?0:s.to-s.from-c.length;h=o.jT.single(s.from-t,s.to-t),u.push(announceMatch(e,s)),u.push(n.facet(j).scrollToMatch(h.main,e))}return e.dispatch({changes:l,selection:h,effects:u,userEvent:"input.replace"}),!0}),et=searchCommand((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:i}=e;return{from:n,to:i,insert:t.getReplacement(e)}});if(!n.length)return!1;let i=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:a.tk.announce.of(i),userEvent:"input.replace.all"}),!0});function createSearchPanel(e){return e.state.facet(j).createPanel(e)}function defaultQuery(e,t){var n,i,r,s,o;let a=e.selection.main,l=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!l)return t;let h=e.facet(j);return new SearchQuery({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:h.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:null!==(i=null==t?void 0:t.caseSensitive)&&void 0!==i?i:h.caseSensitive,literal:null!==(r=null==t?void 0:t.literal)&&void 0!==r?r:h.literal,regexp:null!==(s=null==t?void 0:t.regexp)&&void 0!==s?s:h.regexp,wholeWord:null!==(o=null==t?void 0:t.wholeWord)&&void 0!==o?o:h.wholeWord})}function getSearchInput(e){let t=(0,a.Sd)(e,createSearchPanel);return t&&t.dom.querySelector("[main-field]")}function selectSearchInput(e){let t=getSearchInput(e);t&&t==e.root.activeElement&&t.select()}let openSearchPanel=e=>{let t=e.state.field(G,!1);if(t&&t.panel){let n=getSearchInput(e);if(n&&n!=e.root.activeElement){let i=defaultQuery(e.state,t.query.spec);i.valid&&e.dispatch({effects:M.of(i)}),n.focus(),n.select()}}else e.dispatch({effects:[V.of(!0),t?M.of(defaultQuery(e.state,t.query.spec)):o.Py.appendConfig.of(es)]});return!0},closeSearchPanel=e=>{let t=e.state.field(G,!1);if(!t||!t.panel)return!1;let n=(0,a.Sd)(e,createSearchPanel);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:V.of(!1)}),!0},en=[{key:"Mod-f",run:openSearchPanel,scope:"editor search-panel"},{key:"F3",run:Y,shift:H,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Y,shift:H,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:closeSearchPanel,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:i,to:r}=n.main,s=[],a=0;for(let t=new SearchCursor(e.doc,e.sliceDoc(i,r));!t.next().done;){if(s.length>1e3)return!1;t.value.from==i&&(a=s.length),s.push(o.jT.range(t.value.from,t.value.to))}return t(e.update({selection:o.jT.create(s,a),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let t=(0,a.Sd)(e,createLineDialog);
1if(!t){let n=[W.of(!0)];null==e.state.field(I,!1)&&n.push(o.Py.appendConfig.of([I,B])),e.dispatch({effects:n}),t=(0,a.Sd)(e,createLineDialog)}return t&&t.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return selectWord({state:e,dispatch:t});let i=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=i))return!1;let r=function(e,t){let{main:n,ranges:i}=e.selection,r=e.wordAt(n.head),s=r&&r.from==n.from&&r.to==n.to;for(let n=!1,r=new SearchCursor(e.doc,t,i[i.length-1].to);;)if(r.next(),r.done){if(n)return null;r=new SearchCursor(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),n=!0}else{if(n&&i.some(e=>e.from==r.value.from))continue;if(s){let t=e.wordAt(r.value.from);if(!t||t.from!=r.value.from||t.to!=r.value.to)continue}return r.value}}(e,i);return!!r&&(t(e.update({selection:e.selection.addRange(o.jT.range(r.from,r.to),!1),effects:a.tk.scrollIntoView(r.to)})),!0)},preventDefault:!0}];let SearchPanel=class SearchPanel{constructor(e){this.view=e;let t=this.query=e.state.field(G).query.spec;function button(e,t,n){return crelt("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=crelt("input",{value:t.search,placeholder:phrase(e,"Find"),"aria-label":phrase(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=crelt("input",{value:t.replace,placeholder:phrase(e,"Replace"),"aria-label":phrase(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=crelt("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=crelt("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=crelt("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=crelt("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,button("next",()=>Y(e),[phrase(e,"next")]),button("prev",()=>H(e),[phrase(e,"previous")]),button("select",()=>K(e),[phrase(e,"all")]),crelt("label",null,[this.caseField,phrase(e,"match case")]),crelt("label",null,[this.reField,phrase(e,"regexp")]),crelt("label",null,[this.wordField,phrase(e,"by word")]),...e.state.readOnly?[]:[crelt("br"),this.replaceField,button("replace",()=>ee(e),[phrase(e,"replace")]),button("replaceAll",()=>et(e),[phrase(e,"replace all")])],crelt("button",{name:"close",onclick:()=>closeSearchPanel(e),"aria-label":phrase(e,"close"),type:"button"},["\xd7"])])}commit(){let e=new SearchQuery({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:M.of(e)}))}keydown(e){(0,a.$1)(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?H:Y)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),ee(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(M)&&!e.value.eq(this.query)&&this.setQuery(e.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(j).top}};function phrase(e,t){return e.state.phrase(t)}let ei=/[\s\.,:;?!]/;function announceMatch(e,{from:t,to:n}){let i=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,s=Math.max(i.from,t-30),o=Math.min(r,n+30),l=e.state.sliceDoc(s,o);if(s!=i.from){for(let e=0;e<30;e++)if(!ei.test(l[e+1])&&ei.test(l[e])){l=l.slice(e);break}}if(o!=r){for(let e=l.length-1;e>l.length-30;e--)if(!ei.test(l[e-1])&&ei.test(l[e])){l=l.slice(0,e);break}}return a.tk.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${i.number}.`)}let er=a.tk.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"}}),es=[G,o.Wl.low(Z),er];var eo=n(34790);let SelectedDiagnostic=class SelectedDiagnostic{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}};let LintState=class LintState{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let i=e,r=n.facet(ef).markerFilter;r&&(i=r(i,n));let s=a.p.set(i.map(e=>e.from==e.to||e.from==e.to-1&&n.doc.lineAt(e.from).to==e.from?a.p.widget({widget:new DiagnosticWidget(e),diagnostic:e}).range(e.from):a.p.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity+(e.markClass?" "+e.markClass:"")},diagnostic:e,inclusive:!0}).range(e.from,e.to)),!0);
1return new LintState(s,t,findDiagnostic(s))}};function findDiagnostic(e,t=null,n=0){let i=null;return e.between(n,1e9,(e,n,{spec:r})=>{if(!t||r.diagnostic==t)return i=new SelectedDiagnostic(e,n,r.diagnostic),!1}),i}function hideTooltip(e,t){let n=t.pos,i=t.end||n,r=e.state.facet(ef).hideOn(e,n,i);if(null!=r)return r;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(ea))||e.changes.touchesRange(s.from,Math.max(s.to,i)))}let ea=o.Py.define(),el=o.Py.define(),eh=o.Py.define(),ec=o.QQ.define({create:()=>new LintState(a.p.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),i=null,r=e.panel;if(e.selected){let r=t.changes.mapPos(e.selected.from,1);i=findDiagnostic(n,e.selected.diagnostic,r)||findDiagnostic(n,null,r)}!n.size&&r&&t.state.facet(ef).autoPanel&&(r=null),e=new LintState(n,r,i)}for(let n of t.effects)if(n.is(ea)){let i=t.state.facet(ef).autoPanel?n.value.length?LintPanel.open:null:e.panel;e=LintState.init(n.value,i,t.state)}else n.is(el)?e=new LintState(e.diagnostics,n.value?LintPanel.open:null,e.selected):n.is(eh)&&(e=new LintState(e.diagnostics,e.panel,n.value));return e},provide:e=>[a.mH.from(e,e=>e.panel),a.tk.decorations.from(e,e=>e.diagnostics)]}),eu=a.p.mark({class:"cm-lintRange cm-lintRange-active",inclusive:!0}),closeLintPanel=e=>{let t=e.state.field(ec,!1);return!!t&&!!t.panel&&(e.dispatch({effects:el.of(!1)}),!0)},ed=[{key:"Mod-Shift-m",run:e=>{var t,n;let i=e.state.field(ec,!1);i&&i.panel||e.dispatch({effects:(t=e.state,n=[el.of(!0)],t.field(ec,!1)?n:n.concat(o.Py.appendConfig.of(eg)))});let r=(0,a.Sd)(e,LintPanel.open);return r&&r.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(ec,!1);if(!t)return!1;let n=e.state.selection.main,i=t.diagnostics.iter(n.to+1);return(!!i.value||!!(i=t.diagnostics.iter(0)).value&&(i.from!=n.from||i.to!=n.to))&&(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)}}],ef=o.r$.define({combine:e=>Object.assign({sources:e.map(e=>e.source).filter(e=>null!=e)},(0,o.BO)(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))});function assignKeys(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;e<n.length;e++){let i=n[e];if(/[a-zA-Z]/.test(i)&&!t.some(e=>e.toLowerCase()==i.toLowerCase())){t.push(i);continue e}}t.push("")}return t}function renderDiagnostic(e,t,n){var i;let r=n?assignKeys(t.actions):[];return crelt("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},crelt("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null===(i=t.actions)||void 0===i?void 0:i.map((n,i)=>{let s=!1,click=i=>{if(i.preventDefault(),s)return;s=!0;let r=findDiagnostic(e.state.field(ec).diagnostics,t);r&&n.apply(e,r.from,r.to)},{name:o}=n,a=r[i]?o.indexOf(r[i]):-1,l=a<0?o:[o.slice(0,a),crelt("u",o.slice(a,a+1)),o.slice(a+1)];return crelt("button",{type:"button",class:"cm-diagnosticAction",onclick:click,onmousedown:click,"aria-label":` Action: ${o}${a<0?"":` (access key "${r[i]})"`}.`},l)}),t.source&&crelt("div",{class:"cm-diagnosticSource"},t.source))}let DiagnosticWidget=class DiagnosticWidget extends a.l9{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return crelt("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}};let PanelItem=class PanelItem{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=renderDiagnostic(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}};let LintPanel=class LintPanel{constructor(e){this.view=e,this.items=[],this.list=crelt("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(27==t.keyCode)closeLintPanel(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65)||!(t.keyCode<=90)||!(this.selectedIndex>=0))return;let{diagnostic:n}=this.items[this.selectedIndex],i=assignKeys(n.actions);for(let r=0;r<i.length;
1r++)if(i[r].toUpperCase().charCodeAt(0)==t.keyCode){let t=findDiagnostic(this.view.state.field(ec).diagnostics,n);t&&n.actions[r].apply(e,t.from,t.to)}}t.preventDefault()},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=crelt("div",{class:"cm-panel-lint"},this.list,crelt("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>closeLintPanel(this.view)},"\xd7")),this.update()}get selectedIndex(){let e=this.view.state.field(ec).selected;if(!e)return -1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return -1}update(){let{diagnostics:e,selected:t}=this.view.state.field(ec),n=0,i=!1,r=null;for(e.between(0,this.view.state.doc.length,(e,s,{spec:o})=>{let a=-1,l;for(let e=n;e<this.items.length;e++)if(this.items[e].diagnostic==o.diagnostic){a=e;break}a<0?(l=new PanelItem(this.view,o.diagnostic),this.items.splice(n,0,l),i=!0):(l=this.items[a],a>n&&(this.items.splice(n,a-n),i=!0)),t&&l.diagnostic==t.diagnostic?l.dom.hasAttribute("aria-selected")||(l.dom.setAttribute("aria-selected","true"),r=l):l.dom.hasAttribute("aria-selected")&&l.dom.removeAttribute("aria-selected"),n++});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();0==this.items.length&&(this.items.push(new PanelItem(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function rm(){let t=e;e=t.nextSibling,t.remove()}for(let t of this.items)if(t.dom.parentNode==this.list){for(;e!=t.dom;)rm();e=t.dom.nextSibling}else this.list.insertBefore(t.dom,e);for(;e;)rm()}moveSelection(e){if(this.selectedIndex<0)return;let t=findDiagnostic(this.view.state.field(ec).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:eh.of(t)})}static open(e){return new LintPanel(e)}};function underline(e){return function(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}let ep=a.tk.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:underline("#d11")},".cm-lintRange-warning":{backgroundImage:underline("orange")},".cm-lintRange-info":{backgroundImage:underline("#999")},".cm-lintRange-hint":{backgroundImage:underline("#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}}});a.SJ;let eO=o.Py.define(),eg=[ec,a.tk.decorations.compute([ec],e=>{let{selected:t,panel:n}=e.field(ec);return t&&n&&t.from!=t.to?a.p.set([eu.range(t.from,t.to)]):a.p.none}),(0,a.bF)(function(e,t,n){let{diagnostics:i}=e.state.field(ec),r=[],s=2e8,o=0;i.between(t-(n<0?1:0),t+(n>0?1:0),(e,i,{spec:a})=>{t>=e&&t<=i&&(e==i||(t>e||n>0)&&(t<i||n<0))&&(r.push(a.diagnostic),s=Math.min(e,s),o=Math.max(i,o))});let a=e.state.facet(ef).tooltipFilter;return(a&&(r=a(r,e.state)),r.length)?{pos:s,end:o,above:e.state.doc.lineAt(s).to<o,create:()=>{var t;return{dom:(t=e,crelt("ul",{class:"cm-tooltip-lint"},r.map(e=>renderDiagnostic(t,e,!1))))}}}:null},{hideOn:hideTooltip}),ep];var basicSetup=function(e){void 0===e&&(e={});var t,{crosshairCursor:n=!1}=e,i=[];!1!==e.closeBracketsKeymap&&(i=i.concat(eo.GA)),!1!==e.defaultKeymap&&(i=i.concat(R)),!1!==e.searchKeymap&&(i=i.concat(en)),!1!==e.historyKeymap&&(i=i.concat(Q)),!1!==e.foldKeymap&&(i=i.concat(l.e7)),!1!==e.completionKeymap&&(i=i.concat(eo.B1)),!1!==e.lintKeymap&&(i=i.concat(ed));var r=[];if(!1!==e.lineNumbers&&r.push((0,a.Eu)()),!1!==e.highlightActiveLineGutter&&r.push((0,a.HQ)()),!1!==e.highlightSpecialChars&&r.push((0,a.AE)()),!1!==e.history&&r.push(function(e={}){return[m,g.of(e),a.tk.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?S:"historyRedo"==e.inputType?y:null;return!!n&&(e.preventDefault(),n(t))}})]}()),!1!==e.foldGutter&&r.push((0,l.mi)()),!1!==e.drawSelection&&r.push((0,a.Uw)()),!1!==e.dropCursor&&r.push((0,a.qr)()),!1!==e.allowMultipleSelections&&r.push(o.yy.allowMultipleSelections.of(!0)),!1!==e.indentOnInput&&r.push((0,l.nY)()),!1!==e.syntaxHighlighting&&r.push((0,l.nF)(l.R_,{fallback:!0})),!1!==e.bracketMatching&&r.push((0,l.n$)()),!1!==e.closeBrackets&&r.push((0,eo.vQ)()),!1!==e.autocompletion&&r.push((0,eo.ys)()),!1!==e.rectangularSelection&&r.push((0,a.Zs)()),!1!==n&&r.push((0,a.S2)()),!1!==e.highlightActiveLine&&r.push((0,a.ZO)()),!1!==e.highlightSelectionMatches){let e;r.push((e=[U,L],t&&e.push(X.of(t)),e))}return e.tabSize&&"number"==typeof e.tabSize&&r.push(l.c.of(" ".repeat(e.tabSize))),r.concat([a.$f.of(i.flat())]).filter(
1Boolean)},em=n(35524);let eS="#e06c75",ey="#abb2bf",ek="#7d8799",ev="#d19a66",ex="#2c313a",eT="#282c34",eQ="#353a42",eb="#528bff",ew=a.tk.theme({"&":{color:ey,backgroundColor:eT},".cm-content":{caretColor:eb},".cm-cursor, .cm-dropCursor":{borderLeftColor:eb},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:ey},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:eT,color:ek,border:"none"},".cm-activeLineGutter":{backgroundColor:ex},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:eQ},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:eQ,borderBottomColor:eQ},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:ex,color:ey}}},{dark:!0}
1),eP=l.Qf.define([{tag:em.pJ.keyword,color:"#c678dd"},{tag:[em.pJ.name,em.pJ.deleted,em.pJ.character,em.pJ.propertyName,em.pJ.macroName],color:eS},{tag:[em.pJ.function(em.pJ.variableName),em.pJ.labelName],color:"#61afef"},{tag:[em.pJ.color,em.pJ.constant(em.pJ.name),em.pJ.standard(em.pJ.name)],color:ev},{tag:[em.pJ.definition(em.pJ.name),em.pJ.separator],color:ey},{tag:[em.pJ.typeName,em.pJ.className,em.pJ.number,em.pJ.changed,em.pJ.annotation,em.pJ.modifier,em.pJ.self,em.pJ.namespace],color:"#e5c07b"},{tag:[em.pJ.operator,em.pJ.operatorKeyword,em.pJ.url,em.pJ.escape,em.pJ.regexp,em.pJ.link,em.pJ.special(em.pJ.string)],color:"#56b6c2"},{tag:[em.pJ.meta,em.pJ.comment],color:ek},{tag:em.pJ.strong,fontWeight:"bold"},{tag:em.pJ.emphasis,fontStyle:"italic"},{tag:em.pJ.strikethrough,textDecoration:"line-through"},{tag:em.pJ.link,color:ek,textDecoration:"underline"},{tag:em.pJ.heading,fontWeight:"bold",color:eS},{tag:[em.pJ.atom,em.pJ.bool,em.pJ.special(em.pJ.variableName)],color:ev},{tag:[em.pJ.processingInstruction,em.pJ.string,em.pJ.inserted],color:"#98c379"},{tag:em.pJ.invalid,color:"#ffffff"}]),eC=[ew,(0,l.nF)(eP)];var eR=a.tk.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),getDefaultExtensions=function(e){void 0===e&&(e={});var{indentWithTab:t=!0,editable:n=!0,readOnly:i=!1,theme:r="light",placeholder:s="",basicSetup:l=!0}=e,h=[];switch(t&&h.unshift(a.$f.of([q])),l&&("boolean"==typeof l?h.unshift(basicSetup()):h.unshift(basicSetup(l))),s&&h.unshift((0,a.W$)(s)),r){case"light":h.push(eR);break;case"dark":h.push(eC);break;case"none":break;default:h.push(r)}return!1===n&&h.push(a.tk.editable.of(!1)),i&&h.push(o.yy.readOnly.of(!0)),[...h]},getStatistics=e=>({line:e.state.doc.lineAt(e.state.selection.main.from),lineCount:e.state.doc.lines,lineBreak:e.state.lineBreak,length:e.state.doc.length,readOnly:e.state.readOnly,tabSize:e.state.tabSize,selection:e.state.selection,selectionAsSingle:e.state.selection.asSingle().main,ranges:e.state.selection.ranges,selectionCode:e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to),selections:e.state.selection.ranges.map(t=>e.state.sliceDoc(t.from,t.to)),selectedText:e.state.selection.ranges.some(e=>!e.empty)}),eq=o.q6.define(),eA=[],e$=n(85893),eE=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],ez=(0,s.forwardRef)((e,t)=>{var{className:n,value:l="",selection:h,extensions:c=[],onChange:u,onStatistics:d,onCreateEditor:f,onUpdate:p,autoFocus:O,theme:g="light",height:m,minHeight:S,maxHeight:y,width:k,minWidth:v,maxWidth:x,basicSetup:T,placeholder:Q,indentWithTab:b,editable:w,readOnly:P,root:C,initialState:R}=e,q=(0,r.Z)(e,eE),A=(0,s.useRef)(null),{state:$,view:E,container:z}=function(e){var{value:t,selection:n,onChange:i,onStatistics:r,onCreateEditor:l,onUpdate:h,extensions:c=eA,autoFocus:u,theme:d="light",height:f=null,minHeight:p=null,maxHeight:O=null,width:g=null,minWidth:m=null,maxWidth:S=null,placeholder:y="",editable:k=!0,readOnly:v=!1,indentWithTab:x=!0,basicSetup:T=!0,root:Q,initialState:b}=e,[w,P]=(0,s.useState)(),[C,R]=(0,s.useState)(),[q,A]=(0,s.useState)(),$=a.tk.theme({"&":{height:f,minHeight:p,maxHeight:O,width:g,minWidth:m,maxWidth:S},"& .cm-scroller":{height:"100% !important"}}),E=[a.tk.updateListener.of(e=>{e.docChanged&&"function"==typeof i&&!e.transactions.some(e=>e.annotation(eq))&&i(e.state.doc.toString(),e),r&&r(getStatistics(e))}),$,...getDefaultExtensions({theme:d,editable:k,readOnly:v,placeholder:y,indentWithTab:x,basicSetup:T})];return h&&"function"==typeof h&&E.push(a.tk.updateListener.of(h)),E=E.concat(c),(0,s.useEffect)(()=>{if(w&&!q){var e={doc:t,selection:n,extensions:E},i=b?o.yy.fromJSON(b.json,e,b.fields):o.yy.create(e);if(A(i),!C){var r=new a.tk({state:i,parent:w,root:Q});R(r),l&&l(r,i)}}return()=>{C&&(A(void 0),R(void 0))}},[w,q]),(0,s.useEffect)(()=>P(e.container),[e.container]),(0,s.useEffect)(()=>()=>{C&&(C.destroy(),R(void 0))},[C]),(0,s.useEffect)(()=>{u&&C&&C.focus()},[u,C]),(0,s.useEffect)(()=>{C&&C.dispatch({effects:o.Py.reconfigure.of(E)})},[d,c,f,p,O,g,m,S,y,k,v,x,T,i,h]),(0,s.useEffect)(()=>
1{if(void 0!==t){var e=C?C.state.doc.toString():"";C&&t!==e&&C.dispatch({changes:{from:0,to:e.length,insert:t||""},annotations:[eq.of(!0)]})}},[t,C]),{state:q,setState:A,view:C,setView:R,container:w,setContainer:P}}({container:A.current,root:C,value:l,autoFocus:O,theme:g,height:m,minHeight:S,maxHeight:y,width:k,minWidth:v,maxWidth:x,basicSetup:T,placeholder:Q,indentWithTab:b,editable:w,readOnly:P,selection:h,onChange:u,onStatistics:d,onCreateEditor:f,onUpdate:p,extensions:c,initialState:R});if((0,s.useImperativeHandle)(t,()=>({editor:A.current,state:$,view:E}),[A,z,$,E]),"string"!=typeof l)throw Error("value must be typeof string but got "+typeof l);var W="string"==typeof g?"cm-theme-"+g:"cm-theme";return(0,e$.jsx)("div",(0,i.Z)({ref:A,className:""+W+(n?" "+n:"")},q))});ez.displayName="CodeMirror";var eW=ez},34155:function(e){var t,n,i,r=e.exports={};function defaultSetTimout(){throw Error("setTimeout has not been defined")}function defaultClearTimeout(){throw Error("clearTimeout has not been defined")}function runTimeout(e){if(t===setTimeout)return setTimeout(e,0);if((t===defaultSetTimout||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:defaultSetTimout}catch(e){t=defaultSetTimout}try{n="function"==typeof clearTimeout?clearTimeout:defaultClearTimeout}catch(e){n=defaultClearTimeout}}();var s=[],o=!1,a=-1;function cleanUpNextTick(){o&&i&&(o=!1,i.length?s=i.concat(s):a=-1,s.length&&drainQueue())}function drainQueue(){if(!o){var e=runTimeout(cleanUpNextTick);o=!0;for(var t=s.length;t;){for(i=s,s=[];++a<t;)i&&i[a].run();a=-1,t=s.length}i=null,o=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===defaultClearTimeout||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function Item(e,t){this.fun=e,this.array=t}function noop(){}r.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];s.push(new Item(e,t)),1!==s.length||o||runTimeout(drainQueue)},Item.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=noop,r.addListener=noop,r.once=noop,r.off=noop,r.removeListener=noop,r.removeAllListeners=noop,r.emit=noop,r.prependListener=noop,r.prependOnceListener=noop,r.listeners=function(e){return[]},r.binding=function(e){throw Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw Error("process.chdir is not supported")},r.umask=function(){return 0}},87462:function(e,t,n){"use strict";function _extends(){return(_extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}n.d(t,{Z:function(){return _extends}})},63366:function(e,t,n){"use strict";function _objectWithoutPropertiesLoose(e,t){if(null==e)return{};var n,i,r={},s=Object.keys(e);for(i=0;i<s.length;i++)n=s[i],t.indexOf(n)>=0||(r[n]=e[n]);return r}n.d(t,{Z:function(){return _objectWithoutPropertiesLoose}})},34790:function(e,t,n){"use strict";n.d(t,{B1:function(){return X},GA:function(){return _},Gn:function(){return snippetCompletion},Mb:function(){return completeFromList},eC:function(){return ifNotIn},vQ:function(){return closeBrackets},ys:function(){return autocompletion}});var i=n(78120),r=n(47421),s=n(59119);let CompletionContext=class CompletionContext{constructor(e,t,n){this.state=e,this.pos=t,this.explicit=n,this.abortListeners=[]}tokenBefore(e){let t=(0,s.qz)(this.state).resolveInner(this.pos,-1);for(;t&&0>e.indexOf(t.name);)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),i=t.text.slice(n-t.from,this.pos-t.from),r=i.search(ensureAnchor(e,!1));return r<0?null:{from:n+r,to:this.pos,text:i.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t){"abort"==e&&this.abortListeners&&this.abortListeners.push(t)}};function toSet(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function completeFromList(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,i]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:i}of e){t[i[0]]=!0;for(let e=1;e<i.length;e++)n[i[e]]=!0}let i=toSet(t)+toSet(n)+"*$";return[RegExp("^"+i),new RegExp(i)]}(t);return e=>{let r=e.matchBefore(i);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:n}:null}}function ifNotIn(e,t){return n=>{for(let t=(0,s.qz)(n.state).resolveInner(n.pos,-1);t;t=t.parent){if(e.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return t(n)}}let Option=class Option{constructor(e,t,n,i){this.completion=e,this.source=t,this.match=n,this.score=i}};function cur(e){return e.selection.main.from}function ensureAnchor(e,t){var n;let{source:i}=e,r=t&&"^"!=i[0],s="$"!=i[i.length-1];return r||s?RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}let o=i.q6.define(),a=new WeakMap;function asSource(e){if(!Array.isArray(e))return e;let t=a.get(e);return t||a.set(e,t=completeFromList(e)),t}let l=i.Py.define(),h=i.Py.define();let FuzzyMatcher=class FuzzyMatcher{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=(0,i.gm)(e,t),r=(0,i.nZ)(n);this.chars.push(n);let s=e.slice(t,t+r),o=s.toUpperCase();this.folded.push((0,i.gm)(o==s?s.toLowerCase():o,0)),t+=r}
1this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(0==this.pattern.length)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:r,precise:s,byWord:o}=this;if(1==t.length){let r=(0,i.gm)(e,0),s=(0,i.nZ)(r),o=s==e.length?0:-100;if(r==t[0]);else{if(r!=n[0])return null;o+=-200}return this.ret(o,[0,s])}let a=e.indexOf(this.pattern);if(0==a)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=t.length,h=0;if(a<0){for(let s=0,o=Math.min(e.length,200);s<o&&h<l;){let o=(0,i.gm)(e,s);(o==t[h]||o==n[h])&&(r[h++]=s),s+=(0,i.nZ)(o)}if(h<l)return null}let c=0,u=0,d=!1,f=0,p=-1,O=-1,g=/[a-z]/.test(e),m=!0;for(let r=0,h=Math.min(e.length,200),S=0;r<h&&u<l;){let h=(0,i.gm)(e,r);a<0&&(c<l&&h==t[c]&&(s[c++]=r),f<l&&(h==t[f]||h==n[f]?(0==f&&(p=r),O=r+1,f++):f=0));let y,k=h<255?h>=48&&h<=57||h>=97&&h<=122?2:h>=65&&h<=90?1:0:(y=(0,i.bg)(h))!=y.toLowerCase()?1:y!=y.toUpperCase()?2:0;(!r||1==k&&g||0==S&&0!=k)&&(t[u]==h||n[u]==h&&(d=!0)?o[u++]=r:o.length&&(m=!1)),S=k,r+=(0,i.nZ)(h)}return u==l&&0==o[0]&&m?this.result(-100+(d?-200:0),o,e):f==l&&0==p?this.ret(-200-e.length+(O==e.length?0:-100),[0,O]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):f==l?this.ret(-900-e.length,[p,O]):u==l?this.result(-100+(d?-200:0)+-700+(m?0:-1100),o,e):2==t.length?null:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,n){let r=[],s=0;for(let e of t){let t=e+(this.astral?(0,i.nZ)((0,i.gm)(n,e)):1);s&&r[s-1]==e?r[s-1]=t:(r[s++]=e,r[s++]=t)}return this.ret(e-n.length,r)}};let StrictMatcher=class StrictMatcher{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return null==n?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}};let c=i.r$.define({combine:e=>(0,i.BO)(e,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:defaultPositionInfo,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>joinClass(e(n),t(n)),optionClass:(e,t)=>n=>joinClass(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})});function joinClass(e,t){return e?t?e+" "+t:e:t}function defaultPositionInfo(e,t,n,i,s,o){let a=e.textDirection==r.Nm.RTL,l=a,h=!1,c="top",u,d,f=t.left-s.left,p=s.right-t.right,O=i.right-i.left,g=i.bottom-i.top;if(l&&f<Math.min(O,p)?l=!1:!l&&p<Math.min(O,f)&&(l=!0),O<=(l?f:p))u=Math.max(s.top,Math.min(n.top,s.bottom-g))-t.top,d=Math.min(400,l?f:p);else{h=!0,d=Math.min(400,(a?t.right:s.right-t.left)-30);let e=s.bottom-t.bottom;e>=g||e>t.top?u=n.bottom-t.top:(c="bottom",u=t.bottom-n.top)}let m=(t.bottom-t.top)/o.offsetHeight,S=(t.right-t.left)/o.offsetWidth;return{style:`${c}: ${u/m}px; max-width: ${d/S}px`,class:"cm-completionInfo-"+(h?a?"left-narrow":"right-narrow":l?"left":"right")}}function rangeAroundSelected(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let i=Math.floor((e-t)/n);return{from:e-(i+1)*n,to:e-i*n}}let CompletionTooltip=class CompletionTooltip{constructor(e,t,n){let i;this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:s,selected:o}=r.open,a=e.state.facet(c);this.optionContent=(i=a.addToOptions.slice(),a.icons&&i.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map(e=>"cm-completionIcon-"+e)),t.setAttribute("aria-hidden","true"),t},position:20}),i.push({render(e,t,n,i){let r=document.createElement("span");
1r.className="cm-completionLabel";let s=e.displayLabel||e.label,o=0;for(let e=0;e<i.length;){let t=i[e++],n=i[e++];t>o&&r.appendChild(document.createTextNode(s.slice(o,t)));let a=r.appendChild(document.createElement("span"));a.appendChild(document.createTextNode(s.slice(t,n))),a.className="cm-completionMatchedText",o=n}return o<s.length&&r.appendChild(document.createTextNode(s.slice(o))),r},position:50},{render(e){if(!e.detail)return null;let t=document.createElement("span");return t.className="cm-completionDetail",t.textContent=e.detail,t},position:80}),i.sort((e,t)=>e.position-t.position).map(e=>e.render)),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=rangeAroundSelected(s.length,o,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",n=>{let{options:i}=e.state.field(t).open;for(let t=n.target,r;t&&t!=this.dom;t=t.parentNode)if("LI"==t.nodeName&&(r=/-(\d+)$/.exec(t.id))&&+r[1]<i.length){this.applyCompletion(e,i[+r[1]]),n.preventDefault();return}}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(c).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:h.of(null)})}),this.showOptions(s,r.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=i){let{options:r,selected:s,disabled:o}=n.open;i.open&&i.open.options==r||(this.range=rangeAroundSelected(r.length,s,e.state.facet(c).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),o!=(null===(t=i.open)||void 0===t?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=rangeAroundSelected(t.options.length,t.selected,this.view.state.facet(c).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();
1let{completion:n}=t.options[t.selected],{info:i}=n;if(!i)return;let s="string"==typeof i?document.createTextNode(i):i(n);if(!s)return;"then"in s?s.then(t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,n)}).catch(e=>(0,r.OO)(this.view.state,e,"completion info")):this.addInfoPane(s,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:i}=e;n.appendChild(t),this.infoDestroy=i||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){var t,n;let i,r,s,o=null;for(let t=this.list.firstChild,n=this.range.from;t;t=t.nextSibling,n++)"LI"==t.nodeName&&t.id?n==e?t.hasAttribute("aria-selected")||(t.setAttribute("aria-selected","true"),o=t):t.hasAttribute("aria-selected")&&t.removeAttribute("aria-selected"):n--;return o&&(t=this.list,n=o,i=t.getBoundingClientRect(),r=n.getBoundingClientRect(),s=i.height/t.offsetHeight,r.top<i.top?t.scrollTop-=(i.top-r.top)/s:r.bottom>i.bottom&&(t.scrollTop+=(r.bottom-i.bottom)/s)),o}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),r=this.space;if(!r){let e=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:e.innerWidth,bottom:e.innerHeight}}return i.top>Math.min(r.bottom,t.bottom)-10||i.bottom<Math.max(r.top,t.top)+10?null:this.view.state.facet(c).positionInfo(this.view,t,i,n,r,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){let i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions"));let r=null;for(let s=n.from;s<n.to;s++){let{completion:o,match:a}=e[s],{section:l}=o;if(l){let e="string"==typeof l?l:l.name;e!=r&&(s>n.from||0==n.from)&&(r=e,"string"!=typeof l&&l.header?i.appendChild(l.header(l)):i.appendChild(document.createElement("completion-section")).textContent=e)}let h=i.appendChild(document.createElement("li"));h.id=t+"-"+s,h.setAttribute("role","option");let c=this.optionClass(o);for(let e of(c&&(h.className=c),this.optionContent)){let t=e(o,this.view.state,this.view,a);t&&h.appendChild(t)}}return n.from&&i.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}};function score(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}let CompletionDialog=class CompletionDialog{constructor(e,t,n,i,r,s){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=i,this.selected=r,this.disabled=s}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new CompletionDialog(this.options,makeAttrs(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,i,r){let s=function(e,t){let n=[],i=null,addOption=e=>{n.push(e);let{section:t}=e.completion;if(t){i||(i=[]);let e="string"==typeof t?t:t.name;i.some(t=>t.name==e)||i.push("string"==typeof t?{name:e}:t)}},r=t.facet(c);for(let i of e)if(i.hasResult()){let e=i.result.getMatch;if(!1===i.result.filter)for(let t of i.result.options)addOption(new Option(t,i.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(i.from,i.to),s,o=r.filterStrict?new StrictMatcher(n):new FuzzyMatcher(n);for(let t of i.result.options)if(s=o.match(t.label)){let n=t.displayLabel?e?e(t,s.matched):[]:s.matched;addOption(new Option(t,i.source,n,s.score+(t.boost||0)))}}}if(i){let e=Object.create(null),t=0;for(let n of i.sort((e,t)=>{var n,i;return(null!==(n=e.rank)&&void 0!==n?n:1e9)-(null!==(i=t.rank)&&void 0!==i?i:1e9)||(e.name<t.name?-1:1)}))t-=1e5,e[n.name]=t;for(let t of n){let{section:n}=t.completion;n&&(t.score+=e["string"==typeof n?n:n.name])}}let s=[],o=null,a=r.compareCompletions;for(let e of n.sort((e,t)=>
1t.score-e.score||a(e.completion,t.completion))){let t=e.completion;o&&o.label==t.label&&o.detail==t.detail&&(null==o.type||null==t.type||o.type==t.type)&&o.apply==t.apply&&o.boost==t.boost?score(e.completion)>score(o)&&(s[s.length-1]=e):s.push(e),o=e.completion}return s}(e,t);if(!s.length)return i&&e.some(e=>1==e.state)?new CompletionDialog(i.options,i.attrs,i.tooltip,i.timestamp,i.selected,!0):null;let o=t.facet(c).selectOnOpen?0:-1;if(i&&i.selected!=o&&-1!=i.selected){let e=i.options[i.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){o=t;break}}return new CompletionDialog(s,makeAttrs(n,o),{pos:e.reduce((e,t)=>t.hasResult()?Math.min(e,t.from):e,1e8),create:createTooltip,above:r.aboveCursor},i?i.timestamp:Date.now(),o,!1)}map(e){return new CompletionDialog(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}};let CompletionState=class CompletionState{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new CompletionState(d,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(c),i=(n.override||t.languageDataAt("autocomplete",cur(t)).map(asSource)).map(t=>(this.active.find(e=>e.source==t)||new ActiveSource(t,this.active.some(e=>0!=e.state)?1:0)).update(e,n));i.length==this.active.length&&i.every((e,t)=>e==this.active[t])&&(i=this.active);let r=this.open;for(let s of(r&&e.docChanged&&(r=r.map(e.changes)),e.selection||i.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,i=0;;){for(;n<e.length&&!e[n].hasResult;)n++;for(;i<t.length&&!t[i].hasResult;)i++;let r=n==e.length,s=i==t.length;if(r||s)return r==s;if(e[n++].result!=t[i++].result)return!1}}(i,this.active)?r=CompletionDialog.build(i,t,this.id,r,n):r&&r.disabled&&!i.some(e=>1==e.state)&&(r=null),!r&&i.every(e=>1!=e.state)&&i.some(e=>e.hasResult())&&(i=i.map(e=>e.hasResult()?new ActiveSource(e.source,0):e)),e.effects))s.is(p)&&(r=r&&r.setSelected(s.value,this.id));return i==this.active&&r==this.open?this:new CompletionState(i,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:u}};let u={"aria-autocomplete":"list"};function makeAttrs(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}let d=[];function getUserEvent(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(o);if(n&&t.activateOnCompletion(n))return"input"}return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}let ActiveSource=class ActiveSource{constructor(e,t,n=-1){this.source=e,this.state=t,this.explicitPos=n}hasResult(){return!1}update(e,t){let n=getUserEvent(e,t),i=this;for(let r of(n?i=i.handleUserEvent(e,n,t):e.docChanged?i=i.handleChange(e):e.selection&&0!=i.state&&(i=new ActiveSource(i.source,0)),e.effects))if(r.is(l))i=new ActiveSource(i.source,1,r.value?cur(e.state):-1);else if(r.is(h))i=new ActiveSource(i.source,0);else if(r.is(f))for(let e of r.value)e.source==i.source&&(i=e);return i}handleUserEvent(e,t,n){return"delete"!=t&&n.activateOnTyping?new ActiveSource(this.source,1):this.map(e.changes)}handleChange(e){return e.changes.touchesRange(cur(e.startState))?new ActiveSource(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new ActiveSource(this.source,this.state,e.mapPos(this.explicitPos))}};let ActiveResult=class ActiveResult extends ActiveSource{constructor(e,t,n,i,r){super(e,2,t),this.result=n,this.from=i,this.to=r}hasResult(){return!0}handleUserEvent(e,t,n){var i;let r=this.result;r.map&&!e.changes.empty&&(r=r.map(r,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=cur(e.state);if((this.explicitPos<0?a<=s:a<this.from)||a>o||!r||"delete"==t&&cur(e.startState)==this.from)return new ActiveSource(this.source,"input"==t&&n.activateOnTyping?1:0);let l=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return!function(e,t,n,i){if(!e)return!1;let r=t.sliceDoc(n,i);
1return"function"==typeof e?e(r,n,i,t):ensureAnchor(e,!0).test(r)}(r.validFor,e.state,s,o)?r.update&&(r=r.update(r,s,o,new CompletionContext(e.state,a,l>=0)))?new ActiveResult(this.source,l,r,r.from,null!==(i=r.to)&&void 0!==i?i:cur(e.state)):new ActiveSource(this.source,1,l):new ActiveResult(this.source,l,r,s,o)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new ActiveSource(this.source,0):this.map(e.changes)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new ActiveResult(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new ActiveSource(this.source,0)}};let f=i.Py.define({map:(e,t)=>e.map(e=>e.map(t))}),p=i.Py.define(),O=i.QQ.define({create:()=>CompletionState.start(),update:(e,t)=>e.update(t),provide:e=>[r.hJ.from(e,e=>e.tooltip),r.tk.contentAttributes.from(e,e=>e.attrs)]});function applyCompletion(e,t){let n=t.completion.apply||t.completion.label,r=e.state.field(O).active.find(e=>e.source==t.source);return r instanceof ActiveResult&&("string"==typeof n?e.dispatch(Object.assign(Object.assign({},function(e,t,n,r){let{main:s}=e.selection,o=n-s.from,a=r-s.from;return Object.assign(Object.assign({},e.changeByRange(l=>l!=s&&n!=r&&e.sliceDoc(l.from+o,l.from+a)!=e.sliceDoc(n,r)?{range:l}:{changes:{from:l.from+o,to:r==s.from?l.to:l.from+a,insert:t},range:i.jT.cursor(l.from+o+t.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}(e.state,n,r.from,r.to)),{annotations:o.of(t.completion)})):n(e,t.completion,r.from,r.to),!0)}let createTooltip=e=>new CompletionTooltip(e,O,applyCompletion);function moveCompletionSelection(e,t="option"){return n=>{let i=n.state.field(O,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<n.state.facet(c).interactionDelay)return!1;let s=1,o;"page"==t&&(o=(0,r.gB)(n,i.open.tooltip))&&(s=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:a}=i.open.options,l=i.open.selected>-1?i.open.selected+s*(e?1:-1):e?0:a-1;return l<0?l="page"==t?0:a-1:l>=a&&(l="page"==t?a-1:0),n.dispatch({effects:p.of(l)}),!0}}let RunningQuery=class RunningQuery{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}};let g=r.lg.fromClass(class{constructor(e){for(let t of(this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0,e.state.field(O).active))1==t.state&&this.startQuery(t)}update(e){let t=e.state.field(O),n=e.state.facet(c);if(!e.selectionSet&&!e.docChanged&&e.startState.field(O)==t)return;let i=e.transactions.some(e=>(e.selection||e.docChanged)&&!getUserEvent(e,n));for(let t=0;t<this.running.length;t++){let n=this.running[t];if(i||n.updates.length+e.transactions.length>50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){(0,r.OO)(this.view.state,e)}n.context.abortListeners=null,this.running.splice(t--,1)}else n.updates.push(...e.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),e.transactions.some(e=>e.effects.some(e=>e.is(l)))&&(this.pendingStart=!0);let s=this.pendingStart?50:n.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(e=>1==e.state&&!this.running.some(t=>t.active.source==e.source))?setTimeout(()=>this.startUpdate(),s):-1,0!=this.composing)for(let t of e.transactions)"input"==getUserEvent(t,n)?this.composing=2:2==this.composing&&t.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:e}=this.view;for(let t of e.field(O).active)1!=t.state||this.running.some(e=>e.active.source==t.source)||this.startQuery(t)}startQuery(e){let{state:t}=this.view,n=cur(t),i=new CompletionContext(t,n,e.explicitPos==n),s=new RunningQuery(e,i);this.running.push(s),Promise.resolve(e.source(i)).then(e=>{s.context.aborted||(s.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:h.of(null)}),(0,r.OO)(this.view.state,e)})}scheduleAccept(){this.running.every(e=>void 0!==e.done)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(c).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(c);for(let i=0;i<this.running.length;i++){let r=this.running[i];if(void 0===r.done)continue;if(this.running.splice(i--,1),r.done){let i=new ActiveResult(r.active.source,r.active.explicitPos,r.done,r.done.from,null!==(e=r.done.to)&&void 0!==e?e:cur(r.updates.length?r.updates[0].startState:this.view.state));for(let e of r.updates)i=i.update(e,n);if(i.hasResult()){t.push(i);continue}}let s=this.view.state.field(O).active.find(e=>e.source==r.active.source);if(s&&1==s.state){if(null==r.done){let e=new ActiveSource(r.active.source,0);for(let t of r.updates)e=e.update(t,n);1!=e.state&&t.push(e)}else this.startQuery(s)}}t.length&&this.view.dispatch({effects:f.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(O,!1);if(t&&t.tooltip&&this.view.state.facet(c).closeOnBlur){let n=t.open&&(0,r.gB)(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:h.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:l.of(!1)}),20),this.composing=0}}}),m="object"==typeof navigator&&/Win/.test(navigator.platform),S=i.Wl.highest(r.tk.domEventHandlers({ke
1ydown(e,t){let n=t.state.field(O,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(m&&e.altKey)||e.metaKey)return!1;let i=n.open.options[n.open.selected],r=n.active.find(e=>e.source==i.source),s=i.completion.commitCharacters||r.result.commitCharacters;return s&&s.indexOf(e.key)>-1&&applyCompletion(t,i),!1}})),y=r.tk.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xb7\xb7\xb7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'\uD835\uDC65'"}},".cm-completionIcon-constant":{"&:after":{content:"'\uD835\uDC36'"}},".cm-completionIcon-type":{"&:after":{content:"'\uD835\uDC61'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\uD83D\uDD11︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});let FieldPos=class FieldPos{constructor(e,t,n,i){this.field=e,this.line=t,this.from=n,this.to=i}};let FieldRange=class FieldRange{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,i.gc.TrackDel),n=e.mapPos(this.to,1,i.gc.TrackDel);return null==t||null==n?null:new FieldRange(this.field,t,n)}};let Snippet=class Snippet{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],i=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let r of this.lines){if(n.length){let n=o,a=/^\t*/.exec(r)[0].length;for(let t=0;t<a;t++)n+=e.facet(s.c);i.push(t+n.length-a),r=n+r.slice(a)}n.push(r),t+=r.length+1}return{text:n,ranges:this.fieldPositions.map(e=>new FieldRange(e.field,i[e.line]+e.from,i[e.line]+e.to))}}static parse(e){let t=[],n=[],i=[],r;for(let s of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(s);){let e=r[1]?+r[1]:null,o=r[2]||r[3]||"",a=-1;for(let n=0;n<t.length;n++)(null!=e?t[n].seq==e:o&&t[n].name==o)&&(a=n);if(a<0){let n=0;for(;n<t.length&&(null==e||null!=t[n].seq&&t[n].seq<e);)n++;for(let r of(t.splice(n,0,{seq:e,name:o}),a=n,i))r.field>=a&&r.field++}i.push(new FieldPos(a,n.length,r.index,r.index+o.length)),s=s.slice(0,r.index)+o+s.slice(r.index+r[0].length)}s=s.replace(/\\([{}])/g,(e,t,r)=>{for(let e of i)e.line==n.length&&e.from>r&&(e.from--,e.to--);return t}),n.push(s)}return new Snippet(n,i)}};let k=r.p.widget({widget:new class extends r.l9{toDOM(){let e=document.createElement("span");
1return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),v=r.p.mark({class:"cm-snippetField"});let ActiveSnippet=class ActiveSnippet{constructor(e,t){this.ranges=e,this.active=t,this.deco=r.p.set(e.map(e=>(e.from==e.to?k:v).range(e.from,e.to)))}map(e){let t=[];for(let n of this.ranges){let i=n.map(e);if(!i)return null;t.push(i)}return new ActiveSnippet(t,this.active)}selectionInsideField(e){return e.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}};let x=i.Py.define({map:(e,t)=>e&&e.map(t)}),T=i.Py.define(),Q=i.QQ.define({create:()=>null,update(e,t){for(let n of t.effects){if(n.is(x))return n.value;if(n.is(T)&&e)return new ActiveSnippet(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>r.tk.decorations.from(e,e=>e?e.deco:r.p.none)});function fieldSelection(e,t){return i.jT.create(e.filter(e=>e.field==t).map(e=>i.jT.range(e.from,e.to)))}function moveField(e){return({state:t,dispatch:n})=>{let i=t.field(Q,!1);if(!i||e<0&&0==i.active)return!1;let r=i.active+e,s=e>0&&!i.ranges.some(t=>t.field==r+e);return n(t.update({selection:fieldSelection(i.ranges,r),effects:x.of(s?null:new ActiveSnippet(i.ranges,r)),scrollIntoView:!0})),!0}}let b=moveField(1),w=moveField(-1),P=[{key:"Tab",run:b,shift:w},{key:"Escape",run:({state:e,dispatch:t})=>!!e.field(Q,!1)&&(t(e.update({effects:x.of(null)})),!0)}],C=i.r$.define({combine:e=>e.length?e[0]:P}),R=i.Wl.highest(r.$f.compute([C],e=>e.facet(C)));function snippetCompletion(e,t){let n;return Object.assign(Object.assign({},t),{apply:(n=Snippet.parse(e),(e,t,r,s)=>{let{text:a,ranges:l}=n.instantiate(e.state,r),h={changes:{from:r,to:s,insert:i.xv.of(a)},scrollIntoView:!0,annotations:t?[o.of(t),i.YW.userEvent.of("input.complete")]:void 0};if(l.length&&(h.selection=fieldSelection(l,0)),l.some(e=>e.field>0)){let t=new ActiveSnippet(l,0),n=h.effects=[x.of(t)];void 0===e.state.field(Q,!1)&&n.push(i.Py.appendConfig.of([Q,R,q,y]))}e.dispatch(e.state.update(h))})})}let q=r.tk.domEventHandlers({mousedown(e,t){let n=t.state.field(Q,!1),i;if(!n||null==(i=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let r=n.ranges.find(e=>e.from<=i&&e.to>=i);return!!r&&r.field!=n.active&&(t.dispatch({selection:fieldSelection(n.ranges,r.field),effects:x.of(n.ranges.some(e=>e.field>r.field)?new ActiveSnippet(n.ranges,r.field):null),scrollIntoView:!0}),!0)}}),A={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},$=i.Py.define({map(e,t){let n=t.mapPos(e,-1,i.gc.TrackAfter);return null==n?void 0:n}}),E=new class extends i.uU{};E.startSide=1,E.endSide=-1;let z=i.QQ.define({create:()=>i.Xs.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is($)&&(e=e.update({add:[E.range(n.value,n.value+1)]}));return e}});function closeBrackets(){return[B,z]}let W="()[]{}<>";function closing(e){for(let t=0;t<W.length;t+=2)if(W.charCodeAt(t)==e)return W.charAt(t+1);return(0,i.bg)(e<128?e:e+1)}function config(e,t){return e.languageDataAt("closeBrackets",t)[0]||A}let I="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),B=r.tk.inputHandler.of((e,t,n,r)=>{if((I?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let o=e.state.selection.main;if(r.length>2||2==r.length&&1==(0,i.nZ)((0,i.gm)(r,0))||t!=o.from||n!=o.to)return!1;let a=function(e,t){let n=config(e,e.selection.main.head),r=n.brackets||A.brackets;for(let o of r){let a=closing((0,i.gm)(o,0));if(t==o)return a==o?function(e,t,n,r){let o=r.stringPrefixes||A.stringPrefixes,a=null,l=e.changeByRange(r=>{if(!r.empty)return{changes:[{insert:t,from:r.from},{insert:t,from:r.to}],effects:$.of(r.to+t.length),range:i.jT.range(r.anchor+t.length,r.head+t.length)};let l=r.head,h=nextChar(e.doc,l),c;if(h==t){if(nodeStart(e,l))return{changes:{insert:t+t,from:l},effects:$.of(l+t.length),range:i.jT.cursor(l+t.length)};if(closedBracketAt(e,l)){let r=n&&e.sliceDoc(l,l+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:l,to:l+r.length,insert:r},range:i.jT.cursor(l+r.length)}}}else if(n&&e.sliceDoc(l-2*t.length,l)==t+t&&(c=canStartStringAt(e,l-2*t.length,o))>-1&&nodeStart(e,c))return{changes:{insert:t+t+t+t,from:l},effects:$.of(l+t.length),range:i.jT.cursor(l+t.length)};else if(e.charCategorizer(l)(h)!=i.D0.Word&&canStartStringAt(e,l,o)>-1&&!function(e,t,n,i){let r=(0,s.qz)(e).resolveInner(t,-1),o=i.reduce((e,t)=>
1Math.max(e,t.length),0);for(let s=0;s<5;s++){let s=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+o)),a=s.indexOf(n);if(!a||a>-1&&i.indexOf(s.slice(0,a))>-1){let t=r.firstChild;for(;t&&t.from==r.from&&t.to-t.from>n.length+a;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let l=r.to==t&&r.parent;if(!l)break;r=l}return!1}(e,l,t,o))return{changes:{insert:t+t,from:l},effects:$.of(l+t.length),range:i.jT.cursor(l+t.length)};return{range:a=r}});return a?null:e.update(l,{scrollIntoView:!0,userEvent:"input.type"})}(e,o,r.indexOf(o+o+o)>-1,n):function(e,t,n,r){let s=null,o=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:$.of(o.to+t.length),range:i.jT.range(o.anchor+t.length,o.head+t.length)};let a=nextChar(e.doc,o.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:t+n,from:o.head},effects:$.of(o.head+t.length),range:i.jT.cursor(o.head+t.length)}:{range:s=o}});return s?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}(e,o,a,n.before||A.before);if(t==a&&closedBracketAt(e,e.selection.main.from))return function(e,t,n){let r=null,s=e.changeByRange(t=>t.empty&&nextChar(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:i.jT.cursor(t.head+n.length)}:r={range:t});return r?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}(e,0,a)}return null}(e.state,r);return!!a&&(e.dispatch(a),!0)}),_=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=config(e,e.selection.main.head).brackets||A.brackets,r=null,s=e.changeByRange(t=>{if(t.empty){var s,o;let r;let a=(s=e.doc,o=t.head,r=s.sliceString(o-2,o),(0,i.nZ)((0,i.gm)(r,0))==r.length?r:r.slice(1));for(let r of n)if(r==a&&nextChar(e.doc,t.head)==closing((0,i.gm)(r,0)))return{changes:{from:t.head-r.length,to:t.head+r.length},range:i.jT.cursor(t.head-r.length)}}return{range:r=t}});return r||t(e.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r}}];function closedBracketAt(e,t){let n=!1;return e.field(z).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function nextChar(e,t){let n=e.sliceString(t,t+2);return n.slice(0,(0,i.nZ)((0,i.gm)(n,0)))}function nodeStart(e,t){let n=(0,s.qz)(e).resolveInner(t+1);return n.parent&&n.from==t}function canStartStringAt(e,t,n){let r=e.charCategorizer(t);if(r(e.sliceDoc(t-1,t))!=i.D0.Word)return t;for(let s of n){let n=t-s.length;if(e.sliceDoc(n,t)==s&&r(e.sliceDoc(n-1,n))!=i.D0.Word)return n}return -1}function autocompletion(e={}){return[S,O,c.of(e),g,D,y]}let X=[{key:"Ctrl-Space",run:e=>!!e.state.field(O,!1)&&(e.dispatch({effects:l.of(!0)}),!0)},{key:"Escape",run:e=>{let t=e.state.field(O,!1);return!!(t&&t.active.some(e=>0!=e.state))&&(e.dispatch({effects:h.of(null)}),!0)}},{key:"ArrowDown",run:moveCompletionSelection(!0)},{key:"ArrowUp",run:moveCompletionSelection(!1)},{key:"PageDown",run:moveCompletionSelection(!0,"page")},{key:"PageUp",run:moveCompletionSelection(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(O,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(c).interactionDelay)&&applyCompletion(e,t.open.options[t.open.selected])}}],D=i.Wl.highest(r.$f.computeN([c],e=>e.facet(c).defaultKeymap?[X]:[]))},75408:function(e,t,n){"use strict";n.d(t,{Vs:function(){return python}});var i=n(41113),r=n(34155);let Stack=class Stack{constructor(e,t,n,i,r,s,o,a,l,h=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=i,this.pos=r,this.score=s,this.buffer=o,this.bufferBase=a,this.curContext=l,this.lookAhead=h,this.parent=c}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let i=e.parser.context;return new Stack(e,[],t,n,n,0,[],0,i?new StackContext(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,i=65535&e,{parser:r}=this.p;this.reducePos<this.pos-25&&this.setLookAhead(this.pos);let s=r.dynamicPrecedence(i);if(s&&(this.score+=s),0==n){this.pushState(r.getGoto(this.state,i,!0),this.reducePos),i<r.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,4,!0),this.reduceContext(i,this.reducePos);return}let o=this.stack.length-(n-1)*3-(262144&e?6:0),a=o?this.stack[o-2]:this.p.ranges[0].from,l=this.reducePos-a;l>=2e3&&!(null===(t=this.p.parser.nodeSet.types[i])||void 0===t?void 0:t.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=l):this.p.lastBigReductionSize<l&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=a,this.p.lastBigReductionSize=l));let h=o?this.stack[o-1]:0,c=this.bufferBase+this.buffer.length-h;if(i<r.minRepeatTerm||131072&e){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,a,e,c+4,!0)}if(262144&e)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,i,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(i,a)}storeNode(e,t,n,i=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this,i=this.buffer.length;if(0==i&&e.parent&&(i=e.bufferBase-e.parent.bufferBase,e=e.parent),i>0&&0==e.buffer[i-4]&&e.buffer[i-1]>-1){if(t==n)return;if(e.buffer[i-2]>=t){e.buffer[i-2]=n;return}}}if(r&&this.pos!=n){let r=this.buffer.length;if(r>0&&0!=this.buffer[r-4])for(;r>0&&this.buffer[r-2]>n;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,i>4&&(i-=4);this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=n,this.buffer[r+3]=i}else this.buffer.push(e,t,n,i)}shift(e,t,n,i){if(131072&e)this.pushState(65535&e,this.pos);else if((262144&e)==0){let{parser:r}=this.p;(i>this.pos||t<=r.maxNode)&&(this.pos=i,r.stateFlag(e,1)||(this.reducePos=i)),this.pushState(e,n),this.shiftContext(t,n),t<=r.maxNode&&this.buffer.push(t,n,i,4)}else this.pos=i,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,i,4)}apply(e,t,n,i){65536&e?this.reduce(e):this.shift(e,t,n,i)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(t,i),this.buffer.push(n,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new Stack(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new SimulatedStack(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if((65536&n)==0)return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let i=0,r;i<t.length;i+=2)(r=t[i+1])!=this.state&&this.p.parser.hasAction(r,e)&&n.push(t[i],r);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let i=t[e+1];n.some((e,t)=>1&t&&e==i)||n.push(t[e],i)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let i=t[e+1];if(i==this.state)continue;let r=this.split();r.pushState(i,this.pos),r.storeNode(0,r.pos,r.pos,4,!0),r.shiftContext(t[e],this.pos),r.reducePos=this.pos,r.score-=200,n.push(r)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((65536&t)==0)return!1;if(!e.validAction(this.state,t)){let n=t>>19,i=65535&t,r=this.stack.length-3*n;
1if(r<0||0>e.getGoto(this.stack[r],i,!1)){let e=this.findForcedReduction();if(null==e)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],explore=(n,i)=>{if(!t.includes(n))return t.push(n),e.allActions(n,t=>{if(393216&t);else if(65536&t){let n=(t>>19)-i;if(n>1){let i=65535&t,r=this.stack.length-3*n;if(r>=0&&e.getGoto(this.stack[r],i,!1)>=0)return n<<19|65536|i}}else{let e=explore(t,i+1);if(null!=e)return e}})};return explore(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||-3!=this.buffer[e])&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||-4!=this.buffer[e])&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new StackContext(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){e>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}};let StackContext=class StackContext{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}};let SimulatedStack=class SimulatedStack{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e>>19;0==t?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(t-1)*3;let n=this.start.p.parser.getGoto(this.stack[this.base-3],65535&e,!0);this.state=n}};let StackBufferCursor=class StackBufferCursor{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new StackBufferCursor(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new StackBufferCursor(this.stack,this.pos,this.index)}};function decodeArray(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let i=0,r=0;i<e.length;){let s=0;for(;;){let t=e.charCodeAt(i++),n=!1;if(126==t){s=65535;break}t>=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,n=!0),s+=r,n)break;s*=46}n?n[r++]=s:n=new t(s)}return n}let CachedToken=class CachedToken{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}};let s=new CachedToken;let InputStream=class InputStream{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=s,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,i=this.rangeIndex,r=this.pos+e;for(;r<n.from;){if(!i)return null;let e=this.ranges[--i];r-=n.from-e.to,n=e}for(;t<0?r>n.to:r>=n.to;){if(i==this.ranges.length-1)return null;let e=this.ranges[++i];r+=e.from-n.to,n=e}return r}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,i;if(t>=0&&t<this.chunk.length)n=this.pos+e,i=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(null==t)return -1;if((n=t)>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),i=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),i}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n<this.token.start)throw RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}
1readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=s,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let i of this.ranges){if(i.from>=t)break;i.to>e&&(n+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return n}};let TokenGroup=class TokenGroup{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;readToken(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};TokenGroup.prototype.contextual=TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1,(class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?decodeArray(e):e}token(e,t){let n=e.pos,i=0;for(;;){let n=e.next<0,r=e.resolveOffset(1,1);if(readToken(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(!n&&i++,null==r)break;e.reset(r,e.token)}i&&(e.reset(n,e.token),e.acceptToken(this.elseToken,i))}}).prototype.contextual=TokenGroup.prototype.fallback=TokenGroup.prototype.extend=!1;let ExternalTokenizer=class ExternalTokenizer{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function readToken(e,t,n,i,r,s){let o=0,a=1<<i,{dialect:l}=n.p.parser;t:for(;(a&e[o])!=0;){let n=e[o+1];for(let i=o+3;i<n;i+=2)if((e[i+1]&a)>0){let n=e[i];if(l.allows(n)&&(-1==t.token.value||t.token.value==n||function(e,t,n,i){let r=findOffset(n,i,t);return r<0||findOffset(n,i,e)<r}(n,t.token.value,r,s))){t.acceptToken(n);break}}let i=t.next,h=0,c=e[o+2];if(t.next<0&&c>h&&65535==e[n+3*c-3]){o=e[n+3*c-1];continue}for(;h<c;){let r=h+c>>1,s=n+r+(r<<1),a=e[s],l=e[s+1]||65536;if(i<a)c=r;else if(i>=l)h=r+1;else{o=e[s+2],t.advance();continue t}}break}}function findOffset(e,t,n){for(let i=t,r;65535!=(r=e[i]);i++)if(r==n)return i-t;return -1}let o=void 0!==r&&r.env&&/\bparse\b/.test(r.env.LOG),a=null;function cutAt(e,t,n){let r=e.cursor(i.vj.IncludeAnonymous);for(r.moveTo(t);;)if(!(n<0?r.childBefore(t):r.childAfter(t)))for(;;){if((n<0?r.to<t:r.from>t)&&!r.type.isError)return n<0?Math.max(0,Math.min(r.to-1,t-25)):Math.min(e.length,Math.max(r.from+1,t+25));if(n<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return n<0?0:e.length}}let FragmentCursor=class FragmentCursor{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?cutAt(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?cutAt(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let n=this.trees[t],r=this.index[t];if(r==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=n.children[r],o=this.start[t]+n.positions[r];if(o>e)return this.nextStart=o,null;if(s instanceof i.mp){if(o==e){if(o<this.safeFrom)return null;let e=o+s.length;if(e<=this.safeTo){let t=s.prop(i.md.lookAhead);if(!t||e+t<this.fragment.to)return s}}this.index[t]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}};let TokenCache=class TokenCache{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new CachedToken)}getActions(e){let t=0,n=null,{parser:i}=e.p,{tokenizers:r}=i,s=i.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,a=0;for(let i=0;i<r.length;i++){if((1<<i&s)==0)continue;let l=r[i],h=this.tokens[i];if((!n||l.fallback)&&((l.contextual||h.start!=e.pos||h.mask!=s||h.context!=o)&&(this.updateCachedToken(h,l,e),h.mask=s,h.context=o),h.lookAhead>h.end+25&&(a=Math.max(h.lookAhead,a)),0!=h.value)){let i=t;if(h.extended>-1&&(t=this.addActions(e,h.extended,h.end,t)),t=this.addActions(e,h.value,h.end,t),!l.extend&&(n=h,t>i))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),n||e.pos!=this.stream.end||((n=new CachedToken).value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new CachedToken,{pos:n,p:i}=e;return t.start=n,t.end=Math.min(n+1,i.stream.end),t.value=n==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,n){let i=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(i,e),n),e.value>-1){let{parser:t}=n.p;for(let i=0;i<t.specialized.length;i++)if(t.specialized[i]==e.value){let r=t.specializers[i](this.stream.read(e.start,e.end),n);if(r>=0&&n.p.parser.dialect.allows(r>>1)){(1&r)==0?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,n,i){for(let t=0;t<i;t+=3)if(this.actions[t]==e)return i;return this.actions[i++]=e,this.actions[i++]=t,this.actions[i++]=n,i}addActions(e,t,n,i){let{state:r}=e,{parser:s}=e.p,{data:o}=s;for(let e=0;e<2;e++)for(let a=s.stateSlot(r,e?2:1);;a+=3){if(65535==o[a]){if(1==o[a+1])a=pair(o,a+2);
1else{0==i&&2==o[a+1]&&(i=this.putAction(pair(o,a+2),t,n,i));break}}o[a]==t&&(i=this.putAction(pair(o,a+1),t,n,i))}return i}};let Parse=class Parse{constructor(e,t,n,i){this.parser=e,this.input=t,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new InputStream(t,i),this.tokens=new TokenCache(e,this.stream),this.topTerm=e.top[1];let{from:r}=i[0];this.stacks=[Stack.start(this,e.top[0],r)],this.fragments=n.length&&this.stream.end-r>4*e.bufferLength?new FragmentCursor(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,i=this.minStackPos,r=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let s=0;s<n.length;s++){let o=n[s];for(;;){if(this.tokens.mainToken=null,o.pos>i)r.push(o);else{if(this.advanceStack(o,r,n))continue;e||(e=[],t=[]),e.push(o);let i=this.tokens.getMainToken(o);t.push(i.value,i.end)}break}}if(!r.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}(e);if(t)return o&&console.log("Finish with "+this.stackID(t)),this.stackToTree(t);if(this.parser.strict)throw o&&e&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),SyntaxError("No parse at "+i);this.recovering||(this.recovering=5)}if(this.recovering&&e){let n=null!=this.stoppedAt&&e[0].pos>this.stoppedAt?e[0]:this.runRecovery(e,t,r);if(n)return o&&console.log("Force-finish "+this.stackID(n)),this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort((e,t)=>t.score-e.score);r.length>e;)r.pop();r.some(e=>e.reducePos>i)&&this.recovering--}
1else if(r.length>1){n:for(let e=0;e<r.length-1;e++){let t=r[e];for(let n=e+1;n<r.length;n++){let i=r[n];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500){if((t.score-i.score||t.buffer.length-i.buffer.length)>0)r.splice(n--,1);else{r.splice(e--,1);continue n}}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let e=1;e<r.length;e++)r[e].pos<this.minStackPos&&(this.minStackPos=r[e].pos);return null}stopAt(e){if(null!=this.stoppedAt&&this.stoppedAt<e)throw RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,n){let r=e.pos,{parser:s}=this,a=o?this.stackID(e)+" -> ":"";if(null!=this.stoppedAt&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let l=this.fragments.nodeAt(r);l;){let r=this.parser.nodeSet.types[l.type.id]==l.type?s.getGoto(e.state,l.type.id):-1;if(r>-1&&l.length&&(!t||(l.prop(i.md.contextHash)||0)==n))return e.useNode(l,r),o&&console.log(a+this.stackID(e)+` (via reuse of ${s.getName(l.type.id)})`),!0;if(!(l instanceof i.mp)||0==l.children.length||l.positions[0]>0)break;let h=l.children[0];if(h instanceof i.mp&&0==l.positions[0])l=h;else break}}let l=s.stateSlot(e.state,4);if(l>0)return e.reduce(l),o&&console.log(a+this.stackID(e)+` (via always-reduce ${s.getName(65535&l)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let h=this.tokens.getActions(e);for(let i=0;i<h.length;){let l=h[i++],c=h[i++],u=h[i++],d=i==h.length||!n,f=d?e:e.split(),p=this.tokens.mainToken;if(f.apply(l,c,p?p.start:f.pos,u),o&&console.log(a+this.stackID(f)+` (via ${(65536&l)==0?"shift":`reduce of ${s.getName(65535&l)}`} for ${s.getName(c)} @ ${r}${f==e?"":", split"})`),d)return!0;f.pos>r?t.push(f):n.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return pushStackDedup(e,t),!0}}runRecovery(e,t,n){let i=null,r=!1;for(let s=0;s<e.length;s++){let a=e[s],l=t[s<<1],h=t[(s<<1)+1],c=o?this.stackID(a)+" -> ":"";if(a.deadEnd&&(r||(r=!0,a.restart(),o&&console.log(c+this.stackID(a)+" (restarted)"),this.advanceFully(a,n))))continue;let u=a.split(),d=c;for(let e=0;u.forceReduce()&&e<10&&(o&&console.log(d+this.stackID(u)+" (via force-reduce)"),!this.advanceFully(u,n));e++)o&&(d=this.stackID(u)+" -> ");for(let e of a.recoverByInsert(l))o&&console.log(c+this.stackID(e)+" (via recover-insert)"),this.advanceFully(e,n);this.stream.end>a.pos?(h==a.pos&&(h++,l=0),a.recoverByDelete(l,h),o&&console.log(c+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),pushStackDedup(a,n)):(!i||i.score<a.score)&&(i=a)}return i}stackToTree(e){return e.close(),i.mp.build({buffer:StackBufferCursor.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(a||(a=new WeakMap)).get(e);return t||a.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function pushStackDedup(e,t){for(let n=0;n<t.length;n++){let i=t[n];if(i.pos==e.pos&&i.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}let Dialect=class Dialect{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||0==this.disabled[e]}};let id=e=>e;let LRParser=class LRParser extends i._b{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push("");let n=Object.keys(e.topRules).map(t=>e.topRules[t][1]),r=[];for(let e=0;e<t.length;e++)r.push([]);function setProp(e,t,n){r[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];"string"==typeof e&&(e=i.md[e]);for(let n=1;n<t.length;){let i=t[n++];if(i>=0)setProp(i,e,t[n++]);else{let r=t[n+-i];for(let s=-i;s>0;s--)setProp(t[n++],e,r);n++}}}this.nodeSet=new i.Lj(t.map((t,s)=>i.Jq.define({name:s>=this.minRepeatTerm?void 0:t,id:s,props:r[s],top:n.indexOf(s)>-1,error:0==s,skipped:e.skippedNodes&&e.skippedNodes.indexOf(s)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=i.L3;let s=decodeArray(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(getSpecializer),this.states=decodeArray(e.states,Uint32Array),this.data=decodeArray(e.stateData),this.goto=decodeArray(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>"number"==typeof e?new TokenGroup(s,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let i=new Parse(this,e,t,n);for(let r of this.wrappers)i=r(i,e,t,n);return i}getGoto(e,t,n=!1){let i=this.goto;if(t>=i[0])return -1;for(let r=i[t+1];;){let t=i[r++],s=1&t,o=i[r++];if(s&&n)return o;for(let n=r+(t>>1);r<n;r++)if(i[r]==e)return o;if(s)return -1}}hasAction(e,t){let n=this.data;for(let i=0;i<2;i++)for(let r=this.stateSlot(e,i?2:1),s;;
1r+=3){if(65535==(s=n[r])){if(1==n[r+1])s=n[r=pair(n,r+2)];else if(2==n[r+1])return pair(n,r+2);else break}if(s==t||0==s)return pair(n,r+1)}return 0}stateSlot(e,t){return this.states[6*e+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t||null)}allActions(e,t){let n=this.stateSlot(e,4),i=n?t(n):void 0;for(let n=this.stateSlot(e,1);null==i;n+=3){if(65535==this.data[n]){if(1==this.data[n+1])n=pair(this.data,n+2);else break}i=t(pair(this.data,n+1))}return i}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1==this.data[n+1])n=pair(this.data,n+2);else break}if((1&this.data[n+2])==0){let e=this.data[n+1];t.some((t,n)=>1&n&&t==e)||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(LRParser.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(t=>{let n=e.tokenizers.find(e=>e.from==t);return n?n.to:t})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,i)=>{let r=e.specializers.find(e=>e.from==n.external);if(!r)return n;let s=Object.assign(Object.assign({},n),{external:r.to});return t.specializers[i]=getSpecializer(s),s})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let i of e.split(" ")){let e=t.indexOf(i);e>=0&&(n[e]=!0)}let i=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],r;65535!=(r=this.data[n++]);)(i||(i=new Uint8Array(this.maxTerm+1)))[r]=1;return new Dialect(e,n,i)}static deserialize(e){return new LRParser(e)}};function pair(e,t){return e[t]|e[t+1]<<16}function getSpecializer(e){if(e.external){let t=e.extend?1:0;return(n,i)=>e.external(n,i)<<1|t}return e.get}var l=n(35524);let h=new Set([25,49,50,263,65,130,56,57,238,62,63,72,73,77,60,61,151,152,155,112]);function isLineBreak(e){return 10==e||13==e}function isHex(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}let c=new ExternalTokenizer((e,t)=>
1{let n;if(e.next<0)e.acceptToken(199);else if(t.context.flags&d)isLineBreak(e.next)&&e.acceptToken(198,1);else if(((n=e.peek(-1))<0||isLineBreak(n))&&t.canShift(197)){let t=0;for(;32==e.next||9==e.next;)e.advance(),t++;(10==e.next||13==e.next||35==e.next)&&e.acceptToken(197,-t)}else isLineBreak(e.next)&&e.acceptToken(196,1)},{contextual:!0}),u=new ExternalTokenizer((e,t)=>{let n=t.context;if(n.flags)return;let i=e.peek(-1);if(10==i||13==i){let t=0,i=0;for(;;){if(32==e.next)t++;else if(9==e.next)t+=8-t%8;else break;e.advance(),i++}t!=n.indent&&10!=e.next&&13!=e.next&&35!=e.next&&(t<n.indent?e.acceptToken(195,-i):e.acceptToken(194))}}),d=1;function Context(e,t,n){this.parent=e,this.indent=t,this.flags=n,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)+n+(n<<6)}let f=new Context(null,0,0),p=new Map([[241,0],[242,4],[243,8],[244,12],[245,16],[246,20],[247,24],[248,28],[249,32],[250,36],[251,40],[252,44],[253,48],[254,52],[255,56],[256,60]].map(([e,t])=>[e,2|t])),O=new class{constructor(e){this.start=e.start,this.shift=e.shift||id,this.reduce=e.reduce||id,this.reuse=e.reuse||id,this.hash=e.hash||(()=>0),this.strict=!1!==e.strict}}({start:f,reduce:(e,t,n,i)=>e.flags&d&&h.has(t)||(71==t||72==t)&&2&e.flags?e.parent:e,shift:(e,t,n,i)=>194==t?new Context(e,function(e){let t=0;for(let n=0;n<e.length;n++)t+=9==e.charCodeAt(n)?8-t%8:1;return t}(i.read(i.pos,n.pos)),0):195==t?e.parent:24==t||55==t||59==t||3==t?new Context(e,0,d):p.has(t)?new Context(e,0,p.get(t)|e.flags&d):e,hash:e=>e.hash}),g=new ExternalTokenizer(e=>{for(let t=0;t<5;t++){if(e.next!="print".charCodeAt(t))return;e.advance()}if(!/\w/.test(String.fromCharCode(e.next)))for(let t=0;;t++){let n=e.peek(t);if(32!=n&&9!=n){40!=n&&46!=n&&10!=n&&13!=n&&35!=n&&e.acceptToken(1);return}}}),m=new ExternalTokenizer((e,t)=>
1{let{flags:n}=t.context,i=4&n?34:39,r=(8&n)>0,s=!(16&n),o=(32&n)>0,a=e.pos;for(;!(e.next<0);)if(o&&123==e.next){if(123==e.peek(1))e.advance(2);else{if(e.pos==a){e.acceptToken(3,1);return}break}}else if(s&&92==e.next){if(e.pos==a){e.advance();let t=e.next;t>=0&&(e.advance(),function(e,t){if(111==t)for(let t=0;t<2&&e.next>=48&&e.next<=55;t++)e.advance();else if(120==t)for(let t=0;t<2&&isHex(e.next);t++)e.advance();else if(117==t)for(let t=0;t<4&&isHex(e.next);t++)e.advance();else if(85==t)for(let t=0;t<8&&isHex(e.next);t++)e.advance();else if(78==t&&123==e.next){for(e.advance();e.next>=0&&125!=e.next&&39!=e.next&&34!=e.next&&10!=e.next;)e.advance();125==e.next&&e.advance()}}(e,t)),e.acceptToken(2);return}break}else if(e.next!=i||r&&(e.peek(1)!=i||e.peek(2)!=i)){if(10==e.next){if(r)e.advance();else if(e.pos==a){e.acceptToken(201);return}break}e.advance()}else{if(e.pos==a){e.acceptToken(201,r?3:1);return}break}e.pos>a&&e.acceptToken(200)}),S=(0,l.Gv)({'async "*" "**" FormatConversion FormatSpec':l.pJ.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":l.pJ.controlKeyword,"in not and or is del":l.pJ.operatorKeyword,"from def class global nonlocal lambda":l.pJ.definitionKeyword,import:l.pJ.moduleKeyword,"with as print":l.pJ.keyword,Boolean:l.pJ.bool,None:l.pJ.null,VariableName:l.pJ.variableName,"CallExpression/VariableName":l.pJ.function(l.pJ.variableName),"FunctionDefinition/VariableName":l.pJ.function(l.pJ.definition(l.pJ.variableName)),"ClassDefinition/VariableName":l.pJ.definition(l.pJ.className),PropertyName:l.pJ.propertyName,"CallExpression/MemberExpression/PropertyName":l.pJ.function(l.pJ.propertyName),Comment:l.pJ.lineComment,Number:l.pJ.number,String:l.pJ.string,FormatString:l.pJ.special(l.pJ.string),Escape:l.pJ.escape,UpdateOp:l.pJ.updateOperator,"ArithOp!":l.pJ.arithmeticOperator,BitOp:l.pJ.bitwiseOperator,CompareOp:l.pJ.compareOperator,AssignOp:l.pJ.definitionOperator,Ellipsis:l.pJ.punctuation,At:l.pJ.meta,"( )":l.pJ.paren,"[ ]":l.pJ.squareBracket,"{ }":l.pJ.brace,".":l.pJ.derefOperator,", ;":l.pJ.separator}),y={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},k=LRParser.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO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!qQ%[!tQ%f0cS'v%Z0hQ'x0eQ'y0fQ,p*rQ-u,qS.i-s/sR0p0rU#uq.k0qR(w&][cOn#g$j)t,PZ!xY#[#}$Q+YQ#W[Q#zrR$TxQ%b!yQ%i!}Q%o#RQ'j${Q(V%eQ(Z%jQ(c%pQ(f%qQ*|(`Q,f*bQ-t,pQ.m-uR/].lQ$StQ(R%cR*s(SQ.l-sR/}/sR#QZR#V[R%Q!iQ%O!iV*c'm*d,g!]!lQ!n#c#p$R$d$p$u$v$w$x$y$z%e%j%p%q&`'O'g(q(|)j*o*x+w,v/q0gR%T!kT#]^#_Q%x#[R,{+YQ(m%xS+_(n(oQ,}+`Q-x,{S.n-y-zR/^.oT+Z(k+]Q$`}Q&g$QQ)o'PR+{)pQ$XzQ)W&qR+i)XQ$XzQ&o$WQ)W&qR+i)XQ#khW$Vz$W&q)XQ$[{Q&r$ZZ)R&l)S+f+g-RR$^|R)c&wXlOn)t,PQ$f!RR'Q$gQ$m!UR'R$hR*X'_Q*V'_V-g,`-h.TQ.d-lQ/P.^R/Q._U.]-l.^._Q/U.aQ/b.tQ/g.zU/i.|/j/yQ/n/RQ/|/oQ0O/tU0Q/u0S0[Q0]0UQ0a0ZR0b0^R/T.`R/d.t",nodeNames:"⚠ print Escape { Comment Script AssignStatement * BinaryExpression BitOp BitOp BitOp BitOp ArithOp ArithOp @ ArithOp ** UnaryExpression ArithOp BitOp AwaitExpression await ) ( ParenthesizedExpression BinaryExpression or and CompareOp in not is UnaryExpression ConditionalExpression if else LambdaExpression lambda ParamList VariableName AssignOp , : NamedExpression AssignOp YieldExpression yield from TupleExpression ComprehensionExpression async for LambdaExpression ] [ ArrayExpression ArrayComprehensionExpression }
1 { DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression CallExpression ArgList AssignOp MemberExpression . PropertyName Number String FormatString FormatReplacement FormatSelfDoc FormatConversion FormatSpec FormatReplacement FormatSelfDoc ContinuedString Ellipsis None Boolean TypeDef AssignOp UpdateStatement UpdateOp ExpressionStatement DeleteStatement del PassStatement pass BreakStatement break ContinueStatement continue ReturnStatement return YieldStatement PrintStatement RaiseStatement raise ImportStatement import as ScopeStatement global nonlocal AssertStatement assert TypeDefinition type TypeParamList TypeParam StatementGroup ; IfStatement Body elif WhileStatement while ForStatement TryStatement try except finally WithStatement with FunctionDefinition def ParamList AssignOp TypeDef ClassDefinition class DecoratedStatement Decorator At MatchStatement match MatchBody MatchClause case CapturePattern LiteralPattern ArithOp ArithOp AsPattern OrPattern LogicOp AttributePattern SequencePattern MappingPattern StarPattern ClassPattern PatternArgList KeywordPattern KeywordPattern Guard",maxTerm:277,context:O,nodeProps:[["isolate",-5,4,71,72,73,77,""],["group",-15,6,85,87,88,90,92,94,96,98,99,100,102,105,108,110,"Statement Statement",-22,8,18,21,25,40,49,50,56,57,60,61,62,63,64,67,70,71,72,79,80,81,82,"Expression",-10,114,116,119,121,122,126,128,133,135,138,"Statement",-9,143,144,147,148,150,151,152,153,154,"Pattern"],["openedBy",23,"(",54,"[",58,"{"],["closedBy",24,")",55,"]",59,"}"]],propSources:[S],skippedNodes:[0,4],repeatNodeCount:34,tokenData:"!2|~R!`OX%TXY%oY[%T[]%o]p%Tpq%oqr'ars)Yst*xtu%Tuv,dvw-hwx.Uxy/tyz0[z{0r{|2S|}2p}!O3W!O!P4_!P!Q:Z!Q!R;k!R![>_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%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!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[g,u,c,m,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:e=>y[e]||-1}],tokenPrec:7652});var v=n(59119),x=n(34790);let T=new i.hr,Q=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function defID(e){return(t,n,i)=>{if(i)return!1;let r=t.node.getChild("VariableName");return r&&n(r,e),!0}}let b={FunctionDefinition:defID("function"),ClassDefinition:defID("class"),ForStatement(e,t,n){if(n){for(let n=e.node.firstChild;n;n=n.nextSibling)if("VariableName"==n.name)t(n,"variable");else if("in"==n.name)break}},ImportStatement(e,t){var n,i;let{node:r}=e,s=(null===(n=r.firstChild)||void 0===n?void 0:n.name)=="from";for(let e=r.getChild("import");e;e=e.nextSibling)"VariableName"==e.name&&(null===(i=e.nextSibling)||void 0===i?void 0:i.name)!="as"&&t(e,s?"variable":"namespace")},AssignStatement(e,t){for(let n=e.node.firstChild;n;n=n.nextSibling)if("VariableName"==n.name)t(n,"variable");else if(":"==n.name||"AssignOp"==n.name)break},ParamList(e,t){for(let n=null,i=e.node.firstChild;i;i=i.nextSibling)"VariableName"!=i.name||n&&/\*|AssignOp/.test(n.name)||t(i,"variable"),n=i},CapturePattern:defID("variable"),AsPattern:defID("variable"),__proto__:null},w=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,P=["String","FormatString","Comment","PropertyName"];function localCompletionSource(e){let t=(0,v.qz)(e.state).resolveInner(e.pos,-1);if(P.indexOf(t.name)>-1)return null;let n="VariableName"==t.name||t.to-t.from<20&&w.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let r=[];for(let n=t;n;n=n.parent)Q.has(n.name)&&(r=r.concat(function getScope(e,t){let n=T.get(t);if(n)return n;let r=[],s=!0;function def(t,n){let i=e.sliceString(t.from,t.to);r.push({label:i,type:n})}
1return t.cursor(i.vj.IncludeAnonymous).iterate(t=>{if(t.name){let e=b[t.name];if(e&&e(t,def,s)||!s&&Q.has(t.name))return!1;s=!1}else if(t.to-t.from>8192){for(let n of getScope(e,t.node))r.push(n);return!1}}),T.set(t,r),r}(e.state.doc,n)));return{options:r,from:n?t.from:e.pos,validFor:w}}let C=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(e=>({label:e,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(e=>({label:e,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(e=>({label:e,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(e=>({label:e,type:"function"}))),R=[(0,x.Gn)("def ${name}(${params}):\n	${}",{label:"def",detail:"function",type:"keyword"}),(0,x.Gn)("for ${name} in ${collection}:\n	${}",{label:"for",detail:"loop",type:"keyword"}),(0,x.Gn)("while ${}:\n	${}",{label:"while",detail:"loop",type:"keyword"}),(0,x.Gn)("try:\n	${}\nexcept ${error}:\n	${}",{label:"try",detail:"/ except block",type:"keyword"}),(0,x.Gn)("if ${}:\n	\n",{label:"if",detail:"block",type:"keyword"}),(0,x.Gn)("if ${}:\n	${}\nelse:\n	${}",{label:"if",detail:"/ else block",type:"keyword"}),(0,x.Gn)("class ${name}:\n	def __init__(self, ${params}):\n			${}",{label:"class",detail:"definition",type:"keyword"}),(0,x.Gn)("import ${module}",{label:"import",detail:"statement",type:"keyword"}),(0,x.Gn)("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],q=(0,x.eC)(P,(0,x.Mb)(C.concat(R)));function innerBody(e){let{node:t,pos:n}=e,i=e.lineIndent(n,-1),r=null;for(;;){let s=t.childBefore(n);if(s){if("Comment"==s.name)n=s.from;else if("Body"==s.name)e.baseIndentFor(s)+e.unit<=i&&(r=s),t=s;else if(s.type.is("Statement"))t=s;else break}else break}return r}function indentBody(e,t){let n=e.baseIndentFor(t),i=e.lineAt(e.pos,-1),r=i.from+i.text.length;return/^\s*($|#)/.test(i.text)&&e.node.to<r+100&&!/\S/.test(e.state.sliceDoc(r,e.node.to))&&e.lineIndent(e.pos,-1)<=n||/^\s*(else:|elif |except |finally:)/.test(e.textAfter)&&e.lineIndent(e.pos,-1)>n?null:n+e.unit}let A=v.qp.define({name:"python",parser:k.configure({props:[v.uj.add({Body:e=>{var t;let n=innerBody(e);return null!==(t=indentBody(e,n||e.node))&&void 0!==t?t:e.continue()},IfStatement:e=>/^\s*(else:|elif )/.test(e.textAfter)?e.baseIndent:e.continue(),"ForStatement WhileStatement":e=>/^\s*else:/.test(e.textAfter)?e.baseIndent:e.continue(),TryStatement:e=>/^\s*(except |finally:|else:)/.test(e.textAfter)?e.baseIndent:e.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":(0,v.vw)({closing:")"}
1),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":(0,v.vw)({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":(0,v.vw)({closing:"]"}),"String FormatString":()=>null,Script:e=>{var t;let n=innerBody(e);return null!==(t=n&&indentBody(e,n))&&void 0!==t?t:e.continue()}}),v.x0.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":v.Dv,Body:(e,t)=>({from:e.from+1,to:e.to-(e.to==t.doc.length?0:1)})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/}});function python(){return new v.ri(A,[A.data.of({autocomplete:localCompletionSource}),A.data.of({autocomplete:q})])}},59119:function(e,t,n){"use strict";n.d(t,{Dv:function(){return foldInside},Gn:function(){return IndentContext},K0:function(){return getIndentation},Qf:function(){return HighlightStyle},R_:function(){return $},SS:function(){return indentString},Um:function(){return matchBrackets},c:function(){return g},e7:function(){return T},mi:function(){return foldGutter},n$:function(){return bracketMatching},nF:function(){return syntaxHighlighting},nY:function(){return indentOnInput},qp:function(){return LRLanguage},qz:function(){return syntaxTree},ri:function(){return LanguageSupport},uj:function(){return m},vw:function(){return delimitedIndent},x0:function(){return y},y1:function(){return getIndentUnit}});var i,r=n(41113),s=n(78120),o=n(47421),a=n(35524),l=n(28699);let h=new r.md,c=new r.md;let Language=class Language{constructor(e,t,n=[],i=""){this.data=e,this.name=i,s.yy.prototype.hasOwnProperty("tree")||Object.defineProperty(s.yy.prototype,"tree",{get(){return syntaxTree(this)}}),this.parser=t,this.extension=[p.of(this),s.yy.languageData.of((e,t,n)=>{let i=topNodeAt(e,t,n),r=i.type.prop(h);if(!r)return[];let s=e.facet(r),o=i.type.prop(c);if(o){let r=i.resolve(t-i.from,n);for(let t of o)if(t.test(r,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(s)}}return s})].concat(n)}isActiveAt(e,t,n=-1){return topNodeAt(e,t,n).type.prop(h)==this.data}findRegions(e){let t=e.facet(p);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],explore=(e,t)=>{if(e.prop(h)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(r.md.mounted);if(i){if(i.tree.prop(h)==this.data){if(i.overlay)for(let e of i.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(i.overlay){let e=n.length;if(explore(i.tree,i.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let i=e.children[n];i instanceof r.mp&&explore(i,e.positions[n]+t)}};return explore(syntaxTree(e),0),n}get allowsNesting(){return!0}};
1function topNodeAt(e,t,n){let i=e.facet(p),s=syntaxTree(e).topNode;if(!i||i.allowsNesting)for(let e=s;e;e=e.enter(t,n,r.vj.ExcludeBuffers))e.type.isTop&&(s=e);return s}Language.setState=s.Py.define();let LRLanguage=class LRLanguage extends Language{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){var t;let n=(t=e.languageData,s.r$.define({combine:t?e=>e.concat(t):void 0}));return new LRLanguage(n,e.parser.configure({props:[h.add(e=>e.isTop?n:void 0)]}),e.name)}configure(e,t){return new LRLanguage(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function syntaxTree(e){let t=e.field(Language.state,!1);return t?t.tree:r.mp.empty}let DocInput=class DocInput{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.str
1ing}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e<n||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}};let u=null;let ParseContext=class ParseContext{constructor(e,t,n=[],i,r,s,o,a){this.parser=e,this.state=t,this.fragments=n,this.tree=i,this.treeLen=r,this.viewport=s,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new ParseContext(e,t,[],r.mp.empty,0,n,[],null)}startParse(){return this.parser.startParse(new DocInput(this.state.doc),this.fragments)}work(e,t){return(null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=r.mp.empty&&this.isDone(null!=t?t:this.state.doc.length))?(this.takeTree(),!0):this.withContext(()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i){if(this.fragments=this.withoutTempSkipped(r.i9.addTree(i,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(n=this.parse.stoppedAt)&&void 0!==n?n:this.state.doc.length,this.tree=i,this.parse=null,!(this.treeLen<(null!=t?t:this.state.doc.length)))return!0;this.parse=this.startParse()}if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((null==this.parse.stoppedAt||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(r.i9.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=u;u=this;try{return e()}finally{u=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=cutFragments(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:i,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,n,i,r)=>t.push({fromA:e,toA:n,fromB:i,toB:r})),n=r.i9.applyChanges(n,t),i=r.mp.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length)for(let t of(a=[],this.skipped)){let n=e.mapPos(t.from,1),i=e.mapPos(t.to,-1);n<i&&a.push({from:n,to:i})}}return new ParseContext(this.parser,t,n,i,s,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let t=0;t<this.skipped.length;t++){let{from:n,to:i}=this.skipped[t];n<e.to&&i>e.from&&(this.fragments=cutFragments(this.fragments,n,i),this.skipped.splice(t--,1))}return!(this.skipped.length>=t)&&(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends r._b{createParse(t,n,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let t=u;if(t){for(let e of i)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new r.mp(r.Jq.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return u}};function cutFragments(e,t,n){return r.i9.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}let LanguageState=class LanguageState{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new LanguageState(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=ParseContext.create(e.facet(p).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new LanguageState(n)}};Language.state=s.QQ.define({create:LanguageState.init,update(e,t){for(let e of t.effects)if(e.is(Language.setState))return e.value;return t.startState.facet(p)!=t.state.facet(p)?LanguageState.init(t.state):e.apply(t)}});let requestIdle=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(requestIdle=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});let d="undefined"!=typeof navigator&&(null===(i=navigator.scheduling)||void 0===i?void 0:i.isInputPending)?()=>navigator.scheduling.isInputPending():null,f=o.lg.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Language.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Language.state);
1t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=requestIdle(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:i}}=this.view,r=n.field(Language.state);if(r.tree==r.context.tree&&r.context.isDone(i+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,e&&!d?Math.max(25,e.timeRemaining()-5):1e9),o=r.context.treeLen<i&&n.doc.length>i+1e3,a=r.context.work(()=>d&&d()||Date.now()>s,i+(o?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Language.setState.of(new LanguageState(r.context))})),this.chunkBudget>0&&!(a&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>(0,o.OO)(this.view.state,e)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),p=s.r$.define({combine:e=>e.length?e[0]:null,enables:e=>[Language.state,f,o.tk.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});let LanguageSupport=class LanguageSupport{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}};let O=s.r$.define(),g=s.r$.define({combine:e=>{if(!e.length)return"  ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function getIndentUnit(e){let t=e.facet(g);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function indentString(e,t){let n="",i=e.tabSize,r=e.facet(g)[0];if("	"==r){for(;t>=i;)n+="	",t-=i;r=" "}for(let e=0;e<t;e++)n+=r;return n}function getIndentation(e,t){for(let n of(e instanceof s.yy&&(e=new IndentContext(e)),e.state.facet(O))){let i=n(e,t);if(void 0!==i)return i}let n=syntaxTree(e.state);return n.length>=t?function(e,t,n){let i=t.resolveStack(n),r=i.node.enterUnfinishedNodesBefore(n);if(r!=i.node){let e=[];for(let t=r;t!=i.node;t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)i={node:e[t],next:i}}return indentFor(i,e,n)}(e,n,t):null}let IndentContext=class IndentContext{constructor(e,t={}){this.state=e,this.options=t,this.unit=getIndentUnit(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:r}=this.options;return null!=i&&i>=n.from&&i<=n.to?r&&i==e?{text:"",from:e}:(t<0?i<e:i<=e)?{text:n.text.slice(i-n.from),from:i}:{text:n.text.slice(0,i-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:i}=this.lineAt(e,t);return n.slice(e-i,Math.min(n.length,e+100-i))}column(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.countColumn(n,e-i),s=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return s>-1&&(r+=s-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return(0,s.IS)(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:i}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let e=r(i);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}};let m=new r.md;function indentFor(e,t,n){for(let i=e;i;i=i.next){let e=function(e){let t=e.type.prop(m);if(t)return t;let n=e.firstChild,i;if(n&&(i=n.type.prop(r.md.closedBy))){let t=e.lastChild,n=t&&i.indexOf(t.name)>-1;return e=>delimitedStrategy(e,!0,1,void 0,n&&!(e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak)?t.from:void 0)}return null==e.parent?topIndent:null}(i.node);if(e)return e(TreeIndentContext.create(t,n,i))}return 0}function topIndent(){return 0}let TreeIndentContext=class TreeIndentContext extends IndentContext{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new TreeIndentContext(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(function(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return indentFor(this.context.next,this.base,this.pos)}};function delimitedIndent({closing:e,align:t=!0,units:n=1}){return i=>delimitedStrategy(i,t,n,e)}function delimitedStrategy(e,t,n,i,r){let s=e.textAfter,o=s.match(/^\s*/)[0].length,a=i&&s.slice(o,o+i.length)==i||r==e.pos+o,l=t?function(e){let t=e.node,n=t.childAfter(t.from),i=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,s=e.state.doc.lineAt(n.from),o=null==r||r<=s.from?s.to:Math.min(s.to,r);for(let e=n.to;;){let r=t.childAfter(e);if(!r||r==i)return null;if(!r.type.isSkipped)return r.from<o?n:null;e=r.to}}(e):null;return l?a?e.column(l.from):e.column(l.to):e.baseIndent+(a?0:e.unit*n)}function indentOnInput(){return s.yy.transactionFilter.of(e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:i}=e.newSelection.main,r=n.lineAt(i);if(i>r.from+200)return e;let s=n.sliceString(r.from,i);if(!t.some(e=>e.test(s)))return e;let{state:o}=e,a=-1,l=[];for(let{head:e}
1of o.selection.ranges){let t=o.doc.lineAt(e);if(t.from==a)continue;a=t.from;let n=getIndentation(o,t.from);if(null==n)continue;let i=/^\s*/.exec(t.text)[0],r=indentString(o,n);i!=r&&l.push({from:t.from,to:t.from+i.length,insert:r})}return l.length?[e,{changes:l,sequential:!0}]:e})}let S=s.r$.define(),y=new r.md;function foldInside(e){let t=e.firstChild,n=e.lastChild;return t&&t.to<n.from?{from:t.to,to:n.type.isError?e.to:n.from}:null}function foldable(e,t,n){for(let i of e.facet(S)){let r=i(e,t,n);if(r)return r}return function(e,t,n){let i=syntaxTree(e);if(i.length<n)return null;let r=i.resolveStack(n,1),s=null;for(let o=r;o;o=o.next){let r=o.node;if(r.to<=n||r.from>n)continue;if(s&&r.from<t)break;let a=r.type.prop(y);if(a&&(r.to<i.length-50||i.length==e.doc.length||!function(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}(r))){let i=a(r,e);i&&i.from<=n&&i.from>=t&&i.to>n&&(s=i)}}return s}(e,t,n)}function mapRange(e,t){let n=t.mapPos(e.from,1),i=t.mapPos(e.to,-1);return n>=i?void 0:{from:n,to:i}}let k=s.Py.define({map:mapRange}),v=s.Py.define({map:mapRange});function selectedLines(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some(e=>e.from<=n&&e.to>=n)||t.push(e.lineBlockAt(n));return t}let x=s.QQ.define({create:()=>o.p.none,update(e,t){for(let n of(e=e.map(t.changes),t.effects))if(n.is(k)&&!function(e,t,n){let i=!1;return e.between(t,t,(e,r)=>{e==t&&r==n&&(i=!0)}),i}(e,n.value.from,n.value.to)){let{preparePlaceholder:i}=t.state.facet(b),r=i?o.p.replace({widget:new PreparedFoldWidget(i(t.state,n.value))}):w;e=e.update({add:[r.range(n.value.from,n.value.to)]})}else n.is(v)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));if(t.selection){let n=!1,{head:i}=t.selection.main;e.between(i,i,(e,t)=>{e<i&&t>i&&(n=!0)}),n&&(e=e.update({filterFrom:i,filterTo:i,filter:(e,t)=>t<=i||e>=i}))}return e},provide:e=>o.tk.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,(e,t)=>{n.push(e,t)}),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n<e.length;){let i=e[n++],r=e[n++];if("number"!=typeof i||"number"!=typeof r)throw RangeError("Invalid JSON for fold state");t.push(w.range(i,r))}return o.p.set(t,!0)}});function findFold(e,t,n){var i;let r=null;return null===(i=e.field(x,!1))||void 0===i||i.between(t,n,(e,t)=>{(!r||r.from>e)&&(r={from:e,to:t})}),r}function maybeEnable(e,t){return e.field(x,!1)?t:t.concat(s.Py.appendConfig.of(codeFolding()))}function announceFold(e,t,n=!0){let i=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return o.tk.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${i} ${e.state.phrase("to")} ${r}.`)}let T=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of selectedLines(e)){let n=foldable(e.state,t.from,t.to);if(n)return e.dispatch({effects:maybeEnable(e.state,[k.of(n),announceFold(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(x,!1))return!1;let t=[];for(let n of selectedLines(e)){let i=findFold(e.state,n.from,n.to);i&&t.push(v.of(i),announceFold(e,i,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let i=0;i<t.doc.length;){let r=e.lineBlockAt(i),s=foldable(t,r.from,r.to);s&&n.push(k.of(s)),i=(s?e.lineBlockAt(s.to):r).to+1}return n.length&&e.dispatch({effects:maybeEnable(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(x,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(v.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],Q={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},b=s.r$.define({combine:e=>(0,s.BO)(e,Q)});function codeFolding(e){let t=[x,C];return e&&t.push(b.of(e)),t}function widgetToDOM(e,t){let{state:n}=e,i=n.facet(b),onclick=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),i=findFold(e.state,n.from,n.to);i&&e.dispatch({effects:v.of(i)}),t.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(e,onclick,t);let r=document.createElement("span");return r.textContent=i.placeholderText,r.setAttribute("aria-label",n.phrase("folded code")),r.title=n.phrase("unfold"),r.className="
1cm-foldPlaceholder",r.onclick=onclick,r}let w=o.p.replace({widget:new class extends o.l9{toDOM(e){return widgetToDOM(e,null)}}});let PreparedFoldWidget=class PreparedFoldWidget extends o.l9{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return widgetToDOM(e,this.value)}};let P={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};let FoldMarker=class FoldMarker extends o.SJ{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}};function foldGutter(e={}){let t=Object.assign(Object.assign({},P),e),n=new FoldMarker(t,!0),i=new FoldMarker(t,!1),r=o.lg.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(p)!=e.state.facet(p)||e.startState.field(x,!1)!=e.state.field(x,!1)||syntaxTree(e.startState)!=syntaxTree(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new s.f_;for(let r of e.viewportLineBlocks){let s=findFold(e.state,r.from,r.to)?i:foldable(e.state,r.from,r.to)?n:null;s&&t.add(r.from,r.from,s)}return t.finish()}}),{domEventHandlers:a}=t;return[r,(0,o.v5)({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.markers)||s.Xs.empty},initialSpacer:()=>new FoldMarker(t,!1),domEventHandlers:Object.assign(Object.assign({},a),{click:(e,t,n)=>{if(a.click&&a.click(e,t,n))return!0;let i=findFold(e.state,t.from,t.to);if(i)return e.dispatch({effects:v.of(i)}),!0;let r=foldable(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:k.of(r)}),!0)}})}),codeFolding()]}let C=o.tk.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});let HighlightStyle=class HighlightStyle{constructor(e,t){let n;function def(e){let t=l.V.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;let i="string"==typeof t.all?t.all:t.all?def(t.all):void 0,r=t.scope;this.scope=r instanceof Language?e=>e.prop(h)==r.data:r?e=>e==r:void 0,this.style=(0,a.QR)(e.map(e=>({tag:e.tag,class:e.class||def(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new l.V(n):null,this.themeType=t.themeType}static define(e,t){return new HighlightStyle(e,t||{})}};let R=s.r$.define(),q=s.r$.define({combine:e=>e.length?[e[0]]:null});function getHighlighters(e){let t=e.facet(R);return t.length?t:e.facet(q)}function syntaxHighlighting(e,t){let n=[A],i;return e instanceof HighlightStyle&&(e.module&&n.push(o.tk.styleModule.of(e.module)),i=e.themeType),(null==t?void 0:t.fallback)?n.push(q.of(e)):i?n.push(R.computeN([o.tk.darkTheme],t=>t.facet(o.tk.darkTheme)==("dark"==i)?[e]:[])):n.push(R.of(e)),n}let A=s.Wl.high(o.lg.fromClass(class{constructor(e){this.markCache=Object.create(null),this.tree=syntaxTree(e.state),this.decorations=this.buildDeco(e,getHighlighters(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=syntaxTree(e.state),n=getHighlighters(e.state),i=n!=getHighlighters(e.startState),{viewport:r}=e.view,s=e.changes.mapPos(this.decoratedTo,1);t.length<r.to&&!i&&t.type==this.tree.type&&s>=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return o.p.none;let n=new s.f_;for(let{from:i,to:r}of e.visibleRanges)(0,a.bW)(this.tree,t,(e,t,i)=>{n.add(e,t,this.markCache[i]||(this.markCache[i]=o.p.mark({class:i})))},i,r);return n.finish()}},{decorations:e=>e.decorations})),$=HighlightStyle.define([{tag:a.pJ.meta,color:"#404740"},{tag:a.pJ.link,textDecoration:"underline"},{tag:a.pJ.heading,textDecoration:"underline",fontWeight:"bold"},{tag:a.pJ.emphasis,fontStyle:"italic"},{tag:a.pJ.strong,fontWeight:"bold"},{tag:a.pJ.strikethrough,textDecoration:"line-through"}
1,{tag:a.pJ.keyword,color:"#708"},{tag:[a.pJ.atom,a.pJ.bool,a.pJ.url,a.pJ.contentSeparator,a.pJ.labelName],color:"#219"},{tag:[a.pJ.literal,a.pJ.inserted],color:"#164"},{tag:[a.pJ.string,a.pJ.deleted],color:"#a11"},{tag:[a.pJ.regexp,a.pJ.escape,a.pJ.special(a.pJ.string)],color:"#e40"},{tag:a.pJ.definition(a.pJ.variableName),color:"#00f"},{tag:a.pJ.local(a.pJ.variableName),color:"#30a"},{tag:[a.pJ.typeName,a.pJ.namespace],color:"#085"},{tag:a.pJ.className,color:"#167"},{tag:[a.pJ.special(a.pJ.variableName),a.pJ.macroName],color:"#256"},{tag:a.pJ.definition(a.pJ.propertyName),color:"#00c"},{tag:a.pJ.comment,color:"#940"},{tag:a.pJ.invalid,color:"#f00"}]),E=o.tk.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),z="()[]{}",W=s.r$.define({combine:e=>(0,s.BO)(e,{afterCursor:!0,brackets:z,maxScanDistance:1e4,renderMatch:defaultRenderMatch})}),I=o.p.mark({class:"cm-matchingBracket"}),B=o.p.mark({class:"cm-nonmatchingBracket"});function defaultRenderMatch(e){let t=[],n=e.matched?I:B;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}let _=s.QQ.define({create:()=>o.p.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],i=t.state.facet(W);for(let e of t.state.selection.ranges){if(!e.empty)continue;let r=matchBrackets(t.state,e.head,-1,i)||e.head>0&&matchBrackets(t.state,e.head-1,1,i)||i.afterCursor&&(matchBrackets(t.state,e.head,1,i)||e.head<t.state.doc.length&&matchBrackets(t.state,e.head+1,-1,i));r&&(n=n.concat(i.renderMatch(r,t.state)))}return o.p.set(n,!0)},provide:e=>o.tk.decorations.from(e)}),X=[_,E];function bracketMatching(e={}){return[W.of(e),X]}let D=new r.md;function matchingNodes(e,t,n){let i=e.prop(t<0?r.md.openedBy:r.md.closedBy);if(i)return i;if(1==e.name.length){let i=n.indexOf(e.name);if(i>-1&&i%2==(t<0?1:0))return[n[i+t]]}return null}function findHandle(e){let t=e.type.prop(D);return t?t(e.node):e}function matchBrackets(e,t,n,i={}){let r=i.maxScanDistance||1e4,s=i.brackets||z,o=syntaxTree(e),a=o.resolveInner(t,n);for(let e=a;e;e=e.parent){let i=matchingNodes(e.type,n,s);if(i&&e.from<e.to){let r=findHandle(e);if(r&&(n>0?t>=r.from&&t<r.to:t>r.from&&t<=r.to))return function(e,t,n,i,r,s,o){let a=i.parent,l={from:r.from,to:r.to},h=0,c=null==a?void 0:a.cursor();if(c&&(n<0?c.childBefore(i.from):c.childAfter(i.to)))do if(n<0?c.to<=i.from:c.from>=i.to){if(0==h&&s.indexOf(c.type.name)>-1&&c.from<c.to){let e=findHandle(c);return{start:l,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(matchingNodes(c.type,n,o))h++;else if(matchingNodes(c.type,-n,o)){if(0==h){let e=findHandle(c);return{start:l,end:e&&e.from<e.to?{from:e.from,to:e.to}:void 0,matched:!1}}h--}}while(n<0?c.prevSibling():c.nextSibling());return{start:l,matched:!1}}(0,0,n,e,r,i,s)}}return function(e,t,n,i,r,s,o){let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),l=o.indexOf(a);if(l<0||l%2==0!=n>0)return null;let h={from:n<0?t-1:t,to:n>0?t+1:t},c=e.doc.iterRange(t,n>0?e.doc.length:0),u=0;for(let e=0;!c.next().done&&e<=s;){let s=c.value;n<0&&(e+=s.length);let a=t+e*n;for(let e=n>0?0:s.length-1,t=n>0?s.length:-1;e!=t;e+=n){let t=o.indexOf(s[e]);if(!(t<0)&&i.resolveInner(a+e,1).type==r){if(t%2==0==n>0)u++;else{if(1==u)return{start:h,end:{from:a+e,to:a+e+1},matched:t>>1==l>>1};u--}}}n>0&&(e+=s.length)}return c.done?{start:h,matched:!1}:null}(e,t,n,o,a.type,r,s)}let N=Object.create(null),L=[r.Jq.none],U=[],j=Object.create(null),M=Object.create(null);for(let[e,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])M[e]=function(e,t){let n=[];for(let i of t.split(" ")){let t=[];for(let n of i.split(".")){let i=e[n]||a.pJ[n];i?"function"==typeof i?t.length?t=t.map(i):warnForPart(n,`Modifier ${n} used at start of tag`):t.length?warnForPart(n,`Tag ${n} used as modifier`):t=Array.isArray(i)?i:[i]:warnForPart(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let i=t.replace(/ /g,"_"),s=i+" "+n.map(e=>e.id),o=j[s];if(o)return o.id;let l=j[s]=r.Jq.define({id:L.length,name:i,props:[(0,a.Gv)({[i]:n})]});return L.push(l),l.id}(N,t);function warnForPart(e,t){U.indexOf(e)>-1||(U.push(e),console.warn(t))}o.Nm.RTL,o.Nm.LTR},78120:function(e,t,n){"use strict";let i;n.d(t,{BO:function(){return combineConfig},D0:function(){return v},Gz:function(){return findColumn},IS:function(){return countColumn}
1,Py:function(){return StateEffect},QQ:function(){return StateField},Wl:function(){return d},Xs:function(){return RangeSet},YW:function(){return Transaction},as:function(){return ChangeSet},bg:function(){return fromCodePoint},cp:function(){return findClusterBreak},f_:function(){return RangeSetBuilder},gc:function(){return l},gm:function(){return codePointAt},jT:function(){return EditorSelection},n0:function(){return ChangeDesc},nZ:function(){return codePointSize},q6:function(){return Annotation},r$:function(){return Facet},uU:function(){return RangeValue},xv:function(){return Text},yy:function(){return EditorState}});let Text=class Text{lineAt(e){if(e<0||e>this.length)throw RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=clip(this,e,t);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),TextNode.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=clip(this,e,t);let n=[];return this.decompose(e,t,n,0),TextNode.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new RawTextCursor(this),r=new RawTextCursor(e);for(let e=t,s=t;;){if(i.next(e),r.next(e),e=0,i.lineBreak!=r.lineBreak||i.done!=r.done||i.value!=r.value)return!1;if(s+=i.value.length,i.done||s>=n)return!0}}iter(e=1){return new RawTextCursor(this,e)}iterRange(e,t=this.length){return new PartialTextCursor(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new LineCursor(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new TextLeaf(e):TextNode.from(TextLeaf.split(e,[])):Text.empty}};let TextLeaf=class TextLeaf extends Text{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let r=0;;r++){let s=this.text[r],o=i+s.length;if((t?n:o)>=e)return new Line(i,o,n,s);i=o+1,n++}}decompose(e,t,n,i){let r=e<=0&&t>=this.length?this:new TextLeaf(appendText(this.text,[""],e,t),Math.min(t,this.length)-Math.max(0,e));if(1&i){let e=n.pop(),t=appendText(r.text,e.text.slice(),0,r.length);if(t.length<=32)n.push(new TextLeaf(t,e.length+r.length));else{let e=t.length>>1;n.push(new TextLeaf(t.slice(0,e)),new TextLeaf(t.slice(e)))}}else n.push(r)}replace(e,t,n){var i;if(!(n instanceof TextLeaf))return super.replace(e,t,n);[e,t]=clip(this,e,t);let r=appendText(this.text,appendText(n.text,appendText(this.text,[""],0,e)),t),s=this.length+n.length-(t-e);return r.length<=32?new TextLeaf(r,s):TextNode.from(TextLeaf.split(r,[]),s)}sliceString(e,t=this.length,n="\n"){[e,t]=clip(this,e,t);let i="";for(let r=0,s=0;r<=t&&s<this.text.length;s++){let o=this.text[s],a=r+o.length;r>e&&s&&(i+=n),e<a&&t>r&&(i+=o.slice(Math.max(0,e-r),t-r)),r=a+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let r of e)n.push(r),i+=r.length+1,32==n.length&&(t.push(new TextLeaf(n,i)),n=[],i=-1);return i>-1&&t.push(new TextLeaf(n,i)),t}};let TextNode=class TextNode extends Text{constructor(e,t){for(let n of(super(),this.children=e,this.length=t,this.lines=0,e))this.lines+=n.lines}lineInner(e,t,n,i){for(let r=0;;r++){let s=this.children[r],o=i+s.length,a=n+s.lines-1;if((t?a:o)>=e)return s.lineInner(e,t,n,i);i=o+1,n=a+1}}decompose(e,t,n,i){for(let r=0,s=0;s<=t&&r<this.children.length;r++){let o=this.children[r],a=s+o.length;if(e<=a&&t>=s){let r=i&((s<=e?1:0)|(a>=t?2:0));s>=e&&a<=t&&!r?n.push(o):o.decompose(e-s,t-s,n,r)}s=a+1}}replace(e,t,n){if([e,t]=clip(this,e,t),n.lines<this.lines)for(let i=0,r=0;i<this.children.length;i++){let s=this.children[i],o=r+s.length;if(e>=r&&t<=o){let a=s.replace(e-r,t-r,n),l=this.lines-s.lines+a.lines;if(a.lines<l>>4&&a.lines>l>>6){let r=this.children.slice();return r[i]=a,new TextNode(r,this.length-(t-e)+n.length)}return super.replace(r,o,a)}r=o+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=clip(this,e,t);let i="";for(let r=0,s=0;r<this.children.length&&s<=t;r++){let o=this.children[r],a=s+o.length;s>e&&r&&(i+=n),e<a&&t>
1s&&(i+=o.sliceString(e-s,t-s,n)),s=a+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof TextNode))return 0;let n=0,[i,r,s,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,r+=t){if(i==s||r==o)return n;let a=this.children[i],l=e.children[r];if(a!=l)return n+a.scanIdentical(l,t);n+=a.length+1}}static from(e,t=e.reduce((e,t)=>e+t.length+1,-1)){let n=0;for(let t of e)n+=t.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new TextLeaf(n,t)}let i=Math.max(32,n>>5),r=i<<1,s=i>>1,o=[],a=0,l=-1,h=[];function flush(){0!=a&&(o.push(1==h.length?h[0]:TextNode.from(h,l)),l=-1,a=h.length=0)}for(let t of e)!function add(e){let t;if(e.lines>r&&e instanceof TextNode)for(let t of e.children)add(t);else e.lines>s&&(a>s||!a)?(flush(),o.push(e)):e instanceof TextLeaf&&a&&(t=h[h.length-1])instanceof TextLeaf&&e.lines+t.lines<=32?(a+=e.lines,l+=e.length+1,h[h.length-1]=new TextLeaf(t.text.concat(e.text),t.length+1+e.length)):(a+e.lines>i&&flush(),a+=e.lines,l+=e.length+1,h.push(e))}(t);return flush(),1==o.length?o[0]:new TextNode(o,t)}};function appendText(e,t,n=0,i=1e9){for(let r=0,s=0,o=!0;s<e.length&&r<=i;s++){let a=e[s],l=r+a.length;l>=n&&(l>i&&(a=a.slice(0,i-r)),r<n&&(a=a.slice(n-r)),o?(t[t.length-1]+=a,o=!1):t.push(a)),r=l+1}return t}Text.empty=new TextLeaf([""],0);let RawTextCursor=class RawTextCursor{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof TextLeaf?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],r=this.offsets[n],s=r>>1,o=i instanceof TextLeaf?i.text.length:i.children.length;if(s==(t>0?o:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(i instanceof TextLeaf){let r=i.text[s+(t<0?-1:0)];if(this.offsets[n]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let r=i.children[s+(t<0?-1:0)];e>r.length?(e-=r.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(t>0?1:(r instanceof TextLeaf?r.text.length:r.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}};let PartialTextCursor=class PartialTextCursor{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new RawTextCursor(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&""!=this.value}};let LineCursor=class LineCursor{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}};"undefined"!=typeof Symbol&&(Text.prototype[Symbol.iterator]=function(){return this.iter()},RawTextCursor.prototype[Symbol.iterator]=PartialTextCursor.prototype[Symbol.iterator]=LineCursor.prototype[Symbol.iterator]=function(){return this});let Line=class Line{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}};function clip(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}let r="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=1;e<r.length;e++)r[e]+=r[e-1];function isRegionalIndicator(e){return e>=127462&&e<=127487}function findClusterBreak(e,t,n=!0,i=!0){return(n?nextClusterBreak:function(e,t,n){for(;t>0;){let i=nextClusterBreak(e,t-2,n);if(i<t)return i;t--}return 0})(e,t,i)}function nextClusterBreak(e,t,n){if(t==e.length)return t;t&&surrogateLow(e.charCodeAt(t))&&surrogateHigh(e.charCodeAt(t-1))&&t--;let i=codePointAt(e,t);for(t+=codePointSize(i);t<e.length;){let s=codePointAt(e,t);if(8205==i||8205==s||n&&function(e){for(let t=1;t<r.length;t+=2)if(r[t]>e)return r[t-1]<=e;return!1}(s))t+=codePointSize(s),i=s;else if(isRegionalIndicator(s)){let n=0,i=t-2;for(;i>=0&&isRegionalIndicator(codePointAt(e,i));)n++,i-=2;if(n%2==0)break;t+=2}else break}return t}function surrogateLow(e){return e>=56320&&e<57344}function surrogateHigh(e){return e>=55296&&e<56320}function codePointAt(e,t){let n=e.charCodeAt(t);if(!surrogateHigh(n)||t+1==e.length)return n;let i=e.charCodeAt(t+1);return surrogateLow(i)?(n-55296<<10)+(i-56320)+65536:n}function fromCodePoint(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10)+55296,(1023&e)+56320)}function codePointSize(e){return e<65536?1:2}let s=/\r\n?|\n/;var o,a,l=((o=l||(l={}))[o.Simple=0]="Simple",o[o.TrackDel=1]="TrackDel",o[o.TrackBefore=2]="TrackBefore",o[o.TrackAfter=3]="TrackAfter",o);let ChangeDesc=class ChangeDesc{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return 0==this.sections.length||2==this.sections.length&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,i=0;t<this.sections.length;){let r=this.sections[t++],s=this.sections[t++];s<0?(e(n,i,r),i+=r):i+=s,n+=r}}iterChangedRanges(e,t=!1){iterChanges(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];i<0?e.push(n,i):e.push(i,n)}return new ChangeDesc(e)}composeDesc(e){return this.empty?e:e.empty?this:composeSets(this,e)}mapDesc(e,t=!1){return e.empty?this:mapSet(this,e,t)}mapPos(e,t=-1,n=l.Simple){let i=0,r=0;for(let s=0;s<this.sections.length;){let o=this.sections[s++],a=this.sections[s++],h=i+o;if(a<0){if(h>e)return r+(e-i);r+=o}else{if(n!=l.Simple&&h>=e&&(n==l.TrackDel&&i<e&&h>e||n==l.TrackBefore&&i<e||n==l.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!o)return e==i||t<0?r:r+a;r+=a}i=h}if(e>i)throw RangeError(`Position ${e} is out of range for changeset of length ${i}`);return r}touchesRange(e,t=e){for(let n=0,i=0;n<this.sections.length&&i<=t;){let r=this.sections[n++],s=this.sections[n++],o=i+r;if(s>=0&&i<=t&&o>=e)return!(i<e)||!(o>t)||"cover";i=o}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+n+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(e=>"number"!=typeof e))throw RangeError("Invalid JSON representation of ChangeDesc");return new ChangeDesc(e)}static create(e){return new ChangeDesc(e)}};let ChangeSet=class ChangeSet extends ChangeDesc{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw RangeError("Applying change set to a document with the wrong length");return iterChanges(this,(t,n,i,r,s)=>e=e.replace(i,i+(n-t),s),!1),e}
1mapDesc(e,t=!1){return mapSet(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,r=0;i<t.length;i+=2){let s=t[i],o=t[i+1];if(o>=0){t[i]=o,t[i+1]=s;let a=i>>1;for(;n.length<a;)n.push(Text.empty);n.push(s?e.slice(r,r+s):Text.empty)}r+=s}return new ChangeSet(t,n)}compose(e){return this.empty?e:e.empty?this:composeSets(this,e,!0)}map(e,t=!1){return e.empty?this:mapSet(this,e,t,!0)}iterChanges(e,t=!1){iterChanges(this,e,t)}get desc(){return ChangeDesc.create(this.sections)}filter(e){let t=[],n=[],i=[],r=new SectionIter(this);i:for(let s=0,o=0;;){let a=s==e.length?1e9:e[s++];for(;o<a||o==a&&0==r.len;){if(r.done)break i;let e=Math.min(r.len,a-o);addSection(i,e,-1);let s=-1==r.ins?-1:0==r.off?r.ins:0;addSection(t,e,s),s>0&&addInsert(n,t,r.text),r.forward(e),o+=e}let l=e[s++];for(;o<l;){if(r.done)break i;let e=Math.min(r.len,l-o);addSection(t,e,-1),addSection(i,e,-1==r.ins?-1:0==r.off?r.ins:0),r.forward(e),o+=e}}return{changes:new ChangeSet(t,n),filtered:ChangeDesc.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],i=this.sections[t+1];i<0?e.push(n):0==i?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let i=[],r=[],o=0,a=null;function flush(e=!1){if(!e&&!i.length)return;o<t&&addSection(i,t-o,-1);let n=new ChangeSet(i,r);a=a?a.compose(n.map(a)):n,i=[],r=[],o=0}return!function process(e){if(Array.isArray(e))for(let t of e)process(t);else if(e instanceof ChangeSet){if(e.length!=t)throw RangeError(`Mismatched change set length (got ${e.length}, expected ${t})`);flush(),a=a?a.compose(e.map(a)):e}else{let{from:a,to:l=a,insert:h}=e;if(a>l||a<0||l>t)throw RangeError(`Invalid change range ${a} to ${l} (in doc of length ${t})`);let c=h?"string"==typeof h?Text.of(h.split(n||s)):h:Text.empty,u=c.length;if(a==l&&0==u)return;a<o&&flush(),a>o&&addSection(i,a-o,-1),addSection(i,l-a,u),addInsert(r,i,c),o=l}}(e),flush(!a),a}static empty(e){return new ChangeSet(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;i<e.length;i++){let r=e[i];if("number"==typeof r)t.push(r,-1);else if(!Array.isArray(r)||"number"!=typeof r[0]||r.some((e,t)=>t&&"string"!=typeof e))throw RangeError("Invalid JSON representation of ChangeSet");else if(1==r.length)t.push(r[0],0);else{for(;n.length<i;)n.push(Text.empty);n[i]=Text.of(r.slice(1)),t.push(r[0],n[i].length)}}return new ChangeSet(t,n)}static createSet(e,t){return new ChangeSet(e,t)}};function addSection(e,t,n,i=!1){if(0==t&&n<=0)return;let r=e.length-2;r>=0&&n<=0&&n==e[r+1]?e[r]+=t:0==t&&0==e[r]?e[r+1]+=n:i?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function addInsert(e,t,n){if(0==n.length)return;let i=t.length-2>>1;if(i<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<i;)e.push(Text.empty);e.push(n)}}function iterChanges(e,t,n){let i=e.inserted;for(let r=0,s=0,o=0;o<e.sections.length;){let a=e.sections[o++],l=e.sections[o++];if(l<0)r+=a,s+=a;else{let h=r,c=s,u=Text.empty;for(;h+=a,c+=l,l&&i&&(u=u.append(i[o-2>>1])),!n&&o!=e.sections.length&&!(e.sections[o+1]<0);)a=e.sections[o++],l=e.sections[o++];t(r,h,s,c,u),r=h,s=c}}}function mapSet(e,t,n,i=!1){let r=[],s=i?[]:null,o=new SectionIter(e),a=new SectionIter(t);for(let e=-1;;)if(-1==o.ins&&-1==a.ins){let e=Math.min(o.len,a.len);addSection(r,e,-1),o.forward(e),a.forward(e)}else if(a.ins>=0&&(o.ins<0||e==o.i||0==o.off&&(a.len<o.len||a.len==o.len&&!n))){let t=a.len;for(addSection(r,a.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(addSection(r,0,o.ins),s&&addInsert(s,r,o.text),e=o.i),o.forward(n),t-=n}a.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(-1==a.ins){let e=Math.min(n,a.len);t+=e,n-=e,a.forward(e)}else if(0==a.ins&&a.len<n)n-=a.len,a.next();else break;addSection(r,t,e<o.i?o.ins:0),s&&e<o.i&&addInsert(s,r,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&a.done)return s?ChangeSet.createSet(r,s):ChangeDesc.create(r);else throw Error("Mismatched change set lengths")}function composeSets(e,t,n=!1){let i=[],r=n?[]:null,s=new SectionIter(e),o=new SectionIter(t);for(let e=!1;;){if(s.done&&o.done)return r?ChangeSet.createSet(i,r):ChangeDesc.create(i);if(0==s.ins)addSection(i,s.len,0,e),s.next();else if(0!=o.len||o.done){if(s.done||o.done)throw Error("Mismatched change set lengths");{let t=Math.min(s.len2,o.len),n=i.length;if(-1==s.ins){let n=-1==o.ins?-1:o.off?0:o.ins;addSection(i,t,n,e),r&&n&&addInsert(r,i,o.text)}else -1==o.ins?(addSection(i,s.off?0:s.len,t,e),r&&addInsert(r,i,s.textBit(t))):(addSection(i,s.off?0:s.len,o.off?0:o.ins,e),r&&!o.off&&addInsert(r,i,o.text));e=(s.ins>t||o.ins>=0&&o.len>t)&&(e||i.length>n),s.forward2(t),o.forward(t)}}else addSection(i,0,o.ins,e),r&&addInsert(r,i,o.text),o.next()}}let SectionIter=class SectionIter{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return -2==this.ins}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Text.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?Text.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}
1forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}};let SelectionRange=class SelectionRange{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 16777215==e?void 0:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new SelectionRange(n,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return EditorSelection.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return EditorSelection.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw RangeError("Invalid JSON representation for SelectionRange");return EditorSelection.range(e.anchor,e.head)}static create(e,t,n){return new SelectionRange(e,t,n)}};let EditorSelection=class EditorSelection{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:EditorSelection.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return 1==this.ranges.length?this:new EditorSelection([this.main],0)}addRange(e,t=!0){return EditorSelection.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,EditorSelection.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||"number"!=typeof e.main||e.main>=e.ranges.length)throw RangeError("Invalid JSON representation for EditorSelection");return new EditorSelection(e.ranges.map(e=>SelectionRange.fromJSON(e)),e.main)}static single(e,t=e){return new EditorSelection([EditorSelection.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw RangeError("A selection needs at least one range");for(let n=0,i=0;i<e.length;i++){let r=e[i];if(r.empty?r.from<=n:r.from<n)return EditorSelection.normalized(e.slice(),t);n=r.to}return new EditorSelection(e,t)}static cursor(e,t=0,n,i){return SelectionRange.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n))|(null!=i?i:16777215)<<6)}static range(e,t,n,i){let r=(null!=n?n:16777215)<<6|(null==i?7:Math.min(6,i));return t<e?SelectionRange.create(t,e,48|r):SelectionRange.create(e,t,(t>e?8:0)|r)}static normalized(e,t=0){let n=e[t];e.sort((e,t)=>e.from-t.from),t=e.indexOf(n);for(let n=1;n<e.length;n++){let i=e[n],r=e[n-1];if(i.empty?i.from<=r.to:i.from<r.to){let s=r.from,o=Math.max(i.to,r.to);n<=t&&t--,e.splice(--n,2,i.anchor>i.head?EditorSelection.range(o,s):EditorSelection.range(s,o))}}return new EditorSelection(e,t)}};function checkSelection(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError("Selection points outside of document")}let h=0;let Facet=class Facet{constructor(e,t,n,i,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=h++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(e={}){return new Facet(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:sameArray),!!e.static,e.enables)}of(e){return new FacetProvider([],this,0,e)}compute(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new FacetProvider(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new FacetProvider(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}};function sameArray(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}let FacetProvider=class FacetProvider{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=h++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,r=this.id,s=e[r]>>1,o=2==this.type,a=!1,l=!1,h=[];for(let n of this.dependencies)"doc"==n?a=!0:"selection"==n?l=!0:((null!==(t=e[n.id])&&void 0!==t?t:1)&1)==0&&h.push(e[n.id]);return{create:e=>(e.values[s]=n(e),1),update(e,t){if(a&&t.docChanged||l&&(t.docChanged||t.selection)||ensureAll(e,h)){let t=n(e);
1if(o?!compareArray(t,e.values[s],i):!i(t,e.values[s]))return e.values[s]=t,1}return 0},reconfigure:(e,t)=>{let a,l=t.config.address[r];if(null!=l){let r=getAddr(t,l);if(this.dependencies.every(n=>n instanceof Facet?t.facet(n)===e.facet(n):!(n instanceof StateField)||t.field(n,!1)==e.field(n,!1))||(o?compareArray(a=n(e),r,i):i(a=n(e),r)))return e.values[s]=r,0}else a=n(e);return e.values[s]=a,1}}}};function compareArray(e,t,n){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(!n(e[i],t[i]))return!1;return!0}function ensureAll(e,t){let n=!1;for(let i of t)1&ensureAddr(e,i)&&(n=!0);return n}let c=Facet.define({static:!0});let StateField=class StateField{constructor(e,t,n,i,r){this.id=e,this.createF=t,this.updateF=n,this.compareF=i,this.spec=r,this.provides=void 0}static define(e){let t=new StateField(h++,e.create,e.update,e.compare||((e,t)=>e===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(c).find(e=>e.field==this);return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let i=e.values[t],r=this.updateF(i,n);return this.compareF(i,r)?0:(e.values[t]=r,1)},reconfigure:(e,n)=>null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}init(e){return[this,c.of({field:this,create:e})]}get extension(){return this}};let u={lowest:4,low:3,default:2,high:1,highest:0};function prec(e){return t=>new PrecExtension(t,e)}let d={highest:prec(u.highest),high:prec(u.high),default:prec(u.default),low:prec(u.low),lowest:prec(u.lowest)};let PrecExtension=class PrecExtension{constructor(e,t){this.inner=e,this.prec=t}};let Compartment=class Compartment{of(e){return new CompartmentInstance(this,e)}reconfigure(e){return Compartment.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}};let CompartmentInstance=class CompartmentInstance{constructor(e,t){this.compartment=e,this.inner=t}};let Configuration=class Configuration{constructor(e,t,n,i,r,s){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=r,this.facets=s,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return null==t?e.default:this.staticValues[t>>1]}static resolve(e,t,n){let i,r,s=[],o=Object.create(null),a=new Map;for(let n of(i=[[],[],[],[],[]],r=new Map,!function inner(e,n){let s=r.get(e);if(null!=s){if(s<=n)return;let t=i[s].indexOf(e);t>-1&&i[s].splice(t,1),e instanceof CompartmentInstance&&a.delete(e.compartment)}if(r.set(e,n),Array.isArray(e))for(let t of e)inner(t,n);else if(e instanceof CompartmentInstance){if(a.has(e.compartment))throw RangeError("Duplicate use of compartment in extensions");let i=t.get(e.compartment)||e.inner;a.set(e.compartment,i),inner(i,n)}else if(e instanceof PrecExtension)inner(e.inner,e.prec);else if(e instanceof StateField)i[n].push(e),e.provides&&inner(e.provides,n);else if(e instanceof FacetProvider)i[n].push(e),e.facet.extensions&&inner(e.facet.extensions,u.default);else{let t=e.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);inner(t,n)}}(e,u.default),i.reduce((e,t)=>e.concat(t))))n instanceof StateField?s.push(n):(o[n.facet.id]||(o[n.facet.id]=[])).push(n);let l=Object.create(null),h=[],c=[];for(let e of s)l[e.id]=c.length<<1,c.push(t=>e.slot(t));let d=null==n?void 0:n.config.facets;for(let e in o){let t=o[e],i=t[0].facet,r=d&&d[e]||[];if(t.every(e=>0==e.type)){if(l[i.id]=h.length<<1|1,sameArray(r,t))h.push(n.facet(i));else{let e=i.combine(t.map(e=>e.value));h.push(n&&i.compare(e,n.facet(i))?n.facet(i):e)}}else{for(let e of t)0==e.type?(l[e.id]=h.length<<1|1,h.push(e.value)):(l[e.id]=c.length<<1,c.push(t=>e.dynamicSlot(t)));l[i.id]=c.length<<1,c.push(e=>(function(e,t,n){let i=n.map(t=>e[t.id]),r=n.map(e=>e.type),s=i.filter(e=>!(1&e)),o=e[t.id]>>1;function get(e){let n=[];for(let t=0;t<i.length;t++){let s=getAddr(e,i[t]);if(2==r[t])for(let e of s)n.push(e);else n.push(s)}return t.combine(n)}return{create(e){for(let t of i)ensureAddr(e,t);return e.values[o]=get(e),1},update(e,n){if(!ensureAll(e,s))return 0;let i=get(e);return t.compare(i,e.values[o])?0:(e.values[o]=i,1)},reconfigure(e,r){let s=ensureAll(e,i),a=r.config.facets[t.id],l=r.facet(t);if(a&&!s&&sameArray(n,a))return e.values[o]=l,0;let h=get(e);return t.compare(h,l)?(e.values[o]=l,0):(e.values[o]=h,1)}}})(e,i,t))}}let f=c.map(e=>e(l));return new Configuration(e,a,f,l,h,o)}};function ensureAddr(e,t){if(1&t)return 2;let n=t>>1,i=e.status[n];if(4==i)throw Error("Cyclic dependency between fields and/or facets");if(2&i)return i;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function getAddr(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}let f=Facet.define(),p=Facet.define({combine:e=>e.some(e=>e),static:!0}),O=Facet.define({combine:e=>e.length?e[0]:void 0,static:!0}),g=Facet.define(),m=Facet.define(),S=Facet.define(),y=Facet.define({combine:e=>!!e.length&&e[0]});let Annotation=class Annotation{constructor(e,t){this.type=e,this.value=t}static define(){return new AnnotationType}};let AnnotationType=class AnnotationType{of(e){return new Annotation(this,e)}};
1let StateEffectType=class StateEffectType{constructor(e){this.map=e}of(e){return new StateEffect(this,e)}};let StateEffect=class StateEffect{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new StateEffect(this.type,t)}is(e){return this.type==e}static define(e={}){return new StateEffectType(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let e=i.map(t);e&&n.push(e)}return n}};StateEffect.reconfigure=StateEffect.define(),StateEffect.appendConfig=StateEffect.define();let Transaction=class Transaction{constructor(e,t,n,i,r,s){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=r,this.scrollIntoView=s,this._doc=null,this._state=null,n&&checkSelection(n,t.newLength),r.some(e=>e.type==Transaction.time)||(this.annotations=r.concat(Transaction.time.of(Date.now())))}static create(e,t,n,i,r,s){return new Transaction(e,t,n,i,r,s)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Transaction.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}};function mergeTransaction(e,t,n){var i;let r,s,o;return n?(r=t.changes,s=ChangeSet.empty(t.changes.length),o=e.changes.compose(t.changes)):(r=t.changes.map(e.changes),s=e.changes.mapDesc(t.changes,!0),o=e.changes.compose(r)),{changes:o,selection:t.selection?t.selection.map(s):null===(i=e.selection)||void 0===i?void 0:i.map(r),effects:StateEffect.mapEffects(e.effects,r).concat(StateEffect.mapEffects(t.effects,s)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function resolveTransactionInner(e,t,n){let i=t.selection,r=asArray(t.annotations);return t.userEvent&&(r=r.concat(Transaction.userEvent.of(t.userEvent))),{changes:t.changes instanceof ChangeSet?t.changes:ChangeSet.of(t.changes||[],n,e.facet(O)),selection:i&&(i instanceof EditorSelection?i:EditorSelection.single(i.anchor,i.head)),effects:asArray(t.effects),annotations:r,scrollIntoView:!!t.scrollIntoView}}Transaction.time=Annotation.define(),Transaction.userEvent=Annotation.define(),Transaction.addToHistory=Annotation.define(),Transaction.remote=Annotation.define();let k=[];function asArray(e){return null==e?k:Array.isArray(e)?e:[e]}var v=((a=v||(v={}))[a.Word=0]="Word",a[a.Space=1]="Space",a[a.Other=2]="Other",a);let x=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{i=RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}let EditorState=class EditorState{constructor(e,t,n,i,r,s){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=r,s&&(s._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)ensureAddr(this,e<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(null==n){if(t)throw RangeError("Field is not present in this state");return}return ensureAddr(this,n),getAddr(this,n)}update(...e){return function resolveTransaction(e,t,n){let i=resolveTransactionInner(e,t.length?t[0]:{},e.doc.length);t.length&&!1===t[0].filter&&(n=!1);for(let r=1;r<t.length;r++){!1===t[r].filter&&(n=!1);let s=!!t[r].sequential;i=mergeTransaction(i,resolveTransactionInner(e,t[r],s?i.changes.newLength:e.doc.length),s)}let r=Transaction.create(e,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return function(e){let t=e.startState,n=t.facet(S),i=e;for(let r=n.length-1;r>=0;r--){let s=n[r](e);s&&Object.keys(s).length&&(i=mergeTransaction(i,resolveTransactionInner(t,s,e.changes.newLength),!0))}return i==e?e:Transaction.create(t,e.changes,e.selection,i.effects,i.annotations,i.scrollIntoView)}(n?function(e){let t=e.startState,n=!0;for(let i of t.facet(g)){let t=i(e);if(!1===t){n=!1;break}Array.isArray(t)&&(n=!0===n?t:function(e,t){let n=[];for(let i=0,r=0;;){let s,o;
1if(i<e.length&&(r==t.length||t[r]>=e[i]))s=e[i++],o=e[i++];else{if(!(r<t.length))return n;s=t[r++],o=t[r++]}!n.length||n[n.length-1]<s?n.push(s,o):n[n.length-1]<o&&(n[n.length-1]=o)}}(n,t))}if(!0!==n){let i,r;if(!1===n)r=e.changes.invertedDesc,i=ChangeSet.empty(t.doc.length);else{let t=e.changes.filter(n);i=t.changes,r=t.filtered.mapDesc(t.changes).invertedDesc}e=Transaction.create(t,i,e.selection&&e.selection.map(r),StateEffect.mapEffects(e.effects,r),e.annotations,e.scrollIntoView)}let i=t.facet(m);for(let n=i.length-1;n>=0;n--){let r=i[n](e);e=r instanceof Transaction?r:Array.isArray(r)&&1==r.length&&r[0]instanceof Transaction?r[0]:resolveTransaction(t,asArray(r),!1)}return e}(r):r)}(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:i,compartments:r}=n;for(let t of e.effects)t.is(Compartment.reconfigure)?(n&&(r=new Map,n.compartments.forEach((e,t)=>r.set(t,e)),n=null),r.set(t.value.compartment,t.value.extension)):t.is(StateEffect.reconfigure)?(n=null,i=t.value):t.is(StateEffect.appendConfig)&&(n=null,i=asArray(i).concat(t.value));n?t=e.startState.values.slice():(n=Configuration.resolve(i,r,this),t=new EditorState(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let s=e.startState.facet(p)?e.newSelection:e.newSelection.asSingle();new EditorState(n,e.newDoc,s,t,(t,n)=>n.update(t,e),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:EditorSelection.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),r=[n.range],s=asArray(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),a=this.changes(o.changes),l=a.map(i);for(let e=0;e<n;e++)r[e]=r[e].map(l);let h=i.mapDesc(a,!0);r.push(o.range.map(h)),i=i.compose(l),s=StateEffect.mapEffects(s,l).concat(StateEffect.mapEffects(asArray(o.effects),h))}return{changes:i,selection:EditorSelection.create(r,t.mainIndex),effects:s}}changes(e=[]){return e instanceof ChangeSet?e:ChangeSet.of(e,this.doc.length,this.facet(EditorState.lineSeparator))}toText(e){return Text.of(e.split(this.facet(EditorState.lineSeparator)||s))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return null==t?e.default:(ensureAddr(this,t),getAddr(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let i=e[n];i instanceof StateField&&null!=this.config.address[i.id]&&(t[n]=i.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||"string"!=typeof e.doc)throw RangeError("Invalid JSON representation for EditorState");let i=[];if(n){for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)){let r=n[t],s=e[t];i.push(r.init(e=>r.spec.fromJSON(s,e)))}}return EditorState.create({doc:e.doc,selection:EditorSelection.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=Configuration.resolve(e.extensions||[],new Map),n=e.doc instanceof Text?e.doc:Text.of((e.doc||"").split(t.staticFacet(EditorState.lineSeparator)||s)),i=e.selection?e.selection instanceof EditorSelection?e.selection:EditorSelection.single(e.selection.anchor,e.selection.head):EditorSelection.single(0);return checkSelection(i,n.length),t.staticFacet(p)||(i=i.asSingle()),new EditorState(t,n,i,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(EditorState.tabSize)}get lineBreak(){return this.facet(EditorState.lineSeparator)||"\n"}get readOnly(){return this.facet(y)}phrase(e,...t){for(let t of this.facet(EditorState.phrases))if(Object.prototype.hasOwnProperty.call(t,e)){e=t[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(e,n)=>{if("$"==n)return"$";let i=+(n||1);return!i||i>t.length?e:t[i-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let r of this.facet(f))for(let s of r(this,t,n))Object.prototype.hasOwnProperty.call(s,e)&&i.push(s[e]);return i}charCategorizer(e){var t;return t=this.languageDataAt("wordChars",e).join(""),e=>{if(!/\S/.test(e))return v.Space;if(function(e){if(i)return i.test(e);for(let t=0;t<e.length;t++){let n=e[t];
1if(/\w/.test(n)||n>"\x80"&&(n.toUpperCase()!=n.toLowerCase()||x.test(n)))return!0}return!1}(e))return v.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return v.Word;return v.Other}}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),r=this.charCategorizer(e),s=e-n,o=e-n;for(;s>0;){let e=findClusterBreak(t,s,!1);if(r(t.slice(e,s))!=v.Word)break;s=e}for(;o<i;){let e=findClusterBreak(t,o);if(r(t.slice(o,e))!=v.Word)break;o=e}return s==o?null:EditorSelection.range(s+n,o+n)}};function combineConfig(e,t,n={}){let i={};for(let t of e)for(let e of Object.keys(t)){let r=t[e],s=i[e];if(void 0===s)i[e]=r;else if(s===r||void 0===r);else if(Object.hasOwnProperty.call(n,e))i[e]=n[e](s,r);else throw Error("Config merge conflict for field "+e)}for(let e in t)void 0===i[e]&&(i[e]=t[e]);return i}EditorState.allowMultipleSelections=p,EditorState.tabSize=Facet.define({combine:e=>e.length?e[0]:4}),EditorState.lineSeparator=O,EditorState.readOnly=y,EditorState.phrases=Facet.define({compare(e,t){let n=Object.keys(e),i=Object.keys(t);return n.length==i.length&&n.every(n=>e[n]==t[n])}}),EditorState.languageData=f,EditorState.changeFilter=g,EditorState.transactionFilter=m,EditorState.transactionExtender=S,Compartment.reconfigure=StateEffect.define();let RangeValue=class RangeValue{eq(e){return this==e}range(e,t=e){return Range.create(e,t,this)}};RangeValue.prototype.startSide=RangeValue.prototype.endSide=0,RangeValue.prototype.point=!1,RangeValue.prototype.mapMode=l.TrackDel;let Range=class Range{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new Range(e,t,n)}};function cmpRange(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}let Chunk=class Chunk{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,i=0){let r=n?this.to:this.from;for(let s=i,o=r.length;;){if(s==o)return s;let i=s+o>>1,a=r[i]-e||(n?this.value[i].endSide:this.value[i].startSide)-t;if(i==s)return a>=0?s:o;a>=0?o=i:s=i+1}}between(e,t,n,i){for(let r=this.findIndex(t,-1e9,!0),s=this.findIndex(n,1e9,!1,r);r<s;r++)if(!1===i(this.from[r]+e,this.to[r]+e,this.value[r]))return!1}map(e,t){let n=[],i=[],r=[],s=-1,o=-1;for(let a=0;a<this.value.length;a++){let l=this.value[a],h=this.from[a]+e,c=this.to[a]+e,u,d;if(h==c){let e=t.mapPos(h,l.startSide,l.mapMode);if(null==e||(u=d=e,l.startSide!=l.endSide&&(d=t.mapPos(h,l.endSide))<u))continue}else if((u=t.mapPos(h,l.startSide))>(d=t.mapPos(c,l.endSide))||u==d&&l.startSide>0&&l.endSide<=0)continue;0>(d-u||l.endSide-l.startSide)||(s<0&&(s=u),l.point&&(o=Math.max(o,d-u)),n.push(l),i.push(u-s),r.push(d-s))}return{mapped:n.length?new Chunk(i,r,n,o):null,pos:s}}};let RangeSet=class RangeSet{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new RangeSet(e,t,n,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:i=0,filterTo:r=this.length}=e,s=e.filter;if(0==t.length&&!s)return this;if(n&&(t=t.slice().sort(cmpRange)),this.isEmpty)return t.length?RangeSet.of(t):this;let o=new LayerCursor(this,null,-1).goto(0),a=0,l=[],h=new RangeSetBuilder;for(;o.value||a<t.length;)if(a<t.length&&(o.from-t[a].from||o.startSide-t[a].value.startSide)>=0){let e=t[a++];h.addInner(e.from,e.to,e.value)||l.push(e)}else 1==o.rangeIndex&&o.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(o.chunkIndex)<t[a].from)&&(!s||i>this.chunkEnd(o.chunkIndex)||r<this.chunkPos[o.chunkIndex])&&h.addChunk(this.chunkPos[o.chunkIndex],this.chunk[o.chunkIndex])?o.nextChunk():((!s||i>o.to||r<o.from||s(o.from,o.to,o.value))&&!h.addInner(o.from,o.to,o.value)&&l.push(Range.create(o.from,o.to,o.value)),o.next());return h.finishInner(this.nextLayer.isEmpty&&!l.length?RangeSet.empty:this.nextLayer.update({add:l,filter:s,filterFrom:i,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],i=-1;for(let r=0;r<this.chunk.length;r++){let s=this.chunkPos[r],o=this.chunk[r],a=e.touchesRange(s,s+o.length);if(!1===a)i=Math.max(i,o.maxPoint),t.push(o),n.push(e.mapPos(s));else if(!0===a){let{mapped:r,pos:a}=o.map(s,e);r&&(i=Math.max(i,r.maxPoint),t.push(r),n.push(a))}}let r=this.nextLayer.map(e);return 0==t.length?r:new RangeSet(n,t,r||RangeSet.empty,i)}
1between(e,t,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let r=this.chunkPos[i],s=this.chunk[i];if(t>=r&&e<=r+s.length&&!1===s.between(r,e-r,t-r,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return HeapCursor.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return HeapCursor.from(e).goto(t)}static compare(e,t,n,i,r=-1){let s=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r),a=findSharedChunks(s,o,n),l=new SpanCursor(s,a,r),h=new SpanCursor(o,a,r);n.iterGaps((e,t,n)=>compare(l,e,h,t,n,i)),n.empty&&0==n.length&&compare(l,0,h,0,0,i)}static eq(e,t,n=0,i){null==i&&(i=999999999);let r=e.filter(e=>!e.isEmpty&&0>t.indexOf(e)),s=t.filter(t=>!t.isEmpty&&0>e.indexOf(t));if(r.length!=s.length)return!1;if(!r.length)return!0;let o=findSharedChunks(r,s),a=new SpanCursor(r,o,0).goto(n),l=new SpanCursor(s,o,0).goto(n);for(;;){if(a.to!=l.to||!sameValues(a.active,l.active)||a.point&&(!l.point||!a.point.eq(l.point)))return!1;if(a.to>i)return!0;a.next(),l.next()}}static spans(e,t,n,i,r=-1){let s=new SpanCursor(e,null,r).goto(t),o=t,a=s.openStart;for(;;){let e=Math.min(s.to,n);if(s.point){let n=s.activeForPoint(s.to),r=s.pointFrom<t?n.length+1:s.point.startSide<0?n.length:Math.min(n.length,a);i.point(o,e,s.point,n,r,s.pointRank),a=Math.min(s.openEnd(e),n.length)}else e>o&&(i.span(o,e,s.active,a),a=s.openEnd(e));if(s.to>n)return a+(s.point&&s.to>n?1:0);o=s.to,s.next()}}static of(e,t=!1){let n=new RangeSetBuilder;for(let i of e instanceof Range?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let i=e[n];if(cmpRange(t,i)>0)return e.slice().sort(cmpRange);t=i}return e}(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return RangeSet.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=RangeSet.empty;i=i.nextLayer)t=new RangeSet(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}};RangeSet.empty=new RangeSet([],[],null,-1),RangeSet.empty.nextLayer=RangeSet.empty;let RangeSetBuilder=class RangeSetBuilder{finishChunk(e){this.chunks.push(new Chunk(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new RangeSetBuilder)).add(e,t,n)}addInner(e,t,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&0>(e-this.lastFrom||n.startSide-this.last.startSide))throw Error("Ranges must be added sorted by `from` position and `startSide`");return!(i<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if(0>(e-this.lastTo||t.value[0].startSide-this.last.endSide))return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(RangeSet.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=RangeSet.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function findSharedChunks(e,t,n){let i=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&i.set(t.chunk[e],t.chunkPos[e]);let r=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let s=i.get(e.chunk[t]);null==s||(n?n.mapPos(s):s)!=e.chunkPos[t]||(null==n?void 0:n.touchesRange(s,s+e.chunk[t].length))||r.add(e.chunk[t])}return r}let LayerCursor=class LayerCursor{constructor(e,t,n,i=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let t=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(t)||this.layer.chunkEnd(this.chunkIndex)<e||t.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,t){0>(this.to-e||this.endSide-t)&&this.gotoInner(e,t,!0)}next(){for(;;){if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}};let HeapCursor=class HeapCursor{constructor(e){this.heap=e}static from(e,t=null,n=-1){let i=[];for(let r=0;r<e.length;r++)for(let s=e[r];!s.isEmpty;s=s.nextLayer)s.maxPoint>=n&&i.push(new LayerCursor(s,t,n,r));return 1==i.length?i[0]:new HeapCursor(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let e=this.heap.length>>1;e>=0;e--)heapBubble(this.heap,e);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let e=this.heap.length>>1;e>=0;e--)heapBubble(this.heap,e);0>(this.to-e||this.value.endSide-t)&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),heapBubble(this.heap,0)}}};function heapBubble(e,t){for(let n=e[t];;){let i=(t<<1)+1;if(i>=e.length)break;let r=e[i];if(i+1<e.length&&r.compare(e[i+1])>=0&&(r=e[i+1],i++),0>n.compare(r))break;e[i]=n,e[t]=r,t=i}}let SpanCursor=class SpanCursor{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=HeapCursor.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&0>(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t);)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){remove(this.active,e),remove(this.activeTo,e),remove(this.activeRank,e),this.minActive=findMinIndex(this.active,this.activeTo)}
1addActive(e){let t=0,{value:n,to:i,rank:r}=this.cursor;for(;t<this.activeRank.length&&(r-this.activeRank[t]||i-this.activeTo[t])>0;)t++;insert(this.active,t,n),insert(this.activeTo,t,i),insert(this.activeRank,t,r),e&&insert(e,t,this.cursor.from),this.minActive=findMinIndex(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&0>(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&remove(n,i)}else if(this.cursor.value){if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let e=this.cursor.value;if(e.point){if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=e,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=e.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else this.addActive(n),this.cursor.next()}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let t=n.length-1;t>=0&&n[t]<e;t--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function compare(e,t,n,i,r,s){e.goto(t),n.goto(i);let o=i+r,a=i,l=i-t;for(;;){let t=e.to+l-n.to||e.endSide-n.endSide,i=t<0?e.to+l:n.to,r=Math.min(i,o);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&sameValues(e.activeForPoint(e.to),n.activeForPoint(n.to))||s.comparePoint(a,r,e.point,n.point):r>a&&!sameValues(e.active,n.active)&&s.compareRange(a,r,e.active,n.active),i>o)break;a=i,t<=0&&e.next(),t>=0&&n.next()}}function sameValues(e,t){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n]&&!e[n].eq(t[n]))return!1;return!0}function remove(e,t){for(let n=t,i=e.length-1;n<i;n++)e[n]=e[n+1];e.pop()}function insert(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function findMinIndex(e,t){let n=-1,i=1e9;for(let r=0;r<t.length;r++)0>(t[r]-i||e[r].endSide-e[n].endSide)&&(n=r,i=t[r]);return n}function countColumn(e,t,n=e.length){let i=0;for(let r=0;r<n;)9==e.charCodeAt(r)?(i+=t-i%t,r++):(i++,r=findClusterBreak(e,r));return i}function findColumn(e,t,n,i){for(let i=0,r=0;;){if(r>=t)return i;if(i==e.length)break;r+=9==e.charCodeAt(i)?n-r%n:1,i=findClusterBreak(e,i)}return!0===i?-1:e.length}},41113:function(e,t,n){"use strict";var i,r;n.d(t,{Jq:function(){return NodeType},L3:function(){return s},Lj:function(){return NodeSet},_b:function(){return Parser},hr:function(){return NodeWeakMap},i9:function(){return TreeFragment},md:function(){return NodeProp},mp:function(){return Tree},vj:function(){return i}});let s=1024,o=0;let Range=class Range{constructor(e,t){this.from=e,this.to=t}};let NodeProp=class NodeProp{constructor(e={}){this.id=o++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw RangeError("Can't add per-node props to node types");return"function"!=typeof e&&(e=NodeType.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}};NodeProp.closedBy=new NodeProp({deserialize:e=>e.split(" ")}),NodeProp.openedBy=new NodeProp({deserialize:e=>e.split(" ")}),NodeProp.group=new NodeProp({deserialize:e=>e.split(" ")}),NodeProp.isolate=new NodeProp({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw RangeError("Invalid value for isolate: "+e);return e||"auto"}}),NodeProp.contextHash=new NodeProp({perNode:!0}),NodeProp.lookAhead=new NodeProp({perNode:!0}),NodeProp.mounted=new NodeProp({perNode:!0});let MountedTree=class MountedTree{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[NodeProp.mounted.id]}};let a=Object.create(null);let NodeType=class NodeType{constructor(e,t,n,i=0){this.name=e,this.props=t,this.id=n,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):a,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),i=new NodeType(e.name||"",t,e.id,n);if(e.props){for(let n of e.props)if(Array.isArray(n)||(n=n(i)),n){if(n[0].perNode)throw RangeError("Can't store a per-node prop on a node type");t[n[0].id]=n[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(NodeProp.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let i of n.split(" "))t[i]=e[n];return e=>{for(let n=e.prop(NodeProp.group),i=-1;i<(n?n.length:0);i++){let r=t[i<0?e.name:n[i]];if(r)return r}}}};
1NodeType.none=new NodeType("",Object.create(null),0,8);let NodeSet=class NodeSet{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let n of this.types){let i=null;for(let t of e){let e=t(n);e&&(i||(i=Object.assign({},n.props)),i[e[0].id]=e[1])}t.push(i?new NodeType(n.name,i,n.id,n.flags):n)}return new NodeSet(t)}};let l=new WeakMap,h=new WeakMap;(r=i||(i={}))[r.ExcludeBuffers=1]="ExcludeBuffers",r[r.IncludeAnonymous=2]="IncludeAnonymous",r[r.IgnoreMounts=4]="IgnoreMounts",r[r.IgnoreOverlays=8]="IgnoreOverlays";let Tree=class Tree{constructor(e,t,n,i,r){if(this.type=e,this.children=t,this.positions=n,this.length=i,this.props=null,r&&r.length)for(let[e,t]of(this.props=Object.create(null),r))this.props["number"==typeof e?e:e.id]=t}toString(){let e=MountedTree.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let e of this.children){let n=e.toString();n&&(t&&(t+=","),t+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new TreeCursor(this.topNode,e)}cursorAt(e,t=0,n=0){let i=l.get(this)||this.topNode,r=new TreeCursor(i);return r.moveTo(e,t),l.set(this,r._tree),r}get topNode(){return new TreeNode(this,0,0,null)}resolve(e,t=0){let n=resolveNode(l.get(this)||this.topNode,e,t,!1);return l.set(this,n),n}resolveInner(e,t=0){let n=resolveNode(h.get(this)||this.topNode,e,t,!0);return h.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let i=e.resolveInner(t,n),r=null;for(let e=i instanceof TreeNode?i:i.context.parent;e;e=e.parent)if(e.index<0){let s=e.parent;(r||(r=[i])).push(s.resolve(t,n)),e=s}else{let s=MountedTree.get(e.tree);if(s&&s.overlay&&s.overlay[0].from<=t&&s.overlay[s.overlay.length-1].to>=t){let o=new TreeNode(s.tree,s.overlay[0].from+e.from,-1,e);(r||(r=[i])).push(resolveNode(o,t,n,!1))}}return r?iterStack(r):i}(this,e,t)}iterate(e){let{enter:t,leave:n,from:r=0,to:s=this.length}=e,o=e.mode||0,a=(o&i.IncludeAnonymous)>0;for(let e=this.cursor(o|i.IncludeAnonymous);;){let i=!1;if(e.from<=s&&e.to>=r&&(!a&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;i=!0}for(;i&&n&&(a||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;i=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];
1if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:balanceRange(NodeType.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new Tree(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new Tree(NodeType.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:i,maxBufferLength:r=s,reused:o=[],minRepeatType:a=i.types.length}=e,l=Array.isArray(n)?new FlatBufferCursor(n,n.length):n,h=i.types,c=0,u=0;function makeRepeatLeaf(e,t,n,r,s,o,a,l){let h=[],c=[];for(;e.length>r;)h.push(e.pop()),c.push(t.pop()+n-s);e.push(makeTree(i.types[a],h,c,o-s,l-o)),t.push(s-n)}function makeTree(e,t,n,i,r=0,s){if(c){let e=[NodeProp.contextHash,c];s=s?[e].concat(s):[e]}if(r>25){let e=[NodeProp.lookAhead,r];s=s?[e].concat(s):[e]}return new Tree(e,t,n,i,s)}let d=[],f=[];for(;l.pos>0;)!function takeNode(e,t,n,s,d,f){let{id:p,start:O,end:g,size:m}=l,S=u;for(;m<0;){if(l.next(),-1==m){let t=o[p];n.push(t),s.push(O-e);return}if(-3==m){c=p;return}if(-4==m){u=p;return}throw RangeError(`Unrecognized record size: ${m}`)}let y=h[p],k,v,x=O-e;if(g-O<=r&&(v=function(e,t){let n=l.fork(),i=0,s=0,o=0,h=n.end-r,c={size:0,start:0,skip:0};t:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){c.size=i,c.start=s,c.skip=o,o+=4,i+=4,n.next();continue}let l=n.pos-e;if(e<0||l<r||n.start<h)break;let u=n.id>=a?4:0,d=n.start;for(n.next();n.pos>l;){if(n.size<0){if(-3==n.size)u+=4;else break t}else n.id>=a&&(u+=4);n.next()}s=d,i+=e,o+=u}return(t<0||i==e)&&(c.size=i,c.start=s,c.skip=o),c.size>4?c:void 0}(l.pos-t,d))){let t=new Uint16Array(v.size-v.skip),n=l.pos-v.size,r=t.length;for(;l.pos>n;)r=function copyToBuffer(e,t,n){let{id:i,start:r,end:s,size:o}=l;if(l.next(),o>=0&&i<a){let a=n;if(o>4){let i=l.pos-(o-4);for(;l.pos>i;)n=copyToBuffer(e,t,n)}t[--n]=a,t[--n]=s-e,t[--n]=r-e,t[--n]=i}else -3==o?c=i:-4==o&&(u=i);return n}(v.start,t,r);k=new TreeBuffer(t,g-v.start,i),x=v.start-e}else{let e=l.pos-m;l.next();let t=[],n=[],s=p>=a?p:-1,o=0,h=g;for(;l.pos>e;)s>=0&&l.id==s&&l.size>=0?(l.end<=h-r&&(makeRepeatLeaf(t,n,O,o,l.end,h,s,S),o=t.length,h=l.end),l.next()):f>2500?function(e,t,n,s){let o=[],a=0,h=-1;for(;l.pos>t;){let{id:e,start:t,end:n,size:i}=l;if(i>4)l.next();else if(h>-1&&t<h)break;
1else h<0&&(h=n-r),o.push(e,t,n),a++,l.next()}if(a){let t=new Uint16Array(4*a),r=o[o.length-2];for(let e=o.length-3,n=0;e>=0;e-=3)t[n++]=o[e],t[n++]=o[e+1]-r,t[n++]=o[e+2]-r,t[n++]=n;n.push(new TreeBuffer(t,o[2]-r,i)),s.push(r-e)}}(O,e,t,n):takeNode(O,e,t,n,s,f+1);if(s>=0&&o>0&&o<t.length&&makeRepeatLeaf(t,n,O,o,O,h,s,S),t.reverse(),n.reverse(),s>-1&&o>0){let e=function(e){return(t,n,i)=>{let r=0,s=t.length-1,o,a;if(s>=0&&(o=t[s])instanceof Tree){if(!s&&o.type==e&&o.length==i)return o;(a=o.prop(NodeProp.lookAhead))&&(r=n[s]+o.length+a)}return makeTree(e,t,n,i,r)}}(y);k=balanceRange(y,t,n,0,t.length,0,g-O,e,e)}else k=makeTree(y,t,n,g-O,S-g)}n.push(k),s.push(x)}(e.start||0,e.bufferStart||0,d,f,-1,0);let p=null!==(t=e.length)&&void 0!==t?t:d.length?f[0]+d[0].length:0;return new Tree(h[e.topID],d.reverse(),f.reverse(),p)}(e)}};Tree.empty=new Tree(NodeType.none,[],[],0);let FlatBufferCursor=class FlatBufferCursor{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new FlatBufferCursor(this.buffer,this.index)}};let TreeBuffer=class TreeBuffer{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return NodeType.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],n=this.buffer[e+3],i=this.set.types[t],r=i.name;if(/\W/.test(r)&&!i.isError&&(r=JSON.stringify(r)),n==(e+=4))return r;let s=[];for(;e<n;)s.push(this.childString(e)),e=this.buffer[e+3];return r+"("+s.join(",")+")"}findChild(e,t,n,i,r){let{buffer:s}=this,o=-1;for(let a=e;a!=t&&(!checkSide(r,i,s[a+1],s[a+2])||(o=a,!(n>0)));a=s[a+3]);return o}slice(e,t,n){let i=this.buffer,r=new Uint16Array(t-e),s=0;for(let o=e,a=0;o<t;){r[a++]=i[o++],r[a++]=i[o++]-n;let t=r[a++]=i[o++]-n;r[a++]=i[o++]-e,s=Math.max(s,t)}return new TreeBuffer(r,s,this.set)}};function checkSide(e,t,n,i){switch(e){case -2:return n<t;case -1:return i>=t&&n<t;case 0:return n<t&&i>t;case 1:return n<=t&&i>t;case 2:return i>t;case 4:return!0}}function resolveNode(e,t,n,r){for(var s;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to<t);){let t=!r&&e instanceof TreeNode&&e.index<0?null:e.parent;if(!t)return e;e=t}let o=r?0:i.IgnoreOverlays;if(r)for(let i=e,r=i.parent;r;r=(i=r).parent)i instanceof TreeNode&&i.index<0&&(null===(s=r.enter(t,n,o))||void 0===s?void 0:s.from)!=i.from&&(e=r);for(;;){let i=e.enter(t,n,o);if(!i)return e;e=i}}let BaseNode=class BaseNode{cursor(e=0){return new TreeCursor(this,e)}getChild(e,t=null,n=null){let i=getChildren(this,e,t,n);return i.length?i[0]:null}getChildren(e,t=null,n=null){return getChildren(this,e,t,n)}resolve(e,t=0){return resolveNode(this,e,t,!1)}resolveInner(e,t=0){return resolveNode(this,e,t,!0)}matchContext(e){return matchNodeContext(this,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),n=this;for(;t;){let e=t.lastChild;if(!e||e.to!=t.to)break;e.type.isError&&e.from==e.to?(n=t,t=e.prevSibling):t=e}return n}get node(){return this}get next(){return this.parent}};let TreeNode=class TreeNode extends BaseNode{constructor(e,t,n,i){super(),this._tree=e,this.from=t,this.index=n,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,n,r,s=0){for(let o=this;;){for(let{children:a,positions:l}=o._tree,h=t>0?a.length:-1;e!=h;e+=t){let h=a[e],c=l[e]+o.from;if(checkSide(r,n,c,c+h.length)){if(h instanceof TreeBuffer){if(s&i.ExcludeBuffers)continue;let a=h.findChild(0,h.buffer.length,t,n-c,r);if(a>-1)return new BufferNode(new BufferContext(o,h,e,c),null,a)}else if(s&i.IncludeAnonymous||!h.type.isAnonymous||hasChild(h)){let a;if(!(s&i.IgnoreMounts)&&(a=MountedTree.get(h))&&!a.overlay)return new TreeNode(a.tree,c,e,o);let l=new TreeNode(h,c,e,o);return s&i.IncludeAnonymous||!l.type.isAnonymous?l:l.nextChild(t<0?h.children.length-1:0,t,n,r)}}}if(s&i.IncludeAnonymous||!o.type.isAnonymous||(e=o.index>=0?o.index+t:t<0?-1:o._parent._tree.children.length,!(o=o._parent)))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let r;if(!(n&i.IgnoreOverlays)&&(r=MountedTree.get(this._tree))&&r.overlay){let n=e-this.from;for(let{from:e,to:i}of r.overlay)if((t>0?e<=n:e<n)&&(t<0?i>=n:i>n))return new TreeNode(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function getChildren(e,t,n,i){let r=e.cursor(),s=[];if(!r.firstChild())return s;if(null!=n){for(let e=!1;!e;)if(e=r.type.is(n),!r.nextSibling())return s}for(;;){if(null!=i&&r.type.is(i))return s;if(r.type.is(t)&&s.push(r.node),!r.nextSibling())return null==i?s:[]}}function matchNodeContext(e,t,n=t.length-1){for(let i=e.parent;n>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[n]&&t[n]!=i.name)return!1;n--}}return!0}let BufferContext=class BufferContext{constructor(e,t,n,i){this.parent=e,this.buffer=t,this.index=n,this.start=i}};let BufferNode=class BufferNode extends BaseNode{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:i}=this.context,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new BufferNode(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&i.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new BufferNode(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.
vendor: 1,359 bytes, line 1
1index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new BufferNode(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new BufferNode(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,i=this.index+4,r=n.buffer[this.index+3];if(r>i){let s=n.buffer[this.index+1];e.push(n.slice(i,r,s)),t.push(0)}return new Tree(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function iterStack(e){if(!e.length)return null;let t=0,n=e[0];for(let i=1;i<e.length;i++){let r=e[i];(r.from>n.from||r.to<n.to)&&(n=r,t=i)}let i=n instanceof TreeNode&&n.index<0?null:n.parent,r=e.slice();return i?r[t]=i:r.splice(t,1),new StackIterator(r,n)}let StackIterator=class StackIterator{constructor(e,t){this.heads=e,this.node=t}get next(){return iterStack(this.heads)}};let TreeCursor=class TreeCursor{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof TreeNode)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;
vendor: 6,058 bytes, line 1
1for(let t=e._parent;t;t=t._parent)this.stack.unshift(t.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return!!e&&(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0)}yieldBuf(e,t){this.index=e;let{start:n,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=n+i.buffer[e+1],this.to=n+i.buffer[e+2],!0}yield(e){return!!e&&(e instanceof TreeNode?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)))}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:i}=this.buffer,r=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,n);return!(r<0)&&(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?!(n&i.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&i.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&i.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return!!this._tree._parent&&this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode));let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let e=n<0?0:this.stack[n]+4;if(this.index!=e)return this.yieldBuf(t.findChild(e,this.index,-1,0,4))}else{let e=t.buffer[this.index+3];if(e<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(e)}return n<0&&this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode))}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(r.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=r)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let r=t+e,s=e<0?-1:n._tree.children.length;r!=s;r+=e){let e=n._tree.children[r];if(this.mode&i.IncludeAnonymous||e instanceof TreeBuffer||!e.type.isAnonymous||hasChild(e))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,n=0;if(e&&e.context==this.buffer)t:for(let i=this.index,r=this.stack.length;r>=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;t=s,n=r+1;break t}i=this.stack[--r]}for(let e=n;e<this.stack.length;e++)t=new BufferNode(this.buffer,t,this.stack[e]);return this.bufferNode=new BufferNode(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let i=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(i=!0)}for(;i&&t&&t(this),i=this.type.isAnonymous,!this.nextSibling();){if(!n)return;this.parent(),n--,i=!0}}}matchContext(e){if(!this.buffer)return matchNodeContext(this.node,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let i=e.length-1,r=this.stack.length-1;i>=0;r--){if(r<0)return matchNodeContext(this.node,e,i);let s=n[t.buffer[this.stack[r]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}};function hasChild(e){return e.children.some(e=>e instanceof TreeBuffer||!e.type.isAnonymous||hasChild(e))}let c=new WeakMap;function nodeSize(e,t){if(!e.isAnonymous||t instanceof TreeBuffer||t.type!=e)return 1;let n=c.get(t);if(null==n){for(let i of(n=1,t.children)){if(i.type!=e||!(i instanceof Tree)){n=1;break}n+=nodeSize(e,i)}c.set(t,n)}return n}function balanceRange(e,t,n,i,r,s,o,a,l){let h=0;for(let n=i;n<r;n++)h+=nodeSize(e,t[n]);let c=Math.ceil(1.5*h/8),u=[],d=[];return!function divide(t,n,i,r,o){for(let a=i;a<r;){let i=a,h=n[a],f=nodeSize(e,t[a]);for(a++;a<r;a++){let n=nodeSize(e,t[a]);if(f+n>=c)break;f+=n}if(a==i+1){if(f>c){let e=t[i];divide(e.children,e.positions,0,e.children.length,n[i]+o);continue}u.push(t[i])}else{let r=n[a-1]+t[a-1].length-h;u.push(balanceRange(e,t,n,i,a,h,r,null,l))}d.push(h+o-s)}}(t,n,i,r,0),(a||l)(u,d,o)}let NodeWeakMap=class NodeWeakMap{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof BufferNode?this.setBuffer(e.context.buffer,e.index,t):e instanceof TreeNode&&this.map.set(e.tree,t)}get(e){return e instanceof BufferNode?this.getBuffer(e.context.buffer,e.index):e instanceof TreeNode?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}};let TreeFragment=class TreeFragment{constructor(e,t,n,i,r=!1,s=!1){this.from=e,this.to=t,this.tree=n,this.offset=i,this.open=(r?1:0)|(s?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let i=[new TreeFragment(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&i.push(n);return i}static applyChanges(e,t,n=128){if(!t.length)return e;let i=[],r=1,s=e.length?e[0]:null;for(let o=0,a=0,l=0;;o++){let h=o<t.length?t[o]:null,c=h?h.fromA:1e9;if(c-a>=n)for(;s&&s.from<c;){let t=s;if(a>=t.from||c<=t.to||l){let e=Math.max(t.from,a)-l,n=Math.min(t.to,c)-l;t=e>=n?null:new TreeFragment(e,n,t.tree,t.offset+l,o>
10,!!h)}if(t&&i.push(t),s.to>c)break;s=r<e.length?e[r++]:null}if(!h)break;a=h.toA,l=h.toA-h.toB}return i}};let Parser=class Parser{startParse(e,t,n){return"string"==typeof e&&(e=new StringInput(e)),n=n?n.length?n.map(e=>new Range(e.from,e.to)):[new Range(0,0)]:[new Range(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let i=this.startParse(e,t,n);for(;;){let e=i.advance();if(e)return e}}};let StringInput=class StringInput{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};new NodeProp({perNode:!0})},35524:function(e,t,n){"use strict";n.d(t,{Gv:function(){return styleTags},QR:function(){return tagHighlighter},bW:function(){return highlightTree},pJ:function(){return x}});var i=n(41113);let r=0;let Tag=class Tag{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=r++}static define(e){if(null==e?void 0:e.base)throw Error("Can not derive from a modified tag");let t=new Tag([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new Modifier;return t=>t.modified.indexOf(e)>-1?t:Modifier.get(t.base||t,t.modified.concat(e).sort((e,t)=>e.id-t.id))}};let s=0;let Modifier=class Modifier{constructor(){this.instances=[],this.id=s++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(n=>{var i;return n.base==e&&(i=n.modified,t.length==i.length&&t.every((e,t)=>e==i[t]))});if(n)return n;let i=[],r=new Tag(i,e,t);for(let e of t)e.instances.push(r);let s=function(e){let t=[[]];for(let n=0;n<e.length;n++)for(let i=0,r=t.length;i<r;i++)t.push(t[i].concat(e[n]));return t.sort((e,t)=>t.length-e.length)}(t);for(let t of e.set)if(!t.modified.length)for(let e of s)i.push(Modifier.get(t,e));return r}};function styleTags(e){let t=Object.create(null);for(let n in e){let i=e[n];for(let e of(Array.isArray(i)||(i=[i]),n.split(" ")))if(e){let n=[],r=2,s=e;for(let t=0;;){if("..."==s&&t>0&&t+3==e.length){r=1;break}let i=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(s);if(!i)throw RangeError("Invalid path: "+e);if(n.push("*"==i[0]?"":'"'==i[0][0]?JSON.parse(i[0]):i[0]),(t+=i[0].length)==e.length)break;let o=e[t++];if(t==e.length&&"!"==o){r=0;break}if("/"!=o)throw RangeError("Invalid path: "+e);s=e.slice(t)}let o=n.length-1,a=n[o];if(!a)throw RangeError("Invalid path: "+e);let l=new Rule(i,r,o>0?n.slice(0,o):null);t[a]=l.sort(t[a])}}return o.add(t)}let o=new i.md;let Rule=class Rule{constructor(e,t,n,i){this.tags=e,this.mode=t,this.context=n,this.next=i}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}};function tagHighlighter(e,t){let n=Object.create(null);for(let t of e)if(Array.isArray(t.tag))for(let e of t.tag)n[e.id]=t.class;else n[t.tag.id]=t.class;let{scope:i,all:r=null}=t||{};return{style:e=>{let t=r;for(let i of e)for(let e of i.set){let i=n[e.id];if(i){t=t?t+" "+i:i;break}}return t},scope:i}}function highlightTree(e,t,n,i=0,r=e.length){let s=new HighlightBuilder(i,Array.isArray(t)?t:[t],n);s.highlightRange(e.cursor(),i,r,"",s.highlighters),s.flush(r)}Rule.empty=new Rule([],2,null);let HighlightBuilder=class HighlightBuilder{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,r,s){let{type:a,from:l,to:h}=e;if(l>=n||h<=t)return;a.isTop&&(s=this.highlighters.filter(e=>!e.scope||e.scope(a)));let c=r,u=function(e){let t=e.type.prop(o);for(;t&&t.context&&!e.matchContext(t.context);
1)t=t.next;return t||null}(e)||Rule.empty,d=function(e,t){let n=null;for(let i of e){let e=i.style(t);e&&(n=n?n+" "+e:e)}return n}(s,u.tags);if(d&&(c&&(c+=" "),c+=d,1==u.mode&&(r+=(r?" ":"")+d)),this.startSpan(Math.max(t,l),c),u.opaque)return;let f=e.tree&&e.tree.prop(i.md.mounted);if(f&&f.overlay){let i=e.node.enter(f.overlay[0].from+l,1),o=this.highlighters.filter(e=>!e.scope||e.scope(f.tree.type)),a=e.firstChild();for(let u=0,d=l;;u++){let p=u<f.overlay.length?f.overlay[u]:null,O=p?p.from+l:h,g=Math.max(t,d),m=Math.min(n,O);if(g<m&&a)for(;e.from<m&&(this.highlightRange(e,g,m,r,s),this.startSpan(Math.min(m,e.to),c),!(e.to>=O)&&e.nextSibling()););if(!p||O>n)break;(d=p.to+l)>t&&(this.highlightRange(i.cursor(),Math.max(t,p.from+l),Math.min(n,d),"",o),this.startSpan(Math.min(n,d),c))}a&&e.parent()}else if(e.firstChild()){f&&(r="");do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,r,s),this.startSpan(Math.min(n,e.to),c)}while(e.nextSibling());e.parent()}}};let a=Tag.define,l=a(),h=a(),c=a(h),u=a(h),d=a(),f=a(d),p=a(d),O=a(),g=a(O),m=a(),S=a(),y=a(),k=a(y),v=a(),x={comment:l,lineComment:a(l),blockComment:a(l),docComment:a(l),name:h,variableName:a(h),typeName:c,tagName:a(c),propertyName:u,attributeName:a(u),className:a(h),labelName:a(h),namespace:a(h),macroName:a(h),literal:d,string:f,docString:a(f),character:a(f),attributeValue:a(f),number:p,integer:a(p),float:a(p),bool:a(d),regexp:a(d),escape:a(d),color:a(d),url:a(d),keyword:m,self:a(m),null:a(m),atom:a(m),unit:a(m),modifier:a(m),operatorKeyword:a(m),controlKeyword:a(m),definitionKeyword:a(m),moduleKeyword:a(m),operator:S,derefOperator:a(S),arithmeticOperator:a(S),logicOperator:a(S),bitwiseOperator:a(S),compareOperator:a(S),updateOperator:a(S),definitionOperator:a(S),typeOperator:a(S),controlOperator:a(S),punctuation:y,separator:a(y),bracket:k,angleBracket:a(k),squareBracket:a(k),paren:a(k),brace:a(k),content:O,heading:g,heading1:a(g),heading2:a(g),heading3:a(g),heading4:a(g),heading5:a(g),heading6:a(g),contentSeparator:a(O),list:a(O),quote:a(O),emphasis:a(O),strong:a(O),link:a(O),monospace:a(O),strikethrough:a(O),inserted:a(),deleted:a(),changed:a(),invalid:a(),meta:v,documentMeta:a(v),annotation:a(v),processingInstruction:a(v),definition:Tag.defineModifier(),constant:Tag.defineModifier(),function:Tag.defineModifier(),standard:Tag.defineModifier(),local:Tag.defineModifier(),special:Tag.defineModifier()};tagHighlighter([{tag:x.link,class:"tok-link"},{tag:x.heading,class:"tok-heading"},{tag:x.emphasis,class:"tok-emphasis"},{tag:x.strong,class:"tok-strong"},{tag:x.keyword,class:"tok-keyword"},{tag:x.atom,class:"tok-atom"},{tag:x.bool,class:"tok-bool"},{tag:x.url,class:"tok-url"},{tag:x.labelName,class:"tok-labelName"},{tag:x.inserted,class:"tok-inserted"},{tag:x.deleted,class:"tok-deleted"},{tag:x.literal,class:"tok-literal"},{tag:x.string,class:"tok-string"},{tag:x.number,class:"tok-number"},{tag:[x.regexp,x.escape,x.special(x.string)],class:"tok-string2"},{tag:x.variableName,class:"tok-variableName"},{tag:x.local(x.variableName),class:"tok-variableName tok-local"},{tag:x.definition(x.variableName),class:"tok-variableName tok-definition"},{tag:x.special(x.variableName),class:"tok-variableName2"},{tag:x.definition(x.propertyName),class:"tok-propertyName tok-definition"},{tag:x.typeName,class:"tok-typeName"},{tag:x.namespace,class:"tok-namespace"},{tag:x.className,class:"tok-className"},{tag:x.macroName,class:"tok-macroName"},{tag:x.propertyName,class:"tok-propertyName"},{tag:x.operator,class:"tok-operator"},{tag:x.comment,class:"tok-comment"},{tag:x.meta,class:"tok-meta"},{tag:x.invalid,class:"tok-invalid"},{tag:x.punctuation,class:"tok-punctuation"}])},28699:function(e,t,n){"use strict";n.d(t,{V:function(){return StyleModule}});let i="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),r="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};let StyleModule=class StyleModule{constructor(e,t){this.rules=[];let{finish:n}=t||{};function splitSelector(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}for(let t in e)!function render(e,t,i,r){let s=[],o=/^@(\w+)\b/.exec(e[0]),a=o&&"keyframes"==o[1];if(o&&null==t)return i.push(e[0]+";");for(let n in t){let r=t[n];if(/&/.test(n))render(n.split(/,\s*/).map(t=>e.map(e=>t.replace(/&/,e))).reduce((e,t)=>
1e.concat(t)),r,i);else if(r&&"object"==typeof r){if(!o)throw RangeError("The value of a property ("+n+") should be a primitive value.");render(splitSelector(n),r,s,a)}else null!=r&&s.push(n.replace(/_.*/,"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())+": "+r+";")}(s.length||a)&&i.push((!n||o||r?e:e.map(n)).join(", ")+" {"+s.join(" ")+"}")}(splitSelector(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=s[i]||1;return s[i]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let i=e[r],s=n&&n.nonce;i?s&&i.setNonce(s):i=new StyleSet(e,s),i.mount(Array.isArray(t)?t:[t],e)}};let o=new Map;let StyleSet=class StyleSet{constructor(e,t){let n=e.ownerDocument||e,i=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let t=o.get(n);if(t)return e[r]=t;this.sheet=new i.CSSStyleSheet,o.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[r]=this}mount(e,t){let n=this.sheet,i=0,r=0;for(let t=0;t<e.length;t++){let s=e[t],o=this.modules.indexOf(s);if(o<r&&o>-1&&(this.modules.splice(o,1),r--,o=-1),-1==o){if(this.modules.splice(r++,0,s),n)for(let e=0;e<s.rules.length;e++)n.insertRule(s.rules[e],i++)}else{for(;r<o;)i+=this.modules[r++].rules.length;i+=s.rules.length,r++}}if(n)0>t.adoptedStyleSheets.indexOf(this.sheet)&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let e="";for(let t=0;t<this.modules.length;t++)e+=this.modules[t].getRules()+"\n";this.styleTag.textContent=e;let n=t.head||t;this.styleTag.parentNode!=n&&n.insertBefore(this.styleTag,n.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}},81754:function(e,t,n){"use strict";n.d(t,{YG:function(){return keyName},uY:function(){return r},ue:function(){return i}});for(var i={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},r={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},s="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),o="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),a=0;a<10;a++)i[48+a]=i[96+a]=String(a);for(var a=1;a<=24;a++)i[a+111]="F"+a;for(var a=65;a<=90;a++)i[a]=String.fromCharCode(a+32),r[a]=String.fromCharCode(a);for(var l in i)r.hasOwnProperty(l)||(r[l]=i[l]);function keyName(e){var t=!(s&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||o&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?r:i)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}}}]);

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.