@akairos/myno 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +1 -1
- package/dist/.vite/manifest.json +46 -46
- package/dist/assets/image-markdown-B9h5B2rb.js +1265 -0
- package/dist/assets/index-8AqD83H1.js +1 -0
- package/dist/assets/index-B09gSE-P.js +1 -0
- package/dist/assets/index-B5QirwlE.js +1 -0
- package/dist/assets/index-BCHnk3-y.js +1 -0
- package/dist/assets/index-BDkwyFzW.js +1 -0
- package/dist/assets/index-BLsUt-zA.js +13 -0
- package/dist/assets/index-BTIQZeYj.js +1 -0
- package/dist/assets/index-C-7U-6v_.js +1 -0
- package/dist/assets/index-CJI0zg2K.js +6 -0
- package/dist/assets/index-CLXxLVkb.js +1 -0
- package/dist/assets/index-CMbXJhMt.js +1 -0
- package/dist/assets/index-Clsl5-o0.js +1 -0
- package/dist/assets/index-Cp7P_1nO.js +3 -0
- package/dist/assets/index-D1q1oCbd.js +1 -0
- package/dist/assets/index-DcclUA5v.js +1 -0
- package/dist/assets/index-DjR_s1th.js +1 -0
- package/dist/assets/index-DyrOw6Ys.js +2 -0
- package/dist/assets/index-GnzkuZjw.js +1 -0
- package/dist/assets/index-VMxQT3yK.js +1 -0
- package/dist/assets/index-VyEqR7eO.js +1 -0
- package/dist/assets/index-XaLIcAHQ.js +7 -0
- package/dist/editor/image-markdown.d.ts.map +1 -1
- package/dist/editor/image-markdown.js +10 -4
- package/dist/editor/image-markdown.js.map +1 -1
- package/dist/editor-export.js +1 -1
- package/dist/src/studio/studio.html +1 -1
- package/dist/studio.js +3 -3
- package/package.json +1 -1
package/dist/studio.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/index-
|
|
2
|
-
import{k as Jw,j as Qw,s as ex,$ as Be,l as dt,P as at,m as ft,n as kt,p as Ps,R as z3,S as Wr,F as Fn,D as Cn,o as te,q as In,t as N3,T as Ne,u as Xl,v as I,w as br,x as Vt,y as Te,z as Ia,A as Rr,N as pr,B as tx,M as nx,C as uh,G as ws,H as ne,I as Bn,J as rx,K as Yl,L as Bt,O as Zl,Q as xo,U as Dt,V as hh,W as kn,X as vm,Y as ix,Z as wu,_ as co,a0 as sx,a1 as ya,a2 as ox,a3 as L0,a4 as ss,a5 as xs,a6 as H3,a7 as ym,a8 as ax,a9 as xu,aa as lx,ab as cx,ac as La,ad as Ba,ae as ux,af as hx,ag as dx,ah as fx,ai as F3,aj as px,ak as mx,al as gx,am as bm,an as q3,ao as wm,ap as vx,aq as yx,ar as bx,as as wx,at as xx,au as kx,av as xm,aw as Cx,ax as Sx,ay as Ax,az as Mx,aA as Tx,aB as ku,aC as Ex,E as $3,r as V3,d as W3,aD as j3,c as G3,g as U3,aE as _x,aF as Ix,aG as K3,aH as Lx,aI as X3,aJ as Bx,aK as Dx,aL as Ox,aM as Px,aN as Rx,aO as km,aP as zx,aQ as Nx,aR as Hx,aS as Fx,aT as Y3,aU as S2,aV as Et,aW as Nn,aX as li,aY as Z3,aZ as mi,a_ as J3,a$ as gi,b0 as Q3,b1 as e7,b2 as t7,b3 as n7,b4 as r7,b5 as i7,b6 as Us,b7 as s7,b8 as qx,b9 as o7,ba as a7,bb as $x,bc as l7,bd as c7,be as Vx,bf as u7,bg as Cf,bh as Wx,bi as jx,a as h7,i as d7,f as Cm,bj as f7,bk as Sm,bl as Gx,bm as p7,b as A2,e as Ux,h as Kx,bn as Xx}from"./assets/image-markdown-DjLPX8Cn.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}})();var m7=typeof global=="object"&&global&&global.Object===Object&&global,Yx=typeof self=="object"&&self&&self.Object===Object&&self,Rs=m7||Yx||Function("return this")(),Cu=Rs.Symbol,g7=Object.prototype,Zx=g7.hasOwnProperty,Jx=g7.toString,ba=Cu?Cu.toStringTag:void 0;function Qx(n){var e=Zx.call(n,ba),t=n[ba];try{n[ba]=void 0;var r=!0}catch{}var i=Jx.call(n);return r&&(e?n[ba]=t:delete n[ba]),i}var ek=Object.prototype,tk=ek.toString;function nk(n){return tk.call(n)}var rk="[object Null]",ik="[object Undefined]",M2=Cu?Cu.toStringTag:void 0;function Jl(n){return n==null?n===void 0?ik:rk:M2&&M2 in Object(n)?Qx(n):nk(n)}function $o(n){return n!=null&&typeof n=="object"}var sk="[object Symbol]";function ok(n){return typeof n=="symbol"||$o(n)&&Jl(n)==sk}var Sf=Array.isArray,ak=/\s/;function lk(n){for(var e=n.length;e--&&ak.test(n.charAt(e)););return e}var ck=/^\s+/;function uk(n){return n&&n.slice(0,lk(n)+1).replace(ck,"")}function dn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var T2=NaN,hk=/^[-+]0x[0-9a-f]+$/i,dk=/^0b[01]+$/i,fk=/^0o[0-7]+$/i,pk=parseInt;function E2(n){if(typeof n=="number")return n;if(ok(n))return T2;if(dn(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=dn(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=uk(n);var t=dk.test(n);return t||fk.test(n)?pk(n.slice(2),t?2:8):hk.test(n)?T2:+n}function v7(n){return n}var mk="[object AsyncFunction]",gk="[object Function]",vk="[object GeneratorFunction]",yk="[object Proxy]";function Am(n){if(!dn(n))return!1;var e=Jl(n);return e==gk||e==vk||e==mk||e==yk}var vd=Rs["__core-js_shared__"],_2=(function(){var n=/[^.]+$/.exec(vd&&vd.keys&&vd.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function bk(n){return!!_2&&_2 in n}var wk=Function.prototype,xk=wk.toString;function kk(n){if(n!=null){try{return xk.call(n)}catch{}try{return n+""}catch{}}return""}var Ck=/[\\^$.*+?()[\]{}|]/g,Sk=/^\[object .+?Constructor\]$/,Ak=Function.prototype,Mk=Object.prototype,Tk=Ak.toString,Ek=Mk.hasOwnProperty,_k=RegExp("^"+Tk.call(Ek).replace(Ck,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ik(n){if(!dn(n)||bk(n))return!1;var e=Am(n)?_k:Sk;return e.test(kk(n))}function Lk(n,e){return n?.[e]}function Mm(n,e){var t=Lk(n,e);return Ik(t)?t:void 0}var I2=Object.create,Bk=(function(){function n(){}return function(e){if(!dn(e))return{};if(I2)return I2(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}})();function y7(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function Dk(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var Ok=800,Pk=16,Rk=Date.now;function zk(n){var e=0,t=0;return function(){var r=Rk(),i=Pk-(r-t);if(t=r,i>0){if(++e>=Ok)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function Nk(n){return function(){return n}}var Su=(function(){try{var n=Mm(Object,"defineProperty");return n({},"",{}),n}catch{}})(),Hk=Su?function(n,e){return Su(n,"toString",{configurable:!0,enumerable:!1,value:Nk(e),writable:!0})}:v7,Fk=zk(Hk),qk=9007199254740991,$k=/^(?:0|[1-9]\d*)$/;function b7(n,e){var t=typeof n;return e=e??qk,!!e&&(t=="number"||t!="symbol"&&$k.test(n))&&n>-1&&n%1==0&&n<e}function Tm(n,e,t){e=="__proto__"&&Su?Su(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function dh(n,e){return n===e||n!==n&&e!==e}var Vk=Object.prototype,Wk=Vk.hasOwnProperty;function jk(n,e,t){var r=n[e];(!(Wk.call(n,e)&&dh(r,t))||t===void 0&&!(e in n))&&Tm(n,e,t)}function Gk(n,e,t,r){var i=!t;t||(t={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=void 0;l===void 0&&(l=n[a]),i?Tm(t,a,l):jk(t,a,l)}return t}var L2=Math.max;function Uk(n,e,t){return e=L2(e===void 0?n.length-1:e,0),function(){for(var r=arguments,i=-1,s=L2(r.length-e,0),o=Array(s);++i<s;)o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=t(o),y7(n,this,a)}}function w7(n,e){return Fk(Uk(n,e,v7),n+"")}var Kk=9007199254740991;function x7(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Kk}function Em(n){return n!=null&&x7(n.length)&&!Am(n)}function Xk(n,e,t){if(!dn(t))return!1;var r=typeof e;return(r=="number"?Em(t)&&b7(e,t.length):r=="string"&&e in t)?dh(t[e],n):!1}function Yk(n){return w7(function(e,t){var r=-1,i=t.length,s=i>1?t[i-1]:void 0,o=i>2?t[2]:void 0;for(s=n.length>3&&typeof s=="function"?(i--,s):void 0,o&&Xk(t[0],t[1],o)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var a=t[r];a&&n(e,a,r,s)}return e})}var Zk=Object.prototype;function k7(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||Zk;return n===t}function Jk(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var Qk="[object Arguments]";function B2(n){return $o(n)&&Jl(n)==Qk}var C7=Object.prototype,eC=C7.hasOwnProperty,tC=C7.propertyIsEnumerable,Af=B2((function(){return arguments})())?B2:function(n){return $o(n)&&eC.call(n,"callee")&&!tC.call(n,"callee")};function nC(){return!1}var S7=typeof exports=="object"&&exports&&!exports.nodeType&&exports,D2=S7&&typeof module=="object"&&module&&!module.nodeType&&module,rC=D2&&D2.exports===S7,O2=rC?Rs.Buffer:void 0,iC=O2?O2.isBuffer:void 0,A7=iC||nC,sC="[object Arguments]",oC="[object Array]",aC="[object Boolean]",lC="[object Date]",cC="[object Error]",uC="[object Function]",hC="[object Map]",dC="[object Number]",fC="[object Object]",pC="[object RegExp]",mC="[object Set]",gC="[object String]",vC="[object WeakMap]",yC="[object ArrayBuffer]",bC="[object DataView]",wC="[object Float32Array]",xC="[object Float64Array]",kC="[object Int8Array]",CC="[object Int16Array]",SC="[object Int32Array]",AC="[object Uint8Array]",MC="[object Uint8ClampedArray]",TC="[object Uint16Array]",EC="[object Uint32Array]",Fe={};Fe[wC]=Fe[xC]=Fe[kC]=Fe[CC]=Fe[SC]=Fe[AC]=Fe[MC]=Fe[TC]=Fe[EC]=!0;Fe[sC]=Fe[oC]=Fe[yC]=Fe[aC]=Fe[bC]=Fe[lC]=Fe[cC]=Fe[uC]=Fe[hC]=Fe[dC]=Fe[fC]=Fe[pC]=Fe[mC]=Fe[gC]=Fe[vC]=!1;function _C(n){return $o(n)&&x7(n.length)&&!!Fe[Jl(n)]}function IC(n){return function(e){return n(e)}}var M7=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ol=M7&&typeof module=="object"&&module&&!module.nodeType&&module,LC=ol&&ol.exports===M7,yd=LC&&m7.process,P2=(function(){try{var n=ol&&ol.require&&ol.require("util").types;return n||yd&&yd.binding&&yd.binding("util")}catch{}})(),R2=P2&&P2.isTypedArray,T7=R2?IC(R2):_C;function BC(n,e){var t=Sf(n),r=!t&&Af(n),i=!t&&!r&&A7(n),s=!t&&!r&&!i&&T7(n),o=t||r||i||s,a=o?Jk(n.length,String):[],l=a.length;for(var c in n)o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||b7(c,l))||a.push(c);return a}function DC(n,e){return function(t){return n(e(t))}}function OC(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var PC=Object.prototype,RC=PC.hasOwnProperty;function zC(n){if(!dn(n))return OC(n);var e=k7(n),t=[];for(var r in n)r=="constructor"&&(e||!RC.call(n,r))||t.push(r);return t}function E7(n){return Em(n)?BC(n):zC(n)}var vl=Mm(Object,"create");function NC(){this.__data__=vl?vl(null):{},this.size=0}function HC(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var FC="__lodash_hash_undefined__",qC=Object.prototype,$C=qC.hasOwnProperty;function VC(n){var e=this.__data__;if(vl){var t=e[n];return t===FC?void 0:t}return $C.call(e,n)?e[n]:void 0}var WC=Object.prototype,jC=WC.hasOwnProperty;function GC(n){var e=this.__data__;return vl?e[n]!==void 0:jC.call(e,n)}var UC="__lodash_hash_undefined__";function KC(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=vl&&e===void 0?UC:e,this}function ks(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}ks.prototype.clear=NC;ks.prototype.delete=HC;ks.prototype.get=VC;ks.prototype.has=GC;ks.prototype.set=KC;function XC(){this.__data__=[],this.size=0}function fh(n,e){for(var t=n.length;t--;)if(dh(n[t][0],e))return t;return-1}var YC=Array.prototype,ZC=YC.splice;function JC(n){var e=this.__data__,t=fh(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():ZC.call(e,t,1),--this.size,!0}function QC(n){var e=this.__data__,t=fh(e,n);return t<0?void 0:e[t][1]}function eS(n){return fh(this.__data__,n)>-1}function tS(n,e){var t=this.__data__,r=fh(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function jr(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}jr.prototype.clear=XC;jr.prototype.delete=JC;jr.prototype.get=QC;jr.prototype.has=eS;jr.prototype.set=tS;var _7=Mm(Rs,"Map");function nS(){this.size=0,this.__data__={hash:new ks,map:new(_7||jr),string:new ks}}function rS(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function ph(n,e){var t=n.__data__;return rS(e)?t[typeof e=="string"?"string":"hash"]:t.map}function iS(n){var e=ph(this,n).delete(n);return this.size-=e?1:0,e}function sS(n){return ph(this,n).get(n)}function oS(n){return ph(this,n).has(n)}function aS(n,e){var t=ph(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function Vo(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Vo.prototype.clear=nS;Vo.prototype.delete=iS;Vo.prototype.get=sS;Vo.prototype.has=oS;Vo.prototype.set=aS;var I7=DC(Object.getPrototypeOf,Object),lS="[object Object]",cS=Function.prototype,uS=Object.prototype,L7=cS.toString,hS=uS.hasOwnProperty,dS=L7.call(Object);function fS(n){if(!$o(n)||Jl(n)!=lS)return!1;var e=I7(n);if(e===null)return!0;var t=hS.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&L7.call(t)==dS}function pS(){this.__data__=new jr,this.size=0}function mS(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function gS(n){return this.__data__.get(n)}function vS(n){return this.__data__.has(n)}var yS=200;function bS(n,e){var t=this.__data__;if(t instanceof jr){var r=t.__data__;if(!_7||r.length<yS-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new Vo(r)}return t.set(n,e),this.size=t.size,this}function Wo(n){var e=this.__data__=new jr(n);this.size=e.size}Wo.prototype.clear=pS;Wo.prototype.delete=mS;Wo.prototype.get=gS;Wo.prototype.has=vS;Wo.prototype.set=bS;var B7=typeof exports=="object"&&exports&&!exports.nodeType&&exports,z2=B7&&typeof module=="object"&&module&&!module.nodeType&&module,wS=z2&&z2.exports===B7,N2=wS?Rs.Buffer:void 0;N2&&N2.allocUnsafe;function xS(n,e){return n.slice()}var H2=Rs.Uint8Array;function kS(n){var e=new n.constructor(n.byteLength);return new H2(e).set(new H2(n)),e}function CS(n,e){var t=kS(n.buffer);return new n.constructor(t,n.byteOffset,n.length)}function SS(n){return typeof n.constructor=="function"&&!k7(n)?Bk(I7(n)):{}}function AS(n){return function(e,t,r){for(var i=-1,s=Object(e),o=r(e),a=o.length;a--;){var l=o[++i];if(t(s[l],l,s)===!1)break}return e}}var MS=AS(),bd=function(){return Rs.Date.now()},TS="Expected a function",ES=Math.max,_S=Math.min;function mh(n,e,t){var r,i,s,o,a,l,c=0,u=!1,h=!1,d=!0;if(typeof n!="function")throw new TypeError(TS);e=E2(e)||0,dn(t)&&(u=!!t.leading,h="maxWait"in t,s=h?ES(E2(t.maxWait)||0,e):s,d="trailing"in t?!!t.trailing:d);function f(T){var O=r,L=i;return r=i=void 0,c=T,o=n.apply(L,O),o}function m(T){return c=T,a=setTimeout(b,e),u?f(T):o}function g(T){var O=T-l,L=T-c,B=e-O;return h?_S(B,s-L):B}function y(T){var O=T-l,L=T-c;return l===void 0||O>=e||O<0||h&&L>=s}function b(){var T=bd();if(y(T))return x(T);a=setTimeout(b,g(T))}function x(T){return a=void 0,d&&r?f(T):(r=i=void 0,o)}function C(){a!==void 0&&clearTimeout(a),c=0,r=l=i=a=void 0}function E(){return a===void 0?o:x(bd())}function S(){var T=bd(),O=y(T);if(r=arguments,i=this,l=T,O){if(a===void 0)return m(l);if(h)return clearTimeout(a),a=setTimeout(b,e),f(l)}return a===void 0&&(a=setTimeout(b,e)),o}return S.cancel=C,S.flush=E,S}function Mf(n,e,t){(t!==void 0&&!dh(n[e],t)||t===void 0&&!(e in n))&&Tm(n,e,t)}function IS(n){return $o(n)&&Em(n)}function Tf(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function LS(n){return Gk(n,E7(n))}function BS(n,e,t,r,i,s,o){var a=Tf(n,t),l=Tf(e,t),c=o.get(l);if(c){Mf(n,t,c);return}var u=s?s(a,l,t+"",n,e,o):void 0,h=u===void 0;if(h){var d=Sf(l),f=!d&&A7(l),m=!d&&!f&&T7(l);u=l,d||f||m?Sf(a)?u=a:IS(a)?u=Dk(a):f?(h=!1,u=xS(l)):m?(h=!1,u=CS(l)):u=[]:fS(l)||Af(l)?(u=a,Af(a)?u=LS(a):(!dn(a)||Am(a))&&(u=SS(l))):h=!1}h&&(o.set(l,u),i(u,l,r,s,o),o.delete(l)),Mf(n,t,u)}function _m(n,e,t,r,i){n!==e&&MS(e,function(s,o){if(i||(i=new Wo),dn(s))BS(n,e,o,t,_m,r,i);else{var a=r?r(Tf(n,o),s,o+"",n,e,i):void 0;a===void 0&&(a=s),Mf(n,o,a)}},E7)}function D7(n,e,t,r,i,s){return dn(n)&&dn(e)&&(s.set(e,n),_m(n,e,void 0,D7,s),s.delete(e)),n}var DS=Yk(function(n,e,t,r){_m(n,e,t,r)}),OS=w7(function(n){return n.push(void 0,D7),y7(DS,void 0,n)}),PS="Expected a function";function gh(n,e,t){var r=!0,i=!0;if(typeof n!="function")throw new TypeError(PS);return dn(t)&&(r="leading"in t?!!t.leading:r,i="trailing"in t?!!t.trailing:i),mh(n,e,{leading:r,maxWait:e,trailing:i})}const RS="modulepreload",zS=function(n,e){return new URL(n,e).href},F2={},R=function(e,t,r){let i=Promise.resolve();if(t&&t.length>0){let c=function(u){return Promise.all(u.map(h=>Promise.resolve(h).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");i=c(t.map(u=>{if(u=zS(u,r),u in F2)return;F2[u]=!0;const h=u.endsWith(".css"),d=h?'[rel="stylesheet"]':"";if(r)for(let m=o.length-1;m>=0;m--){const g=o[m];if(g.href===u&&(!h||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${d}`))return;const f=document.createElement("link");if(f.rel=h?"stylesheet":RS,h||(f.as="script"),f.crossOrigin="",f.href=u,l&&f.setAttribute("nonce",l),document.head.appendChild(f),h)return new Promise((m,g)=>{f.addEventListener("load",m),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})},NS=1024;let HS=0,Sn=class{constructor(e,t){this.from=e,this.to=t}};class de{constructor(e={}){this.id=HS++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Wt.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}de.closedBy=new de({deserialize:n=>n.split(" ")});de.openedBy=new de({deserialize:n=>n.split(" ")});de.group=new de({deserialize:n=>n.split(" ")});de.isolate=new de({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});de.contextHash=new de({perNode:!0});de.lookAhead=new de({perNode:!0});de.mounted=new de({perNode:!0});class uo{constructor(e,t,r,i=!1){this.tree=e,this.overlay=t,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[de.mounted.id]}}const FS=Object.create(null);class Wt{constructor(e,t,r,i=0){this.name=e,this.props=t,this.id=r,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):FS,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Wt(e.name||"",t,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(de.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let i of r.split(" "))t[i]=e[r];return r=>{for(let i=r.prop(de.group),s=-1;s<(i?i.length:0);s++){let o=t[s<0?r.name:i[s]];if(o)return o}}}}Wt.none=new Wt("",Object.create(null),0,8);class Im{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let r of this.types){let i=null;for(let s of e){let o=s(r);if(o){i||(i=Object.assign({},r.props));let a=o[1],l=o[0];l.combine&&l.id in i&&(a=l.combine(i[l.id],a)),i[l.id]=a}}t.push(i?new Wt(r.name,i,r.id,r.flags):r)}return new Im(t)}}const B0=new WeakMap,q2=new WeakMap;var Ee;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(Ee||(Ee={}));class Oe{constructor(e,t,r,i,s){if(this.type=e,this.children=t,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,a]of s)this.props[typeof o=="number"?o:o.id]=a}}toString(){let e=uo.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let r of this.children){let i=r.toString();i&&(t&&(t+=","),t+=i)}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 Au(this.topNode,e)}cursorAt(e,t=0,r=0){let i=B0.get(this)||this.topNode,s=new Au(i);return s.moveTo(e,t),B0.set(this,s._tree),s}get topNode(){return new It(this,0,0,null)}resolve(e,t=0){let r=yl(B0.get(this)||this.topNode,e,t,!1);return B0.set(this,r),r}resolveInner(e,t=0){let r=yl(q2.get(this)||this.topNode,e,t,!0);return q2.set(this,r),r}resolveStack(e,t=0){return VS(this,e,t)}iterate(e){let{enter:t,leave:r,from:i=0,to:s=this.length}=e,o=e.mode||0,a=(o&Ee.IncludeAnonymous)>0;for(let l=this.cursor(o|Ee.IncludeAnonymous);;){let c=!1;if(l.from<=s&&l.to>=i&&(!a&&l.type.isAnonymous||t(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Dm(Wt.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,i)=>new Oe(this.type,t,r,i,this.propValues),e.makeTree||((t,r,i)=>new Oe(Wt.none,t,r,i)))}static build(e){return WS(e)}}Oe.empty=new Oe(Wt.none,[],[],0);class Lm{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 Lm(this.buffer,this.index)}}class Ci{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return Wt.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],r=this.buffer[e+3],i=this.set.types[t],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let o=[];for(;e<r;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,t,r,i,s){let{buffer:o}=this,a=-1;for(let l=e;l!=t&&!(O7(s,i,o[l+1],o[l+2])&&(a=l,r>0));l=o[l+3]);return a}slice(e,t,r){let i=this.buffer,s=new Uint16Array(t-e),o=0;for(let a=e,l=0;a<t;){s[l++]=i[a++],s[l++]=i[a++]-r;let c=s[l++]=i[a++]-r;s[l++]=i[a++]-e,o=Math.max(o,c)}return new Ci(s,o,this.set)}}function O7(n,e,t,r){switch(n){case-2:return t<e;case-1:return r>=e&&t<e;case 0:return t<e&&r>e;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function yl(n,e,t,r){for(var i;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let o=!r&&n instanceof It&&n.index<0?null:n.parent;if(!o)return n;n=o}let s=r?0:Ee.IgnoreOverlays;if(r)for(let o=n,a=o.parent;a;o=a,a=o.parent)o instanceof It&&o.index<0&&((i=a.enter(e,t,s))===null||i===void 0?void 0:i.from)!=o.from&&(n=a);for(;;){let o=n.enter(e,t,s);if(!o)return n;n=o}}class P7{cursor(e=0){return new Au(this,e)}getChild(e,t=null,r=null){let i=$2(this,e,t,r);return i.length?i[0]:null}getChildren(e,t=null,r=null){return $2(this,e,t,r)}resolve(e,t=0){return yl(this,e,t,!1)}resolveInner(e,t=0){return yl(this,e,t,!0)}matchContext(e){return Ef(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),r=this;for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(r=t,t=i.prevSibling):t=i}return r}get node(){return this}get next(){return this.parent}}class It extends P7{constructor(e,t,r,i){super(),this._tree=e,this.from=t,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,r,i,s=0){for(let o=this;;){for(let{children:a,positions:l}=o._tree,c=t>0?a.length:-1;e!=c;e+=t){let u=a[e],h=l[e]+o.from,d;if(!(!(s&Ee.EnterBracketed&&u instanceof Oe&&(d=uo.get(u))&&!d.overlay&&d.bracketed&&r>=h&&r<=h+u.length)&&!O7(i,r,h,h+u.length))){if(u instanceof Ci){if(s&Ee.ExcludeBuffers)continue;let f=u.findChild(0,u.buffer.length,t,r-h,i);if(f>-1)return new ar(new qS(o,u,e,h),null,f)}else if(s&Ee.IncludeAnonymous||!u.type.isAnonymous||Bm(u)){let f;if(!(s&Ee.IgnoreMounts)&&(f=uo.get(u))&&!f.overlay)return new It(f.tree,h,e,o);let m=new It(u,h,e,o);return s&Ee.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(t<0?u.children.length-1:0,t,r,i,s)}}}if(s&Ee.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))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)}prop(e){return this._tree.prop(e)}enter(e,t,r=0){let i;if(!(r&Ee.IgnoreOverlays)&&(i=uo.get(this._tree))&&i.overlay){let s=e-this.from,o=r&Ee.EnterBracketed&&i.bracketed;for(let{from:a,to:l}of i.overlay)if((t>0||o?a<=s:a<s)&&(t<0||o?l>=s:l>s))return new It(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}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 $2(n,e,t,r){let i=n.cursor(),s=[];if(!i.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=i.type.is(t),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function Ef(n,e,t=e.length-1){for(let r=n;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}class qS{constructor(e,t,r,i){this.parent=e,this.buffer=t,this.index=r,this.start=i}}class ar extends P7{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,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,r);return s<0?null:new ar(this.context,this,s)}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)}prop(e){return this.type.prop(e)}enter(e,t,r=0){if(r&Ee.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 ar(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 ar(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 ar(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let o=r.buffer[this.index+1];e.push(r.slice(i,s,o)),t.push(0)}return new Oe(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function R7(n){if(!n.length)return null;let e=0,t=n[0];for(let s=1;s<n.length;s++){let o=n[s];(o.from>t.from||o.to<t.to)&&(t=o,e=s)}let r=t instanceof It&&t.index<0?null:t.parent,i=n.slice();return r?i[e]=r:i.splice(e,1),new $S(i,t)}class $S{constructor(e,t){this.heads=e,this.node=t}get next(){return R7(this.heads)}}function VS(n,e,t){let r=n.resolveInner(e,t),i=null;for(let s=r instanceof It?r:r.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(i||(i=[r])).push(o.resolve(e,t)),s=o}else{let o=uo.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let a=new It(o.tree,o.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(yl(a,e,t,!1))}}return i?R7(i):r}class Au{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~Ee.EnterBracketed,e instanceof It)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.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):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof It?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}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,r=this.mode){return this.buffer?r&Ee.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ee.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ee.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)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:r}=i)}else({index:t,_parent:r}=this._tree);for(;r;{index:t,_parent:r}=r)if(t>-1)for(let s=t+e,o=e<0?-1:r._tree.children.length;s!=o;s+=e){let a=r._tree.children[s];if(this.mode&Ee.IncludeAnonymous||a instanceof Ci||!a.type.isAnonymous||Bm(a))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,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;t=o,r=s+1;break e}i=this.stack[--s]}for(let i=r;i<this.stack.length;i++)t=new ar(this.buffer,t,this.stack[i]);return this.bufferNode=new ar(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&t&&t(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return Ef(this.node.parent,e);let{buffer:t}=this.buffer,{types:r}=t.set;for(let i=e.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return Ef(this._tree,e,i);let o=r[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function Bm(n){return n.children.some(e=>e instanceof Ci||!e.type.isAnonymous||Bm(e))}function WS(n){var e;let{buffer:t,nodeSet:r,maxBufferLength:i=NS,reused:s=[],minRepeatType:o=r.types.length}=n,a=Array.isArray(t)?new Lm(t,t.length):t,l=r.types,c=0,u=0;function h(S,T,O,L,B,z){let{id:V,start:D,end:ee,size:J}=a,ie=u,he=c;if(J<0)if(a.next(),J==-1){let Ze=s[V];O.push(Ze),L.push(D-S);return}else if(J==-3){c=V;return}else if(J==-4){u=V;return}else throw new RangeError(`Unrecognized record size: ${J}`);let ke=l[V],we,be,Re=D-S;if(ee-D<=i&&(be=y(a.pos-T,B))){let Ze=new Uint16Array(be.size-be.skip),Je=a.pos-be.size,He=Ze.length;for(;a.pos>Je;)He=b(be.start,Ze,He);we=new Ci(Ze,ee-be.start,r),Re=be.start-S}else{let Ze=a.pos-J;a.next();let Je=[],He=[],Pt=V>=o?V:-1,gn=0,Mr=ee;for(;a.pos>Ze;)Pt>=0&&a.id==Pt&&a.size>=0?(a.end<=Mr-i&&(m(Je,He,D,gn,a.end,Mr,Pt,ie,he),gn=Je.length,Mr=a.end),a.next()):z>2500?d(D,Ze,Je,He):h(D,Ze,Je,He,Pt,z+1);if(Pt>=0&&gn>0&&gn<Je.length&&m(Je,He,D,gn,D,Mr,Pt,ie,he),Je.reverse(),He.reverse(),Pt>-1&&gn>0){let vn=f(ke,he);we=Dm(ke,Je,He,0,Je.length,0,ee-D,vn,vn)}else we=g(ke,Je,He,ee-D,ie-ee,he)}O.push(we),L.push(Re)}function d(S,T,O,L){let B=[],z=0,V=-1;for(;a.pos>T;){let{id:D,start:ee,end:J,size:ie}=a;if(ie>4)a.next();else{if(V>-1&&ee<V)break;V<0&&(V=J-i),B.push(D,ee,J),z++,a.next()}}if(z){let D=new Uint16Array(z*4),ee=B[B.length-2];for(let J=B.length-3,ie=0;J>=0;J-=3)D[ie++]=B[J],D[ie++]=B[J+1]-ee,D[ie++]=B[J+2]-ee,D[ie++]=ie;O.push(new Ci(D,B[2]-ee,r)),L.push(ee-S)}}function f(S,T){return(O,L,B)=>{let z=0,V=O.length-1,D,ee;if(V>=0&&(D=O[V])instanceof Oe){if(!V&&D.type==S&&D.length==B)return D;(ee=D.prop(de.lookAhead))&&(z=L[V]+D.length+ee)}return g(S,O,L,B,z,T)}}function m(S,T,O,L,B,z,V,D,ee){let J=[],ie=[];for(;S.length>L;)J.push(S.pop()),ie.push(T.pop()+O-B);S.push(g(r.types[V],J,ie,z-B,D-z,ee)),T.push(B-O)}function g(S,T,O,L,B,z,V){if(z){let D=[de.contextHash,z];V=V?[D].concat(V):[D]}if(B>25){let D=[de.lookAhead,B];V=V?[D].concat(V):[D]}return new Oe(S,T,O,L,V)}function y(S,T){let O=a.fork(),L=0,B=0,z=0,V=O.end-i,D={size:0,start:0,skip:0};e:for(let ee=O.pos-S;O.pos>ee;){let J=O.size;if(O.id==T&&J>=0){D.size=L,D.start=B,D.skip=z,z+=4,L+=4,O.next();continue}let ie=O.pos-J;if(J<0||ie<ee||O.start<V)break;let he=O.id>=o?4:0,ke=O.start;for(O.next();O.pos>ie;){if(O.size<0)if(O.size==-3||O.size==-4)he+=4;else break e;else O.id>=o&&(he+=4);O.next()}B=ke,L+=J,z+=he}return(T<0||L==S)&&(D.size=L,D.start=B,D.skip=z),D.size>4?D:void 0}function b(S,T,O){let{id:L,start:B,end:z,size:V}=a;if(a.next(),V>=0&&L<o){let D=O;if(V>4){let ee=a.pos-(V-4);for(;a.pos>ee;)O=b(S,T,O)}T[--O]=D,T[--O]=z-S,T[--O]=B-S,T[--O]=L}else V==-3?c=L:V==-4&&(u=L);return O}let x=[],C=[];for(;a.pos>0;)h(n.start||0,n.bufferStart||0,x,C,-1,0);let E=(e=n.length)!==null&&e!==void 0?e:x.length?C[0]+x[0].length:0;return new Oe(l[n.topID],x.reverse(),C.reverse(),E)}const V2=new WeakMap;function xc(n,e){if(!n.isAnonymous||e instanceof Ci||e.type!=n)return 1;let t=V2.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=n||!(r instanceof Oe)){t=1;break}t+=xc(n,r)}V2.set(e,t)}return t}function Dm(n,e,t,r,i,s,o,a,l){let c=0;for(let m=r;m<i;m++)c+=xc(n,e[m]);let u=Math.ceil(c*1.5/8),h=[],d=[];function f(m,g,y,b,x){for(let C=y;C<b;){let E=C,S=g[C],T=xc(n,m[C]);for(C++;C<b;C++){let O=xc(n,m[C]);if(T+O>=u)break;T+=O}if(C==E+1){if(T>u){let O=m[E];f(O.children,O.positions,0,O.children.length,g[E]+x);continue}h.push(m[E])}else{let O=g[C-1]+m[C-1].length-S;h.push(Dm(n,m,g,E,C,S,O,null,l))}d.push(S+x-s)}}return f(e,t,r,i,0),(a||l)(h,d,o)}class Vq{constructor(){this.map=new WeakMap}setBuffer(e,t,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,r)}getBuffer(e,t){let r=this.map.get(e);return r&&r.get(t)}set(e,t){e instanceof ar?this.setBuffer(e.context.buffer,e.index,t):e instanceof It&&this.map.set(e.tree,t)}get(e){return e instanceof ar?this.getBuffer(e.context.buffer,e.index):e instanceof It?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 zr{constructor(e,t,r,i,s=!1,o=!1){this.from=e,this.to=t,this.tree=r,this.offset=i,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let i=[new zr(0,e.length,e,0,!1,r)];for(let s of t)s.to>e.length&&i.push(s);return i}static applyChanges(e,t,r=128){if(!t.length)return e;let i=[],s=1,o=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a<t.length?t[a]:null,h=u?u.fromA:1e9;if(h-l>=r)for(;o&&o.from<h;){let d=o;if(l>=d.from||h<=d.to||c){let f=Math.max(d.from,l)-c,m=Math.min(d.to,h)-c;d=f>=m?null:new zr(f,m,d.tree,d.offset+c,a>0,!!u)}if(d&&i.push(d),o.to>h)break;o=s<e.length?e[s++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}let z7=class{startParse(e,t,r){return typeof e=="string"&&(e=new jS(e)),r=r?r.length?r.map(i=>new Sn(i.from,i.to)):[new Sn(0,0)]:[new Sn(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let i=this.startParse(e,t,r);for(;;){let s=i.advance();if(s)return s}}};class jS{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 jq(n){return(e,t,r,i)=>new US(e,n,t,r,i)}class W2{constructor(e,t,r,i,s,o){this.parser=e,this.parse=t,this.overlay=r,this.bracketed=i,this.target=s,this.from=o}}function j2(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class GS{constructor(e,t,r,i,s,o,a,l){this.parser=e,this.predicate=t,this.mounts=r,this.index=i,this.start=s,this.bracketed=o,this.target=a,this.prev=l,this.depth=0,this.ranges=[]}}const _f=new de({perNode:!0});class US{constructor(e,t,r,i,s){this.nest=t,this.input=r,this.fragments=i,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new Oe(r.type,r.children,r.positions,r.length,r.propValues.concat([[_f,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[de.mounted.id]=new uo(t,e.overlay,e.parser,e.bracketed),e.target.props=r}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 YS(this.fragments),t=null,r=null,i=new Au(new It(this.baseTree,this.ranges[0].from,0,null),Ee.IncludeAnonymous|Ee.IgnoreMounts);e:for(let s,o;;){let a=!0,l;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)a=!1;else if(e.hasNode(i)){if(t){let c=t.mounts.find(u=>u.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let h=u.from+c.pos,d=u.to+c.pos;h>=i.from&&d<=i.to&&!t.ranges.some(f=>f.from<d&&f.to>h)&&t.ranges.push({from:h,to:d})}}a=!1}else if(r&&(o=KS(r.ranges,i.from,i.to)))a=o!=2;else if(!i.type.isAnonymous&&(s=this.nest(i,this.input))&&(i.from<i.to||!s.overlay)){i.tree||(XS(i),t&&t.depth++,r&&r.depth++);let c=e.findMounts(i.from,s.parser);if(typeof s.overlay=="function")t=new GS(s.parser,s.overlay,c,this.inner.length,i.from,!!s.bracketed,i.tree,t);else{let u=K2(this.ranges,s.overlay||(i.from<i.to?[new Sn(i.from,i.to)]:[]));u.length&&j2(u),(u.length||!s.overlay)&&this.inner.push(new W2(s.parser,u.length?s.parser.startParse(this.input,X2(c,u),u):s.parser.startParse(""),s.overlay?s.overlay.map(h=>new Sn(h.from-i.from,h.to-i.from)):null,!!s.bracketed,i.tree,u.length?u[0].from:i.from)),s.overlay?u.length&&(r={ranges:u,depth:0,prev:r}):a=!1}}else if(t&&(l=t.predicate(i))&&(l===!0&&(l=new Sn(i.from,i.to)),l.from<l.to)){let c=t.ranges.length-1;c>=0&&t.ranges[c].to==l.from?t.ranges[c]={from:t.ranges[c].from,to:l.to}:t.ranges.push(l)}if(a&&i.firstChild())t&&t.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(t&&!--t.depth){let c=K2(this.ranges,t.ranges);c.length&&(j2(c),this.inner.splice(t.index,0,new W2(t.parser,t.parser.startParse(this.input,X2(t.mounts,c),c),t.ranges.map(u=>new Sn(u.from-t.start,u.to-t.start)),t.bracketed,t.target,c[0].from))),t=t.prev}r&&!--r.depth&&(r=r.prev)}}}}function KS(n,e,t){for(let r of n){if(r.from>=t)break;if(r.to>e)return r.from<=e&&r.to>=t?2:1}return 0}function G2(n,e,t,r,i,s){if(e<t){let o=n.buffer[e+1];r.push(n.slice(e,t,o)),i.push(o-s)}}function XS(n){let{node:e}=n,t=[],r=e.context.buffer;do t.push(n.index),n.parent();while(!n.tree);let i=n.tree,s=i.children.indexOf(r),o=i.children[s],a=o.buffer,l=[s];function c(u,h,d,f,m,g){let y=t[g],b=[],x=[];G2(o,u,y,b,x,f);let C=a[y+1],E=a[y+2];l.push(b.length);let S=g?c(y+4,a[y+3],o.set.types[a[y]],C,E-C,g-1):e.toTree();return b.push(S),x.push(C-f),G2(o,a[y+3],h,b,x,f),new Oe(d,b,x,m)}i.children[s]=c(0,a.length,Wt.none,0,o.length,t.length-1);for(let u of l){let h=n.tree.children[u],d=n.tree.positions[u];n.yield(new It(h,d+n.from,u,n._tree))}}class U2{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(Ee.IncludeAnonymous|Ee.IgnoreMounts|Ee.ExcludeBuffers)}moveTo(e){let{cursor:t}=this,r=e-this.offset;for(;!this.done&&t.from<r;)if(!(t.to>=r&&t.enter(r,1,Ee.IncludeAnonymous|Ee.IgnoreOverlays|Ee.ExcludeBuffers)))if(t.to<=r)t.next(!1)||(this.done=!0);else break}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;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof Oe)t=t.children[0];else break}return!1}}class YS{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(t=r.tree.prop(_f))!==null&&t!==void 0?t:r.to,this.inner=new U2(r.tree,-r.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=(e=t.tree.prop(_f))!==null&&e!==void 0?e:t.to,this.inner=new U2(t.tree,-t.offset)}}findMounts(e,t){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(r=s.tree)===null||r===void 0?void 0:r.prop(de.mounted);if(o&&o.parser==t)for(let a=this.fragI;a<this.fragments.length;a++){let l=this.fragments[a];if(l.from>=s.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:s.from-l.offset,mount:o})}}}return i}}function K2(n,e){let t=null,r=e;for(let i=1,s=0;i<n.length;i++){let o=n[i-1].to,a=n[i].from;for(;s<r.length;s++){let l=r[s];if(l.from>=a)break;l.to<=o||(t||(r=t=e.slice()),l.from<o?(t[s]=new Sn(l.from,o),l.to>a&&t.splice(s+1,0,new Sn(a,l.to))):l.to>a?t[s--]=new Sn(a,l.to):t.splice(s--,1))}}return r}function ZS(n,e,t,r){let i=0,s=0,o=!1,a=!1,l=-1e9,c=[];for(;;){let u=i==n.length?1e9:o?n[i].to:n[i].from,h=s==e.length?1e9:a?e[s].to:e[s].from;if(o!=a){let d=Math.max(l,t),f=Math.min(u,h,r);d<f&&c.push(new Sn(d,f))}if(l=Math.min(u,h),l==1e9)break;u==l&&(o?(o=!1,i++):o=!0),h==l&&(a?(a=!1,s++):a=!0)}return c}function X2(n,e){let t=[];for(let{pos:r,mount:i,frag:s}of n){let o=r+(i.overlay?i.overlay[0].from:0),a=o+i.tree.length,l=Math.max(s.from,o),c=Math.min(s.to,a);if(i.overlay){let u=i.overlay.map(d=>new Sn(d.from+r,d.to+r)),h=ZS(e,u,l,c);for(let d=0,f=l;;d++){let m=d==h.length,g=m?c:h[d].from;if(g>f&&t.push(new zr(f,g,i.tree,-o,s.from>=f||s.openStart,s.to<=g||s.openEnd)),m)break;f=h[d].to}}else t.push(new zr(l,c,i.tree,-o,s.from>=o||s.openStart,s.to<=a||s.openEnd))}return t}let If=[],N7=[];(()=>{let n="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,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?N7:If).push(t=t+n[e])})();function JS(n){if(n<768)return!1;for(let e=0,t=If.length;;){let r=e+t>>1;if(n<If[r])t=r;else if(n>=N7[r])e=r+1;else return!0;if(e==t)return!1}}function Y2(n){return n>=127462&&n<=127487}const Z2=8205;function QS(n,e,t=!0,r=!0){return(t?H7:eA)(n,e,r)}function H7(n,e,t){if(e==n.length)return e;e&&F7(n.charCodeAt(e))&&q7(n.charCodeAt(e-1))&&e--;let r=wd(n,e);for(e+=J2(r);e<n.length;){let i=wd(n,e);if(r==Z2||i==Z2||t&&JS(i))e+=J2(i),r=i;else if(Y2(i)){let s=0,o=e-2;for(;o>=0&&Y2(wd(n,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function eA(n,e,t){for(;e>1;){let r=H7(n,e-2,t);if(r<e)return r;e--}return 0}function wd(n,e){let t=n.charCodeAt(e);if(!q7(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return F7(r)?(t-55296<<10)+(r-56320)+65536:t}function F7(n){return n>=56320&&n<57344}function q7(n){return n>=55296&&n<56320}function J2(n){return n<65536?1:2}class ye{lineAt(e){if(e<0||e>this.length)throw new 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 new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,r){[e,t]=ko(this,e,t);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(t,this.length,i,1),kc.from(i,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=ko(this,e,t);let r=[];return this.decompose(e,t,r,0),kc.from(r,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new al(this),s=new al(e);for(let o=t,a=t;;){if(i.next(o),s.next(o),o=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new al(this,e)}iterRange(e,t=this.length){return new $7(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new V7(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?ye.empty:e.length<=32?new et(e):kc.from(et.split(e,[]))}}class et extends ye{constructor(e,t=tA(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,i){for(let s=0;;s++){let o=this.text[s],a=i+o.length;if((t?r:a)>=e)return new nA(i,a,r,o);i=a+1,r++}}decompose(e,t,r,i){let s=e<=0&&t>=this.length?this:new et(Q2(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),a=Cc(s.text,o.text.slice(),0,s.length);if(a.length<=32)r.push(new et(a,o.length+s.length));else{let l=a.length>>1;r.push(new et(a.slice(0,l)),new et(a.slice(l)))}}else r.push(s)}replace(e,t,r){if(!(r instanceof et))return super.replace(e,t,r);[e,t]=ko(this,e,t);let i=Cc(this.text,Cc(r.text,Q2(this.text,0,e)),t),s=this.length+r.length-(t-e);return i.length<=32?new et(i,s):kc.from(et.split(i,[]),s)}sliceString(e,t=this.length,r=`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./assets/index-DyrOw6Ys.js","./assets/index-CAXLlEvK.js","./assets/image-markdown-B9h5B2rb.js","./assets/index-GnzkuZjw.js","./assets/index-VyEqR7eO.js","./assets/index-XaLIcAHQ.js","./assets/index-B5QirwlE.js","./assets/index-BLsUt-zA.js","./assets/index-8AqD83H1.js","./assets/index-BDkwyFzW.js","./assets/index-D1q1oCbd.js","./assets/index-BCHnk3-y.js","./assets/index-DcclUA5v.js","./assets/index-CJI0zg2K.js","./assets/index-CMbXJhMt.js","./assets/index-Cp7P_1nO.js","./assets/index-VMxQT3yK.js","./assets/index-BTIQZeYj.js","./assets/index-DjR_s1th.js","./assets/index-CLXxLVkb.js","./assets/index-Clsl5-o0.js","./assets/dockerfile-BKs6k2Af.js","./assets/simple-mode-GW_nhZxv.js","./assets/factor-kuTfRLto.js","./assets/nsis-LY0VT_u5.js","./assets/pug-DeIclll2.js","./assets/javascript-iXu5QeM3.js","./assets/index-C-7U-6v_.js","./assets/index-B09gSE-P.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{k as Jw,j as Qw,s as ex,$ as Be,l as dt,P as at,m as ft,n as kt,p as Ps,R as z3,S as Wr,F as Fn,D as Cn,o as te,q as In,t as N3,T as Ne,u as Xl,v as I,w as br,x as Vt,y as Te,z as Ia,A as Rr,N as pr,B as tx,M as nx,C as uh,G as ws,H as ne,I as Bn,J as rx,K as Yl,L as Bt,O as Zl,Q as xo,U as Dt,V as hh,W as kn,X as vm,Y as ix,Z as wu,_ as co,a0 as sx,a1 as ya,a2 as ox,a3 as L0,a4 as ss,a5 as xs,a6 as H3,a7 as ym,a8 as ax,a9 as xu,aa as lx,ab as cx,ac as La,ad as Ba,ae as ux,af as hx,ag as dx,ah as fx,ai as F3,aj as px,ak as mx,al as gx,am as bm,an as q3,ao as wm,ap as vx,aq as yx,ar as bx,as as wx,at as xx,au as kx,av as xm,aw as Cx,ax as Sx,ay as Ax,az as Mx,aA as Tx,aB as ku,aC as Ex,E as $3,r as V3,d as W3,aD as j3,c as G3,g as U3,aE as _x,aF as Ix,aG as K3,aH as Lx,aI as X3,aJ as Bx,aK as Dx,aL as Ox,aM as Px,aN as Rx,aO as km,aP as zx,aQ as Nx,aR as Hx,aS as Fx,aT as Y3,aU as S2,aV as Et,aW as Nn,aX as li,aY as Z3,aZ as mi,a_ as J3,a$ as gi,b0 as Q3,b1 as e7,b2 as t7,b3 as n7,b4 as r7,b5 as i7,b6 as Us,b7 as s7,b8 as qx,b9 as o7,ba as a7,bb as $x,bc as l7,bd as c7,be as Vx,bf as u7,bg as Cf,bh as Wx,bi as jx,a as h7,i as d7,f as Cm,bj as f7,bk as Sm,bl as Gx,bm as p7,b as A2,e as Ux,h as Kx,bn as Xx}from"./assets/image-markdown-B9h5B2rb.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}})();var m7=typeof global=="object"&&global&&global.Object===Object&&global,Yx=typeof self=="object"&&self&&self.Object===Object&&self,Rs=m7||Yx||Function("return this")(),Cu=Rs.Symbol,g7=Object.prototype,Zx=g7.hasOwnProperty,Jx=g7.toString,ba=Cu?Cu.toStringTag:void 0;function Qx(n){var e=Zx.call(n,ba),t=n[ba];try{n[ba]=void 0;var r=!0}catch{}var i=Jx.call(n);return r&&(e?n[ba]=t:delete n[ba]),i}var ek=Object.prototype,tk=ek.toString;function nk(n){return tk.call(n)}var rk="[object Null]",ik="[object Undefined]",M2=Cu?Cu.toStringTag:void 0;function Jl(n){return n==null?n===void 0?ik:rk:M2&&M2 in Object(n)?Qx(n):nk(n)}function $o(n){return n!=null&&typeof n=="object"}var sk="[object Symbol]";function ok(n){return typeof n=="symbol"||$o(n)&&Jl(n)==sk}var Sf=Array.isArray,ak=/\s/;function lk(n){for(var e=n.length;e--&&ak.test(n.charAt(e)););return e}var ck=/^\s+/;function uk(n){return n&&n.slice(0,lk(n)+1).replace(ck,"")}function dn(n){var e=typeof n;return n!=null&&(e=="object"||e=="function")}var T2=NaN,hk=/^[-+]0x[0-9a-f]+$/i,dk=/^0b[01]+$/i,fk=/^0o[0-7]+$/i,pk=parseInt;function E2(n){if(typeof n=="number")return n;if(ok(n))return T2;if(dn(n)){var e=typeof n.valueOf=="function"?n.valueOf():n;n=dn(e)?e+"":e}if(typeof n!="string")return n===0?n:+n;n=uk(n);var t=dk.test(n);return t||fk.test(n)?pk(n.slice(2),t?2:8):hk.test(n)?T2:+n}function v7(n){return n}var mk="[object AsyncFunction]",gk="[object Function]",vk="[object GeneratorFunction]",yk="[object Proxy]";function Am(n){if(!dn(n))return!1;var e=Jl(n);return e==gk||e==vk||e==mk||e==yk}var vd=Rs["__core-js_shared__"],_2=(function(){var n=/[^.]+$/.exec(vd&&vd.keys&&vd.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function bk(n){return!!_2&&_2 in n}var wk=Function.prototype,xk=wk.toString;function kk(n){if(n!=null){try{return xk.call(n)}catch{}try{return n+""}catch{}}return""}var Ck=/[\\^$.*+?()[\]{}|]/g,Sk=/^\[object .+?Constructor\]$/,Ak=Function.prototype,Mk=Object.prototype,Tk=Ak.toString,Ek=Mk.hasOwnProperty,_k=RegExp("^"+Tk.call(Ek).replace(Ck,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ik(n){if(!dn(n)||bk(n))return!1;var e=Am(n)?_k:Sk;return e.test(kk(n))}function Lk(n,e){return n?.[e]}function Mm(n,e){var t=Lk(n,e);return Ik(t)?t:void 0}var I2=Object.create,Bk=(function(){function n(){}return function(e){if(!dn(e))return{};if(I2)return I2(e);n.prototype=e;var t=new n;return n.prototype=void 0,t}})();function y7(n,e,t){switch(t.length){case 0:return n.call(e);case 1:return n.call(e,t[0]);case 2:return n.call(e,t[0],t[1]);case 3:return n.call(e,t[0],t[1],t[2])}return n.apply(e,t)}function Dk(n,e){var t=-1,r=n.length;for(e||(e=Array(r));++t<r;)e[t]=n[t];return e}var Ok=800,Pk=16,Rk=Date.now;function zk(n){var e=0,t=0;return function(){var r=Rk(),i=Pk-(r-t);if(t=r,i>0){if(++e>=Ok)return arguments[0]}else e=0;return n.apply(void 0,arguments)}}function Nk(n){return function(){return n}}var Su=(function(){try{var n=Mm(Object,"defineProperty");return n({},"",{}),n}catch{}})(),Hk=Su?function(n,e){return Su(n,"toString",{configurable:!0,enumerable:!1,value:Nk(e),writable:!0})}:v7,Fk=zk(Hk),qk=9007199254740991,$k=/^(?:0|[1-9]\d*)$/;function b7(n,e){var t=typeof n;return e=e??qk,!!e&&(t=="number"||t!="symbol"&&$k.test(n))&&n>-1&&n%1==0&&n<e}function Tm(n,e,t){e=="__proto__"&&Su?Su(n,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):n[e]=t}function dh(n,e){return n===e||n!==n&&e!==e}var Vk=Object.prototype,Wk=Vk.hasOwnProperty;function jk(n,e,t){var r=n[e];(!(Wk.call(n,e)&&dh(r,t))||t===void 0&&!(e in n))&&Tm(n,e,t)}function Gk(n,e,t,r){var i=!t;t||(t={});for(var s=-1,o=e.length;++s<o;){var a=e[s],l=void 0;l===void 0&&(l=n[a]),i?Tm(t,a,l):jk(t,a,l)}return t}var L2=Math.max;function Uk(n,e,t){return e=L2(e===void 0?n.length-1:e,0),function(){for(var r=arguments,i=-1,s=L2(r.length-e,0),o=Array(s);++i<s;)o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=t(o),y7(n,this,a)}}function w7(n,e){return Fk(Uk(n,e,v7),n+"")}var Kk=9007199254740991;function x7(n){return typeof n=="number"&&n>-1&&n%1==0&&n<=Kk}function Em(n){return n!=null&&x7(n.length)&&!Am(n)}function Xk(n,e,t){if(!dn(t))return!1;var r=typeof e;return(r=="number"?Em(t)&&b7(e,t.length):r=="string"&&e in t)?dh(t[e],n):!1}function Yk(n){return w7(function(e,t){var r=-1,i=t.length,s=i>1?t[i-1]:void 0,o=i>2?t[2]:void 0;for(s=n.length>3&&typeof s=="function"?(i--,s):void 0,o&&Xk(t[0],t[1],o)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var a=t[r];a&&n(e,a,r,s)}return e})}var Zk=Object.prototype;function k7(n){var e=n&&n.constructor,t=typeof e=="function"&&e.prototype||Zk;return n===t}function Jk(n,e){for(var t=-1,r=Array(n);++t<n;)r[t]=e(t);return r}var Qk="[object Arguments]";function B2(n){return $o(n)&&Jl(n)==Qk}var C7=Object.prototype,eC=C7.hasOwnProperty,tC=C7.propertyIsEnumerable,Af=B2((function(){return arguments})())?B2:function(n){return $o(n)&&eC.call(n,"callee")&&!tC.call(n,"callee")};function nC(){return!1}var S7=typeof exports=="object"&&exports&&!exports.nodeType&&exports,D2=S7&&typeof module=="object"&&module&&!module.nodeType&&module,rC=D2&&D2.exports===S7,O2=rC?Rs.Buffer:void 0,iC=O2?O2.isBuffer:void 0,A7=iC||nC,sC="[object Arguments]",oC="[object Array]",aC="[object Boolean]",lC="[object Date]",cC="[object Error]",uC="[object Function]",hC="[object Map]",dC="[object Number]",fC="[object Object]",pC="[object RegExp]",mC="[object Set]",gC="[object String]",vC="[object WeakMap]",yC="[object ArrayBuffer]",bC="[object DataView]",wC="[object Float32Array]",xC="[object Float64Array]",kC="[object Int8Array]",CC="[object Int16Array]",SC="[object Int32Array]",AC="[object Uint8Array]",MC="[object Uint8ClampedArray]",TC="[object Uint16Array]",EC="[object Uint32Array]",Fe={};Fe[wC]=Fe[xC]=Fe[kC]=Fe[CC]=Fe[SC]=Fe[AC]=Fe[MC]=Fe[TC]=Fe[EC]=!0;Fe[sC]=Fe[oC]=Fe[yC]=Fe[aC]=Fe[bC]=Fe[lC]=Fe[cC]=Fe[uC]=Fe[hC]=Fe[dC]=Fe[fC]=Fe[pC]=Fe[mC]=Fe[gC]=Fe[vC]=!1;function _C(n){return $o(n)&&x7(n.length)&&!!Fe[Jl(n)]}function IC(n){return function(e){return n(e)}}var M7=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ol=M7&&typeof module=="object"&&module&&!module.nodeType&&module,LC=ol&&ol.exports===M7,yd=LC&&m7.process,P2=(function(){try{var n=ol&&ol.require&&ol.require("util").types;return n||yd&&yd.binding&&yd.binding("util")}catch{}})(),R2=P2&&P2.isTypedArray,T7=R2?IC(R2):_C;function BC(n,e){var t=Sf(n),r=!t&&Af(n),i=!t&&!r&&A7(n),s=!t&&!r&&!i&&T7(n),o=t||r||i||s,a=o?Jk(n.length,String):[],l=a.length;for(var c in n)o&&(c=="length"||i&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||b7(c,l))||a.push(c);return a}function DC(n,e){return function(t){return n(e(t))}}function OC(n){var e=[];if(n!=null)for(var t in Object(n))e.push(t);return e}var PC=Object.prototype,RC=PC.hasOwnProperty;function zC(n){if(!dn(n))return OC(n);var e=k7(n),t=[];for(var r in n)r=="constructor"&&(e||!RC.call(n,r))||t.push(r);return t}function E7(n){return Em(n)?BC(n):zC(n)}var vl=Mm(Object,"create");function NC(){this.__data__=vl?vl(null):{},this.size=0}function HC(n){var e=this.has(n)&&delete this.__data__[n];return this.size-=e?1:0,e}var FC="__lodash_hash_undefined__",qC=Object.prototype,$C=qC.hasOwnProperty;function VC(n){var e=this.__data__;if(vl){var t=e[n];return t===FC?void 0:t}return $C.call(e,n)?e[n]:void 0}var WC=Object.prototype,jC=WC.hasOwnProperty;function GC(n){var e=this.__data__;return vl?e[n]!==void 0:jC.call(e,n)}var UC="__lodash_hash_undefined__";function KC(n,e){var t=this.__data__;return this.size+=this.has(n)?0:1,t[n]=vl&&e===void 0?UC:e,this}function ks(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}ks.prototype.clear=NC;ks.prototype.delete=HC;ks.prototype.get=VC;ks.prototype.has=GC;ks.prototype.set=KC;function XC(){this.__data__=[],this.size=0}function fh(n,e){for(var t=n.length;t--;)if(dh(n[t][0],e))return t;return-1}var YC=Array.prototype,ZC=YC.splice;function JC(n){var e=this.__data__,t=fh(e,n);if(t<0)return!1;var r=e.length-1;return t==r?e.pop():ZC.call(e,t,1),--this.size,!0}function QC(n){var e=this.__data__,t=fh(e,n);return t<0?void 0:e[t][1]}function eS(n){return fh(this.__data__,n)>-1}function tS(n,e){var t=this.__data__,r=fh(t,n);return r<0?(++this.size,t.push([n,e])):t[r][1]=e,this}function jr(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}jr.prototype.clear=XC;jr.prototype.delete=JC;jr.prototype.get=QC;jr.prototype.has=eS;jr.prototype.set=tS;var _7=Mm(Rs,"Map");function nS(){this.size=0,this.__data__={hash:new ks,map:new(_7||jr),string:new ks}}function rS(n){var e=typeof n;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?n!=="__proto__":n===null}function ph(n,e){var t=n.__data__;return rS(e)?t[typeof e=="string"?"string":"hash"]:t.map}function iS(n){var e=ph(this,n).delete(n);return this.size-=e?1:0,e}function sS(n){return ph(this,n).get(n)}function oS(n){return ph(this,n).has(n)}function aS(n,e){var t=ph(this,n),r=t.size;return t.set(n,e),this.size+=t.size==r?0:1,this}function Vo(n){var e=-1,t=n==null?0:n.length;for(this.clear();++e<t;){var r=n[e];this.set(r[0],r[1])}}Vo.prototype.clear=nS;Vo.prototype.delete=iS;Vo.prototype.get=sS;Vo.prototype.has=oS;Vo.prototype.set=aS;var I7=DC(Object.getPrototypeOf,Object),lS="[object Object]",cS=Function.prototype,uS=Object.prototype,L7=cS.toString,hS=uS.hasOwnProperty,dS=L7.call(Object);function fS(n){if(!$o(n)||Jl(n)!=lS)return!1;var e=I7(n);if(e===null)return!0;var t=hS.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&L7.call(t)==dS}function pS(){this.__data__=new jr,this.size=0}function mS(n){var e=this.__data__,t=e.delete(n);return this.size=e.size,t}function gS(n){return this.__data__.get(n)}function vS(n){return this.__data__.has(n)}var yS=200;function bS(n,e){var t=this.__data__;if(t instanceof jr){var r=t.__data__;if(!_7||r.length<yS-1)return r.push([n,e]),this.size=++t.size,this;t=this.__data__=new Vo(r)}return t.set(n,e),this.size=t.size,this}function Wo(n){var e=this.__data__=new jr(n);this.size=e.size}Wo.prototype.clear=pS;Wo.prototype.delete=mS;Wo.prototype.get=gS;Wo.prototype.has=vS;Wo.prototype.set=bS;var B7=typeof exports=="object"&&exports&&!exports.nodeType&&exports,z2=B7&&typeof module=="object"&&module&&!module.nodeType&&module,wS=z2&&z2.exports===B7,N2=wS?Rs.Buffer:void 0;N2&&N2.allocUnsafe;function xS(n,e){return n.slice()}var H2=Rs.Uint8Array;function kS(n){var e=new n.constructor(n.byteLength);return new H2(e).set(new H2(n)),e}function CS(n,e){var t=kS(n.buffer);return new n.constructor(t,n.byteOffset,n.length)}function SS(n){return typeof n.constructor=="function"&&!k7(n)?Bk(I7(n)):{}}function AS(n){return function(e,t,r){for(var i=-1,s=Object(e),o=r(e),a=o.length;a--;){var l=o[++i];if(t(s[l],l,s)===!1)break}return e}}var MS=AS(),bd=function(){return Rs.Date.now()},TS="Expected a function",ES=Math.max,_S=Math.min;function mh(n,e,t){var r,i,s,o,a,l,c=0,u=!1,h=!1,d=!0;if(typeof n!="function")throw new TypeError(TS);e=E2(e)||0,dn(t)&&(u=!!t.leading,h="maxWait"in t,s=h?ES(E2(t.maxWait)||0,e):s,d="trailing"in t?!!t.trailing:d);function f(T){var O=r,L=i;return r=i=void 0,c=T,o=n.apply(L,O),o}function m(T){return c=T,a=setTimeout(b,e),u?f(T):o}function g(T){var O=T-l,L=T-c,B=e-O;return h?_S(B,s-L):B}function y(T){var O=T-l,L=T-c;return l===void 0||O>=e||O<0||h&&L>=s}function b(){var T=bd();if(y(T))return x(T);a=setTimeout(b,g(T))}function x(T){return a=void 0,d&&r?f(T):(r=i=void 0,o)}function C(){a!==void 0&&clearTimeout(a),c=0,r=l=i=a=void 0}function E(){return a===void 0?o:x(bd())}function S(){var T=bd(),O=y(T);if(r=arguments,i=this,l=T,O){if(a===void 0)return m(l);if(h)return clearTimeout(a),a=setTimeout(b,e),f(l)}return a===void 0&&(a=setTimeout(b,e)),o}return S.cancel=C,S.flush=E,S}function Mf(n,e,t){(t!==void 0&&!dh(n[e],t)||t===void 0&&!(e in n))&&Tm(n,e,t)}function IS(n){return $o(n)&&Em(n)}function Tf(n,e){if(!(e==="constructor"&&typeof n[e]=="function")&&e!="__proto__")return n[e]}function LS(n){return Gk(n,E7(n))}function BS(n,e,t,r,i,s,o){var a=Tf(n,t),l=Tf(e,t),c=o.get(l);if(c){Mf(n,t,c);return}var u=s?s(a,l,t+"",n,e,o):void 0,h=u===void 0;if(h){var d=Sf(l),f=!d&&A7(l),m=!d&&!f&&T7(l);u=l,d||f||m?Sf(a)?u=a:IS(a)?u=Dk(a):f?(h=!1,u=xS(l)):m?(h=!1,u=CS(l)):u=[]:fS(l)||Af(l)?(u=a,Af(a)?u=LS(a):(!dn(a)||Am(a))&&(u=SS(l))):h=!1}h&&(o.set(l,u),i(u,l,r,s,o),o.delete(l)),Mf(n,t,u)}function _m(n,e,t,r,i){n!==e&&MS(e,function(s,o){if(i||(i=new Wo),dn(s))BS(n,e,o,t,_m,r,i);else{var a=r?r(Tf(n,o),s,o+"",n,e,i):void 0;a===void 0&&(a=s),Mf(n,o,a)}},E7)}function D7(n,e,t,r,i,s){return dn(n)&&dn(e)&&(s.set(e,n),_m(n,e,void 0,D7,s),s.delete(e)),n}var DS=Yk(function(n,e,t,r){_m(n,e,t,r)}),OS=w7(function(n){return n.push(void 0,D7),y7(DS,void 0,n)}),PS="Expected a function";function gh(n,e,t){var r=!0,i=!0;if(typeof n!="function")throw new TypeError(PS);return dn(t)&&(r="leading"in t?!!t.leading:r,i="trailing"in t?!!t.trailing:i),mh(n,e,{leading:r,maxWait:e,trailing:i})}const RS="modulepreload",zS=function(n,e){return new URL(n,e).href},F2={},R=function(e,t,r){let i=Promise.resolve();if(t&&t.length>0){let c=function(u){return Promise.all(u.map(h=>Promise.resolve(h).then(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");i=c(t.map(u=>{if(u=zS(u,r),u in F2)return;F2[u]=!0;const h=u.endsWith(".css"),d=h?'[rel="stylesheet"]':"";if(r)for(let m=o.length-1;m>=0;m--){const g=o[m];if(g.href===u&&(!h||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${d}`))return;const f=document.createElement("link");if(f.rel=h?"stylesheet":RS,h||(f.as="script"),f.crossOrigin="",f.href=u,l&&f.setAttribute("nonce",l),document.head.appendChild(f),h)return new Promise((m,g)=>{f.addEventListener("load",m),f.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})},NS=1024;let HS=0,Sn=class{constructor(e,t){this.from=e,this.to=t}};class de{constructor(e={}){this.id=HS++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Wt.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}de.closedBy=new de({deserialize:n=>n.split(" ")});de.openedBy=new de({deserialize:n=>n.split(" ")});de.group=new de({deserialize:n=>n.split(" ")});de.isolate=new de({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});de.contextHash=new de({perNode:!0});de.lookAhead=new de({perNode:!0});de.mounted=new de({perNode:!0});class uo{constructor(e,t,r,i=!1){this.tree=e,this.overlay=t,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[de.mounted.id]}}const FS=Object.create(null);class Wt{constructor(e,t,r,i=0){this.name=e,this.props=t,this.id=r,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):FS,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Wt(e.name||"",t,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(de.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let i of r.split(" "))t[i]=e[r];return r=>{for(let i=r.prop(de.group),s=-1;s<(i?i.length:0);s++){let o=t[s<0?r.name:i[s]];if(o)return o}}}}Wt.none=new Wt("",Object.create(null),0,8);class Im{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let r of this.types){let i=null;for(let s of e){let o=s(r);if(o){i||(i=Object.assign({},r.props));let a=o[1],l=o[0];l.combine&&l.id in i&&(a=l.combine(i[l.id],a)),i[l.id]=a}}t.push(i?new Wt(r.name,i,r.id,r.flags):r)}return new Im(t)}}const B0=new WeakMap,q2=new WeakMap;var Ee;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(Ee||(Ee={}));class Oe{constructor(e,t,r,i,s){if(this.type=e,this.children=t,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,a]of s)this.props[typeof o=="number"?o:o.id]=a}}toString(){let e=uo.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let r of this.children){let i=r.toString();i&&(t&&(t+=","),t+=i)}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 Au(this.topNode,e)}cursorAt(e,t=0,r=0){let i=B0.get(this)||this.topNode,s=new Au(i);return s.moveTo(e,t),B0.set(this,s._tree),s}get topNode(){return new It(this,0,0,null)}resolve(e,t=0){let r=yl(B0.get(this)||this.topNode,e,t,!1);return B0.set(this,r),r}resolveInner(e,t=0){let r=yl(q2.get(this)||this.topNode,e,t,!0);return q2.set(this,r),r}resolveStack(e,t=0){return VS(this,e,t)}iterate(e){let{enter:t,leave:r,from:i=0,to:s=this.length}=e,o=e.mode||0,a=(o&Ee.IncludeAnonymous)>0;for(let l=this.cursor(o|Ee.IncludeAnonymous);;){let c=!1;if(l.from<=s&&l.to>=i&&(!a&&l.type.isAnonymous||t(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Dm(Wt.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,i)=>new Oe(this.type,t,r,i,this.propValues),e.makeTree||((t,r,i)=>new Oe(Wt.none,t,r,i)))}static build(e){return WS(e)}}Oe.empty=new Oe(Wt.none,[],[],0);class Lm{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 Lm(this.buffer,this.index)}}class Ci{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return Wt.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],r=this.buffer[e+3],i=this.set.types[t],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let o=[];for(;e<r;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,t,r,i,s){let{buffer:o}=this,a=-1;for(let l=e;l!=t&&!(O7(s,i,o[l+1],o[l+2])&&(a=l,r>0));l=o[l+3]);return a}slice(e,t,r){let i=this.buffer,s=new Uint16Array(t-e),o=0;for(let a=e,l=0;a<t;){s[l++]=i[a++],s[l++]=i[a++]-r;let c=s[l++]=i[a++]-r;s[l++]=i[a++]-e,o=Math.max(o,c)}return new Ci(s,o,this.set)}}function O7(n,e,t,r){switch(n){case-2:return t<e;case-1:return r>=e&&t<e;case 0:return t<e&&r>e;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function yl(n,e,t,r){for(var i;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let o=!r&&n instanceof It&&n.index<0?null:n.parent;if(!o)return n;n=o}let s=r?0:Ee.IgnoreOverlays;if(r)for(let o=n,a=o.parent;a;o=a,a=o.parent)o instanceof It&&o.index<0&&((i=a.enter(e,t,s))===null||i===void 0?void 0:i.from)!=o.from&&(n=a);for(;;){let o=n.enter(e,t,s);if(!o)return n;n=o}}class P7{cursor(e=0){return new Au(this,e)}getChild(e,t=null,r=null){let i=$2(this,e,t,r);return i.length?i[0]:null}getChildren(e,t=null,r=null){return $2(this,e,t,r)}resolve(e,t=0){return yl(this,e,t,!1)}resolveInner(e,t=0){return yl(this,e,t,!0)}matchContext(e){return Ef(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),r=this;for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(r=t,t=i.prevSibling):t=i}return r}get node(){return this}get next(){return this.parent}}class It extends P7{constructor(e,t,r,i){super(),this._tree=e,this.from=t,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,r,i,s=0){for(let o=this;;){for(let{children:a,positions:l}=o._tree,c=t>0?a.length:-1;e!=c;e+=t){let u=a[e],h=l[e]+o.from,d;if(!(!(s&Ee.EnterBracketed&&u instanceof Oe&&(d=uo.get(u))&&!d.overlay&&d.bracketed&&r>=h&&r<=h+u.length)&&!O7(i,r,h,h+u.length))){if(u instanceof Ci){if(s&Ee.ExcludeBuffers)continue;let f=u.findChild(0,u.buffer.length,t,r-h,i);if(f>-1)return new ar(new qS(o,u,e,h),null,f)}else if(s&Ee.IncludeAnonymous||!u.type.isAnonymous||Bm(u)){let f;if(!(s&Ee.IgnoreMounts)&&(f=uo.get(u))&&!f.overlay)return new It(f.tree,h,e,o);let m=new It(u,h,e,o);return s&Ee.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(t<0?u.children.length-1:0,t,r,i,s)}}}if(s&Ee.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))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)}prop(e){return this._tree.prop(e)}enter(e,t,r=0){let i;if(!(r&Ee.IgnoreOverlays)&&(i=uo.get(this._tree))&&i.overlay){let s=e-this.from,o=r&Ee.EnterBracketed&&i.bracketed;for(let{from:a,to:l}of i.overlay)if((t>0||o?a<=s:a<s)&&(t<0||o?l>=s:l>s))return new It(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}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 $2(n,e,t,r){let i=n.cursor(),s=[];if(!i.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=i.type.is(t),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function Ef(n,e,t=e.length-1){for(let r=n;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}class qS{constructor(e,t,r,i){this.parent=e,this.buffer=t,this.index=r,this.start=i}}class ar extends P7{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,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,r);return s<0?null:new ar(this.context,this,s)}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)}prop(e){return this.type.prop(e)}enter(e,t,r=0){if(r&Ee.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 ar(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 ar(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 ar(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let o=r.buffer[this.index+1];e.push(r.slice(i,s,o)),t.push(0)}return new Oe(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function R7(n){if(!n.length)return null;let e=0,t=n[0];for(let s=1;s<n.length;s++){let o=n[s];(o.from>t.from||o.to<t.to)&&(t=o,e=s)}let r=t instanceof It&&t.index<0?null:t.parent,i=n.slice();return r?i[e]=r:i.splice(e,1),new $S(i,t)}class $S{constructor(e,t){this.heads=e,this.node=t}get next(){return R7(this.heads)}}function VS(n,e,t){let r=n.resolveInner(e,t),i=null;for(let s=r instanceof It?r:r.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(i||(i=[r])).push(o.resolve(e,t)),s=o}else{let o=uo.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let a=new It(o.tree,o.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(yl(a,e,t,!1))}}return i?R7(i):r}class Au{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~Ee.EnterBracketed,e instanceof It)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.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):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof It?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}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,r=this.mode){return this.buffer?r&Ee.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ee.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ee.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)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:r}=i)}else({index:t,_parent:r}=this._tree);for(;r;{index:t,_parent:r}=r)if(t>-1)for(let s=t+e,o=e<0?-1:r._tree.children.length;s!=o;s+=e){let a=r._tree.children[s];if(this.mode&Ee.IncludeAnonymous||a instanceof Ci||!a.type.isAnonymous||Bm(a))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,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;t=o,r=s+1;break e}i=this.stack[--s]}for(let i=r;i<this.stack.length;i++)t=new ar(this.buffer,t,this.stack[i]);return this.bufferNode=new ar(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&t&&t(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return Ef(this.node.parent,e);let{buffer:t}=this.buffer,{types:r}=t.set;for(let i=e.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return Ef(this._tree,e,i);let o=r[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function Bm(n){return n.children.some(e=>e instanceof Ci||!e.type.isAnonymous||Bm(e))}function WS(n){var e;let{buffer:t,nodeSet:r,maxBufferLength:i=NS,reused:s=[],minRepeatType:o=r.types.length}=n,a=Array.isArray(t)?new Lm(t,t.length):t,l=r.types,c=0,u=0;function h(S,T,O,L,B,z){let{id:V,start:D,end:ee,size:J}=a,ie=u,he=c;if(J<0)if(a.next(),J==-1){let Ze=s[V];O.push(Ze),L.push(D-S);return}else if(J==-3){c=V;return}else if(J==-4){u=V;return}else throw new RangeError(`Unrecognized record size: ${J}`);let ke=l[V],we,be,Re=D-S;if(ee-D<=i&&(be=y(a.pos-T,B))){let Ze=new Uint16Array(be.size-be.skip),Je=a.pos-be.size,He=Ze.length;for(;a.pos>Je;)He=b(be.start,Ze,He);we=new Ci(Ze,ee-be.start,r),Re=be.start-S}else{let Ze=a.pos-J;a.next();let Je=[],He=[],Pt=V>=o?V:-1,gn=0,Mr=ee;for(;a.pos>Ze;)Pt>=0&&a.id==Pt&&a.size>=0?(a.end<=Mr-i&&(m(Je,He,D,gn,a.end,Mr,Pt,ie,he),gn=Je.length,Mr=a.end),a.next()):z>2500?d(D,Ze,Je,He):h(D,Ze,Je,He,Pt,z+1);if(Pt>=0&&gn>0&&gn<Je.length&&m(Je,He,D,gn,D,Mr,Pt,ie,he),Je.reverse(),He.reverse(),Pt>-1&&gn>0){let vn=f(ke,he);we=Dm(ke,Je,He,0,Je.length,0,ee-D,vn,vn)}else we=g(ke,Je,He,ee-D,ie-ee,he)}O.push(we),L.push(Re)}function d(S,T,O,L){let B=[],z=0,V=-1;for(;a.pos>T;){let{id:D,start:ee,end:J,size:ie}=a;if(ie>4)a.next();else{if(V>-1&&ee<V)break;V<0&&(V=J-i),B.push(D,ee,J),z++,a.next()}}if(z){let D=new Uint16Array(z*4),ee=B[B.length-2];for(let J=B.length-3,ie=0;J>=0;J-=3)D[ie++]=B[J],D[ie++]=B[J+1]-ee,D[ie++]=B[J+2]-ee,D[ie++]=ie;O.push(new Ci(D,B[2]-ee,r)),L.push(ee-S)}}function f(S,T){return(O,L,B)=>{let z=0,V=O.length-1,D,ee;if(V>=0&&(D=O[V])instanceof Oe){if(!V&&D.type==S&&D.length==B)return D;(ee=D.prop(de.lookAhead))&&(z=L[V]+D.length+ee)}return g(S,O,L,B,z,T)}}function m(S,T,O,L,B,z,V,D,ee){let J=[],ie=[];for(;S.length>L;)J.push(S.pop()),ie.push(T.pop()+O-B);S.push(g(r.types[V],J,ie,z-B,D-z,ee)),T.push(B-O)}function g(S,T,O,L,B,z,V){if(z){let D=[de.contextHash,z];V=V?[D].concat(V):[D]}if(B>25){let D=[de.lookAhead,B];V=V?[D].concat(V):[D]}return new Oe(S,T,O,L,V)}function y(S,T){let O=a.fork(),L=0,B=0,z=0,V=O.end-i,D={size:0,start:0,skip:0};e:for(let ee=O.pos-S;O.pos>ee;){let J=O.size;if(O.id==T&&J>=0){D.size=L,D.start=B,D.skip=z,z+=4,L+=4,O.next();continue}let ie=O.pos-J;if(J<0||ie<ee||O.start<V)break;let he=O.id>=o?4:0,ke=O.start;for(O.next();O.pos>ie;){if(O.size<0)if(O.size==-3||O.size==-4)he+=4;else break e;else O.id>=o&&(he+=4);O.next()}B=ke,L+=J,z+=he}return(T<0||L==S)&&(D.size=L,D.start=B,D.skip=z),D.size>4?D:void 0}function b(S,T,O){let{id:L,start:B,end:z,size:V}=a;if(a.next(),V>=0&&L<o){let D=O;if(V>4){let ee=a.pos-(V-4);for(;a.pos>ee;)O=b(S,T,O)}T[--O]=D,T[--O]=z-S,T[--O]=B-S,T[--O]=L}else V==-3?c=L:V==-4&&(u=L);return O}let x=[],C=[];for(;a.pos>0;)h(n.start||0,n.bufferStart||0,x,C,-1,0);let E=(e=n.length)!==null&&e!==void 0?e:x.length?C[0]+x[0].length:0;return new Oe(l[n.topID],x.reverse(),C.reverse(),E)}const V2=new WeakMap;function xc(n,e){if(!n.isAnonymous||e instanceof Ci||e.type!=n)return 1;let t=V2.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=n||!(r instanceof Oe)){t=1;break}t+=xc(n,r)}V2.set(e,t)}return t}function Dm(n,e,t,r,i,s,o,a,l){let c=0;for(let m=r;m<i;m++)c+=xc(n,e[m]);let u=Math.ceil(c*1.5/8),h=[],d=[];function f(m,g,y,b,x){for(let C=y;C<b;){let E=C,S=g[C],T=xc(n,m[C]);for(C++;C<b;C++){let O=xc(n,m[C]);if(T+O>=u)break;T+=O}if(C==E+1){if(T>u){let O=m[E];f(O.children,O.positions,0,O.children.length,g[E]+x);continue}h.push(m[E])}else{let O=g[C-1]+m[C-1].length-S;h.push(Dm(n,m,g,E,C,S,O,null,l))}d.push(S+x-s)}}return f(e,t,r,i,0),(a||l)(h,d,o)}class Vq{constructor(){this.map=new WeakMap}setBuffer(e,t,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,r)}getBuffer(e,t){let r=this.map.get(e);return r&&r.get(t)}set(e,t){e instanceof ar?this.setBuffer(e.context.buffer,e.index,t):e instanceof It&&this.map.set(e.tree,t)}get(e){return e instanceof ar?this.getBuffer(e.context.buffer,e.index):e instanceof It?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 zr{constructor(e,t,r,i,s=!1,o=!1){this.from=e,this.to=t,this.tree=r,this.offset=i,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let i=[new zr(0,e.length,e,0,!1,r)];for(let s of t)s.to>e.length&&i.push(s);return i}static applyChanges(e,t,r=128){if(!t.length)return e;let i=[],s=1,o=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a<t.length?t[a]:null,h=u?u.fromA:1e9;if(h-l>=r)for(;o&&o.from<h;){let d=o;if(l>=d.from||h<=d.to||c){let f=Math.max(d.from,l)-c,m=Math.min(d.to,h)-c;d=f>=m?null:new zr(f,m,d.tree,d.offset+c,a>0,!!u)}if(d&&i.push(d),o.to>h)break;o=s<e.length?e[s++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}let z7=class{startParse(e,t,r){return typeof e=="string"&&(e=new jS(e)),r=r?r.length?r.map(i=>new Sn(i.from,i.to)):[new Sn(0,0)]:[new Sn(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let i=this.startParse(e,t,r);for(;;){let s=i.advance();if(s)return s}}};class jS{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 jq(n){return(e,t,r,i)=>new US(e,n,t,r,i)}class W2{constructor(e,t,r,i,s,o){this.parser=e,this.parse=t,this.overlay=r,this.bracketed=i,this.target=s,this.from=o}}function j2(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class GS{constructor(e,t,r,i,s,o,a,l){this.parser=e,this.predicate=t,this.mounts=r,this.index=i,this.start=s,this.bracketed=o,this.target=a,this.prev=l,this.depth=0,this.ranges=[]}}const _f=new de({perNode:!0});class US{constructor(e,t,r,i,s){this.nest=t,this.input=r,this.fragments=i,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new Oe(r.type,r.children,r.positions,r.length,r.propValues.concat([[_f,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[de.mounted.id]=new uo(t,e.overlay,e.parser,e.bracketed),e.target.props=r}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 YS(this.fragments),t=null,r=null,i=new Au(new It(this.baseTree,this.ranges[0].from,0,null),Ee.IncludeAnonymous|Ee.IgnoreMounts);e:for(let s,o;;){let a=!0,l;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)a=!1;else if(e.hasNode(i)){if(t){let c=t.mounts.find(u=>u.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let h=u.from+c.pos,d=u.to+c.pos;h>=i.from&&d<=i.to&&!t.ranges.some(f=>f.from<d&&f.to>h)&&t.ranges.push({from:h,to:d})}}a=!1}else if(r&&(o=KS(r.ranges,i.from,i.to)))a=o!=2;else if(!i.type.isAnonymous&&(s=this.nest(i,this.input))&&(i.from<i.to||!s.overlay)){i.tree||(XS(i),t&&t.depth++,r&&r.depth++);let c=e.findMounts(i.from,s.parser);if(typeof s.overlay=="function")t=new GS(s.parser,s.overlay,c,this.inner.length,i.from,!!s.bracketed,i.tree,t);else{let u=K2(this.ranges,s.overlay||(i.from<i.to?[new Sn(i.from,i.to)]:[]));u.length&&j2(u),(u.length||!s.overlay)&&this.inner.push(new W2(s.parser,u.length?s.parser.startParse(this.input,X2(c,u),u):s.parser.startParse(""),s.overlay?s.overlay.map(h=>new Sn(h.from-i.from,h.to-i.from)):null,!!s.bracketed,i.tree,u.length?u[0].from:i.from)),s.overlay?u.length&&(r={ranges:u,depth:0,prev:r}):a=!1}}else if(t&&(l=t.predicate(i))&&(l===!0&&(l=new Sn(i.from,i.to)),l.from<l.to)){let c=t.ranges.length-1;c>=0&&t.ranges[c].to==l.from?t.ranges[c]={from:t.ranges[c].from,to:l.to}:t.ranges.push(l)}if(a&&i.firstChild())t&&t.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(t&&!--t.depth){let c=K2(this.ranges,t.ranges);c.length&&(j2(c),this.inner.splice(t.index,0,new W2(t.parser,t.parser.startParse(this.input,X2(t.mounts,c),c),t.ranges.map(u=>new Sn(u.from-t.start,u.to-t.start)),t.bracketed,t.target,c[0].from))),t=t.prev}r&&!--r.depth&&(r=r.prev)}}}}function KS(n,e,t){for(let r of n){if(r.from>=t)break;if(r.to>e)return r.from<=e&&r.to>=t?2:1}return 0}function G2(n,e,t,r,i,s){if(e<t){let o=n.buffer[e+1];r.push(n.slice(e,t,o)),i.push(o-s)}}function XS(n){let{node:e}=n,t=[],r=e.context.buffer;do t.push(n.index),n.parent();while(!n.tree);let i=n.tree,s=i.children.indexOf(r),o=i.children[s],a=o.buffer,l=[s];function c(u,h,d,f,m,g){let y=t[g],b=[],x=[];G2(o,u,y,b,x,f);let C=a[y+1],E=a[y+2];l.push(b.length);let S=g?c(y+4,a[y+3],o.set.types[a[y]],C,E-C,g-1):e.toTree();return b.push(S),x.push(C-f),G2(o,a[y+3],h,b,x,f),new Oe(d,b,x,m)}i.children[s]=c(0,a.length,Wt.none,0,o.length,t.length-1);for(let u of l){let h=n.tree.children[u],d=n.tree.positions[u];n.yield(new It(h,d+n.from,u,n._tree))}}class U2{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(Ee.IncludeAnonymous|Ee.IgnoreMounts|Ee.ExcludeBuffers)}moveTo(e){let{cursor:t}=this,r=e-this.offset;for(;!this.done&&t.from<r;)if(!(t.to>=r&&t.enter(r,1,Ee.IncludeAnonymous|Ee.IgnoreOverlays|Ee.ExcludeBuffers)))if(t.to<=r)t.next(!1)||(this.done=!0);else break}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;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof Oe)t=t.children[0];else break}return!1}}class YS{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(t=r.tree.prop(_f))!==null&&t!==void 0?t:r.to,this.inner=new U2(r.tree,-r.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=(e=t.tree.prop(_f))!==null&&e!==void 0?e:t.to,this.inner=new U2(t.tree,-t.offset)}}findMounts(e,t){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(r=s.tree)===null||r===void 0?void 0:r.prop(de.mounted);if(o&&o.parser==t)for(let a=this.fragI;a<this.fragments.length;a++){let l=this.fragments[a];if(l.from>=s.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:s.from-l.offset,mount:o})}}}return i}}function K2(n,e){let t=null,r=e;for(let i=1,s=0;i<n.length;i++){let o=n[i-1].to,a=n[i].from;for(;s<r.length;s++){let l=r[s];if(l.from>=a)break;l.to<=o||(t||(r=t=e.slice()),l.from<o?(t[s]=new Sn(l.from,o),l.to>a&&t.splice(s+1,0,new Sn(a,l.to))):l.to>a?t[s--]=new Sn(a,l.to):t.splice(s--,1))}}return r}function ZS(n,e,t,r){let i=0,s=0,o=!1,a=!1,l=-1e9,c=[];for(;;){let u=i==n.length?1e9:o?n[i].to:n[i].from,h=s==e.length?1e9:a?e[s].to:e[s].from;if(o!=a){let d=Math.max(l,t),f=Math.min(u,h,r);d<f&&c.push(new Sn(d,f))}if(l=Math.min(u,h),l==1e9)break;u==l&&(o?(o=!1,i++):o=!0),h==l&&(a?(a=!1,s++):a=!0)}return c}function X2(n,e){let t=[];for(let{pos:r,mount:i,frag:s}of n){let o=r+(i.overlay?i.overlay[0].from:0),a=o+i.tree.length,l=Math.max(s.from,o),c=Math.min(s.to,a);if(i.overlay){let u=i.overlay.map(d=>new Sn(d.from+r,d.to+r)),h=ZS(e,u,l,c);for(let d=0,f=l;;d++){let m=d==h.length,g=m?c:h[d].from;if(g>f&&t.push(new zr(f,g,i.tree,-o,s.from>=f||s.openStart,s.to<=g||s.openEnd)),m)break;f=h[d].to}}else t.push(new zr(l,c,i.tree,-o,s.from>=o||s.openStart,s.to<=a||s.openEnd))}return t}let If=[],N7=[];(()=>{let n="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,1n,9,16,o,,x,1i,3,,i,,7,a,2,t,3,1k,,,7,2,2,2,3,9,,a,2,q,,2,3,1k,,,5,4,2,2,3,3,,u,2,3,,b,3,1k,,,8,,3,,3,k,2,m,6,,3,1k,,,7,2,2,2,3,7,3,a,2,u,,1n,5,3,3,,4,9,,14,5,1j,,,7,,3,,4,7,2,b,2,t,3,1k,,,7,,3,,4,7,2,b,2,f,,c,4,1j,2,,7,,3,,4,9,,a,2,t,3,1y,,4,6,,,,8,i,2,1p,,,8,c,8,2q,,,a,b,7,21,2,r,,,,,,4,2,1d,k,,2,5,b,,10,9,,2u,b,,6,n,4,4,3,g,4,d,,,3,6,,f,,jj,3,qa,4,s,3,t,2,u,2,1s,w,9,,19,3,,,39,2,y,,3a,c,4,c,63,5,1l,a,,,,,2,o,2,,1c,1a,2,c,k,5,1b,h,12,9,c,3,u,d,1k,e,1c,k,48,3,,l,4,,6,,2,3,5i,1s,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,n,5,4,,2b,2,1e,i,q,i,d,,12,8,p,d,18,4,1b,e,10,,1v,e,c,,8,2,1a,,1f,,,3,2,2,5,2,,,15,5,5,2,6k,8,,2,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,1t,5,8t,2,25,6,1y,b,1d,4,3e,3,1h,f,15,,2,2,a,4,19,b,7,,1p,3,10,e,g,2,18,,c,3,1c,e,8,4,,2,2k,c,6,,2,,4d,c,l,4,1j,2,,7,2,2,2,3,9,,a,2,2,7,3,5,1v,9,,,2,,,4,,5,,,e,2,2a,i,n,,29,k,6j,7,2,9,r,2,2a,h,2y,d,2t,3,2,a,74,f,6t,6,,2,2,4,,,,2,3x,7,2,7,3,,s,a,14,7,,4,8,,9,b,1a,g,5i,8,5j,8,,8,2a,m,,e,3e,6,3,,,2,,7,,,1u,5,,2,,5,9n,4,9,2,,,1c,7,3,5,n,,44l,,6,f,8ug,i,1xc,5,1n,7,t4,,,1j,7,4,29,,b,2,f57,2,3mp,1a,2,n,f2,5,3,6,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,2s,,4g,7,af,,1p,4,e4,4,72,2,6r,,2,,7,2,5,,d6,7,31,7,240,5".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?N7:If).push(t=t+n[e])})();function JS(n){if(n<768)return!1;for(let e=0,t=If.length;;){let r=e+t>>1;if(n<If[r])t=r;else if(n>=N7[r])e=r+1;else return!0;if(e==t)return!1}}function Y2(n){return n>=127462&&n<=127487}const Z2=8205;function QS(n,e,t=!0,r=!0){return(t?H7:eA)(n,e,r)}function H7(n,e,t){if(e==n.length)return e;e&&F7(n.charCodeAt(e))&&q7(n.charCodeAt(e-1))&&e--;let r=wd(n,e);for(e+=J2(r);e<n.length;){let i=wd(n,e);if(r==Z2||i==Z2||t&&JS(i))e+=J2(i),r=i;else if(Y2(i)){let s=0,o=e-2;for(;o>=0&&Y2(wd(n,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function eA(n,e,t){for(;e>1;){let r=H7(n,e-2,t);if(r<e)return r;e--}return 0}function wd(n,e){let t=n.charCodeAt(e);if(!q7(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return F7(r)?(t-55296<<10)+(r-56320)+65536:t}function F7(n){return n>=56320&&n<57344}function q7(n){return n>=55296&&n<56320}function J2(n){return n<65536?1:2}class ye{lineAt(e){if(e<0||e>this.length)throw new 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 new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,r){[e,t]=ko(this,e,t);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(t,this.length,i,1),kc.from(i,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=ko(this,e,t);let r=[];return this.decompose(e,t,r,0),kc.from(r,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new al(this),s=new al(e);for(let o=t,a=t;;){if(i.next(o),s.next(o),o=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new al(this,e)}iterRange(e,t=this.length){return new $7(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new V7(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?ye.empty:e.length<=32?new et(e):kc.from(et.split(e,[]))}}class et extends ye{constructor(e,t=tA(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,i){for(let s=0;;s++){let o=this.text[s],a=i+o.length;if((t?r:a)>=e)return new nA(i,a,r,o);i=a+1,r++}}decompose(e,t,r,i){let s=e<=0&&t>=this.length?this:new et(Q2(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),a=Cc(s.text,o.text.slice(),0,s.length);if(a.length<=32)r.push(new et(a,o.length+s.length));else{let l=a.length>>1;r.push(new et(a.slice(0,l)),new et(a.slice(l)))}}else r.push(s)}replace(e,t,r){if(!(r instanceof et))return super.replace(e,t,r);[e,t]=ko(this,e,t);let i=Cc(this.text,Cc(r.text,Q2(this.text,0,e)),t),s=this.length+r.length-(t-e);return i.length<=32?new et(i,s):kc.from(et.split(i,[]),s)}sliceString(e,t=this.length,r=`
|
|
3
3
|
`){[e,t]=ko(this,e,t);let i="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let a=this.text[o],l=s+a.length;s>e&&o&&(i+=r),e<l&&t>s&&(i+=a.slice(Math.max(0,e-s),t-s)),s=l+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(t.push(new et(r,i)),r=[],i=-1);return i>-1&&t.push(new et(r,i)),t}}let kc=class Ks extends ye{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,i){for(let s=0;;s++){let o=this.children[s],a=i+o.length,l=r+o.lines-1;if((t?l:a)>=e)return o.lineInner(e,t,r,i);i=a+1,r=l+1}}decompose(e,t,r,i){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let a=this.children[s],l=o+a.length;if(e<=l&&t>=o){let c=i&((o<=e?1:0)|(l>=t?2:0));o>=e&&l<=t&&!c?r.push(a):a.decompose(e-o,t-o,r,c)}o=l+1}}replace(e,t,r){if([e,t]=ko(this,e,t),r.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let o=this.children[i],a=s+o.length;if(e>=s&&t<=a){let l=o.replace(e-s,t-s,r),c=this.lines-o.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new Ks(u,this.length-(t-e)+r.length)}return super.replace(s,a,l)}s=a+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=`
|
|
4
4
|
`){[e,t]=ko(this,e,t);let i="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let a=this.children[s],l=o+a.length;o>e&&s&&(i+=r),e<l&&t>o&&(i+=a.sliceString(e-o,t-o,r)),o=l+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ks))return 0;let r=0,[i,s,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,s+=t){if(i==o||s==a)return r;let l=this.children[i],c=e.children[s];if(l!=c)return r+l.scanIdentical(c,t);r+=l.length+1}}static from(e,t=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let f of e)r+=f.lines;if(r<32){let f=[];for(let m of e)m.flatten(f);return new et(f,t)}let i=Math.max(32,r>>5),s=i<<1,o=i>>1,a=[],l=0,c=-1,u=[];function h(f){let m;if(f.lines>s&&f instanceof Ks)for(let g of f.children)h(g);else f.lines>o&&(l>o||!l)?(d(),a.push(f)):f instanceof et&&l&&(m=u[u.length-1])instanceof et&&f.lines+m.lines<=32?(l+=f.lines,c+=f.length+1,u[u.length-1]=new et(m.text.concat(f.text),m.length+1+f.length)):(l+f.lines>i&&d(),l+=f.lines,c+=f.length+1,u.push(f))}function d(){l!=0&&(a.push(u.length==1?u[0]:Ks.from(u,c)),c=-1,l=u.length=0)}for(let f of e)h(f);return d(),a.length==1?a[0]:new Ks(a,t)}};ye.empty=new et([""],0);function tA(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Cc(n,e,t=0,r=1e9){for(let i=0,s=0,o=!0;s<n.length&&i<=r;s++){let a=n[s],l=i+a.length;l>=t&&(l>r&&(a=a.slice(0,r-i)),i<t&&(a=a.slice(t-i)),o?(e[e.length-1]+=a,o=!1):e.push(a)),i=l+1}return e}function Q2(n,e,t){return Cc(n,[""],e,t)}class al{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 et?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],o=s>>1,a=i instanceof et?i.text.length:i.children.length;if(o==(t>0?a:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
5
5
|
`,this;e--}else if(i instanceof et){let l=i.text[o+(t<0?-1:0)];if(this.offsets[r]+=t,l.length>Math.max(0,e))return this.value=e==0?l:t>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[o+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof et?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class $7{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new al(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}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 r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=r?i:t<0?i.slice(i.length-r):i.slice(0,r),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 V7{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(ye.prototype[Symbol.iterator]=function(){return this.iter()},al.prototype[Symbol.iterator]=$7.prototype[Symbol.iterator]=V7.prototype[Symbol.iterator]=function(){return this});class nA{constructor(e,t,r,i){this.from=e,this.to=t,this.number=r,this.text=i}get length(){return this.to-this.from}}function ko(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function yt(n,e,t=!0,r=!0){return QS(n,e,t,r)}function rA(n){return n>=56320&&n<57344}function iA(n){return n>=55296&&n<56320}function Xt(n,e){let t=n.charCodeAt(e);if(!iA(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return rA(r)?(t-55296<<10)+(r-56320)+65536:t}function Om(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function sr(n){return n<65536?1:2}const Lf=/\r\n?|\n/;var St=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(St||(St={}));class dr{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 r=this.sections[t+1];e+=r<0?this.sections[t]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,r=0,i=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(r,i,s),i+=s):i+=o,r+=s}}iterChangedRanges(e,t=!1){Bf(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let r=this.sections[t++],i=this.sections[t++];i<0?e.push(r,i):e.push(i,r)}return new dr(e)}composeDesc(e){return this.empty?e:e.empty?this:W7(this,e)}mapDesc(e,t=!1){return e.empty?this:Df(this,e,t)}mapPos(e,t=-1,r=St.Simple){let i=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],l=this.sections[o++],c=i+a;if(l<0){if(c>e)return s+(e-i);s+=a}else{if(r!=St.Simple&&c>=e&&(r==St.TrackDel&&i<e&&c>e||r==St.TrackBefore&&i<e||r==St.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!a)return e==i||t<0?s:s+l;s+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,t=e){for(let r=0,i=0;r<this.sections.length&&i<=t;){let s=this.sections[r++],o=this.sections[r++],a=i+s;if(o>=0&&i<=t&&a>=e)return i<e&&a>t?"cover":!0;i=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let r=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new dr(e)}static create(e){return new dr(e)}}let Wn=class ni extends dr{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Bf(this,(t,r,i,s,o)=>e=e.replace(i,i+(r-t),o),!1),e}mapDesc(e,t=!1){return Df(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let i=0,s=0;i<t.length;i+=2){let o=t[i],a=t[i+1];if(a>=0){t[i]=a,t[i+1]=o;let l=i>>1;for(;r.length<l;)r.push(ye.empty);r.push(o?e.slice(s,s+o):ye.empty)}s+=o}return new ni(t,r)}compose(e){return this.empty?e:e.empty?this:W7(this,e,!0)}map(e,t=!1){return e.empty?this:Df(this,e,t,!0)}iterChanges(e,t=!1){Bf(this,e,t)}get desc(){return dr.create(this.sections)}filter(e){let t=[],r=[],i=[],s=new bl(this);e:for(let o=0,a=0;;){let l=o==e.length?1e9:e[o++];for(;a<l||a==l&&s.len==0;){if(s.done)break e;let u=Math.min(s.len,l-a);_t(i,u,-1);let h=s.ins==-1?-1:s.off==0?s.ins:0;_t(t,u,h),h>0&&vi(r,t,s.text),s.forward(u),a+=u}let c=e[o++];for(;a<c;){if(s.done)break e;let u=Math.min(s.len,c-a);_t(t,u,-1),_t(i,u,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(u),a+=u}}return{changes:new ni(t,r),filtered:dr.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t],i=this.sections[t+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,r){let i=[],s=[],o=0,a=null;function l(u=!1){if(!u&&!i.length)return;o<t&&_t(i,t-o,-1);let h=new ni(i,s);a=a?a.compose(h.map(a)):h,i=[],s=[],o=0}function c(u){if(Array.isArray(u))for(let h of u)c(h);else if(u instanceof ni){if(u.length!=t)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${t})`);l(),a=a?a.compose(u.map(a)):u}else{let{from:h,to:d=h,insert:f}=u;if(h>d||h<0||d>t)throw new RangeError(`Invalid change range ${h} to ${d} (in doc of length ${t})`);let m=f?typeof f=="string"?ye.of(f.split(r||Lf)):f:ye.empty,g=m.length;if(h==d&&g==0)return;h<o&&l(),h>o&&_t(i,h-o,-1),_t(i,d-h,g),vi(s,i,m),o=d}}return c(e),l(!a),a}static empty(e){return new ni(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,a)=>a&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;r.length<i;)r.push(ye.empty);r[i]=ye.of(s.slice(1)),t.push(s[0],r[i].length)}}}return new ni(t,r)}static createSet(e,t){return new ni(e,t)}};function _t(n,e,t,r=!1){if(e==0&&t<=0)return;let i=n.length-2;i>=0&&t<=0&&t==n[i+1]?n[i]+=e:i>=0&&e==0&&n[i]==0?n[i+1]+=t:r?(n[i]+=e,n[i+1]+=t):n.push(e,t)}function vi(n,e,t){if(t.length==0)return;let r=e.length-2>>1;if(r<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<r;)n.push(ye.empty);n.push(t)}}function Bf(n,e,t){let r=n.inserted;for(let i=0,s=0,o=0;o<n.sections.length;){let a=n.sections[o++],l=n.sections[o++];if(l<0)i+=a,s+=a;else{let c=i,u=s,h=ye.empty;for(;c+=a,u+=l,l&&r&&(h=h.append(r[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)a=n.sections[o++],l=n.sections[o++];e(i,c,s,u,h),i=c,s=u}}}function Df(n,e,t,r=!1){let i=[],s=r?[]:null,o=new bl(n),a=new bl(e);for(let l=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&a.ins==-1){let c=Math.min(o.len,a.len);_t(i,c,-1),o.forward(c),a.forward(c)}else if(a.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(a.len<o.len||a.len==o.len&&!t))){let c=a.len;for(_t(i,a.ins,-1);c;){let u=Math.min(o.len,c);o.ins>=0&&l<o.i&&o.len<=u&&(_t(i,0,o.ins),s&&vi(s,i,o.text),l=o.i),o.forward(u),c-=u}a.next()}else if(o.ins>=0){let c=0,u=o.len;for(;u;)if(a.ins==-1){let h=Math.min(u,a.len);c+=h,u-=h,a.forward(h)}else if(a.ins==0&&a.len<u)u-=a.len,a.next();else break;_t(i,c,l<o.i?o.ins:0),s&&l<o.i&&vi(s,i,o.text),l=o.i,o.forward(o.len-u)}else{if(o.done&&a.done)return s?Wn.createSet(i,s):dr.create(i);throw new Error("Mismatched change set lengths")}}}function W7(n,e,t=!1){let r=[],i=t?[]:null,s=new bl(n),o=new bl(e);for(let a=!1;;){if(s.done&&o.done)return i?Wn.createSet(r,i):dr.create(r);if(s.ins==0)_t(r,s.len,0,a),s.next();else if(o.len==0&&!o.done)_t(r,0,o.ins,a),i&&vi(i,r,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let l=Math.min(s.len2,o.len),c=r.length;if(s.ins==-1){let u=o.ins==-1?-1:o.off?0:o.ins;_t(r,l,u,a),i&&u&&vi(i,r,o.text)}else o.ins==-1?(_t(r,s.off?0:s.len,l,a),i&&vi(i,r,s.textBit(l))):(_t(r,s.off?0:s.len,o.off?0:o.ins,a),i&&!o.off&&vi(i,r,o.text));a=(s.ins>l||o.ins>=0&&o.len>l)&&(a||r.length>c),s.forward2(l),o.forward(l)}}}}class bl{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 this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?ye.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?ye.empty:t[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class di{constructor(e,t,r,i){this.from=e,this.to=t,this.flags=r,this.goalColumn=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,t=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,t):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new di(r,i,this.flags,this.goalColumn)}extend(e,t=e,r=0){if(e<=this.anchor&&t>=this.anchor)return N.range(e,t,void 0,void 0,r);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return N.range(this.anchor,i,void 0,void 0,r)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return N.range(e.anchor,e.head)}static create(e,t,r,i){return new di(e,t,r,i)}}class N{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:N.create(this.ranges.map(r=>r.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new N([this.main],0)}addRange(e,t=!0){return N.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let r=this.ranges.slice();return r[t]=e,N.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new N(e.ranges.map(t=>di.fromJSON(t)),e.main)}static single(e,t=e){return new N([N.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=r:s.from<r)return N.normalized(e.slice(),t);r=s.to}return new N(e,t)}static cursor(e,t=0,r,i){return di.create(e,e,(t==0?0:t<0?8:16)|(r==null?7:Math.min(6,r)),i)}static range(e,t,r,i,s){let o=i==null?7:Math.min(6,i);return!s&&e!=t&&(s=t<e?1:-1),s&&(o|=s<0?8:16),t<e?di.create(t,e,o|32,r):di.create(e,t,o,r)}static undirectionalRange(e,t){return di.create(e,t,64,void 0)}static normalized(e,t=0){let r=e[t];e.sort((i,s)=>i.from-s.from),t=e.indexOf(r);for(let i=1;i<e.length;i++){let s=e[i],o=e[i-1];if(s.empty?s.from<=o.to:s.from<o.to){let a=o.from,l=Math.max(s.to,o.to);i<=t&&t--,e.splice(--i,2,s.anchor>s.head?N.range(l,a):N.range(a,l))}}return new N(e,t)}}function j7(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Pm=0;class X{constructor(e,t,r,i,s){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=i,this.id=Pm++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new X(e.combine||(t=>t),e.compareInput||((t,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:Rm),!!e.static,e.enables)}of(e){return new Sc([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Sc(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Sc(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}}function Rm(n,e){return n==e||n.length==e.length&&n.every((t,r)=>t===e[r])}class Sc{constructor(e,t,r,i){this.dependencies=e,this.facet=t,this.type=r,this.value=i,this.id=Pm++}dynamicSlot(e){var t;let r=this.value,i=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let h of this.dependencies)h=="doc"?l=!0:h=="selection"?c=!0:(((t=e[h.id])!==null&&t!==void 0?t:1)&1)==0&&u.push(e[h.id]);return{create(h){return h.values[o]=r(h),1},update(h,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||Of(h,u)){let f=r(h);if(a?!e4(f,h.values[o],i):!i(f,h.values[o]))return h.values[o]=f,1}return 0},reconfigure:(h,d)=>{let f,m=d.config.address[s];if(m!=null){let g=Tu(d,m);if(this.dependencies.every(y=>y instanceof X?d.facet(y)===h.facet(y):y instanceof Tt?d.field(y,!1)==h.field(y,!1):!0)||(a?e4(f=r(h),g,i):i(f=r(h),g)))return h.values[o]=g,0}else f=r(h);return h.values[o]=f,1}}}get extension(){return this}}function e4(n,e,t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!t(n[r],e[r]))return!1;return!0}function Of(n,e){let t=!1;for(let r of e)ll(n,r)&1&&(t=!0);return t}function sA(n,e,t){let r=t.map(l=>n[l.id]),i=t.map(l=>l.type),s=r.filter(l=>!(l&1)),o=n[e.id]>>1;function a(l){let c=[];for(let u=0;u<r.length;u++){let h=Tu(l,r[u]);if(i[u]==2)for(let d of h)c.push(d);else c.push(h)}return e.combine(c)}return{create(l){for(let c of r)ll(l,c);return l.values[o]=a(l),1},update(l,c){if(!Of(l,s))return 0;let u=a(l);return e.compare(u,l.values[o])?0:(l.values[o]=u,1)},reconfigure(l,c){let u=Of(l,r),h=c.config.facets[e.id],d=c.facet(e);if(h&&!u&&Rm(t,h))return l.values[o]=d,0;let f=a(l);return e.compare(f,d)?(l.values[o]=d,0):(l.values[o]=f,1)}}}const D0=X.define({static:!0});class Tt{constructor(e,t,r,i,s){this.id=e,this.createF=t,this.updateF=r,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let t=new Tt(Pm++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(D0).find(r=>r.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:r=>(r.values[t]=this.create(r),1),update:(r,i)=>{let s=r.values[t],o=this.updateF(s,i);return this.compareF(s,o)?0:(r.values[t]=o,1)},reconfigure:(r,i)=>{let s=r.facet(D0),o=i.facet(D0),a;return(a=s.find(l=>l.field==this))&&a!=o.find(l=>l.field==this)?(r.values[t]=a.create(r),1):i.config.address[this.id]!=null?(r.values[t]=i.field(this),0):(r.values[t]=this.create(r),1)}}}init(e){return[this,D0.of({field:this,create:e})]}get extension(){return this}}const os={lowest:4,low:3,default:2,high:1,highest:0};function wa(n){return e=>new G7(e,n)}const Pi={highest:wa(os.highest),high:wa(os.high),default:wa(os.default),low:wa(os.low),lowest:wa(os.lowest)};class G7{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}}class Co{of(e){return new Pf(this,e)}reconfigure(e){return Co.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Pf{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}}class Mu{constructor(e,t,r,i,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,r){let i=[],s=Object.create(null),o=new Map;for(let d of oA(e,t,o))d instanceof Tt?i.push(d):(s[d.facet.id]||(s[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],c=[];for(let d of i)a[d.id]=c.length<<1,c.push(f=>d.slot(f));let u=r?.config.facets;for(let d in s){let f=s[d],m=f[0].facet,g=u&&u[d]||[];if(f.every(y=>y.type==0))if(a[m.id]=l.length<<1|1,Rm(g,f))l.push(r.facet(m));else{let y=m.combine(f.map(b=>b.value));l.push(r&&m.compare(y,r.facet(m))?r.facet(m):y)}else{for(let y of f)y.type==0?(a[y.id]=l.length<<1|1,l.push(y.value)):(a[y.id]=c.length<<1,c.push(b=>y.dynamicSlot(b)));a[m.id]=c.length<<1,c.push(y=>sA(y,m,f))}}let h=c.map(d=>d(a));return new Mu(e,o,h,a,l,s)}}function oA(n,e,t){let r=[[],[],[],[],[]],i=new Map;function s(o,a){let l=i.get(o);if(l!=null){if(l<=a)return;let c=r[l].indexOf(o);c>-1&&r[l].splice(c,1),o instanceof Pf&&t.delete(o.compartment)}if(i.set(o,a),Array.isArray(o))for(let c of o)s(c,a);else if(o instanceof Pf){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;t.set(o.compartment,c),s(c,a)}else if(o instanceof G7)s(o.inner,o.prec);else if(o instanceof Tt)r[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof Sc)r[a].push(o),o.facet.extensions&&s(o.facet.extensions,os.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(c==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,a)}}return s(n,os.default),r.reduce((o,a)=>o.concat(a))}function ll(n,e){if(e&1)return 2;let t=e>>1,r=n.status[t];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;n.status[t]=4;let i=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|i}function Tu(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const U7=X.define(),Rf=X.define({combine:n=>n.some(e=>e),static:!0}),K7=X.define({combine:n=>n.length?n[0]:void 0,static:!0}),X7=X.define(),Y7=X.define(),Z7=X.define(),J7=X.define({combine:n=>n.length?n[0]:!1});class Gr{constructor(e,t){this.type=e,this.value=t}static define(){return new aA}}class aA{of(e){return new Gr(this,e)}}class lA{constructor(e){this.map=e}of(e){return new ue(this,e)}}class ue{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new ue(this.type,t)}is(e){return this.type==e}static define(e={}){return new lA(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(t);s&&r.push(s)}return r}}ue.reconfigure=ue.define();ue.appendConfig=ue.define();class rt{constructor(e,t,r,i,s,o){this.startState=e,this.changes=t,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,r&&j7(r,t.newLength),s.some(a=>a.type==rt.time)||(this.annotations=s.concat(rt.time.of(Date.now())))}static create(e,t,r,i,s,o){return new rt(e,t,r,i,s,o)}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(rt.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}rt.time=Gr.define();rt.userEvent=Gr.define();rt.addToHistory=Gr.define();rt.remote=Gr.define();function cA(n,e){let t=[];for(let r=0,i=0;;){let s,o;if(r<n.length&&(i==e.length||e[i]>=n[r]))s=n[r++],o=n[r++];else if(i<e.length)s=e[i++],o=e[i++];else return t;!t.length||t[t.length-1]<s?t.push(s,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function Q7(n,e,t){var r;let i,s,o;return t?(i=e.changes,s=Wn.empty(e.changes.length),o=n.changes.compose(e.changes)):(i=e.changes.map(n.changes),s=n.changes.mapDesc(e.changes,!0),o=n.changes.compose(i)),{changes:o,selection:e.selection?e.selection.map(s):(r=n.selection)===null||r===void 0?void 0:r.map(i),effects:ue.mapEffects(n.effects,i).concat(ue.mapEffects(e.effects,s)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function zf(n,e,t){let r=e.selection,i=ho(e.annotations);return e.userEvent&&(i=i.concat(rt.userEvent.of(e.userEvent))),{changes:e.changes instanceof Wn?e.changes:Wn.of(e.changes||[],t,n.facet(K7)),selection:r&&(r instanceof N?r:N.single(r.anchor,r.head)),effects:ho(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function e6(n,e,t){let r=zf(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let o=!!e[s].sequential;r=Q7(r,zf(n,e[s],o?r.changes.newLength:n.doc.length),o)}let i=rt.create(n,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return hA(t?uA(i):i)}function uA(n){let e=n.startState,t=!0;for(let i of e.facet(X7)){let s=i(n);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:cA(t,s))}if(t!==!0){let i,s;if(t===!1)s=n.changes.invertedDesc,i=Wn.empty(e.doc.length);else{let o=n.changes.filter(t);i=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}n=rt.create(e,i,n.selection&&n.selection.map(s),ue.mapEffects(n.effects,s),n.annotations,n.scrollIntoView)}let r=e.facet(Y7);for(let i=r.length-1;i>=0;i--){let s=r[i](n);s instanceof rt?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof rt?n=s[0]:n=e6(e,ho(s),!1)}return n}function hA(n){let e=n.startState,t=e.facet(Z7),r=n;for(let i=t.length-1;i>=0;i--){let s=t[i](n);s&&Object.keys(s).length&&(r=Q7(r,zf(e,s,n.changes.newLength),!0))}return r==n?n:rt.create(e,n.changes,n.selection,r.effects,r.annotations,r.scrollIntoView)}const dA=[];function ho(n){return n==null?dA:Array.isArray(n)?n:[n]}var qe=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(qe||(qe={}));const fA=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Nf;try{Nf=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function pA(n){if(Nf)return Nf.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||fA.test(t)))return!0}return!1}function mA(n){return e=>{if(!/\S/.test(e))return qe.Space;if(pA(e))return qe.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return qe.Word;return qe.Other}}class ve{constructor(e,t,r,i,s,o){this.config=e,this.doc=t,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)ll(this,a<<1);this.computeSlot=null}field(e,t=!0){let r=this.config.address[e.id];if(r==null){if(t)throw new RangeError("Field is not present in this state");return}return ll(this,r),Tu(this,r)}update(...e){return e6(this,e,!0)}applyTransaction(e){let t=this.config,{base:r,compartments:i}=t;for(let a of e.effects)a.is(Co.reconfigure)?(t&&(i=new Map,t.compartments.forEach((l,c)=>i.set(c,l)),t=null),i.set(a.value.compartment,a.value.extension)):a.is(ue.reconfigure)?(t=null,r=a.value):a.is(ue.appendConfig)&&(t=null,r=ho(r).concat(a.value));let s;t?s=e.startState.values.slice():(t=Mu.resolve(r,i,this),s=new ve(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let o=e.startState.facet(Rf)?e.newSelection:e.newSelection.asSingle();new ve(t,e.newDoc,o,s,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:N.cursor(t.from+e.length,-1)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),i=this.changes(r.changes),s=[r.range],o=ho(r.effects);for(let a=1;a<t.ranges.length;a++){let l=e(t.ranges[a]),c=this.changes(l.changes),u=c.map(i);for(let d=0;d<a;d++)s[d]=s[d].map(u);let h=i.mapDesc(c,!0);s.push(l.range.map(h)),i=i.compose(u),o=ue.mapEffects(o,u).concat(ue.mapEffects(ho(l.effects),h))}return{changes:i,selection:N.create(s,t.mainIndex),effects:o}}changes(e=[]){return e instanceof Wn?e:Wn.of(e,this.doc.length,this.facet(ve.lineSeparator))}toText(e){return ye.of(e.split(this.facet(ve.lineSeparator)||Lf))}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 t==null?e.default:(ll(this,t),Tu(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof Tt&&this.config.address[i.id]!=null&&(t[r]=i.spec.toJSON(this.field(e[r]),this))}return t}static fromJSON(e,t={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(e,s)){let o=r[s],a=e[s];i.push(o.init(l=>o.spec.fromJSON(a,l)))}}return ve.create({doc:e.doc,selection:N.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=Mu.resolve(e.extensions||[],new Map),r=e.doc instanceof ye?e.doc:ye.of((e.doc||"").split(t.staticFacet(ve.lineSeparator)||Lf)),i=e.selection?e.selection instanceof N?e.selection:N.single(e.selection.anchor,e.selection.head):N.single(0);return j7(i,r.length),t.staticFacet(Rf)||(i=i.asSingle()),new ve(t,r,i,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(ve.tabSize)}get lineBreak(){return this.facet(ve.lineSeparator)||`
|
|
@@ -11,7 +11,7 @@ import{k as Jw,j as Qw,s as ex,$ as Be,l as dt,P as at,m as ft,n as kt,p as Ps,R
|
|
|
11
11
|
`))};if((K.mac||K.android)&&h.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(h={from:a,to:l,insert:ye.of([r.text.replace("."," ")])}),this.pendingContextChange=h,!e.state.readOnly){let d=this.to-this.from+(h.to-h.from+h.insert.length);Um(e,h,N.single(this.toEditorPos(r.selectionStart,d),this.toEditorPos(r.selectionEnd,d)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),h.from<h.to&&!h.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(t.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o<a;o++){let l=e.coordsForChar(o);s=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||s||new DOMRect,i.push(s)}t.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let l=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(l<c){let u=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;i.push(oe.mark({attributes:{style:u}}).range(l,c))}}}e.dispatch({effects:T6.of(oe.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)t.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{let i=Cl(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,c)=>{if(r)return;let u=c.length-(o-s);if(i&&o>=i.to)if(i.from==s&&i.to==o&&i.insert.eq(c)){i=this.pendingContextChange=null,t+=u,this.to+=u;return}else i=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=u,this.to+=u;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=u}t+=u}),i&&!r&&this.revertPending(e.state),!r}update(e){let t=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),i=this.toContextPos(t.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Z{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.clearAnnouncement=-1,this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||SA(e.parent)||document,this.viewState=new _4(this,e.state||ve.create(e)),e.scrollTo&&e.scrollTo.is(R0)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(so).map(i=>new Cd(i));for(let i of this.plugins)i.update(this);this.observer=new KM(this),this.inputState=new gM(this),this.inputState.ensureHandlers(this.plugins),this.docView=new g4(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof rt?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,r=!1,i,s=this.state;for(let d of e){if(d.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=d.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,l=null;e.some(d=>d.annotation(V6))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=W6(s,o),l||(a=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(u=null)):this.observer.clear(),s.facet(ve.phrases)!=this.state.facet(ve.phrases))return this.setState(s);i=Lu.create(this,s,e),i.flags|=a;let h=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(h&&(h=h.map(d.changes)),d.scrollIntoView){let{main:f}=d.state.selection,{x:m,y:g}=this.state.facet(Z.cursorScrollMargin);h=new mo(f.empty?f:N.cursor(f.head,f.head>f.anchor?-1:1),"nearest","nearest",g,m)}for(let f of d.effects)f.is(R0)&&(h=f.value.clip(this.state))}this.viewState.update(i,h),this.bidiCache=Pu.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(Da)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet($0)!=i.state.facet($0)&&(this.viewState.mustMeasureContent=!0),(t||r||h||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(Jf))try{d(i)}catch(f){Jt(this.state,f,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!R6(this,u)&&c.force&&po(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new _4(this,e),this.plugins=e.facet(so).map(r=>new Cd(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new g4(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(so),r=e.state.facet(so);if(t!=r){let i=[];for(let s of r){let o=t.indexOf(s);if(o<0)i.push(new Cd(s));else{let a=this.plugins[o];a.mustUpdate=e,i.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);t!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(r){Jt(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,r=this.viewState.scrollParent,i=this.viewState.getScrollOffset(),{scrollAnchorPos:s,scrollAnchorHeight:o,scaleY:a}=this.viewState;Math.abs(i-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0){if(u6(r||this.win))s=-1,o=this.viewState.heightMap.height/this.viewState.scaleY;else{let m=this.viewState.scrollAnchorAt(i);s=m.from,o=m.top}a=this.viewState.scaleY}this.updateState=1;let c=this.viewState.measure();if(!c&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let u=[];c&4||([this.measureRequests,u]=[u,this.measureRequests]);let h=u.map(m=>{try{return m.read(this)}catch(g){return Jt(this.state,g),O4}}),d=Lu.create(this,this.state,[]),f=!1;d.flags|=c,t?t.flags|=c:t=d,this.updateState=2,d.empty||(this.updatePlugins(d),this.inputState.update(d),this.updateAttrs(),f=this.docView.update(d),f&&this.docViewUpdate());for(let m=0;m<u.length;m++)if(h[m]!=O4)try{let g=u[m];g.write&&g.write(h[m],this)}catch(g){Jt(this.state,g)}if(f&&this.docView.updateSelection(!0),!d.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let g=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)/this.viewState.scaleY-o/a;if((g>1||g<-1)&&!(K.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(r==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){i=i+g,r?s<0?r.scrollTop=r.scrollHeight:r.scrollTop+=g:this.win.scrollBy(0,g),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Jf))l(t)}get themeClasses(){return sp+" "+(this.state.facet(ip)?K6:U6)+" "+this.state.facet($0)}updateAttrs(){let e=P4(this,E6,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Or)?"true":"false",class:"cm-content",style:`${K.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),P4(this,Wm,t);let r=this.observer.ignore(()=>{let i=u4(this.contentDOM,this.contentAttrs,t),s=u4(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=t,r}showAnnouncements(e){let t=!0;for(let r of e)for(let i of r.effects)if(i.is(Z.announce)){t&&(this.announceDOM.textContent="",this.win.clearTimeout(this.clearAnnouncement),this.clearAnnouncement=this.win.setTimeout(()=>{this.announceDOM.textContent=" "},200),t=!1);let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Da);let e=this.state.facet(Z.cspNonce);Ai.mount(this.root,this.styleModules.concat(GM).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(r=>r.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,r){return Td(this,e,v4(this,e,t,r))}moveByGroup(e,t){return Td(this,e,v4(this,e,t,r=>oM(this,e.head,r)))}visualLineSide(e,t){return t?N.cursor(e.to,1):N.cursor(e.from,-1)}moveToLineBoundary(e,t,r=!0){return sM(this,e,t,r)}moveVertically(e,t,r){return Td(this,e,aM(this,e,t,r))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let r=tp(this,e,t);return r&&r.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),tp(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let r=this.state.doc.lineAt(e),i=this.bidiSpans(r),s=i[lr.find(i,e-r.from,-1,t)];return r.length&&(e==r.from&&t<0||e==r.to&&t>0)&&s.dir!=this.textDirectionAt(r.from)&&(e==r.to?(e=r.from+s.from,t=1):(e=r.from+s.to,t=-1)),this.docView.coordsAt(e,t,s.dir==Pe.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(S6)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>ZM)return g6(e.length);let t=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||m6(s.isolates,r=f4(this,e))))return s.order;r||(r=f4(this,e));let i=BA(e.text,t,r);return this.bidiCache.push(new Pu(e.from,e.to,t,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||K.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{c6(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.win.clearTimeout(this.clearAnnouncement),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var r,i,s,o;return R0.of(new mo(typeof e=="number"?N.cursor(e):e,(r=t.y)!==null&&r!==void 0?r:"nearest",(i=t.x)!==null&&i!==void 0?i:"nearest",(s=t.yMargin)!==null&&s!==void 0?s:5,(o=t.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return R0.of(new mo(N.cursor(r.from),"start","start",r.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return nt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return nt.define(()=>({}),{eventObservers:e})}static theme(e,t){let r=Ai.newName(),i=[$0.of(r),Da.of(op(`.${r}`,e))];return t&&t.dark&&i.push(ip.of(!0)),i}static baseTheme(e){return Pi.lowest(Da.of(op("."+sp,e,X6)))}static findFromDOM(e){var t;let r=e.querySelector(".cm-content"),i=r&&Ye.get(r)||Ye.get(e);return((t=i?.root)===null||t===void 0?void 0:t.view)||null}}Z.styleModule=Da;Z.inputHandler=k6;Z.clipboardInputFilter=$m;Z.clipboardOutputFilter=Vm;Z.scrollHandler=M6;Z.focusChangeEffect=C6;Z.perLineTextDirection=S6;Z.exceptionSink=x6;Z.updateListener=Jf;Z.editable=Or;Z.mouseSelectionStyle=w6;Z.dragMovesSelection=b6;Z.clickAddsSelectionRange=y6;Z.decorations=yh;Z.blockWrappers=_6;Z.outerDecorations=jm;Z.atomicRanges=t0;Z.bidiIsolatedRanges=I6;Z.cursorScrollMargin=X.define({combine:n=>{let e=5,t=5;for(let r of n)typeof r=="number"?e=t=r:{x:e,y:t}=r;return{x:e,y:t}}});Z.scrollMargins=L6;Z.darkTheme=ip;Z.cspNonce=X.define({combine:n=>n.length?n[0]:""});Z.contentAttributes=Wm;Z.editorAttributes=E6;Z.lineWrapping=Z.contentAttributes.of({class:"cm-lineWrapping"});Z.announce=ue.define();const ZM=4096,O4={};class Pu{constructor(e,t,r,i,s,o){this.from=e,this.to=t,this.dir=r,this.isolates=i,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:Pe.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==i&&!t.touchesRange(o.from,o.to)&&r.push(new Pu(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}}function P4(n,e,t){for(let r=n.state.facet(e),i=r.length-1;i>=0;i--){let s=r[i],o=typeof s=="function"?s(n):s;o&&Hm(o,t)}return t}const JM=K.mac?"mac":K.windows?"win":K.linux?"linux":"key";function QM(n,e){const t=n.split(/-(?!$)/);let r=t[t.length-1];r=="Space"&&(r=" ");let i,s,o,a;for(let l=0;l<t.length-1;++l){const c=t[l];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?a=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(r="Alt-"+r),s&&(r="Ctrl-"+r),a&&(r="Meta-"+r),o&&(r="Shift-"+r),r}function V0(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const eT=Pi.default(Z.domEventHandlers({keydown(n,e){return Z6(Y6(e.state),n,e,"editor")}})),Go=X.define({enables:eT}),R4=new WeakMap;function Y6(n){let e=n.facet(Go),t=R4.get(e);return t||R4.set(e,t=rT(e.reduce((r,i)=>r.concat(i),[]))),t}function tT(n,e,t){return Z6(Y6(n.state),e,n,t)}let fi=null;const nT=4e3;function rT(n,e=JM){let t=Object.create(null),r=Object.create(null),i=(o,a)=>{let l=r[o];if(l==null)r[o]=a;else if(l!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,l,c,u)=>{var h,d;let f=t[o]||(t[o]=Object.create(null)),m=a.split(/ (?!$)/).map(b=>QM(b,e));for(let b=1;b<m.length;b++){let x=m.slice(0,b).join(" ");i(x,!0),f[x]||(f[x]={preventDefault:!0,stopPropagation:!1,run:[C=>{let E=fi={view:C,prefix:x,scope:o};return setTimeout(()=>{fi==E&&(fi=null)},nT),!0}]})}let g=m.join(" ");i(g,!1);let y=f[g]||(f[g]={preventDefault:!1,stopPropagation:!1,run:((d=(h=f._any)===null||h===void 0?void 0:h.run)===null||d===void 0?void 0:d.slice())||[]});l&&y.run.push(l),c&&(y.preventDefault=!0),u&&(y.stopPropagation=!0)};for(let o of n){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of a){let u=t[c]||(t[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:h}=o;for(let d in u)u[d].run.push(f=>h(f,ap))}let l=o[e]||o.key;if(l)for(let c of a)s(c,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return t}let ap=null;function Z6(n,e,t,r){ap=e;let i=Jw(e),s=Xt(i,0),o=sr(s)==i.length&&i!=" ",a="",l=!1,c=!1,u=!1;fi&&fi.view==t&&fi.scope==r&&(a=fi.prefix+" ",H6.indexOf(e.keyCode)<0&&(c=!0,fi=null));let h=new Set,d=y=>{if(y){for(let b of y.run)if(!h.has(b)&&(h.add(b),b(t)))return y.stopPropagation&&(u=!0),!0;y.preventDefault&&(y.stopPropagation&&(u=!0),c=!0)}return!1},f=n[r],m,g;return f&&(d(f[a+V0(i,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(K.windows&&e.ctrlKey&&e.altKey)&&!(K.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(m=Qw[e.keyCode])&&m!=i?(d(f[a+V0(m,e,!0)])||e.shiftKey&&(g=ex[e.keyCode])!=i&&g!=m&&d(f[a+V0(g,e,!1)]))&&(l=!0):o&&e.shiftKey&&d(f[a+V0(i,e,!0)])&&(l=!0),!l&&d(f._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),ap=null,l}class ps{constructor(e,t,r,i,s){this.className=e,this.left=t,this.top=r,this.width=i,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,r){if(r.empty){let i=e.coordsAtPos(r.head,r.assoc||1);if(!i)return[];let s=J6(e);return[new ps(t,i.left-s.left,i.top-s.top,null,i.bottom-i.top)]}else return iT(e,t,r)}}function J6(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==Pe.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function z4(n,e,t,r){let i=n.coordsAtPos(e,t*2);if(!i)return r;let s=n.dom.getBoundingClientRect(),o=(i.top+i.bottom)/2,a=n.posAtCoords({x:s.left+1,y:o}),l=n.posAtCoords({x:s.right-1,y:o});return a==null||l==null?r:{from:Math.max(r.from,Math.min(a,l)),to:Math.min(r.to,Math.max(a,l))}}function iT(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let r=Math.max(t.from,n.viewport.from),i=Math.min(t.to,n.viewport.to),s=n.textDirection==Pe.LTR,o=n.contentDOM,a=o.getBoundingClientRect(),l=J6(n),c=o.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),h=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),d=a.right-(u?parseInt(u.paddingRight):0),f=ep(n,r,1),m=ep(n,i,-1),g=f.type==At.Text?f:null,y=m.type==At.Text?m:null;if(g&&(n.lineWrapping||f.widgetLineBreaks)&&(g=z4(n,r,1,g)),y&&(n.lineWrapping||m.widgetLineBreaks)&&(y=z4(n,i,-1,y)),g&&y&&g.from==y.from&&g.to==y.to)return x(C(t.from,t.to,g));{let S=g?C(t.from,null,g):E(f,!1),T=y?C(null,t.to,y):E(m,!0),O=[];return(g||f).to<(y||m).from-(g&&y?1:0)||f.widgetLineBreaks>1&&S.bottom+n.defaultLineHeight/2<T.top?O.push(b(h,S.bottom,d,T.top)):S.bottom<T.top&&n.elementAtHeight((S.bottom+T.top)/2).type==At.Text&&(S.bottom=T.top=(S.bottom+T.top)/2),x(S).concat(O).concat(x(T))}function b(S,T,O,L){return new ps(e,S-l.left,T-l.top,Math.max(0,O-S),L-T)}function x({top:S,bottom:T,horizontal:O}){let L=[];for(let B=0;B<O.length;B+=2)L.push(b(O[B],S,O[B+1],T));return L}function C(S,T,O){let L=1e9,B=-1e9,z=[];function V(J,ie,he,ke,we){let be=n.coordsAtPos(J,J==O.to?-2:2),Re=n.coordsAtPos(he,he==O.from?2:-2);!be||!Re||(L=Math.min(be.top,Re.top,L),B=Math.max(be.bottom,Re.bottom,B),we==Pe.LTR?z.push(s&&ie?h:be.left,s&&ke?d:Re.right):z.push(!s&&ke?h:Re.left,!s&&ie?d:be.right))}let D=S??O.from,ee=T??O.to;for(let J of n.visibleRanges)if(J.to>D&&J.from<ee)for(let ie=Math.max(J.from,D),he=Math.min(J.to,ee);;){let ke=n.state.doc.lineAt(ie);for(let we of n.bidiSpans(ke)){let be=we.from+ke.from,Re=we.to+ke.from;if(be>=he)break;Re>ie&&V(Math.max(be,ie),S==null&&be<=D,Math.min(Re,he),T==null&&Re>=ee,we.dir)}if(ie=ke.to+1,ie>=he)break}return z.length==0&&V(D,S==null,ee,T==null,n.textDirection),{top:L,bottom:B,horizontal:z}}function E(S,T){let O=a.top+(T?S.top:S.bottom);return{top:O,bottom:O,horizontal:[]}}}function sT(n,e){return n.constructor==e.constructor&&n.eq(e)}class oT{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(Tc)!=e.state.facet(Tc)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,r=e.facet(Tc);for(;t<r.length&&r[t]!=this.layer;)t++;this.dom.style.zIndex=String((this.layer.above?150:-1)-t)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:t}=this.view;(e!=this.scaleX||t!=this.scaleY)&&(this.scaleX=e,this.scaleY=t,this.dom.style.transform=`scale(${1/e}, ${1/t})`)}draw(e){if(e.length!=this.drawn.length||e.some((t,r)=>!sT(t,this.drawn[r]))){let t=this.dom.firstChild,r=0;for(let i of e)i.update&&t&&i.constructor&&this.drawn[r].constructor&&i.update(t,this.drawn[r])?(t=t.nextSibling,r++):this.dom.insertBefore(i.draw(),t);for(;t;){let i=t.nextSibling;t.remove(),t=i}this.drawn=e,K.webkit&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Tc=X.define();function Q6(n){return[nt.define(e=>new oT(e,n)),Tc.of(n)]}const lp=!K.ios,Eo=X.define({combine(n){return wr(n,{cursorBlinkRate:1200,drawRangeCursor:!0,iosSelectionHandles:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function e8(n={}){return[Eo.of(n),aT,lT,uT,A6.of(!0)]}function t8(n){return n.startState.facet(Eo)!=n.state.facet(Eo)}const aT=Q6({above:!0,markers(n){let{state:e}=n,t=e.facet(Eo),r=[];for(let i of e.selection.ranges){let s=i==e.selection.main;if(i.empty||t.drawRangeCursor&&!(s&&K.ios&&t.iosSelectionHandles)){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:N.cursor(i.head,i.assoc);for(let l of ps.forRange(n,o,a))r.push(l)}}return r},update(n,e){n.transactions.some(r=>r.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=t8(n);return t&&N4(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){N4(e.state,n)},class:"cm-cursorLayer"});function N4(n,e){e.style.animationDuration=n.facet(Eo).cursorBlinkRate+"ms"}const lT=Q6({above:!1,markers(n){let e=[],{main:t,ranges:r}=n.state.selection;for(let i of r)if(!i.empty&&(lp||i!=t))for(let s of ps.forRange(n,"cm-selectionBackground",i))e.push(s);if(K.ios&&!t.empty&&n.state.facet(Eo).iosSelectionHandles){for(let i of ps.forRange(n,"cm-selectionHandle cm-selectionHandle-start",N.cursor(t.from,1)))e.push(i);for(let i of ps.forRange(n,"cm-selectionHandle cm-selectionHandle-end",N.cursor(t.to,1)))e.push(i)}return e},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||t8(n)},class:"cm-selectionLayer"}),cT=K.gecko&&K.gecko_version==153?"#ffffff01":"transparent",uT=Pi.highest(Z.theme({".cm-line":{...lp?{"& ::selection, &::selection":{backgroundColor:`${cT} !important`}}:{},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important",...lp?{"&::selection, & ::selection":{backgroundColor:"Highlight !important"}}:{}}}})),n8=ue.define({map(n,e){return n==null?null:e.mapPos(n)}}),Pa=Tt.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,r)=>r.is(n8)?r.value:t,n)}}),hT=nt.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(Pa);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(Pa)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(Pa),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let r=n.scrollDOM.getBoundingClientRect();return{left:t.left-r.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-r.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(Pa)!=n&&this.view.dispatch({effects:n8.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function dT(){return[Pa,hT]}function H4(n,e,t,r,i){e.lastIndex=0;for(let s=n.iterRange(t,r),o=t,a;!s.next().done;o+=s.value.length)if(!s.lineBreak)for(;a=e.exec(s.value);)i(o+a.index,a)}function fT(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let r=[];for(let{from:i,to:s}of t)i=Math.max(n.state.doc.lineAt(i).from,i-e),s=Math.min(n.state.doc.lineAt(s).to,s+e),r.length&&r[r.length-1].to>=i?r[r.length-1].to=s:r.push({from:i,to:s});return r}class pT{constructor(e){const{regexp:t,decoration:r,decorate:i,boundary:s,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,i)this.addMatch=(a,l,c,u)=>i(u,c,c+a[0].length,a,l);else if(typeof r=="function")this.addMatch=(a,l,c,u)=>{let h=r(a,l,c);h&&u(c,c+a[0].length,h)};else if(r)this.addMatch=(a,l,c,u)=>u(c,c+a[0].length,r);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=o}createDeco(e){let t=new fr,r=t.add.bind(t);for(let{from:i,to:s}of fT(e,this.maxLength))H4(e.state.doc,this.regexp,i,s,(o,a)=>this.addMatch(a,e,o,r));return t.finish()}updateDeco(e,t){let r=1e9,i=-1;return e.docChanged&&e.changes.iterChanges((s,o,a,l)=>{l>=e.view.viewport.from&&a<=e.view.viewport.to&&(r=Math.min(a,r),i=Math.max(l,i))}),e.viewportMoved||i-r>1e3?this.createDeco(e.view):i>-1?this.updateRange(e.view,t.map(e.changes),r,i):t}updateRange(e,t,r,i){for(let s of e.visibleRanges){let o=Math.max(s.from,r),a=Math.min(s.to,i);if(a>=o){let l=e.state.doc.lineAt(o),c=l.to<a?e.state.doc.lineAt(a):l,u=Math.max(s.from,l.from),h=Math.min(s.to,c.to);if(this.boundary){for(;o>l.from;o--)if(this.boundary.test(l.text[o-1-l.from])){u=o;break}for(;a<c.to;a++)if(this.boundary.test(c.text[a-c.from])){h=a;break}}let d=[],f,m=(g,y,b)=>d.push(b.range(g,y));if(l==c)for(this.regexp.lastIndex=u-l.from;(f=this.regexp.exec(l.text))&&f.index<h-l.from;)this.addMatch(f,e,f.index+l.from,m);else H4(e.state.doc,this.regexp,u,h,(g,y)=>this.addMatch(y,e,g,m));t=t.update({filterFrom:u,filterTo:h,filter:(g,y)=>g<u||y>h,add:d})}}return t}}const cp=/x/.unicode!=null?"gu":"g",mT=new RegExp(`[\0-\b
|
|
12
12
|
--\u2028\u2029\uFEFF-]`,cp),gT={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Id=null;function vT(){var n;if(Id==null&&typeof document<"u"&&document.body){let e=document.body.style;Id=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Id||!1}const Ec=X.define({combine(n){let e=wr(n,{render:null,specialChars:mT,addSpecialChars:null});return(e.replaceTabs=!vT())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,cp)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,cp)),e}});function yT(n={}){return[Ec.of(n),bT()]}let F4=null;function bT(){return F4||(F4=nt.fromClass(class{constructor(n){this.view=n,this.decorations=oe.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(Ec)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new pT({regexp:n.specialChars,decoration:(e,t,r)=>{let{doc:i}=t.state,s=Xt(e[0],0);if(s==9){let o=i.lineAt(r),a=t.state.tabSize,l=jo(o.text,a,r-o.from);return oe.replace({widget:new CT((a-l%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=oe.replace({widget:new kT(n,s)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(Ec);n.startState.facet(Ec)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const wT="•";function xT(n){return n>=32?wT:n==10?"":String.fromCharCode(9216+n)}class kT extends xr{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=xT(this.code),r=e.state.phrase("Control character")+" "+(gT[this.code]||"0x"+this.code.toString(16)),i=this.options.render&&this.options.render(this.code,r,t);if(i)return i;let s=document.createElement("span");return s.textContent=t,s.title=r,s.setAttribute("aria-label",r),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class CT extends xr{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function ST(){return MT}const AT=oe.line({class:"cm-activeLine"}),MT=nt.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let r of n.state.selection.ranges){let i=n.lineBlockAt(r.head);i.from>e&&(t.push(AT.range(i.from)),e=i.from)}return oe.set(t)}},{decorations:n=>n.decorations}),up=2e3;function TT(n,e,t){let r=Math.min(e.line,t.line),i=Math.max(e.line,t.line),s=[];if(e.off>up||t.off>up||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let l=r;l<=i;l++){let c=n.doc.line(l);c.length<=a&&s.push(N.range(c.from+o,c.to+a))}}else{let o=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let l=r;l<=i;l++){let c=n.doc.line(l),u=qf(c.text,o,n.tabSize,!0);if(u<0)s.push(N.cursor(c.to));else{let h=qf(c.text,a,n.tabSize);s.push(N.range(c.from+u,c.from+h))}}}return s}function ET(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function q4(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),r=n.state.doc.lineAt(t),i=t-r.from,s=i>up?-1:i==r.length?ET(n,e.clientX):jo(r.text,n.state.tabSize,t-r.from);return{line:r.number,col:s,off:i}}function _T(n,e){let t=q4(n,e),r=n.state.selection;return t?{update(i){if(i.docChanged){let s=i.changes.mapPos(i.startState.doc.line(t.line).from),o=i.state.doc.lineAt(s);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},r=r.map(i.changes)}},get(i,s,o){let a=q4(n,i);if(!a)return r;let l=TT(n.state,t,a);return l.length?o?N.create(l.concat(r.ranges)):N.create(l):r}}:null}function IT(n){let e=(t=>t.altKey&&t.button==0);return Z.mouseSelectionStyle.of((t,r)=>e(r)?_T(t,r):null)}const LT={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},BT={style:"cursor: crosshair"};function DT(n={}){let[e,t]=LT[n.key||"Alt"],r=nt.fromClass(class{constructor(i){this.view=i,this.isDown=!1}set(i){this.isDown!=i&&(this.isDown=i,this.view.update([]))}},{eventObservers:{keydown(i){this.set(i.keyCode==e||t(i))},keyup(i){(i.keyCode==e||!t(i))&&this.set(!1)},mousemove(i){this.set(t(i))}}});return[r,Z.contentAttributes.of(i=>{var s;return!((s=i.plugin(r))===null||s===void 0)&&s.isDown?BT:null})]}const W0="-10000px";class r8{constructor(e,t,r,i){this.facet=t,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=r(o,s))}update(e,t){var r;let i=e.state.facet(this.facet),s=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let o=[],a=t?[]:null;for(let l=0;l<s.length;l++){let c=s[l],u=-1;if(c){for(let h=0;h<this.tooltips.length;h++){let d=this.tooltips[h];d&&d.create==c.create&&(u=h)}if(u<0)o[l]=this.createTooltipView(c,l?o[l-1]:null),a&&(a[l]=!!c.above);else{let h=o[l]=this.tooltipViews[u];a&&(a[l]=t[u]),h.update&&h.update(e)}}}for(let l of this.tooltipViews)o.indexOf(l)<0&&(this.removeTooltipView(l),(r=l.destroy)===null||r===void 0||r.call(l));return t&&(a.forEach((l,c)=>t[c]=l),t.length=a.length),this.input=i,this.tooltips=s,this.tooltipViews=o,!0}}function i8(n){let e=n.dom.ownerDocument.documentElement,t=e.clientWidth,r=getComputedStyle(e);if(!/stable/.test(r.scrollbarGutter||""))return{left:0,right:t};let i=e.getBoundingClientRect(),s=n.win.scrollX;return{left:Math.max(0,i.left+s-parseFloat(r.marginLeft)),right:Math.min(t,i.right+s+parseFloat(r.marginRight))}}function OT(n){let{left:e,right:t}=i8(n);return{top:0,left:e,right:t,bottom:n.dom.ownerDocument.documentElement.clientHeight}}const Ld=X.define({combine:n=>{var e,t,r;return{position:K.ios?"absolute":((e=n.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(i=>i.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((r=n.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||OT}}}),$4=new WeakMap,Ym=nt.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Ld);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new r8(n,Zm,(t,r)=>this.createTooltip(t,r),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,r=n.state.facet(Ld);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;t=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),r=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",t.dom.appendChild(i)}return t.dom.style.position=this.position,t.dom.style.top=W0,t.dom.style.left="0px",this.container.insertBefore(t.dom,r),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(n=r.destroy)===null||n===void 0||n.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1,r=0;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:o}=this.manager.tooltipViews[0];if(K.safari){let a=o.getBoundingClientRect();t=Math.abs(a.top+1e4)>1||Math.abs(a.left)>1}else t=!!o.offsetParent&&o.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let o=this.parent.getBoundingClientRect();o.width&&o.height&&(n=o.width/this.parent.offsetWidth,e=o.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);else r=i8(this.view).left;let i=this.view.scrollDOM.getBoundingClientRect(),s=Gm(this.view);return{visible:{left:i.left+s.left,top:i.top+s.top,right:i.right-s.right,bottom:i.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((o,a)=>{let l=this.manager.tooltipViews[a];return l.getCoords?l.getCoords(o.pos):this.view.coordsAtPos(o.pos)}),size:this.manager.tooltipViews.map(({dom:o})=>o.getBoundingClientRect()),space:this.view.state.facet(Ld).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t,fixedLeft:r}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:t,space:r,scaleX:i,scaleY:s}=n,o=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:u}=c,h=n.pos[a],d=n.size[a];if(!h||l.clip!==!1&&(h.bottom<=Math.max(t.top,r.top)||h.top>=Math.min(t.bottom,r.bottom)||h.right<Math.max(t.left,r.left)-.1||h.left>Math.min(t.right,r.right)+.1)){u.style.top=W0;continue}let f=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,m=f?7:0,g=d.right-d.left,y=(e=$4.get(c))!==null&&e!==void 0?e:d.bottom-d.top,b=c.offset||RT,x=this.view.textDirection==Pe.LTR,C=d.width>r.right-r.left?x?r.left:r.right-d.width:x?Math.max(r.left,Math.min(h.left-(f?14:0)+b.x,r.right-g)):Math.min(Math.max(r.left,h.left-g+(f?14:0)-b.x),r.right-g),E=this.above[a];!l.strictSide&&(E?h.top-y-m-b.y<r.top:h.bottom+y+m+b.y>r.bottom)&&E==r.bottom-h.bottom>h.top-r.top&&(E=this.above[a]=!E);let S=(E?h.top-r.top:r.bottom-h.bottom)-m;if(S<y&&c.resize!==!1){if(S<this.view.defaultLineHeight){u.style.top=W0;continue}$4.set(c,y),u.style.height=(y=S)/s+"px"}else u.style.height&&(u.style.height="");let T=E?h.top-y-m-b.y:h.bottom+m+b.y,O=C+g;if(c.overlap!==!0)for(let L of o)L.left<O&&L.right>C&&L.top<T+y&&L.bottom>T&&(T=E?L.top-y-2-m:L.bottom+m+2);if(this.position=="absolute"?(u.style.top=(T-n.parent.top)/s+"px",V4(u,(C-n.parent.left)/i)):(u.style.top=T/s+"px",V4(u,(C-n.fixedLeft)/i)),f){let L=h.left+(x?b.x:-b.x)-(C+14-7);f.style.left=L/i+"px"}c.overlap!==!0&&o.push({left:C,top:T,right:O,bottom:T+y}),u.classList.toggle("cm-tooltip-above",E),u.classList.toggle("cm-tooltip-below",!E),c.positioned&&c.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=W0}},{eventObservers:{scroll(){this.maybeMeasure()}}});function V4(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const PT=Z.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),RT={x:0,y:0},Zm=X.define({enables:[Ym,PT]}),Ru=X.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class kh{static create(e){return new kh(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new r8(e,Ru,(t,r)=>this.createHostedView(t,r),t=>t.dom.remove())}createHostedView(e,t){let r=e.create(this.view);return r.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(r.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&r.mount&&r.mount(this.view),r}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let r of this.manager.tooltipViews){let i=r[e];if(i!==void 0){if(t===void 0)t=i;else if(t!==i)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const zT=Zm.compute([Ru],n=>{let e=n.facet(Ru);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var r;return(r=t.end)!==null&&r!==void 0?r:t.pos})),create:kh.create,above:e[0].above,arrow:e.some(t=>t.arrow)}}),s8=X.define();class NT{constructor(e,t,r,i,s,o){this.view=e,this.source=t,this.field=r,this.locked=i,this.setHover=s,this.hoverTime=o,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(e){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:t}=this,r=e.docView.tile.nearest(t.target);if(!r)return;let i,s=1;if(r.isWidget())i=r.posAtStart;else{if(i=e.posAtCoords(t),i==null)return;let o=e.coordsAtPos(i);if(!o||t.y<o.top||t.y>o.bottom||t.x<o.left-e.defaultCharacterWidth||t.x>o.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(i)).find(c=>c.from<=i&&c.to>=i),l=a&&a.dir==Pe.RTL?-1:1;s=t.x<o.left?-l:l}this.activateHover(e,i,s)}activateHover(e,t,r,i){let s=this.source(e,t,r),o=a=>{if(a&&!(Array.isArray(a)&&!a.length)){let l=Array.isArray(a)?a:[a];i&&this.locked.set(l,i),e.dispatch({effects:this.setHover.of(l)})}};if(s&&"then"in s){let a=this.pending={pos:t};s.then(l=>{this.pending==a&&(this.pending=null,o(l))},l=>Jt(e.state,l,"hover tooltip"))}else o(s)}get tooltip(){let e=this.view.plugin(Ym),t=e?e.manager.tooltips.findIndex(r=>r.create==kh.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,r;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:i,tooltip:s}=this;if(i.length&&!this.locked.has(i)&&s&&!HT(s.dom,e)||this.pending){let{pos:o}=i[0]||this.pending,a=(r=(t=i[0])===null||t===void 0?void 0:t.end)!==null&&r!==void 0?r:o;(o==a?this.view.posAtCoords(this.lastMove)!=o:!FT(this.view,o,a,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length&&!this.locked.has(t)){let{tooltip:r}=this;r&&r.dom.contains(e.relatedTarget)?this.watchTooltipLeave(r.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=r=>{e.removeEventListener("mouseleave",t);let{active:i}=this;i.length&&!this.locked.has(i)&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const j0=4;function HT(n,e){let{left:t,right:r,top:i,bottom:s}=n.getBoundingClientRect(),o;if(o=n.querySelector(".cm-tooltip-arrow")){let a=o.getBoundingClientRect();i=Math.min(a.top,i),s=Math.max(a.bottom,s)}return e.clientX>=t-j0&&e.clientX<=r+j0&&e.clientY>=i-j0&&e.clientY<=s+j0}function FT(n,e,t,r,i,s){let o=n.scrollDOM.getBoundingClientRect(),a=n.documentTop+n.documentPadding.top+n.contentHeight;if(o.left>r||o.right<r||o.top>i||Math.min(o.bottom,a)<i)return!1;let l=n.posAtCoords({x:r,y:i},!1);return l>=e&&l<=t}function qT(n,e={}){let t=ue.define(),r=new WeakMap,i=Tt.define({create(){return[]},update(o,a){let l=r.get(o);if(o.length&&(e.hideOnChange&&(a.docChanged||a.selection)?o=[]:l&&l(a)?o=[]:e.hideOn&&(o=o.filter(c=>!e.hideOn(a,c)))),a.docChanged&&o.length){let c=[];for(let u of o){let h=a.changes.mapPos(u.pos,-1,St.TrackDel);if(h!=null){let d=Object.assign(Object.create(null),u);d.pos=h,d.end!=null&&(d.end=a.changes.mapPos(d.end)),c.push(d)}}o=c}for(let c of a.effects)c.is(t)&&(o=c.value,l=void 0),(c.is(VT)&&!c.value||c.value==i)&&(o=[]);return o.length&&l&&r.set(o,l),o},provide:o=>Ru.from(o)});const s=nt.define(o=>new NT(o,n,i,r,t,e.hoverTime||300));return{active:i,extension:[i,s,s8.of(s),zT]}}function $T(n,e,t,r={}){var i;let s=n.state.facet(s8).map(o=>n.plugin(o)).filter(o=>!!o);if(r.tooltip&&r.tooltip.active){let o=s.find(a=>a.field==r.tooltip.active);o&&(s=[o])}for(let o of s)o.activateHover(n,e,t,(i=r.until)!==null&&i!==void 0?i:(()=>!1))}function o8(n,e){let t=n.plugin(Ym);if(!t)return null;let r=t.manager.tooltips.indexOf(e);return r<0?null:t.manager.tooltipViews[r]}const VT=ue.define(),W4=X.define({combine(n){let e,t;for(let r of n)e=e||r.topContainer,t=t||r.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Ch(n,e){let t=n.plugin(a8),r=t?t.specs.indexOf(e):-1;return r>-1?t.panels[r]:null}const a8=nt.fromClass(class{constructor(n){this.input=n.state.facet(Al),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(W4);this.top=new G0(n,!0,e.topContainer),this.bottom=new G0(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(W4);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new G0(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new G0(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Al);if(t!=this.input){let r=t.filter(l=>l),i=[],s=[],o=[],a=[];for(let l of r){let c=this.specs.indexOf(l),u;c<0?(u=l(n.view),a.push(u)):(u=this.panels[c],u.update&&u.update(n)),i.push(u),(u.top?s:o).push(u)}this.specs=r,this.panels=i,this.top.sync(s),this.bottom.sync(o);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>Z.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class G0{constructor(e,t,r){this.view=e,this.top=t,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=j4(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=j4(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function j4(n){let e=n.nextSibling;return n.remove(),e}const Al=X.define({enables:a8});function WT(n,e){let t,r=new Promise(o=>t=o),i=o=>GT(o,e,t);n.state.field(_c,!1)?n.dispatch({effects:l8.of(i)}):n.dispatch({effects:ue.appendConfig.of(_c.init(()=>[i]))});let s=c8.of(i);return{close:s,result:r.then(o=>((n.win.queueMicrotask||(l=>n.win.setTimeout(l,10)))(()=>{n.state.field(_c).indexOf(i)>-1&&n.dispatch({effects:s})}),o))}}function jT(n,e){let t=n.state.field(_c,!1)||[];for(let r of t){let i=Ch(n,r);if(i&&i.dom.classList.contains(e))return i}return null}const _c=Tt.define({create(){return[]},update(n,e){for(let t of e.effects)t.is(l8)?n=[t.value].concat(n):t.is(c8)&&(n=n.filter(r=>r!=t.value));return n},provide:n=>Al.computeN([n],e=>e.field(n))}),l8=ue.define(),c8=ue.define();function GT(n,e,t){let r=e.content?e.content(n,()=>o(null)):null;if(!r){if(r=_e("form"),e.input){let a=_e("input",e.input);/^(text|password|number|email|tel|url)$/.test(a.type)&&a.classList.add("cm-textfield"),a.name||(a.name="input"),r.appendChild(_e("label",(e.label||"")+": ",a))}else r.appendChild(document.createTextNode(e.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(_e("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let i=r.nodeName=="FORM"?[r]:r.querySelectorAll("form");for(let a=0;a<i.length;a++){let l=i[a];l.addEventListener("keydown",c=>{c.keyCode==27?(c.preventDefault(),o(null)):c.keyCode==13&&(c.preventDefault(),o(l))}),l.addEventListener("submit",c=>{c.preventDefault(),o(l)})}let s=_e("div",r,_e("button",{onclick:()=>o(null),"aria-label":n.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(s.className=e.class),s.classList.add("cm-dialog");function o(a){s.contains(s.ownerDocument.activeElement)&&n.focus(),t(a)}return{dom:s,top:e.top,mount:()=>{if(e.focus){let a;typeof e.focus=="string"?a=r.querySelector(e.focus):a=r.querySelector("input")||r.querySelector("button"),a&&"select"in a?a.select():a&&"focus"in a&&a.focus()}}}}class $r extends Si{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}$r.prototype.elementClass="";$r.prototype.toDOM=void 0;$r.prototype.mapMode=St.TrackBefore;$r.prototype.startSide=$r.prototype.endSide=-1;$r.prototype.point=!0;const Ic=X.define(),UT=X.define(),KT={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>me.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},dl=X.define();function XT(n){return[u8(),dl.of({...KT,...n})]}const G4=X.define({combine:n=>n.some(e=>e)});function u8(n){return[YT]}const YT=nt.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(dl).map(e=>new K4(n,e)),this.fixed=!n.state.facet(G4);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,r=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(r<(t.to-t.from)*.8)}if(n.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(G4)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=me.iter(this.view.state.facet(Ic),this.view.viewport.from),r=[],i=this.gutters.map(s=>new ZT(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(s.type)){let o=!0;for(let a of s.type)if(a.type==At.Text&&o){hp(t,r,a.from);for(let l of i)l.line(this.view,a,r);o=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(s.type==At.Text){hp(t,r,s.from);for(let o of i)o.line(this.view,s,r)}else if(s.widget)for(let o of i)o.widget(this.view,s);for(let s of i)s.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(dl),t=n.state.facet(dl),r=n.docChanged||n.heightChanged||n.viewportChanged||!me.eq(n.startState.facet(Ic),n.state.facet(Ic),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let i of this.gutters)i.update(n)&&(r=!0);else{r=!0;let i=[];for(let s of t){let o=e.indexOf(s);o<0?i.push(new K4(this.view,s)):(this.gutters[o].update(n),i.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),i.indexOf(s)<0&&s.destroy();for(let s of i)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=i}return r}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>Z.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let r=t.dom.offsetWidth*e.scaleX,i=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Pe.LTR?{left:r,right:i}:{right:r,left:i}})});function U4(n){return Array.isArray(n)?n:[n]}function hp(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class ZT{constructor(e,t,r){this.gutter=e,this.height=r,this.i=0,this.cursor=me.iter(e.markers,t.from)}addElement(e,t,r){let{gutter:i}=this,s=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==i.elements.length){let a=new h8(e,o,s,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,o,s,r);this.height=t.bottom,this.i++}line(e,t,r){let i=[];hp(this.cursor,i,t.from),r.length&&(i=i.concat(r));let s=this.gutter.config.lineMarker(e,t,i);s&&i.unshift(s);let o=this.gutter;i.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,i)}widget(e,t){let r=this.gutter.config.widgetMarker(e,t.widget,t),i=r?[r]:null;for(let s of e.state.facet(UT)){let o=s(e,t.widget,t);o&&(i||(i=[])).push(o)}i&&this.addElement(e,t,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class K4{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in t.domEventHandlers)this.dom.addEventListener(r,i=>{let s=i.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let l=s.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=i.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=U4(t.markers(e)),t.initialSpacer&&(this.spacer=new h8(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=U4(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!me.eq(this.markers,t,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class h8{constructor(e,t,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,r,i)}update(e,t,r,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),JT(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let r="cm-gutterElement",i=this.dom.firstChild;for(let s=0,o=0;;){let a=o,l=s<t.length?t[s++]:null,c=!1;if(l){let u=l.elementClass;u&&(r+=" "+u);for(let h=o;h<this.markers.length;h++)if(this.markers[h].compare(l)){a=h,c=!0;break}}else a=this.markers.length;for(;o<a;){let u=this.markers[o++];if(u.toDOM){u.destroy(i);let h=i.nextSibling;i.remove(),i=h}}if(!l)break;l.toDOM&&(c?i=i.nextSibling:this.dom.insertBefore(l.toDOM(e),i)),c&&o++}this.dom.className=r,this.markers=t}destroy(){this.setMarkers(null,[])}}function JT(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const QT=X.define(),eE=X.define(),oo=X.define({combine(n){return wr(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let r=Object.assign({},e);for(let i in t){let s=r[i],o=t[i];r[i]=s?(a,l,c)=>s(a,l,c)||o(a,l,c):o}return r}})}});class Bd extends $r{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Dd(n,e){return n.state.facet(oo).formatNumber(e,n.state)}const tE=dl.compute([oo],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(QT)},lineMarker(e,t,r){return r.some(i=>i.toDOM)?null:new Bd(Dd(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,r)=>{for(let i of e.state.facet(eE)){let s=i(e,t,r);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(oo)!=e.state.facet(oo),initialSpacer(e){return new Bd(Dd(e,X4(e.state.doc.lines)))},updateSpacer(e,t){let r=Dd(t.view,X4(t.view.state.doc.lines));return r==e.number?e:new Bd(r)},domEventHandlers:n.facet(oo).domEventHandlers,side:"before"}));function nE(n={}){return[oo.of(n),u8(),tE]}function X4(n){let e=9;for(;e<n;)e=e*10+9;return e}const rE=new class extends $r{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},iE=Ic.compute(["selection"],n=>{let e=[],t=-1;for(let r of n.selection.ranges){let i=n.doc.lineAt(r.head).from;i>t&&(t=i,e.push(rE.range(i)))}return me.of(e)});function sE(){return iE}let oE=0;class xn{constructor(e,t,r,i){this.name=e,this.set=t,this.base=r,this.modified=i,this.id=oE++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let r=typeof e=="string"?e:"?";if(e instanceof xn&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let i=new xn(r,[],null,[]);if(i.set.push(i),t)for(let s of t.set)i.set.push(s);return i}static defineModifier(e){let t=new zu(e);return r=>r.modified.indexOf(t)>-1?r:zu.get(r.base||r,r.modified.concat(t).sort((i,s)=>i.id-s.id))}}let aE=0;class zu{constructor(e){this.name=e,this.instances=[],this.id=aE++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(a=>a.base==e&&lE(t,a.modified));if(r)return r;let i=[],s=new xn(e.name,i,e,t);for(let a of t)a.instances.push(s);let o=cE(t);for(let a of e.set)if(!a.modified.length)for(let l of o)i.push(zu.get(a,l));return s}}function lE(n,e){return n.length==e.length&&n.every((t,r)=>t==e[r])}function cE(n){let e=[[]];for(let t=0;t<n.length;t++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(n[t]));return e.sort((t,r)=>r.length-t.length)}function uE(n){let e=Object.create(null);for(let t in n){let r=n[t];Array.isArray(r)||(r=[r]);for(let i of t.split(" "))if(i){let s=[],o=2,a=i;for(let h=0;;){if(a=="..."&&h>0&&h+3==i.length){o=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+i);if(s.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),h+=d[0].length,h==i.length)break;let f=i[h++];if(h==i.length&&f=="!"){o=0;break}if(f!="/")throw new RangeError("Invalid path: "+i);a=i.slice(h)}let l=s.length-1,c=s[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new Ml(r,o,l>0?s.slice(0,l):null);e[c]=u.sort(e[c])}}return d8.add(e)}const d8=new de({combine(n,e){let t,r,i;for(;n||e;){if(!n||e&&n.depth<=e.depth?(i=e,e=e.next):(i=n,n=n.next),t&&t.mode==i.mode&&!i.context&&!t.context)continue;let s=new Ml(i.tags,i.mode,i.context);t?t.next=s:r=s,t=s}return r}});class Ml{constructor(e,t,r,i){this.tags=e,this.mode=t,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}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}}Ml.empty=new Ml([],2,null);function f8(n,e){let t=Object.create(null);for(let s of n)if(!Array.isArray(s.tag))t[s.tag.id]=s.class;else for(let o of s.tag)t[o.id]=s.class;let{scope:r,all:i=null}=e||{};return{style:s=>{let o=i;for(let a of s)for(let l of a.set){let c=t[l.id];if(c){o=o?o+" "+c:c;break}}return o},scope:r}}function hE(n,e){let t=null;for(let r of n){let i=r.style(e);i&&(t=t?t+" "+i:i)}return t}function dE(n,e,t,r=0,i=n.length){let s=new fE(r,Array.isArray(e)?e:[e],t);s.highlightRange(n.cursor(),r,i,"",s.highlighters),s.flush(i)}class fE{constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,i,s){let{type:o,from:a,to:l}=e;if(a>=r||l<=t)return;o.isTop&&(s=this.highlighters.filter(f=>!f.scope||f.scope(o)));let c=i,u=pE(e)||Ml.empty,h=hE(s,u.tags);if(h&&(c&&(c+=" "),c+=h,u.mode==1&&(i+=(i?" ":"")+h)),this.startSpan(Math.max(t,a),c),u.opaque)return;let d=e.tree&&e.tree.prop(de.mounted);if(d&&d.overlay){let f=e.node.enter(d.overlay[0].from+a,1),m=this.highlighters.filter(y=>!y.scope||y.scope(d.tree.type)),g=e.firstChild();for(let y=0,b=a;;y++){let x=y<d.overlay.length?d.overlay[y]:null,C=x?x.from+a:l,E=Math.max(t,b),S=Math.min(r,C);if(E<S&&g)for(;e.from<S&&(this.highlightRange(e,E,S,i,s),this.startSpan(Math.min(S,e.to),c),!(e.to>=C||!e.nextSibling())););if(!x||C>r)break;b=x.to+a,b>t&&(this.highlightRange(f.cursor(),Math.max(t,x.from+a),Math.min(r,b),"",m),this.startSpan(Math.min(r,b),c))}g&&e.parent()}else if(e.firstChild()){d&&(i="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,i,s),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function pE(n){let e=n.type.prop(d8);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const U=xn.define,U0=U(),ci=U(),Y4=U(ci),Z4=U(ci),ui=U(),K0=U(ui),Od=U(ui),Qn=U(),ji=U(Qn),Xn=U(),Yn=U(),dp=U(),ka=U(dp),X0=U(),H={comment:U0,lineComment:U(U0),blockComment:U(U0),docComment:U(U0),name:ci,variableName:U(ci),typeName:Y4,tagName:U(Y4),propertyName:Z4,attributeName:U(Z4),className:U(ci),labelName:U(ci),namespace:U(ci),macroName:U(ci),literal:ui,string:K0,docString:U(K0),character:U(K0),attributeValue:U(K0),number:Od,integer:U(Od),float:U(Od),bool:U(ui),regexp:U(ui),escape:U(ui),color:U(ui),url:U(ui),keyword:Xn,self:U(Xn),null:U(Xn),atom:U(Xn),unit:U(Xn),modifier:U(Xn),operatorKeyword:U(Xn),controlKeyword:U(Xn),definitionKeyword:U(Xn),moduleKeyword:U(Xn),operator:Yn,derefOperator:U(Yn),arithmeticOperator:U(Yn),logicOperator:U(Yn),bitwiseOperator:U(Yn),compareOperator:U(Yn),updateOperator:U(Yn),definitionOperator:U(Yn),typeOperator:U(Yn),controlOperator:U(Yn),punctuation:dp,separator:U(dp),bracket:ka,angleBracket:U(ka),squareBracket:U(ka),paren:U(ka),brace:U(ka),content:Qn,heading:ji,heading1:U(ji),heading2:U(ji),heading3:U(ji),heading4:U(ji),heading5:U(ji),heading6:U(ji),contentSeparator:U(Qn),list:U(Qn),quote:U(Qn),emphasis:U(Qn),strong:U(Qn),link:U(Qn),monospace:U(Qn),strikethrough:U(Qn),inserted:U(),deleted:U(),changed:U(),invalid:U(),meta:X0,documentMeta:U(X0),annotation:U(X0),processingInstruction:U(X0),definition:xn.defineModifier("definition"),constant:xn.defineModifier("constant"),function:xn.defineModifier("function"),standard:xn.defineModifier("standard"),local:xn.defineModifier("local"),special:xn.defineModifier("special")};for(let n in H){let e=H[n];e instanceof xn&&(e.name=n)}f8([{tag:H.link,class:"tok-link"},{tag:H.heading,class:"tok-heading"},{tag:H.emphasis,class:"tok-emphasis"},{tag:H.strong,class:"tok-strong"},{tag:H.keyword,class:"tok-keyword"},{tag:H.atom,class:"tok-atom"},{tag:H.bool,class:"tok-bool"},{tag:H.url,class:"tok-url"},{tag:H.labelName,class:"tok-labelName"},{tag:H.inserted,class:"tok-inserted"},{tag:H.deleted,class:"tok-deleted"},{tag:H.literal,class:"tok-literal"},{tag:H.string,class:"tok-string"},{tag:H.number,class:"tok-number"},{tag:[H.regexp,H.escape,H.special(H.string)],class:"tok-string2"},{tag:H.variableName,class:"tok-variableName"},{tag:H.local(H.variableName),class:"tok-variableName tok-local"},{tag:H.definition(H.variableName),class:"tok-variableName tok-definition"},{tag:H.special(H.variableName),class:"tok-variableName2"},{tag:H.definition(H.propertyName),class:"tok-propertyName tok-definition"},{tag:H.typeName,class:"tok-typeName"},{tag:H.namespace,class:"tok-namespace"},{tag:H.className,class:"tok-className"},{tag:H.macroName,class:"tok-macroName"},{tag:H.propertyName,class:"tok-propertyName"},{tag:H.operator,class:"tok-operator"},{tag:H.comment,class:"tok-comment"},{tag:H.meta,class:"tok-meta"},{tag:H.invalid,class:"tok-invalid"},{tag:H.punctuation,class:"tok-punctuation"}]);function J4(n,e,t,r=0,i=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let s=i;for(let o=r;o<e;o++)n.charCodeAt(o)==9?s+=t-s%t:s++;return s}class p8{constructor(e,t,r,i){this.string=e,this.tabSize=t,this.indentUnit=r,this.overrideIndent=i,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}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),r;if(typeof e=="string"?r=t==e:r=t&&(e instanceof RegExp?e.test(t):e(t)),r)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=J4(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:J4(this.string,null,this.tabSize)}match(e,t,r){if(typeof e=="string"){let i=o=>r?o.toLowerCase():o,s=this.string.substr(this.pos,e.length);return i(s)==i(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&t!==!1&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}}var Pd;const hs=new de;function m8(n){return X.define({combine:n?e=>e.concat(n):void 0})}const mE=new de;class Mn{constructor(e,t,r=[],i=""){this.data=e,this.name=i,ve.prototype.hasOwnProperty("tree")||Object.defineProperty(ve.prototype,"tree",{get(){return Mt(this)}}),this.parser=t,this.extension=[Ti.of(this),ve.languageData.of((s,o,a)=>{let l=Q4(s,o,a),c=l.type.prop(hs);if(!c)return[];let u=s.facet(c),h=l.type.prop(mE);if(h){let d=l.resolve(o-l.from,a);for(let f of h)if(f.test(d,s)){let m=s.facet(f.facet);return f.type=="replace"?m:m.concat(u)}}return u})].concat(r)}isActiveAt(e,t,r=-1){return Q4(e,t,r).type.prop(hs)==this.data}findRegions(e){let t=e.facet(Ti);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],i=(s,o)=>{if(s.prop(hs)==this.data){r.push({from:o,to:o+s.length});return}let a=s.prop(de.mounted);if(a){if(a.tree.prop(hs)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+o,to:l.to+o});else r.push({from:o,to:o+s.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+o),r.length>l)return}}for(let l=0;l<s.children.length;l++){let c=s.children[l];c instanceof Oe&&i(c,s.positions[l]+o)}};return i(Mt(e),0),r}get allowsNesting(){return!0}}Mn.setState=ue.define();function Q4(n,e,t){let r=n.facet(Ti),i=Mt(n).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,t,Ee.ExcludeBuffers|Ee.EnterBracketed))s.type.isTop&&(i=s);return i}class fp extends Mn{constructor(e,t,r){super(e,t,[],r),this.parser=t}static define(e){let t=m8(e.languageData);return new fp(t,e.parser.configure({props:[hs.add(r=>r.isTop?t:void 0)]}),e.name)}configure(e,t){return new fp(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Mt(n){let e=n.field(Mn.state,!1);return e?e.tree:Oe.empty}class gE{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 r=this.cursorPos-this.string.length;return e<r||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let Ca=null;class _o{constructor(e,t,r=[],i,s,o,a,l){this.parser=e,this.state=t,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new _o(e,t,[],Oe.empty,0,r,[],null)}startParse(){return this.parser.startParse(new gE(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Oe.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(zr.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||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(zr.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Ca;Ca=this;try{return e()}finally{Ca=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=e5(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:i,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,h,d)=>l.push({fromA:c,toA:u,fromB:h,toB:d})),r=zr.applyChanges(r,l),i=Oe.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),h=e.mapPos(c.to,-1);u<h&&a.push({from:u,to:h})}}}return new _o(this.parser,t,r,i,s,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=e5(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(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 z7{createParse(t,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let l=Ca;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=o,new Oe(Wt.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&&t[0].from==0&&t[0].to>=e}static get(){return Ca}}function e5(n,e,t){return zr.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Io{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),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new Io(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=_o.create(e.facet(Ti).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new Io(r)}}Mn.state=Tt.define({create:Io.init,update(n,e){for(let t of e.effects)if(t.is(Mn.setState))return t.value;return e.startState.facet(Ti)!=e.state.facet(Ti)?Io.init(e.state):n.apply(e)}});let g8=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(g8=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const Rd=typeof navigator<"u"&&(!((Pd=navigator.scheduling)===null||Pd===void 0)&&Pd.isInputPending)?()=>navigator.scheduling.isInputPending():null,vE=nt.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(Mn.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(Mn.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=g8(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:r,viewport:{to:i}}=this.view,s=r.field(Mn.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!Rd?Math.max(25,e.timeRemaining()-5):1e9),a=s.context.treeLen<i&&r.doc.length>i+1e3,l=s.context.work(()=>Rd&&Rd()||Date.now()>o,i+(a?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Mn.setState.of(new Io(s.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Jt(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ti=X.define({combine(n){return n.length?n[0]:null},enables:n=>[Mn.state,vE,Z.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class yE{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class P{constructor(e,t,r,i,s,o=void 0){this.name=e,this.alias=t,this.extensions=r,this.filename=i,this.loadFunc=s,this.support=o,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:r}=e;if(!t){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(r)}return new P(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,t,r)}static matchFilename(e,t){for(let i of e)if(i.filename&&i.filename.test(t))return i;let r=/\.([^.]+)$/.exec(t);if(r){for(let i of e)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(e,t,r=!0){t=t.toLowerCase();for(let i of e)if(i.alias.some(s=>s==t))return i;if(r)for(let i of e)for(let s of i.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return i}return null}}const bE=X.define(),Sh=X.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Ms(n){let e=n.facet(Sh);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Tl(n,e){let t="",r=n.tabSize,i=n.facet(Sh)[0];if(i==" "){for(;e>=r;)t+=" ",e-=r;i=" "}for(let s=0;s<e;s++)t+=i;return t}function Jm(n,e){n instanceof ve&&(n=new Ah(n));for(let r of n.state.facet(bE)){let i=r(n,e);if(i!==void 0)return i}let t=Mt(n.state);return t.length>=e?wE(n,t,e):null}class Ah{constructor(e,t={}){this.state=e,this.options=t,this.unit=Ms(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(t<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,t);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,t=1){let{text:r,from:i}=this.lineAt(e,t),s=this.countColumn(r,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(s+=o-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,t=e.length){return jo(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:i}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(i);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const v8=new de;function wE(n,e,t){let r=e.resolveStack(t),i=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(i!=r.node){let s=[];for(let o=i;o&&!(o.from<r.node.from||o.to>r.node.to||o.from==r.node.from&&o.type==r.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return y8(r,n,t)}function y8(n,e,t){for(let r=n;r;r=r.next){let i=kE(r.node);if(i)return i(Qm.create(e,t,r))}return 0}function xE(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function kE(n){let e=n.type.prop(v8);if(e)return e;let t=n.firstChild,r;if(t&&(r=t.type.prop(de.closedBy))){let i=n.lastChild,s=i&&r.indexOf(i.name)>-1;return o=>b8(o,!0,1,void 0,s&&!xE(o)?i.from:void 0)}return n.parent==null?CE:null}function CE(){return 0}class Qm extends Ah{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new Qm(e,t,r)}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 r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(SE(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return y8(this.context.next,this.base,this.pos)}}function SE(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function AE(n){let e=n.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let i=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let a=t.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=o)return null;let c=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+c}}a=l.to}}function Kq({closing:n,align:e=!0,units:t=1}){return r=>b8(r,e,t,n)}function b8(n,e,t,r,i){let s=n.textAfter,o=s.match(/^\s*/)[0].length,a=r&&s.slice(o,o+r.length)==r||i==n.pos+o,l=e?AE(n):null;return l?a?n.column(l.from):n.column(l.to):n.baseIndent+(a?0:n.unit*t)}const Xq=n=>n.baseIndent;function Yq({except:n,units:e=1}={}){return t=>{let r=n&&n.test(t.textAfter);return t.baseIndent+(r?0:e*t.unit)}}const ME=200;function TE(){return ve.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:r}=n.newSelection.main,i=t.lineAt(r);if(r>i.from+ME)return n;let s=t.sliceString(i.from,r);if(!e.some(c=>c.test(s)))return n;let{state:o}=n,a=-1,l=[];for(let{head:c}of o.selection.ranges){let u=o.doc.lineAt(c);if(u.from==a)continue;a=u.from;let h=Jm(o,u.from);if(h==null)continue;let d=/^\s*/.exec(u.text)[0],f=Tl(o,h);d!=f&&l.push({from:u.from,to:u.from+d.length,insert:f})}return l.length?[n,{changes:l,sequential:!0}]:n})}const EE=X.define(),_E=new de;function Zq(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function IE(n,e,t){let r=Mt(n);if(r.length<t)return null;let i=r.resolveStack(t,1),s=null;for(let o=i;o;o=o.next){let a=o.node;if(a.to<=t||a.from>t)continue;if(s&&a.from<e)break;let l=a.type.prop(_E);if(l&&(a.to<r.length-50||r.length==n.doc.length||!LE(a))){let c=l(a,n);c&&c.from<=t&&c.from>=e&&c.to>t&&(s=c)}}return s}function LE(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function Nu(n,e,t){for(let r of n.facet(EE)){let i=r(n,e,t);if(i)return i}return IE(n,e,t)}function w8(n,e){let t=e.mapPos(n.from,1),r=e.mapPos(n.to,-1);return t>=r?void 0:{from:t,to:r}}const Mh=ue.define({map:w8}),n0=ue.define({map:w8});function x8(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(r=>r.from<=t&&r.to>=t)||e.push(n.lineBlockAt(t));return e}const Ts=Tt.define({create(){return oe.none},update(n,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((r,i)=>n=t5(n,r,i)),n=n.map(e.changes);let t=[];for(let r of e.effects)r.is(Mh)&&!BE(n,r.value.from,r.value.to)?t.push(r.value):r.is(n0)&&(n=n.update({filter:(i,s)=>r.value.from!=i||r.value.to!=s,filterFrom:r.value.from,filterTo:r.value.to}));if(t.length){let{preparePlaceholder:r}=e.state.facet(S8),i=t.map(s=>(r?oe.replace({widget:new HE(r(e.state,s))}):n5).range(s.from,s.to));n=n.update({add:i})}return e.selection&&(n=t5(n,e.selection.main.head)),n},provide:n=>Z.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(r,i)=>{t.push(r,i)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let r=n[t++],i=n[t++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(n5.range(r,i))}return oe.set(e,!0)}});function t5(n,e,t=e){let r=!1;return n.between(e,t,(i,s)=>{i<t&&s>e&&(r=!0)}),r?n.update({filterFrom:e,filterTo:t,filter:(i,s)=>i>=t||s<=e}):n}function Hu(n,e,t){var r;let i=null;return(r=n.field(Ts,!1))===null||r===void 0||r.between(e,t,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function BE(n,e,t){let r=!1;return n.between(e,e,(i,s)=>{i==e&&s==t&&(r=!0)}),r}function k8(n,e){return n.field(Ts,!1)?e:e.concat(ue.appendConfig.of(A8()))}const DE=n=>{for(let e of x8(n)){let t=Nu(n.state,e.from,e.to);if(t)return n.dispatch({effects:k8(n.state,[Mh.of(t),C8(n,t)])}),!0}return!1},OE=n=>{if(!n.state.field(Ts,!1))return!1;let e=[];for(let t of x8(n)){let r=Hu(n.state,t.from,t.to);r&&e.push(n0.of(r),C8(n,r,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function C8(n,e,t=!0){let r=n.state.doc.lineAt(e.from).number,i=n.state.doc.lineAt(e.to).number;return Z.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${r} ${n.state.phrase("to")} ${i}.`)}const PE=n=>{let{state:e}=n,t=[];for(let r=0;r<e.doc.length;){let i=n.lineBlockAt(r),s=Nu(e,i.from,i.to);s&&t.push(Mh.of(s)),r=(s?n.lineBlockAt(s.to):i).to+1}return t.length&&n.dispatch({effects:k8(n.state,t)}),!!t.length},RE=n=>{let e=n.state.field(Ts,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(r,i)=>{t.push(n0.of({from:r,to:i}))}),n.dispatch({effects:t}),!0},zE=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:DE},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:OE},{key:"Ctrl-Alt-[",run:PE},{key:"Ctrl-Alt-]",run:RE}],NE={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},S8=X.define({combine(n){return wr(n,NE)}});function A8(n){return[Ts,$E]}function M8(n,e){let{state:t}=n,r=t.facet(S8),i=o=>{let a=n.lineBlockAt(n.posAtDOM(o.target)),l=Hu(n.state,a.from,a.to);l&&n.dispatch({effects:n0.of(l)}),o.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(n,i,e);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const n5=oe.replace({widget:new class extends xr{toDOM(n){return M8(n,null)}}});class HE extends xr{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return M8(e,this.value)}}const FE={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class zd extends $r{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 qE(n={}){let e={...FE,...n},t=new zd(e,!0),r=new zd(e,!1),i=nt.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Ti)!=o.state.facet(Ti)||o.startState.field(Ts,!1)!=o.state.field(Ts,!1)||Mt(o.startState)!=Mt(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let a=new fr;for(let l of o.viewportLineBlocks){let c=Hu(o.state,l.from,l.to)?r:Nu(o.state,l.from,l.to)?t:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:s}=e;return[i,XT({class:"cm-foldGutter",markers(o){var a;return((a=o.plugin(i))===null||a===void 0?void 0:a.markers)||me.empty},initialSpacer(){return new zd(e,!1)},domEventHandlers:{...s,click:(o,a,l)=>{if(s.click&&s.click(o,a,l))return!0;let c=Hu(o.state,a.from,a.to);if(c)return o.dispatch({effects:n0.of(c)}),!0;let u=Nu(o.state,a.from,a.to);return u?(o.dispatch({effects:Mh.of(u)}),!0):!1}}}),A8()]}const $E=Z.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 r0{constructor(e,t){this.specs=e;let r;function i(a){let l=Ai.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const s=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,o=t.scope;this.scope=o instanceof Mn?a=>a.prop(hs)==o.data:o?a=>a==o:void 0,this.style=f8(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=r?new Ai(r):null,this.themeType=t.themeType}static define(e,t){return new r0(e,t||{})}}const pp=X.define(),T8=X.define({combine(n){return n.length?[n[0]]:null}});function Nd(n){let e=n.facet(pp);return e.length?e:n.facet(T8)}function E8(n,e){let t=[WE],r;return n instanceof r0&&(n.module&&t.push(Z.styleModule.of(n.module)),r=n.themeType),e?.fallback?t.push(T8.of(n)):r?t.push(pp.computeN([Z.darkTheme],i=>i.facet(Z.darkTheme)==(r=="dark")?[n]:[])):t.push(pp.of(n)),t}class VE{constructor(e){this.markCache=Object.create(null),this.tree=Mt(e.state),this.decorations=this.buildDeco(e,Nd(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Mt(e.state),r=Nd(e.state),i=r!=Nd(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<s.to&&!i&&t.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return oe.none;let r=new fr;for(let{from:i,to:s}of e.visibleRanges)dE(this.tree,t,(o,a,l)=>{r.add(o,a,this.markCache[l]||(this.markCache[l]=oe.mark({class:l})))},i,s);return r.finish()}}const WE=Pi.high(nt.fromClass(VE,{decorations:n=>n.decorations})),jE=r0.define([{tag:H.meta,color:"#404740"},{tag:H.link,textDecoration:"underline"},{tag:H.heading,textDecoration:"underline",fontWeight:"bold"},{tag:H.emphasis,fontStyle:"italic"},{tag:H.strong,fontWeight:"bold"},{tag:H.strikethrough,textDecoration:"line-through"},{tag:H.keyword,color:"#708"},{tag:[H.atom,H.bool,H.url,H.contentSeparator,H.labelName],color:"#219"},{tag:[H.literal,H.inserted],color:"#164"},{tag:[H.string,H.deleted],color:"#a11"},{tag:[H.regexp,H.escape,H.special(H.string)],color:"#e40"},{tag:H.definition(H.variableName),color:"#00f"},{tag:H.local(H.variableName),color:"#30a"},{tag:[H.typeName,H.namespace],color:"#085"},{tag:H.className,color:"#167"},{tag:[H.special(H.variableName),H.macroName],color:"#256"},{tag:H.definition(H.propertyName),color:"#00c"},{tag:H.comment,color:"#940"},{tag:H.invalid,color:"#f00"}]),GE=Z.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),_8=1e4,I8="()[]{}",L8=X.define({combine(n){return wr(n,{afterCursor:!0,brackets:I8,maxScanDistance:_8,renderMatch:XE})}}),UE=oe.mark({class:"cm-matchingBracket"}),KE=oe.mark({class:"cm-nonmatchingBracket"});function XE(n){let e=[],t=n.matched?UE:KE;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}function r5(n){let e=[],t=n.facet(L8);for(let r of n.selection.ranges){if(!r.empty)continue;let i=cr(n,r.head,-1,t)||r.head>0&&cr(n,r.head-1,1,t)||t.afterCursor&&(cr(n,r.head,1,t)||r.head<n.doc.length&&cr(n,r.head+1,-1,t));i&&(e=e.concat(t.renderMatch(i,n)))}return oe.set(e,!0)}const YE=nt.fromClass(class{constructor(n){this.paused=!1,this.decorations=r5(n.state)}update(n){(n.docChanged||n.selectionSet||this.paused)&&(n.view.composing?(this.decorations=this.decorations.map(n.changes),this.paused=!0):(this.decorations=r5(n.state),this.paused=!1))}},{decorations:n=>n.decorations}),ZE=[YE,GE];function JE(n={}){return[L8.of(n),ZE]}const QE=new de;function mp(n,e,t){let r=n.prop(e<0?de.openedBy:de.closedBy);if(r)return r;if(n.name.length==1){let i=t.indexOf(n.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function gp(n){let e=n.type.prop(QE);return e?e(n.node):n}function cr(n,e,t,r={}){let i=r.maxScanDistance||_8,s=r.brackets||I8,o=Mt(n),a=o.resolveInner(e,t);for(let l=a;l;l=l.parent){let c=mp(l.type,t,s);if(c&&l.from<l.to){let u=gp(l);if(u&&(t>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return e_(n,e,t,l,u,c,s)}}return t_(n,e,t,o,a.type,i,s)}function e_(n,e,t,r,i,s,o){let a=r.parent,l={from:i.from,to:i.to},c=0,u=a?.cursor();if(u&&(t<0?u.childBefore(r.from):u.childAfter(r.to)))do if(t<0?u.to<=r.from:u.from>=r.to){if(c==0&&s.indexOf(u.type.name)>-1&&u.from<u.to){let h=gp(u);return{start:l,end:h?{from:h.from,to:h.to}:void 0,matched:!0}}else if(mp(u.type,t,o))c++;else if(mp(u.type,-t,o)){if(c==0){let h=gp(u);return{start:l,end:h&&h.from<h.to?{from:h.from,to:h.to}:void 0,matched:!1}}c--}}while(t<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}function t_(n,e,t,r,i,s,o){if(t<0?!e:e==n.doc.length)return null;let a=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),l=o.indexOf(a);if(l<0||l%2==0!=t>0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},u=n.doc.iterRange(e,t>0?n.doc.length:0),h=0;for(let d=0;!u.next().done&&d<=s;){let f=u.value;t<0&&(d+=f.length);let m=e+d*t;for(let g=t>0?0:f.length-1,y=t>0?f.length:-1;g!=y;g+=t){let b=o.indexOf(f[g]);if(!(b<0||r.resolveInner(m+g,1).type!=i))if(b%2==0==t>0)h++;else{if(h==1)return{start:c,end:{from:m+g,to:m+g+1},matched:b>>1==l>>1};h--}}t>0&&(d+=f.length)}return u.done?{start:c,matched:!1}:null}function n_(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||r_,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||n1,mergeTokens:n.mergeTokens!==!1}}function r_(n){if(typeof n!="object")return n;let e={};for(let t in n){let r=n[t];e[t]=r instanceof Array?r.slice():r}return e}const i5=new WeakMap;class e1 extends Mn{constructor(e){let t=m8(e.languageData),r=n_(e),i,s=new class extends z7{createParse(o,a,l){return new s_(i,o,a,l)}};super(t,s,[],e.name),this.topNode=l_(t,this),i=this,this.streamParser=r,this.stateAfter=new de({perNode:!0}),this.tokenTable=e.tokenTable?new P8(r.tokenTable):a_}static define(e){return new e1(e)}getIndent(e){let t,{overrideIndentation:r}=e.options;r&&(t=i5.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let i=t1(this,e.node.tree,e.node.from,e.node.from,t??e.pos),s,o;if(i?(o=i.state,s=i.pos+1):(o=this.streamParser.startState(e.unit),s=e.node.from),e.pos-s>1e4)return null;for(;s<e.pos;){let l=e.state.doc.lineAt(s),c=Math.min(e.pos,l.to);if(l.length){let u=r?r(l.from):-1,h=new p8(l.text,e.state.tabSize,e.unit,u<0?void 0:u);for(;h.pos<c-l.from;)D8(this.streamParser.token,h,o)}else this.streamParser.blankLine(o,e.unit);if(c==e.pos)break;s=l.to+1}let a=e.lineAt(e.pos);return r&&t==null&&i5.set(e.state,a.from),this.streamParser.indent(o,/^\s*(.*)/.exec(a.text)[1],e)}get allowsNesting(){return!1}}function t1(n,e,t,r,i){let s=t>=r&&t+e.length<=i&&e.prop(n.stateAfter);if(s)return{state:n.streamParser.copyState(s),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let a=e.children[o],l=t+e.positions[o],c=a instanceof Oe&&l<i&&t1(n,a,l,r,i);if(c)return c}return null}function B8(n,e,t,r,i){if(i&&t<=0&&r>=e.length)return e;!i&&t==0&&e.type==n.topNode&&(i=!0);for(let s=e.children.length-1;s>=0;s--){let o=e.positions[s],a=e.children[s],l;if(o<r&&a instanceof Oe){if(!(l=B8(n,a,t-o,r-o,i)))break;return i?new Oe(e.type,e.children.slice(0,s).concat(l),e.positions.slice(0,s+1),o+l.length):l}}return null}function i_(n,e,t,r,i){for(let s of e){let o=s.from+(s.openStart?25:0),a=s.to-(s.openEnd?25:0),l=o<=t&&a>t&&t1(n,s.tree,0-s.offset,t,a),c;if(l&&l.pos<=r&&(c=B8(n,s.tree,t+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:c}}return{state:n.streamParser.startState(i?Ms(i):4),tree:Oe.empty}}class s_{constructor(e,t,r,i){this.lang=e,this.input=t,this.fragments=r,this.ranges=i,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=i[i.length-1].to;let s=_o.get(),o=i[0].from,{state:a,tree:l}=i_(e,r,o,this.to,s?.state);this.state=a,this.parsedPos=this.chunkStart=o+l.length;for(let c=0;c<l.children.length;c++)this.chunks.push(l.children[c]),this.chunkPos.push(l.positions[c]);s&&this.parsedPos<s.viewport.from-1e5&&i.some(c=>c.from<=s.viewport.from&&c.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(Ms(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let e=_o.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),r=Math.min(t,this.chunkStart+512);for(e&&(r=Math.min(r,e.viewport.to));this.parsedPos<r;)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)t==`
|
|
13
13
|
`&&(t="");else{let r=t.indexOf(`
|
|
14
|
-
`);r>-1&&(t=t.slice(0,r))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),r=e+t.length;for(let i=this.rangeIndex;;){let s=this.ranges[i].to;if(s>=r||(t=t.slice(0,s-(r-t.length)),i++,i==this.ranges.length))break;let o=this.ranges[i].from,a=this.lineAfter(o);t+=a,r=o+a.length}return{line:t,end:r}}skipGapsTo(e,t,r){for(;;){let i=this.ranges[this.rangeIndex].to,s=e+t;if(r>0?i>s:i>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-i}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,r,i){let s=4;if(this.ranges.length>1){i=this.skipGapsTo(t,i,1),t+=i;let a=this.chunk.length;i=this.skipGapsTo(r,i,-1),r+=i,s+=this.chunk.length-a}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=r:this.chunk.push(e,t,r,s),i}parseLine(e){let{line:t,end:r}=this.nextLine(),i=0,{streamParser:s}=this.lang,o=new p8(t,e?e.state.tabSize:4,e?Ms(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=D8(s.token,o,this.state);if(a&&(i=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+o.start,this.parsedPos+o.pos,i)),o.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=Oe.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:o_,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new Oe(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 Oe(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function D8(n,e,t){e.start=e.pos;for(let r=0;r<10;r++){let i=n(e,t);if(e.pos>e.start)return i}throw new Error("Stream parser failed to advance stream.")}const n1=Object.create(null),El=[Wt.none],o_=new Im(El),s5=[],o5=Object.create(null),O8=Object.create(null);for(let[n,e]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"]])O8[n]=R8(n1,e);class P8{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),O8)}resolve(e){return e?this.table[e]||(this.table[e]=R8(this.extra,e)):0}}const a_=new P8(n1);function Hd(n,e){s5.indexOf(n)>-1||(s5.push(n),console.warn(e))}function R8(n,e){let t=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let u=n[c]||H[c];u?typeof u=="function"?l.length?l=l.map(u):Hd(c,`Modifier ${c} used at start of tag`):l.length?Hd(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:Hd(c,`Unknown highlighting tag ${c}`)}for(let c of l)t.push(c)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+t.map(a=>a.id),s=o5[i];if(s)return s.id;let o=o5[i]=Wt.define({id:El.length,name:r,props:[uE({[r]:t})]});return El.push(o),o.id}function l_(n,e){let t=Wt.define({id:El.length,name:"Document",props:[hs.add(()=>n),v8.add(()=>r=>e.getIndent(r))],top:!0});return El.push(t),t}Pe.RTL,Pe.LTR;function F(n){return new yE(e1.define(n))}function Zr(n){return R(()=>import("./assets/index-Cgs3alSt.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(e=>e.sql({dialect:e[n]}))}const c_=[P.of({name:"C",extensions:["c","h","ino"],load(){return R(()=>import("./assets/index-DqPLvEv8.js"),__vite__mapDeps([3,1,2]),import.meta.url).then(n=>n.cpp())}}),P.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return R(()=>import("./assets/index-DqPLvEv8.js"),__vite__mapDeps([3,1,2]),import.meta.url).then(n=>n.cpp())}}),P.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Zr("Cassandra")}}),P.of({name:"CSS",extensions:["css"],load(){return R(()=>import("./assets/index-DickJnaB.js"),__vite__mapDeps([4,1,2]),import.meta.url).then(n=>n.css())}}),P.of({name:"Go",extensions:["go"],load(){return R(()=>import("./assets/index-DvFEir78.js"),__vite__mapDeps([5,1,2]),import.meta.url).then(n=>n.go())}}),P.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return R(()=>import("./assets/index-DgUo7cv1.js"),__vite__mapDeps([6,1,4,2,7]),import.meta.url).then(n=>n.html())}}),P.of({name:"Java",extensions:["java"],load(){return R(()=>import("./assets/index-D4yhPgHm.js"),__vite__mapDeps([8,1,2]),import.meta.url).then(n=>n.java())}}),P.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return R(()=>import("./assets/index-tLrnxT69.js"),__vite__mapDeps([7,1,2]),import.meta.url).then(n=>n.javascript())}}),P.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return R(()=>import("./assets/index-CERUTt28.js"),__vite__mapDeps([9,6,1,4,2,7]),import.meta.url).then(n=>n.jinja())}}),P.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return R(()=>import("./assets/index-Qt71JNB9.js"),__vite__mapDeps([10,1,2]),import.meta.url).then(n=>n.json())}}),P.of({name:"JSX",extensions:["jsx"],load(){return R(()=>import("./assets/index-tLrnxT69.js"),__vite__mapDeps([7,1,2]),import.meta.url).then(n=>n.javascript({jsx:!0}))}}),P.of({name:"LESS",extensions:["less"],load(){return R(()=>import("./assets/index-BfO3YJzD.js"),__vite__mapDeps([11,4,1,2]),import.meta.url).then(n=>n.less())}}),P.of({name:"Liquid",extensions:["liquid"],load(){return R(()=>import("./assets/index-DHqWq6xc.js"),__vite__mapDeps([12,6,1,4,2,7]),import.meta.url).then(n=>n.liquid())}}),P.of({name:"MariaDB SQL",load(){return Zr("MariaSQL")}}),P.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return R(()=>import("./assets/index-Clh0l7tA.js"),__vite__mapDeps([13,6,1,4,2,7]),import.meta.url).then(n=>n.markdown())}}),P.of({name:"MS SQL",load(){return Zr("MSSQL")}}),P.of({name:"MySQL",load(){return Zr("MySQL")}}),P.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return R(()=>import("./assets/index-pGJ67V8L.js"),__vite__mapDeps([14,1,6,4,2,7]),import.meta.url).then(n=>n.php())}}),P.of({name:"PLSQL",extensions:["pls"],load(){return Zr("PLSQL")}}),P.of({name:"PostgreSQL",load(){return Zr("PostgreSQL")}}),P.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return R(()=>import("./assets/index-Vb_uz0jk.js"),__vite__mapDeps([15,1,2]),import.meta.url).then(n=>n.python())}}),P.of({name:"Rust",extensions:["rs"],load(){return R(()=>import("./assets/index-DTBc-iCV.js"),__vite__mapDeps([16,1,2]),import.meta.url).then(n=>n.rust())}}),P.of({name:"Sass",extensions:["sass"],load(){return R(()=>import("./assets/index-Cl8ck_yS.js"),__vite__mapDeps([17,1,4,2]),import.meta.url).then(n=>n.sass({indented:!0}))}}),P.of({name:"SCSS",extensions:["scss"],load(){return R(()=>import("./assets/index-Cl8ck_yS.js"),__vite__mapDeps([17,1,4,2]),import.meta.url).then(n=>n.sass())}}),P.of({name:"SQL",extensions:["sql"],load(){return Zr("StandardSQL")}}),P.of({name:"SQLite",load(){return Zr("SQLite")}}),P.of({name:"TSX",extensions:["tsx"],load(){return R(()=>import("./assets/index-tLrnxT69.js"),__vite__mapDeps([7,1,2]),import.meta.url).then(n=>n.javascript({jsx:!0,typescript:!0}))}}),P.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return R(()=>import("./assets/index-tLrnxT69.js"),__vite__mapDeps([7,1,2]),import.meta.url).then(n=>n.javascript({typescript:!0}))}}),P.of({name:"WebAssembly",extensions:["wat","wast"],load(){return R(()=>import("./assets/index-D96XFM__.js"),__vite__mapDeps([18,1,2]),import.meta.url).then(n=>n.wast())}}),P.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return R(()=>import("./assets/index-DNTDwjMb.js"),__vite__mapDeps([19,1,2]),import.meta.url).then(n=>n.xml())}}),P.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return R(()=>import("./assets/index-BXlZZMOz.js"),__vite__mapDeps([20,1,2]),import.meta.url).then(n=>n.yaml())}}),P.of({name:"APL",extensions:["dyalog","apl"],load(){return R(()=>import("./assets/apl-B4CMkyY2.js"),[],import.meta.url).then(n=>F(n.apl))}}),P.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return R(()=>import("./assets/asciiarmor-Df11BRmG.js"),[],import.meta.url).then(n=>F(n.asciiArmor))}}),P.of({name:"ASN.1",extensions:["asn","asn1"],load(){return R(()=>import("./assets/asn1-EdZsLKOL.js"),[],import.meta.url).then(n=>F(n.asn1({})))}}),P.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return R(()=>import("./assets/asterisk-B-8jnY81.js"),[],import.meta.url).then(n=>F(n.asterisk))}}),P.of({name:"Brainfuck",extensions:["b","bf"],load(){return R(()=>import("./assets/brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(n=>F(n.brainfuck))}}),P.of({name:"Cobol",extensions:["cob","cpy"],load(){return R(()=>import("./assets/cobol-CWcv1MsR.js"),[],import.meta.url).then(n=>F(n.cobol))}}),P.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return R(()=>import("./assets/clike-B9uivgTg.js"),[],import.meta.url).then(n=>F(n.csharp))}}),P.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return R(()=>import("./assets/clojure-BMjYHr_A.js"),[],import.meta.url).then(n=>F(n.clojure))}}),P.of({name:"ClojureScript",extensions:["cljs"],load(){return R(()=>import("./assets/clojure-BMjYHr_A.js"),[],import.meta.url).then(n=>F(n.clojure))}}),P.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return R(()=>import("./assets/css-BnMrqG3P.js"),[],import.meta.url).then(n=>F(n.gss))}}),P.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return R(()=>import("./assets/cmake-BQqOBYOt.js"),[],import.meta.url).then(n=>F(n.cmake))}}),P.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return R(()=>import("./assets/coffeescript-S37ZYGWr.js"),[],import.meta.url).then(n=>F(n.coffeeScript))}}),P.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return R(()=>import("./assets/commonlisp-DBKNyK5s.js"),[],import.meta.url).then(n=>F(n.commonLisp))}}),P.of({name:"Cypher",extensions:["cyp","cypher"],load(){return R(()=>import("./assets/cypher-C_CwsFkJ.js"),[],import.meta.url).then(n=>F(n.cypher))}}),P.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return R(()=>import("./assets/python-BuPzkPfP.js"),[],import.meta.url).then(n=>F(n.cython))}}),P.of({name:"Crystal",extensions:["cr"],load(){return R(()=>import("./assets/crystal-SjHAIU92.js"),[],import.meta.url).then(n=>F(n.crystal))}}),P.of({name:"D",extensions:["d"],load(){return R(()=>import("./assets/d-pRatUO7H.js"),[],import.meta.url).then(n=>F(n.d))}}),P.of({name:"Dart",extensions:["dart"],load(){return R(()=>import("./assets/clike-B9uivgTg.js"),[],import.meta.url).then(n=>F(n.dart))}}),P.of({name:"diff",extensions:["diff","patch"],load(){return R(()=>import("./assets/diff-DbItnlRl.js"),[],import.meta.url).then(n=>F(n.diff))}}),P.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return R(()=>import("./assets/dockerfile-BKs6k2Af.js"),__vite__mapDeps([21,22]),import.meta.url).then(n=>F(n.dockerFile))}}),P.of({name:"DTD",extensions:["dtd"],load(){return R(()=>import("./assets/dtd-DF_7sFjM.js"),[],import.meta.url).then(n=>F(n.dtd))}}),P.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return R(()=>import("./assets/dylan-DwRh75JA.js"),[],import.meta.url).then(n=>F(n.dylan))}}),P.of({name:"EBNF",load(){return R(()=>import("./assets/ebnf-CDyGwa7X.js"),[],import.meta.url).then(n=>F(n.ebnf))}}),P.of({name:"ECL",extensions:["ecl"],load(){return R(()=>import("./assets/ecl-Cabwm37j.js"),[],import.meta.url).then(n=>F(n.ecl))}}),P.of({name:"edn",extensions:["edn"],load(){return R(()=>import("./assets/clojure-BMjYHr_A.js"),[],import.meta.url).then(n=>F(n.clojure))}}),P.of({name:"Eiffel",extensions:["e"],load(){return R(()=>import("./assets/eiffel-CnydiIhH.js"),[],import.meta.url).then(n=>F(n.eiffel))}}),P.of({name:"Elm",extensions:["elm"],load(){return R(()=>import("./assets/elm-vLlmbW-K.js"),[],import.meta.url).then(n=>F(n.elm))}}),P.of({name:"Erlang",extensions:["erl"],load(){return R(()=>import("./assets/erlang-BNw1qcRV.js"),[],import.meta.url).then(n=>F(n.erlang))}}),P.of({name:"Esper",load(){return R(()=>import("./assets/sql-D0XecflT.js"),[],import.meta.url).then(n=>F(n.esper))}}),P.of({name:"Factor",extensions:["factor"],load(){return R(()=>import("./assets/factor-kuTfRLto.js"),__vite__mapDeps([23,22]),import.meta.url).then(n=>F(n.factor))}}),P.of({name:"FCL",load(){return R(()=>import("./assets/fcl-Kvtd6kyn.js"),[],import.meta.url).then(n=>F(n.fcl))}}),P.of({name:"Forth",extensions:["forth","fth","4th"],load(){return R(()=>import("./assets/forth-Ffai-XNe.js"),[],import.meta.url).then(n=>F(n.forth))}}),P.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return R(()=>import("./assets/fortran-DYz_wnZ1.js"),[],import.meta.url).then(n=>F(n.fortran))}}),P.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return R(()=>import("./assets/mllike-CXdrOF99.js"),[],import.meta.url).then(n=>F(n.fSharp))}}),P.of({name:"Gas",extensions:["s"],load(){return R(()=>import("./assets/gas-Bneqetm1.js"),[],import.meta.url).then(n=>F(n.gas))}}),P.of({name:"Gherkin",extensions:["feature"],load(){return R(()=>import("./assets/gherkin-heZmZLOM.js"),[],import.meta.url).then(n=>F(n.gherkin))}}),P.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return R(()=>import("./assets/groovy-D9Dt4D0W.js"),[],import.meta.url).then(n=>F(n.groovy))}}),P.of({name:"Haskell",extensions:["hs"],load(){return R(()=>import("./assets/haskell-Cw1EW3IL.js"),[],import.meta.url).then(n=>F(n.haskell))}}),P.of({name:"Haxe",extensions:["hx"],load(){return R(()=>import("./assets/haxe-H-WmDvRZ.js"),[],import.meta.url).then(n=>F(n.haxe))}}),P.of({name:"HXML",extensions:["hxml"],load(){return R(()=>import("./assets/haxe-H-WmDvRZ.js"),[],import.meta.url).then(n=>F(n.hxml))}}),P.of({name:"HTTP",load(){return R(()=>import("./assets/http-DBlCnlav.js"),[],import.meta.url).then(n=>F(n.http))}}),P.of({name:"IDL",extensions:["pro"],load(){return R(()=>import("./assets/idl-BEugSyMb.js"),[],import.meta.url).then(n=>F(n.idl))}}),P.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return R(()=>import("./assets/javascript-iXu5QeM3.js"),[],import.meta.url).then(n=>F(n.jsonld))}}),P.of({name:"Julia",extensions:["jl"],load(){return R(()=>import("./assets/julia-DuME0IfC.js"),[],import.meta.url).then(n=>F(n.julia))}}),P.of({name:"Kotlin",extensions:["kt","kts"],load(){return R(()=>import("./assets/clike-B9uivgTg.js"),[],import.meta.url).then(n=>F(n.kotlin))}}),P.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return R(()=>import("./assets/livescript-BwQOo05w.js"),[],import.meta.url).then(n=>F(n.liveScript))}}),P.of({name:"Lua",extensions:["lua"],load(){return R(()=>import("./assets/lua-VAEuO923.js"),[],import.meta.url).then(n=>F(n.lua))}}),P.of({name:"mIRC",extensions:["mrc"],load(){return R(()=>import("./assets/mirc-CjQqDB4T.js"),[],import.meta.url).then(n=>F(n.mirc))}}),P.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return R(()=>import("./assets/mathematica-DTrFuWx2.js"),[],import.meta.url).then(n=>F(n.mathematica))}}),P.of({name:"Modelica",extensions:["mo"],load(){return R(()=>import("./assets/modelica-Dc1JOy9r.js"),[],import.meta.url).then(n=>F(n.modelica))}}),P.of({name:"MUMPS",extensions:["mps"],load(){return R(()=>import("./assets/mumps-BT43cFF4.js"),[],import.meta.url).then(n=>F(n.mumps))}}),P.of({name:"Mbox",extensions:["mbox"],load(){return R(()=>import("./assets/mbox-CNhZ1qSd.js"),[],import.meta.url).then(n=>F(n.mbox))}}),P.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return R(()=>import("./assets/nginx-DdIZxoE0.js"),[],import.meta.url).then(n=>F(n.nginx))}}),P.of({name:"NSIS",extensions:["nsh","nsi"],load(){return R(()=>import("./assets/nsis-LY0VT_u5.js"),__vite__mapDeps([24,22]),import.meta.url).then(n=>F(n.nsis))}}),P.of({name:"NTriples",extensions:["nt","nq"],load(){return R(()=>import("./assets/ntriples-BfvgReVJ.js"),[],import.meta.url).then(n=>F(n.ntriples))}}),P.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return R(()=>import("./assets/clike-B9uivgTg.js"),[],import.meta.url).then(n=>F(n.objectiveC))}}),P.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return R(()=>import("./assets/clike-B9uivgTg.js"),[],import.meta.url).then(n=>F(n.objectiveCpp))}}),P.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return R(()=>import("./assets/mllike-CXdrOF99.js"),[],import.meta.url).then(n=>F(n.oCaml))}}),P.of({name:"Octave",extensions:["m"],load(){return R(()=>import("./assets/octave-Ck1zUtKM.js"),[],import.meta.url).then(n=>F(n.octave))}}),P.of({name:"Oz",extensions:["oz"],load(){return R(()=>import("./assets/oz-BzwKVEFT.js"),[],import.meta.url).then(n=>F(n.oz))}}),P.of({name:"Pascal",extensions:["p","pas"],load(){return R(()=>import("./assets/pascal--L3eBynH.js"),[],import.meta.url).then(n=>F(n.pascal))}}),P.of({name:"Perl",extensions:["pl","pm"],load(){return R(()=>import("./assets/perl-CdXCOZ3F.js"),[],import.meta.url).then(n=>F(n.perl))}}),P.of({name:"Pig",extensions:["pig"],load(){return R(()=>import("./assets/pig-CevX1Tat.js"),[],import.meta.url).then(n=>F(n.pig))}}),P.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return R(()=>import("./assets/powershell-CFHJl5sT.js"),[],import.meta.url).then(n=>F(n.powerShell))}}),P.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return R(()=>import("./assets/properties-C78fOPTZ.js"),[],import.meta.url).then(n=>F(n.properties))}}),P.of({name:"ProtoBuf",extensions:["proto"],load(){return R(()=>import("./assets/protobuf-ChK-085T.js"),[],import.meta.url).then(n=>F(n.protobuf))}}),P.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return R(()=>import("./assets/pug-DeIclll2.js"),__vite__mapDeps([25,26]),import.meta.url).then(n=>F(n.pug))}}),P.of({name:"Puppet",extensions:["pp"],load(){return R(()=>import("./assets/puppet-DMA9R1ak.js"),[],import.meta.url).then(n=>F(n.puppet))}}),P.of({name:"Q",extensions:["q"],load(){return R(()=>import("./assets/q-pXgVlZs6.js"),[],import.meta.url).then(n=>F(n.q))}}),P.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return R(()=>import("./assets/r-B6wPVr8A.js"),[],import.meta.url).then(n=>F(n.r))}}),P.of({name:"RPM Changes",load(){return R(()=>import("./assets/rpm-CTu-6PCP.js"),[],import.meta.url).then(n=>F(n.rpmChanges))}}),P.of({name:"RPM Spec",extensions:["spec"],load(){return R(()=>import("./assets/rpm-CTu-6PCP.js"),[],import.meta.url).then(n=>F(n.rpmSpec))}}),P.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return R(()=>import("./assets/ruby-BK5aLJev.js"),[],import.meta.url).then(n=>F(n.ruby))}}),P.of({name:"SAS",extensions:["sas"],load(){return R(()=>import("./assets/sas-B4kiWyti.js"),[],import.meta.url).then(n=>F(n.sas))}}),P.of({name:"Scala",extensions:["scala"],load(){return R(()=>import("./assets/clike-B9uivgTg.js"),[],import.meta.url).then(n=>F(n.scala))}}),P.of({name:"Scheme",extensions:["scm","ss"],load(){return R(()=>import("./assets/scheme-C41bIUwD.js"),[],import.meta.url).then(n=>F(n.scheme))}}),P.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return R(()=>import("./assets/shell-CjFT_Tl9.js"),[],import.meta.url).then(n=>F(n.shell))}}),P.of({name:"Sieve",extensions:["siv","sieve"],load(){return R(()=>import("./assets/sieve-C3Gn_uJK.js"),[],import.meta.url).then(n=>F(n.sieve))}}),P.of({name:"Smalltalk",extensions:["st"],load(){return R(()=>import("./assets/smalltalk-CnHTOXQT.js"),[],import.meta.url).then(n=>F(n.smalltalk))}}),P.of({name:"Solr",load(){return R(()=>import("./assets/solr-DehyRSwq.js"),[],import.meta.url).then(n=>F(n.solr))}}),P.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return R(()=>import("./assets/mllike-CXdrOF99.js"),[],import.meta.url).then(n=>F(n.sml))}}),P.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return R(()=>import("./assets/sparql-DkYu6x3z.js"),[],import.meta.url).then(n=>F(n.sparql))}}),P.of({name:"Spreadsheet",alias:["excel","formula"],load(){return R(()=>import("./assets/spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(n=>F(n.spreadsheet))}}),P.of({name:"Squirrel",extensions:["nut"],load(){return R(()=>import("./assets/clike-B9uivgTg.js"),[],import.meta.url).then(n=>F(n.squirrel))}}),P.of({name:"Stylus",extensions:["styl"],load(){return R(()=>import("./assets/stylus-B533Al4x.js"),[],import.meta.url).then(n=>F(n.stylus))}}),P.of({name:"Swift",extensions:["swift"],load(){return R(()=>import("./assets/swift-BzpIVaGY.js"),[],import.meta.url).then(n=>F(n.swift))}}),P.of({name:"sTeX",load(){return R(()=>import("./assets/stex-C3f8Ysf7.js"),[],import.meta.url).then(n=>F(n.stex))}}),P.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return R(()=>import("./assets/stex-C3f8Ysf7.js"),[],import.meta.url).then(n=>F(n.stex))}}),P.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return R(()=>import("./assets/verilog-C6RDOZhf.js"),[],import.meta.url).then(n=>F(n.verilog))}}),P.of({name:"Tcl",extensions:["tcl"],load(){return R(()=>import("./assets/tcl-DVfN8rqt.js"),[],import.meta.url).then(n=>F(n.tcl))}}),P.of({name:"Textile",extensions:["textile"],load(){return R(()=>import("./assets/textile-CnDTJFAw.js"),[],import.meta.url).then(n=>F(n.textile))}}),P.of({name:"TiddlyWiki",load(){return R(()=>import("./assets/tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(n=>F(n.tiddlyWiki))}}),P.of({name:"Tiki wiki",load(){return R(()=>import("./assets/tiki-DGYXhP31.js"),[],import.meta.url).then(n=>F(n.tiki))}}),P.of({name:"TOML",extensions:["toml"],load(){return R(()=>import("./assets/toml-Bm5Em-hy.js"),[],import.meta.url).then(n=>F(n.toml))}}),P.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return R(()=>import("./assets/troff-wAsdV37c.js"),[],import.meta.url).then(n=>F(n.troff))}}),P.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return R(()=>import("./assets/ttcn-CfJYG6tj.js"),[],import.meta.url).then(n=>F(n.ttcn))}}),P.of({name:"TTCN_CFG",extensions:["cfg"],load(){return R(()=>import("./assets/ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(n=>F(n.ttcnCfg))}}),P.of({name:"Turtle",extensions:["ttl"],load(){return R(()=>import("./assets/turtle-B1tBg_DP.js"),[],import.meta.url).then(n=>F(n.turtle))}}),P.of({name:"Web IDL",extensions:["webidl"],load(){return R(()=>import("./assets/webidl-ZXfAyPTL.js"),[],import.meta.url).then(n=>F(n.webIDL))}}),P.of({name:"VB.NET",extensions:["vb"],load(){return R(()=>import("./assets/vb-CmGdzxic.js"),[],import.meta.url).then(n=>F(n.vb))}}),P.of({name:"VBScript",extensions:["vbs"],load(){return R(()=>import("./assets/vbscript-BuJXcnF6.js"),[],import.meta.url).then(n=>F(n.vbScript))}}),P.of({name:"Velocity",extensions:["vtl"],load(){return R(()=>import("./assets/velocity-D8B20fx6.js"),[],import.meta.url).then(n=>F(n.velocity))}}),P.of({name:"Verilog",extensions:["v"],load(){return R(()=>import("./assets/verilog-C6RDOZhf.js"),[],import.meta.url).then(n=>F(n.verilog))}}),P.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return R(()=>import("./assets/vhdl-lSbBsy5d.js"),[],import.meta.url).then(n=>F(n.vhdl))}}),P.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return R(()=>import("./assets/xquery-DzFWVndE.js"),[],import.meta.url).then(n=>F(n.xQuery))}}),P.of({name:"Yacas",extensions:["ys"],load(){return R(()=>import("./assets/yacas-BJ4BC0dw.js"),[],import.meta.url).then(n=>F(n.yacas))}}),P.of({name:"Z80",extensions:["z80"],load(){return R(()=>import("./assets/z80-Hz9HOZM7.js"),[],import.meta.url).then(n=>F(n.z80))}}),P.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return R(()=>import("./assets/mscgen-BA5vi2Kp.js"),[],import.meta.url).then(n=>F(n.mscgen))}}),P.of({name:"Xù",extensions:["xu"],load(){return R(()=>import("./assets/mscgen-BA5vi2Kp.js"),[],import.meta.url).then(n=>F(n.xu))}}),P.of({name:"MsGenny",extensions:["msgenny"],load(){return R(()=>import("./assets/mscgen-BA5vi2Kp.js"),[],import.meta.url).then(n=>F(n.msgenny))}}),P.of({name:"Vue",extensions:["vue"],load(){return R(()=>import("./assets/index-BADrVn75.js"),__vite__mapDeps([27,6,1,4,2,7]),import.meta.url).then(n=>n.vue())}}),P.of({name:"Angular Template",load(){return R(()=>import("./assets/index-Bd0I8kF1.js"),__vite__mapDeps([28,6,1,4,2,7]),import.meta.url).then(n=>n.angular())}})],u_="#e5c07b",a5="#e06c75",h_="#56b6c2",d_="#ffffff",Lc="#abb2bf",vp="#7d8799",f_="#61afef",p_="#98c379",l5="#d19a66",m_="#c678dd",g_="#21252b",c5="#2c313a",u5="#282c34",Fd="#353a42",v_="#3E4451",h5="#528bff",y_=Z.theme({"&":{color:Lc,backgroundColor:u5},".cm-content":{caretColor:h5},".cm-cursor, .cm-dropCursor":{borderLeftColor:h5},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:v_},".cm-panels":{backgroundColor:g_,color:Lc},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:u5,color:vp,border:"none"},".cm-activeLineGutter":{backgroundColor:c5},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Fd},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Fd,borderBottomColor:Fd},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:c5,color:Lc}}},{dark:!0}),b_=r0.define([{tag:H.keyword,color:m_},{tag:[H.name,H.deleted,H.character,H.propertyName,H.macroName],color:a5},{tag:[H.function(H.variableName),H.labelName],color:f_},{tag:[H.color,H.constant(H.name),H.standard(H.name)],color:l5},{tag:[H.definition(H.name),H.separator],color:Lc},{tag:[H.typeName,H.className,H.number,H.changed,H.annotation,H.modifier,H.self,H.namespace],color:u_},{tag:[H.operator,H.operatorKeyword,H.url,H.escape,H.regexp,H.link,H.special(H.string)],color:h_},{tag:[H.meta,H.comment],color:vp},{tag:H.strong,fontWeight:"bold"},{tag:H.emphasis,fontStyle:"italic"},{tag:H.strikethrough,textDecoration:"line-through"},{tag:H.link,color:vp,textDecoration:"underline"},{tag:H.heading,fontWeight:"bold",color:a5},{tag:[H.atom,H.bool,H.special(H.variableName)],color:l5},{tag:[H.processingInstruction,H.string,H.inserted],color:p_},{tag:H.invalid,color:d_}]),w_=[y_,E8(b_)];function x_(n){let e=n.schema.cached.changeSetIDs||(n.schema.cached.changeSetIDs=Object.create(null)),t=e[n.name];return t==null&&(e[n.name]=t=Object.keys(n.schema.nodes).indexOf(n.name)+1),t}const z8={encodeCharacter:n=>n,encodeNodeStart:n=>n.type.name,encodeNodeEnd:n=>-x_(n.type),compareTokens:(n,e)=>n===e};function yp(n,e,t,r,i){for(let s=0,o=0;s<n.childCount;s++){let a=n.child(s),l=o+a.nodeSize,c=Math.max(o,t),u=Math.min(l,r);if(c<u)if(a.isText)for(let h=c;h<u;h++)i.push(e.encodeCharacter(a.text.charCodeAt(h-o),a.marks));else a.isLeaf?i.push(e.encodeNodeStart(a)):(c==o&&i.push(e.encodeNodeStart(a)),yp(a.content,e,Math.max(o+1,c)-o-1,Math.min(l-1,u)-o-1,i),u==l&&i.push(e.encodeNodeEnd(a)));o=l}return i}const d5=2500,k_=1e4;function C_(n,e){return Math.min(15,Math.max(2,Math.floor(Math.max(n,e)/10)))}function N8(n,e,t,r=z8){if(Math.max(t.toA-t.fromA,t.toB-t.fromB)>k_)return[t];let i=yp(n,r,t.fromA,t.toA,[]),s=yp(e,r,t.fromB,t.toB,[]);return S_(i,s,t,r.compareTokens)}function S_(n,e,t,r){let i=0,s=n.length,o=e.length;for(;i<n.length&&i<e.length&&r(n[i],e[i]);)i++;if(i==n.length&&i==e.length)return[];for(;s>i&&o>i&&r(n[s-1],e[o-1]);)s--,o--;if(s==i&&o==i)return[];if(s==i||o==i||s==o&&s==i+1||Math.max(s,o)-i>d5)return[t.slice(i,s,i,o)];let a=s-i,l=o-i,c=Math.min(d5,a+l),u=[],h=new Int16Array((c+1)*2).fill(-1);for(let d=0;d<=c;d++){for(let f=-d;f<=d;f+=2){let m=h[f+1+c],g=h[f-1+c],y=m<g?g:m+1,b=y+f;for(;y<a&&b<l&&r(n[i+y],e[i+b]);)y++,b++;if(h[f+c]=y,y>=a&&b>=l){let x=[],C=C_(s-i,o-i),E=-1,S=-1,T=-1,O=-1,L=(B,z,V,D)=>{E>-1&&E<z+C?(E=B,T=V):(E>-1&&x.push(t.slice(E,S,T,O)),E=B,S=z,T=V,O=D)};for(let B=d-1;B>=0;B--){let z=h[f+1+c],V=h[f-1+c];z<V?(f--,y=V+i,b=y+f,L(y,y,b,b+1)):(f++,y=z+i,b=y+f,L(y,y+1,b,b)),h=u[B>>1]}return E>-1&&x.push(t.slice(E,S,T,O)),x.reverse()}}d%2==0&&u.push(h.slice())}return[t.slice(i,s,i,o)]}let gt=class Ra{constructor(e,t){this.length=e,this.data=t}cut(e){return e==this.length?this:new Ra(e,this.data)}static slice(e,t,r){if(t==r)return Ra.none;if(t==0&&r==Ra.len(e))return e;let i=[];for(let s=0,o=0;o<r;s++){let a=e[s],l=o+a.length,c=Math.min(r,l)-Math.max(t,o);c>0&&i.push(a.cut(c)),o=l}return i}static join(e,t,r){if(e.length==0)return t;if(t.length==0)return e;let i=r(e[e.length-1].data,t[0].data);if(i==null)return e.concat(t);let s=e.slice(0,e.length-1);s.push(new Ra(e[e.length-1].length+t[0].length,i));for(let o=1;o<t.length;o++)s.push(t[o]);return s}static len(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r].length;return t}};gt.none=[];class ln{constructor(e,t,r,i,s,o){this.fromA=e,this.toA=t,this.fromB=r,this.toB=i,this.deleted=s,this.inserted=o}get lenA(){return this.toA-this.fromA}get lenB(){return this.toB-this.fromB}slice(e,t,r,i){return e==0&&r==0&&t==this.toA-this.fromA&&i==this.toB-this.fromB?this:new ln(this.fromA+e,this.fromA+t,this.fromB+r,this.fromB+i,gt.slice(this.deleted,e,t),gt.slice(this.inserted,r,i))}static merge(e,t,r){if(e.length==0)return t;if(t.length==0)return e;let i=[];for(let s=0,o=0,a=e[0],l=t[0];;){if(!a&&!l)return i;if(a&&(!l||a.toB<l.fromA)){let c=o?t[o-1].toB-t[o-1].toA:0;i.push(c==0?a:new ln(a.fromA,a.toA,a.fromB+c,a.toB+c,a.deleted,a.inserted)),a=s++==e.length?null:e[s]}else if(l&&(!a||l.toA<a.fromB)){let c=s?e[s-1].toB-e[s-1].toA:0;i.push(c==0?l:new ln(l.fromA-c,l.toA-c,l.fromB,l.toB,l.deleted,l.inserted)),l=o++==t.length?null:t[o]}else{let c=Math.min(a.fromB,l.fromA),u=Math.min(a.fromA,l.fromA-(s?e[s-1].toB-e[s-1].toA:0)),h=u,d=Math.min(l.fromB,a.fromB+(o?t[o-1].toB-t[o-1].toA:0)),f=d,m=gt.none,g=gt.none,y=!1,b=!1;for(;;){let x=a?c>=a.fromB?a.toB:a.fromB:2e8,C=l?c>=l.fromA?l.toA:l.fromA:2e8,E=Math.min(x,C),S=a&&c>=a.fromB,T=l&&c>=l.fromA;if(!S&&!T)break;S&&c==a.fromB&&!y&&(m=gt.join(m,a.deleted,r),h+=a.lenA,y=!0),S&&!T&&(g=gt.join(g,gt.slice(a.inserted,c-a.fromB,E-a.fromB),r),f+=E-c),T&&c==l.fromA&&!b&&(g=gt.join(g,l.inserted,r),f+=l.lenB,b=!0),T&&!S&&(m=gt.join(m,gt.slice(l.deleted,c-l.fromA,E-l.fromA),r),h+=E-c),S&&E==a.toB&&(a=s++==e.length?null:e[s],y=!1),T&&E==l.toA&&(l=o++==t.length?null:t[o],b=!1),c=E}(u<h||d<f)&&i.push(new ln(u,h,d,f,m,g))}}}static fromJSON(e){return new ln(e.fromA,e.toA,e.fromB,e.toB,e.deleted.map(t=>new gt(t.length,t.data)),e.inserted.map(t=>new gt(t.length,t.data)))}toJSON(){return this}}let A_;try{A_=new RegExp("[\\p{Alphabetic}_]","u")}catch{}class ms{constructor(e,t){this.config=e,this.changes=t}addSteps(e,t,r){let i=[];for(let l=0;l<t.length;l++){let c=Array.isArray(r)?r[l]:r,u=0;t[l].forEach((h,d,f,m)=>{i.push(new ln(h+u,d+u,f,m,h==d?gt.none:[new gt(d-h,c)],f==m?gt.none:[new gt(m-f,c)])),u=m-f-(d-h)})}if(i.length==0)return this;let s=bp(i,this.config.combine),o=ln.merge(this.changes,s,this.config.combine),a=o;for(let l=0;l<a.length;l++){let c=a[l];if(c.fromA==c.toA||c.fromB==c.toB||!s.some(h=>h.toB>c.fromB&&h.fromB<c.toB))continue;let u=N8(this.config.doc.content,e.content,c,this.config.encoder);u.length==1&&u[0].fromB==0&&u[0].toB==c.toB-c.fromB||(a==o&&(a=o.slice()),u.length==1?a[l]=u[0]:(a.splice(l,1,...u),l+=u.length-1))}return new ms(this.config,a)}get startDoc(){return this.config.doc}map(e){let t=r=>{let i=e(r);return i===r.data?r:new gt(r.length,i)};return new ms(this.config,this.changes.map(r=>new ln(r.fromA,r.toA,r.fromB,r.toB,r.deleted.map(t),r.inserted.map(t))))}changedRange(e,t){if(e==this)return null;let r=t&&M_(t),i=r?r.toB-r.fromB-(r.toA-r.fromA):0;function s(h){return!r||h<=r.fromA?h:h+i}let o=r?r.fromB:2e8,a=r?r.toB:-2e8;function l(h,d=h){o=Math.min(h,o),a=Math.max(d,a)}let c=this.changes,u=e.changes;for(let h=0,d=0;h<c.length&&d<u.length;){let f=c[h],m=u[d];f&&m&&T_(f,m,s)?(h++,d++):m&&(!f||s(f.fromB)>=m.fromB)?(l(m.fromB,m.toB),d++):(l(s(f.fromB),s(f.toB)),h++)}return o<=a?{from:o,to:a}:null}static create(e,t=(s,o)=>s===o?s:null,r=z8,i=[]){return new ms({combine:t,doc:e,encoder:r},i)}}ms.computeDiff=N8;function bp(n,e,t=0,r=n.length){if(r==t+1)return[n[t]];let i=t+r>>1;return ln.merge(bp(n,e,t,i),bp(n,e,i,r),e)}function f5(n){let e=2e8,t=-2e8;for(let r=0;r<n.length;r++){let i=n[r];e!=2e8&&(e=i.map(e,-1),t=i.map(t,1)),i.forEach((s,o,a,l)=>{e=Math.min(e,a),t=Math.max(t,l)})}return e==2e8?null:{from:e,to:t}}function M_(n){let e=f5(n);if(!e)return null;let t=f5(n.map(r=>r.invert()).reverse());return{fromA:t.from,toA:t.to,fromB:e.from,toB:e.to}}function T_(n,e,t){return t(n.fromB)==e.fromB&&t(n.toB)==e.toB&&p5(n.deleted,e.deleted)&&p5(n.inserted,e.inserted)}function p5(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t].length!=e[t].length||n[t].data!==e[t].data)return!1;return!0}function kr(n,e){return Object.assign(n,{meta:{package:"@milkdown/plugin-diff",...e}}),n}var m5=500;function E_(n={}){const e=new WeakMap,t=new WeakMap;function r(i){let s=e.get(i);if(s!=null)return s;const o=i.attrs,a=o?Object.keys(o).filter(l=>o[l]!=null).sort():[];if(a.length===0)s=i.type.name;else{const l={};for(const c of a)l[c]=o[c];s=`${i.type.name}:${JSON.stringify(l)}`}return e.set(i,s),s}return{encodeCharacter:(i,s)=>{if(s.length===0)return i;let o=t.get(s);return o==null&&(o=s.map(r).join(","),t.set(s,o)),`${i}:${o}`},encodeNodeStart:i=>{const s=i.attrs;if(s&&Object.keys(s).length>0){const o=n[i.type.name]??[],a=Object.keys(s).filter(l=>{if(o.includes(l))return!1;const c=i.type.spec.attrs?.[l]?.default;return s[l]!==c});if(a.length>0){const l={};for(const c of a.sort())l[c]=s[c];return`${i.type.name}:${JSON.stringify(l)}`}}return i.type.name},encodeNodeEnd:i=>{const s=i.type.schema,o=s.cached.changeSetIDs||(s.cached.changeSetIDs=Object.create(null));let a=o[i.type.name];return a==null&&(o[i.type.name]=a=Object.keys(s.nodes).indexOf(i.type.name)+1),-a},compareTokens:(i,s)=>i===s}}function H8(n,e,t){const r=t.get(n);if(r!=null)return r;const i=[String(e.encodeNodeStart(n))];if(n.isText){const o=n.text;for(let a=0;a<o.length;a++)i.push(":"+String(e.encodeCharacter(o.charCodeAt(a),n.marks)))}else n.content.forEach(o=>{i.push("/"+H8(o,e,t))});i.push("\\"+String(e.encodeNodeEnd(n)));const s=i.join("");return t.set(n,s),s}function g5(n,e,t){const r=[];let i=0;return n.content.forEach(s=>{r.push({node:s,offset:i,size:s.nodeSize,signature:H8(s,t.encoder,t.sigCache)}),i+=s.nodeSize}),{node:n,contentStart:e,content:r}}function __(n,e){const t=n.length,r=e.length,i=Array.from({length:t+1},()=>Array.from({length:r+1},()=>0));for(let l=t-1;l>=0;l--)for(let c=r-1;c>=0;c--)n[l].signature===e[c].signature?i[l][c]=i[l+1][c+1]+1:i[l][c]=Math.max(i[l+1][c],i[l][c+1]);const s=[];let o=0,a=0;for(;o<t&&a<r;)n[o].signature===e[a].signature?(s.push([o,a]),o++,a++):i[o+1][a]>=i[o][a+1]?o++:a++;return s}function I_(n,e){if(n.type!==e.type)return!1;const t=n.type;return!(t.isTextblock||t.isAtom||t.spec.code===!0||!t.isBlock)}function F8(n,e,t){return ln.fromJSON({fromA:n.fromA+e,toA:n.toA+e,fromB:n.fromB+t,toB:n.toB+t,deleted:n.deleted.map(r=>({length:r.length,data:r.data})),inserted:n.inserted.map(r=>({length:r.length,data:r.data}))})}function L_(n,e,t){const r=n.parent.copy(Fn.from(n.node)),i=e.parent.copy(Fn.from(e.node)),s=new z3(0,r.content.size,new Wr(i.content,0,0));return ms.create(r,void 0,t.encoder).addSteps(i,[s.getMap()],null).changes.map(o=>F8(o,n.abs,e.abs))}function v5(n,e){const t=n.content;if(e<t.length)return n.contentStart+t[e].offset;if(e>0){const r=t[e-1];return n.contentStart+r.offset+r.size}return n.contentStart+n.node.content.size}function B_(n,e,t){return ln.fromJSON({fromA:e,toA:e+n.size,fromB:t,toB:t,deleted:[{length:n.size,data:null}],inserted:[]})}function D_(n,e,t){return ln.fromJSON({fromA:e,toA:e,fromB:t,toB:t+n.size,deleted:[],inserted:[{length:n.size,data:null}]})}function O_(n,e,t,r,i){const s=new z3(0,n.content.size,new Wr(e.content,0,0));return ms.create(n,void 0,i.encoder).addSteps(e,[s.getMap()],null).changes.map(o=>F8(o,t,r))}function Bc(n,e,t,r,i){if(n.childCount>m5||e.childCount>m5)return O_(n,e,t,r,i);const s=g5(n,t,i),o=g5(e,r,i),a=__(s.content,o.content),l=[];let c=0,u=0;for(const[h,d]of a)y5(s,o,{oldStart:c,oldEnd:h,newStart:u,newEnd:d},i,l),c=h+1,u=d+1;return y5(s,o,{oldStart:c,oldEnd:s.content.length,newStart:u,newEnd:o.content.length},i,l),l}function y5(n,e,t,r,i){const s=n.content,o=e.content;let a=t.oldStart,l=t.newStart;for(;a<t.oldEnd||l<t.newEnd;){const c=a<t.oldEnd?s[a]:null,u=l<t.newEnd?o[l]:null,h=c&&u&&c.node.type===u.node.type;if(c&&u&&h){i.push(...P_(n,e,c,u,r)),a++,l++;continue}if(c&&(!u||!h)){const d=n.contentStart+c.offset;i.push(B_(c,d,v5(e,l))),a++;continue}if(u){const d=e.contentStart+u.offset;i.push(D_(u,v5(n,a),d)),l++}}}function P_(n,e,t,r,i){const s=n.contentStart+t.offset,o=e.contentStart+r.offset;return I_(t.node,r.node)&&R_(t.node,r.node,i.encoder)?Bc(t.node,r.node,s+1,o+1,i):L_({node:t.node,parent:n.node,abs:s},{node:r.node,parent:e.node,abs:o},i)}function R_(n,e,t){return t.encodeNodeStart(n)===t.encodeNodeStart(e)}function z_(n,e,t,r,i){const s=n.resolve(t),o=n.resolve(r),a=e.resolve(t),l=e.resolve(r),c=s.sharedDepth(r);if(a.sharedDepth(r)!==c)throw new RangeError(`computeDocDiff: range [${t}, ${r}) resolves to different sharedDepth in old and new docs`);for(let g=0;g<=c;g++){if(i.encodeNodeStart(s.node(g))!==i.encodeNodeStart(a.node(g)))throw new RangeError(`computeDocDiff: ancestor at depth ${g} differs in type or non-ignored attrs along the path to the shared ancestor`);if(s.start(g)!==a.start(g))throw new RangeError(`computeDocDiff: ancestor at depth ${g} starts at different absolute positions in old and new docs (content before the range differs in size)`)}const u=s.node(c);if(u.isTextblock)throw new RangeError(`computeDocDiff: range [${t}, ${r}) lands inside a textblock; widen the range to a block boundary`);if(s.depth!==c||o.depth!==c||a.depth!==c||l.depth!==c)throw new RangeError(`computeDocDiff: range [${t}, ${r}) endpoints must be aligned to child boundaries of the shared ancestor`);const h=a.node(c),d=s.start(c),f=t-d,m=r-d;return{oldCut:u.copy(u.content.cut(f,m)),newCut:h.copy(h.content.cut(f,m)),cutAbsStart:t}}function Fu(n,e,t){const r=E_(t?.ignoreAttrs),i={encoder:r,sigCache:new WeakMap},s=n.content.size,o=e.content.size,a=t?.range;if(a==null)return Bc(n,e,0,0,i);const l=Math.min(s,o),c=Math.max(0,Math.min(a.from??0,l)),u=Math.max(c,Math.min(a.to??l,l));if(c===u)return[];if(c===0&&u===l&&s===o)return Bc(n,e,0,0,i);const h=z_(n,e,c,u,r);return Bc(h.oldCut,h.newCut,h.cutAbsStart,h.cutAbsStart,i)}var Th=Be({ignoreAttrs:{heading:["id"]}},"diffConfig");kr(Th,{displayName:"Ctx<diffConfig>",group:"Diff"});var Ue=new ft("MILKDOWN_DIFF");function N_(n,e,t){const r=Fu(n,e.newDoc,t);return{...e,changes:r}}function H_(n,e){return e.some(t=>n.fromB<t.toB&&n.toB>t.fromB)}function i0(n){return n.changes.filter(e=>!H_(e,n.rejectedRanges))}var q8=dt(n=>{const e=n.get(Th.key);return new at({key:Ue,state:{init:()=>null,apply(t,r,i,s){const o=t.getMeta(Ue);if(!r){if(o?.type==="start"){const c=Fu(s.doc,o.newDoc,{ignoreAttrs:e.ignoreAttrs});return{newDoc:o.newDoc,changes:c,rejectedRanges:[],active:!0}}return null}let a=r;if(t.docChanged&&a.active&&(a=N_(s.doc,a,{ignoreAttrs:e.ignoreAttrs})),!o)return a;let l;switch(o.type){case"start":{const c=Fu(s.doc,o.newDoc,{ignoreAttrs:e.ignoreAttrs});return{newDoc:o.newDoc,changes:c,rejectedRanges:[],active:!0}}case"accept":case"acceptRange":l=a;break;case"reject":l={...a,rejectedRanges:[...a.rejectedRanges,{fromB:o.fromB,toB:o.toB}]};break;case"rejectRange":l={...a,rejectedRanges:[...a.rejectedRanges,{fromB:o.range.fromB,toB:o.range.toB}]};break;case"acceptAll":case"clear":return null;default:return a}return l.active&&i0(l).length===0?null:l}},filterTransaction(t,r){return!Ue.getState(r)?.active||t.getMeta(Ue)?!0:!t.docChanged}})});kr(q8,{displayName:"Prose<diff>",group:"Diff"});function F_(n,e){const t=i0(e);for(let r=t.length-1;r>=0;r--){const i=t[r],s=e.newDoc.slice(i.fromB,i.toB);n=n.replace(i.fromA,i.toA,s)}return n}var $8=kt("StartDiffReview",n=>e=>(t,r)=>{if(e==null)return!1;const i=n.get(Ps)(e);return i?(r&&r(t.tr.setMeta(Ue,{type:"start",newDoc:i})),!0):!1});kr($8,{displayName:"Command<startDiffReview>",group:"Diff"});var r1=kt("StartDiffReviewFromDoc",()=>n=>(e,t)=>!n||n.type!==e.doc.type?!1:(t&&t(e.tr.setMeta(Ue,{type:"start",newDoc:n})),!0));kr(r1,{displayName:"Command<startDiffReviewFromDoc>",group:"Diff"});var V8=kt("AcceptDiffChunk",()=>n=>(e,t)=>{if(n==null)return!1;const r=Ue.getState(e);if(!r)return!1;const i=i0(r)[n];if(!i)return!1;if(t){const s=r.newDoc.slice(i.fromB,i.toB);let o=e.tr.replace(i.fromA,i.toA,s);o=o.setMeta(Ue,{type:"accept",changeIndex:n}),t(o)}return!0});kr(V8,{displayName:"Command<acceptDiffChunk>",group:"Diff"});var W8=kt("RejectDiffChunk",()=>n=>(e,t)=>{if(n==null)return!1;const r=Ue.getState(e);if(!r)return!1;const i=i0(r)[n];return i?(t&&t(e.tr.setMeta(Ue,{type:"reject",fromB:i.fromB,toB:i.toB})),!0):!1});kr(W8,{displayName:"Command<rejectDiffChunk>",group:"Diff"});var i1=kt("AcceptDiffRange",()=>n=>(e,t)=>{if(!n)return!1;const r=Ue.getState(e);if(!r)return!1;if(t){const i=r.newDoc.slice(n.fromB,n.toB);let s=e.tr.replace(n.fromA,n.toA,i);s=s.setMeta(Ue,{type:"acceptRange",range:n}),t(s)}return!0});kr(i1,{displayName:"Command<acceptDiffRange>",group:"Diff"});var s1=kt("RejectDiffRange",()=>n=>(e,t)=>!n||!Ue.getState(e)?!1:(t&&t(e.tr.setMeta(Ue,{type:"rejectRange",range:n})),!0));kr(s1,{displayName:"Command<rejectDiffRange>",group:"Diff"});var Eh=kt("AcceptAllDiffs",()=>()=>(n,e)=>{const t=Ue.getState(n);return t?(e&&e((t.rejectedRanges.length===0?n.tr.replaceWith(0,n.doc.content.size,t.newDoc.content):F_(n.tr,t)).setMeta(Ue,{type:"acceptAll"})),!0):!1});kr(Eh,{displayName:"Command<acceptAllDiffs>",group:"Diff"});var qu=kt("ClearDiffReview",()=>()=>(n,e)=>Ue.getState(n)?(e&&e(n.tr.setMeta(Ue,{type:"clear"})),!0):!1);kr(qu,{displayName:"Command<clearDiffReview>",group:"Diff"});var q_=[Th,q8,$8,r1,V8,i1,W8,s1,Eh,qu],$_=Object.defineProperty,b5=Object.getOwnPropertySymbols,V_=Object.prototype.hasOwnProperty,W_=Object.prototype.propertyIsEnumerable,w5=(n,e,t)=>e in n?$_(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,j_=(n,e)=>{for(var t in e||(e={}))V_.call(e,t)&&w5(n,t,e[t]);if(b5)for(var t of b5(e))W_.call(e,t)&&w5(n,t,e[t]);return n};function j8(n,e){return Object.assign(n,{meta:j_({package:"@milkdown/components"},e)}),n}const Pr="milkdown-diff",G_={acceptLabel:"Accept",rejectLabel:"Reject",customBlockTypes:[]},_h=Be(G_,"diffComponentConfig");j8(_h,{displayName:"Ctx<diffComponentConfig>",group:"DiffComponent"});function U_(n,e,t){if(e===t)return!1;const r=n.resolve(e),i=n.resolve(t),s=r.index(0),o=i.depth===0?Math.max(0,i.index(0)-1):i.index(0);return s!==o}function x5(n,e,t){if(e>=t)return!1;const r=n.resolve(e),i=n.resolve(t);if(r.sameParent(i)&&r.parent.isTextblock)return!1;let s=!1;return n.nodesBetween(e,t,(o,a)=>{if(s)return!1;if(!o.isBlock)return!0;const l=a+o.nodeSize;return a>=e&&l<=t?(s=!0,!1):!0}),s}function K_(n,e,t){if(t!==n.content.size)return!1;const r=n.resolve(e);if(r.depth!==0)return!1;for(let i=r.index(0);i<n.childCount;i++){const s=n.child(i);if(s.type.name!=="paragraph"||s.content.size>0)return!1}return!0}function X_(n){let e=n.content.size;for(let t=n.childCount-1;t>=0;t--){const r=n.child(t);if(r.type.name!=="paragraph"||r.content.size>0)break;e-=r.nodeSize}return e}function wp(n,e){const t=n.resolve(e);for(let r=t.depth;r>=1;r--)if(t.node(r).isTextblock)return t.before(r);return e}function G8(n,e,t,r){let i=0;for(let s=0;s<n.childCount;s++){const o=n.child(s),a=i+o.nodeSize;if(i>=t)break;a>e&&i<t&&r(o,i,a),i=a}}function U8(n,e,t,r){G8(n,e,t,(i,s,o)=>{o===n.content.size&&i.type.name==="paragraph"&&i.content.size===0||r.push(In.node(s,o,{class:`${Pr}-removed-block`}))})}function qd(n,e,t=!1){if(e<0||e>n.content.size)return null;const r=n.resolve(Math.min(e,n.content.size));if(r.depth>=1)return{from:r.before(1),to:r.after(1)};if(t){const i=r.nodeBefore;if(i)return{from:e-i.nodeSize,to:e};const s=r.nodeAfter;if(s)return{from:e,to:e+s.nodeSize}}else{const i=r.nodeAfter;if(i)return{from:e,to:e+i.nodeSize};const s=r.nodeBefore;if(s)return{from:e-s.nodeSize,to:e}}return null}function o1(n,e,t){if(e<0||e>n.content.size)return null;const r=n.resolve(Math.min(e,n.content.size));for(let i=r.depth;i>=0;i--){const s=r.node(i).type.name;if(t.has(s))return s}return null}function $u(n,e,t,r=!1){const i=o1(n,e,t);if(i)return i;const s=n.resolve(Math.min(Math.max(e,0),n.content.size)),o=r?s.nodeBefore:s.nodeAfter;return o&&t.has(o.type.name)?o.type.name:null}function Y_(n,e,t){const r=[];let i=!0,s=-1,o=-1;return G8(n,e,t,(a,l,c)=>{s===-1&&(s=l),o=c,r.push(a)}),(r.length===0||s!==e||o!==t)&&(i=!1),i?r:[]}function Y0(n,e,t,r){return n<r&&e>t}function k5(n,e,t,r){return e===t?o1(n,e,r)!=null:$u(n,e,r)!=null||$u(n,t,r,!0)!=null}function Z_(n,e,t){const r=n.resolve(t.fromA);if(!r.parent.isTextblock||r.depth<1||!r.node(1).isTextblock)return null;const i=r.after(1),s=e.resolve(t.fromB);let o;if(s.depth>=1&&s.node(1).isTextblock?(o=s.after(1),o>t.toB&&(o=t.toB)):o=t.fromB,i>=t.toA&&o>=t.toB)return null;const a=[];return(i>t.fromA||o>t.fromB)&&a.push({fromA:t.fromA,toA:Math.min(i,t.toA),fromB:t.fromB,toB:o,isBlock:!1}),(t.toA>i||t.toB>o)&&a.push({fromA:i,toA:Math.max(i,t.toA),fromB:o,toB:t.toB,isBlock:!0}),a.length>1?a:null}function J_(n,e,t,r){return k5(e,n.fromA,n.toA,r)||k5(t,n.fromB,n.toB,r)}function Q_(n,e,t,r){var i,s,o,a;const l=[],c=new Set;for(let u=0;u<n.length;u++){if(c.has(u))continue;const h=n[u];if(!J_(h,e,t,r)){l.push({fromA:h.fromA,toA:h.toA,fromB:h.fromB,toB:h.toB,isCustomBlock:!1});continue}const d=C5(e,h.fromA,h.toA,r),f=C5(t,h.fromB,h.toB,r),m={fromA:Math.min((i=d?.from)!=null?i:h.fromA,h.fromA),toA:Math.max((s=d?.to)!=null?s:h.toA,h.toA),fromB:Math.min((o=f?.from)!=null?o:h.fromB,h.fromB),toB:Math.max((a=f?.to)!=null?a:h.toB,h.toB),isCustomBlock:!0};c.add(u);for(let y=u+1;y<n.length;y++){if(c.has(y))continue;const b=n[y],x=d&&Y0(b.fromA,b.toA,d.from,d.to),C=f&&Y0(b.fromB,b.toB,f.from,f.to);!x&&!C||(c.add(y),m.fromA=Math.min(m.fromA,b.fromA),m.toA=Math.max(m.toA,b.toA),m.fromB=Math.min(m.fromB,b.fromB),m.toB=Math.max(m.toB,b.toB))}const g=[];for(let y=0;y<l.length;y++){const b=l[y];if(!b.isCustomBlock)continue;const x=Y0(m.fromA,m.toA,b.fromA,b.toA),C=Y0(m.fromB,m.toB,b.fromB,b.toB);!x&&!C||(m.fromA=Math.min(m.fromA,b.fromA),m.toA=Math.max(m.toA,b.toA),m.fromB=Math.min(m.fromB,b.fromB),m.toB=Math.max(m.toB,b.toB),g.push(y))}for(let y=g.length-1;y>=0;y--)l.splice(g[y],1);l.push(m)}return l}function eI(n,e){const t=X_(e);if(t!==e.content.size)for(const r of n)r.fromA===r.toA&&r.fromB<r.toB&&r.fromA>=t&&(r.fromA=t,r.toA=t)}function C5(n,e,t,r){return e===t?o1(n,e,r)==null?null:qd(n,e):$u(n,e,r)!=null?qd(n,e):$u(n,t,r,!0)!=null?qd(n,t,!0):null}const S5=new ft("MILKDOWN_DIFF_DECORATION"),K8=dt(n=>{const e=n.get(_h.key);return new at({key:S5,state:{init:()=>Cn.empty,apply(t,r,i,s){const o=Ue.getState(s);return o?.active?t.getMeta(Ue)||t.docChanged?nI(n,s.doc,o,e):r.map(t.mapping,t.doc):Cn.empty}},props:{decorations(t){var r;return(r=S5.getState(t))!=null?r:Cn.empty}}})});j8(K8,{displayName:"Prose<diffDecoration>",group:"DiffComponent"});function tI({doc:n,newDoc:e,segments:t,change:r,changeIndex:i,commands:s,acceptLabel:o,rejectLabel:a,decorations:l}){for(let f=0;f<t.length;f++){const m=t[f],g=m.fromA<m.toA,y=m.fromB<m.toB;if(g&&(m.isBlock?U8(n,m.fromA,m.toA,l):l.push(In.inline(m.fromA,m.toA,{class:`${Pr}-removed`}))),y){const b=m.isBlock?wp(n,g?m.toA:m.fromA):g?m.toA:m.fromA,x=X8(e,m,m.isBlock);l.push(In.widget(b,x,{side:-1,key:`added-${i}-${f}`}))}}const c=t[t.length-1],u=c.isBlock?c.fromA<c.toA?c.toA:c.fromA:r.toA,h=wp(n,u),d=Y8({commands:s,isBlockLevel:!0,change:r,acceptLabel:o,rejectLabel:a});l.push(In.widget(h,d,{side:-1,key:`controls-${i}`}))}function nI(n,e,t,r){const i=[],s=n.get(te),o=new Set(r.customBlockTypes),a=i0(t),l=Q_(a,e,t.newDoc,o);eI(l,e);for(let c=0;c<l.length;c++){const u=l[c],h=u.fromA<u.toA,d=u.fromB<u.toB;if(h&&!d&&K_(e,u.fromA,u.toA))continue;const f=h&&U_(e,u.fromA,u.toA),m=h&&x5(e,u.fromA,u.toA),g=d&&x5(t.newDoc,u.fromB,u.toB),y=h&&!f&&!m&&!u.isCustomBlock&&!g,b=(f||m||g)&&!y;if(b&&!u.isCustomBlock){const S=Z_(e,t.newDoc,u);if(S){tI({doc:e,newDoc:t.newDoc,segments:S,change:u,changeIndex:c,commands:s,acceptLabel:r.acceptLabel,rejectLabel:r.rejectLabel,decorations:i});continue}}h&&(u.isCustomBlock||b?U8(e,u.fromA,u.toA,i):i.push(In.inline(u.fromA,u.toA,{class:`${Pr}-removed`})));const x=h?u.toA:u.fromA,C=b?wp(e,x):x;if(d){const S=X8(t.newDoc,u,b);i.push(In.widget(C,S,{side:-1,key:`added-${c}`}))}const E=Y8({commands:s,isBlockLevel:b,change:u,acceptLabel:r.acceptLabel,rejectLabel:r.rejectLabel});i.push(In.widget(C,E,{side:b?-1:1,key:`controls-${c}`}))}return Cn.create(e,i)}function X8(n,e,t){var r;const i=document.createElement(t?"div":"span");i.className=`${Pr}-added`,i.contentEditable="false",t&&i.classList.add(`${Pr}-added-block`);const s=N3.fromSchema(n.type.schema);if(t){const l=Y_(n,e.fromB,e.toB);if(l.length>0){const c=document.createDocumentFragment();for(const u of l)c.appendChild(s.serializeNode(u));return i.appendChild(c),i}}const o=n.slice(e.fromB,e.toB),a=s.serializeFragment(o.content);if(i.appendChild(a),!((r=i.textContent)!=null&&r.trim())&&!i.querySelector("img, video, audio, canvas, svg")){const l=n.textBetween(e.fromB,e.toB,`
|
|
14
|
+
`);r>-1&&(t=t.slice(0,r))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),r=e+t.length;for(let i=this.rangeIndex;;){let s=this.ranges[i].to;if(s>=r||(t=t.slice(0,s-(r-t.length)),i++,i==this.ranges.length))break;let o=this.ranges[i].from,a=this.lineAfter(o);t+=a,r=o+a.length}return{line:t,end:r}}skipGapsTo(e,t,r){for(;;){let i=this.ranges[this.rangeIndex].to,s=e+t;if(r>0?i>s:i>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-i}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,r,i){let s=4;if(this.ranges.length>1){i=this.skipGapsTo(t,i,1),t+=i;let a=this.chunk.length;i=this.skipGapsTo(r,i,-1),r+=i,s+=this.chunk.length-a}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=r:this.chunk.push(e,t,r,s),i}parseLine(e){let{line:t,end:r}=this.nextLine(),i=0,{streamParser:s}=this.lang,o=new p8(t,e?e.state.tabSize:4,e?Ms(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=D8(s.token,o,this.state);if(a&&(i=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+o.start,this.parsedPos+o.pos,i)),o.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=Oe.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:o_,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new Oe(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 Oe(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function D8(n,e,t){e.start=e.pos;for(let r=0;r<10;r++){let i=n(e,t);if(e.pos>e.start)return i}throw new Error("Stream parser failed to advance stream.")}const n1=Object.create(null),El=[Wt.none],o_=new Im(El),s5=[],o5=Object.create(null),O8=Object.create(null);for(let[n,e]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"]])O8[n]=R8(n1,e);class P8{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),O8)}resolve(e){return e?this.table[e]||(this.table[e]=R8(this.extra,e)):0}}const a_=new P8(n1);function Hd(n,e){s5.indexOf(n)>-1||(s5.push(n),console.warn(e))}function R8(n,e){let t=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let u=n[c]||H[c];u?typeof u=="function"?l.length?l=l.map(u):Hd(c,`Modifier ${c} used at start of tag`):l.length?Hd(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:Hd(c,`Unknown highlighting tag ${c}`)}for(let c of l)t.push(c)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+t.map(a=>a.id),s=o5[i];if(s)return s.id;let o=o5[i]=Wt.define({id:El.length,name:r,props:[uE({[r]:t})]});return El.push(o),o.id}function l_(n,e){let t=Wt.define({id:El.length,name:"Document",props:[hs.add(()=>n),v8.add(()=>r=>e.getIndent(r))],top:!0});return El.push(t),t}Pe.RTL,Pe.LTR;function F(n){return new yE(e1.define(n))}function Zr(n){return R(()=>import("./assets/index-DyrOw6Ys.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(e=>e.sql({dialect:e[n]}))}const c_=[P.of({name:"C",extensions:["c","h","ino"],load(){return R(()=>import("./assets/index-GnzkuZjw.js"),__vite__mapDeps([3,1,2]),import.meta.url).then(n=>n.cpp())}}),P.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return R(()=>import("./assets/index-GnzkuZjw.js"),__vite__mapDeps([3,1,2]),import.meta.url).then(n=>n.cpp())}}),P.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Zr("Cassandra")}}),P.of({name:"CSS",extensions:["css"],load(){return R(()=>import("./assets/index-VyEqR7eO.js"),__vite__mapDeps([4,1,2]),import.meta.url).then(n=>n.css())}}),P.of({name:"Go",extensions:["go"],load(){return R(()=>import("./assets/index-XaLIcAHQ.js"),__vite__mapDeps([5,1,2]),import.meta.url).then(n=>n.go())}}),P.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return R(()=>import("./assets/index-B5QirwlE.js"),__vite__mapDeps([6,1,4,2,7]),import.meta.url).then(n=>n.html())}}),P.of({name:"Java",extensions:["java"],load(){return R(()=>import("./assets/index-8AqD83H1.js"),__vite__mapDeps([8,1,2]),import.meta.url).then(n=>n.java())}}),P.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return R(()=>import("./assets/index-BLsUt-zA.js"),__vite__mapDeps([7,1,2]),import.meta.url).then(n=>n.javascript())}}),P.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return R(()=>import("./assets/index-BDkwyFzW.js"),__vite__mapDeps([9,6,1,4,2,7]),import.meta.url).then(n=>n.jinja())}}),P.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return R(()=>import("./assets/index-D1q1oCbd.js"),__vite__mapDeps([10,1,2]),import.meta.url).then(n=>n.json())}}),P.of({name:"JSX",extensions:["jsx"],load(){return R(()=>import("./assets/index-BLsUt-zA.js"),__vite__mapDeps([7,1,2]),import.meta.url).then(n=>n.javascript({jsx:!0}))}}),P.of({name:"LESS",extensions:["less"],load(){return R(()=>import("./assets/index-BCHnk3-y.js"),__vite__mapDeps([11,4,1,2]),import.meta.url).then(n=>n.less())}}),P.of({name:"Liquid",extensions:["liquid"],load(){return R(()=>import("./assets/index-DcclUA5v.js"),__vite__mapDeps([12,6,1,4,2,7]),import.meta.url).then(n=>n.liquid())}}),P.of({name:"MariaDB SQL",load(){return Zr("MariaSQL")}}),P.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return R(()=>import("./assets/index-CJI0zg2K.js"),__vite__mapDeps([13,6,1,4,2,7]),import.meta.url).then(n=>n.markdown())}}),P.of({name:"MS SQL",load(){return Zr("MSSQL")}}),P.of({name:"MySQL",load(){return Zr("MySQL")}}),P.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return R(()=>import("./assets/index-CMbXJhMt.js"),__vite__mapDeps([14,1,6,4,2,7]),import.meta.url).then(n=>n.php())}}),P.of({name:"PLSQL",extensions:["pls"],load(){return Zr("PLSQL")}}),P.of({name:"PostgreSQL",load(){return Zr("PostgreSQL")}}),P.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return R(()=>import("./assets/index-Cp7P_1nO.js"),__vite__mapDeps([15,1,2]),import.meta.url).then(n=>n.python())}}),P.of({name:"Rust",extensions:["rs"],load(){return R(()=>import("./assets/index-VMxQT3yK.js"),__vite__mapDeps([16,1,2]),import.meta.url).then(n=>n.rust())}}),P.of({name:"Sass",extensions:["sass"],load(){return R(()=>import("./assets/index-BTIQZeYj.js"),__vite__mapDeps([17,1,4,2]),import.meta.url).then(n=>n.sass({indented:!0}))}}),P.of({name:"SCSS",extensions:["scss"],load(){return R(()=>import("./assets/index-BTIQZeYj.js"),__vite__mapDeps([17,1,4,2]),import.meta.url).then(n=>n.sass())}}),P.of({name:"SQL",extensions:["sql"],load(){return Zr("StandardSQL")}}),P.of({name:"SQLite",load(){return Zr("SQLite")}}),P.of({name:"TSX",extensions:["tsx"],load(){return R(()=>import("./assets/index-BLsUt-zA.js"),__vite__mapDeps([7,1,2]),import.meta.url).then(n=>n.javascript({jsx:!0,typescript:!0}))}}),P.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return R(()=>import("./assets/index-BLsUt-zA.js"),__vite__mapDeps([7,1,2]),import.meta.url).then(n=>n.javascript({typescript:!0}))}}),P.of({name:"WebAssembly",extensions:["wat","wast"],load(){return R(()=>import("./assets/index-DjR_s1th.js"),__vite__mapDeps([18,1,2]),import.meta.url).then(n=>n.wast())}}),P.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return R(()=>import("./assets/index-CLXxLVkb.js"),__vite__mapDeps([19,1,2]),import.meta.url).then(n=>n.xml())}}),P.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return R(()=>import("./assets/index-Clsl5-o0.js"),__vite__mapDeps([20,1,2]),import.meta.url).then(n=>n.yaml())}}),P.of({name:"APL",extensions:["dyalog","apl"],load(){return R(()=>import("./assets/apl-B4CMkyY2.js"),[],import.meta.url).then(n=>F(n.apl))}}),P.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return R(()=>import("./assets/asciiarmor-Df11BRmG.js"),[],import.meta.url).then(n=>F(n.asciiArmor))}}),P.of({name:"ASN.1",extensions:["asn","asn1"],load(){return R(()=>import("./assets/asn1-EdZsLKOL.js"),[],import.meta.url).then(n=>F(n.asn1({})))}}),P.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return R(()=>import("./assets/asterisk-B-8jnY81.js"),[],import.meta.url).then(n=>F(n.asterisk))}}),P.of({name:"Brainfuck",extensions:["b","bf"],load(){return R(()=>import("./assets/brainfuck-C4LP7Hcl.js"),[],import.meta.url).then(n=>F(n.brainfuck))}}),P.of({name:"Cobol",extensions:["cob","cpy"],load(){return R(()=>import("./assets/cobol-CWcv1MsR.js"),[],import.meta.url).then(n=>F(n.cobol))}}),P.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return R(()=>import("./assets/clike-B9uivgTg.js"),[],import.meta.url).then(n=>F(n.csharp))}}),P.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return R(()=>import("./assets/clojure-BMjYHr_A.js"),[],import.meta.url).then(n=>F(n.clojure))}}),P.of({name:"ClojureScript",extensions:["cljs"],load(){return R(()=>import("./assets/clojure-BMjYHr_A.js"),[],import.meta.url).then(n=>F(n.clojure))}}),P.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return R(()=>import("./assets/css-BnMrqG3P.js"),[],import.meta.url).then(n=>F(n.gss))}}),P.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return R(()=>import("./assets/cmake-BQqOBYOt.js"),[],import.meta.url).then(n=>F(n.cmake))}}),P.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return R(()=>import("./assets/coffeescript-S37ZYGWr.js"),[],import.meta.url).then(n=>F(n.coffeeScript))}}),P.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return R(()=>import("./assets/commonlisp-DBKNyK5s.js"),[],import.meta.url).then(n=>F(n.commonLisp))}}),P.of({name:"Cypher",extensions:["cyp","cypher"],load(){return R(()=>import("./assets/cypher-C_CwsFkJ.js"),[],import.meta.url).then(n=>F(n.cypher))}}),P.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return R(()=>import("./assets/python-BuPzkPfP.js"),[],import.meta.url).then(n=>F(n.cython))}}),P.of({name:"Crystal",extensions:["cr"],load(){return R(()=>import("./assets/crystal-SjHAIU92.js"),[],import.meta.url).then(n=>F(n.crystal))}}),P.of({name:"D",extensions:["d"],load(){return R(()=>import("./assets/d-pRatUO7H.js"),[],import.meta.url).then(n=>F(n.d))}}),P.of({name:"Dart",extensions:["dart"],load(){return R(()=>import("./assets/clike-B9uivgTg.js"),[],import.meta.url).then(n=>F(n.dart))}}),P.of({name:"diff",extensions:["diff","patch"],load(){return R(()=>import("./assets/diff-DbItnlRl.js"),[],import.meta.url).then(n=>F(n.diff))}}),P.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return R(()=>import("./assets/dockerfile-BKs6k2Af.js"),__vite__mapDeps([21,22]),import.meta.url).then(n=>F(n.dockerFile))}}),P.of({name:"DTD",extensions:["dtd"],load(){return R(()=>import("./assets/dtd-DF_7sFjM.js"),[],import.meta.url).then(n=>F(n.dtd))}}),P.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return R(()=>import("./assets/dylan-DwRh75JA.js"),[],import.meta.url).then(n=>F(n.dylan))}}),P.of({name:"EBNF",load(){return R(()=>import("./assets/ebnf-CDyGwa7X.js"),[],import.meta.url).then(n=>F(n.ebnf))}}),P.of({name:"ECL",extensions:["ecl"],load(){return R(()=>import("./assets/ecl-Cabwm37j.js"),[],import.meta.url).then(n=>F(n.ecl))}}),P.of({name:"edn",extensions:["edn"],load(){return R(()=>import("./assets/clojure-BMjYHr_A.js"),[],import.meta.url).then(n=>F(n.clojure))}}),P.of({name:"Eiffel",extensions:["e"],load(){return R(()=>import("./assets/eiffel-CnydiIhH.js"),[],import.meta.url).then(n=>F(n.eiffel))}}),P.of({name:"Elm",extensions:["elm"],load(){return R(()=>import("./assets/elm-vLlmbW-K.js"),[],import.meta.url).then(n=>F(n.elm))}}),P.of({name:"Erlang",extensions:["erl"],load(){return R(()=>import("./assets/erlang-BNw1qcRV.js"),[],import.meta.url).then(n=>F(n.erlang))}}),P.of({name:"Esper",load(){return R(()=>import("./assets/sql-D0XecflT.js"),[],import.meta.url).then(n=>F(n.esper))}}),P.of({name:"Factor",extensions:["factor"],load(){return R(()=>import("./assets/factor-kuTfRLto.js"),__vite__mapDeps([23,22]),import.meta.url).then(n=>F(n.factor))}}),P.of({name:"FCL",load(){return R(()=>import("./assets/fcl-Kvtd6kyn.js"),[],import.meta.url).then(n=>F(n.fcl))}}),P.of({name:"Forth",extensions:["forth","fth","4th"],load(){return R(()=>import("./assets/forth-Ffai-XNe.js"),[],import.meta.url).then(n=>F(n.forth))}}),P.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return R(()=>import("./assets/fortran-DYz_wnZ1.js"),[],import.meta.url).then(n=>F(n.fortran))}}),P.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return R(()=>import("./assets/mllike-CXdrOF99.js"),[],import.meta.url).then(n=>F(n.fSharp))}}),P.of({name:"Gas",extensions:["s"],load(){return R(()=>import("./assets/gas-Bneqetm1.js"),[],import.meta.url).then(n=>F(n.gas))}}),P.of({name:"Gherkin",extensions:["feature"],load(){return R(()=>import("./assets/gherkin-heZmZLOM.js"),[],import.meta.url).then(n=>F(n.gherkin))}}),P.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return R(()=>import("./assets/groovy-D9Dt4D0W.js"),[],import.meta.url).then(n=>F(n.groovy))}}),P.of({name:"Haskell",extensions:["hs"],load(){return R(()=>import("./assets/haskell-Cw1EW3IL.js"),[],import.meta.url).then(n=>F(n.haskell))}}),P.of({name:"Haxe",extensions:["hx"],load(){return R(()=>import("./assets/haxe-H-WmDvRZ.js"),[],import.meta.url).then(n=>F(n.haxe))}}),P.of({name:"HXML",extensions:["hxml"],load(){return R(()=>import("./assets/haxe-H-WmDvRZ.js"),[],import.meta.url).then(n=>F(n.hxml))}}),P.of({name:"HTTP",load(){return R(()=>import("./assets/http-DBlCnlav.js"),[],import.meta.url).then(n=>F(n.http))}}),P.of({name:"IDL",extensions:["pro"],load(){return R(()=>import("./assets/idl-BEugSyMb.js"),[],import.meta.url).then(n=>F(n.idl))}}),P.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return R(()=>import("./assets/javascript-iXu5QeM3.js"),[],import.meta.url).then(n=>F(n.jsonld))}}),P.of({name:"Julia",extensions:["jl"],load(){return R(()=>import("./assets/julia-DuME0IfC.js"),[],import.meta.url).then(n=>F(n.julia))}}),P.of({name:"Kotlin",extensions:["kt","kts"],load(){return R(()=>import("./assets/clike-B9uivgTg.js"),[],import.meta.url).then(n=>F(n.kotlin))}}),P.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return R(()=>import("./assets/livescript-BwQOo05w.js"),[],import.meta.url).then(n=>F(n.liveScript))}}),P.of({name:"Lua",extensions:["lua"],load(){return R(()=>import("./assets/lua-VAEuO923.js"),[],import.meta.url).then(n=>F(n.lua))}}),P.of({name:"mIRC",extensions:["mrc"],load(){return R(()=>import("./assets/mirc-CjQqDB4T.js"),[],import.meta.url).then(n=>F(n.mirc))}}),P.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return R(()=>import("./assets/mathematica-DTrFuWx2.js"),[],import.meta.url).then(n=>F(n.mathematica))}}),P.of({name:"Modelica",extensions:["mo"],load(){return R(()=>import("./assets/modelica-Dc1JOy9r.js"),[],import.meta.url).then(n=>F(n.modelica))}}),P.of({name:"MUMPS",extensions:["mps"],load(){return R(()=>import("./assets/mumps-BT43cFF4.js"),[],import.meta.url).then(n=>F(n.mumps))}}),P.of({name:"Mbox",extensions:["mbox"],load(){return R(()=>import("./assets/mbox-CNhZ1qSd.js"),[],import.meta.url).then(n=>F(n.mbox))}}),P.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return R(()=>import("./assets/nginx-DdIZxoE0.js"),[],import.meta.url).then(n=>F(n.nginx))}}),P.of({name:"NSIS",extensions:["nsh","nsi"],load(){return R(()=>import("./assets/nsis-LY0VT_u5.js"),__vite__mapDeps([24,22]),import.meta.url).then(n=>F(n.nsis))}}),P.of({name:"NTriples",extensions:["nt","nq"],load(){return R(()=>import("./assets/ntriples-BfvgReVJ.js"),[],import.meta.url).then(n=>F(n.ntriples))}}),P.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return R(()=>import("./assets/clike-B9uivgTg.js"),[],import.meta.url).then(n=>F(n.objectiveC))}}),P.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return R(()=>import("./assets/clike-B9uivgTg.js"),[],import.meta.url).then(n=>F(n.objectiveCpp))}}),P.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return R(()=>import("./assets/mllike-CXdrOF99.js"),[],import.meta.url).then(n=>F(n.oCaml))}}),P.of({name:"Octave",extensions:["m"],load(){return R(()=>import("./assets/octave-Ck1zUtKM.js"),[],import.meta.url).then(n=>F(n.octave))}}),P.of({name:"Oz",extensions:["oz"],load(){return R(()=>import("./assets/oz-BzwKVEFT.js"),[],import.meta.url).then(n=>F(n.oz))}}),P.of({name:"Pascal",extensions:["p","pas"],load(){return R(()=>import("./assets/pascal--L3eBynH.js"),[],import.meta.url).then(n=>F(n.pascal))}}),P.of({name:"Perl",extensions:["pl","pm"],load(){return R(()=>import("./assets/perl-CdXCOZ3F.js"),[],import.meta.url).then(n=>F(n.perl))}}),P.of({name:"Pig",extensions:["pig"],load(){return R(()=>import("./assets/pig-CevX1Tat.js"),[],import.meta.url).then(n=>F(n.pig))}}),P.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return R(()=>import("./assets/powershell-CFHJl5sT.js"),[],import.meta.url).then(n=>F(n.powerShell))}}),P.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return R(()=>import("./assets/properties-C78fOPTZ.js"),[],import.meta.url).then(n=>F(n.properties))}}),P.of({name:"ProtoBuf",extensions:["proto"],load(){return R(()=>import("./assets/protobuf-ChK-085T.js"),[],import.meta.url).then(n=>F(n.protobuf))}}),P.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return R(()=>import("./assets/pug-DeIclll2.js"),__vite__mapDeps([25,26]),import.meta.url).then(n=>F(n.pug))}}),P.of({name:"Puppet",extensions:["pp"],load(){return R(()=>import("./assets/puppet-DMA9R1ak.js"),[],import.meta.url).then(n=>F(n.puppet))}}),P.of({name:"Q",extensions:["q"],load(){return R(()=>import("./assets/q-pXgVlZs6.js"),[],import.meta.url).then(n=>F(n.q))}}),P.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return R(()=>import("./assets/r-B6wPVr8A.js"),[],import.meta.url).then(n=>F(n.r))}}),P.of({name:"RPM Changes",load(){return R(()=>import("./assets/rpm-CTu-6PCP.js"),[],import.meta.url).then(n=>F(n.rpmChanges))}}),P.of({name:"RPM Spec",extensions:["spec"],load(){return R(()=>import("./assets/rpm-CTu-6PCP.js"),[],import.meta.url).then(n=>F(n.rpmSpec))}}),P.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return R(()=>import("./assets/ruby-BK5aLJev.js"),[],import.meta.url).then(n=>F(n.ruby))}}),P.of({name:"SAS",extensions:["sas"],load(){return R(()=>import("./assets/sas-B4kiWyti.js"),[],import.meta.url).then(n=>F(n.sas))}}),P.of({name:"Scala",extensions:["scala"],load(){return R(()=>import("./assets/clike-B9uivgTg.js"),[],import.meta.url).then(n=>F(n.scala))}}),P.of({name:"Scheme",extensions:["scm","ss"],load(){return R(()=>import("./assets/scheme-C41bIUwD.js"),[],import.meta.url).then(n=>F(n.scheme))}}),P.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return R(()=>import("./assets/shell-CjFT_Tl9.js"),[],import.meta.url).then(n=>F(n.shell))}}),P.of({name:"Sieve",extensions:["siv","sieve"],load(){return R(()=>import("./assets/sieve-C3Gn_uJK.js"),[],import.meta.url).then(n=>F(n.sieve))}}),P.of({name:"Smalltalk",extensions:["st"],load(){return R(()=>import("./assets/smalltalk-CnHTOXQT.js"),[],import.meta.url).then(n=>F(n.smalltalk))}}),P.of({name:"Solr",load(){return R(()=>import("./assets/solr-DehyRSwq.js"),[],import.meta.url).then(n=>F(n.solr))}}),P.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return R(()=>import("./assets/mllike-CXdrOF99.js"),[],import.meta.url).then(n=>F(n.sml))}}),P.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return R(()=>import("./assets/sparql-DkYu6x3z.js"),[],import.meta.url).then(n=>F(n.sparql))}}),P.of({name:"Spreadsheet",alias:["excel","formula"],load(){return R(()=>import("./assets/spreadsheet-BCZA_wO0.js"),[],import.meta.url).then(n=>F(n.spreadsheet))}}),P.of({name:"Squirrel",extensions:["nut"],load(){return R(()=>import("./assets/clike-B9uivgTg.js"),[],import.meta.url).then(n=>F(n.squirrel))}}),P.of({name:"Stylus",extensions:["styl"],load(){return R(()=>import("./assets/stylus-B533Al4x.js"),[],import.meta.url).then(n=>F(n.stylus))}}),P.of({name:"Swift",extensions:["swift"],load(){return R(()=>import("./assets/swift-BzpIVaGY.js"),[],import.meta.url).then(n=>F(n.swift))}}),P.of({name:"sTeX",load(){return R(()=>import("./assets/stex-C3f8Ysf7.js"),[],import.meta.url).then(n=>F(n.stex))}}),P.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return R(()=>import("./assets/stex-C3f8Ysf7.js"),[],import.meta.url).then(n=>F(n.stex))}}),P.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return R(()=>import("./assets/verilog-C6RDOZhf.js"),[],import.meta.url).then(n=>F(n.verilog))}}),P.of({name:"Tcl",extensions:["tcl"],load(){return R(()=>import("./assets/tcl-DVfN8rqt.js"),[],import.meta.url).then(n=>F(n.tcl))}}),P.of({name:"Textile",extensions:["textile"],load(){return R(()=>import("./assets/textile-CnDTJFAw.js"),[],import.meta.url).then(n=>F(n.textile))}}),P.of({name:"TiddlyWiki",load(){return R(()=>import("./assets/tiddlywiki-DO-Gjzrf.js"),[],import.meta.url).then(n=>F(n.tiddlyWiki))}}),P.of({name:"Tiki wiki",load(){return R(()=>import("./assets/tiki-DGYXhP31.js"),[],import.meta.url).then(n=>F(n.tiki))}}),P.of({name:"TOML",extensions:["toml"],load(){return R(()=>import("./assets/toml-Bm5Em-hy.js"),[],import.meta.url).then(n=>F(n.toml))}}),P.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return R(()=>import("./assets/troff-wAsdV37c.js"),[],import.meta.url).then(n=>F(n.troff))}}),P.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return R(()=>import("./assets/ttcn-CfJYG6tj.js"),[],import.meta.url).then(n=>F(n.ttcn))}}),P.of({name:"TTCN_CFG",extensions:["cfg"],load(){return R(()=>import("./assets/ttcn-cfg-B9xdYoR4.js"),[],import.meta.url).then(n=>F(n.ttcnCfg))}}),P.of({name:"Turtle",extensions:["ttl"],load(){return R(()=>import("./assets/turtle-B1tBg_DP.js"),[],import.meta.url).then(n=>F(n.turtle))}}),P.of({name:"Web IDL",extensions:["webidl"],load(){return R(()=>import("./assets/webidl-ZXfAyPTL.js"),[],import.meta.url).then(n=>F(n.webIDL))}}),P.of({name:"VB.NET",extensions:["vb"],load(){return R(()=>import("./assets/vb-CmGdzxic.js"),[],import.meta.url).then(n=>F(n.vb))}}),P.of({name:"VBScript",extensions:["vbs"],load(){return R(()=>import("./assets/vbscript-BuJXcnF6.js"),[],import.meta.url).then(n=>F(n.vbScript))}}),P.of({name:"Velocity",extensions:["vtl"],load(){return R(()=>import("./assets/velocity-D8B20fx6.js"),[],import.meta.url).then(n=>F(n.velocity))}}),P.of({name:"Verilog",extensions:["v"],load(){return R(()=>import("./assets/verilog-C6RDOZhf.js"),[],import.meta.url).then(n=>F(n.verilog))}}),P.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return R(()=>import("./assets/vhdl-lSbBsy5d.js"),[],import.meta.url).then(n=>F(n.vhdl))}}),P.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return R(()=>import("./assets/xquery-DzFWVndE.js"),[],import.meta.url).then(n=>F(n.xQuery))}}),P.of({name:"Yacas",extensions:["ys"],load(){return R(()=>import("./assets/yacas-BJ4BC0dw.js"),[],import.meta.url).then(n=>F(n.yacas))}}),P.of({name:"Z80",extensions:["z80"],load(){return R(()=>import("./assets/z80-Hz9HOZM7.js"),[],import.meta.url).then(n=>F(n.z80))}}),P.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return R(()=>import("./assets/mscgen-BA5vi2Kp.js"),[],import.meta.url).then(n=>F(n.mscgen))}}),P.of({name:"Xù",extensions:["xu"],load(){return R(()=>import("./assets/mscgen-BA5vi2Kp.js"),[],import.meta.url).then(n=>F(n.xu))}}),P.of({name:"MsGenny",extensions:["msgenny"],load(){return R(()=>import("./assets/mscgen-BA5vi2Kp.js"),[],import.meta.url).then(n=>F(n.msgenny))}}),P.of({name:"Vue",extensions:["vue"],load(){return R(()=>import("./assets/index-C-7U-6v_.js"),__vite__mapDeps([27,6,1,4,2,7]),import.meta.url).then(n=>n.vue())}}),P.of({name:"Angular Template",load(){return R(()=>import("./assets/index-B09gSE-P.js"),__vite__mapDeps([28,6,1,4,2,7]),import.meta.url).then(n=>n.angular())}})],u_="#e5c07b",a5="#e06c75",h_="#56b6c2",d_="#ffffff",Lc="#abb2bf",vp="#7d8799",f_="#61afef",p_="#98c379",l5="#d19a66",m_="#c678dd",g_="#21252b",c5="#2c313a",u5="#282c34",Fd="#353a42",v_="#3E4451",h5="#528bff",y_=Z.theme({"&":{color:Lc,backgroundColor:u5},".cm-content":{caretColor:h5},".cm-cursor, .cm-dropCursor":{borderLeftColor:h5},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:v_},".cm-panels":{backgroundColor:g_,color:Lc},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:u5,color:vp,border:"none"},".cm-activeLineGutter":{backgroundColor:c5},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Fd},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Fd,borderBottomColor:Fd},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:c5,color:Lc}}},{dark:!0}),b_=r0.define([{tag:H.keyword,color:m_},{tag:[H.name,H.deleted,H.character,H.propertyName,H.macroName],color:a5},{tag:[H.function(H.variableName),H.labelName],color:f_},{tag:[H.color,H.constant(H.name),H.standard(H.name)],color:l5},{tag:[H.definition(H.name),H.separator],color:Lc},{tag:[H.typeName,H.className,H.number,H.changed,H.annotation,H.modifier,H.self,H.namespace],color:u_},{tag:[H.operator,H.operatorKeyword,H.url,H.escape,H.regexp,H.link,H.special(H.string)],color:h_},{tag:[H.meta,H.comment],color:vp},{tag:H.strong,fontWeight:"bold"},{tag:H.emphasis,fontStyle:"italic"},{tag:H.strikethrough,textDecoration:"line-through"},{tag:H.link,color:vp,textDecoration:"underline"},{tag:H.heading,fontWeight:"bold",color:a5},{tag:[H.atom,H.bool,H.special(H.variableName)],color:l5},{tag:[H.processingInstruction,H.string,H.inserted],color:p_},{tag:H.invalid,color:d_}]),w_=[y_,E8(b_)];function x_(n){let e=n.schema.cached.changeSetIDs||(n.schema.cached.changeSetIDs=Object.create(null)),t=e[n.name];return t==null&&(e[n.name]=t=Object.keys(n.schema.nodes).indexOf(n.name)+1),t}const z8={encodeCharacter:n=>n,encodeNodeStart:n=>n.type.name,encodeNodeEnd:n=>-x_(n.type),compareTokens:(n,e)=>n===e};function yp(n,e,t,r,i){for(let s=0,o=0;s<n.childCount;s++){let a=n.child(s),l=o+a.nodeSize,c=Math.max(o,t),u=Math.min(l,r);if(c<u)if(a.isText)for(let h=c;h<u;h++)i.push(e.encodeCharacter(a.text.charCodeAt(h-o),a.marks));else a.isLeaf?i.push(e.encodeNodeStart(a)):(c==o&&i.push(e.encodeNodeStart(a)),yp(a.content,e,Math.max(o+1,c)-o-1,Math.min(l-1,u)-o-1,i),u==l&&i.push(e.encodeNodeEnd(a)));o=l}return i}const d5=2500,k_=1e4;function C_(n,e){return Math.min(15,Math.max(2,Math.floor(Math.max(n,e)/10)))}function N8(n,e,t,r=z8){if(Math.max(t.toA-t.fromA,t.toB-t.fromB)>k_)return[t];let i=yp(n,r,t.fromA,t.toA,[]),s=yp(e,r,t.fromB,t.toB,[]);return S_(i,s,t,r.compareTokens)}function S_(n,e,t,r){let i=0,s=n.length,o=e.length;for(;i<n.length&&i<e.length&&r(n[i],e[i]);)i++;if(i==n.length&&i==e.length)return[];for(;s>i&&o>i&&r(n[s-1],e[o-1]);)s--,o--;if(s==i&&o==i)return[];if(s==i||o==i||s==o&&s==i+1||Math.max(s,o)-i>d5)return[t.slice(i,s,i,o)];let a=s-i,l=o-i,c=Math.min(d5,a+l),u=[],h=new Int16Array((c+1)*2).fill(-1);for(let d=0;d<=c;d++){for(let f=-d;f<=d;f+=2){let m=h[f+1+c],g=h[f-1+c],y=m<g?g:m+1,b=y+f;for(;y<a&&b<l&&r(n[i+y],e[i+b]);)y++,b++;if(h[f+c]=y,y>=a&&b>=l){let x=[],C=C_(s-i,o-i),E=-1,S=-1,T=-1,O=-1,L=(B,z,V,D)=>{E>-1&&E<z+C?(E=B,T=V):(E>-1&&x.push(t.slice(E,S,T,O)),E=B,S=z,T=V,O=D)};for(let B=d-1;B>=0;B--){let z=h[f+1+c],V=h[f-1+c];z<V?(f--,y=V+i,b=y+f,L(y,y,b,b+1)):(f++,y=z+i,b=y+f,L(y,y+1,b,b)),h=u[B>>1]}return E>-1&&x.push(t.slice(E,S,T,O)),x.reverse()}}d%2==0&&u.push(h.slice())}return[t.slice(i,s,i,o)]}let gt=class Ra{constructor(e,t){this.length=e,this.data=t}cut(e){return e==this.length?this:new Ra(e,this.data)}static slice(e,t,r){if(t==r)return Ra.none;if(t==0&&r==Ra.len(e))return e;let i=[];for(let s=0,o=0;o<r;s++){let a=e[s],l=o+a.length,c=Math.min(r,l)-Math.max(t,o);c>0&&i.push(a.cut(c)),o=l}return i}static join(e,t,r){if(e.length==0)return t;if(t.length==0)return e;let i=r(e[e.length-1].data,t[0].data);if(i==null)return e.concat(t);let s=e.slice(0,e.length-1);s.push(new Ra(e[e.length-1].length+t[0].length,i));for(let o=1;o<t.length;o++)s.push(t[o]);return s}static len(e){let t=0;for(let r=0;r<e.length;r++)t+=e[r].length;return t}};gt.none=[];class ln{constructor(e,t,r,i,s,o){this.fromA=e,this.toA=t,this.fromB=r,this.toB=i,this.deleted=s,this.inserted=o}get lenA(){return this.toA-this.fromA}get lenB(){return this.toB-this.fromB}slice(e,t,r,i){return e==0&&r==0&&t==this.toA-this.fromA&&i==this.toB-this.fromB?this:new ln(this.fromA+e,this.fromA+t,this.fromB+r,this.fromB+i,gt.slice(this.deleted,e,t),gt.slice(this.inserted,r,i))}static merge(e,t,r){if(e.length==0)return t;if(t.length==0)return e;let i=[];for(let s=0,o=0,a=e[0],l=t[0];;){if(!a&&!l)return i;if(a&&(!l||a.toB<l.fromA)){let c=o?t[o-1].toB-t[o-1].toA:0;i.push(c==0?a:new ln(a.fromA,a.toA,a.fromB+c,a.toB+c,a.deleted,a.inserted)),a=s++==e.length?null:e[s]}else if(l&&(!a||l.toA<a.fromB)){let c=s?e[s-1].toB-e[s-1].toA:0;i.push(c==0?l:new ln(l.fromA-c,l.toA-c,l.fromB,l.toB,l.deleted,l.inserted)),l=o++==t.length?null:t[o]}else{let c=Math.min(a.fromB,l.fromA),u=Math.min(a.fromA,l.fromA-(s?e[s-1].toB-e[s-1].toA:0)),h=u,d=Math.min(l.fromB,a.fromB+(o?t[o-1].toB-t[o-1].toA:0)),f=d,m=gt.none,g=gt.none,y=!1,b=!1;for(;;){let x=a?c>=a.fromB?a.toB:a.fromB:2e8,C=l?c>=l.fromA?l.toA:l.fromA:2e8,E=Math.min(x,C),S=a&&c>=a.fromB,T=l&&c>=l.fromA;if(!S&&!T)break;S&&c==a.fromB&&!y&&(m=gt.join(m,a.deleted,r),h+=a.lenA,y=!0),S&&!T&&(g=gt.join(g,gt.slice(a.inserted,c-a.fromB,E-a.fromB),r),f+=E-c),T&&c==l.fromA&&!b&&(g=gt.join(g,l.inserted,r),f+=l.lenB,b=!0),T&&!S&&(m=gt.join(m,gt.slice(l.deleted,c-l.fromA,E-l.fromA),r),h+=E-c),S&&E==a.toB&&(a=s++==e.length?null:e[s],y=!1),T&&E==l.toA&&(l=o++==t.length?null:t[o],b=!1),c=E}(u<h||d<f)&&i.push(new ln(u,h,d,f,m,g))}}}static fromJSON(e){return new ln(e.fromA,e.toA,e.fromB,e.toB,e.deleted.map(t=>new gt(t.length,t.data)),e.inserted.map(t=>new gt(t.length,t.data)))}toJSON(){return this}}let A_;try{A_=new RegExp("[\\p{Alphabetic}_]","u")}catch{}class ms{constructor(e,t){this.config=e,this.changes=t}addSteps(e,t,r){let i=[];for(let l=0;l<t.length;l++){let c=Array.isArray(r)?r[l]:r,u=0;t[l].forEach((h,d,f,m)=>{i.push(new ln(h+u,d+u,f,m,h==d?gt.none:[new gt(d-h,c)],f==m?gt.none:[new gt(m-f,c)])),u=m-f-(d-h)})}if(i.length==0)return this;let s=bp(i,this.config.combine),o=ln.merge(this.changes,s,this.config.combine),a=o;for(let l=0;l<a.length;l++){let c=a[l];if(c.fromA==c.toA||c.fromB==c.toB||!s.some(h=>h.toB>c.fromB&&h.fromB<c.toB))continue;let u=N8(this.config.doc.content,e.content,c,this.config.encoder);u.length==1&&u[0].fromB==0&&u[0].toB==c.toB-c.fromB||(a==o&&(a=o.slice()),u.length==1?a[l]=u[0]:(a.splice(l,1,...u),l+=u.length-1))}return new ms(this.config,a)}get startDoc(){return this.config.doc}map(e){let t=r=>{let i=e(r);return i===r.data?r:new gt(r.length,i)};return new ms(this.config,this.changes.map(r=>new ln(r.fromA,r.toA,r.fromB,r.toB,r.deleted.map(t),r.inserted.map(t))))}changedRange(e,t){if(e==this)return null;let r=t&&M_(t),i=r?r.toB-r.fromB-(r.toA-r.fromA):0;function s(h){return!r||h<=r.fromA?h:h+i}let o=r?r.fromB:2e8,a=r?r.toB:-2e8;function l(h,d=h){o=Math.min(h,o),a=Math.max(d,a)}let c=this.changes,u=e.changes;for(let h=0,d=0;h<c.length&&d<u.length;){let f=c[h],m=u[d];f&&m&&T_(f,m,s)?(h++,d++):m&&(!f||s(f.fromB)>=m.fromB)?(l(m.fromB,m.toB),d++):(l(s(f.fromB),s(f.toB)),h++)}return o<=a?{from:o,to:a}:null}static create(e,t=(s,o)=>s===o?s:null,r=z8,i=[]){return new ms({combine:t,doc:e,encoder:r},i)}}ms.computeDiff=N8;function bp(n,e,t=0,r=n.length){if(r==t+1)return[n[t]];let i=t+r>>1;return ln.merge(bp(n,e,t,i),bp(n,e,i,r),e)}function f5(n){let e=2e8,t=-2e8;for(let r=0;r<n.length;r++){let i=n[r];e!=2e8&&(e=i.map(e,-1),t=i.map(t,1)),i.forEach((s,o,a,l)=>{e=Math.min(e,a),t=Math.max(t,l)})}return e==2e8?null:{from:e,to:t}}function M_(n){let e=f5(n);if(!e)return null;let t=f5(n.map(r=>r.invert()).reverse());return{fromA:t.from,toA:t.to,fromB:e.from,toB:e.to}}function T_(n,e,t){return t(n.fromB)==e.fromB&&t(n.toB)==e.toB&&p5(n.deleted,e.deleted)&&p5(n.inserted,e.inserted)}function p5(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t].length!=e[t].length||n[t].data!==e[t].data)return!1;return!0}function kr(n,e){return Object.assign(n,{meta:{package:"@milkdown/plugin-diff",...e}}),n}var m5=500;function E_(n={}){const e=new WeakMap,t=new WeakMap;function r(i){let s=e.get(i);if(s!=null)return s;const o=i.attrs,a=o?Object.keys(o).filter(l=>o[l]!=null).sort():[];if(a.length===0)s=i.type.name;else{const l={};for(const c of a)l[c]=o[c];s=`${i.type.name}:${JSON.stringify(l)}`}return e.set(i,s),s}return{encodeCharacter:(i,s)=>{if(s.length===0)return i;let o=t.get(s);return o==null&&(o=s.map(r).join(","),t.set(s,o)),`${i}:${o}`},encodeNodeStart:i=>{const s=i.attrs;if(s&&Object.keys(s).length>0){const o=n[i.type.name]??[],a=Object.keys(s).filter(l=>{if(o.includes(l))return!1;const c=i.type.spec.attrs?.[l]?.default;return s[l]!==c});if(a.length>0){const l={};for(const c of a.sort())l[c]=s[c];return`${i.type.name}:${JSON.stringify(l)}`}}return i.type.name},encodeNodeEnd:i=>{const s=i.type.schema,o=s.cached.changeSetIDs||(s.cached.changeSetIDs=Object.create(null));let a=o[i.type.name];return a==null&&(o[i.type.name]=a=Object.keys(s.nodes).indexOf(i.type.name)+1),-a},compareTokens:(i,s)=>i===s}}function H8(n,e,t){const r=t.get(n);if(r!=null)return r;const i=[String(e.encodeNodeStart(n))];if(n.isText){const o=n.text;for(let a=0;a<o.length;a++)i.push(":"+String(e.encodeCharacter(o.charCodeAt(a),n.marks)))}else n.content.forEach(o=>{i.push("/"+H8(o,e,t))});i.push("\\"+String(e.encodeNodeEnd(n)));const s=i.join("");return t.set(n,s),s}function g5(n,e,t){const r=[];let i=0;return n.content.forEach(s=>{r.push({node:s,offset:i,size:s.nodeSize,signature:H8(s,t.encoder,t.sigCache)}),i+=s.nodeSize}),{node:n,contentStart:e,content:r}}function __(n,e){const t=n.length,r=e.length,i=Array.from({length:t+1},()=>Array.from({length:r+1},()=>0));for(let l=t-1;l>=0;l--)for(let c=r-1;c>=0;c--)n[l].signature===e[c].signature?i[l][c]=i[l+1][c+1]+1:i[l][c]=Math.max(i[l+1][c],i[l][c+1]);const s=[];let o=0,a=0;for(;o<t&&a<r;)n[o].signature===e[a].signature?(s.push([o,a]),o++,a++):i[o+1][a]>=i[o][a+1]?o++:a++;return s}function I_(n,e){if(n.type!==e.type)return!1;const t=n.type;return!(t.isTextblock||t.isAtom||t.spec.code===!0||!t.isBlock)}function F8(n,e,t){return ln.fromJSON({fromA:n.fromA+e,toA:n.toA+e,fromB:n.fromB+t,toB:n.toB+t,deleted:n.deleted.map(r=>({length:r.length,data:r.data})),inserted:n.inserted.map(r=>({length:r.length,data:r.data}))})}function L_(n,e,t){const r=n.parent.copy(Fn.from(n.node)),i=e.parent.copy(Fn.from(e.node)),s=new z3(0,r.content.size,new Wr(i.content,0,0));return ms.create(r,void 0,t.encoder).addSteps(i,[s.getMap()],null).changes.map(o=>F8(o,n.abs,e.abs))}function v5(n,e){const t=n.content;if(e<t.length)return n.contentStart+t[e].offset;if(e>0){const r=t[e-1];return n.contentStart+r.offset+r.size}return n.contentStart+n.node.content.size}function B_(n,e,t){return ln.fromJSON({fromA:e,toA:e+n.size,fromB:t,toB:t,deleted:[{length:n.size,data:null}],inserted:[]})}function D_(n,e,t){return ln.fromJSON({fromA:e,toA:e,fromB:t,toB:t+n.size,deleted:[],inserted:[{length:n.size,data:null}]})}function O_(n,e,t,r,i){const s=new z3(0,n.content.size,new Wr(e.content,0,0));return ms.create(n,void 0,i.encoder).addSteps(e,[s.getMap()],null).changes.map(o=>F8(o,t,r))}function Bc(n,e,t,r,i){if(n.childCount>m5||e.childCount>m5)return O_(n,e,t,r,i);const s=g5(n,t,i),o=g5(e,r,i),a=__(s.content,o.content),l=[];let c=0,u=0;for(const[h,d]of a)y5(s,o,{oldStart:c,oldEnd:h,newStart:u,newEnd:d},i,l),c=h+1,u=d+1;return y5(s,o,{oldStart:c,oldEnd:s.content.length,newStart:u,newEnd:o.content.length},i,l),l}function y5(n,e,t,r,i){const s=n.content,o=e.content;let a=t.oldStart,l=t.newStart;for(;a<t.oldEnd||l<t.newEnd;){const c=a<t.oldEnd?s[a]:null,u=l<t.newEnd?o[l]:null,h=c&&u&&c.node.type===u.node.type;if(c&&u&&h){i.push(...P_(n,e,c,u,r)),a++,l++;continue}if(c&&(!u||!h)){const d=n.contentStart+c.offset;i.push(B_(c,d,v5(e,l))),a++;continue}if(u){const d=e.contentStart+u.offset;i.push(D_(u,v5(n,a),d)),l++}}}function P_(n,e,t,r,i){const s=n.contentStart+t.offset,o=e.contentStart+r.offset;return I_(t.node,r.node)&&R_(t.node,r.node,i.encoder)?Bc(t.node,r.node,s+1,o+1,i):L_({node:t.node,parent:n.node,abs:s},{node:r.node,parent:e.node,abs:o},i)}function R_(n,e,t){return t.encodeNodeStart(n)===t.encodeNodeStart(e)}function z_(n,e,t,r,i){const s=n.resolve(t),o=n.resolve(r),a=e.resolve(t),l=e.resolve(r),c=s.sharedDepth(r);if(a.sharedDepth(r)!==c)throw new RangeError(`computeDocDiff: range [${t}, ${r}) resolves to different sharedDepth in old and new docs`);for(let g=0;g<=c;g++){if(i.encodeNodeStart(s.node(g))!==i.encodeNodeStart(a.node(g)))throw new RangeError(`computeDocDiff: ancestor at depth ${g} differs in type or non-ignored attrs along the path to the shared ancestor`);if(s.start(g)!==a.start(g))throw new RangeError(`computeDocDiff: ancestor at depth ${g} starts at different absolute positions in old and new docs (content before the range differs in size)`)}const u=s.node(c);if(u.isTextblock)throw new RangeError(`computeDocDiff: range [${t}, ${r}) lands inside a textblock; widen the range to a block boundary`);if(s.depth!==c||o.depth!==c||a.depth!==c||l.depth!==c)throw new RangeError(`computeDocDiff: range [${t}, ${r}) endpoints must be aligned to child boundaries of the shared ancestor`);const h=a.node(c),d=s.start(c),f=t-d,m=r-d;return{oldCut:u.copy(u.content.cut(f,m)),newCut:h.copy(h.content.cut(f,m)),cutAbsStart:t}}function Fu(n,e,t){const r=E_(t?.ignoreAttrs),i={encoder:r,sigCache:new WeakMap},s=n.content.size,o=e.content.size,a=t?.range;if(a==null)return Bc(n,e,0,0,i);const l=Math.min(s,o),c=Math.max(0,Math.min(a.from??0,l)),u=Math.max(c,Math.min(a.to??l,l));if(c===u)return[];if(c===0&&u===l&&s===o)return Bc(n,e,0,0,i);const h=z_(n,e,c,u,r);return Bc(h.oldCut,h.newCut,h.cutAbsStart,h.cutAbsStart,i)}var Th=Be({ignoreAttrs:{heading:["id"]}},"diffConfig");kr(Th,{displayName:"Ctx<diffConfig>",group:"Diff"});var Ue=new ft("MILKDOWN_DIFF");function N_(n,e,t){const r=Fu(n,e.newDoc,t);return{...e,changes:r}}function H_(n,e){return e.some(t=>n.fromB<t.toB&&n.toB>t.fromB)}function i0(n){return n.changes.filter(e=>!H_(e,n.rejectedRanges))}var q8=dt(n=>{const e=n.get(Th.key);return new at({key:Ue,state:{init:()=>null,apply(t,r,i,s){const o=t.getMeta(Ue);if(!r){if(o?.type==="start"){const c=Fu(s.doc,o.newDoc,{ignoreAttrs:e.ignoreAttrs});return{newDoc:o.newDoc,changes:c,rejectedRanges:[],active:!0}}return null}let a=r;if(t.docChanged&&a.active&&(a=N_(s.doc,a,{ignoreAttrs:e.ignoreAttrs})),!o)return a;let l;switch(o.type){case"start":{const c=Fu(s.doc,o.newDoc,{ignoreAttrs:e.ignoreAttrs});return{newDoc:o.newDoc,changes:c,rejectedRanges:[],active:!0}}case"accept":case"acceptRange":l=a;break;case"reject":l={...a,rejectedRanges:[...a.rejectedRanges,{fromB:o.fromB,toB:o.toB}]};break;case"rejectRange":l={...a,rejectedRanges:[...a.rejectedRanges,{fromB:o.range.fromB,toB:o.range.toB}]};break;case"acceptAll":case"clear":return null;default:return a}return l.active&&i0(l).length===0?null:l}},filterTransaction(t,r){return!Ue.getState(r)?.active||t.getMeta(Ue)?!0:!t.docChanged}})});kr(q8,{displayName:"Prose<diff>",group:"Diff"});function F_(n,e){const t=i0(e);for(let r=t.length-1;r>=0;r--){const i=t[r],s=e.newDoc.slice(i.fromB,i.toB);n=n.replace(i.fromA,i.toA,s)}return n}var $8=kt("StartDiffReview",n=>e=>(t,r)=>{if(e==null)return!1;const i=n.get(Ps)(e);return i?(r&&r(t.tr.setMeta(Ue,{type:"start",newDoc:i})),!0):!1});kr($8,{displayName:"Command<startDiffReview>",group:"Diff"});var r1=kt("StartDiffReviewFromDoc",()=>n=>(e,t)=>!n||n.type!==e.doc.type?!1:(t&&t(e.tr.setMeta(Ue,{type:"start",newDoc:n})),!0));kr(r1,{displayName:"Command<startDiffReviewFromDoc>",group:"Diff"});var V8=kt("AcceptDiffChunk",()=>n=>(e,t)=>{if(n==null)return!1;const r=Ue.getState(e);if(!r)return!1;const i=i0(r)[n];if(!i)return!1;if(t){const s=r.newDoc.slice(i.fromB,i.toB);let o=e.tr.replace(i.fromA,i.toA,s);o=o.setMeta(Ue,{type:"accept",changeIndex:n}),t(o)}return!0});kr(V8,{displayName:"Command<acceptDiffChunk>",group:"Diff"});var W8=kt("RejectDiffChunk",()=>n=>(e,t)=>{if(n==null)return!1;const r=Ue.getState(e);if(!r)return!1;const i=i0(r)[n];return i?(t&&t(e.tr.setMeta(Ue,{type:"reject",fromB:i.fromB,toB:i.toB})),!0):!1});kr(W8,{displayName:"Command<rejectDiffChunk>",group:"Diff"});var i1=kt("AcceptDiffRange",()=>n=>(e,t)=>{if(!n)return!1;const r=Ue.getState(e);if(!r)return!1;if(t){const i=r.newDoc.slice(n.fromB,n.toB);let s=e.tr.replace(n.fromA,n.toA,i);s=s.setMeta(Ue,{type:"acceptRange",range:n}),t(s)}return!0});kr(i1,{displayName:"Command<acceptDiffRange>",group:"Diff"});var s1=kt("RejectDiffRange",()=>n=>(e,t)=>!n||!Ue.getState(e)?!1:(t&&t(e.tr.setMeta(Ue,{type:"rejectRange",range:n})),!0));kr(s1,{displayName:"Command<rejectDiffRange>",group:"Diff"});var Eh=kt("AcceptAllDiffs",()=>()=>(n,e)=>{const t=Ue.getState(n);return t?(e&&e((t.rejectedRanges.length===0?n.tr.replaceWith(0,n.doc.content.size,t.newDoc.content):F_(n.tr,t)).setMeta(Ue,{type:"acceptAll"})),!0):!1});kr(Eh,{displayName:"Command<acceptAllDiffs>",group:"Diff"});var qu=kt("ClearDiffReview",()=>()=>(n,e)=>Ue.getState(n)?(e&&e(n.tr.setMeta(Ue,{type:"clear"})),!0):!1);kr(qu,{displayName:"Command<clearDiffReview>",group:"Diff"});var q_=[Th,q8,$8,r1,V8,i1,W8,s1,Eh,qu],$_=Object.defineProperty,b5=Object.getOwnPropertySymbols,V_=Object.prototype.hasOwnProperty,W_=Object.prototype.propertyIsEnumerable,w5=(n,e,t)=>e in n?$_(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,j_=(n,e)=>{for(var t in e||(e={}))V_.call(e,t)&&w5(n,t,e[t]);if(b5)for(var t of b5(e))W_.call(e,t)&&w5(n,t,e[t]);return n};function j8(n,e){return Object.assign(n,{meta:j_({package:"@milkdown/components"},e)}),n}const Pr="milkdown-diff",G_={acceptLabel:"Accept",rejectLabel:"Reject",customBlockTypes:[]},_h=Be(G_,"diffComponentConfig");j8(_h,{displayName:"Ctx<diffComponentConfig>",group:"DiffComponent"});function U_(n,e,t){if(e===t)return!1;const r=n.resolve(e),i=n.resolve(t),s=r.index(0),o=i.depth===0?Math.max(0,i.index(0)-1):i.index(0);return s!==o}function x5(n,e,t){if(e>=t)return!1;const r=n.resolve(e),i=n.resolve(t);if(r.sameParent(i)&&r.parent.isTextblock)return!1;let s=!1;return n.nodesBetween(e,t,(o,a)=>{if(s)return!1;if(!o.isBlock)return!0;const l=a+o.nodeSize;return a>=e&&l<=t?(s=!0,!1):!0}),s}function K_(n,e,t){if(t!==n.content.size)return!1;const r=n.resolve(e);if(r.depth!==0)return!1;for(let i=r.index(0);i<n.childCount;i++){const s=n.child(i);if(s.type.name!=="paragraph"||s.content.size>0)return!1}return!0}function X_(n){let e=n.content.size;for(let t=n.childCount-1;t>=0;t--){const r=n.child(t);if(r.type.name!=="paragraph"||r.content.size>0)break;e-=r.nodeSize}return e}function wp(n,e){const t=n.resolve(e);for(let r=t.depth;r>=1;r--)if(t.node(r).isTextblock)return t.before(r);return e}function G8(n,e,t,r){let i=0;for(let s=0;s<n.childCount;s++){const o=n.child(s),a=i+o.nodeSize;if(i>=t)break;a>e&&i<t&&r(o,i,a),i=a}}function U8(n,e,t,r){G8(n,e,t,(i,s,o)=>{o===n.content.size&&i.type.name==="paragraph"&&i.content.size===0||r.push(In.node(s,o,{class:`${Pr}-removed-block`}))})}function qd(n,e,t=!1){if(e<0||e>n.content.size)return null;const r=n.resolve(Math.min(e,n.content.size));if(r.depth>=1)return{from:r.before(1),to:r.after(1)};if(t){const i=r.nodeBefore;if(i)return{from:e-i.nodeSize,to:e};const s=r.nodeAfter;if(s)return{from:e,to:e+s.nodeSize}}else{const i=r.nodeAfter;if(i)return{from:e,to:e+i.nodeSize};const s=r.nodeBefore;if(s)return{from:e-s.nodeSize,to:e}}return null}function o1(n,e,t){if(e<0||e>n.content.size)return null;const r=n.resolve(Math.min(e,n.content.size));for(let i=r.depth;i>=0;i--){const s=r.node(i).type.name;if(t.has(s))return s}return null}function $u(n,e,t,r=!1){const i=o1(n,e,t);if(i)return i;const s=n.resolve(Math.min(Math.max(e,0),n.content.size)),o=r?s.nodeBefore:s.nodeAfter;return o&&t.has(o.type.name)?o.type.name:null}function Y_(n,e,t){const r=[];let i=!0,s=-1,o=-1;return G8(n,e,t,(a,l,c)=>{s===-1&&(s=l),o=c,r.push(a)}),(r.length===0||s!==e||o!==t)&&(i=!1),i?r:[]}function Y0(n,e,t,r){return n<r&&e>t}function k5(n,e,t,r){return e===t?o1(n,e,r)!=null:$u(n,e,r)!=null||$u(n,t,r,!0)!=null}function Z_(n,e,t){const r=n.resolve(t.fromA);if(!r.parent.isTextblock||r.depth<1||!r.node(1).isTextblock)return null;const i=r.after(1),s=e.resolve(t.fromB);let o;if(s.depth>=1&&s.node(1).isTextblock?(o=s.after(1),o>t.toB&&(o=t.toB)):o=t.fromB,i>=t.toA&&o>=t.toB)return null;const a=[];return(i>t.fromA||o>t.fromB)&&a.push({fromA:t.fromA,toA:Math.min(i,t.toA),fromB:t.fromB,toB:o,isBlock:!1}),(t.toA>i||t.toB>o)&&a.push({fromA:i,toA:Math.max(i,t.toA),fromB:o,toB:t.toB,isBlock:!0}),a.length>1?a:null}function J_(n,e,t,r){return k5(e,n.fromA,n.toA,r)||k5(t,n.fromB,n.toB,r)}function Q_(n,e,t,r){var i,s,o,a;const l=[],c=new Set;for(let u=0;u<n.length;u++){if(c.has(u))continue;const h=n[u];if(!J_(h,e,t,r)){l.push({fromA:h.fromA,toA:h.toA,fromB:h.fromB,toB:h.toB,isCustomBlock:!1});continue}const d=C5(e,h.fromA,h.toA,r),f=C5(t,h.fromB,h.toB,r),m={fromA:Math.min((i=d?.from)!=null?i:h.fromA,h.fromA),toA:Math.max((s=d?.to)!=null?s:h.toA,h.toA),fromB:Math.min((o=f?.from)!=null?o:h.fromB,h.fromB),toB:Math.max((a=f?.to)!=null?a:h.toB,h.toB),isCustomBlock:!0};c.add(u);for(let y=u+1;y<n.length;y++){if(c.has(y))continue;const b=n[y],x=d&&Y0(b.fromA,b.toA,d.from,d.to),C=f&&Y0(b.fromB,b.toB,f.from,f.to);!x&&!C||(c.add(y),m.fromA=Math.min(m.fromA,b.fromA),m.toA=Math.max(m.toA,b.toA),m.fromB=Math.min(m.fromB,b.fromB),m.toB=Math.max(m.toB,b.toB))}const g=[];for(let y=0;y<l.length;y++){const b=l[y];if(!b.isCustomBlock)continue;const x=Y0(m.fromA,m.toA,b.fromA,b.toA),C=Y0(m.fromB,m.toB,b.fromB,b.toB);!x&&!C||(m.fromA=Math.min(m.fromA,b.fromA),m.toA=Math.max(m.toA,b.toA),m.fromB=Math.min(m.fromB,b.fromB),m.toB=Math.max(m.toB,b.toB),g.push(y))}for(let y=g.length-1;y>=0;y--)l.splice(g[y],1);l.push(m)}return l}function eI(n,e){const t=X_(e);if(t!==e.content.size)for(const r of n)r.fromA===r.toA&&r.fromB<r.toB&&r.fromA>=t&&(r.fromA=t,r.toA=t)}function C5(n,e,t,r){return e===t?o1(n,e,r)==null?null:qd(n,e):$u(n,e,r)!=null?qd(n,e):$u(n,t,r,!0)!=null?qd(n,t,!0):null}const S5=new ft("MILKDOWN_DIFF_DECORATION"),K8=dt(n=>{const e=n.get(_h.key);return new at({key:S5,state:{init:()=>Cn.empty,apply(t,r,i,s){const o=Ue.getState(s);return o?.active?t.getMeta(Ue)||t.docChanged?nI(n,s.doc,o,e):r.map(t.mapping,t.doc):Cn.empty}},props:{decorations(t){var r;return(r=S5.getState(t))!=null?r:Cn.empty}}})});j8(K8,{displayName:"Prose<diffDecoration>",group:"DiffComponent"});function tI({doc:n,newDoc:e,segments:t,change:r,changeIndex:i,commands:s,acceptLabel:o,rejectLabel:a,decorations:l}){for(let f=0;f<t.length;f++){const m=t[f],g=m.fromA<m.toA,y=m.fromB<m.toB;if(g&&(m.isBlock?U8(n,m.fromA,m.toA,l):l.push(In.inline(m.fromA,m.toA,{class:`${Pr}-removed`}))),y){const b=m.isBlock?wp(n,g?m.toA:m.fromA):g?m.toA:m.fromA,x=X8(e,m,m.isBlock);l.push(In.widget(b,x,{side:-1,key:`added-${i}-${f}`}))}}const c=t[t.length-1],u=c.isBlock?c.fromA<c.toA?c.toA:c.fromA:r.toA,h=wp(n,u),d=Y8({commands:s,isBlockLevel:!0,change:r,acceptLabel:o,rejectLabel:a});l.push(In.widget(h,d,{side:-1,key:`controls-${i}`}))}function nI(n,e,t,r){const i=[],s=n.get(te),o=new Set(r.customBlockTypes),a=i0(t),l=Q_(a,e,t.newDoc,o);eI(l,e);for(let c=0;c<l.length;c++){const u=l[c],h=u.fromA<u.toA,d=u.fromB<u.toB;if(h&&!d&&K_(e,u.fromA,u.toA))continue;const f=h&&U_(e,u.fromA,u.toA),m=h&&x5(e,u.fromA,u.toA),g=d&&x5(t.newDoc,u.fromB,u.toB),y=h&&!f&&!m&&!u.isCustomBlock&&!g,b=(f||m||g)&&!y;if(b&&!u.isCustomBlock){const S=Z_(e,t.newDoc,u);if(S){tI({doc:e,newDoc:t.newDoc,segments:S,change:u,changeIndex:c,commands:s,acceptLabel:r.acceptLabel,rejectLabel:r.rejectLabel,decorations:i});continue}}h&&(u.isCustomBlock||b?U8(e,u.fromA,u.toA,i):i.push(In.inline(u.fromA,u.toA,{class:`${Pr}-removed`})));const x=h?u.toA:u.fromA,C=b?wp(e,x):x;if(d){const S=X8(t.newDoc,u,b);i.push(In.widget(C,S,{side:-1,key:`added-${c}`}))}const E=Y8({commands:s,isBlockLevel:b,change:u,acceptLabel:r.acceptLabel,rejectLabel:r.rejectLabel});i.push(In.widget(C,E,{side:b?-1:1,key:`controls-${c}`}))}return Cn.create(e,i)}function X8(n,e,t){var r;const i=document.createElement(t?"div":"span");i.className=`${Pr}-added`,i.contentEditable="false",t&&i.classList.add(`${Pr}-added-block`);const s=N3.fromSchema(n.type.schema);if(t){const l=Y_(n,e.fromB,e.toB);if(l.length>0){const c=document.createDocumentFragment();for(const u of l)c.appendChild(s.serializeNode(u));return i.appendChild(c),i}}const o=n.slice(e.fromB,e.toB),a=s.serializeFragment(o.content);if(i.appendChild(a),!((r=i.textContent)!=null&&r.trim())&&!i.querySelector("img, video, audio, canvas, svg")){const l=n.textBetween(e.fromB,e.toB,`
|
|
15
15
|
`,`
|
|
16
16
|
`);l.trim()&&(i.textContent=l)}return i}function Y8({commands:n,isBlockLevel:e,change:t,acceptLabel:r,rejectLabel:i}){const s=document.createElement(e?"div":"span");s.className=`${Pr}-controls`,s.contentEditable="false",e&&s.classList.add(`${Pr}-controls-block`);const o=c=>u=>{u.preventDefault(),u.stopPropagation();const h={fromA:t.fromA,toA:t.toA,fromB:t.fromB,toB:t.toB},d=c==="accept"?i1.key:s1.key;n.call(d,h)},a=document.createElement("button");a.className=`${Pr}-accept`,a.textContent=r,a.addEventListener("click",o("accept"));const l=document.createElement("button");return l.className=`${Pr}-reject`,l.textContent=i,l.addEventListener("click",o("reject")),s.appendChild(a),s.appendChild(l),s}const rI=[_h,K8];function Uo(n,e){return Object.assign(n,{meta:{package:"@milkdown/plugin-streaming",...e}}),n}var zs=Be({throttleMs:100,scrollFollow:!0,diffReviewOnEnd:!1,ignoreAttrs:{heading:["id"]}},"streamingConfig");Uo(zs,{displayName:"Ctx<streamingConfig>",group:"Streaming"});function iI(n,e,t){const r=Ih(n.get(Ps),t);if(!r)return{tr:e,newDoc:null};const i=n.get(zs.key).ignoreAttrs,s=Fu(e.doc,r,i?{ignoreAttrs:i}:void 0);for(let o=s.length-1;o>=0;o--){const a=s[o],l=r.slice(a.fromB,a.toB);e=e.replace(a.fromA,a.toA,l)}return{tr:e,newDoc:r}}function sI(n){if(n.parent.type.spec.code)return{type:"plain-text",preserveNewlines:!0};for(let e=n.depth;e>0;e--)if(n.node(e).type.name==="table")return{type:"plain-text",preserveNewlines:!1};return n.depth>=1?{type:"split-block"}:{type:"block"}}function Z8(n){if(n.childCount===0)return n;const e=n.lastChild;return e.type.name==="paragraph"&&e.content.size===0?n.cut(0,n.size-e.nodeSize):n}function oI(n,e,t){const{insertPos:r,currentEndPos:i}=t,s=t.buffer.replace(/\r\n?/g,`
|
|
17
17
|
`);if(!s)return{tr:e,applied:!1,insertEndPos:i};const o=e.doc.content.size,a=Math.max(0,Math.min(r,o)),l=Math.max(a,Math.min(i,o)),c=e.doc.resolve(a),u=(n.get(zs.key).insertStrategy??sI)(c),h={ctx:n,tr:e,buffer:s,from:a,to:l,resolved:c};switch(u.type){case"plain-text":return aI(h,u.preserveNewlines??!1);case"split-block":return dI(h);case"block":return fI(h)}}function aI({tr:n,buffer:e,from:t,to:r},i){const s=i?e:e.replace(/\n/g," "),o=n.doc.type.schema.text(s);return n=n.replaceWith(t,r,o),{tr:n,applied:!0,insertEndPos:t+s.length}}var lI=/[*_~`[\\<]|https?:\/\/|www\.|[\w.+-]@\w|&[a-zA-Z#]/,cI=/\$(?!\s)(?:[^$\n]*[^\s$])?\$(?!\d)/,uI=/:[\w+-]+:/;function hI(n,e){return!!(lI.test(e)||n.nodes.math_inline&&cI.test(e)||n.nodes.emoji&&uI.test(e))}function Ih(n,e){try{return n(e)??null}catch{return null}}function $d(n,e,t){if(!t)return Fn.empty;if(!hI(e,t))return Fn.from(e.text(t));const r=Ih(n.get(Ps),t)?.firstChild;if(r?.type.name!=="paragraph"||r.content.size===0)return Fn.from(e.text(t));let i=r.content;const s=/^[ \t]+/.exec(t)?.[0];s&&(i=Fn.from(e.text(s)).append(i));const o=/[ \t]+$/.exec(t)?.[0];return o&&(i=i.append(Fn.from(e.text(o)))),i}function dI({ctx:n,tr:e,buffer:t,from:r,to:i,resolved:s}){const o=e.doc.type.schema,a=t.indexOf(`
|