1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="45cc033c-b6e7-4aa1-90d7-a02f98778c4a",e._sentryDebugIdIdentifier="sentry-dbid-45cc033c-b6e7-4aa1-90d7-a02f98778c4a")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1301],{34790:function(e,t,n){n.d(t,{B1:function(){return eC},GA:function(){return ew},Gn:function(){return el},Mb:function(){return a},TK:function(){return o},eC:function(){return h},vQ:function(){return ed},ys:function(){return eA}});var r=n(78120),i=n(47421),s=n(59119);class o{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),r=t.text.slice(n-t.from,this.pos-t.from),i=r.search(f(e,!1));return i<0?null:{from:n+i,to:this.pos,text:r.slice(i)}}get aborted(){return null==this.abortListeners}addEventListener(e,t){"abort"==e&&this.abortListeners&&this.abortListeners.push(t)}}function l(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 a(e){let t=e.map(e=>"string"==typeof e?{label:e}:e),[n,r]=t.every(e=>/^\w+$/.test(e.label))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e<r.length;e++)n[r[e]]=!0}let r=l(t)+l(n)+"*$";return[RegExp("^"+r),new RegExp(r)]}(t);return e=>{let i=e.matchBefore(r);return i||e.explicit?{from:i?i.from:e.pos,options:t,validFor:n}:null}}function h(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)}}class c{constructor(e,t,n,r){this.completion=e,this.source=t,this.match=n,this.score=r}}function u(e){return e.selection.main.from}function f(e,t){var n;let{source:r}=e,i=t&&"^"!=r[0],s="$"!=r[r.length-1];return i||s?RegExp(`${i?"^":""}(?:${r})${s?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}let d=r.q6.define(),p=new WeakMap;function m(e){if(!Array.isArray(e))return e;let t=p.get(e);return t||p.set(e,t=a(e)),t}let g=r.Py.define(),v=r.Py.define();class y{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,r.gm)(e,t),i=(0,r.nZ)(n);this.chars.push(n);let s=e.slice(t,t+i),o=s.toUpperCase();this.folded.push((0,r.gm)(o==s?s.toLowerCase():o,0)),t+=i}this.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:i,precise:s,byWord:o}=this;if(1==t.length){let i=(0,r.gm)(e,0),s=(0,r.nZ)(i),o=s==e.length?0:-100;if(i==t[0]);else{if(i!=n[0])return null;o+=-200}return this.ret(o,[0,s])}let l=e.indexOf(this.pattern);if(0==l)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=t.length,h=0;if(l<0){for(let s=0,o=Math.min(e.length,200);s<o&&h<a;){let o=(0,r.gm)(e,s);(o==t[h]||o==n[h])&&(i[h++]=s),s+=(0,r.nZ)(o)}if(h<a)return null}let c=0,u=0,f=!1,d=0,p=-1,m=-1,g=/[a-z]/.test(e),v=!0;for(let i=0,h=Math.min(e.length,200),y=0;i<h&&u<a;){let h=(0,r.gm)(e,i);l<0&&(c<a&&h==t[c]&&(s[c++]=i),d<a&&(h==t[d]||h==n[d]?(0==d&&(p=i),m=i+1,d++):d=0));let w,x=h<255?h>=48&&h<=57||h>=97&&h<=122?2:h>=65&&h<=90?1:0:(w=(0,r.bg)(h))!=w.toLowerCase()?1:w!=w.toUpperCase()?2:0;(!i||1==x&&g||0==y&&0!=x)&&(t[u]==h||n[u]==h&&(f=!0)?o[u++]=i:o.length&&(v=!1)),y=x,i+=(0,r.nZ)(h)}return u==a&&0==o[0]&&v?this.result(-100+(f?-200:0),o,e):d==a&&0==p?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):d==a?this.ret(-900-e.length,[p,m]):u==a?this.result(-100+(f?-200:0)+-700+(v?0:-1100),o,e):2==t.length?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,n){let i=[],s=0;for(let e of t){let t=e+(this.astral?(0,r.nZ)((0,r.gm)(n,e)):1);s&&i[s-1]==e?i[s-1]=t:(i[s++]=e,i[s++]=t)}return this.ret(e-n.length,i)}}class w{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 x=r.r$.define({combine:e=>(0,r.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:b,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=>k(e(n),t(n)),optionClass:(e,t)=>n=>k(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>
vendor: 4,113 bytes, line 1
1e||t})});function k(e,t){return e?t?e+" "+t:e:t}function b(e,t,n,r,s,o){let l=e.textDirection==i.Nm.RTL,a=l,h=!1,c="top",u,f,d=t.left-s.left,p=s.right-t.right,m=r.right-r.left,g=r.bottom-r.top;if(a&&d<Math.min(m,p)?a=!1:!a&&p<Math.min(m,d)&&(a=!0),m<=(a?d:p))u=Math.max(s.top,Math.min(n.top,s.bottom-g))-t.top,f=Math.min(400,a?d:p);else{h=!0,f=Math.min(400,(l?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)}return{style:`${c}: ${u/((t.bottom-t.top)/o.offsetHeight)}px; max-width: ${f/((t.right-t.left)/o.offsetWidth)}px`,class:"cm-completionInfo-"+(h?l?"left-narrow":"right-narrow":a?"left":"right")}}function S(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 r=Math.floor((e-t)/n);return{from:e-(r+1)*n,to:e-r*n}}class A{constructor(e,t,n){let r;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 i=e.state.field(t),{options:s,selected:o}=i.open,l=e.state.facet(x);this.optionContent=(r=l.addToOptions.slice(),l.icons&&r.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}),r.push({render(e,t,n,r){let i=document.createElement("span");i.className="cm-completionLabel";let s=e.displayLabel||e.label,o=0;for(let e=0;e<r.length;){let t=r[e++],n=r[e++];t>o&&i.appendChild(document.createTextNode(s.slice(o,t)));let l=i.appendChild(document.createElement("span"));l.appendChild(document.createTextNode(s.slice(t,n))),l.className="cm-completionMatchedText",o=n}return o<s.length&&i.appendChild(document.createTextNode(s.slice(o))),i},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}),r.sort((e,t)=>e.position-t.position).map(e=>e.render)),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=S(s.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",n=>{let{options:r}=e.state.field(t).open;for(let t=n.target,i;t&&t!=this.dom;t=t.parentNode)if("LI"==t.nodeName&&(i=/-(\d+)$/.exec(t.id))&&+i[1]<r.length){this.applyCompletion(e,r[+i[1]]),n.preventDefault();return}}),this.dom.addEventListener("focusout",t=>{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(x).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:v.of(null)})}),this.showOptions(s,i.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),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=r){let{options:i,selected:s,disabled:o}=n.open;r.open&&r.open.options==i||(this.range=S(i.length,s,e.state.facet(x).maxRenderedOptions),this.showOptions(i,n.id)),this.updateSel(),o!=(null===(t=r.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=S(t.options.length,t.selected,this.view.state.facet(x).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();
1let{completion:n}=t.options[t.selected],{info:r}=n;if(!r)return;let s="string"==typeof r?document.createTextNode(r):r(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,i.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:r}=e;n.appendChild(t),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){var t,n;let r,i,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,r=t.getBoundingClientRect(),i=n.getBoundingClientRect(),s=r.height/t.offsetHeight,i.top<r.top?t.scrollTop-=(r.top-i.top)/s:i.bottom>r.bottom&&(t.scrollTop+=(i.bottom-r.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(),r=e.getBoundingClientRect(),i=this.space;if(!i){let e=this.dom.ownerDocument.defaultView||window;i={left:0,top:0,right:e.innerWidth,bottom:e.innerHeight}}return r.top>Math.min(i.bottom,t.bottom)-10||r.bottom<Math.max(i.top,t.top)+10?null:this.view.state.facet(x).positionInfo(this.view,t,r,n,i,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 r=document.createElement("ul");r.id=t,r.setAttribute("role","listbox"),r.setAttribute("aria-expanded","true"),r.setAttribute("aria-label",this.view.state.phrase("Completions"));let i=null;for(let s=n.from;s<n.to;s++){let{completion:o,match:l}=e[s],{section:a}=o;if(a){let e="string"==typeof a?a:a.name;e!=i&&(s>n.from||0==n.from)&&(i=e,"string"!=typeof a&&a.header?r.appendChild(a.header(a)):r.appendChild(document.createElement("completion-section")).textContent=e)}let h=r.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,l);t&&h.appendChild(t)}}return n.from&&r.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&r.classList.add("cm-completionListIncompleteBottom"),r}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function C(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class I{constructor(e,t,n,r,i,s){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=r,this.selected=i,this.disabled=s}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new I(this.options,M(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,r,i){let s=function(e,t){let n=[],r=null,i=e=>{n.push(e);let{section:t}=e.completion;if(t){r||(r=[]);let e="string"==typeof t?t:t.name;r.some(t=>t.name==e)||r.push("string"==typeof t?{name:e}:t)}},s=t.facet(x);for(let r of e)if(r.hasResult()){let e=r.result.getMatch;if(!1===r.result.filter)for(let t of r.result.options)i(new c(t,r.source,e?e(t):[],1e9-n.length));else{let n=t.sliceDoc(r.from,r.to),o,l=s.filterStrict?new w(n):new y(n);for(let t of r.result.options)if(o=l.match(t.label)){let n=t.displayLabel?e?e(t,o.matched):[]:o.matched;i(new c(t,r.source,n,o.score+(t.boost||0)))}}}if(r){let e=Object.create(null),t=0;for(let n of r.sort((e,t)=>{var n,r;return(null!==(n=e.rank)&&void 0!==n?n:1e9)-(null!==(r=t.rank)&&void 0!==r?r: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 o=[],l=null,a=s.compareCompletions;for(let e of n.sort((e,t)=>t.score-e.score||a(e.completion,t.completion))){let t=e.completion;l&&l.label==t.label&&l.detail==t.detail&&(null==l.type||null==t.type||l.type==t.type)&&l.apply==t.apply&&l.boost==t.boost?C(e.completion)>C(l)&&(o[o.length-1]=e):o.push(e),l=e.completion}return o}(e,t);if(!s.length)return r&&e.some(e=>1==e.state)?new I(r.options,r.attrs,r.tooltip,r.timestamp,r.selected,!0):null;let o=t.facet(x).selectOnOpen?0:-1;if(r&&r.selected!=o&&-1!=r.selected){let e=r.options[r.selected].completion;for(let t=0;t<s.length;t++)if(s[t].completion==e){o=t;break}}return new I(s,M(n,o),{pos:e.reduce((e,t)=>
1t.hasResult()?Math.min(e,t.from):e,1e8),create:J,above:i.aboveCursor},r?r.timestamp:Date.now(),o,!1)}map(e){return new I(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class T{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new T(P,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(x),r=(n.override||t.languageDataAt("autocomplete",u(t)).map(m)).map(t=>(this.active.find(e=>e.source==t)||new E(t,this.active.some(e=>0!=e.state)?1:0)).update(e,n));r.length==this.active.length&&r.every((e,t)=>e==this.active[t])&&(r=this.active);let i=this.open;for(let s of(i&&e.docChanged&&(i=i.map(e.changes)),e.selection||r.some(t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to))||!function(e,t){if(e==t)return!0;for(let n=0,r=0;;){for(;n<e.length&&!e[n].hasResult;)n++;for(;r<t.length&&!t[r].hasResult;)r++;let i=n==e.length,s=r==t.length;if(i||s)return i==s;if(e[n++].result!=t[r++].result)return!1}}(r,this.active)?i=I.build(r,t,this.id,i,n):i&&i.disabled&&!r.some(e=>1==e.state)&&(i=null),!i&&r.every(e=>1!=e.state)&&r.some(e=>e.hasResult())&&(r=r.map(e=>e.hasResult()?new E(e.source,0):e)),e.effects))s.is(L)&&(i=i&&i.setSelected(s.value,this.id));return r==this.active&&i==this.open?this:new T(r,this.id,i)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:O}}let O={"aria-autocomplete":"list"};function M(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}let P=[];function D(e,t){if(e.isUserEvent("input.complete")){let n=e.annotation(d);if(n&&t.activateOnCompletion(n))return"input"}return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}class E{constructor(e,t,n=-1){this.source=e,this.state=t,this.explicitPos=n}hasResult(){return!1}update(e,t){let n=D(e,t),r=this;for(let i of(n?r=r.handleUserEvent(e,n,t):e.docChanged?r=r.handleChange(e):e.selection&&0!=r.state&&(r=new E(r.source,0)),e.effects))if(i.is(g))r=new E(r.source,1,i.value?u(e.state):-1);else if(i.is(v))r=new E(r.source,0);else if(i.is(N))for(let e of i.value)e.source==r.source&&(r=e);return r}handleUserEvent(e,t,n){return"delete"!=t&&n.activateOnTyping?new E(this.source,1):this.map(e.changes)}handleChange(e){return e.changes.touchesRange(u(e.startState))?new E(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new E(this.source,this.state,e.mapPos(this.explicitPos))}}class B extends E{constructor(e,t,n,r,i){super(e,2,t),this.result=n,this.from=r,this.to=i}hasResult(){return!0}handleUserEvent(e,t,n){var r;let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let s=e.changes.mapPos(this.from),l=e.changes.mapPos(this.to,1),a=u(e.state);if((this.explicitPos<0?a<=s:a<this.from)||a>l||!i||"delete"==t&&u(e.startState)==this.from)return new E(this.source,"input"==t&&n.activateOnTyping?1:0);let h=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return!function(e,t,n,r){if(!e)return!1;let i=t.sliceDoc(n,r);return"function"==typeof e?e(i,n,r,t):f(e,!0).test(i)}(i.validFor,e.state,s,l)?i.update&&(i=i.update(i,s,l,new o(e.state,a,h>=0)))?new B(this.source,h,i,i.from,null!==(r=i.to)&&void 0!==r?r:u(e.state)):new E(this.source,1,h):new B(this.source,h,i,s,l)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new E(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 B(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new E(this.source,0)}}let N=r.Py.define({map:(e,t)=>e.map(e=>e.map(t))}),L=r.Py.define(),R=r.QQ.define({create:()=>T.start(),update:(e,t)=>e.update(t),provide:e=>[i.hJ.from(e,e=>e.tooltip),i.tk.contentAttributes.from(e,e=>e.attrs)]});function j(e,t){let n=t.completion.apply||t.completion.label,i=e.state.field(R).active.find(e=>e.source==t.source);return i instanceof B&&("string"==typeof n?e.dispatch(Object.assign(Object.assign({},function(e,t,n,i){let{main:s}=e.selection,o=n-s.from,l=i-s.from;return Object.assign(Object.assign({},e.changeByRange(a=>a!=s&&n!=i&&e.sliceDoc(a.from+o,a.from+l)!=e.sliceDoc(n,i)?{range:a}:{changes:{from:a.from+o,to:i==s.from?a.to:a.from+l,insert:t},range:r.jT.cursor(a.from+o+t.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}(e.state,n,i.from,i.to)),{annotations:d.of(t.completion)})):n(e,t.completion,i.from,i.to),!0)}let J=e=>new A(e,R,j);function $(e,t="option"){return n=>{let r=n.state.field(R,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<n.state.facet(x).interactionDelay)return!1;let s=1,o;"page"==t&&(o=(0,i.gB)(n,r.open.tooltip))&&(s=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let{length:l}=r.open.options,a=r.open.selected>-1?r.open.selected+s*(e?1:-1):e?0:l-1;return a<0?a="page"==t?0:l-1:a>=l&&(a="page"==t?l-1:0),n.dispatch({effects:L.of(a)}),!0}}class F{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}let q=i.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(R).active))1==t.state&&this.startQuery(t)}update(e){let t=e.state.field(R),n=e.state.facet(x);if(!e.selectionSet&&!e.docChanged&&e.startState.field(R)==t)return;let r=e.transactions.some(e=>(e.selection||e.docChanged)&&!D(e,n));for(let t=0;t<this.running.length;t++){let n=this.running[t];if(r||n.updates.length+e.transactions.length>50&&Date.now()-n.time>1e3){for(let e of n.context.abortListeners)try{e()}catch(e){(0,i.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(g)))&&(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(()=>
1this.startUpdate(),s):-1,0!=this.composing)for(let t of e.transactions)"input"==D(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(R).active)1!=t.state||this.running.some(e=>e.active.source==t.source)||this.startQuery(t)}startQuery(e){let{state:t}=this.view,n=u(t),r=new o(t,n,e.explicitPos==n),s=new F(e,r);this.running.push(s),Promise.resolve(e.source(r)).then(e=>{s.context.aborted||(s.done=e||null,this.scheduleAccept())},e=>{this.view.dispatch({effects:v.of(null)}),(0,i.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(x).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(x);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(void 0===i.done)continue;if(this.running.splice(r--,1),i.done){let r=new B(i.active.source,i.active.explicitPos,i.done,i.done.from,null!==(e=i.done.to)&&void 0!==e?e:u(i.updates.length?i.updates[0].startState:this.view.state));for(let e of i.updates)r=r.update(e,n);if(r.hasResult()){t.push(r);continue}}let s=this.view.state.field(R).active.find(e=>e.source==i.active.source);if(s&&1==s.state){if(null==i.done){let e=new E(i.active.source,0);for(let t of i.updates)e=e.update(t,n);1!=e.state&&t.push(e)}else this.startQuery(s)}}t.length&&this.view.dispatch({effects:N.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(R,!1);if(t&&t.tooltip&&this.view.state.facet(x).closeOnBlur){let n=t.open&&(0,i.gB)(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||setTimeout(()=>this.view.dispatch({effects:v.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout(()=>this.view.dispatch({effects:g.of(!1)}),20),this.composing=0}}}),_="object"==typeof navigator&&/Win/.test(navigator.platform),W=r.Wl.highest(i.tk.domEventHandlers({keydown(e,t){let n=t.state.field(R,!1);if(!n||!n.open||n.open.disabled||n.open.selected<0||e.key.length>1||e.ctrlKey&&!(_&&e.altKey)||e.metaKey)return!1;let r=n.open.options[n.open.selected],i=n.active.find(e=>e.source==r.source),s=r.completion.commitCharacters||i.result.commitCharacters;return s&&s.indexOf(e.key)>-1&&j(t,r),!1}})),z=i.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"}}});class V{constructor(e,t,n,r){this.field=e,this.line=t,this.from=n,this.to=r}}class U{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,r.gc.TrackDel),n=e.mapPos(this.to,1,r.gc.TrackDel);return null==t||null==n?null:new U(this.field,t,n)}}class H{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],r=[t],i=e.doc.lineAt(t),o=/^\s*/.exec(i.text)[0];for(let i of this.lines){if(n.length){let n=o,l=/^\t*/.exec(i)[0].length;for(let t=0;t<l;t++)n+=e.facet(s.c);r.push(t+n.length-l),i=n+i.slice(l)}n.push(i),t+=i.length+1}return{text:n,ranges:this.fieldPositions.map(e=>new U(e.field,r[e.line]+e.from,r[e.line]+e.to))}}static parse(e){let t=[],n=[],r=[],i;for(let s of e.split(/\r\n?|\n/)){for(;i=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}
1])*))\}/.exec(s);){let e=i[1]?+i[1]:null,o=i[2]||i[3]||"",l=-1,a=o.replace(/\\[{}]/g,e=>e[1]);for(let n=0;n<t.length;n++)(null!=e?t[n].seq==e:a&&t[n].name==a)&&(l=n);if(l<0){let n=0;for(;n<t.length&&(null==e||null!=t[n].seq&&t[n].seq<e);)n++;for(let i of(t.splice(n,0,{seq:e,name:a}),l=n,r))i.field>=l&&i.field++}r.push(new V(l,n.length,i.index,i.index+a.length)),s=s.slice(0,i.index)+o+s.slice(i.index+i[0].length)}s=s.replace(/\\([{}])/g,(e,t,i)=>{for(let e of r)e.line==n.length&&e.from>i&&(e.from--,e.to--);return t}),n.push(s)}return new H(n,r)}}let Q=i.p.widget({widget:new class extends i.l9{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),G=i.p.mark({class:"cm-snippetField"});class K{constructor(e,t){this.ranges=e,this.active=t,this.deco=i.p.set(e.map(e=>(e.from==e.to?Q:G).range(e.from,e.to)))}map(e){let t=[];for(let n of this.ranges){let r=n.map(e);if(!r)return null;t.push(r)}return new K(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 Z=r.Py.define({map:(e,t)=>e&&e.map(t)}),Y=r.Py.define(),X=r.QQ.define({create:()=>null,update(e,t){for(let n of t.effects){if(n.is(Z))return n.value;if(n.is(Y)&&e)return new K(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=>i.tk.decorations.from(e,e=>e?e.deco:i.p.none)});function ee(e,t){return r.jT.create(e.filter(e=>e.field==t).map(e=>r.jT.range(e.from,e.to)))}function et(e){return({state:t,dispatch:n})=>{let r=t.field(X,!1);if(!r||e<0&&0==r.active)return!1;let i=r.active+e,s=e>0&&!r.ranges.some(t=>t.field==i+e);return n(t.update({selection:ee(r.ranges,i),effects:Z.of(s?null:new K(r.ranges,i)),scrollIntoView:!0})),!0}}let en=et(1),er=et(-1),ei=[{key:"Tab",run:en,shift:er},{key:"Escape",run:({state:e,dispatch:t})=>!!e.field(X,!1)&&(t(e.update({effects:Z.of(null)})),!0)}],es=r.r$.define({combine:e=>e.length?e[0]:ei}),eo=r.Wl.highest(i.$f.compute([es],e=>e.facet(es)));function el(e,t){let n;return Object.assign(Object.assign({},t),{apply:(n=H.parse(e),(e,t,i,s)=>{let{text:o,ranges:l}=n.instantiate(e.state,i),a={changes:{from:i,to:s,insert:r.xv.of(o)},scrollIntoView:!0,annotations:t?[d.of(t),r.YW.userEvent.of("input.complete")]:void 0};if(l.length&&(a.selection=ee(l,0)),l.some(e=>e.field>0)){let t=new K(l,0),n=a.effects=[Z.of(t)];void 0===e.state.field(X,!1)&&n.push(r.Py.appendConfig.of([X,eo,ea,z]))}e.dispatch(e.state.update(a))})})}let ea=i.tk.domEventHandlers({mousedown(e,t){let n=t.state.field(X,!1),r;if(!n||null==(r=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let i=n.ranges.find(e=>e.from<=r&&e.to>=r);return!!i&&i.field!=n.active&&(t.dispatch({selection:ee(n.ranges,i.field),effects:Z.of(n.ranges.some(e=>e.field>i.field)?new K(n.ranges,i.field):null),scrollIntoView:!0}),!0)}}),eh={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},ec=r.Py.define({map(e,t){let n=t.mapPos(e,-1,r.gc.TrackAfter);return null==n?void 0:n}}),eu=new class extends r.uU{};eu.startSide=1,eu.endSide=-1;let ef=r.QQ.define({create:()=>r.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(ec)&&(e=e.update({add:[eu.range(n.value,n.value+1)]}));return e}});function ed(){return[ey,ef]}let ep="()[]{}<>";function em(e){for(let t=0;t<ep.length;t+=2)if(ep.charCodeAt(t)==e)return ep.charAt(t+1);return(0,r.bg)(e<128?e:e+1)}function eg(e,t){return e.languageDataAt("closeBrackets",t)[0]||eh}let ev="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),ey=i.tk.inputHandler.of((e,t,n,i)=>{if((ev?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let o=e.state.selection.main;if(i.length>2||2==i.length&&1==(0,r.nZ)((0,r.gm)(i,0))||t!=o.from||n!=o.to)return!1;let l=function(e,t){let n=eg(e,e.selection.main.head),i=n.brackets||eh.brackets;for(let o of i){let l=em((0,r.gm)(o,0));if(t==o)return l==o?function(e,t,n,i){let o=i.stringPrefixes||eh.stringPrefixes,l=null,a=e.changeByRange(i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:t,from:i.to}],effects:ec.of(i.to+t.length),range:r.jT.range(i.anchor+t.length,i.head+t.length)};let a=i.head,h=ek(e.doc,a),c;if(h==t){if(eb(e,a))return{changes:{insert:t+t,from:a}
1,effects:ec.of(a+t.length),range:r.jT.cursor(a+t.length)};if(ex(e,a)){let i=n&&e.sliceDoc(a,a+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+i.length,insert:i},range:r.jT.cursor(a+i.length)}}}else if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(c=eS(e,a-2*t.length,o))>-1&&eb(e,c))return{changes:{insert:t+t+t+t,from:a},effects:ec.of(a+t.length),range:r.jT.cursor(a+t.length)};else if(e.charCategorizer(a)(h)!=r.D0.Word&&eS(e,a,o)>-1&&!function(e,t,n,r){let i=(0,s.qz)(e).resolveInner(t,-1),o=r.reduce((e,t)=>Math.max(e,t.length),0);for(let s=0;s<5;s++){let s=e.sliceDoc(i.from,Math.min(i.to,i.from+n.length+o)),l=s.indexOf(n);if(!l||l>-1&&r.indexOf(s.slice(0,l))>-1){let t=i.firstChild;for(;t&&t.from==i.from&&t.to-t.from>n.length+l;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let a=i.to==t&&i.parent;if(!a)break;i=a}return!1}(e,a,t,o))return{changes:{insert:t+t,from:a},effects:ec.of(a+t.length),range:r.jT.cursor(a+t.length)};return{range:l=i}});return l?null:e.update(a,{scrollIntoView:!0,userEvent:"input.type"})}(e,o,i.indexOf(o+o+o)>-1,n):function(e,t,n,i){let s=null,o=e.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:n,from:o.to}],effects:ec.of(o.to+t.length),range:r.jT.range(o.anchor+t.length,o.head+t.length)};let l=ek(e.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+n,from:o.head},effects:ec.of(o.head+t.length),range:r.jT.cursor(o.head+t.length)}:{range:s=o}});return s?null:e.update(o,{scrollIntoView:!0,userEvent:"input.type"})}(e,o,l,n.before||eh.before);if(t==l&&ex(e,e.selection.main.from))return function(e,t,n){let i=null,s=e.changeByRange(t=>t.empty&&ek(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:r.jT.cursor(t.head+n.length)}:i={range:t});return i?null:e.update(s,{scrollIntoView:!0,userEvent:"input.type"})}(e,0,l)}return null}(e.state,i);return!!l&&(e.dispatch(l),!0)}),ew=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=eg(e,e.selection.main.head).brackets||eh.brackets,i=null,s=e.changeByRange(t=>{if(t.empty){var s,o;let i;let l=(s=e.doc,o=t.head,i=s.sliceString(o-2,o),(0,r.nZ)((0,r.gm)(i,0))==i.length?i:i.slice(1));for(let i of n)if(i==l&&ek(e.doc,t.head)==em((0,r.gm)(i,0)))return{changes:{from:t.head-i.length,to:t.head+i.length},range:r.jT.cursor(t.head-i.length)}}return{range:i=t}});return i||t(e.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!i}}];function ex(e,t){let n=!1;return e.field(ef).between(0,e.doc.length,e=>{e==t&&(n=!0)}),n}function ek(e,t){let n=e.sliceString(t,t+2);return n.slice(0,(0,r.nZ)((0,r.gm)(n,0)))}function eb(e,t){let n=(0,s.qz)(e).resolveInner(t+1);return n.parent&&n.from==t}function eS(e,t,n){let i=e.charCategorizer(t);if(i(e.sliceDoc(t-1,t))!=r.D0.Word)return t;for(let s of n){let n=t-s.length;if(e.sliceDoc(n,t)==s&&i(e.sliceDoc(n-1,n))!=r.D0.Word)return n}return -1}function eA(e={}){return[W,R,x.of(e),q,eI,z]}let eC=[{key:"Ctrl-Space",run:e=>!!e.state.field(R,!1)&&(e.dispatch({effects:g.of(!0)}),!0)},{key:"Escape",run:e=>{let t=e.state.field(R,!1);return!!(t&&t.active.some(e=>0!=e.state))&&(e.dispatch({effects:v.of(null)}),!0)}},{key:"ArrowDown",run:$(!0)},{key:"ArrowUp",run:$(!1)},{key:"PageDown",run:$(!0,"page")},{key:"PageUp",run:$(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(R,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<e.state.facet(x).interactionDelay)&&j(e,t.open.options[t.open.selected])}}],eI=r.Wl.highest(i.$f.computeN([x],e=>e.facet(x).defaultKeymap?[eC]:[]))},59119:function(e,t,n){n.d(t,{Be:function(){return y},Dv:function(){return z},Gn:function(){return E},K0:function(){return D},KC:function(){return u},R_:function(){return ev},SQ:function(){return f},SS:function(){return P},Um:function(){return eP},a0:function(){return eT},c:function(){return O},c6:function(){return I},e7:function(){return ee},il:function(){return eL},kU:function(){return c},mi:function(){return eh},n$:function(){return eI},nF:function(){return em},nY:function(){return q},pp:function(){return h},qp:function(){return p},qz:function(){return m},ri:function(){return C},rs:function(){return _},tC:function(){return F},uj:function(){return B},vw:function(){return j},x0:function(){return W},y1:function(){return M},ze:function(){return $}});var r,i=n(41113),s=n(78120),o=n(47421),l=n(35524),a=n(28699);let h=new i.md;function c(e){return s.r$.define({combine:e?t=>t.concat(e):void 0})}let u=new i.md;class f{constructor(e,t,n=[],r=""){this.data=e,this.name=r,s.yy.prototype.hasOwnProperty("tree")||Object.defineProperty(s.yy.prototype,"tree",{get(){return m(this)}}),this.parser=t,this.extension=[A.of(this),s.yy.languageData.of((e,t,n)=>{let r=d(e,t,n),i=r.type.prop(h);if(!i)return[];let s=e.facet(i),o=r.type.prop(u);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,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 d(e,t,n).type.prop(h)==this.data}findRegions(e){let t=e.facet(A);
vendor: 6,229 bytes, line 1
1if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(h)==this.data){n.push({from:t,to:t+e.length});return}let s=e.prop(i.md.mounted);if(s){if(s.tree.prop(h)==this.data){if(s.overlay)for(let e of s.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(s.overlay){let e=n.length;if(r(s.tree,s.overlay[0].from+t),n.length>e)return}}for(let n=0;n<e.children.length;n++){let s=e.children[n];s instanceof i.mp&&r(s,e.positions[n]+t)}};return r(m(e),0),n}get allowsNesting(){return!0}}function d(e,t,n){let r=e.facet(A),s=m(e).topNode;if(!r||r.allowsNesting)for(let e=s;e;e=e.enter(t,n,i.vj.ExcludeBuffers))e.type.isTop&&(s=e);return s}f.setState=s.Py.define();class p extends f{constructor(e,t,n){super(e,t,[],n),this.parser=t}static define(e){let t=c(e.languageData);return new p(t,e.parser.configure({props:[h.add(e=>e.isTop?t:void 0)]}),e.name)}configure(e,t){return new p(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function m(e){let t=e.field(f.state,!1);return t?t.tree:i.mp.empty}class g{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.string}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 v=null;class y{constructor(e,t,n=[],r,i,s,o,l){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=s,this.skipped=o,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new y(e,t,[],i.mp.empty,0,n,[],null)}startParse(){return this.parser.startParse(new g(this.state.doc),this.fragments)}work(e,t){return(null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=i.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 r=this.parse.advance();if(r){if(this.fragments=this.withoutTempSkipped(i.i9.addTree(r,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(n=this.parse.stoppedAt)&&void 0!==n?n:this.state.doc.length,this.tree=r,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(i.i9.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=v;v=this;try{return e()}finally{v=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=w(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,n,r,i)=>t.push({fromA:e,toA:n,fromB:r,toB:i})),n=i.i9.applyChanges(n,t),r=i.mp.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length)for(let t of(l=[],this.skipped)){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);n<r&&l.push({from:n,to:r})}}return new y(this.parser,t,n,r,s,o,l,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:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=w(this.fragments,n,r),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 i._b{createParse(t,n,r){let s=r[0].from,o=r[r.length-1].to;return{parsedPos:s,advance(){let t=v;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=o,new i.mp(i.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 v}}function w(e,t,n){return i.i9.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class x{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 x(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=y.create(e.facet(A).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new x(n)}}f.state=s.QQ.define({create:x.init,update(e,t){for(let e of t.effects)if(e.is(f.setState))return e.value;return t.startState.facet(A)!=t.state.facet(A)?x.init(t.state):e.apply(t)}});let k=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(k=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});let b="undefined"!=typeof navigator&&(null===(r=navigator.scheduling)||void 0===r?void 0:r.isInputPending)?()=>navigator.scheduling.isInputPending():null,S=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(f.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(f.state);
1t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=k(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:r}}=this.view,i=n.field(f.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,e&&!b?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,l=i.context.work(()=>b&&b()||Date.now()>s,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:f.setState.of(new x(i.context))})),this.chunkBudget>0&&!(l&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.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()}}}),A=s.r$.define({combine:e=>e.length?e[0]:null,enables:e=>[f.state,S,o.tk.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]});class C{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class I{constructor(e,t,n,r,i,s){this.name=e,this.alias=t,this.extensions=n,this.filename=r,this.loadFunc=i,this.support=s,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:n}=e;if(!t){if(!n)throw RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(n)}return new I(e.name,(e.alias||[]).concat(e.name).map(e=>e.toLowerCase()),e.extensions||[],e.filename,t,n)}static matchFilename(e,t){for(let n of e)if(n.filename&&n.filename.test(t))return n;let n=/\.([^.]+)$/.exec(t);if(n){for(let t of e)if(t.extensions.indexOf(n[1])>-1)return t}return null}static matchLanguageName(e,t,n=!0){for(let n of(t=t.toLowerCase(),e))if(n.alias.some(e=>e==t))return n;if(n)for(let n of e)for(let e of n.alias){let r=t.indexOf(e);if(r>-1&&(e.length>2||!/\w/.test(t[r-1])&&!/\w/.test(t[r+e.length])))return n}return null}}let T=s.r$.define(),O=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 M(e){let t=e.facet(O);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function P(e,t){let n="",r=e.tabSize,i=e.facet(O)[0];if(" "==i){for(;t>=r;)n+=" ",t-=r;i=" "}for(let e=0;e<t;e++)n+=i;return n}function D(e,t){for(let n of(e instanceof s.yy&&(e=new E(e)),e.state.facet(T))){let r=n(e,t);if(void 0!==r)return r}let n=m(e.state);return n.length>=t?function(e,t,n){let r=t.resolveStack(n),i=r.node.enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t!=r.node;t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return N(r,e,n)}(e,n,t):null}class E{constructor(e,t={}){this.state=e,this.options=t,this.unit=M(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return null!=r&&r>=n.from&&r<=n.to?i&&r==e?{text:"",from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),s=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return s>-1&&(i+=s-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return(0,s.IS)(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}let B=new i.md;function N(e,t,n){for(let r=e;r;r=r.next){let e=function(e){let t=e.type.prop(B);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(i.md.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>J(e,!0,1,void 0,n&&!(e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak)?t.from:void 0)}return null==e.parent?L:null}
1(r.node);if(e)return e(R.create(t,n,r))}return 0}function L(){return 0}class R extends E{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 R(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 N(this.context.next,this.base,this.pos)}}function j({closing:e,align:t=!0,units:n=1}){return r=>J(r,t,n,e)}function J(e,t,n,r,i){let s=e.textAfter,o=s.match(/^\s*/)[0].length,l=r&&s.slice(o,o+r.length)==r||i==e.pos+o,a=t?function(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,s=e.state.doc.lineAt(n.from),o=null==i||i<=s.from?s.to:Math.min(s.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped)return i.from<o?n:null;e=i.to}}(e):null;return a?l?e.column(a.from):e.column(a.to):e.baseIndent+(l?0:e.unit*n)}let $=e=>e.baseIndent;function F({except:e,units:t=1}={}){return n=>{let r=e&&e.test(n.textAfter);return n.baseIndent+(r?0:t*n.unit)}}function q(){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:r}=e.newSelection.main,i=n.lineAt(r);if(r>i.from+200)return e;let s=n.sliceString(i.from,r);if(!t.some(e=>e.test(s)))return e;let{state:o}=e,l=-1,a=[];for(let{head:e}of o.selection.ranges){let t=o.doc.lineAt(e);if(t.from==l)continue;l=t.from;let n=D(o,t.from);if(null==n)continue;let r=/^\s*/.exec(t.text)[0],i=P(o,n);r!=i&&a.push({from:t.from,to:t.from+r.length,insert:i})}return a.length?[e,{changes:a,sequential:!0}]:e})}let _=s.r$.define(),W=new i.md;function z(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 V(e,t,n){for(let r of e.facet(_)){let i=r(e,t,n);if(i)return i}return function(e,t,n){let r=m(e);if(r.length<n)return null;let i=r.resolveStack(n,1),s=null;for(let o=i;o;o=o.next){let i=o.node;if(i.to<=n||i.from>n)continue;if(s&&i.from<t)break;let l=i.type.prop(W);if(l&&(i.to<r.length-50||r.length==e.doc.length||!function(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}(i))){let r=l(i,e);r&&r.from<=n&&r.from>=t&&r.to>n&&(s=r)}}return s}(e,t,n)}function U(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}let H=s.Py.define({map:U}),Q=s.Py.define({map:U});function G(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 K=s.QQ.define({create:()=>o.p.none,update(e,t){for(let n of(e=e.map(t.changes),t.effects))if(n.is(H)&&!function(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet(en),i=r?o.p.replace({widget:new eo(r(t.state,n.value))}):es;e=e.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(Q)&&(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:r}=t.selection.main;e.between(r,r,(e,t)=>{e<r&&t>r&&(n=!0)}),n&&(e=e.update({filterFrom:r,filterTo:r,filter:(e,t)=>t<=r||e>=r}))}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 r=e[n++],i=e[n++];if("number"!=typeof r||"number"!=typeof i)throw RangeError("Invalid JSON for fold state");t.push(es.range(r,i))}return o.p.set(t,!0)}});function Z(e,t,n){var r;let i=null;return null===(r=e.field(K,!1))||void 0===r||r.between(t,n,(e,t)=>{(!i||i.from>e)&&(i={from:e,to:t})}),i}function Y(e,t){return e.field(K,!1)?t:t.concat(s.Py.appendConfig.of(er()))}function X(e,t,n=!0){let r=e.state.doc.lineAt(t.from).number,i=e.state.doc.lineAt(t.to).number;return o.tk.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${e.state.phrase("to")} ${i}.`)}let ee=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of G(e)){let n=V(e.state,t.from,t.to);if(n)return e.dispatch({effects:Y(e.state,[H.of(n),X(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(K,!1))return!1;let t=[];for(let n of G(e)){let r=Z(e.state,n.from,n.to);r&&t.push(Q.of(r),X(e,r,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let r=0;r<t.doc.length;){let i=e.lineBlockAt(r),s=V(t,i.from,i.to);
1s&&n.push(H.of(s)),r=(s?e.lineBlockAt(s.to):i).to+1}return n.length&&e.dispatch({effects:Y(e.state,n)}),!!n.length}},{key:"Ctrl-Alt-]",run:e=>{let t=e.state.field(K,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,(e,t)=>{n.push(Q.of({from:e,to:t}))}),e.dispatch({effects:n}),!0}}],et={placeholderDOM:null,preparePlaceholder:null,placeholderText:"â¦"},en=s.r$.define({combine:e=>(0,s.BO)(e,et)});function er(e){let t=[K,ec];return e&&t.push(en.of(e)),t}function ei(e,t){let{state:n}=e,r=n.facet(en),i=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),r=Z(e.state,n.from,n.to);r&&e.dispatch({effects:Q.of(r)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}let es=o.p.replace({widget:new class extends o.l9{toDOM(e){return ei(e,null)}}});class eo extends o.l9{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return ei(e,this.value)}}let el={openText:"â",closedText:"âº",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class ea 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 eh(e={}){let t=Object.assign(Object.assign({},el),e),n=new ea(t,!0),r=new ea(t,!1),i=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(A)!=e.state.facet(A)||e.startState.field(K,!1)!=e.state.field(K,!1)||m(e.startState)!=m(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new s.f_;for(let i of e.viewportLineBlocks){let s=Z(e.state,i.from,i.to)?r:V(e.state,i.from,i.to)?n:null;s&&t.add(i.from,i.from,s)}return t.finish()}}),{domEventHandlers:l}=t;return[i,(0,o.v5)({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(i))||void 0===t?void 0:t.markers)||s.Xs.empty},initialSpacer:()=>new ea(t,!1),domEventHandlers:Object.assign(Object.assign({},l),{click:(e,t,n)=>{if(l.click&&l.click(e,t,n))return!0;let r=Z(e.state,t.from,t.to);if(r)return e.dispatch({effects:Q.of(r)}),!0;let i=V(e.state,t.from,t.to);return!!i&&(e.dispatch({effects:H.of(i)}),!0)}})}),er()]}let ec=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"}});class eu{constructor(e,t){let n;function r(e){let t=a.V.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;let i="string"==typeof t.all?t.all:t.all?r(t.all):void 0,s=t.scope;this.scope=s instanceof f?e=>e.prop(h)==s.data:s?e=>e==s:void 0,this.style=(0,l.QR)(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new a.V(n):null,this.themeType=t.themeType}static define(e,t){return new eu(e,t||{})}}let ef=s.r$.define(),ed=s.r$.define({combine:e=>e.length?[e[0]]:null});function ep(e){let t=e.facet(ef);return t.length?t:e.facet(ed)}function em(e,t){let n=[eg],r;return e instanceof eu&&(e.module&&n.push(o.tk.styleModule.of(e.module)),r=e.themeType),(null==t?void 0:t.fallback)?n.push(ed.of(e)):r?n.push(ef.computeN([o.tk.darkTheme],t=>t.facet(o.tk.darkTheme)==("dark"==r)?[e]:[])):n.push(ef.of(e)),n}let eg=s.Wl.high(o.lg.fromClass(class{constructor(e){this.markCache=Object.create(null),this.tree=m(e.state),this.decorations=this.buildDeco(e,ep(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=m(e.state),n=ep(e.state),r=n!=ep(e.startState),{viewport:i}=e.view,s=e.changes.mapPos(this.decoratedTo,1);t.length<i.to&&!r&&t.type==this.tree.type&&s>=i.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=s):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=i.to)}buildDeco(e,t){if(!t||!this.tree.length)return o.p.none;let n=new s.f_;for(let{from:r,to:i}of e.visibleRanges)(0,l.bW)(this.tree,t,(e,t,r)=>{n.add(e,t,this.markCache[r]||(this.markCache[r]=o.p.mark({class:r})))},r,i);return n.finish()}},{decorations:e=>e.decorations})),ev=eu.define([{tag:l.pJ.meta,color:"#404740"},{tag:l.pJ.link,textDecoration:"underline"},{tag:l.pJ.heading,textDecoration:"underline",fontWeight:"bold"},{tag:l.pJ.emphasis,fontStyle:"italic"},{tag:l.pJ.strong,fontWeight:"bold"},{tag:l.pJ.strikethrough,textDecoration:"line-through"}
1,{tag:l.pJ.keyword,color:"#708"},{tag:[l.pJ.atom,l.pJ.bool,l.pJ.url,l.pJ.contentSeparator,l.pJ.labelName],color:"#219"},{tag:[l.pJ.literal,l.pJ.inserted],color:"#164"},{tag:[l.pJ.string,l.pJ.deleted],color:"#a11"},{tag:[l.pJ.regexp,l.pJ.escape,l.pJ.special(l.pJ.string)],color:"#e40"},{tag:l.pJ.definition(l.pJ.variableName),color:"#00f"},{tag:l.pJ.local(l.pJ.variableName),color:"#30a"},{tag:[l.pJ.typeName,l.pJ.namespace],color:"#085"},{tag:l.pJ.className,color:"#167"},{tag:[l.pJ.special(l.pJ.variableName),l.pJ.macroName],color:"#256"},{tag:l.pJ.definition(l.pJ.propertyName),color:"#00c"},{tag:l.pJ.comment,color:"#940"},{tag:l.pJ.invalid,color:"#f00"}]),ey=o.tk.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),ew="()[]{}",ex=s.r$.define({combine:e=>(0,s.BO)(e,{afterCursor:!0,brackets:ew,maxScanDistance:1e4,renderMatch:eS})}),ek=o.p.mark({class:"cm-matchingBracket"}),eb=o.p.mark({class:"cm-nonmatchingBracket"});function eS(e){let t=[],n=e.matched?ek:eb;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 eA=s.QQ.define({create:()=>o.p.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],r=t.state.facet(ex);for(let e of t.state.selection.ranges){if(!e.empty)continue;let i=eP(t.state,e.head,-1,r)||e.head>0&&eP(t.state,e.head-1,1,r)||r.afterCursor&&(eP(t.state,e.head,1,r)||e.head<t.state.doc.length&&eP(t.state,e.head+1,-1,r));i&&(n=n.concat(r.renderMatch(i,t.state)))}return o.p.set(n,!0)},provide:e=>o.tk.decorations.from(e)}),eC=[eA,ey];function eI(e={}){return[ex.of(e),eC]}let eT=new i.md;function eO(e,t,n){let r=e.prop(t<0?i.md.openedBy:i.md.closedBy);if(r)return r;if(1==e.name.length){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function eM(e){let t=e.type.prop(eT);return t?t(e.node):e}function eP(e,t,n,r={}){let i=r.maxScanDistance||1e4,s=r.brackets||ew,o=m(e),l=o.resolveInner(t,n);for(let e=l;e;e=e.parent){let r=eO(e.type,n,s);if(r&&e.from<e.to){let i=eM(e);if(i&&(n>0?t>=i.from&&t<i.to:t>i.from&&t<=i.to))return function(e,t,n,r,i,s,o){let l=r.parent,a={from:i.from,to:i.to},h=0,c=null==l?void 0:l.cursor();if(c&&(n<0?c.childBefore(r.from):c.childAfter(r.to)))do if(n<0?c.to<=r.from:c.from>=r.to){if(0==h&&s.indexOf(c.type.name)>-1&&c.from<c.to){let e=eM(c);return{start:a,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(eO(c.type,n,o))h++;else if(eO(c.type,-n,o)){if(0==h){let e=eM(c);return{start:a,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:a,matched:!1}}(0,0,n,e,i,r,s)}}return function(e,t,n,r,i,s,o){let l=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),a=o.indexOf(l);if(a<0||a%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 l=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)&&r.resolveInner(l+e,1).type==i){if(t%2==0==n>0)u++;else{if(1==u)return{start:h,end:{from:l+e,to:l+e+1},matched:t>>1==a>>1};u--}}}n>0&&(e+=s.length)}return c.done?{start:h,matched:!1}:null}(e,t,n,o,l.type,i,s)}function eD(e,t,n,r=0,i=0){null==t&&-1==(t=e.search(/[^\s\u00a0]/))&&(t=e.length);let s=i;for(let i=r;i<t;i++)9==e.charCodeAt(i)?s+=n-s%n:s++;return s}class eE{constructor(e,t,n,r){this.string=e,this.tabSize=t,this.indentUnit=n,this.overrideIndent=r,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return 0==this.pos}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos);if("string"==typeof e?t==e:t&&(e instanceof RegExp?e.test(t):e(t)))return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=eD(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return null!==(e=this.overrideIndent)&&void 0!==e?e:eD(this.string,null,this.tabSize)}
1match(e,t,n){if("string"==typeof e){let r=e=>n?e.toLowerCase():e;return r(this.string.substr(this.pos,e.length))==r(e)?(!1!==t&&(this.pos+=e.length),!0):null}{let n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&!1!==t&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}}function eB(e){if("object"!=typeof e)return e;let t={};for(let n in e){let r=e[n];t[n]=r instanceof Array?r.slice():r}return t}let eN=new WeakMap;class eL extends f{constructor(e){let t,n=c(e.languageData),r={name:e.name||"",token:e.token,blankLine:e.blankLine||(()=>{}),startState:e.startState||(()=>!0),copyState:e.copyState||eB,indent:e.indent||(()=>null),languageData:e.languageData||{},tokenTable:e.tokenTable||e$},s;super(n,new class extends i._b{createParse(e,t,n){return new ej(s,e,t,n)}},[T.of((e,t)=>this.getIndent(e,t))],e.name),this.topNode=(t=i.Jq.define({id:eF.length,name:"Document",props:[h.add(()=>n)],top:!0}),eF.push(t),t),s=this,this.streamParser=r,this.stateAfter=new i.md({perNode:!0}),this.tokenTable=e.tokenTable?new eV(r.tokenTable):eU}static define(e){return new eL(e)}getIndent(e,t){let n,r=m(e.state),i=r.resolve(t);for(;i&&i.type!=this.topNode;)i=i.parent;if(!i)return null;let{overrideIndentation:s}=e.options;s&&null!=(n=eN.get(e.state))&&n<t-1e4&&(n=void 0);let o=eR(this,r,0,i.from,null!=n?n:t),l,a;if(o?(a=o.state,l=o.pos+1):(a=this.streamParser.startState(e.unit),l=0),t-l>1e4)return null;for(;l<t;){let n=e.state.doc.lineAt(l),r=Math.min(t,n.to);if(n.length){let t=s?s(n.from):-1,i=new eE(n.text,e.state.tabSize,e.unit,t<0?void 0:t);for(;i.pos<r-n.from;)eJ(this.streamParser.token,i,a)}else this.streamParser.blankLine(a,e.unit);if(r==t)break;l=n.to+1}let h=e.lineAt(t);return s&&null==n&&eN.set(e.state,h.from),this.streamParser.indent(a,/^\s*(.*)/.exec(h.text)[1],e)}get allowsNesting(){return!1}}function eR(e,t,n,r,s){let o=n>=r&&n+t.length<=s&&t.prop(e.stateAfter);if(o)return{state:e.streamParser.copyState(o),pos:n+t.length};for(let o=t.children.length-1;o>=0;o--){let l=t.children[o],a=n+t.positions[o],h=l instanceof i.mp&&a<s&&eR(e,l,a,r,s);if(h)return h}return null}class ej{constructor(e,t,n,r){this.lang=e,this.input=t,this.fragments=n,this.ranges=r,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=r[r.length-1].to;let s=y.get(),o=r[0].from,{state:l,tree:a}=function(e,t,n,r){for(let r of t){let t=r.from+(r.openStart?25:0),s=r.to-(r.openEnd?25:0),o=t<=n&&s>n&&eR(e,r.tree,0-r.offset,n,s),l;if(o&&(l=function e(t,n,r,s,o){if(o&&r<=0&&s>=n.length)return n;o||n.type!=t.topNode||(o=!0);for(let l=n.children.length-1;l>=0;l--){let a=n.positions[l],h=n.children[l],c;if(a<s&&h instanceof i.mp){if(!(c=e(t,h,r-a,s-a,o)))break;return o?new i.mp(n.type,n.children.slice(0,l).concat(c),n.positions.slice(0,l+1),a+c.length):c}}return null}(e,r.tree,n+r.offset,o.pos+r.offset,!1)))return{state:o.state,tree:l}}return{state:e.streamParser.startState(r?M(r):4),tree:i.mp.empty}}(e,n,o,null==s?void 0:s.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let e=0;e<a.children.length;e++)this.chunks.push(a.children[e]),this.chunkPos.push(a.positions[e]);s&&this.parsedPos<s.viewport.from-1e5&&(this.state=this.lang.streamParser.startState(M(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let e=y.get(),t=null==this.stoppedAt?this.to:Math.min(this.to,this.stoppedAt),n=Math.min(t,this.chunkStart+2048);for(e&&(n=Math.min(n,e.viewport.to));this.parsedPos<n;)this.parseLine(e);return(this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t)?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)"\n"==t&&(t="");else{let e=t.indexOf("\n");e>
1-1&&(t=t.slice(0,e))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),n=e+t.length;for(let e=this.rangeIndex;;){let r=this.ranges[e].to;if(r>=n||(t=t.slice(0,r-(n-t.length)),++e==this.ranges.length))break;let i=this.ranges[e].from,s=this.lineAfter(i);t+=s,n=i+s.length}return{line:t,end:n}}skipGapsTo(e,t,n){for(;;){let r=this.ranges[this.rangeIndex].to,i=e+t;if(n>0?r>i:r>=i)break;t+=this.ranges[++this.rangeIndex].from-r}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,n,r,i){if(this.ranges.length>1){i=this.skipGapsTo(t,i,1),t+=i;let e=this.chunk.length;i=this.skipGapsTo(n,i,-1),n+=i,r+=this.chunk.length-e}return this.chunk.push(e,t,n,r),i}parseLine(e){let{line:t,end:n}=this.nextLine(),r=0,{streamParser:i}=this.lang,s=new eE(t,e?e.state.tabSize:4,e?M(e.state):2);if(s.eol())i.blankLine(this.state,s.indentUnit);else for(;!s.eol();){let e=eJ(i.token,s,this.state);if(e&&(r=this.emitToken(this.lang.tokenTable.resolve(e),this.parsedPos+s.start,this.parsedPos+s.pos,4,r)),s.start>1e4)break}this.parsedPos=n,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=i.mp.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:eq,topID:0,maxBufferLength:2048,reused:this.chunkReused});e=new i.mp(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new i.mp(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function eJ(e,t,n){t.start=t.pos;for(let r=0;r<10;r++){let r=e(t,n);if(t.pos>t.start)return r}throw Error("Stream parser failed to advance stream.")}let e$=Object.create(null),eF=[i.Jq.none],eq=new i.Lj(eF),e_=[],eW=Object.create(null),ez=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"]])ez[e]=eQ(e$,t);class eV{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),ez)}resolve(e){return e?this.table[e]||(this.table[e]=eQ(this.extra,e)):0}}let eU=new eV(e$);function eH(e,t){e_.indexOf(e)>-1||(e_.push(e),console.warn(t))}function eQ(e,t){let n=[];for(let r of t.split(" ")){let t=[];for(let n of r.split(".")){let r=e[n]||l.pJ[n];r?"function"==typeof r?t.length?t=t.map(r):eH(n,`Modifier ${n} used at start of tag`):t.length?eH(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:eH(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,"_"),s=r+" "+n.map(e=>e.id),o=eW[s];if(o)return o.id;let a=eW[s]=i.Jq.define({id:eF.length,name:r,props:[(0,l.Gv)({[r]:n})]});return eF.push(a),a.id}o.Nm.RTL,o.Nm.LTR},78120:function(e,t,n){let r;n.d(t,{BO:function(){return ex},D0:function(){return ev},F6:function(){return K},Gz:function(){return eJ},IS:function(){return ej},Py:function(){return eu},QQ:function(){return V},Wl:function(){return Q},Xs:function(){return eC},YW:function(){return ef},as:function(){return O},bg:function(){return k},cp:function(){return m},f_:function(){return eI},gc:function(){return I},gm:function(){return x},jT:function(){return R},n0:function(){return T},nZ:function(){return b},q6:function(){return ea},r$:function(){return $},uU:function(){return ek},xv:function(){return i},yy:function(){return ew}});class i{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]=f(this,e,t);let r=[];return this.decompose(0,e,r,2),n.length&&n.decompose(0,n.length,r,3),this.decompose(t,this.length,r,1),o.from(r,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=f(this,e,t);let n=[];return this.decompose(e,t,n,0),o.from(n,t-e)}eq(e){if(e==this)return!0;
vendor: 4,930 bytes, line 1
1if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),r=new a(this),i=new a(e);for(let e=t,s=t;;){if(r.next(e),i.next(e),e=0,r.lineBreak!=i.lineBreak||r.done!=i.done||r.value!=i.value)return!1;if(s+=r.value.length,r.done||s>=n)return!0}}iter(e=1){return new a(this,e)}iterRange(e,t=this.length){return new h(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let r=this.line(e).from;n=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new c(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 s(e):o.from(s.split(e,[])):i.empty}}class s extends i{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,r){for(let i=0;;i++){let s=this.text[i],o=r+s.length;if((t?n:o)>=e)return new u(r,o,n,s);r=o+1,n++}}decompose(e,t,n,r){let i=e<=0&&t>=this.length?this:new s(l(this.text,[""],e,t),Math.min(t,this.length)-Math.max(0,e));if(1&r){let e=n.pop(),t=l(i.text,e.text.slice(),0,i.length);if(t.length<=32)n.push(new s(t,e.length+i.length));else{let e=t.length>>1;n.push(new s(t.slice(0,e)),new s(t.slice(e)))}}else n.push(i)}replace(e,t,n){var r;if(!(n instanceof s))return super.replace(e,t,n);[e,t]=f(this,e,t);let i=l(this.text,l(n.text,l(this.text,[""],0,e)),t),a=this.length+n.length-(t-e);return i.length<=32?new s(i,a):o.from(s.split(i,[]),a)}sliceString(e,t=this.length,n="\n"){[e,t]=f(this,e,t);let r="";for(let i=0,s=0;i<=t&&s<this.text.length;s++){let o=this.text[s],l=i+o.length;i>e&&s&&(r+=n),e<l&&t>i&&(r+=o.slice(Math.max(0,e-i),t-i)),i=l+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],r=-1;for(let i of e)n.push(i),r+=i.length+1,32==n.length&&(t.push(new s(n,r)),n=[],r=-1);return r>-1&&t.push(new s(n,r)),t}}class o extends i{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,r){for(let i=0;;i++){let s=this.children[i],o=r+s.length,l=n+s.lines-1;if((t?l:o)>=e)return s.lineInner(e,t,n,r);r=o+1,n=l+1}}decompose(e,t,n,r){for(let i=0,s=0;s<=t&&i<this.children.length;i++){let o=this.children[i],l=s+o.length;if(e<=l&&t>=s){let i=r&((s<=e?1:0)|(l>=t?2:0));s>=e&&l<=t&&!i?n.push(o):o.decompose(e-s,t-s,n,i)}s=l+1}}replace(e,t,n){if([e,t]=f(this,e,t),n.lines<this.lines)for(let r=0,i=0;r<this.children.length;r++){let s=this.children[r],l=i+s.length;if(e>=i&&t<=l){let a=s.replace(e-i,t-i,n),h=this.lines-s.lines+a.lines;if(a.lines<h>>4&&a.lines>h>>6){let i=this.children.slice();return i[r]=a,new o(i,this.length-(t-e)+n.length)}return super.replace(i,l,a)}i=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=f(this,e,t);let r="";for(let i=0,s=0;i<this.children.length&&s<=t;i++){let o=this.children[i],l=s+o.length;s>e&&i&&(r+=n),e<l&&t>s&&(r+=o.sliceString(e-s,t-s,n)),s=l+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof o))return 0;let n=0,[r,i,s,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,i+=t){if(r==s||i==l)return n;let o=this.children[r],a=e.children[i];if(o!=a)return n+o.scanIdentical(a,t);n+=o.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 s(n,t)}let r=Math.max(32,n>>5),i=r<<1,l=r>>1,a=[],h=0,c=-1,u=[];function f(){0!=h&&(a.push(1==u.length?u[0]:o.from(u,c)),c=-1,h=u.length=0)}for(let t of e)!function e(t){let n;if(t.lines>i&&t instanceof o)for(let n of t.children)e(n);else t.lines>l&&(h>l||!h)?(f(),a.push(t)):t instanceof s&&h&&(n=u[u.length-1])instanceof s&&t.lines+n.lines<=32?(h+=t.lines,c+=t.length+1,u[u.length-1]=new s(n.text.concat(t.text),n.length+1+t.length)):(h+t.lines>r&&f(),h+=t.lines,c+=t.length+1,u.push(t))}(t);return f(),1==a.length?a[0]:new o(a,t)}}function l(e,t,n=0,r=1e9){for(let i=0,s=0,o=!0;s<e.length&&i<=r;s++){let l=e[s],a=i+l.length;a>=n&&(a>r&&(l=l.slice(0,r-i)),i<n&&(l=l.slice(n-i)),o?(t[t.length-1]+=l,o=!1):t.push(l)),i=a+1}return t}i.empty=new s([""],0);class a{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 s?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,r=this.nodes[n],i=this.offsets[n],o=i>>1,l=r instanceof s?r.text.length:r.children.length;if(o==(t>0?l: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&i)==(t>
10?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(r instanceof s){let i=r.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,i.length>Math.max(0,e))return this.value=0==e?i:t>0?i.slice(e):i.slice(0,i.length-e),this;e-=i.length}else{let i=r.children[o+(t<0?-1:0)];e>i.length?(e-=i.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(i),this.offsets.push(t>0?1:(i instanceof s?i.text.length:i.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class h{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new a(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:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=n?r:t<0?r.slice(r.length-n):r.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}}class c{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:r}=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=r,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(i.prototype[Symbol.iterator]=function(){return this.iter()},a.prototype[Symbol.iterator]=h.prototype[Symbol.iterator]=c.prototype[Symbol.iterator]=function(){return this});class u{constructor(e,t,n,r){this.from=e,this.to=t,this.number=n,this.text=r}get length(){return this.to-this.from}}function f(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}let d="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<d.length;e++)d[e]+=d[e-1];function p(e){return e>=127462&&e<=127487}function m(e,t,n=!0,r=!0){return(n?g:v)(e,t,r)}function g(e,t,n){if(t==e.length)return t;t&&y(e.charCodeAt(t))&&w(e.charCodeAt(t-1))&&t--;let r=x(e,t);for(t+=b(r);t<e.length;){let i=x(e,t);if(8205==r||8205==i||n&&function(e){for(let t=1;t<d.length;t+=2)if(d[t]>e)return d[t-1]<=e;return!1}(i))t+=b(i),r=i;else if(p(i)){let n=0,r=t-2;for(;r>=0&&p(x(e,r));)n++,r-=2;if(n%2==0)break;t+=2}else break}return t}function v(e,t,n){for(;t>0;){let r=g(e,t-2,n);if(r<t)return r;t--}return 0}function y(e){return e>=56320&&e<57344}function w(e){return e>=55296&&e<56320}function x(e,t){let n=e.charCodeAt(t);if(!w(n)||t+1==e.length)return n;let r=e.charCodeAt(t+1);return y(r)?(n-55296<<10)+(r-56320)+65536:n}function k(e){return e<=65535?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10)+55296,(1023&e)+56320)}function b(e){return e<65536?1:2}let S=/\r\n?|\n/;var A,C,I=((A=I||(I={}))[A.Simple=0]="Simple",A[A.TrackDel=1]="TrackDel",A[A.TrackBefore=2]="TrackBefore",A[A.TrackAfter=3]="TrackAfter",A);class T{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,r=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?(e(n,r,i),r+=i):r+=s,n+=i}}iterChangedRanges(e,t=!1){D(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];r<0?e.push(n,r):e.push(r,n)}return new T(e)}composeDesc(e){return this.empty?e:e.empty?this:B(this,e)}mapDesc(e,t=!1){return e.empty?this:E(this,e,t)}mapPos(e,t=-1,n=I.Simple){let r=0,i=0;for(let s=0;s<this.sections.length;){let o=this.sections[s++],l=this.sections[s++],a=r+o;if(l<0){if(a>e)return i+(e-r);i+=o}else{if(n!=I.Simple&&a>=e&&(n==I.TrackDel&&r<e&&a>e||n==I.TrackBefore&&r<e||n==I.TrackAfter&&a>e))return null;if(a>e||a==e&&t<0&&!o)return e==r||t<0?i:i+l;i+=l}r=a}if(e>r)throw RangeError(`Position ${e} is out of range for changeset of length ${r}`);return i}touchesRange(e,t=e){for(let n=0,r=0;n<this.sections.length&&r<=t;){let i=this.sections[n++],s=this.sections[n++],o=r+i;if(s>=0&&r<=t&&o>=e)return!(r<e)||!(o>t)||"cover";r=o}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+n+(r>=0?":"+r:"")}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 T(e)}static create(e){return new T(e)}}class O extends T{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 D(this,(t,n,r,i,s)=>e=e.replace(r,r+(n-t),s),!1),e}
1mapDesc(e,t=!1){return E(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let r=0,s=0;r<t.length;r+=2){let o=t[r],l=t[r+1];if(l>=0){t[r]=l,t[r+1]=o;let a=r>>1;for(;n.length<a;)n.push(i.empty);n.push(o?e.slice(s,s+o):i.empty)}s+=o}return new O(t,n)}compose(e){return this.empty?e:e.empty?this:B(this,e,!0)}map(e,t=!1){return e.empty?this:E(this,e,t,!0)}iterChanges(e,t=!1){D(this,e,t)}get desc(){return T.create(this.sections)}filter(e){let t=[],n=[],r=[],i=new N(this);e:for(let s=0,o=0;;){let l=s==e.length?1e9:e[s++];for(;o<l||o==l&&0==i.len;){if(i.done)break e;let e=Math.min(i.len,l-o);M(r,e,-1);let s=-1==i.ins?-1:0==i.off?i.ins:0;M(t,e,s),s>0&&P(n,t,i.text),i.forward(e),o+=e}let a=e[s++];for(;o<a;){if(i.done)break e;let e=Math.min(i.len,a-o);M(t,e,-1),M(r,e,-1==i.ins?-1:0==i.off?i.ins:0),i.forward(e),o+=e}}return{changes:new O(t,n),filtered:T.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],r=this.sections[t+1];r<0?e.push(n):0==r?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let r=[],s=[],o=0,l=null;function a(e=!1){if(!e&&!r.length)return;o<t&&M(r,t-o,-1);let n=new O(r,s);l=l?l.compose(n.map(l)):n,r=[],s=[],o=0}return!function e(h){if(Array.isArray(h))for(let t of h)e(t);else if(h instanceof O){if(h.length!=t)throw RangeError(`Mismatched change set length (got ${h.length}, expected ${t})`);a(),l=l?l.compose(h.map(l)):h}else{let{from:e,to:l=e,insert:c}=h;if(e>l||e<0||l>t)throw RangeError(`Invalid change range ${e} to ${l} (in doc of length ${t})`);let u=c?"string"==typeof c?i.of(c.split(n||S)):c:i.empty,f=u.length;if(e==l&&0==f)return;e<o&&a(),e>o&&M(r,e-o,-1),M(r,l-e,f),P(s,r,u),o=l}}(e),a(!l),l}static empty(e){return new O(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let r=0;r<e.length;r++){let s=e[r];if("number"==typeof s)t.push(s,-1);else if(!Array.isArray(s)||"number"!=typeof s[0]||s.some((e,t)=>t&&"string"!=typeof e))throw RangeError("Invalid JSON representation of ChangeSet");else if(1==s.length)t.push(s[0],0);else{for(;n.length<r;)n.push(i.empty);n[r]=i.of(s.slice(1)),t.push(s[0],n[r].length)}}return new O(t,n)}static createSet(e,t){return new O(e,t)}}function M(e,t,n,r=!1){if(0==t&&n<=0)return;let i=e.length-2;i>=0&&n<=0&&n==e[i+1]?e[i]+=t:0==t&&0==e[i]?e[i+1]+=n:r?(e[i]+=t,e[i+1]+=n):e.push(t,n)}function P(e,t,n){if(0==n.length)return;let r=t.length-2>>1;if(r<e.length)e[e.length-1]=e[e.length-1].append(n);else{for(;e.length<r;)e.push(i.empty);e.push(n)}}function D(e,t,n){let r=e.inserted;for(let s=0,o=0,l=0;l<e.sections.length;){let a=e.sections[l++],h=e.sections[l++];if(h<0)s+=a,o+=a;else{let c=s,u=o,f=i.empty;for(;c+=a,u+=h,h&&r&&(f=f.append(r[l-2>>1])),!n&&l!=e.sections.length&&!(e.sections[l+1]<0);)a=e.sections[l++],h=e.sections[l++];t(s,c,o,u,f),s=c,o=u}}}function E(e,t,n,r=!1){let i=[],s=r?[]:null,o=new N(e),l=new N(t);for(let e=-1;;)if(-1==o.ins&&-1==l.ins){let e=Math.min(o.len,l.len);M(i,e,-1),o.forward(e),l.forward(e)}else if(l.ins>=0&&(o.ins<0||e==o.i||0==o.off&&(l.len<o.len||l.len==o.len&&!n))){let t=l.len;for(M(i,l.ins,-1);t;){let n=Math.min(o.len,t);o.ins>=0&&e<o.i&&o.len<=n&&(M(i,0,o.ins),s&&P(s,i,o.text),e=o.i),o.forward(n),t-=n}l.next()}else if(o.ins>=0){let t=0,n=o.len;for(;n;)if(-1==l.ins){let e=Math.min(n,l.len);t+=e,n-=e,l.forward(e)}else if(0==l.ins&&l.len<n)n-=l.len,l.next();else break;M(i,t,e<o.i?o.ins:0),s&&e<o.i&&P(s,i,o.text),e=o.i,o.forward(o.len-n)}else if(o.done&&l.done)return s?O.createSet(i,s):T.create(i);else throw Error("Mismatched change set lengths")}function B(e,t,n=!1){let r=[],i=n?[]:null,s=new N(e),o=new N(t);for(let e=!1;;){if(s.done&&o.done)return i?O.createSet(r,i):T.create(r);if(0==s.ins)M(r,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=r.length;if(-1==s.ins){let n=-1==o.ins?-1:o.off?0:o.ins;M(r,t,n,e),i&&n&&P(i,r,o.text)}else -1==o.ins?(M(r,s.off?0:s.len,t,e),i&&P(i,r,s.textBit(t))):(M(r,s.off?0:s.len,o.off?0:o.ins,e),i&&!o.off&&P(i,r,o.text));e=(s.ins>t||o.ins>=0&&o.len>t)&&(e||r.length>n),s.forward2(t),o.forward(t)}}else M(r,0,o.ins,e),i&&P(i,r,o.text),o.next()}}class N{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>
vendor: 4,375 bytes, line 1
1=e.length?i.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?i.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)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class L{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,r;return this.empty?n=r=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),n==this.from&&r==this.to?this:new L(n,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return R.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return R.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 R.range(e.anchor,e.head)}static create(e,t,n){return new L(e,t,n)}}class R{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:R.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 R([this.main],0)}addRange(e,t=!0){return R.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,R.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 R(e.ranges.map(e=>L.fromJSON(e)),e.main)}static single(e,t=e){return new R([R.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,r=0;r<e.length;r++){let i=e[r];if(i.empty?i.from<=n:i.from<n)return R.normalized(e.slice(),t);n=i.to}return new R(e,t)}static cursor(e,t=0,n,r){return L.create(e,e,(0==t?0:t<0?8:16)|(null==n?7:Math.min(6,n))|(null!=r?r:16777215)<<6)}static range(e,t,n,r){let i=(null!=n?n:16777215)<<6|(null==r?7:Math.min(6,r));return t<e?L.create(t,e,48|i):L.create(e,t,(t>e?8:0)|i)}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 r=e[n],i=e[n-1];if(r.empty?r.from<=i.to:r.from<i.to){let s=i.from,o=Math.max(r.to,i.to);n<=t&&t--,e.splice(--n,2,r.anchor>r.head?R.range(o,s):R.range(s,o))}}return new R(e,t)}}function j(e,t){for(let n of e.ranges)if(n.to>t)throw RangeError("Selection points outside of document")}let J=0;class ${constructor(e,t,n,r,i){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=r,this.id=J++,this.default=e([]),this.extensions="function"==typeof i?i(this):i}get reader(){return this}static define(e={}){return new $(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:F),!!e.static,e.enables)}of(e){return new q([],this,0,e)}compute(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new q(e,this,1,t)}computeN(e,t){if(this.isStatic)throw Error("Can't compute a static facet");return new q(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],n=>t(n.field(e)))}}function F(e,t){return e==t||e.length==t.length&&e.every((e,n)=>e===t[n])}class q{constructor(e,t,n,r){this.dependencies=e,this.facet=t,this.type=n,this.value=r,this.id=J++}dynamicSlot(e){var t;let n=this.value,r=this.facet.compareInput,i=this.id,s=e[i]>>1,o=2==this.type,l=!1,a=!1,h=[];for(let n of this.dependencies)"doc"==n?l=!0:"selection"==n?a=!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(l&&t.docChanged||a&&(t.docChanged||t.selection)||W(e,h)){let t=n(e);
1if(o?!_(t,e.values[s],r):!r(t,e.values[s]))return e.values[s]=t,1}return 0},reconfigure:(e,t)=>{let l,a=t.config.address[i];if(null!=a){let i=ee(t,a);if(this.dependencies.every(n=>n instanceof $?t.facet(n)===e.facet(n):!(n instanceof V)||t.field(n,!1)==e.field(n,!1))||(o?_(l=n(e),i,r):r(l=n(e),i)))return e.values[s]=i,0}else l=n(e);return e.values[s]=l,1}}}}function _(e,t,n){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}function W(e,t){let n=!1;for(let r of t)1&X(e,r)&&(n=!0);return n}let z=$.define({static:!0});class V{constructor(e,t,n,r,i){this.id=e,this.createF=t,this.updateF=n,this.compareF=r,this.spec=i,this.provides=void 0}static define(e){let t=new V(J++,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(z).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 r=e.values[t],i=this.updateF(r,n);return this.compareF(r,i)?0:(e.values[t]=i,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,z.of({field:this,create:e})]}get extension(){return this}}let U={lowest:4,low:3,default:2,high:1,highest:0};function H(e){return t=>new G(t,e)}let Q={highest:H(U.highest),high:H(U.high),default:H(U.default),low:H(U.low),lowest:H(U.lowest)};class G{constructor(e,t){this.inner=e,this.prec=t}}class K{of(e){return new Z(this,e)}reconfigure(e){return K.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Z{constructor(e,t){this.compartment=e,this.inner=t}}class Y{constructor(e,t,n,r,i,s){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=r,this.staticValues=i,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 r,i,s=[],o=Object.create(null),l=new Map;for(let n of(r=[[],[],[],[],[]],i=new Map,!function e(n,s){let o=i.get(n);if(null!=o){if(o<=s)return;let e=r[o].indexOf(n);e>-1&&r[o].splice(e,1),n instanceof Z&&l.delete(n.compartment)}if(i.set(n,s),Array.isArray(n))for(let t of n)e(t,s);else if(n instanceof Z){if(l.has(n.compartment))throw RangeError("Duplicate use of compartment in extensions");let r=t.get(n.compartment)||n.inner;l.set(n.compartment,r),e(r,s)}else if(n instanceof G)e(n.inner,n.prec);else if(n instanceof V)r[s].push(n),n.provides&&e(n.provides,s);else if(n instanceof q)r[s].push(n),n.facet.extensions&&e(n.facet.extensions,U.default);else{let t=n.extension;if(!t)throw Error(`Unrecognized extension value in extension set (${n}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);e(t,s)}}(e,U.default),r.reduce((e,t)=>e.concat(t))))n instanceof V?s.push(n):(o[n.facet.id]||(o[n.facet.id]=[])).push(n);let a=Object.create(null),h=[],c=[];for(let e of s)a[e.id]=c.length<<1,c.push(t=>e.slot(t));let u=null==n?void 0:n.config.facets;for(let e in o){let t=o[e],r=t[0].facet,i=u&&u[e]||[];if(t.every(e=>0==e.type)){if(a[r.id]=h.length<<1|1,F(i,t))h.push(n.facet(r));else{let e=r.combine(t.map(e=>e.value));h.push(n&&r.compare(e,n.facet(r))?n.facet(r):e)}}else{for(let e of t)0==e.type?(a[e.id]=h.length<<1|1,h.push(e.value)):(a[e.id]=c.length<<1,c.push(t=>e.dynamicSlot(t)));a[r.id]=c.length<<1,c.push(e=>(function(e,t,n){let r=n.map(t=>e[t.id]),i=n.map(e=>e.type),s=r.filter(e=>!(1&e)),o=e[t.id]>>1;function l(e){let n=[];for(let t=0;t<r.length;t++){let s=ee(e,r[t]);if(2==i[t])for(let e of s)n.push(e);else n.push(s)}return t.combine(n)}return{create(e){for(let t of r)X(e,t);return e.values[o]=l(e),1},update(e,n){if(!W(e,s))return 0;let r=l(e);return t.compare(r,e.values[o])?0:(e.values[o]=r,1)},reconfigure(e,i){let s=W(e,r),a=i.config.facets[t.id],h=i.facet(t);if(a&&!s&&F(n,a))return e.values[o]=h,0;let c=l(e);return t.compare(c,h)?(e.values[o]=h,0):(e.values[o]=c,1)}}})(e,r,t))}}let f=c.map(e=>e(a));return new Y(e,l,f,a,h,o)}}function X(e,t){if(1&t)return 2;let n=t>>1,r=e.status[n];if(4==r)throw Error("Cyclic dependency between fields and/or facets");if(2&r)return r;e.status[n]=4;let i=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|i}function ee(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}let et=$.define(),en=$.define({combine:e=>e.some(e=>e),static:!0}),er=$.define({combine:e=>e.length?e[0]:void 0,static:!0}),ei=$.define(),es=$.define(),eo=$.define(),el=$.define({combine:e=>!!e.length&&e[0]});class ea{constructor(e,t){this.type=e,this.value=t}static define(){return new eh}}class eh{of(e){return new ea(this,e)}}class ec{constructor(e){this.map=e}of(e){return new eu(this,e)}}class eu{constructor(e,t){this.type=e,this.value=t}
1map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new eu(this.type,t)}is(e){return this.type==e}static define(e={}){return new ec(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let r of e){let e=r.map(t);e&&n.push(e)}return n}}eu.reconfigure=eu.define(),eu.appendConfig=eu.define();class ef{constructor(e,t,n,r,i,s){this.startState=e,this.changes=t,this.selection=n,this.effects=r,this.annotations=i,this.scrollIntoView=s,this._doc=null,this._state=null,n&&j(n,t.newLength),i.some(e=>e.type==ef.time)||(this.annotations=i.concat(ef.time.of(Date.now())))}static create(e,t,n,r,i,s){return new ef(e,t,n,r,i,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(ef.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function ed(e,t,n){var r;let i,s,o;return n?(i=t.changes,s=O.empty(t.changes.length),o=e.changes.compose(t.changes)):(i=t.changes.map(e.changes),s=e.changes.mapDesc(t.changes,!0),o=e.changes.compose(i)),{changes:o,selection:t.selection?t.selection.map(s):null===(r=e.selection)||void 0===r?void 0:r.map(i),effects:eu.mapEffects(e.effects,i).concat(eu.mapEffects(t.effects,s)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function ep(e,t,n){let r=t.selection,i=eg(t.annotations);return t.userEvent&&(i=i.concat(ef.userEvent.of(t.userEvent))),{changes:t.changes instanceof O?t.changes:O.of(t.changes||[],n,e.facet(er)),selection:r&&(r instanceof R?r:R.single(r.anchor,r.head)),effects:eg(t.effects),annotations:i,scrollIntoView:!!t.scrollIntoView}}ef.time=ea.define(),ef.userEvent=ea.define(),ef.addToHistory=ea.define(),ef.remote=ea.define();let em=[];function eg(e){return null==e?em:Array.isArray(e)?e:[e]}var ev=((C=ev||(ev={}))[C.Word=0]="Word",C[C.Space=1]="Space",C[C.Other=2]="Other",C);let ey=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;try{r=RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(e){}class ew{constructor(e,t,n,r,i,s){this.config=e,this.doc=t,this.selection=n,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=i,s&&(s._state=this);for(let e=0;e<this.config.dynamicSlots.length;e++)X(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 X(this,n),ee(this,n)}update(...e){return function e(t,n,r){let i=ep(t,n.length?n[0]:{},t.doc.length);n.length&&!1===n[0].filter&&(r=!1);for(let e=1;e<n.length;e++){!1===n[e].filter&&(r=!1);let s=!!n[e].sequential;i=ed(i,ep(t,n[e],s?i.changes.newLength:t.doc.length),s)}let s=ef.create(t,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return function(e){let t=e.startState,n=t.facet(eo),r=e;for(let i=n.length-1;i>=0;i--){let s=n[i](e);s&&Object.keys(s).length&&(r=ed(r,ep(t,s,e.changes.newLength),!0))}return r==e?e:ef.create(t,e.changes,e.selection,r.effects,r.annotations,r.scrollIntoView)}(r?function(t){let n=t.startState,r=!0;for(let e of n.facet(ei)){let n=e(t);if(!1===n){r=!1;break}Array.isArray(n)&&(r=!0===r?n:function(e,t){let n=[];for(let r=0,i=0;;){let s,o;if(r<e.length&&(i==t.length||t[i]>=e[r]))s=e[r++],o=e[r++];else{if(!(i<t.length))return n;s=t[i++],o=t[i++]}!n.length||n[n.length-1]<s?n.push(s,o):n[n.length-1]<o&&(n[n.length-1]=o)}}(r,n))}if(!0!==r){let e,i;if(!1===r)i=t.changes.invertedDesc,e=O.empty(n.doc.length);else{let n=t.changes.filter(r);e=n.changes,i=n.filtered.mapDesc(n.changes).invertedDesc}t=ef.create(n,e,t.selection&&t.selection.map(i),eu.mapEffects(t.effects,i),t.annotations,t.scrollIntoView)}let i=n.facet(es);for(let r=i.length-1;r>=0;r--){let s=i[r](t);t=s instanceof ef?s:Array.isArray(s)&&1==s.length&&s[0]instanceof ef?s[0]:e(n,eg(s),!1)}return t}(s):s)}(this,e,!0)}applyTransaction(e){let t,n=this.config,{base:r,compartments:i}=n;for(let t of e.effects)t.is(K.reconfigure)?(n&&(i=new Map,n.compartments.forEac
vendor: 4,289 bytes, line 1
1h((e,t)=>i.set(t,e)),n=null),i.set(t.value.compartment,t.value.extension)):t.is(eu.reconfigure)?(n=null,r=t.value):t.is(eu.appendConfig)&&(n=null,r=eg(r).concat(t.value));n?t=e.startState.values.slice():(n=Y.resolve(r,i,this),t=new ew(n,this.doc,this.selection,n.dynamicSlots.map(()=>null),(e,t)=>t.reconfigure(e,this),null).values);let s=e.startState.facet(en)?e.newSelection:e.newSelection.asSingle();new ew(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:R.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),r=this.changes(n.changes),i=[n.range],s=eg(n.effects);for(let n=1;n<t.ranges.length;n++){let o=e(t.ranges[n]),l=this.changes(o.changes),a=l.map(r);for(let e=0;e<n;e++)i[e]=i[e].map(a);let h=r.mapDesc(l,!0);i.push(o.range.map(h)),r=r.compose(a),s=eu.mapEffects(s,a).concat(eu.mapEffects(eg(o.effects),h))}return{changes:r,selection:R.create(i,t.mainIndex),effects:s}}changes(e=[]){return e instanceof O?e:O.of(e,this.doc.length,this.facet(ew.lineSeparator))}toText(e){return i.of(e.split(this.facet(ew.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:(X(this,t),ee(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let r=e[n];r instanceof V&&null!=this.config.address[r.id]&&(t[n]=r.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 r=[];if(n){for(let t in n)if(Object.prototype.hasOwnProperty.call(e,t)){let i=n[t],s=e[t];r.push(i.init(e=>i.spec.fromJSON(s,e)))}}return ew.create({doc:e.doc,selection:R.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=Y.resolve(e.extensions||[],new Map),n=e.doc instanceof i?e.doc:i.of((e.doc||"").split(t.staticFacet(ew.lineSeparator)||S)),r=e.selection?e.selection instanceof R?e.selection:R.single(e.selection.anchor,e.selection.head):R.single(0);return j(r,n.length),t.staticFacet(en)||(r=r.asSingle()),new ew(t,n,r,t.dynamicSlots.map(()=>null),(e,t)=>t.create(e),null)}get tabSize(){return this.facet(ew.tabSize)}get lineBreak(){return this.facet(ew.lineSeparator)||"\n"}get readOnly(){return this.facet(el)}phrase(e,...t){for(let t of this.facet(ew.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 r=+(n||1);return!r||r>t.length?e:t[r-1]})),e}languageDataAt(e,t,n=-1){let r=[];for(let i of this.facet(et))for(let s of i(this,t,n))Object.prototype.hasOwnProperty.call(s,e)&&r.push(s[e]);return r}charCategorizer(e){var t;return t=this.languageDataAt("wordChars",e).join(""),e=>{if(!/\S/.test(e))return ev.Space;if(function(e){if(r)return r.test(e);for(let t=0;t<e.length;t++){let n=e[t];if(/\w/.test(n)||n>"\x80"&&(n.toUpperCase()!=n.toLowerCase()||ey.test(n)))return!0}return!1}(e))return ev.Word;for(let n=0;n<t.length;n++)if(e.indexOf(t[n])>-1)return ev.Word;return ev.Other}}wordAt(e){let{text:t,from:n,length:r}=this.doc.lineAt(e),i=this.charCategorizer(e),s=e-n,o=e-n;for(;s>0;){let e=m(t,s,!1);if(i(t.slice(e,s))!=ev.Word)break;s=e}for(;o<r;){let e=m(t,o);if(i(t.slice(o,e))!=ev.Word)break;o=e}return s==o?null:R.range(s+n,o+n)}}function ex(e,t,n={}){let r={};for(let t of e)for(let e of Object.keys(t)){let i=t[e],s=r[e];if(void 0===s)r[e]=i;else if(s===i||void 0===i);else if(Object.hasOwnProperty.call(n,e))r[e]=n[e](s,i);else throw Error("Config merge conflict for field "+e)}for(let e in t)void 0===r[e]&&(r[e]=t[e]);return r}ew.allowMultipleSelections=en,ew.tabSize=$.define({combine:e=>e.length?e[0]:4}),ew.lineSeparator=er,ew.readOnly=el,ew.phrases=$.define({compare(e,t){let n=Object.keys(e),r=Object.keys(t);return n.length==r.length&&n.every(n=>e[n]==t[n])}}),ew.languageData=et,ew.changeFilter=ei,ew.transactionFilter=es,ew.transactionExtender=eo,K.reconfigure=eu.define();class ek{eq(e){return this==e}range(e,t=e){return eb.create(e,t,this)}}ek.prototype.startSide=ek.prototype.endSide=0,ek.prototype.point=!1,ek.prototype.mapM
vendor: 8,579 bytes, line 1
1ode=I.TrackDel;class eb{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new eb(e,t,n)}}function eS(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class eA{constructor(e,t,n,r){this.from=e,this.to=t,this.value=n,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,r=0){let i=n?this.to:this.from;for(let s=r,o=i.length;;){if(s==o)return s;let r=s+o>>1,l=i[r]-e||(n?this.value[r].endSide:this.value[r].startSide)-t;if(r==s)return l>=0?s:o;l>=0?o=r:s=r+1}}between(e,t,n,r){for(let i=this.findIndex(t,-1e9,!0),s=this.findIndex(n,1e9,!1,i);i<s;i++)if(!1===r(this.from[i]+e,this.to[i]+e,this.value[i]))return!1}map(e,t){let n=[],r=[],i=[],s=-1,o=-1;for(let l=0;l<this.value.length;l++){let a=this.value[l],h=this.from[l]+e,c=this.to[l]+e,u,f;if(h==c){let e=t.mapPos(h,a.startSide,a.mapMode);if(null==e||(u=f=e,a.startSide!=a.endSide&&(f=t.mapPos(h,a.endSide))<u))continue}else if((u=t.mapPos(h,a.startSide))>(f=t.mapPos(c,a.endSide))||u==f&&a.startSide>0&&a.endSide<=0)continue;0>(f-u||a.endSide-a.startSide)||(s<0&&(s=u),a.point&&(o=Math.max(o,f-u)),n.push(a),r.push(u-s),i.push(f-s))}return{mapped:n.length?new eA(r,i,n,o):null,pos:s}}}class eC{constructor(e,t,n,r){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=r}static create(e,t,n,r){return new eC(e,t,n,r)}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:r=0,filterTo:i=this.length}=e,s=e.filter;if(0==t.length&&!s)return this;if(n&&(t=t.slice().sort(eS)),this.isEmpty)return t.length?eC.of(t):this;let o=new eO(this,null,-1).goto(0),l=0,a=[],h=new eI;for(;o.value||l<t.length;)if(l<t.length&&(o.from-t[l].from||o.startSide-t[l].value.startSide)>=0){let e=t[l++];h.addInner(e.from,e.to,e.value)||a.push(e)}else 1==o.rangeIndex&&o.chunkIndex<this.chunk.length&&(l==t.length||this.chunkEnd(o.chunkIndex)<t[l].from)&&(!s||r>this.chunkEnd(o.chunkIndex)||i<this.chunkPos[o.chunkIndex])&&h.addChunk(this.chunkPos[o.chunkIndex],this.chunk[o.chunkIndex])?o.nextChunk():((!s||r>o.to||i<o.from||s(o.from,o.to,o.value))&&!h.addInner(o.from,o.to,o.value)&&a.push(eb.create(o.from,o.to,o.value)),o.next());return h.finishInner(this.nextLayer.isEmpty&&!a.length?eC.empty:this.nextLayer.update({add:a,filter:s,filterFrom:r,filterTo:i}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],r=-1;for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],o=this.chunk[i],l=e.touchesRange(s,s+o.length);if(!1===l)r=Math.max(r,o.maxPoint),t.push(o),n.push(e.mapPos(s));else if(!0===l){let{mapped:i,pos:l}=o.map(s,e);i&&(r=Math.max(r,i.maxPoint),t.push(i),n.push(l))}}let i=this.nextLayer.map(e);return 0==t.length?i:new eC(n,t,i||eC.empty,r)}between(e,t,n){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let i=this.chunkPos[r],s=this.chunk[r];if(t>=i&&e<=i+s.length&&!1===s.between(i,e-i,t-i,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return eM.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return eM.from(e).goto(t)}static compare(e,t,n,r,i=-1){let s=e.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),o=t.filter(e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=i),l=eT(s,o,n),a=new eD(s,l,i),h=new eD(o,l,i);n.iterGaps((e,t,n)=>eE(a,e,h,t,n,r)),n.empty&&0==n.length&&eE(a,0,h,0,0,r)}static eq(e,t,n=0,r){null==r&&(r=999999999);let i=e.filter(e=>!e.isEmpty&&0>t.indexOf(e)),s=t.filter(t=>!t.isEmpty&&0>e.indexOf(t));if(i.length!=s.length)return!1;if(!i.length)return!0;let o=eT(i,s),l=new eD(i,o,0).goto(n),a=new eD(s,o,0).goto(n);for(;;){if(l.to!=a.to||!eB(l.active,a.active)||l.point&&(!a.point||!l.point.eq(a.point)))return!1;if(l.to>r)return!0;l.next(),a.next()}}static spans(e,t,n,r,i=-1){let s=new eD(e,null,i).goto(t),o=t,l=s.openStart;for(;;){let e=Math.min(s.to,n);if(s.point){let n=s.activeForPoint(s.to),i=s.pointFrom<t?n.length+1:s.point.startSide<0?n.length:Math.min(n.length,l);r.point(o,e,s.point,n,i,s.pointRank),l=Math.min(s.openEnd(e),n.length)}else e>o&&(r.span(o,e,s.active,l),l=s.openEnd(e));if(s.to>n)return l+(s.point&&s.to>n?1:0);o=s.to,s.next()}}static of(e,t=!1){let n=new eI;for(let r of e instanceof eb?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n<e.length;n++){let r=e[n];if(eS(t,r)>0)return e.slice().sort(eS);t=r}return e}(e):e)n.add(r.from,r.to,r.value);return n.finish()}static join(e){if(!e.length)return eC.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let r=e[n];r!=eC.empty;r=r.nextLayer)t=new eC(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}eC.empty=new eC([],[],null,-1),eC.empty.nextLayer=eC.empty;class eI{finishChunk(e){this.chunks.push(new eA(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 eI)).add(e,t,n)}addInner(e,t,n){let r=e-this.lastTo||n.startSide-this.last.endSide;if(r<=0&&0>(e-this.lastFrom||n.startSide-this.last.startSide))throw Error("Ranges must be added sorted by `from` position and `startSide`");return!(r<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(eC.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=eC.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function eT(e,t,n){let r=new Map;for(let t of e)for(let e=0;e<t.chunk.length;e++)t.chunk[e].maxPoint<=0&&r.set(t.chunk[e],t.chunkPos[e]);let i=new Set;for(let e of t)for(let t=0;t<e.chunk.length;t++){let s=r.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))||i.add(e.chunk[t])}return i}class eO{constructor(e,t,n,r=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=r}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 r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<r)&&this.setRangeIndex(r)}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}}class eM{constructor(e){this.heap=e}static from(e,t=null,n=-1){let r=[];for(let i=0;i<e.length;i++)for(let s=e[i];!s.isEmpty;s=s.nextLayer)s.maxPoint>
1=n&&r.push(new eO(s,t,n,i));return 1==r.length?r[0]:new eM(r)}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--)eP(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--)eP(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(),eP(this.heap,0)}}}function eP(e,t){for(let n=e[t];;){let r=(t<<1)+1;if(r>=e.length)break;let i=e[r];if(r+1<e.length&&i.compare(e[r+1])>=0&&(i=e[r+1],r++),0>n.compare(i))break;e[r]=n,e[t]=i,t=r}}class eD{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=eM.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){eN(this.active,e),eN(this.activeTo,e),eN(this.activeRank,e),this.minActive=eR(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:r,rank:i}=this.cursor;for(;t<this.activeRank.length&&(i-this.activeRank[t]||r-this.activeTo[t])>0;)t++;eL(this.active,t,n),eL(this.activeTo,t,r),eL(this.activeRank,t,i),e&&eL(e,t,this.cursor.from),this.minActive=eR(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&0>(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),n&&eN(n,r)}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 eE(e,t,n,r,i,s){e.goto(t),n.goto(r);let o=r+i,l=r,a=r-t;for(;;){let t=e.to+a-n.to||e.endSide-n.endSide,r=t<0?e.to+a:n.to,i=Math.min(r,o);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&eB(e.activeForPoint(e.to),n.activeForPoint(n.to))||s.comparePoint(l,i,e.point,n.point):i>l&&!eB(e.active,n.active)&&s.compareRange(l,i,e.active,n.active),r>o)break;l=r,t<=0&&e.next(),t>=0&&n.next()}}function eB(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 eN(e,t){for(let n=t,r=e.length-1;n<r;n++)e[n]=e[n+1];e.pop()}
1function eL(e,t,n){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=n}function eR(e,t){let n=-1,r=1e9;for(let i=0;i<t.length;i++)0>(t[i]-r||e[i].endSide-e[n].endSide)&&(n=i,r=t[i]);return n}function ej(e,t,n=e.length){let r=0;for(let i=0;i<n;)9==e.charCodeAt(i)?(r+=t-r%t,i++):(r++,i=m(e,i));return r}function eJ(e,t,n,r){for(let r=0,i=0;;){if(i>=t)return r;if(r==e.length)break;i+=9==e.charCodeAt(r)?n-i%n:1,r=m(e,r)}return!0===r?-1:e.length}},41113:function(e,t,n){var r,i;n.d(t,{FE:function(){return j},Jq:function(){return u},L3:function(){return s},Lj:function(){return f},_b:function(){return L},hr:function(){return B},i9:function(){return N},md:function(){return a},mp:function(){return m},vj:function(){return r}});let s=1024,o=0;class l{constructor(e,t){this.from=e,this.to=t}}class a{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=u.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}a.closedBy=new a({deserialize:e=>e.split(" ")}),a.openedBy=new a({deserialize:e=>e.split(" ")}),a.group=new a({deserialize:e=>e.split(" ")}),a.isolate=new a({deserialize:e=>{if(e&&"rtl"!=e&&"ltr"!=e&&"auto"!=e)throw RangeError("Invalid value for isolate: "+e);return e||"auto"}}),a.contextHash=new a({perNode:!0}),a.lookAhead=new a({perNode:!0}),a.mounted=new a({perNode:!0});class h{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[a.mounted.id]}}let c=Object.create(null);class u{constructor(e,t,n,r=0){this.name=e,this.props=t,this.id=n,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):c,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),r=new u(e.name||"",t,e.id,n);if(e.props){for(let n of e.props)if(Array.isArray(n)||(n=n(r)),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 r}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(a.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 r of n.split(" "))t[r]=e[n];return e=>{for(let n=e.prop(a.group),r=-1;r<(n?n.length:0);r++){let i=t[r<0?e.name:n[r]];if(i)return i}}}}u.none=new u("",Object.create(null),0,8);class f{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 r=null;for(let t of e){let e=t(n);e&&(r||(r=Object.assign({},n.props)),r[e[0].id]=e[1])}t.push(r?new u(n.name,r,n.id,n.flags):n)}return new f(t)}}let d=new WeakMap,p=new WeakMap;(i=r||(r={}))[i.ExcludeBuffers=1]="ExcludeBuffers",i[i.IncludeAnonymous=2]="IncludeAnonymous",i[i.IgnoreMounts=4]="IgnoreMounts",i[i.IgnoreOverlays=8]="IgnoreOverlays";class m{constructor(e,t,n,r,i){if(this.type=e,this.children=t,this.positions=n,this.length=r,this.props=null,i&&i.length)for(let[e,t]of(this.props=Object.create(null),i))this.props["number"==typeof e?e:e.id]=t}toString(){let e=h.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 O(this.topNode,e)}cursorAt(e,t=0,n=0){let r=d.get(this)||this.topNode,i=new O(r);return i.moveTo(e,t),d.set(this,i._tree),i}get topNode(){return new k(this,0,0,null)}resolve(e,t=0){let n=w(d.get(this)||this.topNode,e,t,!1);return d.set(this,n),n}resolveInner(e,t=0){let n=w(p.get(this)||this.topNode,e,t,!0);return p.set(this,n),n}resolveStack(e,t=0){return function(e,t,n){let r=e.resolveInner(t,n),i=null;for(let e=r instanceof k?r:r.context.parent;e;e=e.parent)if(e.index<0){let s=e.parent;(i||(i=[r])).push(s.resolve(t,n)),e=s}else{let s=h.get(e.tree);if(s&&s.overlay&&s.overlay[0].from<=t&&s.overlay[s.overlay.length-1].to>=t){let o=new k(s.tree,s.overlay[0].from+e.from,-1,e);(i||(i=[r])).push(w(o,t,n,!1))}}return i?I(i):r}(this,e,t)}iterate(e){let{enter:t,leave:n,from:i=0,to:s=this.length}=e,o=e.mode||0,l=(o&r.IncludeAnonymous)>0;for(let e=this.cursor(o|r.IncludeAnonymous);;){let r=!1;if(e.from<=s&&e.to>=i&&(!l&&e.type.isAnonymous||!1!==t(e))){if(e.firstChild())continue;r=!0}for(;r&&n&&(l||!e.type.isAnonymous)&&n(e),!e.nextSibling();){if(!e.parent())return;r=!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:E(u.none,this.children,this.positions,0,this.children.length,0,this.length,(e,t,n)=>new m(this.type,e,t,n,this.propValues),e.makeTree||((e,t,n)=>new m(u.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:r,maxBufferLength:i=s,reused:o=[],minRepeatType:l=r.types.length}=e,h=Array.isArray(n)?new g(n,n.length):n,c=r.types,u=0,f=0;function d(e,t,n,i,s,o,l,a){let h=[],c=[];for(;e.length>i;)h.push(e.pop()),c.push(t.pop()+n-s);e.push(p(r.types[l],h,c,o-s,a-o)),t.push(s-n)}function p(e,t,n,r,i=0,s){if(u){let e=[a.contextHash,u];s=s?[e].concat(s):[e]}if(i>25){let e=[a.lookAhead,i];s=s?[e].concat(s):[e]}return new m(e,t,n,r,s)}let y=[],w=[];for(;h.pos>0;)!function e(t,n,s,g,y,w){let{id:x,start:k,end:b,size:S}=h,A=f;for(;S<0;){if(h.next(),-1==S){let e=o[x];s.push(e),g.push(k-t);return}if(-3==S){u=x;return}if(-4==S){f=x;return}throw RangeError(`Unrecognized record size: ${S}`)}let C=c[x],I,T,O=k-t;if(b-k<=i&&(T=function(e,t){let n=h.fork(),r=0,s=0,o=0,a=n.end-i,c={size:0,start:0,skip:0};t:for(let i=n.pos-e;n.pos>i;){let e=n.size;if(n.id==t&&e>=0){c.size=r,c.start=s,c.skip=o,o+=4,r+=4,n.next();continue}let h=n.pos-e;if(e<0||h<i||n.start<a)break;let u=n.id>=l?4:0,f=n.start;for(n.next();n.pos>h;){if(n.size<0){if(-3==n.size)u+=4;else break t}else n.id>=l&&(u+=4);n.next()}s=f,r+=e,o+=u}return(t<0||r==e)&&(c.size=r,c.start=s,c.skip=o),c.size>4?c:void 0}(h.pos-n,y))){let e=new Uint16Array(T.size-T.skip),n=h.pos-T.size,i=e.length;for(;h.pos>n;)i=function e(t,n,r){let{id:i,start:s,end:o,size:a}=h;if(h.next(),a>=0&&i<l){let l=r;if(a>4){let i=h.pos-(a-4);for(;h.pos>i;)r=e(t,n,r)}n[--r]=l,n[--r]=o-t,n[--r]=s-t,n[--r]=i}else -3==a?u=i:-4==a&&(f=i);return r}(T.start,e,i);I=new v(e,b-T.start,r),O=T.start-t}else{let t=h.pos-S;h.next();let n=[],s=[],o=x>=l?x:-1,c=0,u=b;for(;h.pos>t;)o>=0&&h.id==o&&h.size>=0?(h.end<=u-i&&(d(n,s,k,c,h.end,u,o,A),c=n.length,u=h.end),h.next()):w>2500?function(e,t,n,s){let o=[],l=0,a=-1;for(;h.pos>t;){let{id:e,start:t,end:n,size:r}=h;if(r>4)h.next();else if(a>-1&&t<a)break;
vendor: 7,551 bytes, line 1
1else a<0&&(a=n-i),o.push(e,t,n),l++,h.next()}if(l){let t=new Uint16Array(4*l),i=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]-i,t[n++]=o[e+2]-i,t[n++]=n;n.push(new v(t,o[2]-i,r)),s.push(i-e)}}(k,t,n,s):e(k,t,n,s,o,w+1);if(o>=0&&c>0&&c<n.length&&d(n,s,k,c,k,u,o,A),n.reverse(),s.reverse(),o>-1&&c>0){let e=function(e){return(t,n,r)=>{let i=0,s=t.length-1,o,l;if(s>=0&&(o=t[s])instanceof m){if(!s&&o.type==e&&o.length==r)return o;(l=o.prop(a.lookAhead))&&(i=n[s]+o.length+l)}return p(e,t,n,r,i)}}(C);I=E(C,n,s,0,n.length,0,b-k,e,e)}else I=p(C,n,s,b-k,A-b)}s.push(I),g.push(O)}(e.start||0,e.bufferStart||0,y,w,-1,0);let x=null!==(t=e.length)&&void 0!==t?t:y.length?w[0]+y[0].length:0;return new m(c[e.topID],y.reverse(),w.reverse(),x)}(e)}}m.empty=new m(u.none,[],[],0);class g{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 g(this.buffer,this.index)}}class v{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return u.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],r=this.set.types[t],i=r.name;if(/\W/.test(i)&&!r.isError&&(i=JSON.stringify(i)),n==(e+=4))return i;let s=[];for(;e<n;)s.push(this.childString(e)),e=this.buffer[e+3];return i+"("+s.join(",")+")"}findChild(e,t,n,r,i){let{buffer:s}=this,o=-1;for(let l=e;l!=t&&(!y(i,r,s[l+1],s[l+2])||(o=l,!(n>0)));l=s[l+3]);return o}slice(e,t,n){let r=this.buffer,i=new Uint16Array(t-e),s=0;for(let o=e,l=0;o<t;){i[l++]=r[o++],i[l++]=r[o++]-n;let t=i[l++]=r[o++]-n;i[l++]=r[o++]-e,s=Math.max(s,t)}return new v(i,s,this.set)}}function y(e,t,n,r){switch(e){case -2:return n<t;case -1:return r>=t&&n<t;case 0:return n<t&&r>t;case 1:return n<=t&&r>t;case 2:return r>t;case 4:return!0}}function w(e,t,n,i){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=!i&&e instanceof k&&e.index<0?null:e.parent;if(!t)return e;e=t}let o=i?0:r.IgnoreOverlays;if(i)for(let r=e,i=r.parent;i;i=(r=i).parent)r instanceof k&&r.index<0&&(null===(s=i.enter(t,n,o))||void 0===s?void 0:s.from)!=r.from&&(e=i);for(;;){let r=e.enter(t,n,o);if(!r)return e;e=r}}class x{cursor(e=0){return new O(this,e)}getChild(e,t=null,n=null){let r=b(this,e,t,n);return r.length?r[0]:null}getChildren(e,t=null,n=null){return b(this,e,t,n)}resolve(e,t=0){return w(this,e,t,!1)}resolveInner(e,t=0){return w(this,e,t,!0)}matchContext(e){return S(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}}class k extends x{constructor(e,t,n,r){super(),this._tree=e,this.from=t,this.index=n,this._parent=r}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,i,s=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,c=t>0?l.length:-1;e!=c;e+=t){let c=l[e],u=a[e]+o.from;if(y(i,n,u,u+c.length)){if(c instanceof v){if(s&r.ExcludeBuffers)continue;let l=c.findChild(0,c.buffer.length,t,n-u,i);if(l>-1)return new C(new A(o,c,e,u),null,l)}else if(s&r.IncludeAnonymous||!c.type.isAnonymous||M(c)){let l;if(!(s&r.IgnoreMounts)&&(l=h.get(c))&&!l.overlay)return new k(l.tree,u,e,o);let a=new k(c,u,e,o);return s&r.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(t<0?c.children.length-1:0,t,n,i)}}}if(s&r.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 i;if(!(n&r.IgnoreOverlays)&&(i=h.get(this._tree))&&i.overlay){let n=e-this.from;for(let{from:e,to:r}of i.overlay)if((t>0?e<=n:e<n)&&(t<0?r>=n:r>n))return new k(i.tree,i.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 b(e,t,n,r){let i=e.cursor(),s=[];if(!i.firstChild())return s;if(null!=n){for(let e=!1;!e;)if(e=i.type.is(n),!i.nextSibling())return s}for(;;){if(null!=r&&i.type.is(r))return s;if(i.type.is(t)&&s.push(i.node),!i.nextSibling())return null==r?s:[]}}function S(e,t,n=t.length-1){for(let r=e.parent;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(t[n]&&t[n]!=r.name)return!1;n--}}return!0}class A{constructor(e,t,n,r){this.parent=e,this.buffer=t,this.index=n,this.start=r}}class C extends x{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:r}=this.context,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,n);return i<0?null:new C(this.context,this,i)}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&r.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new C(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.index+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 C(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 C(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,r=this.index+4,i=n.buffer[this.index+3];if(i>r){let s=n.buffer[this.index+1];e.push(n.slice(r,i,s)),t.push(0)}return new m(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function I(e){if(!e.length)return null;let t=0,n=e[0];for(let r=1;r<e.length;r++){let i=e[r];(i.from>n.from||i.to<n.to)&&(n=i,t=r)}let r=n instanceof k&&n.index<0?null:n.parent,i=e.slice();return r?i[t]=r:i.splice(t,1),new T(i,n)}class T{constructor(e,t){this.heads=e,this.node=t}get next(){return I(this.heads)}}class O{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 k)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;
vendor: 5,775 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:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=n+r.buffer[e+1],this.to=n+r.buffer[e+2],!0}yield(e){return!!e&&(e instanceof k?(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:r}=this.buffer,i=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,n);return!(i<0)&&(this.stack.push(this.index),this.yieldBuf(i))}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&r.ExcludeBuffers)&&this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&r.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&r.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:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let e=0;e<this.index;e++)if(i.buffer.buffer[e+3]<this.index)return!1;({index:t,parent:n}=i)}else({index:t,_parent:n}=this._tree);for(;n;{index:t,_parent:n}=n)if(t>-1)for(let i=t+e,s=e<0?-1:n._tree.children.length;i!=s;i+=e){let e=n._tree.children[i];if(this.mode&r.IncludeAnonymous||e instanceof v||!e.type.isAnonymous||M(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 r=this.index,i=this.stack.length;i>=0;){for(let s=e;s;s=s._parent)if(s.index==r){if(r==this.index)return s;t=s,n=i+1;break t}r=this.stack[--i]}for(let e=n;e<this.stack.length;e++)t=new C(this.buffer,t,this.stack[e]);return this.bufferNode=new C(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let n=0;;){let r=!1;if(this.type.isAnonymous||!1!==e(this)){if(this.firstChild()){n++;continue}this.type.isAnonymous||(r=!0)}for(;r&&t&&t(this),r=this.type.isAnonymous,!this.nextSibling();){if(!n)return;this.parent(),n--,r=!0}}}matchContext(e){if(!this.buffer)return S(this.node,e);let{buffer:t}=this.buffer,{types:n}=t.set;for(let r=e.length-1,i=this.stack.length-1;r>=0;i--){if(i<0)return S(this.node,e,r);let s=n[t.buffer[this.stack[i]]];if(!s.isAnonymous){if(e[r]&&e[r]!=s.name)return!1;r--}}return!0}}function M(e){return e.children.some(e=>e instanceof v||!e.type.isAnonymous||M(e))}let P=new WeakMap;function D(e,t){if(!e.isAnonymous||t instanceof v||t.type!=e)return 1;let n=P.get(t);if(null==n){for(let r of(n=1,t.children)){if(r.type!=e||!(r instanceof m)){n=1;break}n+=D(e,r)}P.set(t,n)}return n}function E(e,t,n,r,i,s,o,l,a){let h=0;for(let n=r;n<i;n++)h+=D(e,t[n]);let c=Math.ceil(1.5*h/8),u=[],f=[];return!function t(n,r,i,o,l){for(let h=i;h<o;){let i=h,d=r[h],p=D(e,n[h]);for(h++;h<o;h++){let t=D(e,n[h]);if(p+t>=c)break;p+=t}if(h==i+1){if(p>c){let e=n[i];t(e.children,e.positions,0,e.children.length,r[i]+l);continue}u.push(n[i])}else{let t=r[h-1]+n[h-1].length-d;u.push(E(e,n,r,i,h,d,t,null,a))}f.push(d+l-s)}}(t,n,r,i,0),(l||a)(u,f,o)}class B{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof C?this.setBuffer(e.context.buffer,e.index,t):e instanceof k&&this.map.set(e.tree,t)}get(e){return e instanceof C?this.getBuffer(e.context.buffer,e.index):e instanceof k?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)}}class N{constructor(e,t,n,r,i=!1,s=!1){this.from=e,this.to=t,this.tree=n,this.offset=r,this.open=(i?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 r=[new N(0,e.length,e,0,!1,n)];for(let n of t)n.to>e.length&&r.push(n);return r}static applyChanges(e,t,n=128){if(!t.length)return e;let r=[],i=1,s=e.length?e[0]:null;for(let o=0,l=0,a=0;;o++){let h=o<t.length?t[o]:null,c=h?h.fromA:1e9;if(c-l>=n)for(;s&&s.from<c;){let t=s;if(l>=t.from||c<=t.to||a){let e=Math.max(t.from,l)-a,n=Math.min(t.to,c)-a;t=e>=n?null:new N(e,n,t.tree,t.offset+a,o>
10,!!h)}if(t&&r.push(t),s.to>c)break;s=i<e.length?e[i++]:null}if(!h)break;l=h.toA,a=h.toA-h.toB}return r}}class L{startParse(e,t,n){return"string"==typeof e&&(e=new R(e)),n=n?n.length?n.map(e=>new l(e.from,e.to)):[new l(0,0)]:[new l(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let r=this.startParse(e,t,n);for(;;){let e=r.advance();if(e)return e}}}class R{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)}}function j(e){return(t,n,r,i)=>new _(t,e,n,r,i)}class J{constructor(e,t,n,r,i){this.parser=e,this.parse=t,this.overlay=n,this.target=r,this.from=i}}function $(e){if(!e.length||e.some(e=>e.from>=e.to))throw RangeError("Invalid inner parse ranges given: "+JSON.stringify(e))}class F{constructor(e,t,n,r,i,s,o){this.parser=e,this.predicate=t,this.mounts=n,this.index=r,this.start=i,this.target=s,this.prev=o,this.depth=0,this.ranges=[]}}let q=new a({perNode:!0});class _{constructor(e,t,n,r,i){this.nest=t,this.input=n,this.fragments=r,this.ranges=i,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let e=this.baseParse.advance();if(!e)return null;if(this.baseParse=null,this.baseTree=e,this.startInner(),null!=this.stoppedAt)for(let e of this.inner)e.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let e=this.baseTree;return null!=this.stoppedAt&&(e=new m(e.type,e.children,e.positions,e.length,e.propValues.concat([[q,this.stoppedAt]]))),e}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[a.mounted.id]=new h(t,e.overlay,e.parser),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new V(this.fragments),t=null,n=null,i=new O(new k(this.baseTree,this.ranges[0].from,0,null),r.IncludeAnonymous|r.IgnoreMounts);t:for(let r,s;;){let o=!0,a;if(null!=this.stoppedAt&&i.from>=this.stoppedAt)o=!1;else if(e.hasNode(i)){if(t){let e=t.mounts.find(e=>e.frag.from<=i.from&&e.frag.to>=i.to&&e.mount.overlay);if(e)for(let n of e.mount.overlay){let r=n.from+e.pos,s=n.to+e.pos;r>=i.from&&s<=i.to&&!t.ranges.some(e=>e.from<s&&e.to>r)&&t.ranges.push({from:r,to:s})}}o=!1}else if(n&&(s=function(e,t,n){for(let r of e){if(r.from>=n)break;if(r.to>t)return r.from<=t&&r.to>=n?2:1}return 0}(n.ranges,i.from,i.to)))o=2!=s;else if(!i.type.isAnonymous&&(r=this.nest(i,this.input))&&(i.from<i.to||!r.overlay)){i.tree||function(e){let{node:t}=e,n=[],r=t.context.buffer;do n.push(e.index),e.parent();while(!e.tree);let i=e.tree,s=i.children.indexOf(r),o=i.children[s],l=o.buffer,a=[s];for(let r of(i.children[s]=function e(r,i,s,h,c,u){let f=n[u],d=[],p=[];W(o,r,f,d,p,h);let g=l[f+1],v=l[f+2];a.push(d.length);let y=u?e(f+4,l[f+3],o.set.types[l[f]],g,v-g,u-1):t.toTree();return d.push(y),p.push(g-h),W(o,l[f+3],i,d,p,h),new m(s,d,p,c)}(0,l.length,u.none,0,o.length,n.length-1),a)){let t=e.tree.children[r],n=e.tree.positions[r];e.yield(new k(t,n+e.from,r,e._tree))}}(i);let s=e.findMounts(i.from,r.parser);if("function"==typeof r.overlay)t=new F(r.parser,r.overlay,s,this.inner.length,i.from,i.tree,t);else{let e=U(this.ranges,r.overlay||(i.from<i.to?[new l(i.from,i.to)]:[]));e.length&&$(e),(e.length||!r.overlay)&&this.inner.push(new J(r.parser,e.length?r.parser.startParse(this.input,H(s,e),e):r.parser.startParse(""),r.overlay?r.overlay.map(e=>new l(e.from-i.from,e.to-i.from)):null,i.tree,e.length?e[0].from:i.from)),r.overlay?e.length&&(n={ranges:e,depth:0,prev:n}):o=!1}}else t&&(a=t.predicate(i))&&(!0===a&&(a=new l(i.from,i.to)),a.from<a.to&&t.ranges.push(a));if(o&&i.firstChild())t&&t.depth++,n&&n.depth++;else for(;!i.nextSibling();){if(!i.parent())break t;if(t&&!--t.depth){let e=U(this.ranges,t.ranges);e.length&&($(e),this.inner.splice(t.index,0,new J(t.parser,t.parser.startParse(this.input,H(t.mounts,e),e),t.ranges.map(e=>new l(e.from-t.start,e.to-t.start)),t.target,e[0].from))),t=t.prev}!n||--n.depth||(n=n.prev)}}}}function W(e,t,n,r,i,s){if(t<n){let o=e.buffer[t+1];r.push(e.slice(t,n,o)),i.push(o-s)}}class z{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(r.IncludeAnonymous|r.IgnoreMounts)}moveTo(e){let{cursor:t}=this,n=e-this.offset;for(;!this.done&&t.from<n;)t.to>=e&&t.enter(n,1,r.IgnoreOverlays|r.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;
1if(t.children.length&&0==t.positions[0]&&t.children[0]instanceof m)t=t.children[0];else break}return!1}}class V{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=null!==(t=n.tree.prop(q))&&void 0!==t?t:n.to,this.inner=new z(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=null!==(e=t.tree.prop(q))&&void 0!==e?e:t.to,this.inner=new z(t.tree,-t.offset)}}findMounts(e,t){var n;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let e=this.inner.cursor.node;e;e=e.parent){let i=null===(n=e.tree)||void 0===n?void 0:n.prop(a.mounted);if(i&&i.parser==t)for(let t=this.fragI;t<this.fragments.length;t++){let n=this.fragments[t];if(n.from>=e.to)break;n.tree==this.curFrag.tree&&r.push({frag:n,pos:e.from-n.offset,mount:i})}}}return r}}function U(e,t){let n=null,r=t;for(let i=1,s=0;i<e.length;i++){let o=e[i-1].to,a=e[i].from;for(;s<r.length;s++){let e=r[s];if(e.from>=a)break;!(e.to<=o)&&(n||(r=n=t.slice()),e.from<o?(n[s]=new l(e.from,o),e.to>a&&n.splice(s+1,0,new l(a,e.to))):e.to>a?n[s--]=new l(a,e.to):n.splice(s--,1))}}return r}function H(e,t){let n=[];for(let{pos:r,mount:i,frag:s}of e){let e=r+(i.overlay?i.overlay[0].from:0),o=e+i.tree.length,a=Math.max(s.from,e),h=Math.min(s.to,o);if(i.overlay){let o=function(e,t,n,r){let i=0,s=0,o=!1,a=!1,h=-1e9,c=[];for(;;){let u=i==e.length?1e9:o?e[i].to:e[i].from,f=s==t.length?1e9:a?t[s].to:t[s].from;if(o!=a){let e=Math.max(h,n),t=Math.min(u,f,r);e<t&&c.push(new l(e,t))}if(1e9==(h=Math.min(u,f)))break;u==h&&(o?(o=!1,i++):o=!0),f==h&&(a?(a=!1,s++):a=!0)}return c}(t,i.overlay.map(e=>new l(e.from+r,e.to+r)),a,h);for(let t=0,r=a;;t++){let l=t==o.length,a=l?h:o[t].from;if(a>r&&n.push(new N(r,a,i.tree,-e,s.from>=r||s.openStart,s.to<=a||s.openEnd)),l)break;r=o[t].to}}else n.push(new N(a,h,i.tree,-e,s.from>=e||s.openStart,s.to<=o||s.openEnd))}return n}},35524:function(e,t,n){n.d(t,{Gv:function(){return a},QR:function(){return u},Vp:function(){return s},bW:function(){return f},pJ:function(){return M}});var r=n(41113);let i=0;class s{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=i++}static define(e){if(null==e?void 0:e.base)throw Error("Can not derive from a modified tag");let t=new s([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new l;return t=>t.modified.indexOf(e)>-1?t:l.get(t.base||t,t.modified.concat(e).sort((e,t)=>e.id-t.id))}}let o=0;class l{constructor(){this.instances=[],this.id=o++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(n=>{var r;return n.base==e&&(r=n.modified,t.length==r.length&&t.every((e,t)=>e==r[t]))});if(n)return n;let r=[],i=new s(r,e,t);for(let e of t)e.instances.push(i);let o=function(e){let t=[[]];for(let n=0;n<e.length;n++)for(let r=0,i=t.length;r<i;r++)t.push(t[r].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 o)r.push(l.get(t,e));return i}}function a(e){let t=Object.create(null);for(let n in e){let r=e[n];for(let e of(Array.isArray(r)||(r=[r]),n.split(" ")))if(e){let n=[],i=2,s=e;for(let t=0;;){if("..."==s&&t>0&&t+3==e.length){i=1;break}let r=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(s);if(!r)throw RangeError("Invalid path: "+e);if(n.push("*"==r[0]?"":'"'==r[0][0]?JSON.parse(r[0]):r[0]),(t+=r[0].length)==e.length)break;let o=e[t++];if(t==e.length&&"!"==o){i=0;break}if("/"!=o)throw RangeError("Invalid path: "+e);s=e.slice(t)}let o=n.length-1,l=n[o];if(!l)throw RangeError("Invalid path: "+e);let a=new c(r,i,o>0?n.slice(0,o):null);t[l]=a.sort(t[l])}}return h.add(t)}let h=new r.md;class c{constructor(e,t,n,r){this.tags=e,this.mode=t,this.context=n,this.next=r}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 u(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:r,all:i=null}=t||{};return{style:e=>{let t=i;for(let r of e)for(let e of r.set){let r=n[e.id];if(r){t=t?t+" "+r:r;break}}return t},scope:r}}function f(e,t,n,r=0,i=e.length){let s=new d(r,Array.isArray(t)?t:[t],n);s.highlightRange(e.cursor(),r,i,"",s.highlighters),s.flush(i)}c.empty=new c([],2,null);class d{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}
1startSpan(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,i,s){let{type:o,from:l,to:a}=e;if(l>=n||a<=t)return;o.isTop&&(s=this.highlighters.filter(e=>!e.scope||e.scope(o)));let u=i,f=function(e){let t=e.type.prop(h);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||c.empty,d=function(e,t){let n=null;for(let r of e){let e=r.style(t);e&&(n=n?n+" "+e:e)}return n}(s,f.tags);if(d&&(u&&(u+=" "),u+=d,1==f.mode&&(i+=(i?" ":"")+d)),this.startSpan(Math.max(t,l),u),f.opaque)return;let p=e.tree&&e.tree.prop(r.md.mounted);if(p&&p.overlay){let r=e.node.enter(p.overlay[0].from+l,1),o=this.highlighters.filter(e=>!e.scope||e.scope(p.tree.type)),h=e.firstChild();for(let c=0,f=l;;c++){let d=c<p.overlay.length?p.overlay[c]:null,m=d?d.from+l:a,g=Math.max(t,f),v=Math.min(n,m);if(g<v&&h)for(;e.from<v&&(this.highlightRange(e,g,v,i,s),this.startSpan(Math.min(v,e.to),u),!(e.to>=m)&&e.nextSibling()););if(!d||m>n)break;(f=d.to+l)>t&&(this.highlightRange(r.cursor(),Math.max(t,d.from+l),Math.min(n,f),"",o),this.startSpan(Math.min(n,f),u))}h&&e.parent()}else if(e.firstChild()){p&&(i="");do{if(e.to<=t)continue;if(e.from>=n)break;this.highlightRange(e,t,n,i,s),this.startSpan(Math.min(n,e.to),u)}while(e.nextSibling());e.parent()}}}let p=s.define,m=p(),g=p(),v=p(g),y=p(g),w=p(),x=p(w),k=p(w),b=p(),S=p(b),A=p(),C=p(),I=p(),T=p(I),O=p(),M={comment:m,lineComment:p(m),blockComment:p(m),docComment:p(m),name:g,variableName:p(g),typeName:v,tagName:p(v),propertyName:y,attributeName:p(y),className:p(g),labelName:p(g),namespace:p(g),macroName:p(g),literal:w,string:x,docString:p(x),character:p(x),attributeValue:p(x),number:k,integer:p(k),float:p(k),bool:p(w),regexp:p(w),escape:p(w),color:p(w),url:p(w),keyword:A,self:p(A),null:p(A),atom:p(A),unit:p(A),modifier:p(A),operatorKeyword:p(A),controlKeyword:p(A),definitionKeyword:p(A),moduleKeyword:p(A),operator:C,derefOperator:p(C),arithmeticOperator:p(C),logicOperator:p(C),bitwiseOperator:p(C),compareOperator:p(C),updateOperator:p(C),definitionOperator:p(C),typeOperator:p(C),controlOperator:p(C),punctuation:I,separator:p(I),bracket:T,angleBracket:p(T),squareBracket:p(T),paren:p(T),brace:p(T),content:b,heading:S,heading1:p(S),heading2:p(S),heading3:p(S),heading4:p(S),heading5:p(S),heading6:p(S),contentSeparator:p(b),list:p(b),quote:p(b),emphasis:p(b),strong:p(b),link:p(b),monospace:p(b),strikethrough:p(b),inserted:p(),deleted:p(),changed:p(),invalid:p(),meta:O,documentMeta:p(O),annotation:p(O),processingInstruction:p(O),definition:s.defineModifier(),constant:s.defineModifier(),function:s.defineModifier(),standard:s.defineModifier(),local:s.defineModifier(),special:s.defineModifier()};u([{tag:M.link,class:"tok-link"},{tag:M.heading,class:"tok-heading"},{tag:M.emphasis,class:"tok-emphasis"},{tag:M.strong,class:"tok-strong"},{tag:M.keyword,class:"tok-keyword"},{tag:M.atom,class:"tok-atom"},{tag:M.bool,class:"tok-bool"},{tag:M.url,class:"tok-url"},{tag:M.labelName,class:"tok-labelName"},{tag:M.inserted,class:"tok-inserted"},{tag:M.deleted,class:"tok-deleted"},{tag:M.literal,class:"tok-literal"},{tag:M.string,class:"tok-string"},{tag:M.number,class:"tok-number"},{tag:[M.regexp,M.escape,M.special(M.string)],class:"tok-string2"},{tag:M.variableName,class:"tok-variableName"},{tag:M.local(M.variableName),class:"tok-variableName tok-local"},{tag:M.definition(M.variableName),class:"tok-variableName tok-definition"},{tag:M.special(M.variableName),class:"tok-variableName2"},{tag:M.definition(M.propertyName),class:"tok-propertyName tok-definition"},{tag:M.typeName,class:"tok-typeName"},{tag:M.namespace,class:"tok-namespace"},{tag:M.className,class:"tok-className"},{tag:M.macroName,class:"tok-macroName"},{tag:M.propertyName,class:"tok-propertyName"},{tag:M.operator,class:"tok-operator"},{tag:M.comment,class:"tok-comment"},{tag:M.meta,class:"tok-meta"},{tag:M.invalid,class:"tok-invalid"},{tag:M.punctuation,class:"tok-punctuation"}])},21301:function(e,t,n){let r;n.d(t,{defineFeature:function(){return r8}});
1var i,s,o=n(22110),l=n(50347),a=n(37832),h=n(35503),c=n(58463),u=n(78120),f=n(25804),d=n(2376),p=n(50130),m=n(90512),g=Object.defineProperty,v=Object.getOwnPropertySymbols,y=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable,x=(e,t,n)=>t in e?g(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,k=(e,t)=>{for(var n in t||(t={}))y.call(t,n)&&x(e,n,t[n]);if(v)for(var n of v(t))w.call(t,n)&&x(e,n,t[n]);return e};function b(e,t){return Object.assign(e,{meta:k({package:"@milkdown/components"},t)}),e}let S=(0,o.Tu)({extensions:[],languages:[],expandIcon:()=>"â¬",searchIcon:()=>"\uD83D\uDD0D",clearSearchIcon:()=>"â«",searchPlaceholder:"Search language",noResultText:"No result",renderLanguage:e=>a.dy`${e}`},"codeBlockConfigCtx");b(S,{displayName:"Config<code-block>",group:"CodeBlock"});var A=Object.getOwnPropertySymbols,C=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable,T=(e,t)=>{var n={};for(var r in e)C.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&A)for(var r of A(e))0>t.indexOf(r)&&I.call(e,r)&&(n[r]=e[r]);return n};class O{constructor(e,t,n,r,i){this.node=e,this.view=t,this.getPos=n,this.loader=r,this.config=i,this.updating=!1,this.languageName="",this.forwardUpdate=e=>{var t;if(this.updating||!this.cm.hasFocus)return;let n=(null!=(t=this.getPos())?t:0)+1,{main:r}=e.state.selection,i=n+r.from,s=n+r.to,o=this.view.state.selection;if(e.docChanged||o.from!==i||o.to!==s){let t=this.view.state.tr;e.changes.iterChanges((e,r,i,s,o)=>{o.length?t.replaceWith(n+e,n+r,this.view.state.schema.text(o.toString())):t.delete(n+e,n+r),n+=s-i-(r-e)}),t.setSelection(d.Bs.create(t.doc,i,s)),this.view.dispatch(t)}},this.codeMirrorKeymap=()=>{let e=this.view;return[{key:"ArrowUp",run:()=>this.maybeEscape("line",-1)},{key:"ArrowLeft",run:()=>this.maybeEscape("char",-1)},{key:"ArrowDown",run:()=>this.maybeEscape("line",1)},{key:"ArrowRight",run:()=>this.maybeEscape("char",1)},{key:"Mod-Enter",run:()=>!!(0,f.uo)(e.state,e.dispatch)&&(e.focus(),!0)},{key:"Mod-z",run:()=>(0,c.Yw)(e.state,e.dispatch)},{key:"Shift-Mod-z",run:()=>(0,c.KX)(e.state,e.dispatch)},{key:"Mod-y",run:()=>(0,c.KX)(e.state,e.dispatch)},{key:"Backspace",run:()=>{var e;let t=this.cm.state.selection.ranges;if(t.length>1)return!1;let n=t[0];if(n&&(!n.empty||n.anchor>0)||this.cm.state.doc.lines>=2)return!1;let r=this.view.state,i=null!=(e=this.getPos())?e:0,s=r.tr.replaceWith(i,i+this.node.nodeSize,r.schema.nodes.paragraph.createChecked({},this.node.content));return s.setSelection(d.Bs.near(s.doc.resolve(i))),this.view.dispatch(s),this.view.focus(),!0}}]},this.maybeEscape=(e,t)=>{var n;let{state:r}=this.cm,i=r.selection.main;if(!i.empty||("line"===e&&(i=r.doc.lineAt(i.head)),t<0?i.from>0:i.to<r.doc.length))return!1;let s=(null!=(n=this.getPos())?n:0)+(t<0?0:this.node.nodeSize),o=d.Bs.near(this.view.state.doc.resolve(s),t),l=this.view.state.tr.setSelection(o).scrollIntoView();return this.view.dispatch(l),this.view.focus(),!0},this.setLanguage=e=>{var t;this.view.dispatch(this.view.state.tr.setNodeAttribute(null!=(t=this.getPos())?t:0,"language",e))},this.getAllLanguages=()=>this.loader.getAll(),this.languageConf=new u.F6,this.readOnlyConf=new u.F6,this.cm=new h.tk({doc:this.node.textContent,root:this.view.root,extensions:[this.readOnlyConf.of(u.yy.readOnly.of(!this.view.editable)),h.$f.of(this.codeMirrorKeymap()),this.languageConf.of([]),...i.extensions,h.tk.updateListener.of(this.forwardUpdate)]}),this.dom=this.createDom(),this.updateLanguage()}createDom(){let e=document.createElement("milkdown-code-block");e.codemirror=this.cm,e.getAllLanguages=this.getAllLanguages,e.setLanguage=this.setLanguage,e.isEditorReadonly=()=>!this.view.editable;let t=this.config,n=T(t,["languages","extensions"]);return e.config=n,e}updateLanguage(){let e=this.node.attrs.language;if(e===this.languageName)return;this.dom.language=e;let t=this.loader.load(null!=e?e:"");t.then(t=>{t&&(this.cm.dispatch({effects:this.languageConf.reconfigure(t)}),this.languageName=e)})}setSelection(e,t){this.cm.dom.isConnected&&(this.cm.focus(),this.updating=!0,this.cm.dispatch({selection:{anchor:e,head:t}}),this.updating=!1)}update(e){if(e.type!==this.node.type)return!1;if(this.updating)return!0;this.node=e,this.updateLanguage(),this.view.editable===this.cm.state.readOnly&&this.cm.dispatch({effects:this.readOnlyConf.reconfigure(u.yy.readOnly.of(!this.view.editable))});let t=function(e,t){if(e===t)return null;let n=0,r=e.length,i=t.length;for(;n<r&&e.charCodeAt(n)===t.charCodeAt(n);)++n;for(;r>n&&i>n&&e.charCodeAt(r-1)===t.charCodeAt(i-1);)r--,i--;return{from:n,to:r,text:t.slice(n,i)}}(this.cm.state.doc.toString(),e.textContent);return t&&(this.updating=!0,this.cm.dispatch({changes:{from:t.from,to:t.to,insert:t.text}}),this.updating=!1),!0}
1selectNode(){this.dom.selected=!0,this.cm.focus()}deselectNode(){this.dom.selected=!1}stopEvent(){return!0}destroy(){this.cm.destroy()}}class M{constructor(e){this.languages=e,this.map={},e.forEach(e=>{e.alias.forEach(t=>{this.map[t]=e})})}getAll(){return this.languages.map(e=>({name:e.name,alias:e.alias}))}load(e){let t=this.map[e.toLowerCase()];return t?t.support?Promise.resolve(t.support):t.load():Promise.resolve(void 0)}}let P=({selected:e=!1,codemirror:t,getAllLanguages:n,setLanguage:r,language:i,config:s,isEditorReadonly:o})=>{var l,h,c;let u=(0,a.$)(),f=(0,a.sO)(),d=(0,a.sO)(),[g,v]=(0,a.eJ)(""),[y,w]=(0,a.eJ)(!1),x=(0,a.Ye)(()=>u.current.getRootNode(),[u]);(0,a.d4)(()=>{var e;let t=null==(e=null==n?void 0:n())?void 0:e.find(e=>e.alias.some(e=>e.toLowerCase()===(null==i?void 0:i.toLowerCase())));t&&t.name!==i&&(null==r||r(t.name))},[i]),(0,a.d4)(()=>{w(!1)},[i]),(0,a.d4)(()=>{let e=e=>{let t=e.target;if(f.current&&f.current.contains(t))return;let n=d.current;n&&("true"!==n.dataset.expanded||n.contains(t)||w(!1))};return x.addEventListener("click",e),()=>{x.removeEventListener("click",e)}},[]),(0,a.bt)(()=>{v("");let e=f.current,t=d.current;e&&t&&(0,p.oo)(e,t,{placement:"bottom-start"}).then(({x:e,y:n})=>{Object.assign(t.style,{left:`${e}px`,top:`${n}px`})})},[y]);let k=(0,a.Ye)(()=>{var e;if(!y)return[];let t=null!=(e=null==n?void 0:n())?e:[],r=t.find(e=>e.name.toLowerCase()===(null==i?void 0:i.toLowerCase())),s=t.filter(e=>(e.name.toLowerCase().includes(g.toLowerCase())||e.alias.some(e=>e.toLowerCase().includes(g.toLowerCase())))&&e!==r);return 0===s.length?[]:r?[r,...s]:s},[g,y,i]),b=(0,a.Ye)(()=>(null==k?void 0:k.length)?k.map(e=>{var t;return a.dy`<li 2 role="listitem" 3 tabindex="0" 4 class="language-list-item" 5 aria-selected=${e.name.toLowerCase()===(null==i?void 0:i.toLowerCase())} 6 data-language=${e.name} 7 onclick=${()=>null==r?void 0:r(e.name)} 8 > 9 ${null==(t=null==s?void 0:s.renderLanguage)?void 0:t.call(s,e.name,e.name.toLowerCase()===(null==i?void 0:i.toLowerCase()))} 10 </li>`}):a.dy`<li class="language-list-item no-result">${null==s?void 0:s.noResultText}</li>`,[k]);return a.dy`<host class=${(0,m.Z)(e&&"selected")}> 11 <div class="tools"> 12 <button 13 ref=${f} 14 class="language-button" 15 onpointerdown=${e=>{e.preventDefault(),e.stopPropagation(),null!=o&&o()||w(e=>!e)}} 16 data-expanded=${y} 17 > 18 ${i||"Text"} 19 <div class="expand-icon"> 20 ${null==(l=null==s?void 0:s.expandIcon)?void 0:l.call(s)} 21 </div> 22 </button> 23 <div ref=${d} data-expanded=${y} class=${(0,m.Z)("language-picker",y&&"show")}> 24 <div class="list-wrapper"> 25 <div class="search-box"> 26 <div class="search-icon"> 27 ${null==(h=null==s?void 0:s.searchIcon)?void 0:h.call(s)} 28 </div> 29 <input 30 class="search-input" 31 placeholder=${null==s?void 0:s.searchPlaceholder} 32 value=${g} 33 oninput=${e=>{let t=e.target;v(t.value)}} 34 onkeydown=${e=>{"Escape"===e.key&&v("")}} 35 /> 36 <div class=${(0,m.Z)("clear-icon",0===g.length&&"hidden")} onmousedown=${e=>{e.preventDefault(),v("")}}> 37 ${null==(c=null==s?void 0:s.clearSearchIcon)?void 0:c.call(s)} 38 </div> 39 </div> 40 <ul class="language-list" role="listbox" onkeydown=${e=>{if("Enter"===e.key){let e=document.activeElement;e instanceof HTMLElement&&e.dataset.language&&(null==r||r(e.dataset.language))}}}> 41 ${b} 42 </ul> 43 </div> 44 </div> 45 </div> 46 <div class="codemirror-host">${(0,a.h)(null==t?void 0:t.dom,{})}</div> 47 </host>`};P.props={selected:Boolean,codemirror:Object,language:String,getAllLanguages:Function,setLanguage:Function,isEditorReadonly:Function,config:Object};let D=(0,a.c)(P);!function(e,t){let n=customElements.get(e);if(null==n){customElements.define(e,t);return}n!==t&&console.warn(`Custom element ${e} has been defined before.`)}("milkdown-code-block",D);let E=(0,o.u)(l.W0.node,e=>{let t=e.get(S.key),n=new M(t.languages);
47return(e,r,i)=>new O(e,r,i,n,t)});b(E,{displayName:"NodeView<code-block>",group:"CodeBlock"});let B=[E,S];var N=n(47421),L=n(59119),R=n(41113);function j(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return!!i&&(r(n.update(i)),!0)}}let J=j(function(e,t,n=t.selection.ranges){let r=[],i=-1;for(let{from:e,to:s}of n){let n=r.length,o=1e9,l=q(t,e).line;if(l){for(let n=e;n<=s;){let a=t.doc.lineAt(n);if(a.from>i&&(e==s||s>a.from)){i=a.from;let e=/^\s*/.exec(a.text)[0].length,t=e==a.length,n=a.text.slice(e,e+l.length)==l?e:-1;e<a.text.length&&e<o&&(o=e),r.push({line:a,comment:n,token:l,indent:e,empty:t,single:!1})}n=a.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}}if(2!=e&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:s,single:o}of r)(o||!s)&&e.push({from:t.from+i,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,s=r+i.length;" "==t.text[s-t.from]&&s++,e.push({from:r,to:s})}return{changes:e}}return null},0),$=j(_,0),F=j((e,t)=>_(e,t,function(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to),s=t.length-1;s>=0&&t[s].to>r.from?t[s].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}(t)),0);function q(e,t){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function _(e,t,n=t.selection.ranges){let r=n.map(e=>q(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>(function(e,{open:t,close:n},r,i){let s,o,l=e.sliceDoc(r-50,r),a=e.sliceDoc(i,i+50),h=/\s*$/.exec(l)[0].length,c=/^\s*/.exec(a)[0].length,u=l.length-h;if(l.slice(u-t.length,u)==t&&a.slice(c,c+n.length)==n)return{open:{pos:r-h,margin:h&&1},close:{pos:i+c,margin:c&&1}};i-r<=100?s=o=e.sliceDoc(r,i):(s=e.sliceDoc(r,r+50),o=e.sliceDoc(i-50,i));let f=/^\s*/.exec(s)[0].length,d=/\s*$/.exec(o)[0].length,p=o.length-d-n.length;return s.slice(f,f+t.length)==t&&o.slice(p,p+n.length)==n?{open:{pos:r+f+t.length,margin:/\s/.test(s.charAt(f+t.length))?1:0},close:{pos:i-d-n.length,margin:/\s/.test(o.charAt(p-1))?1:0}}:null})(t,r[n],e.from,e.to));if(2!=e&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+" "},{from:e.to,insert:" "+r[t].close}]))};if(1!=e&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:s,close:o}=n;e.push({from:s.pos-i.open.length,to:s.pos+s.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}let W=u.q6.define(),z=u.q6.define(),V=u.r$.define(),U=u.r$.define({combine:e=>(0,u.BO)(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,r)=>e(n,r)||t(n,r)})}),H=u.QQ.define({create:()=>eo.empty,update(e,t){let n=t.state.facet(U),r=t.annotation(W);if(r){let i=X.fromTransaction(t,r.selection),s=r.side,o=0==s?e.undone:e.done;return o=i?ee(o,o.length,n.minDepth,i):er(o,t.startState.selection),new eo(0==s?r.rest:o,0==s?o:r.rest)}let i=t.annotation(z);if(("full"==i||"before"==i)&&(e=e.isolate()),!1===t.annotation(u.YW.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let s=X.fromTransaction(t),o=t.annotation(u.YW.time),l=t.annotation(u.YW.userEvent);return s?e=e.addChanges(s,o,l,n,t):t.selection&&(e=e.addSelection(t.startState.selection,o,l,n.newGroupDelay)),("full"==i||"after"==i)&&(e=e.isolate()),e},toJSON:e=>({done:e.done.map(e=>e.toJSON()),undone:e.undone.map(e=>e.toJSON())}),fromJSON:e=>new eo(e.done.map(X.fromJSON),e.undone.map(X.fromJSON))});function Q(e,t){return function({state:n,dispatch:r}){if(!t&&n.readOnly)return!1;let i=n.field(H,!1);if(!i)return!1;let s=i.pop(e,n,t);return!!s&&(r(s),!0)}}let G=Q(0,!1),K=Q(1,!1),Z=Q(0,!0),Y=Q(1,!0);class X{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(e){return new X(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 X(e.changes&&u.as.fromJSON(e.changes),[],e.mapped&&u.n0.fromJSON(e.mapped),e.startSelection&&u.jT.fromJSON(e.startSelection),e.selectionsAfter.map(u.jT.fromJSON))}static fromTransaction(e,t){let n=en;for(let t of e.startState.facet(V)){let r=t(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new X(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,en)}static selection(e){return new X(void 0,en,void 0,void 0,e)}}function ee(e,t,n,r){let i=t+1>n+20?t-n-1:0,s=e.slice(i,t);return s.push(r),s}function et(e,t){return e.length?t.length?e.concat(t):e:t}let en=[];function er(e,t){if(!e.length)return[X.selection([t])];{let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),ee(e,e.length-1,1e9,n.setSelAfter(r)))}}function ei(e,t){if(!e.length)return e;let n=e.length,r=en;for(;n;){let i=function(e,t,n){let r=et(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):en,n);if(!e.changes)return X.selection(r);let i=e.changes.map(t),s=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(s):s;return new X(i,u.Py.mapEffects(e.effects,t),o,e.startSelection.map(s),r)}(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[X.selection(r)]:en}let es=/^(input\.type|delete)($|\.)/;class eo{constructor(e,t,n=0,r){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new eo(this.done,this.undone):this}addChanges(e,t,n,r,i){var s,o;let l,a,h=this.done,c=h[h.length-1];return h=c&&c.changes&&!c.changes.empty&&e.changes&&(!n||es.test(n))&&(!c.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(i,(s=c.changes,o=e.changes,l=[],a=!1,s.iterChangedRanges((e,t)=>l.push(e,t)),o.iterChangedRanges((e,t,n,r)=>{for(let e=0;e<l.length;){let t=l[e++],i=l[e++];r>=t&&n<=i&&(a=!0)}}),a))||"input.type.compose"==n)?ee(h,h.length-1,r.minDepth,new X(e.changes.compose(c.
47changes),et(e.effects,c.effects),c.mapped,c.startSelection,en)):ee(h,h.length,r.minDepth,e),new eo(h,en,t,n)}addSelection(e,t,n,r){var i;let s=this.done.length?this.done[this.done.length-1].selectionsAfter:en;return s.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(i=s[s.length-1]).ranges.length==e.ranges.length&&0===i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length?this:new eo(er(this.done,e),this.undone,t,n)}addMapping(e){return new eo(ei(this.done,e),ei(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=0==e?this.done:this.undone;if(0==r.length)return null;let i=r[r.length-1],s=i.selectionsAfter[0]||t.selection;if(n&&i.selectionsAfter.length){let n,o;return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:W.of({side:e,rest:(n=r[r.length-1],(o=r.slice())[r.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(!i.changes)return null;{let n=1==r.length?en:r.slice(0,r.length-1);return i.mapped&&(n=ei(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:W.of({side:e,rest:n,selection:s}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}}eo.empty=new eo(en,en);let el=[{key:"Mod-z",run:G,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:K,preventDefault:!0},{linux:"Ctrl-Shift-z",run:K,preventDefault:!0},{key:"Mod-u",run:Z,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Y,preventDefault:!0}];function ea(e,t){return u.jT.create(e.ranges.map(t),e.mainIndex)}function eh(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function ec({state:e,dispatch:t},n){let r=ea(e.selection,n);return!r.eq(e.selection,!0)&&(t(eh(e,r)),!0)}function eu(e,t){return u.jT.cursor(t?e.to:e.from)}function ef(e,t){return ec(e,n=>n.empty?e.moveByChar(n,t):eu(n,t))}function ed(e){return e.textDirectionAt(e.state.selection.main.head)==N.Nm.LTR}let ep=e=>ef(e,!ed(e)),em=e=>ef(e,ed(e));function eg(e,t){return ec(e,n=>n.empty?e.moveByGroup(n,t):eu(n,t))}function ev(e,t,n){let r,i,s=(0,L.qz)(e).resolveInner(t.head),o=n?R.md.closedBy:R.md.openedBy;for(let r=t.head;;){let t=n?s.childAfter(r):s.childBefore(r);if(!t)break;!function(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}(e,t,o)?r=n?t.to:t.from:s=t}return i=s.type.prop(o)&&(r=n?(0,L.Um)(e,s.from,1):(0,L.Um)(e,s.to,-1))&&r.matched?n?r.end.to:r.end.from:n?s.to:s.from,u.jT.cursor(i,n?-1:1)}function ey(e,t){return ec(e,n=>{if(!n.empty)return eu(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}"undefined"!=typeof Intl&&Intl.Segmenter;let ew=e=>ey(e,!1),ex=e=>ey(e,!0);function ek(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(N.tk.scrollMargins)){let i=t(e);(null==i?void 0:i.top)&&(n=Math.max(null==i?void 0:i.top,n)),(null==i?void 0:i.bottom)&&(r=Math.max(null==i?void 0:i.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function eb(e,t){let n,r=ek(e),{state:i}=e,s=ea(i.selection,n=>n.empty?e.moveVertically(n,t,r.height):eu(n,t));if(s.eq(i.selection))return!1;if(r.selfScroll){let t=e.coordsAtPos(i.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),l=o.top+r.marginTop,a=o.bottom-r.marginBottom;t&&t.top>l&&t.bottom<a&&(n=N.tk.scrollIntoView(s.main.head,{y:"start",yMargin:t.top-l}))}return e.dispatch(eh(i,s),{effects:n}),!0}let eS=e=>eb(e,!1),eA=e=>eb(e,!0);function eC(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=u.jT.cursor(r.from+n))}return i}function eI(e,t){let n=ea(e.state.selection,e=>{let n=t(e);return u.jT.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return!n.eq(e.state.selection)&&(e.dispatch(eh(e.state,n)),!0)}function eT(e,t){return eI(e,n=>e.moveByChar(n,t))}let eO=e=>eT(e,!ed(e)),eM=e=>eT(e,ed(e));function eP(e,t){return eI(e,n=>e.moveByGroup(n,t))}function eD(e,t){return eI(e,n=>e.moveVertically(n,t))}let eE=e=>eD(e,!1),eB=e=>eD(e,!0);function eN(e,t){return eI(e,n=>e.moveVertically(n,t,ek(e).height))}let eL=e=>eN(e,!1),eR=e=>eN(e,!0),ej=({state:e,dispatch:t})=>(t(eh(e,{anchor:0})),!0),eJ=({state:e,dispatch:t})=>(t(eh(e,{anchor:e.doc.length})),!0),e$=({state:e,dispatch:t})=>(t(eh(e,{anchor:e.selection.main.anchor,head:0})),!0),eF=({state:e,dispatch:t})=>(t(eh(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function eq(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:s}=r;if(i==s){let o=t(r);
47o<i?(n="delete.backward",o=e_(e,o,!1)):o>i&&(n="delete.forward",o=e_(e,o,!0)),i=Math.min(i,o),s=Math.max(s,o)}else i=e_(e,i,!1),s=e_(e,s,!0);return i==s?{range:r}:{changes:{from:i,to:s},range:u.jT.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?N.tk.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function e_(e,t,n){if(e instanceof N.tk)for(let r of e.state.facet(N.tk.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}let eW=(e,t,n)=>eq(e,r=>{let i=r.from,{state:s}=e,o=s.doc.lineAt(i),l,a;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,i-o.from))){if(" "==l[l.length-1])return i-1;let e=(0,u.IS)(l,s.tabSize)%(0,L.y1)(s)||(0,L.y1)(s);for(let t=0;t<e&&" "==l[l.length-1-t];t++)i--;a=i}else(a=(0,u.cp)(o.text,i-o.from,t,t)+o.from)==i&&o.number!=(t?s.doc.lines:1)?a+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(a-o.from,i-o.from))&&(a=(0,u.cp)(o.text,a-o.from,!1,!1)+o.from);return a}),ez=e=>eW(e,!1,!0),eV=e=>eW(e,!0,!1),eU=(e,t)=>eq(e,n=>{let r=n.head,{state:i}=e,s=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?s.to:s.from)){r==n.head&&s.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let l=(0,u.cp)(s.text,r-s.from,t)+s.from,a=s.text.slice(Math.min(r,l)-s.from,Math.max(r,l)-s.from),h=o(a);if(null!=e&&h!=e)break;(" "!=a||r!=n.head)&&(e=h),r=l}return r}),eH=e=>eU(e,!1);function eQ(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),s=e.doc.lineAt(r.to);if(r.empty||r.to!=s.from||(s=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=s.to,e.ranges.push(r)}else t.push({from:i.from,to:s.to,ranges:[r]});n=s.number+1}return t}function eG(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of eQ(e)){if(n?t.to==e.doc.length:0==t.from)continue;let s=e.doc.lineAt(n?t.to+1:t.from-1),o=s.length+1;if(n)for(let n of(r.push({from:t.to,to:s.to},{from:t.from,insert:s.text+e.lineBreak}),t.ranges))i.push(u.jT.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)));else for(let n of(r.push({from:s.from,to:t.from},{from:t.to,insert:e.lineBreak+s.text}),t.ranges))i.push(u.jT.range(n.anchor-o,n.head-o))}return!!r.length&&(t(e.update({changes:r,scrollIntoView:!0,selection:u.jT.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0)}function eK(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of eQ(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}let eZ=eX(!1),eY=eX(!0);function eX(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,s=t.doc.lineAt(r),o=!e&&r==i&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=(0,L.qz)(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),s;return r&&i&&r.to<=t&&i.from>=t&&(s=r.type.prop(R.md.closedBy))&&s.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}(t,r);e&&(r=i=(i<=s.to?s:t.doc.lineAt(i)).to);let l=new L.Gn(t,{simulateBreak:r,simulateDoubleBreak:!!o}),a=(0,L.K0)(l,r);for(null==a&&(a=(0,u.IS)(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));i<s.to&&/\s/.test(s.text[i-s.from]);)i++;o?{from:r,to:i}=o:r>s.from&&r<s.from+100&&!/\S/.test(s.text.slice(0,r))&&(r=s.from);let h=["",(0,L.SS)(t,a)];return o&&h.push((0,L.SS)(t,l.lineIndent(s.from,-1))),{changes:{from:r,to:i,insert:u.xv.of(h)},range:u.jT.cursor(r+1+h[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function e0(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let s=r.from;s<=r.to;){let o=e.doc.lineAt(s);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),s=o.to+1}let s=e.changes(i);return{changes:i,range:u.jT.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}let e1=[{key:"Ctrl-b",run:ep,shift:eO,preventDefault:!0},{key:"Ctrl-f",run:em,shift:eM},{key:"Ctrl-p",run:ew,shift:eE},{key:"Ctrl-n",run:ex,shift:eB},{key:"Ctrl-a",run:e=>ec(e,t=>u.jT.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>eI(e,t=>u.jT.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>ec(e,t=>u.jT.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>eI(e,t=>u.jT.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:eV},{key:"Ctrl-h",run:ez},{key:"Ctrl-k",run:e=>eq(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:eH},{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:u.xv.of(["",""])},range:u.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,r=e.doc.lineAt(n),i=n==r.from?n-1:(0,u.cp)(r.text,n-r.from,!1)+r.from,s=n==r.to?n+1:(0,u.cp)(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:s,insert:e.doc.slice(n,s).append(e.doc.slice(i,n))},range:u.jT.cursor(s)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:eA}],e2=[{key:"ArrowLeft",run:ep,shift:eO,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>eg(e,!ed(e)),shift:e=>eP(e,!ed(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>ec(e,t=>eC(e,t,!ed(e))),shift:e=>eI(e,t=>eC(e,t,!ed(e))),preventDefault:!0},{key:"ArrowRight",run:em,shift:eM,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>eg(e,ed(e)),shift:e=>eP(e,ed(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>ec(e,t=>eC(e,t,ed(e))),shift:e=>eI(e,t=>eC(e,t,ed(e))),preventDefault:!0},{key:"ArrowUp",run:ew,shift:eE,preventDefault:!0},{mac:"Cmd-ArrowUp",run:ej,shift:e$},{mac:"Ctrl-ArrowUp",run:eS,shift:eL},{key:"ArrowDown",run:ex,shift:eB,preventDefault:!0},{mac:"Cmd-ArrowDown",run:eJ,shift:eF},{mac:"Ctrl-ArrowDown",run:eA,shift:eR},{key:"PageUp",run:eS,shift:eL},{key:"PageDown",run:eA,shift:eR},{key:"Home",run:e=>ec(e,t=>eC(e,t,!1)),shift:e=>eI(e,t=>eC(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:ej,shift:e$},{key:"End",run:e=>ec(e,t=>eC(e,t,!0)),shift:e=>eI(e,t=>eC(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:eJ,shift:eF},{key:"Enter",run:eZ},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:ez,shift:ez},{key:"Delete",run:eV},{key:"Mod-Backspace",mac:"Alt-Backspace",run:eH},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>eU(e,!0)},{mac:"Mod-Backspace",run:e=>eq(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=>eq(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})}].concat(e1.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),e4=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>ec(e,t=>ev(e.state,t,!ed(e))),shift:e=>eI(e,t=>ev(e.state,t,!ed(e)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>ec(e,t=>ev(e.state,t,ed(e))),shift:e=>eI(e,t=>ev(e.state,t,ed(e)))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>eG(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>eK(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>eG(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>eK(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=u.jT.create([n.main]):n.main.empty||(r=u.jT.create([u.jT.cursor(n.main.head)])),!!r&&(t(eh(e,r)),!0)}},{key:"Mod-Enter",run:eY},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=eQ(e).map(({from:t,to:n})=>u.jT.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:u.jT.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=ea(e.selection,t=>{var n;let r=(0,L.qz)(e).resolveStack(t.from,1);for(let e=r;e;e=e.next){let{node:r}=e;if((r.from<t.from&&r.to>=t.to||r.to>t.to&&r.from<=t.from)&&(null===(n=r.parent)||void 0===n?void 0:n.parent))return u.jT.range(r.to,r.from)}return t});return t(eh(e,n)),!0},preventDefault:!0},{key:"Mod-[",run:({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(e0(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=(0,u.IS)(r,e.tabSize),s=0,o=(0,L.SS)(e,Math.max(0,i-(0,L.y1)(e)));for(;
47s<r.length&&s<o.length&&r.charCodeAt(s)==o.charCodeAt(s);)s++;n.push({from:t.from+s,to:t.from+r.length,insert:o.slice(s)})}),{userEvent:"delete.dedent"})),!0)},{key:"Mod-]",run:({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(e0(e,(t,n)=>{n.push({from:t.from,insert:e.facet(L.c)})}),{userEvent:"input.indent"})),!0)},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new L.Gn(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),i=e0(e,(t,i,s)=>{let o=(0,L.K0)(r,t.from);if(null==o)return;/\S/.test(t.text)||(o=0);let l=/^\s*/.exec(t.text)[0],a=(0,L.SS)(e,o);(l!=a||s.from<t.from+l.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+l.length,insert:a}))});return i.changes.empty||t(e.update(i,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(eQ(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=ea(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>{let n,r;return n=!1,r=ea(e.selection,t=>{let r=(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(!r||!r.end)return t;n=!0;let i=r.start.from==t.head?r.end.to:r.end.from;return u.jT.cursor(i)}),!!n&&(t(eh(e,r)),!0)}},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=q(e.state,n.from);return r.line?J(e):!!r.block&&F(e)}},{key:"Alt-A",run:$}].concat(e2);function e3(){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 r in n)if(Object.prototype.hasOwnProperty.call(n,r)){var i=n[r];"string"==typeof i?e.setAttribute(r,i):null!=i&&(e[r]=i)}t++}for(;t<arguments.length;t++)!function e(t,n){if("string"==typeof n)t.appendChild(document.createTextNode(n));else if(null==n);else if(null!=n.nodeType)t.appendChild(n);else if(Array.isArray(n))for(var r=0;r<n.length;r++)e(t,n[r]);else throw RangeError("Unsupported child node: "+n)}(e,arguments[t]);return e}let e5="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class e9{constructor(e,t,n=0,r=e.length,i,s){this.test=s,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(e5(e)):e5,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,u.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,u.bg)(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=(0,u.nZ)(e);let r=this.normalize(t);for(let e=0,i=n;;e++){let s=r.charCodeAt(e),o=this.match(s,i,this.bufferPos+this.bufferStart);if(e==r.length-1){if(o)return this.value=o,this;break}i==n&&e<t.length&&t.charCodeAt(e)==s&&i++}}}match(e,t,n){let r=null;for(let t=0;t<this.matches.length;t+=2){let i=this.matches[t],s=!1;this.query.charCodeAt(i)==e&&(i==this.query.length-1?r={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?r={from:t,to:n}:this.matches.push(1,t)),r&&this.test&&!this.test(r.from,r.to,this.buffer,this.bufferStart)&&(r=null),r}}"undefined"!=typeof Symbol&&(e9.prototype[Symbol.iterator]=function(){return this});let e7={from:-1,to:-1,match:/.*/.exec("")},e6="gm"+(null==/x/.unicode?"":"u");class e8{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine="",this.done=!1,this.value=e7,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new tn(e,t,n,r,i);this.re=new RegExp(t,e6+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.iter
47=e.iter();let s=e.lineAt(r);this.curLineStart=s.from,this.matchPos=tr(e,r),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,r=n+t[0].length;if(this.matchPos=tr(this.text,r+(n==r?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,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 te=new WeakMap;class tt{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let r=te.get(e);if(!r||r.from>=n||r.to<=t){let r=new tt(t,e.sliceString(t,n));return te.set(e,r),r}if(r.from==t&&r.to==n)return r;let{text:i,from:s}=r;return s>t&&(i=e.sliceString(t,s)+i,s=t),r.to<n&&(i+=e.sliceString(r.to,n)),te.set(e,new tt(s,i)),new tt(t,i.slice(t-s,n-s))}}class tn{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=e7,this.matchPos=tr(e,r),this.re=new RegExp(t,e6+((null==n?void 0:n.ignoreCase)?"i":"")),this.test=null==n?void 0:n.test,this.flat=tt.get(e,r,this.chunkEnd(r+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=tr(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=tt.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function tr(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}function ti(e){let t=e3("input",{class:"cm-textfield",name:"line",value:String(e.state.doc.lineAt(e.state.selection.main.head).number)});function n(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:r}=e,i=r.doc.lineAt(r.selection.main.head),[,s,o,l,a]=n,h=l?+l.slice(1):0,c=o?+o:i.number;if(o&&a){let e=c/100;s&&(e=e*("-"==s?-1:1)+i.number/r.doc.lines),c=Math.round(r.doc.lines*e)}else o&&s&&(c=c*("-"==s?-1:1)+i.number);let f=r.doc.line(Math.max(1,Math.min(r.doc.lines,c))),d=u.jT.cursor(f.from+Math.max(0,Math.min(h,f.length)));e.dispatch({effects:[ts.of(!1),N.tk.scrollIntoView(d.from,{y:"center"})],selection:d}),e.focus()}return{dom:e3("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:ts.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:e=>{e.preventDefault(),n()}},e3("label",e.state.phrase("Go to line"),": ",t)," ",e3("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(e8.prototype[Symbol.iterator]=tn.prototype[Symbol.iterator]=function(){return this});let ts=u.Py.define(),to=u.QQ.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(ts)&&(e=n.value);return e},provide:e=>N.mH.from(e,e=>e?ti:null)}),tl=N.tk.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),ta={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},th=u.r$.define({combine:e=>(0,u.BO)(e,ta,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}),tc=N.p.mark({class:"cm-selectionMatch"}),tu=N.p.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function tf(e,t,n,r){return(0==n||e(t.sliceDoc(n-1,n))!=u.D0.Word)&&(r==t.doc.length||e(t.sliceDoc(r,r+1))!=u.D0.Word)}let td=N.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(th),{state:n}=e,r=n.selection;if(r.ranges.length>1)return N.p.none;let i=r.main,s,o=null;
47if(i.empty){if(!t.highlightWordAroundCursor)return N.p.none;let e=n.wordAt(i.head);if(!e)return N.p.none;o=n.charCategorizer(i.head),s=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return N.p.none;if(t.wholeWords){var l,a,h;if(s=n.sliceDoc(i.from,i.to),!(tf(o=n.charCategorizer(i.head),n,i.from,i.to)&&(l=o,a=i.from,h=i.to,l(n.sliceDoc(a,a+1))==u.D0.Word&&l(n.sliceDoc(h-1,h))==u.D0.Word)))return N.p.none}else if(!(s=n.sliceDoc(i.from,i.to)))return N.p.none}let c=[];for(let r of e.visibleRanges){let e=new e9(n.doc,s,r.from,r.to);for(;!e.next().done;){let{from:r,to:s}=e.value;if((!o||tf(o,n,r,s))&&(i.empty&&r<=i.from&&s>=i.to?c.push(tu.range(r,s)):(r>=i.to||s<=i.from)&&c.push(tc.range(r,s)),c.length>t.maxMatches))return N.p.none}}return N.p.set(c)}},{decorations:e=>e.decorations}),tp=N.tk.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),tm=({state:e,dispatch:t})=>{let{selection:n}=e,r=u.jT.create(n.ranges.map(t=>e.wordAt(t.head)||u.jT.cursor(t.head)),n.mainIndex);return!r.eq(n)&&(t(e.update({selection:r})),!0)},tg=u.r$.define({combine:e=>(0,u.BO)(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new tV(e),scrollToMatch:e=>N.tk.scrollIntoView(e)})});class tv{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,e6),!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 tA(this):new tx(this)}getCursor(e,t=0,n){let r=e.doc?e:u.yy.create({doc:e});return null==n&&(n=r.doc.length),this.regexp?tk(this,r,t,n):tw(this,r,t,n)}}class ty{constructor(e){this.spec=e}}function tw(e,t,n,r){var i,s;return new e9(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?(i=t.doc,s=t.charCategorizer(t.selection.main.head),(e,t,n,r)=>((r>e||r+n.length<t)&&(r=Math.max(0,e-2),n=i.sliceString(r,Math.min(i.length,t+2))),(s(tb(n,e-r))!=u.D0.Word||s(tS(n,e-r))!=u.D0.Word)&&(s(tS(n,t-r))!=u.D0.Word||s(tb(n,t-r))!=u.D0.Word))):void 0)}class tx extends ty{constructor(e){super(e)}nextMatch(e,t,n){let r=tw(this.spec,e,n,e.doc.length).nextOverlapping();return r.done&&(r=tw(this.spec,e,0,t).nextOverlapping()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=tw(this.spec,e,n,r),s=null;for(;!i.nextOverlapping().done;)s=i.value;if(s)return s;if(n==t)return null;r-=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=tw(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=tw(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}function tk(e,t,n,r){var i;return new e8(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(i=t.charCategorizer(t.selection.main.head),(e,t,n)=>!n[0].length||(i(tb(n.input,n.index))!=u.D0.Word||i(tS(n.input,n.index))!=u.D0.Word)&&(i(tS(n.input,n.index+n[0].length))!=u.D0.Word||i(tb(n.input,n.index+n[0].length))!=u.D0.Word)):void 0},n,r)}function tb(e,t){return e.slice((0,u.cp)(e,t,!1),t)}function tS(e,t){return e.slice(t,(0,u.cp)(e,t))}class tA extends ty{nextMatch(e,t,n){let r=tk(this.spec,e,n,e.doc.length).next();return r.done&&(r=tk(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-1e4*r),s=tk(this.spec,e,i,n),o=null;for(;!s.next().done;)o=s.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}
47prevMatch(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=tk(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=tk(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}}let tC=u.Py.define(),tI=u.Py.define(),tT=u.QQ.define({create:e=>new tO(t$(e).create(),null),update(e,t){for(let n of t.effects)n.is(tC)?e=new tO(n.value.create(),e.panel):n.is(tI)&&(e=new tO(e.query,n.value?tJ:null));return e},provide:e=>N.mH.from(e,e=>e.panel)});class tO{constructor(e,t){this.query=e,this.panel=t}}let tM=N.p.mark({class:"cm-searchMatch"}),tP=N.p.mark({class:"cm-searchMatch cm-searchMatch-selected"}),tD=N.lg.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(tT))}update(e){let t=e.state.field(tT);(t!=e.startState.field(tT)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return N.p.none;let{view:n}=this,r=new u.f_;for(let t=0,i=n.visibleRanges,s=i.length;t<s;t++){let{from:o,to:l}=i[t];for(;t<s-1&&l>i[t+1].from-500;)l=i[++t].to;e.highlight(n.state,o,l,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?tP:tM)})}return r.finish()}},{decorations:e=>e.decorations});function tE(e){return t=>{let n=t.state.field(tT,!1);return n&&n.query.spec.valid?e(t,n):t_(t)}}let tB=tE((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=u.jT.single(r.from,r.to),s=e.state.facet(tg);return e.dispatch({selection:i,effects:[tQ(e,r),s.scrollToMatch(i.main,e)],userEvent:"select.search"}),tq(e),!0}),tN=tE((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let s=u.jT.single(i.from,i.to),o=e.state.facet(tg);return e.dispatch({selection:s,effects:[tQ(e,i),o.scrollToMatch(s.main,e)],userEvent:"select.search"}),tq(e),!0}),tL=tE((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!!n&&!!n.length&&(e.dispatch({selection:u.jT.create(n.map(e=>u.jT.range(e.from,e.to))),userEvent:"select.search.matches"}),!0)}),tR=tE((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let s=t.nextMatch(n,r,r);if(!s)return!1;let o=[],l,a,h=[];if(s.from==r&&s.to==i&&(a=n.toText(t.getReplacement(s)),o.push({from:s.from,to:s.to,insert:a}),s=t.nextMatch(n,s.from,s.to),h.push(N.tk.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(r).number)+"."))),s){let t=0==o.length||o[0].from>=s.to?0:s.to-s.from-a.length;l=u.jT.single(s.from-t,s.to-t),h.push(tQ(e,s)),h.push(n.facet(tg).scrollToMatch(l.main,e))}return e.dispatch({changes:o,selection:l,effects:h,userEvent:"input.replace"}),!0}),tj=tE((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map(e=>{let{from:n,to:r}=e;return{from:n,to:r,insert:t.getReplacement(e)}});if(!n.length)return!1;let r=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:N.tk.announce.of(r),userEvent:"input.replace.all"}),!0});function tJ(e){return e.state.facet(tg).createPanel(e)}function t$(e,t){var n,r,i,s,o;let l=e.selection.main,a=l.empty||l.to>l.from+100?"":e.sliceDoc(l.from,l.to);if(t&&!a)return t;let h=e.facet(tg);return new tv({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:null!==(r=null==t?void 0:t.caseSensitive)&&void 0!==r?r:h.caseSensitive,literal:null!==(i=null==t?void 0:t.literal)&&void 0!==i?i: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 tF(e){let t=(0,N.Sd)(e,tJ);return t&&t.dom.querySelector("[main-field]")}function tq(e){let t=tF(e);t&&t==e.root.activeElement&&t.select()}let t_=e=>{let t=e.state.field(tT,!1);if(t&&t.panel){let n=tF(e);if(n&&n!=e.root.activeElement){let r=t$(e.state,t.query.spec);r.valid&&e.dispatch({effects:tC.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[tI.of(!0),t?tC.of(t$(e.state,t.query.spec)):u.Py.appendConfig.of(tK)]});return!0},tW=e=>{let t=e.state.field(tT,!1);if(!t||!t.panel)return!1;let n=(0,N.Sd)(e,tJ);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:tI.of(!1)}),!0},tz=[{key:"Mod-f",run:t_,scope:"editor search-panel"},{key:"F3",run:tB,shift:tN,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:tB,shift:tN,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:tW,scope:"editor search-panel"}
47,{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:r,to:i}=n.main,s=[],o=0;for(let t=new e9(e.doc,e.sliceDoc(r,i));!t.next().done;){if(s.length>1e3)return!1;t.value.from==r&&(o=s.length),s.push(u.jT.range(t.value.from,t.value.to))}return t(e.update({selection:u.jT.create(s,o),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let t=(0,N.Sd)(e,ti);if(!t){let n=[ts.of(!0)];null==e.state.field(to,!1)&&n.push(u.Py.appendConfig.of([to,tl])),e.dispatch({effects:n}),t=(0,N.Sd)(e,ti)}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 tm({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=function(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),s=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new e9(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new e9(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(s){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}(e,r);return!!i&&(t(e.update({selection:e.selection.addRange(u.jT.range(i.from,i.to),!1),effects:N.tk.scrollIntoView(i.to)})),!0)},preventDefault:!0}];class tV{constructor(e){this.view=e;let t=this.query=e.state.field(tT).query.spec;function n(e,t,n){return e3("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=e3("input",{value:t.search,placeholder:tU(e,"Find"),"aria-label":tU(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=e3("input",{value:t.replace,placeholder:tU(e,"Replace"),"aria-label":tU(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=e3("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=e3("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=e3("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=e3("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",()=>tB(e),[tU(e,"next")]),n("prev",()=>tN(e),[tU(e,"previous")]),n("select",()=>tL(e),[tU(e,"all")]),e3("label",null,[this.caseField,tU(e,"match case")]),e3("label",null,[this.reField,tU(e,"regexp")]),e3("label",null,[this.wordField,tU(e,"by word")]),...e.state.readOnly?[]:[e3("br"),this.replaceField,n("replace",()=>tR(e),[tU(e,"replace")]),n("replaceAll",()=>tj(e),[tU(e,"replace all")])],e3("button",{name:"close",onclick:()=>tW(e),"aria-label":tU(e,"close"),type:"button"},["\xd7"])])}commit(){let e=new tv({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:tC.of(e)}))}keydown(e){(0,N.$1)(this.view,e,"search-panel")?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?tN:tB)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),tR(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(tC)&&!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(tg).top}}function tU(e,t){return e.state.phrase(t)}let tH=/[\s\.,:;?!]/;function tQ(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,s=Math.max(r.from,t-30),o=Math.min(i,n+30),l=e.state.sliceDoc(s,o);if(s!=r.from){for(let e=0;e<30;e++)if(!tH.test(l[e+1])&&tH.test(l[e])){l=l.slice(e);break}}if(o!=i){for(let e=l.length-1;e>l.length-30;e--)if(!tH.test(l[e-1])&&tH.test(l[e])){l=l.slice(0,e);break}}return N.tk.announce.of(`${e.state.phrase("current match")}. ${l} ${e.state.phrase("on line")} ${r.number}.`)}let tG=N.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"}}
47),tK=[tT,u.Wl.low(tD),tG];var tZ=n(34790);class tY{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class tX{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let r=e,i=n.facet(t8).markerFilter;i&&(r=i(r,n));let s=N.p.set(r.map(e=>e.from==e.to||e.from==e.to-1&&n.doc.lineAt(e.from).to==e.from?N.p.widget({widget:new nn(e),diagnostic:e}).range(e.from):N.p.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity+(e.markClass?" "+e.markClass:"")},diagnostic:e,inclusive:!0}).range(e.from,e.to)),!0);return new tX(s,t,t0(s))}}function t0(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!t||i.diagnostic==t)return r=new tY(e,n,i.diagnostic),!1}),r}function t1(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(t8).hideOn(e,n,r);if(null!=i)return i;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(t2))||e.changes.touchesRange(s.from,Math.max(s.to,r)))}let t2=u.Py.define(),t4=u.Py.define(),t3=u.Py.define(),t5=u.QQ.define({create:()=>new tX(N.p.none,null,null),update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=t0(n,e.selected.diagnostic,i)||t0(n,null,i)}!n.size&&i&&t.state.facet(t8).autoPanel&&(i=null),e=new tX(n,i,r)}for(let n of t.effects)if(n.is(t2)){let r=t.state.facet(t8).autoPanel?n.value.length?ni.open:null:e.panel;e=tX.init(n.value,r,t.state)}else n.is(t4)?e=new tX(e.diagnostics,n.value?ni.open:null,e.selected):n.is(t3)&&(e=new tX(e.diagnostics,e.panel,n.value));return e},provide:e=>[N.mH.from(e,e=>e.panel),N.tk.decorations.from(e,e=>e.diagnostics)]}),t9=N.p.mark({class:"cm-lintRange cm-lintRange-active",inclusive:!0}),t7=e=>{let t=e.state.field(t5,!1);return!!t&&!!t.panel&&(e.dispatch({effects:t4.of(!1)}),!0)},t6=[{key:"Mod-Shift-m",run:e=>{var t,n;let r=e.state.field(t5,!1);r&&r.panel||e.dispatch({effects:(t=e.state,n=[t4.of(!0)],t.field(t5,!1)?n:n.concat(u.Py.appendConfig.of(na)))});let i=(0,N.Sd)(e,ni.open);return i&&i.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(t5,!1);if(!t)return!1;let n=e.state.selection.main,r=t.diagnostics.iter(n.to+1);return(!!r.value||!!(r=t.diagnostics.iter(0)).value&&(r.from!=n.from||r.to!=n.to))&&(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)}}],t8=u.r$.define({combine:e=>Object.assign({sources:e.map(e=>e.source).filter(e=>null!=e)},(0,u.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 ne(e){let t=[];if(e)n:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue n}}t.push("")}return t}function nt(e,t,n){var r;let i=n?ne(t.actions):[];return e3("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},e3("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),null===(r=t.actions)||void 0===r?void 0:r.map((n,r)=>{let s=!1,o=r=>{if(r.preventDefault(),s)return;s=!0;let i=t0(e.state.field(t5).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:l}=n,a=i[r]?l.indexOf(i[r]):-1,h=a<0?l:[l.slice(0,a),e3("u",l.slice(a,a+1)),l.slice(a+1)];return e3("button",{type:"button",class:"cm-diagnosticAction",onclick:o,onmousedown:o,"aria-label":` Action: ${l}${a<0?"":` (access key "${i[r]})"`}.`},h)}),t.source&&e3("div",{class:"cm-diagnosticSource"},t.source))}class nn extends N.l9{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return e3("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class nr{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=nt(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class ni{constructor(e){this.view=e,this.items=[],this.list=e3("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(27==t.keyCode)t7(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],r=ne(n.actions);for(let i=0;i<r.length;
47i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=t0(this.view.state.field(t5).diagnostics,n);t&&n.actions[i].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=e3("div",{class:"cm-panel-lint"},this.list,e3("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>t7(this.view)},"\xd7")),this.update()}get selectedIndex(){let e=this.view.state.field(t5).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(t5),n=0,r=!1,i=null;for(e.between(0,this.view.state.doc.length,(e,s,{spec:o})=>{let l=-1,a;for(let e=n;e<this.items.length;e++)if(this.items[e].diagnostic==o.diagnostic){l=e;break}l<0?(a=new nr(this.view,o.diagnostic),this.items.splice(n,0,a),r=!0):(a=this.items[l],l>n&&(this.items.splice(n,l-n),r=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),i=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++});n<this.items.length&&!(1==this.items.length&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();0==this.items.length&&(this.items.push(new nr(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),r=!0),i?(this.list.setAttribute("aria-activedescendant",i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel: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"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=t0(this.view.state.field(t5).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:t3.of(t)})}static open(e){return new ni(e)}}function ns(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 no=N.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:ns("#d11")},".cm-lintRange-warning":{backgroundImage:ns("orange")},".cm-lintRange-info":{backgroundImage:ns("#999")},".cm-lintRange-hint":{backgroundImage:ns("#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}}});N.SJ;let nl=u.Py.define(),na=[t5,N.tk.decorations.compute([t5],e=>{let{selected:t,panel:n}=e.field(t5);return t&&n&&t.from!=t.to?N.p.set([t9.range(t.from,t.to)]):N.p.none}),(0,N.bF)(function(e,t,n){let{diagnostics:r}=e.state.field(t5),i=[],s=2e8,o=0;r.between(t-(n<0?1:0),t+(n>0?1:0),(e,r,{spec:l})=>{t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0))&&(i.push(l.diagnostic),s=Math.min(e,s),o=Math.max(r,o))});let l=e.state.facet(t8).tooltipFilter;return(l&&(i=l(i,e.state)),i.length)?{pos:s,end:o,above:e.state.doc.lineAt(s).to<o,create:()=>{var t;return{dom:(t=e,e3("ul",{class:"cm-tooltip-lint"},i.map(e=>nt(t,e,!1))))}}}:null},{hideOn:t1}),no],nh=[(0,N.Eu)(),(0,N.HQ)(),(0,N.AE)(),function(e={}){return[H,U.of(e),N.tk.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?G:"historyRedo"==e.inputType?K:null;return!!n&&(e.preventDefault(),n(t))}})]}(),(0,L.mi)(),(0,N.Uw)(),(0,N.qr)(),u.yy.allowMultipleSelections.of(!0),(0,L.nY)(),(0,L.nF)(L.R_,{fallback:!0}),(0,L.n$)(),(0,tZ.vQ)(),(0,tZ.ys)(),(0,N.Zs)(),(0,N.S2)(),(0,N.ZO)(),(r=[tp,td],i&&r.push(th.of(i)),r),N.$f.of([...tZ.GA,...e4,...tz,...el,...L.e7,...tZ.B1,...t6])];var nc=n(95995),nu=n(67044),nf=n(35524),nd=n(28699);let np=new R.md,nm=new R.md;class ng{constructor(e,t,n=[],r=""){this.data=e,this.name=r,u.yy.prototype.hasOwnProperty("tree")||Object.defineProperty(u.yy.prototype,"tree",{get(){return ny(this)}}),this.parser=t,this.extension=[nT.of(this),u.yy.languageData.of((e,t,n)=>{let r=nv(e,t,n),i=r.type.prop(np);if(!i)return[];let s=e.facet(i),o=r.type.prop(nm);if(o){let i=r.resolve(t-r.from,n);for(let t of o)if(t.test(i,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 nv(e,t,n).type.prop(np)==this.data}findRegions(e){let t=e.facet(nT);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],r=(e,t)=>{if(e.prop(np)==this.data){n.push({from:t,to:t+e.length});return}let i=e.prop(R.md.mounted);if(i){if(i.tree.prop(np)==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(r(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&&r(i,e.positions[n]+t)}};return r(ny(e),0),n}get allowsNesting(){return!0}}function nv(e,t,n){let r=e.facet(nT),i=ny(e).topNode;if(!r||r.allowsNesting)for(let e=i;e;e=e.enter(t,n,R.vj.ExcludeBuffers))e.type.isTop&&(i=e);return i}function ny(e){let t=e.field(ng.state,!1);return t?t.tree:R.mp.empty}ng.setState=u.Py.define();
vendor: 5,107 bytes, line 47
47class nw{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.string}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 nx=null;class nk{constructor(e,t,n=[],r,i,s,o,l){this.parser=e,this.state=t,this.fragments=n,this.tree=r,this.treeLen=i,this.viewport=s,this.skipped=o,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new nk(e,t,[],R.mp.empty,0,n,[],null)}startParse(){return this.parser.startParse(new nw(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 r=this.parse.advance();if(r){if(this.fragments=this.withoutTempSkipped(R.i9.addTree(r,this.fragments,null!=this.parse.stoppedAt)),this.treeLen=null!==(n=this.parse.stoppedAt)&&void 0!==n?n:this.state.doc.length,this.tree=r,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=nx;nx=this;try{return e()}finally{nx=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=nb(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:r,treeLen:i,viewport:s,skipped:o}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges((e,n,r,i)=>t.push({fromA:e,toA:n,fromB:r,toB:i})),n=R.i9.applyChanges(n,t),r=R.mp.empty,i=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length)for(let t of(o=[],this.skipped)){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);n<r&&o.push({from:n,to:r})}}return new nk(this.parser,t,n,r,i,s,o,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:r}=this.skipped[t];n<e.to&&r>e.from&&(this.fragments=nb(this.fragments,n,r),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,r){let i=r[0].from,s=r[r.length-1].to;return{parsedPos:i,advance(){let t=nx;if(t){for(let e of r)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=s,new R.mp(R.Jq.none,[],[],s-i)},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 nx}}function nb(e,t,n){return R.i9.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class nS{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 nS(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=nk.create(e.facet(nT).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new nS(n)}}ng.state=u.QQ.define({create:nS.init,update(e,t){for(let e of t.effects)if(e.is(ng.setState))return e.value;return t.startState.facet(nT)!=t.state.facet(nT)?nS.init(t.state):e.apply(t)}});let nA=e=>{let t=setTimeout(()=>e(),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(nA=e=>{let t=-1,n=setTimeout(()=>{t=requestIdleCallback(e,{timeout:400})},100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});let nC="undefined"!=typeof navigator&&(null===(s=navigator.scheduling)||void 0===s?void 0:s.isInputPending)?()=>navigator.scheduling.isInputPending():null,nI=nu.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(ng.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(ng.state);
47t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=nA(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:r}}=this.view,i=n.field(ng.state);if(i.tree==i.context.tree&&i.context.isDone(r+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,e&&!nC?Math.max(25,e.timeRemaining()-5):1e9),o=i.context.treeLen<r&&n.doc.length>r+1e3,l=i.context.work(()=>nC&&nC()||Date.now()>s,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:ng.setState.of(new nS(i.context))})),this.chunkBudget>0&&!(l&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(e=>(0,nu.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()}}}),nT=u.r$.define({combine:e=>e.length?e[0]:null,enables:e=>[ng.state,nI,nu.tk.contentAttributes.compute([e],t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}})]}),nO=u.r$.define(),nM=u.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 nP(e){let t=e.facet(nM);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function nD(e,t){let n="",r=e.tabSize,i=e.facet(nM)[0];if(" "==i){for(;t>=r;)n+=" ",t-=r;i=" "}for(let e=0;e<t;e++)n+=i;return n}function nE(e,t){for(let n of(e instanceof u.yy&&(e=new nB(e)),e.state.facet(nO))){let r=n(e,t);if(void 0!==r)return r}let n=ny(e.state);return n.length>=t?function(e,t,n){let r=t.resolveStack(n),i=r.node.enterUnfinishedNodesBefore(n);if(i!=r.node){let e=[];for(let t=i;t!=r.node;t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)r={node:e[t],next:r}}return nL(r,e,n)}(e,n,t):null}class nB{constructor(e,t={}){this.state=e,this.options=t,this.unit=nP(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:i}=this.options;return null!=r&&r>=n.from&&r<=n.to?i&&r==e?{text:"",from:e}:(t<0?r<e:r<=e)?{text:n.text.slice(r-n.from),from:r}:{text:n.text.slice(0,r-n.from),from:n.from}:n}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:r}=this.lineAt(e,t);return n.slice(e-r,Math.min(n.length,e+100-r))}column(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.countColumn(n,e-r),s=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return s>-1&&(i+=s-this.countColumn(n,n.search(/\S|$/))),i}countColumn(e,t=e.length){return(0,u.IS)(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:r}=this.lineAt(e,t),i=this.options.overrideIndentation;if(i){let e=i(r);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}let nN=new R.md;function nL(e,t,n){for(let r=e;r;r=r.next){let e=function(e){let t=e.type.prop(nN);if(t)return t;let n=e.firstChild,r;if(n&&(r=n.type.prop(R.md.closedBy))){let t=e.lastChild,n=t&&r.indexOf(t.name)>-1;return e=>(function(e,t,n,r,i){let s=e.textAfter,o=s.match(/^\s*/)[0].length,l=r&&s.slice(o,o+r.length)==r||i==e.pos+o,a=t?function(e){let t=e.node,n=t.childAfter(t.from),r=t.lastChild;if(!n)return null;let i=e.options.simulateBreak,s=e.state.doc.lineAt(n.from),o=null==i||i<=s.from?s.to:Math.min(s.to,i);for(let e=n.to;;){let i=t.childAfter(e);if(!i||i==r)return null;if(!i.type.isSkipped)return i.from<o?n:null;e=i.to}}(e):null;return a?l?e.column(a.from):e.column(a.to):e.baseIndent+(l?0:1*e.unit)})(e,!0,0,void 0,n&&!(e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak)?t.from:void 0)}return null==e.parent?nR:null}(r.node);if(e)return e(nj.create(t,n,r))}return 0}function nR(){return 0}class nj extends nB{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 nj(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 nL(this.context.next,this.base,this.pos)}}function nJ(e,t){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);return n>=r?void 0:{from:n,to:r}}let n$=u.Py.define({map:nJ}),nF=u.Py.define({map:nJ}),nq=u.QQ.define({create:()=>nu.p.none,update(e,t){for(let n of(e=e.map(t.changes),t.effects))if(n.is(n$)&&!function(e,t,n){let r=!1;return e.between(t,t,(e,i)=>{e==t&&i==n&&(r=!0)}),r}(e,n.value.from,n.value.to)){let{preparePlaceholder:r}=t.state.facet(nW),i=r?nu.p.replace({widget:new nU(r(t.state,n.value))}):nV;e=e.update({add:[i.range(n.value.from,n.value.to)]})}else n.is(nF)&&(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:r}=t.selection.main;e.between(r,r,(e,t)=>{e<r&&t>r&&(n=!0)}),n&&(e=e.update({filterFrom:r,filterTo:r,filter:(e,t)=>t<=r||e>=r}))}return e},provide:e=>nu.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 r=e[n++],i=e[n++];if("number"!=typeof r||"number"!=typeof i)throw RangeError("Invalid JSON for fold state");t.push(nV.range(r,i))}return nu.p.set(t,!0)}}),n_={placeholderDOM:null,preparePlaceholder:null,placeholderText:"â¦"},nW=u.r$.define({combine:e=>(0,u.BO)(e,n_)});function nz(e,t){let{state:n}=e,r=n.facet(nW),i=t=>{var n,r,i,s;let o,l=e.lineBlockAt(e.posAtDOM(t.target)),a=(n=e.state,r=l.from,i=l.to,o=null,null===(s=n.field(nq,!1))||void 0===s||s.between(r,i,(e,t)=>{(!o||o.from>e)&&(o={from:e,to:t})}),o);a&&e.dispatch({effects:nF.of(a)}),t.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(e,i,t);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",n.phrase("folded code")),s.title=n.phrase("unfold"),s.className="
47cm-foldPlaceholder",s.onclick=i,s}let nV=nu.p.replace({widget:new class extends nu.l9{toDOM(e){return nz(e,null)}}});class nU extends nu.l9{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return nz(e,this.value)}}class nH{constructor(e,t){let n;function r(e){let t=nd.V.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;let i="string"==typeof t.all?t.all:t.all?r(t.all):void 0,s=t.scope;this.scope=s instanceof ng?e=>e.prop(np)==s.data:s?e=>e==s:void 0,this.style=(0,nf.QR)(e.map(e=>({tag:e.tag,class:e.class||r(Object.assign({},e,{tag:null}))})),{all:i}).style,this.module=n?new nd.V(n):null,this.themeType=t.themeType}static define(e,t){return new nH(e,t||{})}}nf.pJ.meta,nf.pJ.link,nf.pJ.heading,nf.pJ.emphasis,nf.pJ.strong,nf.pJ.strikethrough,nf.pJ.keyword,nf.pJ.atom,nf.pJ.bool,nf.pJ.url,nf.pJ.contentSeparator,nf.pJ.labelName,nf.pJ.literal,nf.pJ.inserted,nf.pJ.string,nf.pJ.deleted,nf.pJ.regexp,nf.pJ.escape,nf.pJ.string,nf.pJ.variableName,nf.pJ.variableName,nf.pJ.typeName,nf.pJ.namespace,nf.pJ.className,nf.pJ.variableName,nf.pJ.macroName,nf.pJ.propertyName,nf.pJ.comment,nf.pJ.invalid;let nQ=new R.md;function nG(e,t,n){let r=e.prop(t<0?R.md.openedBy:R.md.closedBy);if(r)return r;if(1==e.name.length){let r=n.indexOf(e.name);if(r>-1&&r%2==(t<0?1:0))return[n[r+t]]}return null}function nK(e){let t=e.type.prop(nQ);return t?t(e.node):e}function nZ(e,t,n,r={}){let i=r.maxScanDistance||1e4,s=r.brackets||"()[]{}",o=ny(e),l=o.resolveInner(t,n);for(let e=l;e;e=e.parent){let r=nG(e.type,n,s);if(r&&e.from<e.to){let i=nK(e);if(i&&(n>0?t>=i.from&&t<i.to:t>i.from&&t<=i.to))return function(e,t,n,r,i,s,o){let l=r.parent,a={from:i.from,to:i.to},h=0,c=null==l?void 0:l.cursor();if(c&&(n<0?c.childBefore(r.from):c.childAfter(r.to)))do if(n<0?c.to<=r.from:c.from>=r.to){if(0==h&&s.indexOf(c.type.name)>-1&&c.from<c.to){let e=nK(c);return{start:a,end:e?{from:e.from,to:e.to}:void 0,matched:!0}}if(nG(c.type,n,o))h++;else if(nG(c.type,-n,o)){if(0==h){let e=nK(c);return{start:a,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:a,matched:!1}}(0,0,n,e,i,r,s)}}return function(e,t,n,r,i,s,o){let l=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),a=o.indexOf(l);if(a<0||a%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 l=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)&&r.resolveInner(l+e,1).type==i){if(t%2==0==n>0)u++;else{if(1==u)return{start:h,end:{from:l+e,to:l+e+1},matched:t>>1==a>>1};u--}}}n>0&&(e+=s.length)}return c.done?{start:h,matched:!1}:null}(e,t,n,o,l.type,i,s)}let nY=Object.create(null),nX=[R.Jq.none],n0=[],n1=Object.create(null),n2=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"]])n2[e]=function(e,t){let n=[];for(let r of t.split(" ")){let t=[];for(let n of r.split(".")){let r=e[n]||nf.pJ[n];r?"function"==typeof r?t.length?t=t.map(r):n4(n,`Modifier ${n} used at start of tag`):t.length?n4(n,`Tag ${n} used as modifier`):t=Array.isArray(r)?r:[r]:n4(n,`Unknown highlighting tag ${n}`)}for(let e of t)n.push(e)}if(!n.length)return 0;let r=t.replace(/ /g,"_"),i=r+" "+n.map(e=>e.id),s=n1[i];if(s)return s.id;let o=n1[i]=R.Jq.define({id:nX.length,name:r,props:[(0,nf.Gv)({[r]:n})]});return nX.push(o),o.id}(nY,t);function n4(e,t){n0.indexOf(e)>-1||(n0.push(e),console.warn(t))}function n3(e,t){return({state:n,dispatch:r})=>{if(n.readOnly)return!1;let i=e(t,n);return!!i&&(r(n.update(i)),!0)}}nu.Nm.RTL,nu.Nm.LTR;let n5=n3(function(e,t,n=t.selection.ranges){let r=[],i=-1;for(let{from:e,to:s}of n){let n=r.length,o=1e9,l=n6(t,e).line;if(l){for(let n=e;n<=s;){let a=t.doc.lineAt(n);if(a.from>i&&(e==s||s>
47a.from)){i=a.from;let e=/^\s*/.exec(a.text)[0].length,t=e==a.length,n=a.text.slice(e,e+l.length)==l?e:-1;e<a.text.length&&e<o&&(o=e),r.push({line:a,comment:n,token:l,indent:e,empty:t,single:!1})}n=a.to+1}if(o<1e9)for(let e=n;e<r.length;e++)r[e].indent<r[e].line.text.length&&(r[e].indent=o);r.length==n+1&&(r[n].single=!0)}}if(2!=e&&r.some(e=>e.comment<0&&(!e.empty||e.single))){let e=[];for(let{line:t,token:n,indent:i,empty:s,single:o}of r)(o||!s)&&e.push({from:t.from+i,insert:n+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&r.some(e=>e.comment>=0)){let e=[];for(let{line:t,comment:n,token:i}of r)if(n>=0){let r=t.from+n,s=r+i.length;" "==t.text[s-t.from]&&s++,e.push({from:r,to:s})}return{changes:e}}return null},0),n9=n3(n8,0),n7=n3((e,t)=>n8(e,t,function(e){let t=[];for(let n of e.selection.ranges){let r=e.doc.lineAt(n.from),i=n.to<=r.to?r:e.doc.lineAt(n.to),s=t.length-1;s>=0&&t[s].to>r.from?t[s].to=i.to:t.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return t}(t)),0);function n6(e,t){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function n8(e,t,n=t.selection.ranges){let r=n.map(e=>n6(t,e.from).block);if(!r.every(e=>e))return null;let i=n.map((e,n)=>(function(e,{open:t,close:n},r,i){let s,o,l=e.sliceDoc(r-50,r),a=e.sliceDoc(i,i+50),h=/\s*$/.exec(l)[0].length,c=/^\s*/.exec(a)[0].length,u=l.length-h;if(l.slice(u-t.length,u)==t&&a.slice(c,c+n.length)==n)return{open:{pos:r-h,margin:h&&1},close:{pos:i+c,margin:c&&1}};i-r<=100?s=o=e.sliceDoc(r,i):(s=e.sliceDoc(r,r+50),o=e.sliceDoc(i-50,i));let f=/^\s*/.exec(s)[0].length,d=/\s*$/.exec(o)[0].length,p=o.length-d-n.length;return s.slice(f,f+t.length)==t&&o.slice(p,p+n.length)==n?{open:{pos:r+f+t.length,margin:/\s/.test(s.charAt(f+t.length))?1:0},close:{pos:i-d-n.length,margin:/\s/.test(o.charAt(p-1))?1:0}}:null})(t,r[n],e.from,e.to));if(2!=e&&!i.every(e=>e))return{changes:t.changes(n.map((e,t)=>i[t]?[]:[{from:e.from,insert:r[t].open+" "},{from:e.to,insert:" "+r[t].close}]))};if(1!=e&&i.some(e=>e)){let e=[];for(let t=0,n;t<i.length;t++)if(n=i[t]){let i=r[t],{open:s,close:o}=n;e.push({from:s.pos-i.open.length,to:s.pos+s.margin},{from:o.pos-o.margin,to:o.pos+i.close.length})}return{changes:e}}return null}let re=u.q6.define(),rt=u.r$.define();class rn{constructor(e,t,n,r,i){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=r,this.selectionsAfter=i}setSelAfter(e){return new rn(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 rn(e.changes&&u.as.fromJSON(e.changes),[],e.mapped&&u.n0.fromJSON(e.mapped),e.startSelection&&u.jT.fromJSON(e.startSelection),e.selectionsAfter.map(u.jT.fromJSON))}static fromTransaction(e,t){let n=rs;for(let t of e.startState.facet(rt)){let r=t(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new rn(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,rs)}static selection(e){return new rn(void 0,rs,void 0,void 0,e)}}function rr(e,t,n,r){let i=t+1>n+20?t-n-1:0,s=e.slice(i,t);return s.push(r),s}function ri(e,t){return e.length?t.length?e.concat(t):e:t}let rs=[];function ro(e,t){if(!e.length)return e;let n=e.length,r=rs;for(;n;){let i=function(e,t,n){let r=ri(e.selectionsAfter.length?e.selectionsAfter.map(e=>e.map(t)):rs,n);if(!e.changes)return rn.selection(r);let i=e.changes.map(t),s=t.mapDesc(e.changes,!0),o=e.mapped?e.mapped.composeDesc(s):s;return new rn(i,u.Py.mapEffects(e.effects,t),o,e.startSelection.map(s),r)}(e[n-1],t,r);if(i.changes&&!i.changes.empty||i.effects.length){let t=e.slice(0,n);return t[n-1]=i,t}t=i.mapped,n--,r=i.selectionsAfter}return r.length?[rn.selection(r)]:rs}let rl=/^(input\.type|delete)($|\.)/;class ra{constructor(e,t,n=0,r){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=r}isolate(){return this.prevTime?new ra(this.done,this.undone):this}addChanges(e,t,n,r,i){var s,o;let l,a,h=this.done,c=h[h.length-1];return h=c&&c.changes&&!c.changes.empty&&e.changes&&(!n||rl.test(n))&&(!c.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(i,(s=c.changes,o=e.changes,l=[],a=!1,s.iterChangedRanges((e,t)=>l.push(e,t)),o.iterChangedRanges((e,t,n,r)=>{for(let e=0;e<l.length;){let t=l[e++],i=l[e++];r>=t&&n<=i&&(a=!0)}}),a))||"input.type.compose"==n)?rr(h,h.length-1,r.minDepth,new rn(e.changes.compose(c.
47changes),ri(u.Py.mapEffects(e.effects,c.changes),c.effects),c.mapped,c.startSelection,rs)):rr(h,h.length,r.minDepth,e),new ra(h,rs,t,n)}addSelection(e,t,n,r){var i;let s=this.done.length?this.done[this.done.length-1].selectionsAfter:rs;return s.length>0&&t-this.prevTime<r&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&(i=s[s.length-1]).ranges.length==e.ranges.length&&0===i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length?this:new ra(function(e,t){if(!e.length)return[rn.selection([t])];{let n=e[e.length-1],r=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return r.length&&r[r.length-1].eq(t)?e:(r.push(t),rr(e,e.length-1,1e9,n.setSelAfter(r)))}}(this.done,e),this.undone,t,n)}addMapping(e){return new ra(ro(this.done,e),ro(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let r=0==e?this.done:this.undone;if(0==r.length)return null;let i=r[r.length-1],s=i.selectionsAfter[0]||t.selection;if(n&&i.selectionsAfter.length){let n,o;return t.update({selection:i.selectionsAfter[i.selectionsAfter.length-1],annotations:re.of({side:e,rest:(n=r[r.length-1],(o=r.slice())[r.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(!i.changes)return null;{let n=1==r.length?rs:r.slice(0,r.length-1);return i.mapped&&(n=ro(n,i.mapped)),t.update({changes:i.changes,selection:i.startSelection,effects:i.effects,annotations:re.of({side:e,rest:n,selection:s}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}}}function rh(e,t){return u.jT.create(e.ranges.map(t),e.mainIndex)}function rc(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function ru({state:e,dispatch:t},n){let r=rh(e.selection,n);return!r.eq(e.selection,!0)&&(t(rc(e,r)),!0)}function rf(e,t){return u.jT.cursor(t?e.to:e.from)}function rd(e,t){return ru(e,n=>n.empty?e.moveByChar(n,t):rf(n,t))}function rp(e){return e.textDirectionAt(e.state.selection.main.head)==nc.Nm.LTR}ra.empty=new ra(rs,rs);let rm=e=>rd(e,!rp(e)),rg=e=>rd(e,rp(e));function rv(e,t){return ru(e,n=>n.empty?e.moveByGroup(n,t):rf(n,t))}function ry(e,t,n){let r,i,s=ny(e).resolveInner(t.head),o=n?R.md.closedBy:R.md.openedBy;for(let r=t.head;;){let t=n?s.childAfter(r):s.childBefore(r);if(!t)break;!function(e,t,n){if(t.type.prop(n))return!0;let r=t.to-t.from;return r&&(r>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}(e,t,o)?r=n?t.to:t.from:s=t}return i=s.type.prop(o)&&(r=n?nZ(e,s.from,1):nZ(e,s.to,-1))&&r.matched?n?r.end.to:r.end.from:n?s.to:s.from,u.jT.cursor(i,n?-1:1)}function rw(e,t){return ru(e,n=>{if(!n.empty)return rf(n,t);let r=e.moveVertically(n,t);return r.head!=n.head?r:e.moveToLineBoundary(n,t)})}"undefined"!=typeof Intl&&Intl.Segmenter;let rx=e=>rw(e,!1),rk=e=>rw(e,!0);function rb(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,n=0,r=0,i;if(t){for(let t of e.state.facet(nc.tk.scrollMargins)){let i=t(e);(null==i?void 0:i.top)&&(n=Math.max(null==i?void 0:i.top,n)),(null==i?void 0:i.bottom)&&(r=Math.max(null==i?void 0:i.bottom,r))}i=e.scrollDOM.clientHeight-n-r}else i=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:n,marginBottom:r,selfScroll:t,height:Math.max(e.defaultLineHeight,i-5)}}function rS(e,t){let n,r=rb(e),{state:i}=e,s=rh(i.selection,n=>n.empty?e.moveVertically(n,t,r.height):rf(n,t));if(s.eq(i.selection))return!1;if(r.selfScroll){let t=e.coordsAtPos(i.selection.main.head),o=e.scrollDOM.getBoundingClientRect(),l=o.top+r.marginTop,a=o.bottom-r.marginBottom;t&&t.top>l&&t.bottom<a&&(n=nc.tk.scrollIntoView(s.main.head,{y:"start",yMargin:t.top-l}))}return e.dispatch(rc(i,s),{effects:n}),!0}let rA=e=>rS(e,!1),rC=e=>rS(e,!0);function rI(e,t,n){let r=e.lineBlockAt(t.head),i=e.moveToLineBoundary(t,n);if(i.head==t.head&&i.head!=(n?r.to:r.from)&&(i=e.moveToLineBoundary(t,n,!1)),!n&&i.head==r.from&&r.length){let n=/^\s*/.exec(e.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;n&&t.head!=r.from+n&&(i=u.jT.cursor(r.from+n))}return i}function rT(e,t){let n=rh(e.state.selection,e=>{let n=t(e);return u.jT.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return!n.eq(e.state.selection)&&(e.dispatch(rc(e.state,n)),!0)}function rO(e,t){return rT(e,n=>e.moveByChar(n,t))}let rM=e=>rO(e,!rp(e)),rP=e=>rO(e,rp(e));function rD(e,t){return rT(e,n=>e.moveByGroup(n,t))}function rE(e,t){return rT(e,n=>e.moveVertically(n,t))}let rB=e=>rE(e,!1),rN=e=>rE(e,!0);function rL(e,t){return rT(e,n=>e.moveVertically(n,t,rb(e).height))}let rR=e=>rL(e,!1),rj=e=>rL(e,!0),rJ=({state:e,dispatch:t})=>(t(rc(e,{anchor:0})),!0),r$=({state:e,dispatch:t})=>(t(rc(e,{anchor:e.doc.length})),!0),rF=({state:e,dispatch:t})=>(t(rc(e,{anchor:e.selection.main.anchor,head:0})),!0),rq=({state:e,dispatch:t})=>(t(rc(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function r_(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:r}=e,i=r.changeByRange(r=>{let{from:i,to:s}=r;if(i==s){let o=t(r);o<i?(n="delete.backward",o=rW(e,o,!1)):o>i&&(n="delete.forward",o=rW(e,o,!0)),i=Math.min(i,o),s=Math.max(s,o)}else i=rW(e,i,!1),s=rW(e,s,!0);return i==s?{range:r}:{changes:{from:i,to:s},range:u.jT.cursor(i,i<r.head?-1:1)}});return!i.changes.empty&&(e.dispatch(r.update(i,{scrollIntoView:!0,userEvent:n,effects:"delete.selection"==n?nc.tk.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function rW(e,t,n){if(e instanceof nc.tk)for(let r of e.state.facet(nc.tk.atomicRanges).map(t=>t(e)))r.between(t,t,(e,r)=>{e<t&&r>t&&(t=n?r:e)});return t}let rz=(e,t,n)=>r_(e,r=>{let i=r.from,{state:s}=e,o=s.doc.lineAt(i),l,a;if(n&&!t&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,i-o.from))){if(" "==l[l.length-1])return i-1;let e=(0,u.IS)(l,s.tabSize)%nP(s)||nP(s);for(let t=0;t<e&&" "==l[l.length-1-t];t++)i--;a=i}else(a=(0,u.cp)(o.text,i-o.from,t,t)+o.from)==i&&o.number!=(t?s.doc.lines:1)?a+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(a-o.from,i-o.from))&&(a=(0,u.cp)(o.text,a-o.from,!1,!1)+o.from);return a}),rV=e=>rz(e,!1,!0),rU=e=>rz(e,!0,!1),rH=(e,t)=>r_(e,n=>{let r=n.head,{state:i}=e,s=i.doc.lineAt(r),o=i.charCategorizer(r);for(let e=null;;){if(r==(t?s.to:s.from)){r==n.head&&s.number!=(t?i.doc.lines:1)&&(r+=t?1:-1);break}let l=(0,u.cp)(s.text,r-s.from,t)+s.from,a=s.text.slice(Math.min(r,l)-s.from,Math.max(r,l)-s.from),h=o(a);if(null!=e&&h!=e)break;
47(" "!=a||r!=n.head)&&(e=h),r=l}return r}),rQ=e=>rH(e,!1);function rG(e){let t=[],n=-1;for(let r of e.selection.ranges){let i=e.doc.lineAt(r.from),s=e.doc.lineAt(r.to);if(r.empty||r.to!=s.from||(s=e.doc.lineAt(r.to-1)),n>=i.number){let e=t[t.length-1];e.to=s.to,e.ranges.push(r)}else t.push({from:i.from,to:s.to,ranges:[r]});n=s.number+1}return t}function rK(e,t,n){if(e.readOnly)return!1;let r=[],i=[];for(let t of rG(e)){if(n?t.to==e.doc.length:0==t.from)continue;let s=e.doc.lineAt(n?t.to+1:t.from-1),o=s.length+1;if(n)for(let n of(r.push({from:t.to,to:s.to},{from:t.from,insert:s.text+e.lineBreak}),t.ranges))i.push(u.jT.range(Math.min(e.doc.length,n.anchor+o),Math.min(e.doc.length,n.head+o)));else for(let n of(r.push({from:s.from,to:t.from},{from:t.to,insert:e.lineBreak+s.text}),t.ranges))i.push(u.jT.range(n.anchor-o,n.head-o))}return!!r.length&&(t(e.update({changes:r,scrollIntoView:!0,selection:u.jT.create(i,e.selection.mainIndex),userEvent:"move.line"})),!0)}function rZ(e,t,n){if(e.readOnly)return!1;let r=[];for(let t of rG(e))n?r.push({from:t.from,insert:e.doc.slice(t.from,t.to)+e.lineBreak}):r.push({from:t.to,insert:e.lineBreak+e.doc.slice(t.from,t.to)});return t(e.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}let rY=r0(!1),rX=r0(!0);function r0(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let r=t.changeByRange(n=>{let{from:r,to:i}=n,s=t.doc.lineAt(r),o=!e&&r==i&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n=ny(e).resolveInner(t),r=n.childBefore(t),i=n.childAfter(t),s;return r&&i&&r.to<=t&&i.from>=t&&(s=r.type.prop(R.md.closedBy))&&s.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}(t,r);e&&(r=i=(i<=s.to?s:t.doc.lineAt(i)).to);let l=new nB(t,{simulateBreak:r,simulateDoubleBreak:!!o}),a=nE(l,r);for(null==a&&(a=(0,u.IS)(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));i<s.to&&/\s/.test(s.text[i-s.from]);)i++;o?{from:r,to:i}=o:r>s.from&&r<s.from+100&&!/\S/.test(s.text.slice(0,r))&&(r=s.from);let h=["",nD(t,a)];return o&&h.push(nD(t,l.lineIndent(s.from,-1))),{changes:{from:r,to:i,insert:u.xv.of(h)},range:u.jT.cursor(r+1+h[1].length)}});return n(t.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function r1(e,t){let n=-1;return e.changeByRange(r=>{let i=[];for(let s=r.from;s<=r.to;){let o=e.doc.lineAt(s);o.number>n&&(r.empty||r.to>o.from)&&(t(o,i,r),n=o.number),s=o.to+1}let s=e.changes(i);return{changes:i,range:u.jT.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}let r2=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(r1(e,(t,n)=>{n.push({from:t.from,insert:e.facet(nM)})}),{userEvent:"input.indent"})),!0),r4=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(r1(e,(t,n)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let i=(0,u.IS)(r,e.tabSize),s=0,o=nD(e,Math.max(0,i-nP(e)));for(;s<r.length&&s<o.length&&r.charCodeAt(s)==o.charCodeAt(s);)s++;n.push({from:t.from+s,to:t.from+r.length,insert:o.slice(s)})}),{userEvent:"delete.dedent"})),!0),r3=[{key:"Ctrl-b",run:rm,shift:rM,preventDefault:!0},{key:"Ctrl-f",run:rg,shift:rP},{key:"Ctrl-p",run:rx,shift:rB},{key:"Ctrl-n",run:rk,shift:rN},{key:"Ctrl-a",run:e=>ru(e,t=>u.jT.cursor(e.lineBlockAt(t.head).from,1)),shift:e=>rT(e,t=>u.jT.cursor(e.lineBlockAt(t.head).from))},{key:"Ctrl-e",run:e=>ru(e,t=>u.jT.cursor(e.lineBlockAt(t.head).to,-1)),shift:e=>rT(e,t=>u.jT.cursor(e.lineBlockAt(t.head).to))},{key:"Ctrl-d",run:rU},{key:"Ctrl-h",run:rV},{key:"Ctrl-k",run:e=>r_(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:rQ},{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:u.xv.of(["",""])},range:u.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,r=e.doc.lineAt(n),i=n==r.from?n-1:(0,u.cp)(r.text,n-r.from,!1)+r.from,s=n==r.to?n+1:(0,u.cp)(r.text,n-r.from,!0)+r.from;return{changes:{from:i,to:s,insert:e.doc.slice(n,s).append(e.doc.slice(i,n))},range:u.jT.cursor(s)}});return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:rC}],r5=[{key:"ArrowLeft",run:rm,shift:rM,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>rv(e,!rp(e)),shift:e=>rD(e,!rp(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>ru(e,t=>rI(e,t,!rp(e))),shift:e=>rT(e,t=>rI(e,t,!rp(e))),preventDefault:!0},{key:"ArrowRight",run:rg,shift:rP,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>rv(e,rp(e)),shift:e=>rD(e,rp(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>ru(e,t=>rI(e,t,rp(e))),shift:e=>rT(e,t=>rI(e,t,rp(e))),preventDefault:!0},{key:"ArrowUp",run:rx,shift:rB,preventDefault:!0},{mac:"Cmd-ArrowUp",run:rJ,shift:rF},{mac:"Ctrl-ArrowUp",run:rA,shift:rR},{key:"ArrowDown",run:rk,shift:rN,preventDefault:!0},{mac:"Cmd-ArrowDown",run:r$,shift:rq},{mac:"Ctrl-ArrowDown",run:rC,shift:rj},{key:"PageUp",run:rA,shift:rR},{key:"PageDown",run:rC,shift:rj},{key:"Home",run:e=>ru(e,t=>rI(e,t,!1)),shift:e=>rT(e,t=>rI(e,t,!1)),preventDefault:!0},{key:"Mod-Home",run:rJ,shift:rF},{key:"End",run:e=>ru(e,t=>rI(e,t,!0)),shift:e=>rT(e,t=>rI(e,t,!0)),preventDefault:!0},{key:"Mod-End",run:r$,shift:rq},{key:"Enter",run:rY},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:rV,shift:rV},{key:"Delete",run:rU},{key:"Mod-Backspace",mac:"Alt-Backspace",run:rQ},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>rH(e,!0)},{mac:"Mod-Backspace",run:e=>r_(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=>r_(e,t=>{let n=e.moveToLineBoundary(t,!0).head;return t.head<n?n:Math.min(e.state.doc.length,t.head+1)})}].concat(r3.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),r9=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>ru(e,t=>ry(e.state,t,!rp(e))),shift:e=>rT(e,t=>ry(e.state,t,!rp(e)))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>ru(e,t=>ry(e.state,t,rp(e))),shift:e=>rT(e,t=>ry(e.state,t,rp(e)))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>rK(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>rZ(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>rK(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>rZ(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,r=null;return n.ranges.length>1?r=u.jT.create([n.main]):n.main.empty||(r=u.jT.create([u.jT.cursor(n.main.head)])),!!r&&(t(rc(e,r)),!0)}},{key:"Mod-Enter",run:rX},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=rG(e).map(({from:t,to:n})=>u.jT.range(t,Math.min(n+1,e.doc.length)));return t(e.update({selection:u.jT.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=rh(e.selection,t=>{var n;let r=ny(e).resolveStack(t.from,1);for(let e=r;e;e=e.next){let{node:r}=e;if((r.from<t.from&&r.to>=t.to||r.to>t.to&&r.from<=t.from)&&(null===(n=r.parent)||void 0===n?void 0:n.parent))return u.jT.range(r.to,r.from)}return t});return t(rc(e,n)),!0},preventDefault:!0},{key:"Mod-[",run:r4},{key:"Mod-]",run:r2},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),r=new nB(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),i=r1(e,(t,i,s)=>{let o=nE(r,t.from);if(null==o)return;/\S/.test(t.text)||(o=0);let l=/^\s*/.exec(t.text)[0],a=nD(e,o);(l!=a||s.from<t.from+l.length)&&(n[t.from]=o,i.push({from:t.from,to:t.from+l.length,insert:a}))});return i.changes.empty||t(e.update(i,{userEvent:"indent"})),!0}},{key:"Shift-Mod-k",run:e=>{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(rG(t).map(({from:e,to:n})=>(e>0?e--:n<t.doc.length&&n++,{from:e,to:n}))),r=rh(t.selection,t=>{let n;if(e.lineWrapping){let r=e.lineBlockAt(t.head),i=e.coordsAtPos(t.head,t.assoc||1);i&&(n=r.bottom+e.documentTop-i.bottom+e.defaultLineHeight/2)}return e.moveVertically(t,!0,n)}).map(n);return e.dispatch({changes:n,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>{let n,r;return n=!1,r=rh(e.selection,t=>{let r=nZ(e,t.head,-1)||nZ(e,t.head,1)||t.head>0&&nZ(e,t.head-1,1)||t.head<e.doc.length&&nZ(e,t.head+1,-1);if(!r||!r.end)return t;n=!0;let i=r.start.from==t.head?r.end.to:r.end.from;return u.jT.cursor(i)}),!!n&&(t(rc(e,r)),!0)}},{key:"Mod-/",run:e=>{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),r=n6(e.state,n.from);return r.line?n5(e):!!r.block&&n7(e)}},{key:"Alt-A",run:n9},{key:"Ctrl-m",mac:"Shift-Alt-m",run:e=>(e.setTabFocusMode(),!0)}].concat(r5),r7={key:"Tab",run:r2,shift:r4};var r6=n(14388);let r8=(e,t={})=>{e.config(async e=>{let{languages:r,theme:i}=t;if(!r){let{languages:e}=await n.e(6538).then(n.bind(n,76538));r=e}if(!i){let{nord:e}=await Promise.all([n.e(6440),n.e(9325),n.e(4981)]).then(n.bind(n,94981));i=e}e.update(S.key,e=>{var n;return{extensions:[nc.$f.of(r9.concat(r7)),nh,i,...null!=(n=null==t?void 0:t.extensions)?n:[]],languages:r,expandIcon:t.expandIcon||(()=>r6.c),searchIcon:t.searchIcon||(()=>r6.s),clearSearchIcon:t.clearSearchIcon||(()=>r6.a),searchPlaceholder:t.searchPlaceholder||"Search language",noResultText:t.noResultText||"No result",renderLanguage:t.renderLanguage||e.renderLanguage}}
47)}).use(B)}},28699:function(e,t,n){n.d(t,{V:function(){return o}});let r="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),i="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class o{constructor(e,t){this.rules=[];let{finish:n}=t||{};function r(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}for(let t in e)!function e(t,i,s,o){let l=[],a=/^@(\w+)\b/.exec(t[0]),h=a&&"keyframes"==a[1];if(a&&null==i)return s.push(t[0]+";");for(let n in i){let o=i[n];if(/&/.test(n))e(n.split(/,\s*/).map(e=>t.map(t=>e.replace(/&/,t))).reduce((e,t)=>e.concat(t)),o,s);else if(o&&"object"==typeof o){if(!a)throw RangeError("The value of a property ("+n+") should be a primitive value.");e(r(n),o,l,h)}else null!=o&&l.push(n.replace(/_.*/,"").replace(/[A-Z]/g,e=>"-"+e.toLowerCase())+": "+o+";")}(l.length||h)&&s.push((!n||a||o?t:t.map(n)).join(", ")+" {"+l.join(" ")+"}")}(r(t),e[t],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=s[r]||1;return s[r]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let r=e[i],s=n&&n.nonce;r?s&&r.setNonce(s):r=new a(e,s),r.mount(Array.isArray(t)?t:[t],e)}}let l=new Map;class a{constructor(e,t){let n=e.ownerDocument||e,r=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let t=l.get(n);if(t)return e[i]=t;this.sheet=new r.CSSStyleSheet,l.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[i]=this}mount(e,t){let n=this.sheet,r=0,i=0;for(let t=0;t<e.length;t++){let s=e[t],o=this.modules.indexOf(s);if(o<i&&o>-1&&(this.modules.splice(o,1),i--,o=-1),-1==o){if(this.modules.splice(i++,0,s),n)for(let e=0;e<s.rules.length;e++)n.insertRule(s.rules[e],r++)}else{for(;i<o;)r+=this.modules[i++].rules.length;r+=s.rules.length,i++}}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)}}}}]);
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.