@joinezco/codeblock 0.0.9 → 0.0.11
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/dist/editor.d.ts +23 -2
- package/dist/editor.js +346 -41
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/lsps/index.d.ts +5 -0
- package/dist/lsps/index.js +9 -2
- package/dist/panels/{footer.d.ts → settings.d.ts} +7 -1
- package/dist/panels/{footer.js → settings.js} +12 -3
- package/dist/panels/terminal.d.ts +3 -0
- package/dist/panels/terminal.js +76 -0
- package/dist/panels/toolbar.d.ts +40 -3
- package/dist/panels/toolbar.js +919 -160
- package/dist/themes/index.js +63 -17
- package/dist/types.d.ts +5 -0
- package/dist/utils/fs.d.ts +7 -0
- package/dist/utils/fs.js +41 -15
- package/dist/workers/fs.worker.d.ts +4 -8
- package/dist/workers/fs.worker.js +27 -53
- package/package.json +14 -12
- package/dist/assets/clike-C8IJ2oj_.js +0 -1
- package/dist/assets/cmake-BQqOBYOt.js +0 -1
- package/dist/assets/dockerfile-C_y-rIpk.js +0 -1
- package/dist/assets/fs.worker-DfanUHpQ.js +0 -21
- package/dist/assets/go-CTD25R5P.js +0 -1
- package/dist/assets/haskell-BWDZoCOh.js +0 -1
- package/dist/assets/index-BAnLzvMk.js +0 -1
- package/dist/assets/index-BBC9WDX6.js +0 -1
- package/dist/assets/index-BEXYxRro.js +0 -1
- package/dist/assets/index-BfYmUKH9.js +0 -13
- package/dist/assets/index-BhaTNAWE.js +0 -1
- package/dist/assets/index-CCbYDSng.js +0 -1
- package/dist/assets/index-CIi8tLT6.js +0 -1
- package/dist/assets/index-CaANcgI2.js +0 -3
- package/dist/assets/index-CkWzFNzm.js +0 -208
- package/dist/assets/index-D_XGv9QZ.js +0 -1
- package/dist/assets/index-DkmiPfkD.js +0 -1
- package/dist/assets/index-DmNlLMQ4.js +0 -6
- package/dist/assets/index-DmX_vI7D.js +0 -1
- package/dist/assets/index-DogEEevD.js +0 -1
- package/dist/assets/index-DsDl5qZV.js +0 -2
- package/dist/assets/index-gAy5mDg-.js +0 -1
- package/dist/assets/index-i5qJLB2h.js +0 -1
- package/dist/assets/javascript.worker-ClsyHOLi.js +0 -552
- package/dist/assets/lua-BgMRiT3U.js +0 -1
- package/dist/assets/perl-CdXCOZ3F.js +0 -1
- package/dist/assets/process-Dw9K5EnD.js +0 -1357
- package/dist/assets/properties-C78fOPTZ.js +0 -1
- package/dist/assets/ruby-B2Rjki9n.js +0 -1
- package/dist/assets/shell-CjFT_Tl9.js +0 -1
- package/dist/assets/swift-BzpIVaGY.js +0 -1
- package/dist/assets/toml-BXUEaScT.js +0 -1
- package/dist/assets/vb-CmGdzxic.js +0 -1
- package/dist/e2e/editor.spec.d.ts +0 -1
- package/dist/e2e/editor.spec.js +0 -309
- package/dist/e2e/example.spec.d.ts +0 -5
- package/dist/e2e/example.spec.js +0 -44
- package/dist/index.html +0 -15
- package/dist/resources/config.json +0 -13
- package/dist/styles.css +0 -7
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BfYmUKH9.js","assets/index-CCbYDSng.js","assets/index-CaANcgI2.js","assets/index-CIi8tLT6.js","assets/index-BBC9WDX6.js","assets/index-BEXYxRro.js","assets/index-DmX_vI7D.js","assets/index-DkmiPfkD.js","assets/index-BAnLzvMk.js","assets/index-DogEEevD.js","assets/index-DmNlLMQ4.js","assets/index-DsDl5qZV.js","assets/index-D_XGv9QZ.js","assets/index-i5qJLB2h.js","assets/index-BhaTNAWE.js","assets/index-gAy5mDg-.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
(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)}})();const R7="modulepreload",A7=function(n){return"/"+n},iC={},pt=function(e,t,r){let i=Promise.resolve();if(t&&t.length>0){let u=function(l){return Promise.all(l.map(c=>Promise.resolve(c).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=o?.nonce||o?.getAttribute("nonce");i=u(t.map(l=>{if(l=A7(l),l in iC)return;iC[l]=!0;const c=l.endsWith(".css"),f=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${f}`))return;const d=document.createElement("link");if(d.rel=c?"stylesheet":R7,c||(d.as="script"),d.crossOrigin="",d.href=l,a&&d.setAttribute("nonce",a),document.head.appendChild(d),c)return new Promise((g,m)=>{d.addEventListener("load",g),d.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${l}`)))})}))}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)})},fe=0,E2=2,yi=8,f0=10,D7=19,ro=20,xt=28,Lr=31,T7=32,kT=43,Ei=44,Ya=54,Gg=55,gm=56,R2=58,M7=59,zb=75,O7=0,P7=1,xT=2,vc=3,nd=4,I7=6,tl=7,ST=1,Qr=1;BigInt(1);const Kg=BigInt(2);BigInt(4);BigInt(8);BigInt(16);BigInt(32);const Jg=BigInt(64);BigInt(128);BigInt(256);BigInt(512);BigInt(1024);BigInt(2048);BigInt(4096);BigInt(8192);BigInt(16384);BigInt(32768);BigInt(65536);BigInt(131072);BigInt(262144);BigInt(524288);BigInt(1048576);BigInt(2097152);BigInt(4194304);BigInt(8388608);BigInt(16777216);BigInt(33554432);BigInt(67108864);BigInt(134217728);BigInt(268435456);const ti=BigInt(536870911),uc=1,Xs=2,Ub=4,CT=8,ET=0,RT=1,AT=2;class A2{fdstat;path;getFdstat(){return this.fdstat}async initialize(e){return this.path=e,fe}getPath(){return this.path}async setFdstatFlags(e){return this.fdstat.fs_flags=e,fe}async setFdstatRights(e,t){return this.fdstat.fs_rights_base=e,this.fdstat.fs_rights_inheriting=t,fe}async ioctl(e,t){return M7}async mountFs(e){return{err:R2,fs:void 0}}duplicateFd(){}}class DT extends A2{isatty(){return!1}async readdir(e){return{err:Ya,dirents:void 0}}}class TT extends A2{async close(){return Lr}async read(e,t){return{err:Lr,buffer:void 0}}async read_str(){return{err:Lr,content:void 0}}async pread(e,t){return{err:Lr,buffer:void 0}}async arrayBuffer(){return{err:Lr,buffer:void 0}}async write(e){return{err:Lr,written:-1n}}async pwrite(e,t){return{err:Lr,written:-1n}}async seek(e,t){return{err:Lr,offset:-1n}}async writableStream(){return{err:Lr,stream:void 0}}isatty(){return!1}async truncate(e){return Lr}addPollSub(e,t,r){return Promise.resolve({userdata:e,error:R2,eventType:t,nbytes:0n})}}class L7 extends A2{constructor(e,t,r){super(),this.fdstat={fs_flags:e,fs_rights_base:t,fs_rights_inheriting:r,fs_filetype:xT}}async getFilestat(){return{err:yi,filestat:void 0}}async setFilestatTimes(e,t){return yi}async close(){return yi}async read(e,t){return{err:yi,buffer:void 0}}async read_str(){return{err:yi,content:void 0}}async pread(e,t){return{err:yi,buffer:void 0}}async arrayBuffer(){return{err:yi,buffer:void 0}}async write(e){return{err:yi,written:-1n}}async pwrite(e,t){return{err:yi,written:-1n}}async seek(e,t){return{err:yi,offset:-1n}}async readdir(e){return{err:yi,dirents:void 0}}async writableStream(){return{err:yi,stream:void 0}}async truncate(e){return yi}addPollSub(e,t,r){return Promise.resolve({userdata:e,error:R2,eventType:t,nbytes:0n})}}function h0(n){const e=[];let t="",r=n,i="",s=0;for(;r!=="";)r.indexOf("/")!==-1?i=r.substr(0,r.indexOf("/")):i=r,r=r.substr(i.length+1),i===".."?s>0&&(s-=1):i==="."||i!=""&&(e[s]=i,s+=1);return t=`/${e.slice(0,s).join("/")}`,t=t.replace("/./","/"),t}function pr(n){return n=="/"?"/":n.slice(n.lastIndexOf("/")+1)}function Js(n){let e=n.lastIndexOf("/");return e<1&&e++,n.slice(0,e)}function yy(n){switch(n.toLowerCase().trim()){case"yes":case"on":case"true":return!0;case"no":case"off":case"false":return!1;default:return}}function jd(n){return new Promise((e,t)=>{n.oncomplete=n.onsuccess=()=>e(n.result),n.onabort=n.onerror=()=>t(n.error)})}function F7(n,e){const t=Promise.resolve().then(()=>{const r=indexedDB.open(n);return r.onupgradeneeded=()=>r.result.createObjectStore(e),jd(r)});return(r,i)=>t.then(s=>i(s.transaction(e,r).objectStore(e)))}let by;function y1(){return by||(by=F7("keyval-store","keyval")),by}function N7(n,e=y1()){return e("readonly",t=>jd(t.get(n)))}function B7(n,e,t=y1()){return t("readwrite",r=>(r.put(e,n),jd(r.transaction)))}function q7(n,e=y1()){return e("readwrite",t=>(t.delete(n),jd(t.transaction)))}function j7(n,e){return n("readonly",t=>(t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},jd(t.transaction)))}function $7(n=y1()){const e=[];return j7(n,t=>e.push(t.key)).then(()=>e)}async function sC(n){q7(n)}async function nl(n){return N7(n)}async function Zl(n,e){B7(n,e)}async function W7(){return $7()}async function Lh(n){return(await(await navigator.storage.getDirectory()).resolve(n)).join("/")}async function z7(n,e){return navigator.storage.getDirectory().then(async t=>await t.getDirectoryHandle(n,{create:e}))}async function U7(){try{const n=await showDirectoryPicker();return{err:fe,handle:n}}catch{return{err:Ei,handle:void 0}}}function Fh(n,e){switch(n.name){case"NotAllowedError":return E2;case"TypeMismatchError":return e?Ya:Lr;case"NotFoundError":return Ei;case"InvalidModificationError":return Gg;case"QuotaExceededError":return D7;default:return xt}}function MT(n,e,t,r,i){n.keepMetadata=i,n.keepMetadata&&(n.metadataPath=""),n.fdstat={fs_flags:e,fs_rights_base:t,fs_rights_inheriting:r,fs_filetype:void 0}}async function mm(n){n.keepMetadata&&n.metadataPath===""&&(n.metadataPath=await Lh(n.handle))}async function OT(n,e,t){if(n.keepMetadata){let r=await nl(n.metadataPath);e!==void 0&&(r.atim=e),t!==void 0&&(r.mtim=t),(e!==void 0||t!==void 0)&&await Zl(n.metadataPath,r)}return fe}class Ys extends DT{handle;static defaultFilestat={dev:0n,ino:0n,filetype:nd,nlink:1n,size:0n,atim:0n,mtim:0n,ctim:0n};metadataPath;keepMetadata;cursor;writer;file;constructor(e,t,r,i,s){super(),this.handle=e,this.cursor=0n,MT(this,t,r,i,s),this.file=void 0}async initialize(e){const t=await super.initialize(e);if(t!==fe)return t;await mm(this);const r=BigInt((await this.__getFile()).file?.size);let i;if(this.keepMetadata){const s=await nl(this.metadataPath);if(s==null)return Ei;i=s.filetype}else i=Ys.defaultFilestat.filetype;return this.fdstat.fs_filetype=i,this.fdstat.fs_flags&ST&&(this.cursor=r),fe}async getWriter(){return this.writer||(this.writer=await this.handle.createWritable({keepExistingData:!0})),this.writer}async __getFile(){if(!this.file)try{const e=await this.handle.getFile();return this.file=e,{err:fe,file:e}}catch{return{err:E2,file:void 0}}return{err:fe,file:this.file}}async read(e){const{err:t,file:r}=await this.__getFile();if(t!==fe)return{err:t,buffer:void 0};const i=Number(this.cursor)+e,s=await r.slice(Number(this.cursor),Number(i)).arrayBuffer();return this.cursor+=BigInt(s.byteLength),{err:fe,buffer:s}}async read_str(){const{err:e,file:t}=await this.__getFile();return e!==fe?{err:e,content:void 0}:{err:fe,content:await t.text()}}async pread(e,t){const{err:r,file:i}=await this.__getFile();if(r!==fe)return{err:r,buffer:void 0};const s=BigInt((await this.__getFile()).file?.size),o=s<t+BigInt(e)?s:this.cursor+BigInt(e);return{err:fe,buffer:await i.slice(Number(t),Number(o)).arrayBuffer()}}async seek(e,t){const r=BigInt((await this.__getFile()).file?.size);switch(t){case RT:if(this.cursor+e<0n)return{offset:this.cursor,err:xt};this.cursor+=e;break;case ET:if(e<0n)return{offset:this.cursor,err:xt};this.cursor=e;break;case AT:if(r<-e)return{offset:this.cursor,err:xt};this.cursor=r+e;break;default:return{offset:this.cursor,err:xt}}return{err:fe,offset:this.cursor}}async setFilestatTimes(e,t){return OT(this,e,t)}async write(e){await(await this.getWriter()).write({type:"write",position:Number(this.cursor),data:e});let t=BigInt(e.byteLength);return this.cursor+=t,{err:fe,written:t}}async pwrite(e,t){await(await this.getWriter()).write({type:"write",position:Number(t),data:e});let r=BigInt(e.byteLength);return{err:fe,written:r}}async writableStream(){return{err:fe,stream:await this.getWriter()}}async truncate(e){try{await(await this.getWriter()).write({type:"truncate",size:Number(e)})}catch(t){return t instanceof DOMException?Fh(t,!1):xt}return await this.flush(),this.cursor=0n,fe}async arrayBuffer(){let e=await(await this.handle.getFile()).arrayBuffer();return{err:fe,buffer:e}}async flush(){if(this.writer){const e=this.writer;this.writer=null;try{await e?.close()}catch{}}}async close(){return await this.flush(),fe}async getFilestat(){let e=this.keepMetadata?await nl(this.metadataPath):Ys.defaultFilestat;return e===void 0?{err:gm,filestat:void 0}:(e.size=BigInt((await this.__getFile()).file?.size),{err:fe,filestat:e})}async addPollSub(e,t,r){const i=BigInt(this.file?this.file.size:(await this.__getFile()).file.size);return{userdata:e,error:fe,eventType:t,nbytes:i}}}class ks extends TT{handle;metadataPath;keepMetadata;static defaultFilestat={dev:0n,ino:0n,filetype:vc,nlink:1n,size:4096n,atim:0n,mtim:0n,ctim:0n};entries;constructor(e,t,r,i,s){super(),this.handle=e,MT(this,t,r,i,s),this.fdstat.fs_filetype=vc,this.entries=[]}async initialize(e){const t=await super.initialize(e);return t!==fe?t:(await mm(this),fe)}async getFilestat(){if(this.keepMetadata){const e=await nl(this.metadataPath);return e===void 0?{err:gm,filestat:void 0}:{err:fe,filestat:e}}else return{err:fe,filestat:ks.defaultFilestat}}async setFilestatTimes(e,t){return OT(this,e,t)}async readdir(e){let t=fe;if(e||this.entries.length===0){this.entries=[];var r=1n;for await(const[i,s]of this.handle.entries()){if(i.endsWith(".crswap"))continue;let o;this.keepMetadata?o=await nl(`${this.metadataPath}/${i}`):o=s instanceof FileSystemDirectoryHandle?ks.defaultFilestat:Ys.defaultFilestat,o===void 0?t=gm:this.entries.push({d_next:r++,d_ino:o.ino,name:i,d_type:o.filetype})}}return{err:t,dirents:this.entries}}}class H7{rootHandle;keepMetadata;fsname(){return"FsaFilesystem"}getRootHandle(){return this.rootHandle}async getHandle(e,t,r){let i,s,o=!0,a=r===void 0?this.getRootHandle():r;try{for(e.startsWith("/")?s=1:s=0,i=e.indexOf("/",s);i!=-1;i=e.indexOf("/",s))a=await a.getDirectoryHandle(e.slice(s,i)),s=i+1;let u;o=t;let l=e.slice(s);return l===""?u=a:t?u=await a.getDirectoryHandle(l):u=await a.getFileHandle(l),{handle:u,err:fe,index:-1}}catch(u){let l;try{l=Fh(u,o)}catch{l=xt}return{index:i,err:l,handle:a}}}async unlinkat(e,t,r){let i;if(e!==void 0)if(e instanceof ks)i=e.handle;else return xt;let{err:s,handle:o}=await this.getHandle(Js(t),!0,i);if(s!==fe)return s;let a=pr(t);try{let u=(await this.getHandle(a,r,o)).err;return u!==fe?u:(o.removeEntry(a,{recursive:!1}),await sC(`${await Lh(o)}/${t}`),fe)}catch(u){let l=xt;return u instanceof DOMException&&(l=Fh(u,!0)),l}}async mkdirat(e,t){let r;if(e!==void 0)if(e instanceof ks)r=e.handle;else return xt;let{err:i,handle:s}=await this.getHandle(Js(t),!0,r);if(i!==fe)return i;let o=pr(t);if({err:i}=await this.getHandle(o,!0,s),i===fe)return ro;if(i!==Ei)return i;try{s=await s.getDirectoryHandle(t,{create:!0})}catch(a){if(a instanceof DOMException){const u=Fh(a,!0);if(u!==fe)return u}}return this.keepMetadata&&await Zl(await Lh(s),{dev:0n,ino:0n,filetype:vc,nlink:1n,size:4096n,mtim:0n,atim:0n,ctim:0n}),fe}async symlinkat(e,t,r){let i;if(t!==void 0)if(t instanceof ks)i=t.handle;else return xt;let{err:s,handle:o}=await this.getHandle(Js(r),!0,i);if(s!==fe)return s;let a=pr(r);if({err:s}=await this.getHandle(a,!1,o),s===fe||s===Lr)return ro;if(s!==Ei)return s;let u=await o.getFileHandle(r,{create:!0}),l=await u.createWritable();return await l.write(e),await l.close(),this.keepMetadata&&await Zl(await Lh(u),{dev:0n,ino:0n,filetype:tl,nlink:1n,size:BigInt(e.length),mtim:0n,atim:0n,ctim:0n}),fe}async getFilestat(e){if(this.keepMetadata){const t=this.getRootHandle().name+e,r=await nl(t);return{filestat:r,err:r?fe:Ei}}else{const{err:t}=await this.getHandle(e,!0,void 0);switch(t){case Ya:return{err:fe,filestat:ks.defaultFilestat};case fe:return{err:fe,filestat:Ys.defaultFilestat};default:return{err:t,filestat:void 0}}}}async open(e,t,r,i,s,o,a){let u=await this.getHandle(e,!0,void 0),l=u.err,c=u.index,f;switch(l){case fe:{r&uc?r&Ub?l=ro:l=Lr:l=u.err,c=u.index,f=new ks(u.handle,o,i,s,this.keepMetadata);break}case Ya:if(c===-1){if(r&Xs&&!(t&Qr))break;const d=await this.getHandle(pr(e),!1,u.handle);d.err===fe&&(r&uc&&r&Ub?l=ro:r&Xs||(l=d.err),f=new Ys(d.handle,o,i,s,this.keepMetadata));break}else if(t&Qr){const d=await this.getHandle(pr(e.slice(0,c)),!1,u.handle);d.err===fe&&(f=new Ys(d.handle,o,i,s,this.keepMetadata));break}case Ei:{if(r&uc&&c===-1)try{const d=await u.handle.getFileHandle(pr(e),{create:!0});l=fe,f=new Ys(d,o,i,s,this.keepMetadata),this.keepMetadata&&(f.metadataPath=await Lh(d),await Zl(f.metadataPath,{dev:0n,ino:0n,filetype:nd,nlink:1n,size:0n,mtim:0n,atim:0n,ctim:0n}))}catch(d){d instanceof DOMException?l=Fh(d,!1):l=xt}break}}return{err:l,index:c,desc:f}}async renameat(e,t,r,i){if(e!==void 0&&!(e instanceof ks))return xt;const{handle:o,err:a}=await this.getHandle(t,!1,e.handle);if(a===Lr)return zb;if(a!==fe)return a;const u=new Ys(o,0,ti,ti,this.keepMetadata);await mm(u);const l=await u.getFilestat();if(l.err!==fe)return l.err;if(l.filestat.filetype===tl)return zb;if(r!==void 0&&!(r instanceof ks))return xt;const{handle:c,err:f}=await this.getHandle(Js(i),!0,r.handle);if(f!==fe)return f;const d=await c.getFileHandle(pr(i),{create:!0}),g=new Ys(d,0,ti,ti,this.keepMetadata);for(await mm(g);;){const{err:m,buffer:y}=await u.read(2048);if(m!==fe)return m;if(y.byteLength===0)break;if((await g.write(y)).err!==fe)return m}return await u.close(),await g.close(),await Zl(g.metadataPath,l.filestat),await this.unlinkat(e,t,!1),fe}async initialize(e){const t=e;this.keepMetadata=t.keepMetadata===void 0?!1:yy(t.keepMetadata);const r=t.create===void 0?!1:yy(t.create);if(t.prompt===void 0?!1:yy(t.prompt)){if(this.keepMetadata||t.name!==void 0||r)return xt;const{err:s,handle:o}=await U7();if(s===fe)this.rootHandle=o;else return s}else if(t.name!==void 0)this.rootHandle=await z7(t.name,r),this.keepMetadata&&await nl(t.name)===void 0&&await Zl(t.name,ks.defaultFilestat);else return xt;return fe}async mknodat(e,t,r,i){return xt}async cleanup(){if(!this.keepMetadata)return;const e=this.rootHandle.name;await Promise.all((await W7()).map(async t=>{t.startsWith(e)&&(await this.open(t.replace(e,""),0,0,ti,ti,0,0)).err===Ei&&await sC(t)}))}}var yc=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},Zs=[],Wi=[],V7=typeof Uint8Array<"u"?Uint8Array:Array,D2=!1;function PT(){D2=!0;for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,t=n.length;e<t;++e)Zs[e]=n[e],Wi[n.charCodeAt(e)]=e;Wi[45]=62,Wi[95]=63}function G7(n){D2||PT();var e,t,r,i,s,o,a=n.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");s=n[a-2]==="="?2:n[a-1]==="="?1:0,o=new V7(a*3/4-s),r=s>0?a-4:a;var u=0;for(e=0,t=0;e<r;e+=4,t+=3)i=Wi[n.charCodeAt(e)]<<18|Wi[n.charCodeAt(e+1)]<<12|Wi[n.charCodeAt(e+2)]<<6|Wi[n.charCodeAt(e+3)],o[u++]=i>>16&255,o[u++]=i>>8&255,o[u++]=i&255;return s===2?(i=Wi[n.charCodeAt(e)]<<2|Wi[n.charCodeAt(e+1)]>>4,o[u++]=i&255):s===1&&(i=Wi[n.charCodeAt(e)]<<10|Wi[n.charCodeAt(e+1)]<<4|Wi[n.charCodeAt(e+2)]>>2,o[u++]=i>>8&255,o[u++]=i&255),o}function K7(n){return Zs[n>>18&63]+Zs[n>>12&63]+Zs[n>>6&63]+Zs[n&63]}function J7(n,e,t){for(var r,i=[],s=e;s<t;s+=3)r=(n[s]<<16)+(n[s+1]<<8)+n[s+2],i.push(K7(r));return i.join("")}function oC(n){D2||PT();for(var e,t=n.length,r=t%3,i="",s=[],o=16383,a=0,u=t-r;a<u;a+=o)s.push(J7(n,a,a+o>u?u:a+o));return r===1?(e=n[t-1],i+=Zs[e>>2],i+=Zs[e<<4&63],i+="=="):r===2&&(e=(n[t-2]<<8)+n[t-1],i+=Zs[e>>10],i+=Zs[e>>4&63],i+=Zs[e<<2&63],i+="="),s.push(i),s.join("")}function b1(n,e,t,r,i){var s,o,a=i*8-r-1,u=(1<<a)-1,l=u>>1,c=-7,f=t?i-1:0,d=t?-1:1,g=n[e+f];for(f+=d,s=g&(1<<-c)-1,g>>=-c,c+=a;c>0;s=s*256+n[e+f],f+=d,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=r;c>0;o=o*256+n[e+f],f+=d,c-=8);if(s===0)s=1-l;else{if(s===u)return o?NaN:(g?-1:1)*(1/0);o=o+Math.pow(2,r),s=s-l}return(g?-1:1)*o*Math.pow(2,s-r)}function IT(n,e,t,r,i,s){var o,a,u,l=s*8-i-1,c=(1<<l)-1,f=c>>1,d=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=r?0:s-1,m=r?1:-1,y=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+f>=1?e+=d/u:e+=d*Math.pow(2,1-f),e*u>=2&&(o++,u/=2),o+f>=c?(a=0,o=c):o+f>=1?(a=(e*u-1)*Math.pow(2,i),o=o+f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;n[t+g]=a&255,g+=m,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;n[t+g]=o&255,g+=m,o/=256,l-=8);n[t+g-m]|=y*128}var Y7={}.toString,LT=Array.isArray||function(n){return Y7.call(n)=="[object Array]"};/*!
|
|
3
|
-
* The buffer module from node.js, for the browser.
|
|
4
|
-
*
|
|
5
|
-
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
|
|
6
|
-
* @license MIT
|
|
7
|
-
*/var X7=50;he.TYPED_ARRAY_SUPPORT=yc.TYPED_ARRAY_SUPPORT!==void 0?yc.TYPED_ARRAY_SUPPORT:!0;function Hb(){return he.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Yo(n,e){if(Hb()<e)throw new RangeError("Invalid typed array length");return he.TYPED_ARRAY_SUPPORT?(n=new Uint8Array(e),n.__proto__=he.prototype):(n===null&&(n=new he(e)),n.length=e),n}function he(n,e,t){if(!he.TYPED_ARRAY_SUPPORT&&!(this instanceof he))return new he(n,e,t);if(typeof n=="number"){if(typeof e=="string")throw new Error("If encoding is specified then the first argument must be a string");return T2(this,n)}return FT(this,n,e,t)}he.poolSize=8192;he._augment=function(n){return n.__proto__=he.prototype,n};function FT(n,e,t,r){if(typeof e=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer?eB(n,e,t,r):typeof e=="string"?Q7(n,e,t):tB(n,e)}he.from=function(n,e,t){return FT(null,n,e,t)};he.TYPED_ARRAY_SUPPORT&&(he.prototype.__proto__=Uint8Array.prototype,he.__proto__=Uint8Array);function NT(n){if(typeof n!="number")throw new TypeError('"size" argument must be a number');if(n<0)throw new RangeError('"size" argument must not be negative')}function Z7(n,e,t,r){return NT(e),e<=0?Yo(n,e):t!==void 0?typeof r=="string"?Yo(n,e).fill(t,r):Yo(n,e).fill(t):Yo(n,e)}he.alloc=function(n,e,t){return Z7(null,n,e,t)};function T2(n,e){if(NT(e),n=Yo(n,e<0?0:M2(e)|0),!he.TYPED_ARRAY_SUPPORT)for(var t=0;t<e;++t)n[t]=0;return n}he.allocUnsafe=function(n){return T2(null,n)};he.allocUnsafeSlow=function(n){return T2(null,n)};function Q7(n,e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!he.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var r=BT(e,t)|0;n=Yo(n,r);var i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function Vb(n,e){var t=e.length<0?0:M2(e.length)|0;n=Yo(n,t);for(var r=0;r<t;r+=1)n[r]=e[r]&255;return n}function eB(n,e,t,r){if(e.byteLength,t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(r||0))throw new RangeError("'length' is out of bounds");return t===void 0&&r===void 0?e=new Uint8Array(e):r===void 0?e=new Uint8Array(e,t):e=new Uint8Array(e,t,r),he.TYPED_ARRAY_SUPPORT?(n=e,n.__proto__=he.prototype):n=Vb(n,e),n}function tB(n,e){if(fo(e)){var t=M2(e.length)|0;return n=Yo(n,t),n.length===0||e.copy(n,0,0,t),n}if(e){if(typeof ArrayBuffer<"u"&&e.buffer instanceof ArrayBuffer||"length"in e)return typeof e.length!="number"||wB(e.length)?Yo(n,0):Vb(n,e);if(e.type==="Buffer"&<(e.data))return Vb(n,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function M2(n){if(n>=Hb())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Hb().toString(16)+" bytes");return n|0}he.isBuffer=VT;function fo(n){return!!(n!=null&&n._isBuffer)}he.compare=function(e,t){if(!fo(e)||!fo(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,i=t.length,s=0,o=Math.min(r,i);s<o;++s)if(e[s]!==t[s]){r=e[s],i=t[s];break}return r<i?-1:i<r?1:0};he.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};he.concat=function(e,t){if(!LT(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return he.alloc(0);var r;if(t===void 0)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var i=he.allocUnsafe(t),s=0;for(r=0;r<e.length;++r){var o=e[r];if(!fo(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(i,s),s+=o.length}return i};function BT(n,e){if(fo(n))return n.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(n)||n instanceof ArrayBuffer))return n.byteLength;typeof n!="string"&&(n=""+n);var t=n.length;if(t===0)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return vm(n).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return HT(n).length;default:if(r)return vm(n).length;e=(""+e).toLowerCase(),r=!0}}he.byteLength=BT;function nB(n,e,t){var r=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(n||(n="utf8");;)switch(n){case"hex":return hB(this,e,t);case"utf8":case"utf-8":return $T(this,e,t);case"ascii":return cB(this,e,t);case"latin1":case"binary":return fB(this,e,t);case"base64":return uB(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dB(this,e,t);default:if(r)throw new TypeError("Unknown encoding: "+n);n=(n+"").toLowerCase(),r=!0}}he.prototype._isBuffer=!0;function Gu(n,e,t){var r=n[e];n[e]=n[t],n[t]=r}he.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Gu(this,t,t+1);return this};he.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Gu(this,t,t+3),Gu(this,t+1,t+2);return this};he.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Gu(this,t,t+7),Gu(this,t+1,t+6),Gu(this,t+2,t+5),Gu(this,t+3,t+4);return this};he.prototype.toString=function(){var e=this.length|0;return e===0?"":arguments.length===0?$T(this,0,e):nB.apply(this,arguments)};he.prototype.equals=function(e){if(!fo(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:he.compare(this,e)===0};he.prototype.inspect=function(){var e="",t=X7;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"};he.prototype.compare=function(e,t,r,i,s){if(!fo(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),r===void 0&&(r=e?e.length:0),i===void 0&&(i=0),s===void 0&&(s=this.length),t<0||r>e.length||i<0||s>this.length)throw new RangeError("out of range index");if(i>=s&&t>=r)return 0;if(i>=s)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,i>>>=0,s>>>=0,this===e)return 0;for(var o=s-i,a=r-t,u=Math.min(o,a),l=this.slice(i,s),c=e.slice(t,r),f=0;f<u;++f)if(l[f]!==c[f]){o=l[f],a=c[f];break}return o<a?-1:a<o?1:0};function qT(n,e,t,r,i){if(n.length===0)return-1;if(typeof t=="string"?(r=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=i?0:n.length-1),t<0&&(t=n.length+t),t>=n.length){if(i)return-1;t=n.length-1}else if(t<0)if(i)t=0;else return-1;if(typeof e=="string"&&(e=he.from(e,r)),fo(e))return e.length===0?-1:aC(n,e,t,r,i);if(typeof e=="number")return e=e&255,he.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(n,e,t):Uint8Array.prototype.lastIndexOf.call(n,e,t):aC(n,[e],t,r,i);throw new TypeError("val must be string, number or Buffer")}function aC(n,e,t,r,i){var s=1,o=n.length,a=e.length;if(r!==void 0&&(r=String(r).toLowerCase(),r==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(n.length<2||e.length<2)return-1;s=2,o/=2,a/=2,t/=2}function u(g,m){return s===1?g[m]:g.readUInt16BE(m*s)}var l;if(i){var c=-1;for(l=t;l<o;l++)if(u(n,l)===u(e,c===-1?0:l-c)){if(c===-1&&(c=l),l-c+1===a)return c*s}else c!==-1&&(l-=l-c),c=-1}else for(t+a>o&&(t=o-a),l=t;l>=0;l--){for(var f=!0,d=0;d<a;d++)if(u(n,l+d)!==u(e,d)){f=!1;break}if(f)return l}return-1}he.prototype.includes=function(e,t,r){return this.indexOf(e,t,r)!==-1};he.prototype.indexOf=function(e,t,r){return qT(this,e,t,r,!0)};he.prototype.lastIndexOf=function(e,t,r){return qT(this,e,t,r,!1)};function rB(n,e,t,r){t=Number(t)||0;var i=n.length-t;r?(r=Number(r),r>i&&(r=i)):r=i;var s=e.length;if(s%2!==0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var o=0;o<r;++o){var a=parseInt(e.substr(o*2,2),16);if(isNaN(a))return o;n[t+o]=a}return o}function iB(n,e,t,r){return k1(vm(e,n.length-t),n,t,r)}function jT(n,e,t,r){return k1(yB(e),n,t,r)}function sB(n,e,t,r){return jT(n,e,t,r)}function oB(n,e,t,r){return k1(HT(e),n,t,r)}function aB(n,e,t,r){return k1(bB(e,n.length-t),n,t,r)}he.prototype.write=function(e,t,r,i){if(t===void 0)i="utf8",r=this.length,t=0;else if(r===void 0&&typeof t=="string")i=t,r=this.length,t=0;else if(isFinite(t))t=t|0,isFinite(r)?(r=r|0,i===void 0&&(i="utf8")):(i=r,r=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var s=this.length-t;if((r===void 0||r>s)&&(r=s),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return rB(this,e,t,r);case"utf8":case"utf-8":return iB(this,e,t,r);case"ascii":return jT(this,e,t,r);case"latin1":case"binary":return sB(this,e,t,r);case"base64":return oB(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return aB(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}};he.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function uB(n,e,t){return e===0&&t===n.length?oC(n):oC(n.slice(e,t))}function $T(n,e,t){t=Math.min(n.length,t);for(var r=[],i=e;i<t;){var s=n[i],o=null,a=s>239?4:s>223?3:s>191?2:1;if(i+a<=t){var u,l,c,f;switch(a){case 1:s<128&&(o=s);break;case 2:u=n[i+1],(u&192)===128&&(f=(s&31)<<6|u&63,f>127&&(o=f));break;case 3:u=n[i+1],l=n[i+2],(u&192)===128&&(l&192)===128&&(f=(s&15)<<12|(u&63)<<6|l&63,f>2047&&(f<55296||f>57343)&&(o=f));break;case 4:u=n[i+1],l=n[i+2],c=n[i+3],(u&192)===128&&(l&192)===128&&(c&192)===128&&(f=(s&15)<<18|(u&63)<<12|(l&63)<<6|c&63,f>65535&&f<1114112&&(o=f))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|o&1023),r.push(o),i+=a}return lB(r)}var uC=4096;function lB(n){var e=n.length;if(e<=uC)return String.fromCharCode.apply(String,n);for(var t="",r=0;r<e;)t+=String.fromCharCode.apply(String,n.slice(r,r+=uC));return t}function cB(n,e,t){var r="";t=Math.min(n.length,t);for(var i=e;i<t;++i)r+=String.fromCharCode(n[i]&127);return r}function fB(n,e,t){var r="";t=Math.min(n.length,t);for(var i=e;i<t;++i)r+=String.fromCharCode(n[i]);return r}function hB(n,e,t){var r=n.length;(!e||e<0)&&(e=0),(!t||t<0||t>r)&&(t=r);for(var i="",s=e;s<t;++s)i+=vB(n[s]);return i}function dB(n,e,t){for(var r=n.slice(e,t),i="",s=0;s<r.length;s+=2)i+=String.fromCharCode(r[s]+r[s+1]*256);return i}he.prototype.slice=function(e,t){var r=this.length;e=~~e,t=t===void 0?r:~~t,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),t<e&&(t=e);var i;if(he.TYPED_ARRAY_SUPPORT)i=this.subarray(e,t),i.__proto__=he.prototype;else{var s=t-e;i=new he(s,void 0);for(var o=0;o<s;++o)i[o]=this[o+e]}return i};function Un(n,e,t){if(n%1!==0||n<0)throw new RangeError("offset is not uint");if(n+e>t)throw new RangeError("Trying to access beyond buffer length")}he.prototype.readUIntLE=function(e,t,r){e=e|0,t=t|0,r||Un(e,t,this.length);for(var i=this[e],s=1,o=0;++o<t&&(s*=256);)i+=this[e+o]*s;return i};he.prototype.readUIntBE=function(e,t,r){e=e|0,t=t|0,r||Un(e,t,this.length);for(var i=this[e+--t],s=1;t>0&&(s*=256);)i+=this[e+--t]*s;return i};he.prototype.readUInt8=function(e,t){return t||Un(e,1,this.length),this[e]};he.prototype.readUInt16LE=function(e,t){return t||Un(e,2,this.length),this[e]|this[e+1]<<8};he.prototype.readUInt16BE=function(e,t){return t||Un(e,2,this.length),this[e]<<8|this[e+1]};he.prototype.readUInt32LE=function(e,t){return t||Un(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};he.prototype.readUInt32BE=function(e,t){return t||Un(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};he.prototype.readIntLE=function(e,t,r){e=e|0,t=t|0,r||Un(e,t,this.length);for(var i=this[e],s=1,o=0;++o<t&&(s*=256);)i+=this[e+o]*s;return s*=128,i>=s&&(i-=Math.pow(2,8*t)),i};he.prototype.readIntBE=function(e,t,r){e=e|0,t=t|0,r||Un(e,t,this.length);for(var i=t,s=1,o=this[e+--i];i>0&&(s*=256);)o+=this[e+--i]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*t)),o};he.prototype.readInt8=function(e,t){return t||Un(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};he.prototype.readInt16LE=function(e,t){t||Un(e,2,this.length);var r=this[e]|this[e+1]<<8;return r&32768?r|4294901760:r};he.prototype.readInt16BE=function(e,t){t||Un(e,2,this.length);var r=this[e+1]|this[e]<<8;return r&32768?r|4294901760:r};he.prototype.readInt32LE=function(e,t){return t||Un(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};he.prototype.readInt32BE=function(e,t){return t||Un(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};he.prototype.readFloatLE=function(e,t){return t||Un(e,4,this.length),b1(this,e,!0,23,4)};he.prototype.readFloatBE=function(e,t){return t||Un(e,4,this.length),b1(this,e,!1,23,4)};he.prototype.readDoubleLE=function(e,t){return t||Un(e,8,this.length),b1(this,e,!0,52,8)};he.prototype.readDoubleBE=function(e,t){return t||Un(e,8,this.length),b1(this,e,!1,52,8)};function ci(n,e,t,r,i,s){if(!fo(n))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(t+r>n.length)throw new RangeError("Index out of range")}he.prototype.writeUIntLE=function(e,t,r,i){if(e=+e,t=t|0,r=r|0,!i){var s=Math.pow(2,8*r)-1;ci(this,e,t,r,s,0)}var o=1,a=0;for(this[t]=e&255;++a<r&&(o*=256);)this[t+a]=e/o&255;return t+r};he.prototype.writeUIntBE=function(e,t,r,i){if(e=+e,t=t|0,r=r|0,!i){var s=Math.pow(2,8*r)-1;ci(this,e,t,r,s,0)}var o=r-1,a=1;for(this[t+o]=e&255;--o>=0&&(a*=256);)this[t+o]=e/a&255;return t+r};he.prototype.writeUInt8=function(e,t,r){return e=+e,t=t|0,r||ci(this,e,t,1,255,0),he.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=e&255,t+1};function w1(n,e,t,r){e<0&&(e=65535+e+1);for(var i=0,s=Math.min(n.length-t,2);i<s;++i)n[t+i]=(e&255<<8*(r?i:1-i))>>>(r?i:1-i)*8}he.prototype.writeUInt16LE=function(e,t,r){return e=+e,t=t|0,r||ci(this,e,t,2,65535,0),he.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):w1(this,e,t,!0),t+2};he.prototype.writeUInt16BE=function(e,t,r){return e=+e,t=t|0,r||ci(this,e,t,2,65535,0),he.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):w1(this,e,t,!1),t+2};function _1(n,e,t,r){e<0&&(e=4294967295+e+1);for(var i=0,s=Math.min(n.length-t,4);i<s;++i)n[t+i]=e>>>(r?i:3-i)*8&255}he.prototype.writeUInt32LE=function(e,t,r){return e=+e,t=t|0,r||ci(this,e,t,4,4294967295,0),he.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255):_1(this,e,t,!0),t+4};he.prototype.writeUInt32BE=function(e,t,r){return e=+e,t=t|0,r||ci(this,e,t,4,4294967295,0),he.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):_1(this,e,t,!1),t+4};he.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t=t|0,!i){var s=Math.pow(2,8*r-1);ci(this,e,t,r,s-1,-s)}var o=0,a=1,u=0;for(this[t]=e&255;++o<r&&(a*=256);)e<0&&u===0&&this[t+o-1]!==0&&(u=1),this[t+o]=(e/a>>0)-u&255;return t+r};he.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t=t|0,!i){var s=Math.pow(2,8*r-1);ci(this,e,t,r,s-1,-s)}var o=r-1,a=1,u=0;for(this[t+o]=e&255;--o>=0&&(a*=256);)e<0&&u===0&&this[t+o+1]!==0&&(u=1),this[t+o]=(e/a>>0)-u&255;return t+r};he.prototype.writeInt8=function(e,t,r){return e=+e,t=t|0,r||ci(this,e,t,1,127,-128),he.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=e&255,t+1};he.prototype.writeInt16LE=function(e,t,r){return e=+e,t=t|0,r||ci(this,e,t,2,32767,-32768),he.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8):w1(this,e,t,!0),t+2};he.prototype.writeInt16BE=function(e,t,r){return e=+e,t=t|0,r||ci(this,e,t,2,32767,-32768),he.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=e&255):w1(this,e,t,!1),t+2};he.prototype.writeInt32LE=function(e,t,r){return e=+e,t=t|0,r||ci(this,e,t,4,2147483647,-2147483648),he.TYPED_ARRAY_SUPPORT?(this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):_1(this,e,t,!0),t+4};he.prototype.writeInt32BE=function(e,t,r){return e=+e,t=t|0,r||ci(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),he.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255):_1(this,e,t,!1),t+4};function WT(n,e,t,r,i,s){if(t+r>n.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function zT(n,e,t,r,i){return i||WT(n,e,t,4),IT(n,e,t,r,23,4),t+4}he.prototype.writeFloatLE=function(e,t,r){return zT(this,e,t,!0,r)};he.prototype.writeFloatBE=function(e,t,r){return zT(this,e,t,!1,r)};function UT(n,e,t,r,i){return i||WT(n,e,t,8),IT(n,e,t,r,52,8),t+8}he.prototype.writeDoubleLE=function(e,t,r){return UT(this,e,t,!0,r)};he.prototype.writeDoubleBE=function(e,t,r){return UT(this,e,t,!1,r)};he.prototype.copy=function(e,t,r,i){if(r||(r=0),!i&&i!==0&&(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);var s=i-r,o;if(this===e&&r<t&&t<i)for(o=s-1;o>=0;--o)e[o+t]=this[o+r];else if(s<1e3||!he.TYPED_ARRAY_SUPPORT)for(o=0;o<s;++o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+s),t);return s};he.prototype.fill=function(e,t,r,i){if(typeof e=="string"){if(typeof t=="string"?(i=t,t=0,r=this.length):typeof r=="string"&&(i=r,r=this.length),e.length===1){var s=e.charCodeAt(0);s<256&&(e=s)}if(i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!he.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else typeof e=="number"&&(e=e&255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;t=t>>>0,r=r===void 0?this.length:r>>>0,e||(e=0);var o;if(typeof e=="number")for(o=t;o<r;++o)this[o]=e;else{var a=fo(e)?e:vm(new he(e,i).toString()),u=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%u]}return this};var pB=/[^+\/0-9A-Za-z-_]/g;function gB(n){if(n=mB(n).replace(pB,""),n.length<2)return"";for(;n.length%4!==0;)n=n+"=";return n}function mB(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}function vB(n){return n<16?"0"+n.toString(16):n.toString(16)}function vm(n,e){e=e||1/0;for(var t,r=n.length,i=null,s=[],o=0;o<r;++o){if(t=n.charCodeAt(o),t>55295&&t<57344){if(!i){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===r){(e-=3)>-1&&s.push(239,191,189);continue}i=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191,189),i=t;continue}t=(i-55296<<10|t-56320)+65536}else i&&(e-=3)>-1&&s.push(239,191,189);if(i=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}function yB(n){for(var e=[],t=0;t<n.length;++t)e.push(n.charCodeAt(t)&255);return e}function bB(n,e){for(var t,r,i,s=[],o=0;o<n.length&&!((e-=2)<0);++o)t=n.charCodeAt(o),r=t>>8,i=t%256,s.push(i),s.push(r);return s}function HT(n){return G7(gB(n))}function k1(n,e,t,r){for(var i=0;i<r&&!(i+t>=e.length||i>=n.length);++i)e[i+t]=n[i];return i}function wB(n){return n!==n}function VT(n){return n!=null&&(!!n._isBuffer||GT(n)||_B(n))}function GT(n){return!!n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n)}function _B(n){return typeof n.readFloatLE=="function"&&typeof n.slice=="function"&>(n.slice(0,0))}var rd=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Kt(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function ft(n,e){return e={exports:{}},n(e,e.exports),e.exports}var kB=Math.ceil,xB=Math.floor,O2=function(n){return isNaN(n=+n)?0:(n>0?xB:kB)(n)},P2=function(n){if(n==null)throw TypeError("Can't call method on "+n);return n},SB=function(n){return function(e,t){var r=String(P2(e)),i=O2(t),s=r.length,o,a;return i<0||i>=s?"":(o=r.charCodeAt(i),o<55296||o>56319||i+1===s||(a=r.charCodeAt(i+1))<56320||a>57343?r.charAt(i):r.slice(i,i+2))}},CB=!0,Ge=ft(function(n){var e=n.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=e)}),It=ft(function(n){var e=n.exports={version:"2.6.12"};typeof __e=="number"&&(__e=e)});It.version;var rl=function(n){if(typeof n!="function")throw TypeError(n+" is not a function!");return n},zn=function(n,e,t){if(rl(n),e===void 0)return n;switch(t){case 1:return function(r){return n.call(e,r)};case 2:return function(r,i){return n.call(e,r,i)};case 3:return function(r,i,s){return n.call(e,r,i,s)}}return function(){return n.apply(e,arguments)}},Mn=function(n){return typeof n=="object"?n!==null:typeof n=="function"},br=function(n){if(!Mn(n))throw TypeError(n+" is not an object!");return n},aa=function(n){try{return!!n()}catch{return!0}},Di=!aa(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),Gb=Ge.document,EB=Mn(Gb)&&Mn(Gb.createElement),ym=function(n){return EB?Gb.createElement(n):{}},KT=!Di&&!aa(function(){return Object.defineProperty(ym("div"),"a",{get:function(){return 7}}).a!=7}),$d=function(n,e){if(!Mn(n))return n;var t,r;if(typeof(t=n.toString)=="function"&&!Mn(r=t.call(n))||typeof(t=n.valueOf)=="function"&&!Mn(r=t.call(n)))return r;throw TypeError("Can't convert object to primitive value")},RB=Object.defineProperty,AB=Di?Object.defineProperty:function(e,t,r){if(br(e),t=$d(t),br(r),KT)try{return RB(e,t,r)}catch{}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e},rs={f:AB},il=function(n,e){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:e}},iu=Di?function(n,e,t){return rs.f(n,e,il(1,t))}:function(n,e,t){return n[e]=t,n},DB={}.hasOwnProperty,Ot=function(n,e){return DB.call(n,e)},d0="prototype",gr=function(n,e,t){var r=n&gr.F,i=n&gr.G,s=n&gr.S,o=n&gr.P,a=n&gr.B,u=n&gr.W,l=i?It:It[e]||(It[e]={}),c=l[d0],f=i?Ge:s?Ge[e]:(Ge[e]||{})[d0],d,g,m;i&&(t=e);for(d in t)g=!r&&f&&f[d]!==void 0,!(g&&Ot(l,d))&&(m=g?f[d]:t[d],l[d]=i&&typeof f[d]!="function"?t[d]:a&&g?zn(m,Ge):u&&f[d]==m?function(y){var b=function(w,S,k){if(this instanceof y){switch(arguments.length){case 0:return new y;case 1:return new y(w);case 2:return new y(w,S)}return new y(w,S,k)}return y.apply(this,arguments)};return b[d0]=y[d0],b}(m):o&&typeof m=="function"?zn(Function.call,m):m,o&&((l.virtual||(l.virtual={}))[d]=m,n&gr.R&&c&&!c[d]&&iu(c,d,m)))};gr.F=1;gr.G=2;gr.S=4;gr.P=8;gr.B=16;gr.W=32;gr.U=64;gr.R=128;var Me=gr,I2=iu,ta={},TB={}.toString,sl=function(n){return TB.call(n).slice(8,-1)},L2=Object("z").propertyIsEnumerable(0)?Object:function(n){return sl(n)=="String"?n.split(""):Object(n)},vo=function(n){return L2(P2(n))},MB=Math.min,x1=function(n){return n>0?MB(O2(n),9007199254740991):0},OB=Math.max,PB=Math.min,IB=function(n,e){return n=O2(n),n<0?OB(n+e,0):PB(n,e)},LB=function(n){return function(e,t,r){for(var i=vo(e),s=x1(i.length),o=IB(r,s);s>o;o++)if(o in i&&i[o]===t)return o||0;return-1}},Wd=ft(function(n){var e="__core-js_shared__",t=Ge[e]||(Ge[e]={});(n.exports=function(r,i){return t[r]||(t[r]=i!==void 0?i:{})})("versions",[]).push({version:It.version,mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})}),FB=0,NB=Math.random(),S1=function(n){return"Symbol(".concat(n===void 0?"":n,")_",(++FB+NB).toString(36))},lC=Wd("keys"),F2=function(n){return lC[n]||(lC[n]=S1(n))},BB=LB(),qB=F2("IE_PROTO"),JT=function(n,e){var t=vo(n),r=0,i=[],s;for(s in t)s!=qB&&Ot(t,s)&&i.push(s);for(;e.length>r;)Ot(t,s=e[r++])&&(~BB(i,s)||i.push(s));return i},bm="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),id=Object.keys||function(e){return JT(e,bm)},jB=Di?Object.defineProperties:function(e,t){br(e);for(var r=id(t),i=r.length,s=0,o;i>s;)rs.f(e,o=r[s++],t[o]);return e},cC=Ge.document,Kb=cC&&cC.documentElement,$B=F2("IE_PROTO"),wy=function(){},Jb="prototype",Yg=function(){var n=ym("iframe"),e=bm.length,t="<",r=">",i;for(n.style.display="none",Kb.appendChild(n),n.src="javascript:",i=n.contentWindow.document,i.open(),i.write(t+"script"+r+"document.F=Object"+t+"/script"+r),i.close(),Yg=i.F;e--;)delete Yg[Jb][bm[e]];return Yg()},Xa=Object.create||function(e,t){var r;return e!==null?(wy[Jb]=br(e),r=new wy,wy[Jb]=null,r[$B]=e):r=Yg(),t===void 0?r:jB(r,t)},Pn=ft(function(n){var e=Wd("wks"),t=Ge.Symbol,r=typeof t=="function",i=n.exports=function(s){return e[s]||(e[s]=r&&t[s]||(r?t:S1)("Symbol."+s))};i.store=e}),WB=rs.f,fC=Pn("toStringTag"),gl=function(n,e,t){n&&!Ot(n=t?n:n.prototype,fC)&&WB(n,fC,{configurable:!0,value:e})},YT={};iu(YT,Pn("iterator"),function(){return this});var zB=function(n,e,t){n.prototype=Xa(YT,{next:il(1,t)}),gl(n,e+" Iterator")},Fc=function(n){return Object(P2(n))},hC=F2("IE_PROTO"),UB=Object.prototype,XT=Object.getPrototypeOf||function(n){return n=Fc(n),Ot(n,hC)?n[hC]:typeof n.constructor=="function"&&n instanceof n.constructor?n.constructor.prototype:n instanceof Object?UB:null},_y=Pn("iterator"),ky=!([].keys&&"next"in[].keys()),HB="@@iterator",dC="keys",p0="values",VB=function(){return this},N2=function(n,e,t,r,i,s,o){zB(t,e,r);var a=function(k){if(!ky&&k in f)return f[k];switch(k){case dC:return function(){return new t(this,k)};case p0:return function(){return new t(this,k)}}return function(){return new t(this,k)}},u=e+" Iterator",l=i==p0,c=!1,f=n.prototype,d=f[_y]||f[HB]||i&&f[i],g=d||a(i),m=i?l?a("entries"):g:void 0,y=e=="Array"&&f.entries||d,b,w,S;if(y&&(S=XT(y.call(new n)),S!==Object.prototype&&S.next&&gl(S,u,!0)),l&&d&&d.name!==p0&&(c=!0,g=function(){return d.call(this)}),o&&(ky||c||!f[_y])&&iu(f,_y,g),ta[e]=g,ta[u]=VB,i)if(b={values:l?g:a(p0),keys:s?g:a(dC),entries:m},o)for(w in b)w in f||I2(f,w,b[w]);else Me(Me.P+Me.F*(ky||c),e,b);return b},GB=SB();N2(String,"String",function(n){this._t=String(n),this._i=0},function(){var n=this._t,e=this._i,t;return e>=n.length?{value:void 0,done:!0}:(t=GB(n,e),this._i+=t.length,{value:t,done:!1})});var Ba=function(n,e){return{value:e,done:!!n}};N2(Array,"Array",function(n,e){this._t=vo(n),this._i=0,this._k=e},function(){var n=this._t,e=this._k,t=this._i++;return!n||t>=n.length?(this._t=void 0,Ba(1)):e=="keys"?Ba(0,t):e=="values"?Ba(0,n[t]):Ba(0,[t,n[t]])},"values");ta.Arguments=ta.Array;var pC=Pn("toStringTag"),gC="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(",");for(var xy=0;xy<gC.length;xy++){var Sy=gC[xy],mC=Ge[Sy],Cy=mC&&mC.prototype;Cy&&!Cy[pC]&&iu(Cy,pC,Sy),ta[Sy]=ta.Array}var KB=Pn,B2={f:KB},JB=B2.f("iterator"),ZT=ft(function(n){n.exports={default:JB,__esModule:!0}});Kt(ZT);var Qi=ft(function(n){var e=S1("meta"),t=rs.f,r=0,i=Object.isExtensible||function(){return!0},s=!aa(function(){return i(Object.preventExtensions({}))}),o=function(f){t(f,e,{value:{i:"O"+ ++r,w:{}}})},a=function(f,d){if(!Mn(f))return typeof f=="symbol"?f:(typeof f=="string"?"S":"P")+f;if(!Ot(f,e)){if(!i(f))return"F";if(!d)return"E";o(f)}return f[e].i},u=function(f,d){if(!Ot(f,e)){if(!i(f))return!0;if(!d)return!1;o(f)}return f[e].w},l=function(f){return s&&c.NEED&&i(f)&&!Ot(f,e)&&o(f),f},c=n.exports={KEY:e,NEED:!1,fastKey:a,getWeak:u,onFreeze:l}});Qi.KEY;Qi.NEED;Qi.fastKey;Qi.getWeak;Qi.onFreeze;var YB=rs.f,q2=function(n){var e=It.Symbol||(It.Symbol={});n.charAt(0)!="_"&&!(n in e)&&YB(e,n,{value:B2.f(n)})},XB=Object.getOwnPropertySymbols,Nc={f:XB},ZB={}.propertyIsEnumerable,C1={f:ZB},QB=function(n){var e=id(n),t=Nc.f;if(t)for(var r=t(n),i=C1.f,s=0,o;r.length>s;)i.call(n,o=r[s++])&&e.push(o);return e},Yb=Array.isArray||function(e){return sl(e)=="Array"},eq=bm.concat("length","prototype"),tq=Object.getOwnPropertyNames||function(e){return JT(e,eq)},QT={f:tq},e6=QT.f,nq={}.toString,t6=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],rq=function(n){try{return e6(n)}catch{return t6.slice()}},iq=function(e){return t6&&nq.call(e)=="[object Window]"?rq(e):e6(vo(e))},n6={f:iq},vC=Object.getOwnPropertyDescriptor,sq=Di?vC:function(e,t){if(e=vo(e),t=$d(t),KT)try{return vC(e,t)}catch{}if(Ot(e,t))return il(!C1.f.call(e,t),e[t])},E1={f:sq},oq=Qi.KEY,r6=E1.f,$u=rs.f,i6=n6.f,ui=Ge.Symbol,wm=Ge.JSON,g0=wm&&wm.stringify,Va="prototype",ni=Pn("_hidden"),yC=Pn("toPrimitive"),aq={}.propertyIsEnumerable,jf=Wd("symbol-registry"),na=Wd("symbols"),zd=Wd("op-symbols"),Cs=Object[Va],Bc=typeof ui=="function"&&!!Nc.f,Ey=Ge.QObject,Xb=!Ey||!Ey[Va]||!Ey[Va].findChild,Zb=Di&&aa(function(){return Xa($u({},"a",{get:function(){return $u(this,"a",{value:7}).a}})).a!=7})?function(n,e,t){var r=r6(Cs,e);r&&delete Cs[e],$u(n,e,t),r&&n!==Cs&&$u(Cs,e,r)}:$u,bC=function(n){var e=na[n]=Xa(ui[Va]);return e._k=n,e},Qb=Bc&&typeof ui.iterator=="symbol"?function(n){return typeof n=="symbol"}:function(n){return n instanceof ui},R1=function(e,t,r){return e===Cs&&R1(zd,t,r),br(e),t=$d(t),br(r),Ot(na,t)?(r.enumerable?(Ot(e,ni)&&e[ni][t]&&(e[ni][t]=!1),r=Xa(r,{enumerable:il(0,!1)})):(Ot(e,ni)||$u(e,ni,il(1,{})),e[ni][t]=!0),Zb(e,t,r)):$u(e,t,r)},s6=function(e,t){br(e);for(var r=QB(t=vo(t)),i=0,s=r.length,o;s>i;)R1(e,o=r[i++],t[o]);return e},uq=function(e,t){return t===void 0?Xa(e):s6(Xa(e),t)},lq=function(e){var t=aq.call(this,e=$d(e));return this===Cs&&Ot(na,e)&&!Ot(zd,e)?!1:t||!Ot(this,e)||!Ot(na,e)||Ot(this,ni)&&this[ni][e]?t:!0},o6=function(e,t){if(e=vo(e),t=$d(t),!(e===Cs&&Ot(na,t)&&!Ot(zd,t))){var r=r6(e,t);return r&&Ot(na,t)&&!(Ot(e,ni)&&e[ni][t])&&(r.enumerable=!0),r}},a6=function(e){for(var t=i6(vo(e)),r=[],i=0,s;t.length>i;)!Ot(na,s=t[i++])&&s!=ni&&s!=oq&&r.push(s);return r},u6=function(e){for(var t=e===Cs,r=i6(t?zd:vo(e)),i=[],s=0,o;r.length>s;)Ot(na,o=r[s++])&&(!t||Ot(Cs,o))&&i.push(na[o]);return i};Bc||(ui=function(){if(this instanceof ui)throw TypeError("Symbol is not a constructor!");var e=S1(arguments.length>0?arguments[0]:void 0),t=function(r){this===Cs&&t.call(zd,r),Ot(this,ni)&&Ot(this[ni],e)&&(this[ni][e]=!1),Zb(this,e,il(1,r))};return Di&&Xb&&Zb(Cs,e,{configurable:!0,set:t}),bC(e)},I2(ui[Va],"toString",function(){return this._k}),E1.f=o6,rs.f=R1,QT.f=n6.f=a6,C1.f=lq,Nc.f=u6,B2.f=function(n){return bC(Pn(n))});Me(Me.G+Me.W+Me.F*!Bc,{Symbol:ui});for(var wC="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),_C=0;wC.length>_C;)Pn(wC[_C++]);for(var kC=id(Pn.store),xC=0;kC.length>xC;)q2(kC[xC++]);Me(Me.S+Me.F*!Bc,"Symbol",{for:function(n){return Ot(jf,n+="")?jf[n]:jf[n]=ui(n)},keyFor:function(e){if(!Qb(e))throw TypeError(e+" is not a symbol!");for(var t in jf)if(jf[t]===e)return t},useSetter:function(){Xb=!0},useSimple:function(){Xb=!1}});Me(Me.S+Me.F*!Bc,"Object",{create:uq,defineProperty:R1,defineProperties:s6,getOwnPropertyDescriptor:o6,getOwnPropertyNames:a6,getOwnPropertySymbols:u6});var cq=aa(function(){Nc.f(1)});Me(Me.S+Me.F*cq,"Object",{getOwnPropertySymbols:function(e){return Nc.f(Fc(e))}});wm&&Me(Me.S+Me.F*(!Bc||aa(function(){var n=ui();return g0([n])!="[null]"||g0({a:n})!="{}"||g0(Object(n))!="{}"})),"JSON",{stringify:function(e){for(var t=[e],r=1,i,s;arguments.length>r;)t.push(arguments[r++]);if(s=i=t[1],!(!Mn(i)&&e===void 0||Qb(e)))return Yb(i)||(i=function(o,a){if(typeof s=="function"&&(a=s.call(this,o,a)),!Qb(a))return a}),t[1]=i,g0.apply(wm,t)}});ui[Va][yC]||iu(ui[Va],yC,ui[Va].valueOf);gl(ui,"Symbol");gl(Math,"Math",!0);gl(Ge.JSON,"JSON",!0);q2("asyncIterator");q2("observable");var fq=It.Symbol,l6=ft(function(n){n.exports={default:fq,__esModule:!0}});Kt(l6);var j2=ft(function(n,e){e.__esModule=!0;var t=s(ZT),r=s(l6),i=typeof r.default=="function"&&typeof t.default=="symbol"?function(o){return typeof o}:function(o){return o&&typeof r.default=="function"&&o.constructor===r.default&&o!==r.default.prototype?"symbol":typeof o};function s(o){return o&&o.__esModule?o:{default:o}}e.default=typeof r.default=="function"&&i(t.default)==="symbol"?function(o){return typeof o>"u"?"undefined":i(o)}:function(o){return o&&typeof r.default=="function"&&o.constructor===r.default&&o!==r.default.prototype?"symbol":typeof o>"u"?"undefined":i(o)}}),hq=Kt(j2),m0=Object.assign,c6=!m0||aa(function(){var n={},e={},t=Symbol(),r="abcdefghijklmnopqrst";return n[t]=7,r.split("").forEach(function(i){e[i]=i}),m0({},n)[t]!=7||Object.keys(m0({},e)).join("")!=r})?function(e,t){for(var r=Fc(e),i=arguments.length,s=1,o=Nc.f,a=C1.f;i>s;)for(var u=L2(arguments[s++]),l=o?id(u).concat(o(u)):id(u),c=l.length,f=0,d;c>f;)d=l[f++],(!Di||a.call(u,d))&&(r[d]=u[d]);return r}:m0;Me(Me.S+Me.F,"Object",{assign:c6});var dq=It.Object.assign,f6=ft(function(n){n.exports={default:dq,__esModule:!0}});Kt(f6);var pq=ft(function(n,e){e.__esModule=!0;var t=r(f6);function r(i){return i&&i.__esModule?i:{default:i}}e.default=t.default||function(i){for(var s=1;s<arguments.length;s++){var o=arguments[s];for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(i[a]=o[a])}return i}}),Ql=Kt(pq),h6=function(n,e,t,r){try{return r?e(br(t)[0],t[1]):e(t)}catch(s){var i=n.return;throw i!==void 0&&br(i.call(n)),s}},gq=Pn("iterator"),mq=Array.prototype,d6=function(n){return n!==void 0&&(ta.Array===n||mq[gq]===n)},SC=function(n,e,t){e in n?rs.f(n,e,il(0,t)):n[e]=t},vq=Pn("toStringTag"),yq=sl(function(){return arguments}())=="Arguments",bq=function(n,e){try{return n[e]}catch{}},A1=function(n){var e,t,r;return n===void 0?"Undefined":n===null?"Null":typeof(t=bq(e=Object(n),vq))=="string"?t:yq?sl(e):(r=sl(e))=="Object"&&typeof e.callee=="function"?"Arguments":r},wq=Pn("iterator"),$2=It.getIteratorMethod=function(n){if(n!=null)return n[wq]||n["@@iterator"]||ta[A1(n)]},ew=Pn("iterator"),p6=!1;try{var _q=[7][ew]();_q.return=function(){p6=!0}}catch{}var g6=function(n,e){if(!p6)return!1;var t=!1;try{var r=[7],i=r[ew]();i.next=function(){return{done:t=!0}},r[ew]=function(){return i},n(r)}catch{}return t};Me(Me.S+Me.F*!g6(function(n){}),"Array",{from:function(e){var t=Fc(e),r=typeof this=="function"?this:Array,i=arguments.length,s=i>1?arguments[1]:void 0,o=s!==void 0,a=0,u=$2(t),l,c,f,d;if(o&&(s=zn(s,i>2?arguments[2]:void 0,2)),u!=null&&!(r==Array&&d6(u)))for(d=u.call(t),c=new r;!(f=d.next()).done;a++)SC(c,a,o?h6(d,s,[f.value,a],!0):f.value);else for(l=x1(t.length),c=new r(l);l>a;a++)SC(c,a,o?s(t[a],a):t[a]);return c.length=a,c}});var kq=It.Array.from,m6=ft(function(n){n.exports={default:kq,__esModule:!0}});Kt(m6);var xq=ft(function(n,e){e.__esModule=!0;var t=r(m6);function r(i){return i&&i.__esModule?i:{default:i}}e.default=function(i){if(Array.isArray(i)){for(var s=0,o=Array(i.length);s<i.length;s++)o[s]=i[s];return o}else return(0,t.default)(i)}}),un=Kt(xq),Sq=Pn("iterator"),Cq=It.isIterable=function(n){var e=Object(n);return e[Sq]!==void 0||"@@iterator"in e||ta.hasOwnProperty(A1(e))},Eq=Cq,v6=ft(function(n){n.exports={default:Eq,__esModule:!0}});Kt(v6);var Rq=It.getIterator=function(n){var e=$2(n);if(typeof e!="function")throw TypeError(n+" is not iterable!");return br(e.call(n))},Aq=Rq,y6=ft(function(n){n.exports={default:Aq,__esModule:!0}});Kt(y6);var Dq=ft(function(n,e){e.__esModule=!0;var t=i(v6),r=i(y6);function i(s){return s&&s.__esModule?s:{default:s}}e.default=function(){function s(o,a){var u=[],l=!0,c=!1,f=void 0;try{for(var d=(0,r.default)(o),g;!(l=(g=d.next()).done)&&(u.push(g.value),!(a&&u.length===a));l=!0);}catch(m){c=!0,f=m}finally{try{!l&&d.return&&d.return()}finally{if(c)throw f}}return u}return function(o,a){if(Array.isArray(o))return o;if((0,t.default)(Object(o)))return s(o,a);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()}),ei=Kt(Dq),Tq=ft(function(n,e){e.__esModule=!0,e.default=function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}}),sr=Kt(Tq);Me(Me.S+Me.F*!Di,"Object",{defineProperty:rs.f});var Mq=It.Object,Oq=function(e,t,r){return Mq.defineProperty(e,t,r)},b6=ft(function(n){n.exports={default:Oq,__esModule:!0}});Kt(b6);var Pq=ft(function(n,e){e.__esModule=!0;var t=r(b6);function r(i){return i&&i.__esModule?i:{default:i}}e.default=function(){function i(s,o){for(var a=0;a<o.length;a++){var u=o[a];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),(0,t.default)(s,u.key,u)}}return function(s,o,a){return o&&i(s.prototype,o),a&&i(s,a),s}}()}),wr=Kt(Pq);function w6(){throw new Error("setTimeout has not been defined")}function _6(){throw new Error("clearTimeout has not been defined")}var Ta=w6,Ma=_6;typeof yc.setTimeout=="function"&&(Ta=setTimeout);typeof yc.clearTimeout=="function"&&(Ma=clearTimeout);function k6(n){if(Ta===setTimeout)return setTimeout(n,0);if((Ta===w6||!Ta)&&setTimeout)return Ta=setTimeout,setTimeout(n,0);try{return Ta(n,0)}catch{try{return Ta.call(null,n,0)}catch{return Ta.call(this,n,0)}}}function Iq(n){if(Ma===clearTimeout)return clearTimeout(n);if((Ma===_6||!Ma)&&clearTimeout)return Ma=clearTimeout,clearTimeout(n);try{return Ma(n)}catch{try{return Ma.call(null,n)}catch{return Ma.call(this,n)}}}var Xo=[],lc=!1,Ku,Xg=-1;function Lq(){!lc||!Ku||(lc=!1,Ku.length?Xo=Ku.concat(Xo):Xg=-1,Xo.length&&x6())}function x6(){if(!lc){var n=k6(Lq);lc=!0;for(var e=Xo.length;e;){for(Ku=Xo,Xo=[];++Xg<e;)Ku&&Ku[Xg].run();Xg=-1,e=Xo.length}Ku=null,lc=!1,Iq(n)}}function Wr(n){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];Xo.push(new S6(n,e)),Xo.length===1&&!lc&&k6(x6)}function S6(n,e){this.fun=n,this.array=e}S6.prototype.run=function(){this.fun.apply(null,this.array)};var Fq={},$f=yc.performance||{};$f.now||$f.mozNow||$f.msNow||$f.oNow||$f.webkitNow;var Zg={env:Fq};function Nq(n,e){for(var t=0,r=n.length-1;r>=0;r--){var i=n[r];i==="."?n.splice(r,1):i===".."?(n.splice(r,1),t++):t&&(n.splice(r,1),t--)}if(e)for(;t--;t)n.unshift("..");return n}function Bq(n){var e=qq(n),t=$q(n,-1)==="/";return n=Nq(C6(n.split("/"),function(r){return!!r}),!e).join("/"),!n&&!e&&(n="."),n&&t&&(n+="/"),(e?"/":"")+n}function qq(n){return n.charAt(0)==="/"}function jq(){var n=Array.prototype.slice.call(arguments,0);return Bq(C6(n,function(e,t){if(typeof e!="string")throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))}var Ry={join:jq};function C6(n,e){if(n.filter)return n.filter(e);for(var t=[],r=0;r<n.length;r++)e(n[r],r,n)&&t.push(n[r]);return t}var $q="ab".substr(-1)==="b"?function(n,e,t){return n.substr(e,t)}:function(n,e,t){return e<0&&(e=n.length+e),n.substr(e,t)},Wq=ft(function(n,e){(function(t,r){n.exports=r()})(rd,function(){function t(r,i){return new Proxy({},{getPrototypeOf:function(o){return Reflect.getPrototypeOf(r[i])},setPrototypeOf:function(o,a){return Reflect.setPrototypeOf(r[i],a)},isExtensible:function(o){return Reflect.isExtensible(r[i])},preventExtensions:function(o){return Reflect.preventExtensions(r[i])},getOwnPropertyDescriptor:function(o,a){return Reflect.getOwnPropertyDescriptor(r[i],a)},defineProperty:function(o,a,u){return Reflect.defineProperty(r[i],a,u)},get:function(o,a){var u=Reflect.get(r[i],a);return typeof u=="function"&&(u=u.bind(r[i])),u},set:function(o,a,u){return Reflect.set(r[i],a,u)},has:function(o,a){return Reflect.has(r[i],a)},deleteProperty:function(o,a){return Reflect.delete(r[i],a)},ownKeys:function(o){return Reflect.ownKeys(r[i])},apply:function(o,a,u){return Reflect.apply(r[i],a,u)},construct:function(o,a,u){return Reflect.construct(r[i],a,u)}})}return t})}),W2=function(n,e){var t=(It.Object||{})[n]||Object[n],r={};r[n]=e(t),Me(Me.S+Me.F*aa(function(){t(1)}),"Object",r)},zq=Qi.onFreeze;W2("freeze",function(n){return function(t){return n&&Mn(t)?n(zq(t)):t}});var Uq=It.Object.freeze,Hq=ft(function(n){n.exports={default:Uq,__esModule:!0}}),Vq=Kt(Hq),ie=Vq({O_RDONLY:0,O_WRONLY:1,O_RDWR:2,O_ACCMODE:3,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,COPYFILE_EXCL:1,SEEK_SET:0,SEEK_CUR:1,SEEK_END:2,MAP_SHARED:1,MAP_PRIVATE:2}),Qg=function(){function n(e){sr(this,n),this.dev=e.dev||0,this.ino=e.ino,this.mode=e.mode,this.nlink=e.nlink,this.uid=e.uid,this.gid=e.gid,this.rdev=e.rdev||0,this.size=e.size,this.blksize=void 0,this.blocks=void 0,this.atime=e.atime,this.mtime=e.mtime,this.ctime=e.ctime,this.birthtime=e.birthtime}return wr(n,[{key:"isFile",value:function(){return(this.mode&ie.S_IFMT)==ie.S_IFREG}},{key:"isDirectory",value:function(){return(this.mode&ie.S_IFMT)==ie.S_IFDIR}},{key:"isBlockDevice",value:function(){return(this.mode&ie.S_IFMT)==ie.S_IFBLK}},{key:"isCharacterDevice",value:function(){return(this.mode&ie.S_IFMT)==ie.S_IFCHR}},{key:"isSymbolicLink",value:function(){return(this.mode&ie.S_IFMT)==ie.S_IFLNK}},{key:"isFIFO",value:function(){return(this.mode&ie.S_IFMT)==ie.S_IFIFO}},{key:"isSocket",value:function(){return(this.mode&ie.S_IFMT)==ie.S_IFSOCK}}]),n}(),Gq=function(){function n(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];sr(this,n),this._iNodeMgr=e,this._iNode=t,this._curPath=r,e.refINode(t)}return wr(n,[{key:"changeDir",value:function(t,r){this._iNodeMgr.refINode(t),this._iNodeMgr.unrefINode(this._iNode),this._iNode=t,this._curPath=r}},{key:"getINode",value:function(){return this._iNode}},{key:"getPathStack",value:function(){return[].concat(un(this._curPath))}},{key:"getPath",value:function(){return"/"+this._curPath.join("/")}}]),n}(),Vs=0,tw=0,Kq=ie.S_IRWXU|ie.S_IRGRP|ie.S_IXGRP|ie.S_IROTH|ie.S_IXOTH,zi=ie.S_IRUSR|ie.S_IWUSR|ie.S_IRGRP|ie.S_IWGRP|ie.S_IROTH|ie.S_IWOTH,nw=ie.S_IRWXU|ie.S_IRWXG|ie.S_IRWXO,E6=ie.S_IRWXU|ie.S_IRWXG|ie.S_IRWXO;function Wf(n,e){return n&~e}function Jq(n,e,t){return n===t.uid?(t.mode&ie.S_IRWXU)>>6:e===t.gid?(t.mode&ie.S_IRWXG)>>3:t.mode&ie.S_IRWXO}function Yq(n,e,t,r){return(n&Jq(e,t,r))===n}var D1=function(n,e,t){for(var r in e)iu(n,r,e[r]);return n},sd=function(n,e,t,r){if(!(n instanceof e)||r!==void 0&&r in n)throw TypeError(t+": incorrect invocation!");return n},Za=ft(function(n){var e={},t={},r=n.exports=function(i,s,o,a,u){var l=u?function(){return i}:$2(i),c=zn(o,a,s?2:1),f=0,d,g,m,y;if(typeof l!="function")throw TypeError(i+" is not iterable!");if(d6(l)){for(d=x1(i.length);d>f;f++)if(y=s?c(br(g=i[f])[0],g[1]):c(i[f]),y===e||y===t)return y}else for(m=l.call(i);!(g=m.next()).done;)if(y=h6(m,c,g.value,s),y===e||y===t)return y};r.BREAK=e,r.RETURN=t}),CC=Pn("species"),R6=function(n){var e=typeof It[n]=="function"?It[n]:Ge[n];Di&&e&&!e[CC]&&rs.f(e,CC,{configurable:!0,get:function(){return this}})},Ci=function(n,e){if(!Mn(n)||n._t!==e)throw TypeError("Incompatible receiver, "+e+" required!");return n},Xq=rs.f,A6=Qi.fastKey,zf=Di?"_s":"size",v0=function(n,e){var t=A6(e),r;if(t!=="F")return n._i[t];for(r=n._f;r;r=r.n)if(r.k==e)return r},Ay={getConstructor:function(n,e,t,r){var i=n(function(s,o){sd(s,i,e,"_i"),s._t=e,s._i=Xa(null),s._f=void 0,s._l=void 0,s[zf]=0,o!=null&&Za(o,t,s[r],s)});return D1(i.prototype,{clear:function(){for(var o=Ci(this,e),a=o._i,u=o._f;u;u=u.n)u.r=!0,u.p&&(u.p=u.p.n=void 0),delete a[u.i];o._f=o._l=void 0,o[zf]=0},delete:function(s){var o=Ci(this,e),a=v0(o,s);if(a){var u=a.n,l=a.p;delete o._i[a.i],a.r=!0,l&&(l.n=u),u&&(u.p=l),o._f==a&&(o._f=u),o._l==a&&(o._l=l),o[zf]--}return!!a},forEach:function(o){Ci(this,e);for(var a=zn(o,arguments.length>1?arguments[1]:void 0,3),u;u=u?u.n:this._f;)for(a(u.v,u.k,this);u&&u.r;)u=u.p},has:function(o){return!!v0(Ci(this,e),o)}}),Di&&Xq(i.prototype,"size",{get:function(){return Ci(this,e)[zf]}}),i},def:function(n,e,t){var r=v0(n,e),i,s;return r?r.v=t:(n._l=r={i:s=A6(e,!0),k:e,v:t,p:i=n._l,n:void 0,r:!1},n._f||(n._f=r),i&&(i.n=r),n[zf]++,s!=="F"&&(n._i[s]=r)),n},getEntry:v0,setStrong:function(n,e,t){N2(n,e,function(r,i){this._t=Ci(r,e),this._k=i,this._l=void 0},function(){for(var r=this,i=r._k,s=r._l;s&&s.r;)s=s.p;return!r._t||!(r._l=s=s?s.n:r._t._f)?(r._t=void 0,Ba(1)):i=="keys"?Ba(0,s.k):i=="values"?Ba(0,s.v):Ba(0,[s.k,s.v])},t?"entries":"values",!t,!0),R6(e)}},Zq=Pn("species"),Qq=function(n){var e;return Yb(n)&&(e=n.constructor,typeof e=="function"&&(e===Array||Yb(e.prototype))&&(e=void 0),Mn(e)&&(e=e[Zq],e===null&&(e=void 0))),e===void 0?Array:e},ej=function(n,e){return new(Qq(n))(e)},T1=function(n,e){var t=n==1,r=n==2,i=n==3,s=n==4,o=n==6,a=n==5||o,u=ej;return function(l,c,f){for(var d=Fc(l),g=L2(d),m=zn(c,f,3),y=x1(g.length),b=0,w=t?u(l,y):r?u(l,0):void 0,S,k;y>b;b++)if((a||b in g)&&(S=g[b],k=m(S,b,d),n)){if(t)w[b]=k;else if(k)switch(n){case 3:return!0;case 5:return S;case 6:return b;case 2:w.push(S)}else if(s)return!1}return o?-1:i||s?s:w}},tj=rs.f,nj=T1(0),D6=function(n,e,t,r,i,s){var o=Ge[n],a=o,u="set",l=a&&a.prototype,c={};return!Di||typeof a!="function"||!(s||l.forEach&&!aa(function(){new a().entries().next()}))?(a=r.getConstructor(e,n,i,u),D1(a.prototype,t),Qi.NEED=!0):(a=e(function(f,d){sd(f,a,n,"_c"),f._c=new o,d!=null&&Za(d,i,f[u],f)}),nj("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function(f){var d=f=="add"||f=="set";f in l&&!(s&&f=="clear")&&iu(a.prototype,f,function(g,m){if(sd(this,a,f),!d&&s&&!Mn(g))return f=="get"?void 0:!1;var y=this._c[f](g===0?0:g,m);return d?this:y})}),s||tj(a.prototype,"size",{get:function(){return this._c.size}})),gl(a,n),c[n]=a,Me(Me.G+Me.W+Me.F,c),s||r.setStrong(a,n,i),a},Dy="Map";D6(Dy,function(n){return function(){return n(this,arguments.length>0?arguments[0]:void 0)}},{get:function(e){var t=Ay.getEntry(Ci(this,Dy),e);return t&&t.v},set:function(e,t){return Ay.def(Ci(this,Dy),e===0?0:e,t)}},Ay,!0);var rj=function(n,e){var t=[];return Za(n,!1,t.push,t,e),t},ij=function(n){return function(){if(A1(this)!=n)throw TypeError(n+"#toJSON isn't generic");return rj(this)}};Me(Me.P+Me.R,"Map",{toJSON:ij("Map")});var T6=function(n){Me(Me.S,n,{of:function(){for(var t=arguments.length,r=new Array(t);t--;)r[t]=arguments[t];return new this(r)}})};T6("Map");var M6=function(n){Me(Me.S,n,{from:function(t){var r=arguments[1],i,s,o,a;return rl(this),i=r!==void 0,i&&rl(r),t==null?new this:(s=[],i?(o=0,a=zn(r,arguments[2],2),Za(t,!1,function(u){s.push(a(u,o++))})):Za(t,!1,s.push,s),new this(s))}})};M6("Map");var sj=It.Map,oj=ft(function(n){n.exports={default:sj,__esModule:!0}}),od=Kt(oj);W2("getPrototypeOf",function(){return function(e){return XT(Fc(e))}});var aj=It.Object.getPrototypeOf,O6=ft(function(n){n.exports={default:aj,__esModule:!0}}),Ht=Kt(O6),uj=ft(function(n,e){e.__esModule=!0;var t=r(j2);function r(i){return i&&i.__esModule?i:{default:i}}e.default=function(i,s){if(!i)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return s&&((typeof s>"u"?"undefined":(0,t.default)(s))==="object"||typeof s=="function")?s:i}}),ua=Kt(uj),lj=function(n,e){if(br(n),!Mn(e)&&e!==null)throw TypeError(e+": can't set as prototype!")},cj={set:Object.setPrototypeOf||("__proto__"in{}?function(n,e,t){try{t=zn(Function.call,E1.f(Object.prototype,"__proto__").set,2),t(n,[]),e=!(n instanceof Array)}catch{e=!0}return function(i,s){return lj(i,s),e?i.__proto__=s:t(i,s),i}}({},!1):void 0)};Me(Me.S,"Object",{setPrototypeOf:cj.set});var fj=It.Object.setPrototypeOf,P6=ft(function(n){n.exports={default:fj,__esModule:!0}});Kt(P6);Me(Me.S,"Object",{create:Xa});var hj=It.Object,dj=function(e,t){return hj.create(e,t)},I6=ft(function(n){n.exports={default:dj,__esModule:!0}});Kt(I6);var pj=ft(function(n,e){e.__esModule=!0;var t=s(P6),r=s(I6),i=s(j2);function s(o){return o&&o.__esModule?o:{default:o}}e.default=function(o,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function, not "+(typeof a>"u"?"undefined":(0,i.default)(a)));o.prototype=(0,r.default)(a&&a.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),a&&(t.default?(0,t.default)(o,a):o.__proto__=a)}}),la=Kt(pj),gj=ft(function(n,e){(function(t,r){r(e)})(rd,function(t){function r(D){return D&&D.__esModule&&Object.prototype.hasOwnProperty.call(D,"default")?D.default:D}function i(D,O){return O={exports:{}},D(O,O.exports),O.exports}var s=function(D,O){return{value:O,done:!!D}},o={},a={}.toString,u=function(D){return a.call(D).slice(8,-1)},l=Object("z").propertyIsEnumerable(0)?Object:function(D){return u(D)=="String"?D.split(""):Object(D)},c=function(D){if(D==null)throw TypeError("Can't call method on "+D);return D},f=function(D){return l(c(D))},d=i(function(D){var O=D.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=O)}),g=i(function(D){var O=D.exports={version:"2.4.0"};typeof __e=="number"&&(__e=O)});g.version;var m=function(D){if(typeof D!="function")throw TypeError(D+" is not a function!");return D},y=function(D,O,U){if(m(D),O===void 0)return D;switch(U){case 1:return function(J){return D.call(O,J)};case 2:return function(J,Z){return D.call(O,J,Z)};case 3:return function(J,Z,X){return D.call(O,J,Z,X)}}return function(){return D.apply(O,arguments)}},b=function(D){return typeof D=="object"?D!==null:typeof D=="function"},w=function(D){if(!b(D))throw TypeError(D+" is not an object!");return D},S=function(D){try{return!!D()}catch{return!0}},k=!S(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),x=d.document,C=b(x)&&b(x.createElement),R=function(D){return C?x.createElement(D):{}},P=!k&&!S(function(){return Object.defineProperty(R("div"),"a",{get:function(){return 7}}).a!=7}),q=function(D,O){if(!b(D))return D;var U,J;if(typeof(U=D.toString)=="function"&&!b(J=U.call(D))||typeof(U=D.valueOf)=="function"&&!b(J=U.call(D)))return J;throw TypeError("Can't convert object to primitive value")},B=Object.defineProperty,G=k?Object.defineProperty:function(O,U,J){if(w(O),U=q(U),w(J),P)try{return B(O,U,J)}catch{}if("get"in J||"set"in J)throw TypeError("Accessors not supported!");return"value"in J&&(O[U]=J.value),O},V={f:G},F=function(D,O){return{enumerable:!(D&1),configurable:!(D&2),writable:!(D&4),value:O}},A=k?function(D,O,U){return V.f(D,O,F(1,U))}:function(D,O,U){return D[O]=U,D},Y="prototype",N=function(D,O,U){var J=D&N.F,Z=D&N.G,X=D&N.S,T=D&N.P,j=D&N.B,H=D&N.W,ae=Z?g:g[O]||(g[O]={}),_e=ae[Y],$=Z?d:X?d[O]:(d[O]||{})[Y],Q,ne,le;Z&&(U=O);for(Q in U)ne=!J&&$&&$[Q]!==void 0,!(ne&&Q in ae)&&(le=ne?$[Q]:U[Q],ae[Q]=Z&&typeof $[Q]!="function"?U[Q]:j&&ne?y(le,d):H&&$[Q]==le?function(Ee){var Pe=function(Ue,Ve,je){if(this instanceof Ee){switch(arguments.length){case 0:return new Ee;case 1:return new Ee(Ue);case 2:return new Ee(Ue,Ve)}return new Ee(Ue,Ve,je)}return Ee.apply(this,arguments)};return Pe[Y]=Ee[Y],Pe}(le):T&&typeof le=="function"?y(Function.call,le):le,T&&((ae.virtual||(ae.virtual={}))[Q]=le,D&N.R&&_e&&!_e[Q]&&A(_e,Q,le)))};N.F=1,N.G=2,N.S=4,N.P=8,N.B=16,N.W=32,N.U=64,N.R=128;var ee=N,oe=A,be={}.hasOwnProperty,ve=function(D,O){return be.call(D,O)},De=Math.ceil,we=Math.floor,Ie=function(D){return isNaN(D=+D)?0:(D>0?we:De)(D)},Rt=Math.min,wt=function(D){return D>0?Rt(Ie(D),9007199254740991):0},tt=Math.max,Jt=Math.min,In=function(D,O){return D=Ie(D),D<0?tt(D+O,0):Jt(D,O)},nn=function(D){return function(O,U,J){for(var Z=f(O),X=wt(Z.length),T=In(J,X);X>T;T++)if(T in Z&&Z[T]===U)return T||0;return-1}},mn="__core-js_shared__",Pt=d[mn]||(d[mn]={}),Se=function(D){return Pt[D]||(Pt[D]={})},Je=0,An=Math.random(),Le=function(D){return"Symbol(".concat(D===void 0?"":D,")_",(++Je+An).toString(36))},$t=Se("keys"),xn=function(D){return $t[D]||($t[D]=Le(D))},Yt=nn(),st=xn("IE_PROTO"),Ln=function(D,O){var U=f(D),J=0,Z=[],X;for(X in U)X!=st&&ve(U,X)&&Z.push(X);for(;O.length>J;)ve(U,X=O[J++])&&(~Yt(Z,X)||Z.push(X));return Z},At="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),ut=Object.keys||function(O){return Ln(O,At)},or=k?Object.defineProperties:function(O,U){w(O);for(var J=ut(U),Z=J.length,X=0,T;Z>X;)V.f(O,T=J[X++],U[T]);return O},ss=d.document&&document.documentElement,pa=xn("IE_PROTO"),Ur=function(){},Ts="prototype",ar=function(){var D=R("iframe"),O=At.length,U="<",J=">",Z;for(D.style.display="none",ss.appendChild(D),D.src="javascript:",Z=D.contentWindow.document,Z.open(),Z.write(U+"script"+J+"document.F=Object"+U+"/script"+J),Z.close(),ar=Z.F;O--;)delete ar[Ts][At[O]];return ar()},Sn=Object.create||function(O,U){var J;return O!==null?(Ur[Ts]=w(O),J=new Ur,Ur[Ts]=null,J[pa]=O):J=ar(),U===void 0?J:or(J,U)},Dt=i(function(D){var O=Se("wks"),U=d.Symbol,J=typeof U=="function",Z=D.exports=function(X){return O[X]||(O[X]=J&&U[X]||(J?U:Le)("Symbol."+X))};Z.store=O}),os=V.f,as=Dt("toStringTag"),Sr=function(D,O,U){D&&!ve(D=U?D:D.prototype,as)&&os(D,as,{configurable:!0,value:O})},Ti={};A(Ti,Dt("iterator"),function(){return this});var us=function(D,O,U){D.prototype=Sn(Ti,{next:F(1,U)}),Sr(D,O+" Iterator")},fi=function(D){return Object(c(D))},ls=xn("IE_PROTO"),Ms=Object.prototype,ko=Object.getPrototypeOf||function(D){return D=fi(D),ve(D,ls)?D[ls]:typeof D.constructor=="function"&&D instanceof D.constructor?D.constructor.prototype:D instanceof Object?Ms:null},ga=Dt("iterator"),xo=!([].keys&&"next"in[].keys()),ur="@@iterator",Os="keys",cs="values",fs=function(){return this},So=function(D,O,U,J,Z,X,T){us(U,O,J);var j=function(Ve){if(!xo&&Ve in $)return $[Ve];switch(Ve){case Os:return function(){return new U(this,Ve)};case cs:return function(){return new U(this,Ve)}}return function(){return new U(this,Ve)}},H=O+" Iterator",ae=Z==cs,_e=!1,$=D.prototype,Q=$[ga]||$[ur]||Z&&$[Z],ne=Q||j(Z),le=Z?ae?j("entries"):ne:void 0,Ee=O=="Array"&&$.entries||Q,Pe,Ue;return Ee&&(Ue=ko(Ee.call(new D)),Ue!==Object.prototype&&Sr(Ue,H,!0)),ae&&Q&&Q.name!==cs&&(_e=!0,ne=function(){return Q.call(this)}),o[O]=ne,o[H]=fs,Z&&(Pe={values:ae?ne:j(cs),keys:j(Os),entries:le},ee(ee.P+ee.F*(xo||_e),O,Pe)),Pe};So(Array,"Array",function(D,O){this._t=f(D),this._i=0,this._k=O},function(){var D=this._t,O=this._k,U=this._i++;return!D||U>=D.length?(this._t=void 0,s(1)):O=="keys"?s(0,U):O=="values"?s(0,D[U]):s(0,[U,D[U]])},"values"),o.Arguments=o.Array;for(var hs=Dt("toStringTag"),Co=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],Cr=0;Cr<5;Cr++){var Hr=Co[Cr],Eo=d[Hr],Mi=Eo&&Eo.prototype;Mi&&!Mi[hs]&&A(Mi,hs,Hr),o[Hr]=o.Array}var Oi=function(D){return function(O,U){var J=String(c(O)),Z=Ie(U),X=J.length,T,j;return Z<0||Z>=X?"":(T=J.charCodeAt(Z),T<55296||T>56319||Z+1===X||(j=J.charCodeAt(Z+1))<56320||j>57343?J.charAt(Z):J.slice(Z,Z+2))}},ds=Oi();So(String,"String",function(D){this._t=String(D),this._i=0},function(){var D=this._t,O=this._i,U;return O>=D.length?{value:void 0,done:!0}:(U=ds(D,O),this._i+=U.length,{value:U,done:!1})});var L=Dt("toStringTag"),Xt=u(function(){return arguments}())=="Arguments",Zt=function(D,O){try{return D[O]}catch{}},qe=function(D){var O,U,J;return D===void 0?"Undefined":D===null?"Null":typeof(U=Zt(O=Object(D),L))=="string"?U:Xt?u(O):(J=u(O))=="Object"&&typeof O.callee=="function"?"Arguments":J},W=Dt("iterator"),de=g.isIterable=function(D){var O=Object(D);return O[W]!==void 0||"@@iterator"in O||o.hasOwnProperty(qe(O))},ke=de,Oe=i(function(D){D.exports={default:ke,__esModule:!0}});r(Oe);var _t=Dt("iterator"),bt=g.getIteratorMethod=function(D){if(D!=null)return D[_t]||D["@@iterator"]||o[qe(D)]},Wt=g.getIterator=function(D){var O=bt(D);if(typeof O!="function")throw TypeError(D+" is not iterable!");return w(O.call(D))},Qt=Wt,nt=i(function(D){D.exports={default:Qt,__esModule:!0}});r(nt);var Ft=i(function(D,O){O.__esModule=!0;var U=Z(Oe),J=Z(nt);function Z(X){return X&&X.__esModule?X:{default:X}}O.default=function(){function X(T,j){var H=[],ae=!0,_e=!1,$=void 0;try{for(var Q=(0,J.default)(T),ne;!(ae=(ne=Q.next()).done)&&(H.push(ne.value),!(j&&H.length===j));ae=!0);}catch(le){_e=!0,$=le}finally{try{!ae&&Q.return&&Q.return()}finally{if(_e)throw $}}return H}return function(T,j){if(Array.isArray(T))return T;if((0,U.default)(Object(T)))return X(T,j);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}()}),rt=r(Ft),zt=i(function(D,O){O.__esModule=!0,O.default=function(U,J){if(!(U instanceof J))throw new TypeError("Cannot call a class as a function")}}),sn=r(zt);ee(ee.S+ee.F*!k,"Object",{defineProperty:V.f});var Hn=g.Object,Zc=function(O,U,J){return Hn.defineProperty(O,U,J)},hp=i(function(D){D.exports={default:Zc,__esModule:!0}});r(hp);var rv=i(function(D,O){O.__esModule=!0;var U=J(hp);function J(Z){return Z&&Z.__esModule?Z:{default:Z}}O.default=function(){function Z(X,T){for(var j=0;j<T.length;j++){var H=T[j];H.enumerable=H.enumerable||!1,H.configurable=!0,"value"in H&&(H.writable=!0),(0,U.default)(X,H.key,H)}}return function(X,T,j){return T&&Z(X.prototype,T),j&&Z(X,j),X}}()}),uu=r(rv);function bl(D,O,U){var J=void 0,Z=void 0;return D.allocate(O,function(X){var T=X.counter,j=X.changed,H=X.tree;O=T,J=j,Z=H},U),[O,J,Z]}function wl(D,O,U){var J=void 0,Z=void 0;return D.deallocate(O,function(X){var T=X.changed,j=X.tree;J=T,Z=j},U),[J,Z]}function Qc(D,O){var U=void 0;return D.check(O,function(J){U=J}),!!U}var dp=function(D,O){var U=(g.Object||{})[D]||Object[D],J={};J[D]=O(U),ee(ee.S+ee.F*S(function(){U(1)}),"Object",J)};dp("keys",function(){return function(O){return ut(fi(O))}});var iv=g.Object.keys,sv=i(function(D){D.exports={default:iv,__esModule:!0}}),pp=r(sv);dp("getPrototypeOf",function(){return function(O){return ko(fi(O))}});var gp=g.Object.getPrototypeOf,mp=i(function(D){D.exports={default:gp,__esModule:!0}}),_l=r(mp),ov=Dt,kl={f:ov},xl=kl.f("iterator"),ef=i(function(D){D.exports={default:xl,__esModule:!0}});r(ef);var Ps=i(function(D){var O=Le("meta"),U=V.f,J=0,Z=Object.isExtensible||function(){return!0},X=!S(function(){return Z(Object.preventExtensions({}))}),T=function($){U($,O,{value:{i:"O"+ ++J,w:{}}})},j=function($,Q){if(!b($))return typeof $=="symbol"?$:(typeof $=="string"?"S":"P")+$;if(!ve($,O)){if(!Z($))return"F";if(!Q)return"E";T($)}return $[O].i},H=function($,Q){if(!ve($,O)){if(!Z($))return!0;if(!Q)return!1;T($)}return $[O].w},ae=function($){return X&&_e.NEED&&Z($)&&!ve($,O)&&T($),$},_e=D.exports={KEY:O,NEED:!1,fastKey:j,getWeak:H,onFreeze:ae}});Ps.KEY,Ps.NEED,Ps.fastKey,Ps.getWeak,Ps.onFreeze;var vp=V.f,Sl=function(D){var O=g.Symbol||(g.Symbol={});D.charAt(0)!="_"&&!(D in O)&&vp(O,D,{value:kl.f(D)})},tf=function(D,O){for(var U=f(D),J=ut(U),Z=J.length,X=0,T;Z>X;)if(U[T=J[X++]]===O)return T},av=Object.getOwnPropertySymbols,nf={f:av},rf={}.propertyIsEnumerable,lu={f:rf},ma=function(D){var O=ut(D),U=nf.f;if(U)for(var J=U(D),Z=lu.f,X=0,T;J.length>X;)Z.call(D,T=J[X++])&&O.push(T);return O},Cl=Array.isArray||function(O){return u(O)=="Array"},yp=At.concat("length","prototype"),uv=Object.getOwnPropertyNames||function(O){return Ln(O,yp)},sf={f:uv},of=sf.f,bp={}.toString,af=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],lv=function(D){try{return of(D)}catch{return af.slice()}},cv=function(O){return af&&bp.call(O)=="[object Window]"?lv(O):of(f(O))},wp={f:cv},uf=Object.getOwnPropertyDescriptor,fv=k?uf:function(O,U){if(O=f(O),U=q(U),P)try{return uf(O,U)}catch{}if(ve(O,U))return F(!lu.f.call(O,U),O[U])},lf={f:fv},hv=Ps.KEY,_p=lf.f,ps=V.f,kp=wp.f,lr=d.Symbol,El=d.JSON,Rl=El&&El.stringify,Is="prototype",Xe=Dt("_hidden"),Tt=Dt("toPrimitive"),dv={}.propertyIsEnumerable,Al=Se("symbol-registry"),gs=Se("symbols"),cu=Se("op-symbols"),hi=Object[Is],va=typeof lr=="function",Dl=d.QObject,cf=!Dl||!Dl[Is]||!Dl[Is].findChild,vn=k&&S(function(){return Sn(ps({},"a",{get:function(){return ps(this,"a",{value:7}).a}})).a!=7})?function(D,O,U){var J=_p(hi,O);J&&delete hi[O],ps(D,O,U),J&&D!==hi&&ps(hi,O,J)}:ps,Tl=function(D){var O=gs[D]=Sn(lr[Is]);return O._k=D,O},ms=va&&typeof lr.iterator=="symbol"?function(D){return typeof D=="symbol"}:function(D){return D instanceof lr},fu=function(O,U,J){return O===hi&&fu(cu,U,J),w(O),U=q(U),w(J),ve(gs,U)?(J.enumerable?(ve(O,Xe)&&O[Xe][U]&&(O[Xe][U]=!1),J=Sn(J,{enumerable:F(0,!1)})):(ve(O,Xe)||ps(O,Xe,F(1,{})),O[Xe][U]=!0),vn(O,U,J)):ps(O,U,J)},Ml=function(O,U){w(O);for(var J=ma(U=f(U)),Z=0,X=J.length,T;X>Z;)fu(O,T=J[Z++],U[T]);return O},Vr=function(O,U){return U===void 0?Sn(O):Ml(Sn(O),U)},xp=function(O){var U=dv.call(this,O=q(O));return this===hi&&ve(gs,O)&&!ve(cu,O)?!1:U||!ve(this,O)||!ve(gs,O)||ve(this,Xe)&&this[Xe][O]?U:!0},ff=function(O,U){if(O=f(O),U=q(U),!(O===hi&&ve(gs,U)&&!ve(cu,U))){var J=_p(O,U);return J&&ve(gs,U)&&!(ve(O,Xe)&&O[Xe][U])&&(J.enumerable=!0),J}},hf=function(O){for(var U=kp(f(O)),J=[],Z=0,X;U.length>Z;)!ve(gs,X=U[Z++])&&X!=Xe&&X!=hv&&J.push(X);return J},df=function(O){for(var U=O===hi,J=kp(U?cu:f(O)),Z=[],X=0,T;J.length>X;)ve(gs,T=J[X++])&&(!U||ve(hi,T))&&Z.push(gs[T]);return Z};va||(lr=function(){if(this instanceof lr)throw TypeError("Symbol is not a constructor!");var O=Le(arguments.length>0?arguments[0]:void 0),U=function(J){this===hi&&U.call(cu,J),ve(this,Xe)&&ve(this[Xe],O)&&(this[Xe][O]=!1),vn(this,O,F(1,J))};return k&&cf&&vn(hi,O,{configurable:!0,set:U}),Tl(O)},oe(lr[Is],"toString",function(){return this._k}),lf.f=ff,V.f=fu,sf.f=wp.f=hf,lu.f=xp,nf.f=df,kl.f=function(D){return Tl(Dt(D))}),ee(ee.G+ee.W+ee.F*!va,{Symbol:lr});for(var ya="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ba=0;ya.length>ba;)Dt(ya[ba++]);for(var ya=ut(Dt.store),ba=0;ya.length>ba;)Sl(ya[ba++]);ee(ee.S+ee.F*!va,"Symbol",{for:function(D){return ve(Al,D+="")?Al[D]:Al[D]=lr(D)},keyFor:function(O){if(ms(O))return tf(Al,O);throw TypeError(O+" is not a symbol!")},useSetter:function(){cf=!0},useSimple:function(){cf=!1}}),ee(ee.S+ee.F*!va,"Object",{create:Vr,defineProperty:fu,defineProperties:Ml,getOwnPropertyDescriptor:ff,getOwnPropertyNames:hf,getOwnPropertySymbols:df}),El&&ee(ee.S+ee.F*(!va||S(function(){var D=lr();return Rl([D])!="[null]"||Rl({a:D})!="{}"||Rl(Object(D))!="{}"})),"JSON",{stringify:function(O){if(!(O===void 0||ms(O))){for(var U=[O],J=1,Z,X;arguments.length>J;)U.push(arguments[J++]);return Z=U[1],typeof Z=="function"&&(X=Z),(X||!Cl(Z))&&(Z=function(T,j){if(X&&(j=X.call(this,T,j)),!ms(j))return j}),U[1]=Z,Rl.apply(El,U)}}}),lr[Is][Tt]||A(lr[Is],Tt,lr[Is].valueOf),Sr(lr,"Symbol"),Sr(Math,"Math",!0),Sr(d.JSON,"JSON",!0),Sl("asyncIterator"),Sl("observable");var Er=g.Symbol,Sp=i(function(D){D.exports={default:Er,__esModule:!0}});r(Sp);var cr=i(function(D,O){O.__esModule=!0;var U=X(ef),J=X(Sp),Z=typeof J.default=="function"&&typeof U.default=="symbol"?function(T){return typeof T}:function(T){return T&&typeof J.default=="function"&&T.constructor===J.default&&T!==J.default.prototype?"symbol":typeof T};function X(T){return T&&T.__esModule?T:{default:T}}O.default=typeof J.default=="function"&&Z(U.default)==="symbol"?function(T){return typeof T>"u"?"undefined":Z(T)}:function(T){return T&&typeof J.default=="function"&&T.constructor===J.default&&T!==J.default.prototype?"symbol":typeof T>"u"?"undefined":Z(T)}});r(cr);var pv=i(function(D,O){O.__esModule=!0;var U=J(cr);function J(Z){return Z&&Z.__esModule?Z:{default:Z}}O.default=function(Z,X){if(!Z)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return X&&((typeof X>"u"?"undefined":(0,U.default)(X))==="object"||typeof X=="function")?X:Z}}),pf=r(pv),Ls=function(D,O){if(w(D),!b(O)&&O!==null)throw TypeError(O+": can't set as prototype!")},Ol={set:Object.setPrototypeOf||("__proto__"in{}?function(D,O,U){try{U=y(Function.call,lf.f(Object.prototype,"__proto__").set,2),U(D,[]),O=!(D instanceof Array)}catch{O=!0}return function(Z,X){return Ls(Z,X),O?Z.__proto__=X:U(Z,X),Z}}({},!1):void 0)};ee(ee.S,"Object",{setPrototypeOf:Ol.set});var gf=g.Object.setPrototypeOf,Nt=i(function(D){D.exports={default:gf,__esModule:!0}});r(Nt),ee(ee.S,"Object",{create:Sn});var Fs=g.Object,mf=function(O,U){return Fs.create(O,U)},Cp=i(function(D){D.exports={default:mf,__esModule:!0}});r(Cp);var vf=i(function(D,O){O.__esModule=!0;var U=X(Nt),J=X(Cp),Z=X(cr);function X(T){return T&&T.__esModule?T:{default:T}}O.default=function(T,j){if(typeof j!="function"&&j!==null)throw new TypeError("Super expression must either be null or a function, not "+(typeof j>"u"?"undefined":(0,Z.default)(j)));T.prototype=(0,J.default)(j&&j.prototype,{constructor:{value:T,enumerable:!1,writable:!0,configurable:!0}}),j&&(U.default?(0,U.default)(T,j):T.__proto__=j)}}),Ep=r(vf),gv=i(function(D,O){/**
|
|
8
|
-
* @license BitSet.js v5.0.3 4/3/2018
|
|
9
|
-
* http://www.xarg.org/2014/03/javascript-bit-array/
|
|
10
|
-
*
|
|
11
|
-
* Copyright (c) 2016, Robert Eisele (robert@xarg.org)
|
|
12
|
-
* Dual licensed under the MIT or GPL Version 2 licenses.
|
|
13
|
-
**/(function(U){var J=32,Z=5;function X($){return $-=$>>>1&1431655765,$=($&858993459)+($>>>2&858993459),($+($>>>4)&252645135)*16843009>>>24}function T($,Q){for(var ne=0,le=0;le<$.length;le++){ne*=2;var Ee=($[le]+ne)/Q|0;ne=($[le]+ne)%Q,$[le]=Ee}return ne}function j($,Q){if(Q==null){$.data=[0,0,0,0,0,0,0,0,0,0],$._=0;return}if(Q instanceof H){$.data=Q.data,$._=Q._;return}switch(typeof Q){case"number":$.data=[Q|0],$._=0;break;case"string":var ne=2,le=J;Q.indexOf("0b")===0?Q=Q.substr(2):Q.indexOf("0x")===0&&(Q=Q.substr(2),ne=16,le=8),$.data=[],$._=0;var Ee=Q.length-le,Pe=Q.length;do{var Ue=parseInt(Q.slice(Ee>0?Ee:0,Pe),ne);if(isNaN(Ue))throw SyntaxError("Invalid param");if($.data.push(Ue|0),Ee<=0)break;Ee-=le,Pe-=le}while(!0);break;default:$.data=[0];var Ve=$.data;if(Q instanceof Array){for(var je=Q.length-1;je>=0;je--){var Ut=Q[je];Ut===1/0?$._=-1:(ae($,Ut),Ve[Ut>>>Z]|=1<<Ut)}break}if(Uint8Array&&Q instanceof Uint8Array){var yn=8;ae($,Q.length*yn);for(var je=0;je<Q.length;je++)for(var lt=Q[je],Ao=0;Ao<yn;Ao++){var Cf=je*yn+Ao;Ve[Cf>>>Z]|=(lt>>Ao&1)<<Cf}break}throw SyntaxError("Invalid param")}}function H($){if(!(this instanceof H))return new H($);j(this,$),this.data=this.data.slice()}function ae($,Q){for(var ne=Q>>>Z,le=$.data,Ee=$._,Pe=le.length;ne>=Pe;ne--)le.push(Ee)}var _e={data:[],_:0};H.prototype={data:[],_:0,set:function($,Q){return $|=0,ae(this,$),Q===void 0||Q?this.data[$>>>Z]|=1<<$:this.data[$>>>Z]&=~(1<<$),this},get:function($){$|=0;var Q=this.data,ne=$>>>Z;return ne>Q.length?this._&1:Q[ne]>>>$&1},not:function(){for(var $=this.clone(),Q=$.data,ne=0;ne<Q.length;ne++)Q[ne]=~Q[ne];return $._=~$._,$},and:function($){j(_e,$);var Q=this.clone(),ne=Q.data,le=_e.data,Ee=le.length,Pe=_e._,Ue=Q._;Ue!==0&&ae(Q,Ee*J-1);for(var Ve=ne.length,je=Math.min(Ee,Ve),Ut=0;Ut<je;Ut++)ne[Ut]&=le[Ut];for(;Ut<Ve;Ut++)ne[Ut]&=Pe;return Q._&=Pe,Q},or:function($){j(_e,$);for(var Q=this.clone(),ne=Q.data,le=_e.data,Ee=le.length-1,Pe=ne.length-1,Ue=Math.min(Pe,Ee),Ve=Ee;Ve>Ue;Ve--)ne[Ve]=le[Ve];for(;Ve>=0;Ve--)ne[Ve]|=le[Ve];return Q._|=_e._,Q},xor:function($){j(_e,$);var Q=this.clone(),ne=Q.data,le=_e.data,Ee=Q._,Pe=_e._,Ue=0,Ve=ne.length-1,je=le.length-1;for(Ue=Ve;Ue>je;Ue--)ne[Ue]^=Pe;for(Ue=je;Ue>Ve;Ue--)ne[Ue]=Ee^le[Ue];for(;Ue>=0;Ue--)ne[Ue]^=le[Ue];return Q._^=Pe,Q},andNot:function($){return this.and(new H($).flip())},flip:function($,Q){if($===void 0){for(var ne=this.data,le=0;le<ne.length;le++)ne[le]=~ne[le];this._=~this._}else if(Q===void 0)ae(this,$),this.data[$>>>Z]^=1<<$;else if(0<=$&&$<=Q){ae(this,Q);for(var le=$;le<=Q;le++)this.data[le>>>Z]^=1<<le}return this},clear:function($,Q){var ne=this.data;if($===void 0){for(var le=ne.length-1;le>=0;le--)ne[le]=0;this._=0}else if(Q===void 0)$|=0,ae(this,$),ne[$>>>Z]&=~(1<<$);else if($<=Q){ae(this,Q);for(var le=$;le<=Q;le++)ne[le>>>Z]&=~(1<<le)}return this},slice:function($,Q){if($===void 0)return this.clone();if(Q===void 0){Q=this.data.length*J;var ne=Object.create(H.prototype);ne._=this._,ne.data=[0];for(var le=$;le<=Q;le++)ne.set(le-$,this.get(le));return ne}else if($<=Q&&0<=$){var ne=Object.create(H.prototype);ne.data=[0];for(var le=$;le<=Q;le++)ne.set(le-$,this.get(le));return ne}return null},setRange:function($,Q,ne){for(var le=$;le<=Q;le++)this.set(le,ne);return this},clone:function(){var $=Object.create(H.prototype);return $.data=this.data.slice(),$._=this._,$},toArray:Math.clz32?function(){for(var $=[],Q=this.data,ne=Q.length-1;ne>=0;ne--)for(var le=Q[ne];le!==0;){var Ee=31-Math.clz32(le);le^=1<<Ee,$.unshift(ne*J+Ee)}return this._!==0&&$.push(1/0),$}:function(){for(var $=[],Q=this.data,ne=0;ne<Q.length;ne++)for(var le=Q[ne];le!==0;){var Ee=le&-le;le^=Ee,$.push(ne*J+X(Ee-1))}return this._!==0&&$.push(1/0),$},toString:function($){var Q=this.data;if($||($=2),($&$-1)===0&&$<36){for(var ne="",le=2+Math.log(4294967295)/Math.log($)|0,Ee=Q.length-1;Ee>=0;Ee--){var Pe=Q[Ee];Pe<0&&(Pe+=4294967296);var Ue=Pe.toString($);ne!==""&&(ne+="0".repeat(le-Ue.length-1)),ne+=Ue}return this._===0?(ne=ne.replace(/^0+/,""),ne===""&&(ne="0"),ne):(ne="1111"+ne,ne.replace(/^1+/,"...1111"))}else{if(2>$||$>36)throw SyntaxError("Invalid base");for(var ne=[],Ve=[],Ee=Q.length;Ee--;)for(var je=J;je--;)Ve.push(Q[Ee]>>>je&1);do ne.unshift(T(Ve,$).toString($));while(!Ve.every(function(yn){return yn===0}));return ne.join("")}},isEmpty:function(){if(this._!==0)return!1;for(var $=this.data,Q=$.length-1;Q>=0;Q--)if($[Q]!==0)return!1;return!0},cardinality:function(){if(this._!==0)return 1/0;for(var $=0,Q=this.data,ne=0;ne<Q.length;ne++){var le=Q[ne];le!==0&&($+=X(le))}return $},msb:Math.clz32?function(){if(this._!==0)return 1/0;for(var $=this.data,Q=$.length;Q-- >0;){var ne=Math.clz32($[Q]);if(ne!==J)return Q*J+J-1-ne}return 1/0}:function(){if(this._!==0)return 1/0;for(var $=this.data,Q=$.length;Q-- >0;){var ne=$[Q],le=0;if(ne){for(;(ne>>>=1)>0;le++);return Q*J+le}}return 1/0},ntz:function(){for(var $=this.data,Q=0;Q<$.length;Q++){var ne=$[Q];if(ne!==0)return ne=(ne^ne-1)>>>1,Q*J+X(ne)}return 1/0},lsb:function(){for(var $=this.data,Q=0;Q<$.length;Q++){var ne=$[Q],le=0;if(ne){for(var Ee=ne&-ne;Ee>>>=1;le++);return J*Q+le}}return this._&1},equals:function($){j(_e,$);var Q=this.data,ne=_e.data,le=this._,Ee=_e._,Pe=Q.length-1,Ue=ne.length-1;if(Ee!==le)return!1;for(var Ve=Pe<Ue?Pe:Ue,je=0;je<=Ve;je++)if(Q[je]!==ne[je])return!1;for(je=Pe;je>Ue;je--)if(Q[je]!==Ee)return!1;for(je=Ue;je>Pe;je--)if(ne[je]!==le)return!1;return!0}},H.fromBinaryString=function($){return new H("0b"+$)},H.fromHexString=function($){return new H("0x"+$)},H.Random=function($){($===void 0||$<0)&&($=J);for(var Q=$%J,ne=[],le=Math.ceil($/J),Ee=Object.create(H.prototype),Pe=0;Pe<le;Pe++)ne.push(Math.random()*4294967296|0);return Q>0&&(ne[le-1]&=(1<<Q)-1),Ee.data=ne,Ee._=0,Ee},Object.defineProperty(O,"__esModule",{value:!0}),H.default=H,H.BitSet=H,D.exports=H})()}),mv=r(gv);function Rp(D){return new mv(new Uint8Array(D/8-1)).flip(0,D-1)}function di(D,O){return D.set(O,0)}function Pi(D,O){return D.set(O,1)}function Ro(D){return D.isEmpty()}function Ap(D,O){return D.cardinality()===O}function yf(D){var O=D.ntz();return O===1/0&&(O=null),O}function hu(D,O){return!D.get(O)}var Pl=function D(O,U,J,Z,X){sn(this,D),this.blockSize=O,this.shrink=U,this.begin=J,this.depth=Z,this.bitMap=X||Rp(O)},du=function(D){Ep(O,D);function O(U,J,Z,X){return sn(this,O),pf(this,(O.__proto__||_l(O)).call(this,U,J,Z,0,X))}return uu(O,[{key:"allocate",value:function(J,Z,X){var T=void 0;if(J==null?T=yf(this.bitMap):T=J-this.begin,T!==null&&T<this.blockSize)if(hu(this.bitMap,T))Z({counter:this.begin+T,changed:!1,bitMap:this.bitMap,tree:this});else{var j=void 0,H=void 0;!X||X.has(this)?(j=this.bitMap,di(j,T),H=this):(j=this.bitMap.clone(),di(j,T),H=new O(this.blockSize,this.shrink,this.begin,j),X.add(H)),Z({counter:this.begin+T,changed:!0,bitMap:j,tree:H})}else{var ae=new vv(this.blockSize,this.shrink,this.begin,this.depth+1);X&&(X.add(ae),X.add(ae.bitMap)),ae.bitMapTrees[0]=this,Ro(this.bitMap)&&di(ae.bitMap,0),ae.allocate(J,Z,X)}}},{key:"deallocate",value:function(J,Z,X){var T=J-this.begin;if(T>=0&&T<this.blockSize)if(hu(this.bitMap,T)){var j=void 0,H=void 0;!X||X.has(this)?(j=this.bitMap,Pi(j,T),H=this):(j=this.bitMap.clone(),Pi(j,T),H=new O(this.blockSize,this.shrink,this.begin,j),X.add(H)),Z({exists:!0,changed:!0,bitMap:j,tree:H})}else Z({exists:!0,changed:!1,bitMap:this.bitMap,tree:this});else Z({exists:!1,changed:!1,bitMap:this.bitMap,tree:this})}},{key:"check",value:function(J,Z){var X=J-this.begin;X>=0&&X<this.blockSize?hu(this.bitMap,X)?Z(!0):Z(!1):Z(null)}}]),O}(Pl),vv=function(D){Ep(O,D);function O(U,J,Z,X,T,j){sn(this,O);var H=pf(this,(O.__proto__||_l(O)).call(this,U,J,Z,X,T));return H.bitMapTrees=j||[],H}return uu(O,[{key:"allocate",value:function(J,Z,X){var T=this,j=void 0;if(J==null?j=yf(this.bitMap):j=Math.floor((J-this.begin)/Math.pow(this.blockSize,this.depth)),j!=null&&this.bitMapTrees[j]){var H=j;this.bitMapTrees[j].allocate(J,function(Pe){var Ue=Pe.counter,Ve=Pe.changed,je=Pe.bitMap,Ut=Pe.tree,yn=T.bitMap,lt=T;if(Ve){if(!X&&Ro(je))di(yn,H);else if(X&&X.has(T))Ro(je)&&(X.has(T.bitMap)||(yn=T.bitMap.clone(),X.add(yn),T.bitMap=yn),di(yn,H)),lt.bitMapTrees[H]=Ut;else if(X){Ro(je)&&(yn=T.bitMap.clone(),X.add(yn),di(yn,H));var Ao=T.bitMapTrees.slice();Ao[H]=Ut,lt=new O(T.blockSize,T.shrink,T.begin,T.depth,yn,Ao),X.add(lt)}}Z({counter:Ue,changed:Ve,bitMap:yn,tree:lt})},X)}else if(j===null||j>=this.blockSize){var ae=new O(this.blockSize,this.shrink,this.begin,this.depth+1);X&&(X.add(ae),X.add(ae.bitMap)),ae.bitMapTrees[0]=this,Ro(this.bitMap)&&di(ae.bitMap,0),ae.allocate(J,Z,X)}else{var _e=this.begin+j*Math.pow(this.blockSize,this.depth),$=this.depth-1,Q=void 0;$===0?Q=new du(this.blockSize,this.shrink,_e):Q=new O(this.blockSize,this.shrink,_e,$),X&&(X.add(Q),X.add(Q.bitMap));var ne=void 0;if(!X||X.has(this))this.bitMapTrees[j]=Q,ne=this;else{var le=this.bitMapTrees.slice();le[j]=Q,ne=new O(this.blockSize,this.shrink,this.begin,this.depth,this.bitMap,le),X.add(ne)}var Ee=j;Q.allocate(J,function(Pe){var Ue=Pe.counter,Ve=Pe.changed,je=Pe.bitMap;Pe.tree;var Ut=T.bitMap;je&&Ro(je)&&(X&&!X.has(T.bitMap)&&(Ut=T.bitMap.clone(),X.add(Ut),ne.bitMap=Ut),di(Ut,Ee)),Z({counter:Ue,changed:Ve,bitMap:Ut,tree:ne})},X)}}},{key:"deallocate",value:function(J,Z,X){var T=this,j=Math.floor((J-this.begin)/Math.pow(this.blockSize,this.depth));if(this.bitMapTrees[j]){var H=Ro(this.bitMapTrees[j].bitMap);this.bitMapTrees[j].deallocate(J,function(ae){var _e=ae.exists,$=ae.changed,Q=ae.bitMap,ne=ae.tree,le=T.bitMap,Ee=T;if(!_e)Z({exists:_e,changed:$,bitMap:le,tree:Ee});else{if($){if(!X&&H)Pi(le,j);else if(X&&X.has(T))H&&(X.has(T.bitMap)||(le=T.bitMap.clone(),X.add(le),T.bitMap=le),Pi(le,j)),Ee.bitMapTrees[j]=ne;else if(X){H&&(le=T.bitMap.clone(),X.add(le),Pi(le,j));var Pe=T.bitMapTrees.slice();Pe[j]=ne,Ee=new O(T.blockSize,T.shrink,T.begin,T.depth,le,Pe),X.add(Ee)}T.shrink&&(ne instanceof du&&Ap(Q,T.blockSize)||ne instanceof O&&pp(ne.bitMapTrees).length===0)&&delete Ee.bitMapTrees[j]}Z({exists:!0,changed:$,bitMap:le,tree:Ee})}},X)}else Z({exists:!1,changed:!1,bitMap:this.bitMap,tree:this})}},{key:"check",value:function(J,Z){var X=Math.floor((J-this.begin)/Math.pow(this.blockSize,this.depth));this.bitMapTrees[X]?this.bitMapTrees[X].check(J,function(T){Z(T)}):Z(null)}}]),O}(Pl),bf=function(){function D(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:32,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,Z=arguments[3];if(sn(this,D),U%32!==0)throw new RangeError("Blocksize for Counter must be a multiple of 32");this._begin=O,this._tree=Z||new du(U,J,0)}return uu(D,[{key:"allocate",value:function(U){if(U!=null){if(U<this._begin)throw new RangeError("counter needs to be greater or equal to the beginning offset");U=U-this._begin}var J=bl(this._tree,U),Z=rt(J,3),X=Z[0],T=Z[1],j=Z[2];return this._tree=j,U==null?X+this._begin:T}},{key:"deallocate",value:function(U){var J=wl(this._tree,U-this._begin),Z=rt(J,2),X=Z[0],T=Z[1];return this._tree=T,X}},{key:"check",value:function(U){return Qc(this._tree,U-this._begin)}}]),D}(),Il=function(D,O,U){for(var J in O)A(D,J,O[J]);return D},wf=function(D,O,U,J){if(!(D instanceof O)||J!==void 0&&J in D)throw TypeError(U+": incorrect invocation!");return D},Dp=function(D,O,U,J){try{return J?O(w(U)[0],U[1]):O(U)}catch(X){var Z=D.return;throw Z!==void 0&&w(Z.call(D)),X}},Rr=Dt("iterator"),_f=Array.prototype,pu=function(D){return D!==void 0&&(o.Array===D||_f[Rr]===D)},kf=i(function(D){var O={},U={},J=D.exports=function(Z,X,T,j,H){var ae=H?function(){return Z}:bt(Z),_e=y(T,j,X?2:1),$=0,Q,ne,le,Ee;if(typeof ae!="function")throw TypeError(Z+" is not iterable!");if(pu(ae)){for(Q=wt(Z.length);Q>$;$++)if(Ee=X?_e(w(ne=Z[$])[0],ne[1]):_e(Z[$]),Ee===O||Ee===U)return Ee}else for(le=ae.call(Z);!(ne=le.next()).done;)if(Ee=Dp(le,_e,ne.value,X),Ee===O||Ee===U)return Ee};J.BREAK=O,J.RETURN=U}),Tp=Dt("species"),yv=function(D){var O;return Cl(D)&&(O=D.constructor,typeof O=="function"&&(O===Array||Cl(O.prototype))&&(O=void 0),b(O)&&(O=O[Tp],O===null&&(O=void 0))),O===void 0?Array:O},bv=function(D,O){return new(yv(D))(O)},xf=function(D,O){var U=D==1,J=D==2,Z=D==3,X=D==4,T=D==6,j=D==5||T,H=bv;return function(ae,_e,$){for(var Q=fi(ae),ne=l(Q),le=y(_e,$,3),Ee=wt(ne.length),Pe=0,Ue=U?H(ae,Ee):J?H(ae,0):void 0,Ve,je;Ee>Pe;Pe++)if((j||Pe in ne)&&(Ve=ne[Pe],je=le(Ve,Pe,Q),D)){if(U)Ue[Pe]=je;else if(je)switch(D){case 3:return!0;case 5:return Ve;case 6:return Pe;case 2:Ue.push(Ve)}else if(X)return!1}return T?-1:Z||X?X:Ue}},Sf=Ps.getWeak,wv=xf(5),wa=xf(6),_v=0,Ll=function(D){return D._l||(D._l=new Fl)},Fl=function(){this.a=[]},Nl=function(D,O){return wv(D.a,function(U){return U[0]===O})};Fl.prototype={get:function(D){var O=Nl(this,D);if(O)return O[1]},has:function(D){return!!Nl(this,D)},set:function(D,O){var U=Nl(this,D);U?U[1]=O:this.a.push([D,O])},delete:function(D){var O=wa(this.a,function(U){return U[0]===D});return~O&&this.a.splice(O,1),!!~O}};var vs={getConstructor:function(D,O,U,J){var Z=D(function(X,T){wf(X,Z,O,"_i"),X._i=_v++,X._l=void 0,T!=null&&kf(T,U,X[J],X)});return Il(Z.prototype,{delete:function(X){if(!b(X))return!1;var T=Sf(X);return T===!0?Ll(this).delete(X):T&&ve(T,this._i)&&delete T[this._i]},has:function(T){if(!b(T))return!1;var j=Sf(T);return j===!0?Ll(this).has(T):j&&ve(j,this._i)}}),Z},def:function(D,O,U){var J=Sf(w(O),!0);return J===!0?Ll(D).set(O,U):J[D._i]=U,D},ufstore:Ll},Bl=V.f,kv=xf(0),xv=function(D,O,U,J,Z,X){var T=d[D],j=T,H="add",ae=j&&j.prototype,_e={};return!k||typeof j!="function"?(j=J.getConstructor(O,D,Z,H),Il(j.prototype,U),Ps.NEED=!0):(j=O(function($,Q){wf($,j,D,"_c"),$._c=new T,Q!=null&&kf(Q,Z,$[H],$)}),kv("add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON".split(","),function($){var Q=$=="add"||$=="set";$ in ae&&$!="clear"&&A(j.prototype,$,function(ne,le){if(wf(this,j,$),!Q&&X&&!b(ne))return $=="get"?void 0:!1;var Ee=this._c[$](ne===0?0:ne,le);return Q?this:Ee})}),"size"in ae&&Bl(j.prototype,"size",{get:function(){return this._c.size}})),Sr(j,D),_e[D]=j,ee(ee.G+ee.W+ee.F,_e),j};xv("WeakSet",function(D){return function(){return D(this,arguments.length>0?arguments[0]:void 0)}},{add:function(O){return vs.def(this,O,!0)}},vs,!1,!0);var Sv=g.WeakSet,_a=i(function(D){D.exports={default:Sv,__esModule:!0}}),Ar=r(_a),Mp=function(){function D(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:32,J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,Z=arguments[3];if(sn(this,D),U%32!==0)throw new RangeError("Blocksize for Counter must be a multiple of 32");this._begin=O,this._blockSize=U,this._shrink=J,this._tree=Z||new du(U,J,0)}return uu(D,[{key:"allocate",value:function(U){if(U!=null){if(U<this._begin)throw new RangeError("counter needs to be greater or equal to the beginning offset");U=U-this._begin}var J=bl(this._tree,U,new Ar),Z=rt(J,3),X=Z[0],T=Z[1],j=Z[2],H=void 0;return T?H=new D(this._begin,this._blockSize,this._shrink,j):H=this,U==null?[X+this._begin,H]:[T,H]}},{key:"deallocate",value:function(U){var J=wl(this._tree,U-this._begin,new Ar),Z=rt(J,2),X=Z[0],T=Z[1],j=void 0;return X?j=new D(this._begin,this._blockSize,this._shrink,T):j=this,[X,j]}},{key:"check",value:function(U){return Qc(this._tree,U-this._begin)}},{key:"transaction",value:function(U){var J=this,Z=new Ar,X=this._tree,T=!1,j={allocate:function(ae){if(ae!=null){if(ae<J._begin)throw new RangeError("counter needs to be greater or equal to the beginning offset");ae=ae-J._begin}var _e=bl(X,ae,Z),$=rt(_e,3),Q=$[0],ne=$[1],le=$[2];return T=ne,X=le,ae==null?Q+J._begin:T},deallocate:function(ae){var _e=wl(X,ae-J._begin,Z),$=rt(_e,2),Q=$[0],ne=$[1];return T=Q,X=ne,T},check:function(ae){return Qc(X,ae-J._begin)}};return U(j),T?new D(this._begin,this._blockSize,this._shrink,X):this}}]),D}();t.default=bf,t.CounterImmutable=Mp,Object.defineProperty(t,"__esModule",{value:!0})})}),_m=Kt(gj),mj=12,km=20,L6=Math.pow(2,mj)-1,F6=Math.pow(2,km)-1,rw=0,iw=0,ic=function(n){la(e,n);function e(t,r){sr(this,e);var i=ua(this,(e.__proto__||Ht(e)).call(this,r));return i.code=t,i}return e}(Error);Object.defineProperty(ic,"ERROR_RANGE",{value:1});Object.defineProperty(ic,"ERROR_CONFLICT",{value:2});var z2=function(){function n(){sr(this,n),this._chrCounterMaj=new _m(rw),this._chrDevices=new od}return wr(n,[{key:"getChr",value:function(t,r){var i=this._chrDevices.get(t);if(i){var s=ei(i,1),o=s[0];return o.get(r)}}},{key:"registerChr",value:function(t,r,i){var s=void 0,o=void 0,a=void 0,u=void 0;try{if(r===void 0)r=this._chrCounterMaj.allocate(),s=r;else{var l=this._chrDevices.get(r);if(!l)this._chrCounterMaj.allocate(r),s=r;else{var c=ei(l,2);u=c[0],a=c[1]}}if((!u||!a)&&(a=new _m(iw),u=new od),i===void 0)i=a.allocate(),o=i;else if(!u.has(i))a.allocate(i),o=i;else throw new ic(ic.ERROR_CONFLICT);if(r>L6||r<rw||i>F6||i<iw)throw new ic(ic.ERROR_RANGE);u.set(i,t),this._chrDevices.set(r,[u,a]);return}catch(f){throw s!=null&&this._chrCounterMaj.deallocate(s),o!=null&&a&&a.deallocate(o),f}}},{key:"deregisterChr",value:function(t,r){var i=this._chrDevices.get(t);if(i){var s=ei(i,2),o=s[0],a=s[1];o.delete(r)&&a.deallocate(r),o.size||(this._chrDevices.delete(t),this._chrCounterMaj.deallocate(t))}}}]),n}();function vj(n,e){return n<<km|e}function N6(n){var e=n>>km,t=n&(1<<km)-1;return[e,t]}var Ty=Qi.getWeak,yj=T1(5),bj=T1(6),wj=0,y0=function(n){return n._l||(n._l=new B6)},B6=function(){this.a=[]},My=function(n,e){return yj(n.a,function(t){return t[0]===e})};B6.prototype={get:function(n){var e=My(this,n);if(e)return e[1]},has:function(n){return!!My(this,n)},set:function(n,e){var t=My(this,n);t?t[1]=e:this.a.push([n,e])},delete:function(n){var e=bj(this.a,function(t){return t[0]===n});return~e&&this.a.splice(e,1),!!~e}};var b0={getConstructor:function(n,e,t,r){var i=n(function(s,o){sd(s,i,e,"_i"),s._t=e,s._i=wj++,s._l=void 0,o!=null&&Za(o,t,s[r],s)});return D1(i.prototype,{delete:function(s){if(!Mn(s))return!1;var o=Ty(s);return o===!0?y0(Ci(this,e)).delete(s):o&&Ot(o,this._i)&&delete o[this._i]},has:function(o){if(!Mn(o))return!1;var a=Ty(o);return a===!0?y0(Ci(this,e)).has(o):a&&Ot(a,this._i)}}),i},def:function(n,e,t){var r=Ty(br(e),!0);return r===!0?y0(n).set(e,t):r[n._i]=t,n},ufstore:y0};ft(function(n){var e=T1(0),t=Ci,r=!Ge.ActiveXObject&&"ActiveXObject"in Ge,i="WeakMap",s=Qi.getWeak,o=Object.isExtensible,a=b0.ufstore,u,l=function(d){return function(){return d(this,arguments.length>0?arguments[0]:void 0)}},c={get:function(g){if(Mn(g)){var m=s(g);return m===!0?a(Ci(this,i)).get(g):m?m[this._i]:void 0}},set:function(g,m){return b0.def(Ci(this,i),g,m)}},f=n.exports=D6(i,l,c,b0,!0,!0);t&&r&&(u=b0.getConstructor(l,i),c6(u.prototype,c),Qi.NEED=!0,e(["delete","has","get","set"],function(d){var g=f.prototype,m=g[d];I2(g,d,function(y,b){if(Mn(y)&&!o(y)){this._f||(this._f=new u);var w=this._f[d](y,b);return d=="set"?this:w}return m.call(this,y,b)})}))});T6("WeakMap");M6("WeakMap");var _j=It.WeakMap,kj=ft(function(n){n.exports={default:_j,__esModule:!0}}),xj=Kt(kj),Sj=Pn("species"),q6=function(n,e){var t=br(n).constructor,r;return t===void 0||(r=br(t)[Sj])==null?e:rl(r)},Cj=function(n,e,t){switch(e.length){case 0:return n();case 1:return n(e[0]);case 2:return n(e[0],e[1]);case 3:return n(e[0],e[1],e[2]);case 4:return n(e[0],e[1],e[2],e[3])}return n.apply(t,e)},EC=Ge.process,sw=Ge.setImmediate,RC=Ge.clearImmediate,AC=Ge.MessageChannel,Oy=Ge.Dispatch,Py=0,Gh={},DC="onreadystatechange",xu,Iy,Ly,Nh=function(){var n=+this;if(Gh.hasOwnProperty(n)){var e=Gh[n];delete Gh[n],e()}},TC=function(n){Nh.call(n.data)};(!sw||!RC)&&(sw=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return Gh[++Py]=function(){Cj(typeof e=="function"?e:Function(e),t)},xu(Py),Py},RC=function(e){delete Gh[e]},sl(EC)=="process"?xu=function(n){EC.nextTick(zn(Nh,n,1))}:Oy&&Oy.now?xu=function(n){Oy.now(zn(Nh,n,1))}:AC?(Iy=new AC,Ly=Iy.port2,Iy.port1.onmessage=TC,xu=zn(Ly.postMessage,Ly,1)):Ge.addEventListener&&typeof postMessage=="function"&&!Ge.importScripts?(xu=function(n){Ge.postMessage(n+"","*")},Ge.addEventListener("message",TC,!1)):DC in ym("script")?xu=function(n){Kb.appendChild(ym("script"))[DC]=function(){Kb.removeChild(this),Nh.call(n)}}:xu=function(n){setTimeout(zn(Nh,n,1),0)});var j6={set:sw},Ej=j6.set,MC=Ge.MutationObserver||Ge.WebKitMutationObserver,ow=Ge.process,Fy=Ge.Promise,OC=sl(ow)=="process",Rj=function(){var n,e,t,r=function(){var a,u;for(OC&&(a=ow.domain)&&a.exit();n;){u=n.fn,n=n.next;try{u()}catch(l){throw n?t():e=void 0,l}}e=void 0,a&&a.enter()};if(OC)t=function(){ow.nextTick(r)};else if(MC&&!(Ge.navigator&&Ge.navigator.standalone)){var i=!0,s=document.createTextNode("");new MC(r).observe(s,{characterData:!0}),t=function(){s.data=i=!i}}else if(Fy&&Fy.resolve){var o=Fy.resolve(void 0);t=function(){o.then(r)}}else t=function(){Ej.call(Ge,r)};return function(a){var u={fn:a,next:void 0};e&&(e.next=u),n||(n=u,t()),e=u}};function Aj(n){var e,t;this.promise=new n(function(r,i){if(e!==void 0||t!==void 0)throw TypeError("Bad Promise constructor");e=r,t=i}),this.resolve=rl(e),this.reject=rl(t)}var Dj=function(n){return new Aj(n)},M1={f:Dj},xm=function(n){try{return{e:!1,v:n()}}catch(e){return{e:!0,v:e}}},PC=Ge.navigator,Tj=PC&&PC.userAgent||"",aw=function(n,e){if(br(n),Mn(e)&&e.constructor===n)return e;var t=M1.f(n),r=t.resolve;return r(e),t.promise},$6=j6.set,W6=Rj(),su="Promise",z6=Ge.TypeError,bc=Ge.process,IC=bc&&bc.versions,Mj=IC&&IC.v8||"",Qs=Ge[su],ad=A1(bc)=="process",em=function(){},w0,U6,LC,U2,ud=U6=M1.f,O1=!!function(){try{var n=Qs.resolve(1),e=(n.constructor={})[Pn("species")]=function(t){t(em,em)};return(ad||typeof PromiseRejectionEvent=="function")&&n.then(em)instanceof e&&Mj.indexOf("6.6")!==0&&Tj.indexOf("Chrome/66")===-1}catch{}}(),H6=function(n){var e;return Mn(n)&&typeof(e=n.then)=="function"?e:!1},H2=function(n,e){if(!n._n){n._n=!0;var t=n._c;W6(function(){for(var r=n._v,i=n._s==1,s=0,o=function(a){var u=i?a.ok:a.fail,l=a.resolve,c=a.reject,f=a.domain,d,g,m;try{u?(i||(n._h==2&&Pj(n),n._h=1),u===!0?d=r:(f&&f.enter(),d=u(r),f&&(f.exit(),m=!0)),d===a.promise?c(z6("Promise-chain cycle")):(g=H6(d))?g.call(d,l,c):l(d)):c(r)}catch(y){f&&!m&&f.exit(),c(y)}};t.length>s;)o(t[s++]);n._c=[],n._n=!1,e&&!n._h&&Oj(n)})}},Oj=function(n){$6.call(Ge,function(){var e=n._v,t=FC(n),r,i,s;if(t&&(r=xm(function(){ad?bc.emit("unhandledRejection",e,n):(i=Ge.onunhandledrejection)?i({promise:n,reason:e}):(s=Ge.console)&&s.error&&s.error("Unhandled promise rejection",e)}),n._h=ad||FC(n)?2:1),n._a=void 0,t&&r.e)throw r.v})},FC=function(n){return n._h!==1&&(n._a||n._c).length===0},Pj=function(n){$6.call(Ge,function(){var e;ad?bc.emit("rejectionHandled",n):(e=Ge.onrejectionhandled)&&e({promise:n,reason:n._v})})},cc=function(n){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=n,e._s=2,e._a||(e._a=e._c.slice()),H2(e,!0))},uw=function(n){var e=this,t;if(!e._d){e._d=!0,e=e._w||e;try{if(e===n)throw z6("Promise can't be resolved itself");(t=H6(n))?W6(function(){var r={_w:e,_d:!1};try{t.call(n,zn(uw,r,1),zn(cc,r,1))}catch(i){cc.call(r,i)}}):(e._v=n,e._s=1,H2(e,!1))}catch(r){cc.call({_w:e,_d:!1},r)}}};O1||(Qs=function(e){sd(this,Qs,su,"_h"),rl(e),w0.call(this);try{e(zn(uw,this,1),zn(cc,this,1))}catch(t){cc.call(this,t)}},w0=function(e){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},w0.prototype=D1(Qs.prototype,{then:function(e,t){var r=ud(q6(this,Qs));return r.ok=typeof e=="function"?e:!0,r.fail=typeof t=="function"&&t,r.domain=ad?bc.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&H2(this,!1),r.promise},catch:function(n){return this.then(void 0,n)}}),LC=function(){var n=new w0;this.promise=n,this.resolve=zn(uw,n,1),this.reject=zn(cc,n,1)},M1.f=ud=function(n){return n===Qs||n===U2?new LC(n):U6(n)});Me(Me.G+Me.W+Me.F*!O1,{Promise:Qs});gl(Qs,su);R6(su);U2=It[su];Me(Me.S+Me.F*!O1,su,{reject:function(e){var t=ud(this),r=t.reject;return r(e),t.promise}});Me(Me.S+Me.F*CB,su,{resolve:function(e){return aw(this===U2?Qs:this,e)}});Me(Me.S+Me.F*!(O1&&g6(function(n){Qs.all(n).catch(em)})),su,{all:function(e){var t=this,r=ud(t),i=r.resolve,s=r.reject,o=xm(function(){var a=[],u=0,l=1;Za(e,!1,function(c){var f=u++,d=!1;a.push(void 0),l++,t.resolve(c).then(function(g){d||(d=!0,a[f]=g,--l||i(a))},s)}),--l||i(a)});return o.e&&s(o.v),r.promise},race:function(e){var t=this,r=ud(t),i=r.reject,s=xm(function(){Za(e,!1,function(o){t.resolve(o).then(r.resolve,i)})});return s.e&&i(s.v),r.promise}});Me(Me.P+Me.R,"Promise",{finally:function(n){var e=q6(this,It.Promise||Ge.Promise),t=typeof n=="function";return this.then(t?function(r){return aw(e,n()).then(function(){return r})}:n,t?function(r){return aw(e,n()).then(function(){throw r})}:n)}});Me(Me.S,"Promise",{try:function(n){var e=M1.f(this),t=xm(n);return(t.e?e.reject:e.resolve)(t.v),e.promise}});var Ij=It.Promise,Lj=ft(function(n){n.exports={default:Ij,__esModule:!0}}),Ny=Kt(Lj);Me(Me.S,"Math",{log2:function(e){return Math.log(e)/Math.LN2}});var Fj=It.Math.log2,Nj=ft(function(n){n.exports={default:Fj,__esModule:!0}}),Bj=Kt(Nj);function Sm(n,e){if(n.maxByteLength<e){var t=1<<Math.ceil(Bj(e)),r=new ArrayBuffer(e,{maxByteLength:t}),i=new Uint8Array(n),s=new Uint8Array(r);return s.set(i),r}return n.byteLength<e&&n.resize(e),n}function lw(n,e){var t=n.byteLength+e.byteLength,r=n;n.maxByteLength<t&&(newBuf=Sm(n,t),newBuf.set(e,n.byteLength),r=newBuf);var i=new Uint8Array(r),s=new Uint8Array(e);return i.set(s,n.byteLength),newBuf}function NC(n){var e=new ArrayBuffer(n.byteLength,{maxByteLength:n.maxByteLength}),t=new Uint8Array(n),r=new Uint8Array(e);return r.set(t,n.byteLength),e}var Ud=function(){function n(e,t){sr(this,n);var r=new Date;this._metadata=new Qg(Ql({},e,{mode:e.mode,nlink:e.nlink||0,atime:r,mtime:r,ctime:r,birthtime:r})),this._iNodeMgr=t}return wr(n,[{key:"getMetadata",value:function(){return this._metadata}}]),n}(),xi=function(n){la(e,n);function e(t,r){sr(this,e);var i=ua(this,(e.__proto__||Ht(e)).call(this,{ino:t.ino,uid:t.uid,gid:t.gid,mode:ie.S_IFREG|t.mode&~ie.S_IFMT,size:t.data?t.data.byteLength:0},r));return i._data=t.data?t.data:new ArrayBuffer(0),i}return wr(e,[{key:"getData",value:function(){return this._data}},{key:"setData",value:function(r){this._data=r}},{key:"read",value:function(){}},{key:"write",value:function(r,i,s){var o=this._data,a=void 0;if(s)o=lw(o,r),a=r.byteLength;else{i=o.byteLength<i?o.byteLength:i;var u=o.byteLength-i,l=r.byteLength-u;l>0&&(o=Sm(o,o.byteLength+l)),a=r.byteLength;var c=new Uint8Array(o);c.set(new Uint8Array(r),i)}return this._data=o,this._metadata.size=this._data.byteLength,a}},{key:"destructor",value:function(){}}]),e}(Ud),ln=function(n){la(e,n);function e(t,r){sr(this,e),t.parent===void 0&&(t.parent=t.ino);var i=void 0;t.parent===t.ino?i=2:(i=1,r.linkINode(r.getINode(t.parent)));var s=ua(this,(e.__proto__||Ht(e)).call(this,{ino:t.ino,mode:ie.S_IFDIR|t.mode&~ie.S_IFMT,uid:t.uid,gid:t.gid,nlink:i,size:4096},r));return s._dir=new od([[".",t.ino],["..",t.parent]]),s}return wr(e,[{key:"getEntries",value:function(){return this._metadata.atime=new Date,this._dir.entries()}},{key:"getEntryIndex",value:function(r){return this._dir.get(r)}},{key:"getEntry",value:function(r){var i=this._dir.get(r);if(i!==void 0)return this._iNodeMgr.getINode(i)}},{key:"addEntry",value:function(r,i){if(r==="."||r==="..")throw new Error("Not allowed to add `.` or `..` entries");var s=new Date;this._metadata.mtime=s,this._metadata.ctime=s,this._iNodeMgr.linkINode(this._iNodeMgr.getINode(i)),this._dir.set(r,i)}},{key:"deleteEntry",value:function(r){if(r==="."||r==="..")throw new Error("Not allowed to delete `.` or `..` entries");var i=this._dir.get(r);if(i!==void 0){var s=new Date;this._metadata.mtime=s,this._metadata.ctime=s,this._dir.delete(r),this._iNodeMgr.unlinkINode(this._iNodeMgr.getINode(i))}}},{key:"renameEntry",value:function(r,i){if(r==="."||r===".."||i==="."||r==="..")throw new Error("Not allowed to rename `.` or `..` entries");var s=this._dir.get(r);if(s!=null){var o=new Date;this._metadata.mtime=o,this._metadata.ctime=o,this._dir.delete(r),this._dir.set(i,s)}}},{key:"destructor",value:function(){if(this._dir.get(".")!==this._dir.get("..")){var r=this._dir.get("..");r!=null&&this._iNodeMgr.unlinkINode(this._iNodeMgr.getINode(r))}}}]),e}(Ud),Kh=function(n){la(e,n);function e(t,r){sr(this,e);var i=ua(this,(e.__proto__||Ht(e)).call(this,{ino:t.ino,mode:ie.S_IFLNK|t.mode&~ie.S_IFMT,uid:t.uid,gid:t.gid,size:new TextEncoder().encode(t.link).byteLength},r));return i._link=t.link,i}return wr(e,[{key:"getLink",value:function(){return this._link}},{key:"destructor",value:function(){}}]),e}(Ud),Zo=function(n){la(e,n);function e(t,r){sr(this,e);var i=ua(this,(e.__proto__||Ht(e)).call(this,{ino:t.ino,mode:ie.S_IFCHR|t.mode&~ie.S_IFMT,uid:t.uid,gid:t.gid,rdev:t.rdev,size:0},r));return i.teardown=t.teardown,i}return wr(e,[{key:"getFileDesOps",value:function(){var r=N6(this.getMetadata().rdev),i=ei(r,2),s=i[0],o=i[1];return this._iNodeMgr._devMgr.getChr(s,o)}},{key:"destructor",value:function(){this.teardown!==void 0&&this.teardown()}}]),e}(Ud),V2=function(n){la(e,n);function e(t,r){sr(this,e);var i=ua(this,(e.__proto__||Ht(e)).call(this,{ino:t.ino,mode:ie.S_IFIFO|t.mode&~ie.S_IFMT,uid:t.uid,gid:t.gid,size:0},r));return i.KERN_W=0,i.KERN_R=1,i.CLOSERM=2,i.teardown=t.teardown,i.reader=-1,i.writer=-1,i.messages=[],i.readQueue=[],i.pollQueue=[],i.mode=0,i}return wr(e,[{key:"setMode",value:function(r,i){i?this.mode|=1<<r:this.mode&=~(1<<r)}},{key:"isKernW",value:function(){return(this.mode&1<<this.KERN_W)!==0}},{key:"isKernR",value:function(){return(this.mode&1<<this.KERN_R)!==0}},{key:"isCloserm",value:function(){return(this.mode&1<<this.CLOSERM)!==0}},{key:"notify",value:function(r){for(var i=this.pollQueue.shift();i!==void 0;i=this.pollQueue.shift())i(r)}},{key:"sendEof",value:function(){for(var r=this.readQueue.shift();r!==void 0;r=this.readQueue.shift())r(new ArrayBuffer);this.notify(0)}},{key:"write",value:function(r){var i=this.readQueue.shift();if(i!==void 0){i(r);return}this.messages.push(r),this.notify(r.byteLength)}},{key:"read",value:function(){var r=this,i=this.messages.shift();return i===void 0?this.writer===0?new ArrayBuffer:new Ny(function(s){r.readQueue.push(s)}):i}},{key:"addPollSub",value:function(){var r=this;return this.messages.length!==0?Ny.resolve(this.messages[0].byteLength):new Ny(function(i){r.pollQueue.push(i)})}},{key:"destructor",value:function(){this.teardown!==void 0&&this.teardown()}}]),e}(Ud),V6=function(){function n(e){sr(this,n),this._counter=new _m(1),this._iNodes=new od,this._iNodeRefs=new xj,this._devMgr=e}return wr(n,[{key:"createINode",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};r.ino=this._counter.allocate(),r.mode=typeof r.mode=="number"?r.mode:0,r.uid=typeof r.uid=="number"?r.uid:Vs,r.gid=typeof r.gid=="number"?r.gid:tw;var i=new t(r,this);return this._iNodes.set(r.ino,i),this._iNodeRefs.set(i,0),[i,r.ino]}},{key:"getINode",value:function(t){return this._iNodes.get(t)}},{key:"linkINode",value:function(t){t&&++t.getMetadata().nlink}},{key:"unlinkINode",value:function(t){t&&(--t.getMetadata().nlink,this._gcINode(t))}},{key:"refINode",value:function(t){if(t){var r=this._iNodeRefs.get(t);r!==void 0&&this._iNodeRefs.set(t,r+1)}}},{key:"unrefINode",value:function(t){if(t){var r=this._iNodeRefs.get(t);r!==void 0&&(this._iNodeRefs.set(t,r-1),this._gcINode(t))}}},{key:"_gcINode",value:function(t){var r=t.getMetadata(),i=r.nlink+this._iNodeRefs.get(t);if(i===0||i===1&&t instanceof ln){var s=r.ino;t.destructor(),this._iNodes.delete(s),this._counter.deallocate(s)}}}]),n}(),qj=ft(function(n){/*!
|
|
14
|
-
* prr
|
|
15
|
-
* (c) 2013 Rod Vagg <rod@vagg.org>
|
|
16
|
-
* https://github.com/rvagg/prr
|
|
17
|
-
* License: MIT
|
|
18
|
-
*/(function(e,t,r){n.exports?n.exports=r():t[e]=r()})("prr",rd,function(){var e=typeof Object.defineProperty=="function"?function(i,s,o){return Object.defineProperty(i,s,o),i}:function(i,s,o){return i[s]=o.value,i},t=function(i,s){var o=typeof s=="object",a=!o&&typeof s=="string",u=function(l){return o?!!s[l]:a?s.indexOf(l[0])>-1:!1};return{enumerable:u("enumerable"),configurable:u("configurable"),writable:u("writable"),value:i}},r=function(i,s,o,a){var u;if(a=t(o,a),typeof s=="object"){for(u in s)Object.hasOwnProperty.call(s,u)&&(a.value=s[u],e(i,u,a));return i}return e(i,s,a)};return r})});function G6(n,e,t){e&&typeof e!="string"&&(e=e.message||e.name),qj(this,{type:n,name:n,cause:typeof e!="string"?e:t,message:e},"ewr")}function G2(n,e){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),G6.call(this,"CustomError",n,e)}G2.prototype=new Error;function jj(n,e,t){var r=function(i,s){G6.call(this,e,i,s),e=="FilesystemError"&&(this.code=this.cause.code,this.path=this.cause.path,this.errno=this.cause.errno,this.message=(n.errno[this.cause.errno]?n.errno[this.cause.errno].description:this.cause.message)+(this.cause.path?" ["+this.cause.path+"]":"")),Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,r)};return r.prototype=t?new t:new G2,r}var $j=function(n){var e=function(t,r){return jj(n,t,r)};return{CustomError:G2,FilesystemError:e("FilesystemError"),createError:e}},Hd=ft(function(n){var e=n.exports.all=[{errno:-2,code:"ENOENT",description:"no such file or directory"},{errno:-1,code:"UNKNOWN",description:"unknown error"},{errno:0,code:"OK",description:"success"},{errno:1,code:"EOF",description:"end of file"},{errno:2,code:"EADDRINFO",description:"getaddrinfo error"},{errno:3,code:"EACCES",description:"permission denied"},{errno:4,code:"EAGAIN",description:"resource temporarily unavailable"},{errno:5,code:"EADDRINUSE",description:"address already in use"},{errno:6,code:"EADDRNOTAVAIL",description:"address not available"},{errno:7,code:"EAFNOSUPPORT",description:"address family not supported"},{errno:8,code:"EALREADY",description:"connection already in progress"},{errno:9,code:"EBADF",description:"bad file descriptor"},{errno:10,code:"EBUSY",description:"resource busy or locked"},{errno:11,code:"ECONNABORTED",description:"software caused connection abort"},{errno:12,code:"ECONNREFUSED",description:"connection refused"},{errno:13,code:"ECONNRESET",description:"connection reset by peer"},{errno:14,code:"EDESTADDRREQ",description:"destination address required"},{errno:15,code:"EFAULT",description:"bad address in system call argument"},{errno:16,code:"EHOSTUNREACH",description:"host is unreachable"},{errno:17,code:"EINTR",description:"interrupted system call"},{errno:18,code:"EINVAL",description:"invalid argument"},{errno:19,code:"EISCONN",description:"socket is already connected"},{errno:20,code:"EMFILE",description:"too many open files"},{errno:21,code:"EMSGSIZE",description:"message too long"},{errno:22,code:"ENETDOWN",description:"network is down"},{errno:23,code:"ENETUNREACH",description:"network is unreachable"},{errno:24,code:"ENFILE",description:"file table overflow"},{errno:25,code:"ENOBUFS",description:"no buffer space available"},{errno:26,code:"ENOMEM",description:"not enough memory"},{errno:27,code:"ENOTDIR",description:"not a directory"},{errno:28,code:"EISDIR",description:"illegal operation on a directory"},{errno:29,code:"ENONET",description:"machine is not on the network"},{errno:31,code:"ENOTCONN",description:"socket is not connected"},{errno:32,code:"ENOTSOCK",description:"socket operation on non-socket"},{errno:33,code:"ENOTSUP",description:"operation not supported on socket"},{errno:34,code:"ENOENT",description:"no such file or directory"},{errno:35,code:"ENOSYS",description:"function not implemented"},{errno:36,code:"EPIPE",description:"broken pipe"},{errno:37,code:"EPROTO",description:"protocol error"},{errno:38,code:"EPROTONOSUPPORT",description:"protocol not supported"},{errno:39,code:"EPROTOTYPE",description:"protocol wrong type for socket"},{errno:40,code:"ETIMEDOUT",description:"connection timed out"},{errno:41,code:"ECHARSET",description:"invalid Unicode character"},{errno:42,code:"EAIFAMNOSUPPORT",description:"address family for hostname not supported"},{errno:44,code:"EAISERVICE",description:"servname not supported for ai_socktype"},{errno:45,code:"EAISOCKTYPE",description:"ai_socktype not supported"},{errno:46,code:"ESHUTDOWN",description:"cannot send after transport endpoint shutdown"},{errno:47,code:"EEXIST",description:"file already exists"},{errno:48,code:"ESRCH",description:"no such process"},{errno:49,code:"ENAMETOOLONG",description:"name too long"},{errno:50,code:"EPERM",description:"operation not permitted"},{errno:51,code:"ELOOP",description:"too many symbolic links encountered"},{errno:52,code:"EXDEV",description:"cross-device link not permitted"},{errno:53,code:"ENOTEMPTY",description:"directory not empty"},{errno:54,code:"ENOSPC",description:"no space left on device"},{errno:55,code:"EIO",description:"i/o error"},{errno:56,code:"EROFS",description:"read-only file system"},{errno:57,code:"ENODEV",description:"no such device"},{errno:58,code:"ESPIPE",description:"invalid seek"},{errno:59,code:"ECANCELED",description:"operation canceled"}];n.exports.errno={},n.exports.code={},e.forEach(function(t){n.exports.errno[t.errno]=t,n.exports.code[t.code]=t}),n.exports.custom=$j(n.exports),n.exports.create=n.exports.custom.createError});Hd.all;Hd.errno;var ce=Hd.code;Hd.custom;Hd.create;var ue=function(n){la(e,n);function e(t,r,i,s){sr(this,e);var o=t.code+": "+t.description;r!=null&&(o+=", "+r,i!=null&&(o+=" -> "+i));var a=ua(this,(e.__proto__||Ht(e)).call(this,o));return a.errno=t.errno,a.code=t.code,a.errnoDescription=t.description,s!=null&&(a.syscall=s),a}return wr(e,[{key:"setPaths",value:function(r,i){var s=this.code+": "+this.errnoDescription+", "+r;i!=null&&(s+=" -> "+i),this.message=s}},{key:"setSyscall",value:function(r){this.syscall=r}}]),e}(Error),Wj=function(){function n(e,t){sr(this,n),this._iNode=e,this._flags=t,this._pos=0}return wr(n,[{key:"getINode",value:function(){return this._iNode}},{key:"getFlags",value:function(){return this._flags}},{key:"setFlags",value:function(t){this._flags=t}},{key:"getPos",value:function(){return this._pos}},{key:"setPos",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ie.SEEK_SET,i=this.getINode(),s=void 0;switch(!0){case i instanceof xi:case i instanceof ln:switch(r){case ie.SEEK_SET:s=t;break;case ie.SEEK_CUR:s=this._pos+t;break;case ie.SEEK_END:s=i.getData().length+t;break;default:s=this._pos}if(s<0)throw new ue(ce.EINVAL);this._pos=s;break;case i instanceof Zo:var o=i.getFileDesOps();if(o)if(o.setPos)o.setPos(this,t,r);else throw new ue(ce.ESPIPE);else throw new ue(ce.ENXIO);break;default:throw new ue(ce.ESPIPE)}}},{key:"read",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=void 0;r===null?i=this._pos:i=r;var s=this._iNode,o=void 0;switch(!0){case s instanceof xi:var a=s.getData(),u=s.getMetadata();o=a.copy(t,0,i),u.atime=new Date;break;case s instanceof Zo:var l=s.getFileDesOps();if(l)if(l.read)o=l.read(this,t,i);else throw new ue(ce.EINVAL);else throw new ue(ce.ENXIO);break;default:throw new ue(ce.EINVAL)}return r===null&&(this._pos=i+o),o}},{key:"write",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=void 0;r===null?s=this._pos:s=r;var o=this._iNode,a=void 0;switch(!0){case o instanceof xi:var u=o.getData(),l=o.getMetadata();if((this.getFlags()|i)&ie.O_APPEND)s=u.length,u=he.concat([u,t]),a=t.length;else{if(s>u.length)u=he.concat([u,he.alloc(s-u.length),he.allocUnsafe(t.length)]);else if(s<=u.length){var c=u.length-s,f=t.length-c;f>0&&(u=he.concat([u,he.allocUnsafe(f)]))}a=t.copy(u,s)}o.setData(u);var d=new Date;l.mtime=d,l.ctime=d,l.size=u.length;break;case o instanceof Zo:var g=o.getFileDesOps();if(g)if(g.write)a=g.write(this,t,s,i);else throw new ue(ce.EINVAL);else throw new ue(ce.ENXIO);break;default:throw new ue(ce.EINVAL)}return r===null&&(this._pos=s+a),a}}]),n}(),K6=function(){function n(e){sr(this,n),this._counter=new _m(0),this._fds=new od,this._iNodeMgr=e}return wr(n,[{key:"createFd",value:function(t,r){this._iNodeMgr.refINode(t);var i=this._counter.allocate(),s=new Wj(t,r);if(t instanceof Zo){var o=t.getFileDesOps();if(o)o.open&&o.open(s);else throw new ue(ce.ENXIO)}return this._fds.set(i,s),[s,i]}},{key:"getFd",value:function(t){return this._fds.get(t)}},{key:"dupFd",value:function(t){var r=this._fds.get(t);if(r){this._iNodeMgr.refINode(r.getINode());var i=this._counter.allocate();return this._fds.set(i,r),t}}},{key:"deleteFd",value:function(t){var r=this._fds.get(t);if(r){var i=r.getINode();if(i instanceof Zo){var s=i.getFileDesOps();if(s)s.close&&s.close(r);else throw new ue(ce.ENXIO)}this._fds.delete(t),this._counter.deallocate(t),this._iNodeMgr.unrefINode(i)}}}]),n}(),zj=E1.f;W2("getOwnPropertyDescriptor",function(){return function(e,t){return zj(vo(e),t)}});var Uj=It.Object,Hj=function(e,t){return Uj.getOwnPropertyDescriptor(e,t)},J6=ft(function(n){n.exports={default:Hj,__esModule:!0}});Kt(J6);var Vj=ft(function(n,e){e.__esModule=!0;var t=i(O6),r=i(J6);function i(s){return s&&s.__esModule?s:{default:s}}e.default=function s(o,a,u){o===null&&(o=Function.prototype);var l=(0,r.default)(o,a);if(l===void 0){var c=(0,t.default)(o);return c===null?void 0:s(c,a,u)}else{if("value"in l)return l.value;var f=l.get;return f===void 0?void 0:f.call(u)}}}),Yn=Kt(Vj),By;function Ga(){}Ga.prototype=Object.create(null);function mt(){mt.init.call(this)}mt.EventEmitter=mt;mt.usingDomains=!1;mt.prototype.domain=void 0;mt.prototype._events=void 0;mt.prototype._maxListeners=void 0;mt.defaultMaxListeners=10;mt.init=function(){this.domain=null,mt.usingDomains&&By.active&&!(this instanceof By.Domain)&&(this.domain=By.active),(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new Ga,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};mt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this};function Y6(n){return n._maxListeners===void 0?mt.defaultMaxListeners:n._maxListeners}mt.prototype.getMaxListeners=function(){return Y6(this)};function Gj(n,e,t){if(e)n.call(t);else for(var r=n.length,i=Vd(n,r),s=0;s<r;++s)i[s].call(t)}function Kj(n,e,t,r){if(e)n.call(t,r);else for(var i=n.length,s=Vd(n,i),o=0;o<i;++o)s[o].call(t,r)}function Jj(n,e,t,r,i){if(e)n.call(t,r,i);else for(var s=n.length,o=Vd(n,s),a=0;a<s;++a)o[a].call(t,r,i)}function Yj(n,e,t,r,i,s){if(e)n.call(t,r,i,s);else for(var o=n.length,a=Vd(n,o),u=0;u<o;++u)a[u].call(t,r,i,s)}function Xj(n,e,t,r){if(e)n.apply(t,r);else for(var i=n.length,s=Vd(n,i),o=0;o<i;++o)s[o].apply(t,r)}mt.prototype.emit=function(e){var t,r,i,s,o,a,u,l=e==="error";if(a=this._events,a)l=l&&a.error==null;else if(!l)return!1;if(u=this.domain,l){if(t=arguments[1],u)t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=u,t.domainThrown=!1,u.emit("error",t);else{if(t instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}return!1}if(r=a[e],!r)return!1;var f=typeof r=="function";switch(i=arguments.length,i){case 1:Gj(r,f,this);break;case 2:Kj(r,f,this,arguments[1]);break;case 3:Jj(r,f,this,arguments[1],arguments[2]);break;case 4:Yj(r,f,this,arguments[1],arguments[2],arguments[3]);break;default:for(s=new Array(i-1),o=1;o<i;o++)s[o-1]=arguments[o];Xj(r,f,this,s)}return!0};function X6(n,e,t,r){var i,s,o;if(typeof t!="function")throw new TypeError('"listener" argument must be a function');if(s=n._events,s?(s.newListener&&(n.emit("newListener",e,t.listener?t.listener:t),s=n._events),o=s[e]):(s=n._events=new Ga,n._eventsCount=0),!o)o=s[e]=t,++n._eventsCount;else if(typeof o=="function"?o=s[e]=r?[t,o]:[o,t]:r?o.unshift(t):o.push(t),!o.warned&&(i=Y6(n),i&&i>0&&o.length>i)){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+e+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=n,a.type=e,a.count=o.length,Zj(a)}return n}function Zj(n){typeof console.warn=="function"?console.warn(n):console.log(n)}mt.prototype.addListener=function(e,t){return X6(this,e,t,!1)};mt.prototype.on=mt.prototype.addListener;mt.prototype.prependListener=function(e,t){return X6(this,e,t,!0)};function Z6(n,e,t){var r=!1;function i(){n.removeListener(e,i),r||(r=!0,t.apply(n,arguments))}return i.listener=t,i}mt.prototype.once=function(e,t){if(typeof t!="function")throw new TypeError('"listener" argument must be a function');return this.on(e,Z6(this,e,t)),this};mt.prototype.prependOnceListener=function(e,t){if(typeof t!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(e,Z6(this,e,t)),this};mt.prototype.removeListener=function(e,t){var r,i,s,o,a;if(typeof t!="function")throw new TypeError('"listener" argument must be a function');if(i=this._events,!i)return this;if(r=i[e],!r)return this;if(r===t||r.listener&&r.listener===t)--this._eventsCount===0?this._events=new Ga:(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if(typeof r!="function"){for(s=-1,o=r.length;o-- >0;)if(r[o]===t||r[o].listener&&r[o].listener===t){a=r[o].listener,s=o;break}if(s<0)return this;if(r.length===1){if(r[0]=void 0,--this._eventsCount===0)return this._events=new Ga,this;delete i[e]}else Qj(r,s);i.removeListener&&this.emit("removeListener",e,a||t)}return this};mt.prototype.removeAllListeners=function(e){var t,r;if(r=this._events,!r)return this;if(!r.removeListener)return arguments.length===0?(this._events=new Ga,this._eventsCount=0):r[e]&&(--this._eventsCount===0?this._events=new Ga:delete r[e]),this;if(arguments.length===0){for(var i=Object.keys(r),s=0,o;s<i.length;++s)o=i[s],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=new Ga,this._eventsCount=0,this}if(t=r[e],typeof t=="function")this.removeListener(e,t);else if(t)do this.removeListener(e,t[t.length-1]);while(t[0]);return this};mt.prototype.listeners=function(e){var t,r,i=this._events;return i?(t=i[e],t?typeof t=="function"?r=[t.listener||t]:r=e$(t):r=[]):r=[],r};mt.listenerCount=function(n,e){return typeof n.listenerCount=="function"?n.listenerCount(e):Q6.call(n,e)};mt.prototype.listenerCount=Q6;function Q6(n){var e=this._events;if(e){var t=e[n];if(typeof t=="function")return 1;if(t)return t.length}return 0}mt.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function Qj(n,e){for(var t=e,r=t+1,i=n.length;r<i;t+=1,r+=1)n[t]=n[r];n.pop()}function Vd(n,e){for(var t=new Array(e);e--;)t[e]=n[e];return t}function e$(n){for(var e=new Array(n.length),t=0;t<e.length;++t)e[t]=n[t].listener||n[t];return e}var cw;typeof Object.create=="function"?cw=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:cw=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e};var qc=cw,t$=/%[sdj%]/g;function n$(n){if(!J2(n)){for(var e=[],t=0;t<arguments.length;t++)e.push(Ka(arguments[t]));return e.join(" ")}for(var t=1,r=arguments,i=r.length,s=String(n).replace(t$,function(a){if(a==="%%")return"%";if(t>=i)return a;switch(a){case"%s":return String(r[t++]);case"%d":return Number(r[t++]);case"%j":try{return JSON.stringify(r[t++])}catch{return"[Circular]"}default:return a}}),o=r[t];t<i;o=r[++t])K2(o)||!Gd(o)?s+=" "+o:s+=" "+Ka(o);return s}function eM(n,e){if(qa(yc.process))return function(){return eM(n,e).apply(this,arguments)};if(Zg.noDeprecation===!0)return n;var t=!1;function r(){if(!t){if(Zg.throwDeprecation)throw new Error(e);Zg.traceDeprecation?console.trace(e):console.error(e),t=!0}return n.apply(this,arguments)}return r}var _0={},qy;function r$(n){if(qa(qy)&&(qy=Zg.env.NODE_DEBUG||""),n=n.toUpperCase(),!_0[n])if(new RegExp("\\b"+n+"\\b","i").test(qy)){var e=0;_0[n]=function(){var t=n$.apply(null,arguments);console.error("%s %d: %s",n,e,t)}}else _0[n]=function(){};return _0[n]}function Ka(n,e){var t={seen:[],stylize:s$};return arguments.length>=3&&(t.depth=arguments[2]),arguments.length>=4&&(t.colors=arguments[3]),tM(e)?t.showHidden=e:e&&h$(t,e),qa(t.showHidden)&&(t.showHidden=!1),qa(t.depth)&&(t.depth=2),qa(t.colors)&&(t.colors=!1),qa(t.customInspect)&&(t.customInspect=!0),t.colors&&(t.stylize=i$),Cm(t,n,t.depth)}Ka.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};Ka.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function i$(n,e){var t=Ka.styles[e];return t?"\x1B["+Ka.colors[t][0]+"m"+n+"\x1B["+Ka.colors[t][1]+"m":n}function s$(n,e){return n}function o$(n){var e={};return n.forEach(function(t,r){e[t]=!0}),e}function Cm(n,e,t){if(n.customInspect&&e&&zy(e.inspect)&&e.inspect!==Ka&&!(e.constructor&&e.constructor.prototype===e)){var r=e.inspect(t,n);return J2(r)||(r=Cm(n,r,t)),r}var i=a$(n,e);if(i)return i;var s=Object.keys(e),o=o$(s);if(n.showHidden&&(s=Object.getOwnPropertyNames(e)),Wy(e)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return jy(e);if(s.length===0){if(zy(e)){var a=e.name?": "+e.name:"";return n.stylize("[Function"+a+"]","special")}if($y(e))return n.stylize(RegExp.prototype.toString.call(e),"regexp");if(BC(e))return n.stylize(Date.prototype.toString.call(e),"date");if(Wy(e))return jy(e)}var u="",l=!1,c=["{","}"];if(c$(e)&&(l=!0,c=["[","]"]),zy(e)){var f=e.name?": "+e.name:"";u=" [Function"+f+"]"}if($y(e)&&(u=" "+RegExp.prototype.toString.call(e)),BC(e)&&(u=" "+Date.prototype.toUTCString.call(e)),Wy(e)&&(u=" "+jy(e)),s.length===0&&(!l||e.length==0))return c[0]+u+c[1];if(t<0)return $y(e)?n.stylize(RegExp.prototype.toString.call(e),"regexp"):n.stylize("[Object]","special");n.seen.push(e);var d;return l?d=u$(n,e,t,o,s):d=s.map(function(g){return fw(n,e,t,o,g,l)}),n.seen.pop(),l$(d,u,c)}function a$(n,e){if(qa(e))return n.stylize("undefined","undefined");if(J2(e)){var t="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return n.stylize(t,"string")}if(f$(e))return n.stylize(""+e,"number");if(tM(e))return n.stylize(""+e,"boolean");if(K2(e))return n.stylize("null","null")}function jy(n){return"["+Error.prototype.toString.call(n)+"]"}function u$(n,e,t,r,i){for(var s=[],o=0,a=e.length;o<a;++o)nM(e,String(o))?s.push(fw(n,e,t,r,String(o),!0)):s.push("");return i.forEach(function(u){u.match(/^\d+$/)||s.push(fw(n,e,t,r,u,!0))}),s}function fw(n,e,t,r,i,s){var o,a,u;if(u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},u.get?u.set?a=n.stylize("[Getter/Setter]","special"):a=n.stylize("[Getter]","special"):u.set&&(a=n.stylize("[Setter]","special")),nM(r,i)||(o="["+i+"]"),a||(n.seen.indexOf(u.value)<0?(K2(t)?a=Cm(n,u.value,null):a=Cm(n,u.value,t-1),a.indexOf(`
|
|
19
|
-
`)>-1&&(s?a=a.split(`
|
|
20
|
-
`).map(function(l){return" "+l}).join(`
|
|
21
|
-
`).substr(2):a=`
|
|
22
|
-
`+a.split(`
|
|
23
|
-
`).map(function(l){return" "+l}).join(`
|
|
24
|
-
`))):a=n.stylize("[Circular]","special")),qa(o)){if(s&&i.match(/^\d+$/))return a;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=n.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=n.stylize(o,"string"))}return o+": "+a}function l$(n,e,t){var r=n.reduce(function(i,s){return s.indexOf(`
|
|
25
|
-
`)>=0,i+s.replace(/\u001b\[\d\d?m/g,"").length+1},0);return r>60?t[0]+(e===""?"":e+`
|
|
26
|
-
`)+" "+n.join(`,
|
|
27
|
-
`)+" "+t[1]:t[0]+e+" "+n.join(", ")+" "+t[1]}function c$(n){return Array.isArray(n)}function tM(n){return typeof n=="boolean"}function K2(n){return n===null}function f$(n){return typeof n=="number"}function J2(n){return typeof n=="string"}function qa(n){return n===void 0}function $y(n){return Gd(n)&&Y2(n)==="[object RegExp]"}function Gd(n){return typeof n=="object"&&n!==null}function BC(n){return Gd(n)&&Y2(n)==="[object Date]"}function Wy(n){return Gd(n)&&(Y2(n)==="[object Error]"||n instanceof Error)}function zy(n){return typeof n=="function"}function Y2(n){return Object.prototype.toString.call(n)}function h$(n,e){if(!e||!Gd(e))return n;for(var t=Object.keys(e),r=t.length;r--;)n[t[r]]=e[t[r]];return n}function nM(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ml(){this.head=null,this.tail=null,this.length=0}ml.prototype.push=function(n){var e={data:n,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length};ml.prototype.unshift=function(n){var e={data:n,next:this.head};this.length===0&&(this.tail=e),this.head=e,++this.length};ml.prototype.shift=function(){if(this.length!==0){var n=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,n}};ml.prototype.clear=function(){this.head=this.tail=null,this.length=0};ml.prototype.join=function(n){if(this.length===0)return"";for(var e=this.head,t=""+e.data;e=e.next;)t+=n+e.data;return t};ml.prototype.concat=function(n){if(this.length===0)return he.alloc(0);if(this.length===1)return this.head.data;for(var e=he.allocUnsafe(n>>>0),t=this.head,r=0;t;)t.data.copy(e,r),r+=t.data.length,t=t.next;return e};var d$=he.isEncoding||function(n){switch(n&&n.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function p$(n){if(n&&!d$(n))throw new Error("Unknown encoding: "+n)}function Kd(n){switch(this.encoding=(n||"utf8").toLowerCase().replace(/[-_]/,""),p$(n),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=m$;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=v$;break;default:this.write=g$;return}this.charBuffer=new he(6),this.charReceived=0,this.charLength=0}Kd.prototype.write=function(n){for(var e="";this.charLength;){var t=n.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:n.length;if(n.copy(this.charBuffer,this.charReceived,0,t),this.charReceived+=t,this.charReceived<this.charLength)return"";n=n.slice(t,n.length),e=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var i=e.charCodeAt(e.length-1);if(i>=55296&&i<=56319){this.charLength+=this.surrogateSize,e="";continue}if(this.charReceived=this.charLength=0,n.length===0)return e;break}this.detectIncompleteChar(n);var r=n.length;this.charLength&&(n.copy(this.charBuffer,0,n.length-this.charReceived,r),r-=this.charReceived),e+=n.toString(this.encoding,0,r);var r=e.length-1,i=e.charCodeAt(r);if(i>=55296&&i<=56319){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),n.copy(this.charBuffer,0,0,s),e.substring(0,r)}return e};Kd.prototype.detectIncompleteChar=function(n){for(var e=n.length>=3?3:n.length;e>0;e--){var t=n[n.length-e];if(e==1&&t>>5==6){this.charLength=2;break}if(e<=2&&t>>4==14){this.charLength=3;break}if(e<=3&&t>>3==30){this.charLength=4;break}}this.charReceived=e};Kd.prototype.end=function(n){var e="";if(n&&n.length&&(e=this.write(n)),this.charReceived){var t=this.charReceived,r=this.charBuffer,i=this.encoding;e+=r.slice(0,t).toString(i)}return e};function g$(n){return n.toString(this.encoding)}function m$(n){this.charReceived=n.length%2,this.charLength=this.charReceived?2:0}function v$(n){this.charReceived=n.length%3,this.charLength=this.charReceived?3:0}fn.ReadableState=rM;var Mt=r$("stream");qc(fn,mt);function y$(n,e,t){if(typeof n.prependListener=="function")return n.prependListener(e,t);!n._events||!n._events[e]?n.on(e,t):Array.isArray(n._events[e])?n._events[e].unshift(t):n._events[e]=[t,n._events[e]]}function b$(n,e){return n.listeners(e).length}function rM(n,e){n=n||{},this.objectMode=!!n.objectMode,e instanceof es&&(this.objectMode=this.objectMode||!!n.readableObjectMode);var t=n.highWaterMark,r=this.objectMode?16:16*1024;this.highWaterMark=t||t===0?t:r,this.highWaterMark=~~this.highWaterMark,this.buffer=new ml,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=n.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,n.encoding&&(this.decoder=new Kd(n.encoding),this.encoding=n.encoding)}function fn(n){if(!(this instanceof fn))return new fn(n);this._readableState=new rM(n,this),this.readable=!0,n&&typeof n.read=="function"&&(this._read=n.read),mt.call(this)}fn.prototype.push=function(n,e){var t=this._readableState;return!t.objectMode&&typeof n=="string"&&(e=e||t.defaultEncoding,e!==t.encoding&&(n=he.from(n,e),e="")),iM(this,t,n,e,!1)};fn.prototype.unshift=function(n){var e=this._readableState;return iM(this,e,n,"",!0)};fn.prototype.isPaused=function(){return this._readableState.flowing===!1};function iM(n,e,t,r,i){var s=k$(e,t);if(s)n.emit("error",s);else if(t===null)e.reading=!1,x$(n,e);else if(e.objectMode||t&&t.length>0)if(e.ended&&!i){var o=new Error("stream.push() after EOF");n.emit("error",o)}else if(e.endEmitted&&i){var a=new Error("stream.unshift() after end event");n.emit("error",a)}else{var u;e.decoder&&!i&&!r&&(t=e.decoder.write(t),u=!e.objectMode&&t.length===0),i||(e.reading=!1),u||(e.flowing&&e.length===0&&!e.sync?(n.emit("data",t),n.read(0)):(e.length+=e.objectMode?1:t.length,i?e.buffer.unshift(t):e.buffer.push(t),e.needReadable&&P1(n))),S$(n,e)}else i||(e.reading=!1);return w$(e)}function w$(n){return!n.ended&&(n.needReadable||n.length<n.highWaterMark||n.length===0)}fn.prototype.setEncoding=function(n){return this._readableState.decoder=new Kd(n),this._readableState.encoding=n,this};var qC=8388608;function _$(n){return n>=qC?n=qC:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n}function jC(n,e){return n<=0||e.length===0&&e.ended?0:e.objectMode?1:n!==n?e.flowing&&e.length?e.buffer.head.data.length:e.length:(n>e.highWaterMark&&(e.highWaterMark=_$(n)),n<=e.length?n:e.ended?e.length:(e.needReadable=!0,0))}fn.prototype.read=function(n){Mt("read",n),n=parseInt(n,10);var e=this._readableState,t=n;if(n!==0&&(e.emittedReadable=!1),n===0&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return Mt("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Uy(this):P1(this),null;if(n=jC(n,e),n===0&&e.ended)return e.length===0&&Uy(this),null;var r=e.needReadable;Mt("need readable",r),(e.length===0||e.length-n<e.highWaterMark)&&(r=!0,Mt("length less than watermark",r)),e.ended||e.reading?(r=!1,Mt("reading or ended",r)):r&&(Mt("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(n=jC(t,e)));var i;return n>0?i=sM(n,e):i=null,i===null?(e.needReadable=!0,n=0):e.length-=n,e.length===0&&(e.ended||(e.needReadable=!0),t!==n&&e.ended&&Uy(this)),i!==null&&this.emit("data",i),i};function k$(n,e){var t=null;return!VT(e)&&typeof e!="string"&&e!==null&&e!==void 0&&!n.objectMode&&(t=new TypeError("Invalid non-string/buffer chunk")),t}function x$(n,e){if(!e.ended){if(e.decoder){var t=e.decoder.end();t&&t.length&&(e.buffer.push(t),e.length+=e.objectMode?1:t.length)}e.ended=!0,P1(n)}}function P1(n){var e=n._readableState;e.needReadable=!1,e.emittedReadable||(Mt("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?Wr($C,n):$C(n))}function $C(n){Mt("emit readable"),n.emit("readable"),X2(n)}function S$(n,e){e.readingMore||(e.readingMore=!0,Wr(C$,n,e))}function C$(n,e){for(var t=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(Mt("maybeReadMore read 0"),n.read(0),t!==e.length);)t=e.length;e.readingMore=!1}fn.prototype._read=function(n){this.emit("error",new Error("not implemented"))};fn.prototype.pipe=function(n,e){var t=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=n;break;case 1:r.pipes=[r.pipes,n];break;default:r.pipes.push(n);break}r.pipesCount+=1,Mt("pipe count=%d opts=%j",r.pipesCount,e);var i=!e||e.end!==!1,s=i?a:c;r.endEmitted?Wr(s):t.once("end",s),n.on("unpipe",o);function o(w){Mt("onunpipe"),w===t&&c()}function a(){Mt("onend"),n.end()}var u=E$(t);n.on("drain",u);var l=!1;function c(){Mt("cleanup"),n.removeListener("close",m),n.removeListener("finish",y),n.removeListener("drain",u),n.removeListener("error",g),n.removeListener("unpipe",o),t.removeListener("end",a),t.removeListener("end",c),t.removeListener("data",d),l=!0,r.awaitDrain&&(!n._writableState||n._writableState.needDrain)&&u()}var f=!1;t.on("data",d);function d(w){Mt("ondata"),f=!1;var S=n.write(w);S===!1&&!f&&((r.pipesCount===1&&r.pipes===n||r.pipesCount>1&&oM(r.pipes,n)!==-1)&&!l&&(Mt("false write response, pause",t._readableState.awaitDrain),t._readableState.awaitDrain++,f=!0),t.pause())}function g(w){Mt("onerror",w),b(),n.removeListener("error",g),b$(n,"error")===0&&n.emit("error",w)}y$(n,"error",g);function m(){n.removeListener("finish",y),b()}n.once("close",m);function y(){Mt("onfinish"),n.removeListener("close",m),b()}n.once("finish",y);function b(){Mt("unpipe"),t.unpipe(n)}return n.emit("pipe",t),r.flowing||(Mt("pipe resume"),t.resume()),n};function E$(n){return function(){var e=n._readableState;Mt("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,e.awaitDrain===0&&n.listeners("data").length&&(e.flowing=!0,X2(n))}}fn.prototype.unpipe=function(n){var e=this._readableState;if(e.pipesCount===0)return this;if(e.pipesCount===1)return n&&n!==e.pipes?this:(n||(n=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,n&&n.emit("unpipe",this),this);if(!n){var t=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i<r;i++)t[i].emit("unpipe",this);return this}var s=oM(e.pipes,n);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),n.emit("unpipe",this),this)};fn.prototype.on=function(n,e){var t=mt.prototype.on.call(this,n,e);if(n==="data")this._readableState.flowing!==!1&&this.resume();else if(n==="readable"){var r=this._readableState;!r.endEmitted&&!r.readableListening&&(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&P1(this):Wr(R$,this))}return t};fn.prototype.addListener=fn.prototype.on;function R$(n){Mt("readable nexttick read 0"),n.read(0)}fn.prototype.resume=function(){var n=this._readableState;return n.flowing||(Mt("resume"),n.flowing=!0,A$(this,n)),this};function A$(n,e){e.resumeScheduled||(e.resumeScheduled=!0,Wr(D$,n,e))}function D$(n,e){e.reading||(Mt("resume read 0"),n.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,n.emit("resume"),X2(n),e.flowing&&!e.reading&&n.read(0)}fn.prototype.pause=function(){return Mt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Mt("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function X2(n){var e=n._readableState;for(Mt("flow",e.flowing);e.flowing&&n.read()!==null;);}fn.prototype.wrap=function(n){var e=this._readableState,t=!1,r=this;n.on("end",function(){if(Mt("wrapped end"),e.decoder&&!e.ended){var o=e.decoder.end();o&&o.length&&r.push(o)}r.push(null)}),n.on("data",function(o){if(Mt("wrapped data"),e.decoder&&(o=e.decoder.write(o)),!(e.objectMode&&o==null)&&!(!e.objectMode&&(!o||!o.length))){var a=r.push(o);a||(t=!0,n.pause())}});for(var i in n)this[i]===void 0&&typeof n[i]=="function"&&(this[i]=function(o){return function(){return n[o].apply(n,arguments)}}(i));var s=["error","close","destroy","pause","resume"];return I$(s,function(o){n.on(o,r.emit.bind(r,o))}),r._read=function(o){Mt("wrapped _read",o),t&&(t=!1,n.resume())},r};fn._fromList=sM;function sM(n,e){if(e.length===0)return null;var t;return e.objectMode?t=e.buffer.shift():!n||n>=e.length?(e.decoder?t=e.buffer.join(""):e.buffer.length===1?t=e.buffer.head.data:t=e.buffer.concat(e.length),e.buffer.clear()):t=T$(n,e.buffer,e.decoder),t}function T$(n,e,t){var r;return n<e.head.data.length?(r=e.head.data.slice(0,n),e.head.data=e.head.data.slice(n)):n===e.head.data.length?r=e.shift():r=t?M$(n,e):O$(n,e),r}function M$(n,e){var t=e.head,r=1,i=t.data;for(n-=i.length;t=t.next;){var s=t.data,o=n>s.length?s.length:n;if(o===s.length?i+=s:i+=s.slice(0,n),n-=o,n===0){o===s.length?(++r,t.next?e.head=t.next:e.head=e.tail=null):(e.head=t,t.data=s.slice(o));break}++r}return e.length-=r,i}function O$(n,e){var t=he.allocUnsafe(n),r=e.head,i=1;for(r.data.copy(t),n-=r.data.length;r=r.next;){var s=r.data,o=n>s.length?s.length:n;if(s.copy(t,t.length-n,0,o),n-=o,n===0){o===s.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=s.slice(o));break}++i}return e.length-=i,t}function Uy(n){var e=n._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,Wr(P$,e,n))}function P$(n,e){!n.endEmitted&&n.length===0&&(n.endEmitted=!0,e.readable=!1,e.emit("end"))}function I$(n,e){for(var t=0,r=n.length;t<r;t++)e(n[t],t)}function oM(n,e){for(var t=0,r=n.length;t<r;t++)if(n[t]===e)return t;return-1}rr.WritableState=Z2;qc(rr,mt);function L$(){}function F$(n,e,t){this.chunk=n,this.encoding=e,this.callback=t,this.next=null}function Z2(n,e){Object.defineProperty(this,"buffer",{get:eM(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")}),n=n||{},this.objectMode=!!n.objectMode,e instanceof es&&(this.objectMode=this.objectMode||!!n.writableObjectMode);var t=n.highWaterMark,r=this.objectMode?16:16*1024;this.highWaterMark=t||t===0?t:r,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var i=n.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=n.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(s){z$(e,s)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new cM(this)}Z2.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t};function rr(n){if(!(this instanceof rr)&&!(this instanceof es))return new rr(n);this._writableState=new Z2(n,this),this.writable=!0,n&&(typeof n.write=="function"&&(this._write=n.write),typeof n.writev=="function"&&(this._writev=n.writev)),mt.call(this)}rr.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function N$(n,e){var t=new Error("write after end");n.emit("error",t),Wr(e,t)}function B$(n,e,t,r){var i=!0,s=!1;return t===null?s=new TypeError("May not write null values to stream"):!he.isBuffer(t)&&typeof t!="string"&&t!==void 0&&!e.objectMode&&(s=new TypeError("Invalid non-string/buffer chunk")),s&&(n.emit("error",s),Wr(r,s),i=!1),i}rr.prototype.write=function(n,e,t){var r=this._writableState,i=!1;return typeof e=="function"&&(t=e,e=null),he.isBuffer(n)?e="buffer":e||(e=r.defaultEncoding),typeof t!="function"&&(t=L$),r.ended?N$(this,t):B$(this,r,n,t)&&(r.pendingcb++,i=j$(this,r,n,e,t)),i};rr.prototype.cork=function(){var n=this._writableState;n.corked++};rr.prototype.uncork=function(){var n=this._writableState;n.corked&&(n.corked--,!n.writing&&!n.corked&&!n.finished&&!n.bufferProcessing&&n.bufferedRequest&&aM(this,n))};rr.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this};function q$(n,e,t){return!n.objectMode&&n.decodeStrings!==!1&&typeof e=="string"&&(e=he.from(e,t)),e}function j$(n,e,t,r,i){t=q$(e,t,r),he.isBuffer(t)&&(r="buffer");var s=e.objectMode?1:t.length;e.length+=s;var o=e.length<e.highWaterMark;if(o||(e.needDrain=!0),e.writing||e.corked){var a=e.lastBufferedRequest;e.lastBufferedRequest=new F$(t,r,i),a?a.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else hw(n,e,!1,s,t,r,i);return o}function hw(n,e,t,r,i,s,o){e.writelen=r,e.writecb=o,e.writing=!0,e.sync=!0,t?n._writev(i,e.onwrite):n._write(i,s,e.onwrite),e.sync=!1}function $$(n,e,t,r,i){--e.pendingcb,t?Wr(i,r):i(r),n._writableState.errorEmitted=!0,n.emit("error",r)}function W$(n){n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0}function z$(n,e){var t=n._writableState,r=t.sync,i=t.writecb;if(W$(t),e)$$(n,t,r,e,i);else{var s=uM(t);!s&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&aM(n,t),r?Wr(WC,n,t,s,i):WC(n,t,s,i)}}function WC(n,e,t,r){t||U$(n,e),e.pendingcb--,r(),lM(n,e)}function U$(n,e){e.length===0&&e.needDrain&&(e.needDrain=!1,n.emit("drain"))}function aM(n,e){e.bufferProcessing=!0;var t=e.bufferedRequest;if(n._writev&&t&&t.next){var r=e.bufferedRequestCount,i=new Array(r),s=e.corkedRequestsFree;s.entry=t;for(var o=0;t;)i[o]=t,t=t.next,o+=1;hw(n,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new cM(e)}else{for(;t;){var a=t.chunk,u=t.encoding,l=t.callback,c=e.objectMode?1:a.length;if(hw(n,e,!1,c,a,u,l),t=t.next,e.writing)break}t===null&&(e.lastBufferedRequest=null)}e.bufferedRequestCount=0,e.bufferedRequest=t,e.bufferProcessing=!1}rr.prototype._write=function(n,e,t){t(new Error("not implemented"))};rr.prototype._writev=null;rr.prototype.end=function(n,e,t){var r=this._writableState;typeof n=="function"?(t=n,n=null,e=null):typeof e=="function"&&(t=e,e=null),n!=null&&this.write(n,e),r.corked&&(r.corked=1,this.uncork()),!r.ending&&!r.finished&&H$(this,r,t)};function uM(n){return n.ending&&n.length===0&&n.bufferedRequest===null&&!n.finished&&!n.writing}function zC(n,e){e.prefinished||(e.prefinished=!0,n.emit("prefinish"))}function lM(n,e){var t=uM(e);return t&&(e.pendingcb===0?(zC(n,e),e.finished=!0,n.emit("finish")):zC(n,e)),t}function H$(n,e,t){e.ending=!0,lM(n,e),t&&(e.finished?Wr(t):n.once("finish",t)),e.ended=!0,n.writable=!1}function cM(n){var e=this;this.next=null,this.entry=null,this.finish=function(t){var r=e.entry;for(e.entry=null;r;){var i=r.callback;n.pendingcb--,i(t),r=r.next}n.corkedRequestsFree?n.corkedRequestsFree.next=e:n.corkedRequestsFree=e}}qc(es,fn);var UC=Object.keys(rr.prototype);for(var Hy=0;Hy<UC.length;Hy++){var Vy=UC[Hy];es.prototype[Vy]||(es.prototype[Vy]=rr.prototype[Vy])}function es(n){if(!(this instanceof es))return new es(n);fn.call(this,n),rr.call(this,n),n&&n.readable===!1&&(this.readable=!1),n&&n.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,n&&n.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",V$)}function V$(){this.allowHalfOpen||this._writableState.ended||Wr(G$,this)}function G$(n){n.end()}qc(ho,es);function K$(n){this.afterTransform=function(e,t){return J$(n,e,t)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function J$(n,e,t){var r=n._transformState;r.transforming=!1;var i=r.writecb;if(!i)return n.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,t!=null&&n.push(t),i(e);var s=n._readableState;s.reading=!1,(s.needReadable||s.length<s.highWaterMark)&&n._read(s.highWaterMark)}function ho(n){if(!(this instanceof ho))return new ho(n);es.call(this,n),this._transformState=new K$(this);var e=this;this._readableState.needReadable=!0,this._readableState.sync=!1,n&&(typeof n.transform=="function"&&(this._transform=n.transform),typeof n.flush=="function"&&(this._flush=n.flush)),this.once("prefinish",function(){typeof this._flush=="function"?this._flush(function(t){HC(e,t)}):HC(e)})}ho.prototype.push=function(n,e){return this._transformState.needTransform=!1,es.prototype.push.call(this,n,e)};ho.prototype._transform=function(n,e,t){throw new Error("Not implemented")};ho.prototype._write=function(n,e,t){var r=this._transformState;if(r.writecb=t,r.writechunk=n,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};ho.prototype._read=function(n){var e=this._transformState;e.writechunk!==null&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};function HC(n,e){if(e)return n.emit("error",e);var t=n._writableState,r=n._transformState;if(t.length)throw new Error("Calling transform done when ws.length != 0");if(r.transforming)throw new Error("Calling transform done when still transforming");return n.push(null)}qc(ld,ho);function ld(n){if(!(this instanceof ld))return new ld(n);ho.call(this,n)}ld.prototype._transform=function(n,e,t){t(null,n)};qc(ra,mt);ra.Readable=fn;ra.Writable=rr;ra.Duplex=es;ra.Transform=ho;ra.PassThrough=ld;ra.Stream=ra;function ra(){mt.call(this)}ra.prototype.pipe=function(n,e){var t=this;function r(c){n.writable&&n.write(c)===!1&&t.pause&&t.pause()}t.on("data",r);function i(){t.readable&&t.resume&&t.resume()}n.on("drain",i),!n._isStdio&&(!e||e.end!==!1)&&(t.on("end",o),t.on("close",a));var s=!1;function o(){s||(s=!0,n.end())}function a(){s||(s=!0,typeof n.destroy=="function"&&n.destroy())}function u(c){if(l(),mt.listenerCount(this,"error")===0)throw c}t.on("error",u),n.on("error",u);function l(){t.removeListener("data",r),n.removeListener("drain",i),t.removeListener("end",o),t.removeListener("close",a),t.removeListener("error",u),n.removeListener("error",u),t.removeListener("end",l),t.removeListener("close",l),n.removeListener("close",l)}return t.on("end",l),t.on("close",l),n.on("close",l),n.emit("pipe",t),n};var VC=function(n){la(e,n);function e(t,r,i){sr(this,e);var s=ua(this,(e.__proto__||Ht(e)).call(this,{highWaterMark:r.highWaterMark,encoding:r.encoding}));return s._fs=i,s.bytesRead=0,s.path=t,s.fd=r.fd===void 0?null:r.fd,s.flags=r.flags===void 0?"r":r.flags,s.mode=r.mode===void 0?zi:r.mode,s.autoClose=r.autoClose===void 0?!0:r.autoClose,s.start=r.start,s.end=r.end===void 0?1/0:r.end,s.pos=r.start,typeof s.fd!="number"&&s._open(),Yn(e.prototype.__proto__||Ht(e.prototype),"on",s).call(s,"end",function(){s.autoClose&&s.destroy()}),s}return wr(e,[{key:"_open",value:function(){var r=this;this._fs.open(this.path,this.flags,this.mode,function(i,s){if(i){r.autoClose&&r.destroy(),Yn(e.prototype.__proto__||Ht(e.prototype),"emit",r).call(r,"error",i);return}r.fd=s,Yn(e.prototype.__proto__||Ht(e.prototype),"emit",r).call(r,"open",s),Yn(e.prototype.__proto__||Ht(e.prototype),"read",r).call(r)})}},{key:"_read",value:function(r){var i=this;if(typeof this.fd!="number"){Yn(e.prototype.__proto__||Ht(e.prototype),"once",this).call(this,"open",function(){i._read(r)});return}if(!this.destroyed){if(this.pos!=null&&(r=Math.min(this.end-this.pos+1,r)),r<=0){this.push(null);return}this._fs.read(this.fd,he.allocUnsafe(r),0,r,this.pos,function(s,o,a){if(s){i.autoClose&&i.destroy(),Yn(e.prototype.__proto__||Ht(e.prototype),"emit",i).call(i,"error",s);return}o>0?(i.bytesRead+=o,i.push(a.slice(0,o))):i.push(null)}),this.pos!=null&&(this.pos+=r)}}},{key:"_destroy",value:function(r,i){this._close(function(s){i(r||s)})}},{key:"_close",value:function(r){var i=this;if(r&&Yn(e.prototype.__proto__||Ht(e.prototype),"once",this).call(this,"close",r),typeof this.fd!="number"){Yn(e.prototype.__proto__||Ht(e.prototype),"once",this).call(this,"open",function(){i._close()});return}if(this.closed)return Wr(function(){return Yn(e.prototype.__proto__||Ht(e.prototype),"emit",i).call(i,"close")});this.closed=!0,this._fs.close(this.fd,function(s){s?i.emit("error",s):i.emit("close")}),this.fd=null}}]),e}(fn),GC=function(n){la(e,n);function e(t,r,i){sr(this,e);var s=ua(this,(e.__proto__||Ht(e)).call(this,{highWaterMark:r.highWaterMark}));return s._fs=i,s.bytesWritten=0,s.path=t,s.fd=r.fd===void 0?null:r.fd,s.flags=r.flags===void 0?"w":r.flags,s.mode=r.mode===void 0?zi:r.mode,s.autoClose=r.autoClose===void 0?!0:r.autoClose,s.start=r.start,s.pos=s.start,r.encoding&&Yn(e.prototype.__proto__||Ht(e.prototype),"setDefaultEncoding",s).call(s,r.encoding),typeof s.fd!="number"&&s._open(),Yn(e.prototype.__proto__||Ht(e.prototype),"on",s).call(s,"finish",function(){s.autoClose&&s.destroy()}),s}return wr(e,[{key:"_open",value:function(){var r=this;this._fs.open(this.path,this.flags,this.mode,function(i,s){if(i){r.autoClose&&r.destroy(),Yn(e.prototype.__proto__||Ht(e.prototype),"emit",r).call(r,"error",i);return}r.fd=s,Yn(e.prototype.__proto__||Ht(e.prototype),"emit",r).call(r,"open",s)})}},{key:"_write",value:function(r,i,s){var o=this;if(typeof this.fd!="number")return Yn(e.prototype.__proto__||Ht(e.prototype),"once",this).call(this,"open",function(){o._write(r,i,s)});this._fs.write(this.fd,r,0,r.length,this.pos,function(a,u){if(a){o.autoClose&&o.destroy(),s(a);return}o.bytesWritten+=u,s()}),this.pos!==void 0&&(this.pos+=r.length)}},{key:"_writev",value:function(r,i){this._write(he.concat(r.map(function(s){return s.chunk})),void 0,i)}},{key:"_destroy",value:function(r,i){this._close(function(s){i(r||s)})}},{key:"_close",value:function(r){var i=this;if(r&&Yn(e.prototype.__proto__||Ht(e.prototype),"once",this).call(this,"close",r),typeof this.fd!="number"){Yn(e.prototype.__proto__||Ht(e.prototype),"once",this).call(this,"open",function(){i._close()});return}if(this.closed)return Wr(function(){return Yn(e.prototype.__proto__||Ht(e.prototype),"emit",i).call(i,"close")});this.closed=!0,this._fs.close(this.fd,function(s){s?i.emit("error",s):i.emit("close")}),this.fd=null}},{key:"_final",value:function(r){r()}}]),e}(rr),KC=Ry.posix?Ry.posix.join:Ry.join,et=function(e){if(e)throw e},fM=function(){function n(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:18,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new z2,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:new V6(r),s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:new K6(i);sr(this,n);var o=void 0;if(typeof t=="number"){if(o=i.getINode(t),!(o instanceof ln))throw TypeError("rootIndex must point to a root directory")}else{var a=i.createINode(ln,{mode:Kq,uid:Vs,gid:tw}),u=ei(a,1);o=u[0]}this._uid=Vs,this._gid=tw,this._umask=e,this._devMgr=r,this._iNodeMgr=i,this._fdMgr=s,this._root=o,this._cwd=new Gq(i,o),this.constants=ie,this.ReadStream=VC,this.WriteStream=GC}return wr(n,[{key:"getUmask",value:function(){return this._umask}},{key:"setUmask",value:function(t){this._umask=t}},{key:"getUid",value:function(){return this._uid}},{key:"setUid",value:function(t){this._uid=t}},{key:"getGid",value:function(){return this._gid}},{key:"setGid",value:function(t){this._gid=t}},{key:"getCwd",value:function(){return this._cwd.getPath()}},{key:"chdir",value:function(t){t=this._getPath(t);var r=this._navigate(t,!0);if(!r.target)throw new ue(ce.ENOENT,t);if(!(r.target instanceof ln))throw new ue(ce.ENOTDIR,t);if(!this._checkPermissions(ie.X_OK,r.target.getMetadata()))throw new ue(ce.EACCES,t);this._cwd.changeDir(r.target,r.pathStack)}},{key:"access",value:function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var o=i.findIndex(function(u){return typeof u=="function"}),a=i[o]||et;o=o>=0?o:i.length,this._callAsync(this.accessSync.bind(this),[t].concat(un(i.slice(0,o))),a,a)}},{key:"accessSync",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ie.F_OK;t=this._getPath(t);var i=this._navigate(t,!0).target;if(!i)throw new ue(ce.ENOENT,t);if(r!==ie.F_OK&&!this._checkPermissions(r,i.getMetadata()))throw new ue(ce.EACCES,t)}},{key:"appendFile",value:function(t,r){for(var i=arguments.length,s=Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];var a=s.findIndex(function(l){return typeof l=="function"}),u=s[a]||et;a=a>=0?a:s.length,this._callAsync(this.appendFileSync.bind(this),[t,r].concat(un(s.slice(0,a))),u,u)}},{key:"appendFileSync",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"undefined",i=arguments[2];i=this._getOptions({encoding:"utf8",mode:zi,flag:"a"},i),r=this._getBuffer(r,i.encoding);var s=void 0;try{var o=void 0;if(typeof t=="number"){if(o=this._fdMgr.getFd(t),!o)throw new ue(ce.EBADF,null,null,"appendFile");if(!(o.getFlags()&(ie.O_WRONLY|ie.O_RDWR)))throw new ue(ce.EBADF,null,null,"appendFile")}else{var a=this._openSync(t,i.flag,i.mode),u=ei(a,2);o=u[0],s=u[1]}try{o.write(r,null,ie.O_APPEND)}catch(l){throw l instanceof RangeError?new ue(ce.EFBIG,null,null,"appendFile"):l}}finally{s!==void 0&&this.closeSync(s)}}},{key:"chmod",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:et;this._callAsync(this.chmodSync.bind(this),[t,r],i,i)}},{key:"chmodSync",value:function(t,r){t=this._getPath(t);var i=this._navigate(t,!0).target;if(!i)throw new ue(ce.ENOENT,t);if(typeof r!="number")throw new TypeError("mode must be an integer");var s=i.getMetadata();if(this._uid!==Vs&&this._uid!==s.uid)throw new ue(ce.EPERM,null,null,"chmod");s.mode=s.mode&ie.S_IFMT|r}},{key:"chown",value:function(t,r,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:et;this._callAsync(this.chownSync.bind(this),[t,r,i],s,s)}},{key:"chownSync",value:function(t,r,i){t=this._getPath(t);var s=this._navigate(t,!0).target;if(!s)throw new ue(ce.ENOENT,t);var o=s.getMetadata();if(this._uid!==Vs){if(o.uid!==this._uid)throw new ue(ce.EPERM,null,null,"chown");if(this._uid!==r)throw new ue(ce.EPERM,null,null,"chown")}typeof r=="number"&&(o.uid=r),typeof i=="number"&&(o.gid=i)}},{key:"chownr",value:function(t,r,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:et;this._callAsync(this.chownrSync.bind(this),[t,r,i],s,s)}},{key:"chownrSync",value:function(t,r,i){var s=this;t=this._getPath(t),this.chownSync(t,r,i);var o=void 0;try{o=this.readdirSync(t)}catch(a){if(a&&a.code==="ENOTDIR")return;throw a}o.forEach(function(a){var u=KC(t,a);s.lstatSync(u).isSymbolicLink()||s.chownrSync(u,r,i)})}},{key:"close",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:et;this._callAsync(this.closeSync.bind(this),[t],r,r)}},{key:"closeSync",value:function(t){if(!this._fdMgr.getFd(t))throw new ue(ce.EBADF,null,null,"close");this._fdMgr.deleteFd(t)}},{key:"copyFile",value:function(t,r){for(var i=arguments.length,s=Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];var a=s.findIndex(function(l){return typeof l=="function"}),u=s[a]||et;a=a>=0?a:s.length,this._callAsync(this.copyFileSync.bind(this),[t,r].concat(un(s.slice(0,a))),u,u)}},{key:"copyFileSync",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;t=this._getPath(t),r=this._getPath(r);var s=void 0,o=void 0,a=void 0,u=void 0;try{var l=this._openSync(t,ie.O_RDONLY),c=ei(l,2);s=c[0],o=c[1];var f=s.getINode();if(f instanceof ln)throw new ue(ce.EBADF,t,r);var d=ie.WRONLY|ie.O_CREAT;i&ie.COPYFILE_EXCL&&(d|=ie.O_EXCL);var g=this._openSync(r,d,f.getMetadata().mode),m=ei(g,2);a=m[0],u=m[1];var y=a.getINode();if(y instanceof xi)y.setData(NC(f.getData()));else throw new ue(ce.EINVAL,t,r)}finally{o!==void 0&&this.closeSync(o),u!==void 0&&this.closeSync(u)}}},{key:"createReadStream",value:function(t,r){if(t=this._getPath(t),r=this._getOptions({flags:"r",encoding:null,fd:null,mode:zi,autoClose:!0,end:1/0},r),r.start!==void 0&&r.start>r.end)throw new RangeError("ERR_VALUE_OUT_OF_RANGE");return new VC(t,r,this)}},{key:"createWriteStream",value:function(t,r){if(t=this._getPath(t),r=this._getOptions({flags:"w",defaultEncoding:"utf8",fd:null,mode:zi,autoClose:!0},r),r.start!==void 0&&r.start<0)throw new RangeError("ERR_VALUE_OUT_OF_RANGE");return new GC(t,r,this)}},{key:"exists",value:function(t,r){r||(r=function(){}),this._callAsync(this.existsSync.bind(this),[t],r,r)}},{key:"existsSync",value:function(t){t=this._getPath(t);try{return!!this._navigate(t,!0).target}catch{return!1}}},{key:"fallocate",value:function(t,r,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:et;this._callAsync(this.fallocateSync.bind(this),[t,r,i],s,s)}},{key:"fallocateSync",value:function(t,r,i){if(r<0||i<=0)throw new ue(ce.EINVAL,null,null,"fallocate");var s=this._fdMgr.getFd(t);if(!s)throw new ue(ce.EBADF,null,null,"fallocate");var o=s.getINode();if(!(o instanceof xi))throw new ue(ce.ENODEV,null,null,"fallocate");if(!(s.getFlags()&(ie.O_WRONLY|ie.O_RDWR)))throw new ue(ce.EBADF,null,null,"fallocate");var a=o.getData(),u=o.getMetadata();if(r+i>a.length){var l=void 0;try{l=Sm(a,r+i-a.length)}catch(c){throw c instanceof RangeError?new ue(ce.EFBIG,null,null,"fallocate"):c}o.setData(l),u.size=l.length}u.ctime=new Date}},{key:"mmap",value:function(t,r,i){for(var s=arguments.length,o=Array(s>3?s-3:0),a=3;a<s;a++)o[a-3]=arguments[a];var u=o.findIndex(function(c){return typeof c=="function"}),l=o[u]||et;u=u>=0?u:o.length,this._callAsync(this.mmapSync.bind(this),[t,r,i].concat(un(o.slice(0,u))),function(c){return l(null,c)},l)}},{key:"mmapSync",value:function(t,r,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(t<1||s<0)throw new ue(ce.EINVAL,null,null,"mmap");var o=this._fdMgr.getFd(i);if(!o)throw new ue(ce.EBADF,null,null,"mmap");var a=o.getFlags()&ie.O_ACCMODE;if(a===ie.O_WRONLY)throw new ue(ce.EACCES,null,null,"mmap");var u=o.getINode();if(!(u instanceof xi))throw new ue(ce.ENODEV,null,null,"mmap");switch(r){case ie.MAP_PRIVATE:return NC(u.getData().slice(s,s+t));case ie.MAP_SHARED:if(a!==ie.O_RDWR)throw new ue(ce.EACCES,null,null,"mmap");return Wq(u,"_data").slice(s,s+t);default:throw new ue(ce.EINVAL,null,null,"mmap")}}},{key:"fchmod",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:et;this._callAsync(this.fchmodSync.bind(this),[t,r],i,i)}},{key:"fchmodSync",value:function(t,r){var i=this._fdMgr.getFd(t);if(!i)throw new ue(ce.EBADF,null,null,"fchmod");if(typeof r!="number")throw new TypeError("mode must be an integer");var s=i.getINode().getMetadata();if(this._uid!==Vs&&this._uid!==s.uid)throw new ue(ce.EPERM,null,null,"fchmod");s.mode=s.mode&ie.S_IMFT|r}},{key:"fchown",value:function(t,r,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:et;this._callAsync(this.fchmodSync.bind(this),[t,r,i],s,s)}},{key:"fchownSync",value:function(t,r,i){var s=this._fdMgr.getFd(t);if(!s)throw new ue(ce.EBADF,null,null,"fchown");var o=s.getINode().getMetadata();if(this._uid!==Vs){if(o.uid!==this._uid)throw new ue(ce.EPERM,null,null,"fchown");if(this._uid!==r)throw new ue(ce.EPERM,null,null,"fchown")}typeof r=="number"&&(o.uid=r),typeof i=="number"&&(o.gid=i)}},{key:"fdatasync",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:et;this._callAsync(this.fchmodSync.bind(this),[t],r,r)}},{key:"fdatasyncSync",value:function(t){if(!this._fdMgr.getFd(t))throw new ue(ce.EBADF,null,null,"fdatasync")}},{key:"fstat",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:et;this._callAsync(this.fstatSync.bind(this),[t],function(i){return r(null,i)},r)}},{key:"fstatSync",value:function(t){var r=this._fdMgr.getFd(t);if(!r)throw new ue(ce.EBADF,null,null,"fstat");return new Qg(Ql({},r.getINode().getMetadata()))}},{key:"fsync",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:et;this._callAsync(this.fsyncSync.bind(this),[t],r,r)}},{key:"fsyncSync",value:function(t){if(!this._fdMgr.getFd(t))throw new ue(ce.EBADF,null,null,"fsync")}},{key:"ftruncate",value:function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var o=i.findIndex(function(u){return typeof u=="function"}),a=i[o]||et;o=o>=0?o:i.length,this._callAsync(this.ftruncateSync.bind(this),[t].concat(un(i.slice(0,o))),a,a)}},{key:"ftruncateSync",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(r<0)throw new ue(ce.EINVAL,null,null,"ftruncate");var i=this._fdMgr.getFd(t);if(!i)throw new ue(ce.EBADF,null,null,"ftruncate");var s=i.getINode();if(!(s instanceof xi))throw new ue(ce.EINVAL,null,null,"ftruncate");if(!(i.getFlags()&(ie.O_WRONLY|ie.O_RDWR)))throw new ue(ce.EINVAL,null,null,"ftruncate");var o=s.getData(),a=s.getMetadata(),u=void 0;try{r>o.length?(u=Sm(o,r),s.setData(u)):r<o.length?(o.resize(r),s.setData(u)):u=o}catch(c){throw c instanceof RangeError?new ue(ce.EFBIG,null,null,"ftruncate"):c}var l=new Date;a.mtime=l,a.ctime=l,a.size=u.length,i.setPos(Math.min(u.length,i.getPos()))}},{key:"futimes",value:function(t,r,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:et;this._callAsync(this.futimesSync.bind(this),[t,r,i],s,s)}},{key:"futimesSync",value:function(t,r,i){var s=this._fdMgr.getFd(t);if(!s)throw new ue(ce.EBADF,null,null,"futimes");var o=s.getINode().getMetadata(),a=void 0,u=void 0;if(typeof r=="number")a=new Date(r*1e3);else if(typeof r=="string")a=new Date(parseInt(r)*1e3);else if(r instanceof Date)a=r;else throw TypeError("atime and mtime must be dates or unixtime in seconds");if(typeof i=="number")u=new Date(i*1e3);else if(typeof i=="string")u=new Date(parseInt(i)*1e3);else if(i instanceof Date)u=i;else throw TypeError("atime and mtime must be dates or unixtime in seconds");o.atime=a,o.mtime=u,o.ctime=new Date}},{key:"lchmod",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:et;this._callAsync(this.lchmodSync.bind(this),[t,r],i,i)}},{key:"lchmodSync",value:function(t,r){t=this._getPath(t);var i=this._navigate(t,!1).target;if(!i)throw new ue(ce.ENOENT,t);if(typeof r!="number")throw new TypeError("mode must be an integer");var s=i.getMetadata();if(this._uid!==Vs&&this._uid!==s.uid)throw new ue(ce.EPERM,null,null,"lchmod");s.mode=s.mode&ie.S_IFMT|r}},{key:"lchown",value:function(t,r,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:et;this._callAsync(this.lchownSync.bind(this),[t,r,i],s,s)}},{key:"lchownSync",value:function(t,r,i){t=this._getPath(t);var s=this._navigate(t,!1).target;if(!s)throw new ue(ce.ENOENT,t);var o=s.getMetadata();if(this._uid!==Vs){if(o.uid!==this._uid)throw new ue(ce.EPERM,null,null,"lchown");if(this._uid!==r)throw new ue(ce.EPERM,null,null,"lchown")}typeof r=="number"&&(o.uid=r),typeof i=="number"&&(o.gid=i)}},{key:"link",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:et;this._callAsync(this.linkSync.bind(this),[t,r],i,i)}},{key:"linkSync",value:function(t,r){t=this._getPath(t),r=this._getPath(r);var i=void 0,s=void 0;if(i=this._navigate(t,!1),s=this._navigate(r,!1),!i.target)throw new ue(ce.ENOENT,t,r,"link");if(i.target instanceof ln)throw new ue(ce.EPERM,t,r,"link");if(s.target)throw new ue(ce.EEXIST,t,r,"link");if(s.dir.getMetadata().nlink<2)throw new ue(ce.ENOENT,t,r,"link");if(!this._checkPermissions(ie.W_OK,s.dir.getMetadata()))throw new ue(ce.EACCES,t,r,"link");var o=i.dir.getEntryIndex(i.name);s.dir.addEntry(s.name,o),i.target.getMetadata().ctime=new Date}},{key:"lseek",value:function(t,r){for(var i=arguments.length,s=Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];var a=s.findIndex(function(l){return typeof l=="function"}),u=s[a]||et;a=a>=0?a:s.length,this._callAsync(this.lseekSync.bind(this),[t,r].concat(un(s.slice(0,a))),u,u)}},{key:"lseekSync",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ie.SEEK_SET,s=this._fdMgr.getFd(t);if(!s)throw new ue(ce.EBADF,null,null,"lseek");if([ie.SEEK_SET,ie.SEEK_CUR,ie.SEEK_END].indexOf(i)===-1)throw new ue(ce.EINVAL,null,null,"lseek");try{s.setPos(r,i)}catch(o){throw o instanceof ue&&o.setSyscall("lseek"),o}}},{key:"lstat",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:et;this._callAsync(this.lstatSync.bind(this),[t],function(i){return r(null,i)},r)}},{key:"lstatSync",value:function(t){t=this._getPath(t);var r=this._navigate(t,!1).target;if(r)return new Qg(Ql({},r.getMetadata()));throw new ue(ce.ENOENT,t)}},{key:"mkdir",value:function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var o=i.findIndex(function(u){return typeof u=="function"}),a=i[o]||et;o=o>=0?o:i.length,this._callAsync(this.mkdirSync.bind(this),[t].concat(un(i.slice(0,o))),a,a)}},{key:"mkdirSync",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nw;t=this._getPath(t),t=t.replace(/(.+?)\/+$/,"$1");var i=this._navigate(t,!0);if(i.target)throw new ue(ce.EEXIST,t,null,"mkdir");if(!i.target&&i.remaining)throw new ue(ce.ENOENT,t,null,"mkdir");if(!i.target){if(i.dir.getMetadata().nlink<2)throw new ue(ce.ENOENT,t,null,"mkdir");if(!this._checkPermissions(ie.W_OK,i.dir.getMetadata()))throw new ue(ce.EACCES,t,null,"mkdir");var s=this._iNodeMgr.createINode(ln,{mode:Wf(r,this._umask),uid:this._uid,gid:this._gid,parent:i.dir.getEntryIndex(".")}),o=ei(s,2),a=o[1];i.dir.addEntry(i.name,a)}}},{key:"mkdirp",value:function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var o=i.findIndex(function(u){return typeof u=="function"}),a=i[o]||et;o=o>=0?o:i.length,this._callAsync(this.mkdirpSync.bind(this),[t].concat(un(i.slice(0,o))),a,a)}},{key:"mkdirpSync",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:nw;t=this._getPath(t),t=t.replace(/(.+?)\/+$/,"$1");for(var i=void 0,s=void 0,o=void 0,a=this._navigate(t,!0);;)if(a.target){if(a.target instanceof ln)break;throw new ue(ce.ENOTDIR,t)}else{if(a.dir.getMetadata().nlink<2)throw new ue(ce.ENOENT,t);if(!this._checkPermissions(ie.W_OK,a.dir.getMetadata()))throw new ue(ce.EACCES,t);var u=this._iNodeMgr.createINode(ln,{mode:Wf(r,this._umask),uid:this._uid,gid:this._gid,parent:a.dir.getEntryIndex(".")}),l=ei(u,2);if(i=l[0],s=l[1],a.dir.addEntry(a.name,s),a.remaining)o=i,a=this._navigateFrom(o,a.remaining,!0);else break}}},{key:"mkdtemp",value:function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var o=i.findIndex(function(u){return typeof u=="function"}),a=i[o]||et;o=o>=0?o:i.length,this._callAsync(this.mkdtempSync.bind(this),[t].concat(un(i.slice(0,o))),function(u){return a(null,u)},a)}},{key:"mknod",value:function(t,r,i,s){for(var o=arguments.length,a=Array(o>4?o-4:0),u=4;u<o;u++)a[u-4]=arguments[u];var l=a.findIndex(function(f){return typeof f=="function"}),c=a[l]||et;l=l>=0?l:a.length,this._callAsync(this.mknodSync.bind(this),[t,r,i,s].concat(un(a.slice(0,l))),c,c)}},{key:"mknodSync",value:function(t,r,i,s){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:zi;t=this._getPath(t);var a=this._navigate(t,!1);if(a.target)throw new ue(ce.EEXIST,t,null,"mknod");if(a.dir.getMetadata().nlink<2)throw new ue(ce.ENOENT,t,null,"mknod");if(!this._checkPermissions(ie.W_OK,a.dir.getMetadata()))throw new ue(ce.EACCES,t,null,"mknod");var u=void 0;switch(r){case ie.S_IFREG:var l=this._iNodeMgr.createINode(xi,{mode:Wf(o,this._umask),uid:this._uid,gid:this._gid}),c=ei(l,2);u=c[1];break;case ie.S_IFCHR:if(typeof i!="number"||typeof s!="number")throw TypeError("major and minor must set as numbers when creating device nodes");if(i>L6||s>F6||s<rw||s<iw)throw new ue(ce.EINVAL,t,null,"mknod");var f=this._iNodeMgr.createINode(Zo,{mode:Wf(o,this._umask),uid:this._uid,gid:this._gid,rdev:vj(i,s)}),d=ei(f,2);u=d[1];break;default:throw new ue(ce.EPERM,t,null,"mknod")}a.dir.addEntry(a.name,u)}},{key:"open",value:function(t,r){for(var i=arguments.length,s=Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];var a=s.findIndex(function(l){return typeof l=="function"}),u=s[a]||et;a=a>=0?a:s.length,this._callAsync(this.openSync.bind(this),[t,r].concat(un(s.slice(0,a))),function(l){return u(null,l)},u)}},{key:"openSync",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zi;return this._openSync(t,r,i)[1]}},{key:"_openSync",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zi;if(t=this._getPath(t),typeof r=="string")switch(r){case"r":case"rs":r=ie.O_RDONLY;break;case"r+":case"rs+":r=ie.O_RDWR;break;case"w":r=ie.O_WRONLY|ie.O_CREAT|ie.O_TRUNC;break;case"wx":r=ie.O_WRONLY|ie.O_CREAT|ie.O_TRUNC|ie.O_EXCL;break;case"w+":r=ie.O_RDWR|ie.O_CREAT|ie.O_TRUNC;break;case"wx+":r=ie.O_RDWR|ie.O_CREAT|ie.O_TRUNC|ie.O_EXCL;break;case"a":r=ie.O_WRONLY|ie.O_APPEND|ie.O_CREAT;break;case"ax":r=ie.O_WRONLY|ie.O_APPEND|ie.O_CREAT|ie.O_EXCL;break;case"a+":r=ie.O_RDWR|ie.O_APPEND|ie.O_CREAT;break;case"ax+":r=ie.O_RDWR|ie.O_APPEND|ie.O_CREAT|ie.O_EXCL;break;default:throw new TypeError("Unknown file open flag: "+r)}if(typeof r!="number")throw new TypeError("Unknown file open flag: "+r);var s=this._navigate(t,!1);if(s.target instanceof Kh){if(r&ie.O_NOFOLLOW)throw new ue(ce.ELOOP,t,null,"open");s=this._navigateFrom(s.dir,s.name+s.remaining,!0,void 0,void 0,t)}var o=s.target;if(o){if(r&ie.O_CREAT&&r&ie.O_EXCL)throw new ue(ce.EEXIST,t,null,"open");if(o instanceof ln&&r&(ie.O_WRONLY|r&ie.O_RDWR))throw new ue(ce.EISDIR,t,null,"open");if(r&ie.O_DIRECTORY&&!(o instanceof ln))throw new ue(ce.ENOTDIR,t,null,"open");r&ie.O_TRUNC&&o instanceof xi&&r&(ie.O_WRONLY|ie.O_RDWR)&&o.setData(new ArrayBuffer(0));var c=void 0;if(r&ie.O_RDWR?c=ie.R_OK|ie.W_OK:r&ie.O_WRONLY?c=ie.W_OK:c=ie.R_OK,!this._checkPermissions(c,o.getMetadata()))throw new ue(ce.EACCES,t,null,"open")}else if(!s.remaining&&r&ie.O_CREAT){if(s.dir.getMetadata().nlink<2)throw new ue(ce.ENOENT,t,null,"open");if(!this._checkPermissions(ie.W_OK,s.dir.getMetadata()))throw new ue(ce.EACCES,t,null,"open");var a=void 0,u=this._iNodeMgr.createINode(xi,{mode:Wf(i,this._umask),uid:this._uid,gid:this._gid}),l=ei(u,2);o=l[0],a=l[1],s.dir.addEntry(s.name,a)}else throw new ue(ce.ENOENT,t,null,"open");try{var f=this._fdMgr.createFd(o,r);return f}catch(d){throw d instanceof ue&&(d.setPaths(t),d.setSyscall("open")),d}}},{key:"read",value:function(t,r){for(var i=arguments.length,s=Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];var a=s.findIndex(function(l){return typeof l=="function"}),u=s[a]||et;a=a>=0?a:s.length,this._callAsync(this.readSync.bind(this),[t,r].concat(un(s.slice(0,a))),function(l){return u(null,l,r)},u)}},{key:"readSync",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,a=this._fdMgr.getFd(t);if(!a)throw new ue(ce.EBADF,null,null,"read");if(typeof o=="number"&&o<0)throw new ue(ce.EINVAL,null,null,"read");if(a.getINode().getMetadata().isDirectory())throw new ue(ce.EISDIR,null,null,"read");var u=a.getFlags();if(u&ie.O_WRONLY)throw new ue(ce.EBADF,null,null,"read");if(i<0||i>r.length)throw new RangeError("Offset is out of bounds");if(s<0||s>r.length)throw new RangeError("Length extends beyond buffer");r=this._getBuffer(r).slice(i,i+s);var l=void 0;try{l=a.read(r,o)}catch(c){throw c instanceof ue&&(c.syscall="read"),c}return l}},{key:"readdir",value:function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var o=i.findIndex(function(u){return typeof u=="function"}),a=i[o]||et;o=o>=0?o:i.length,this._callAsync(this.readdirSync.bind(this),[t].concat(un(i.slice(0,o))),function(u){return a(null,u)},a)}},{key:"readFile",value:function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var o=i.findIndex(function(u){return typeof u=="function"}),a=i[o]||et;o=o>=0?o:i.length,this._callAsync(this.readFileSync.bind(this),[t].concat(un(i.slice(0,o))),function(u){return a(null,u)},a)}},{key:"readFileSync",value:function(t,r){r=this._getOptions({encoding:null,flag:"r"},r);var i=void 0;try{var s=new ArrayBuffer(4096),o=new ArrayBuffer(0),a=null;if(typeof t=="number")for(;a!==0;)a=this.readSync(t,s,0,s.length),o=lw(o,s.slice(0,a));else for(i=this.openSync(t,r.flag);a!==0;)a=this.readSync(i,s,0,s.length),o=lw(o,s.slice(0,a));return r.encoding?o.toString(r.encoding):o}finally{i!==void 0&&this.closeSync(i)}}},{key:"readlink",value:function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var o=i.findIndex(function(u){return typeof u=="function"}),a=i[o]||et;o=o>=0?o:i.length,this._callAsync(this.readlinkSync.bind(this),[t].concat(un(i.slice(0,o))),function(u){return a(null,u)},a)}},{key:"rename",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:et;this._callAsync(this.renameSync.bind(this),[t,r],i,i)}},{key:"renameSync",value:function(t,r){t=this._getPath(t),r=this._getPath(r);var i=this._navigate(t,!1),s=this._navigate(r,!1);if(!i.target)throw new ue(ce.ENOENT,t,r,"rename");if(i.target instanceof ln){if(s.target&&!(s.target instanceof ln))throw new ue(ce.ENOTDIR,t,r,"rename");if(i.target===this._root||s.target===this._root)throw new ue(ce.EBUSY,t,r,"rename");if(s.target&&[].concat(un(s.target.getEntries())).length-2)throw new ue(ce.ENOTEMPTY,t,r,"rename");if(i.name==="."||i.name===".."||s.name==="."||s.name==="..")throw new ue(ce.EBUSY,t,r,"rename");if(i.pathStack.length<s.pathStack.length){for(var o=!0,a=0;a<i.pathStack.length;++a)if(i.pathStack[a]!==s.pathStack[a]){o=!1;break}if(o)throw new ue(ce.EINVAL,t,r,"rename")}}else if(s.target&&s.target instanceof ln)throw new ue(ce.EISDIR,t,r,"rename");if(!this._checkPermissions(ie.W_OK,i.dir.getMetadata())||!this._checkPermissions(ie.W_OK,s.dir.getMetadata()))throw new ue(ce.EACCES,t,r,"rename");if(i.dir===s.dir){i.dir.renameEntry(i.name,s.name);return}var u=i.dir.getEntryIndex(i.name);if(s.target)s.target.getMetadata().ctime=new Date,s.dir.deleteEntry(s.name),s.dir.addEntry(s.name,u);else{if(s.dir.getMetadata().nlink<2)throw new ue(ce.ENOENT,t,r,"rename");s.dir.addEntry(s.name,u)}i.target.getMetadata().ctime=new Date,i.dir.deleteEntry(i.name)}},{key:"rmdir",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:et;this._callAsync(this.rmdirSync.bind(this),[t],r,r)}},{key:"rmdirSync",value:function(t){t=this._getPath(t),t=t.replace(/(.+?)\/+$/,"$1");var r=this._navigate(t,!1);if(!r.name)throw new ue(ce.EBUSY,t,null,"rmdir");if(r.name==="."||r.name==="..")throw new ue(ce.EINVAL,t,null,"rmdir");if(!r.target)throw new ue(ce.ENOENT,t,null,"rmdir");if(!(r.target instanceof ln))throw new ue(ce.ENOTDIR,t,null,"rmdir");if([].concat(un(r.target.getEntries())).length-2)throw new ue(ce.ENOTEMPTY,t,null,"rmdir");if(!this._checkPermissions(ie.W_OK,r.dir.getMetadata()))throw new ue(ce.EACCES,t,null,"rmdir");r.dir.deleteEntry(r.name)}},{key:"stat",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:et;this._callAsync(this.statSync.bind(this),[t],function(i){return r(null,i)},r)}},{key:"statSync",value:function(t){t=this._getPath(t);var r=this._navigate(t,!0).target;if(r)return new Qg(Ql({},r.getMetadata()));throw new ue(ce.ENOENT,t)}},{key:"symlink",value:function(t,r){for(var i=arguments.length,s=Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];var a=s.findIndex(function(l){return typeof l=="function"}),u=s[a]||et;a=a>=0?a:s.length,this._callAsync(this.symlinkSync.bind(this),[t,r].concat(un(s.slice(0,a))),u,u)}},{key:"symlinkSync",value:function(t,r){if(t=this._getPath(t),r=this._getPath(r),!t)throw new ue(ce.ENOENT,r,t,"symlink");var i=this._navigate(r,!1);if(i.target)throw new ue(ce.EEXIST,r,t,"symlink");if(i.dir.getMetadata().nlink<2)throw new ue(ce.ENOENT,r,t,"symlink");if(!this._checkPermissions(ie.W_OK,i.dir.getMetadata()))throw new ue(ce.EACCES,r,t,"symlink");var s=this._iNodeMgr.createINode(Kh,{mode:E6,uid:this._uid,gid:this._gid,link:t}),o=ei(s,2),a=o[1];i.dir.addEntry(i.name,a)}},{key:"truncate",value:function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),s=1;s<r;s++)i[s-1]=arguments[s];var o=i.findIndex(function(u){return typeof u=="function"}),a=i[o]||et;o=o>=0?o:i.length,this._callAsync(this.truncateSync.bind(this),[t].concat(un(i.slice(0,o))),a,a)}},{key:"truncateSync",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(r<0)throw new ue(ce.EINVAL,null,null,"ftruncate");if(typeof t=="number")this.ftruncateSync(t,r);else{t=this._getPath(t);var i=void 0;try{i=this.openSync(t,ie.O_WRONLY),this.ftruncateSync(i,r)}finally{i!==void 0&&this.closeSync(i)}}}},{key:"unlink",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:et;this._callAsync(this.unlinkSync.bind(this),[t],r,r)}},{key:"unlinkSync",value:function(t){t=this._getPath(t);var r=this._navigate(t,!1);if(!r.target)throw new ue(ce.ENOENT,t);if(!this._checkPermissions(ie.W_OK,r.dir.getMetadata()))throw new ue(ce.EACCES,t);if(r.target instanceof ln)throw new ue(ce.EISDIR,t);r.target.getMetadata().ctime=new Date,r.dir.deleteEntry(r.name)}},{key:"utimes",value:function(t,r,i){var s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:et;this._callAsync(this.utimesSync.bind(this),[t,r,i],s,s)}},{key:"utimesSync",value:function(t,r,i){t=this._getPath(t);var s=this._navigate(t,!0).target;if(!s)throw new ue(ce.ENOENT,t,null,"utimes");var o=s.getMetadata(),a=void 0,u=void 0;if(typeof r=="number")a=new Date(r*1e3);else if(typeof r=="string")a=new Date(parseInt(r)*1e3);else if(r instanceof Date)a=r;else throw TypeError("atime and mtime must be dates or unixtime in seconds");if(typeof i=="number")u=new Date(i*1e3);else if(typeof i=="string")u=new Date(parseInt(i)*1e3);else if(i instanceof Date)u=i;else throw TypeError("atime and mtime must be dates or unixtime in seconds");o.atime=a,o.mtime=u,o.ctime=new Date}},{key:"write",value:function(t,r){for(var i=arguments.length,s=Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];var a=s.findIndex(function(l){return typeof l=="function"}),u=s[a]||et;a=a>=0?a:s.length,this._callAsync(this.writeSync.bind(this),[t,r].concat(un(s.slice(0,a))),function(l){return u(null,l,r)},u)}},{key:"writeSync",value:function(t,r,i,s){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:null,a=this._fdMgr.getFd(t);if(!a)throw new ue(ce.EBADF,null,null,"write");if(typeof o=="number"&&o<0)throw new ue(ce.EINVAL,null,null,"write");var u=a.getFlags();if(!(u&(ie.O_WRONLY|ie.O_RDWR)))throw new ue(ce.EBADF,null,null,"write");var l=void 0;if(typeof r=="string")o=typeof i=="number"?i:null,s=typeof s=="string"?s:"utf8",l=this._getBuffer(r,s);else{if(i=typeof i=="number"?i:0,i<0||i>r.length)throw new RangeError("Offset is out of bounds");if(s=typeof s=="number"?s:r.length,s<0||s>r.length)throw new RangeError("Length is out of bounds");l=this._getBuffer(r).slice(i,i+s)}try{return a.write(l,o)}catch(c){throw c instanceof RangeError?new ue(ce.EFBIG,null,null,"write"):(c instanceof ue&&c.setSyscall("write"),c)}}},{key:"writeFile",value:function(t,r){for(var i=arguments.length,s=Array(i>2?i-2:0),o=2;o<i;o++)s[o-2]=arguments[o];var a=s.findIndex(function(l){return typeof l=="function"}),u=s[a]||et;a=a>=0?a:s.length,this._callAsync(this.writeFileSync.bind(this),[t,r].concat(un(s.slice(0,a))),u,u)}},{key:"writeFileSync",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"undefined",i=arguments[2];i=this._getOptions({encoding:"utf8",mode:zi,flag:"w"},i);var s=void 0;try{var o=this._getBuffer(r,i.encoding);typeof t=="number"?this.writeSync(t,o,0,o.length,0):(s=this.openSync(t,i.flag,i.mode),this.writeSync(s,o,0,o.length,0))}finally{s!==void 0&&this.closeSync(s)}}},{key:"_callAsync",value:function(t,r,i,s){Wr(function(){try{var o=t.apply(void 0,un(r));o=o===void 0?null:o,i(o)}catch(a){s(a)}})}},{key:"_getPath",value:function(t){if(typeof t=="string")return t;if(t instanceof ArrayBuffer)return new TextDecoder().decode(t);if((typeof t>"u"?"undefined":hq(t))==="object"&&typeof t.pathname=="string")return this._getPathFromURL(t);throw new TypeError("path must be a string or Buffer or URL")}},{key:"_getPathFromURL",value:function(t){if(t.hostname)throw new TypeError("ERR_INVALID_FILE_URL_HOST");var r=t.pathname;if(r.match(/%2[fF]/))throw new TypeError("ERR_INVALID_FILE_URL_PATH");return decodeURIComponent(r)}},{key:"_getOptions",value:function(t,r){return typeof r=="string"?Ql({},t,{encoding:r}):Ql({},t,r)}},{key:"_checkPermissions",value:function(t,r){return this._uid!==Vs?Yq(t,this._uid,this._gid,r):!0}},{key:"_parsePath",value:function(t){var r=t.match(/^([\s\S]*?)(?:\/+|$)([\s\S]*)/);if(r){var i=r[1]||"",s=r[2]||"";return{segment:i,rest:s}}else throw new Error("Could not parse pathS: "+t)}},{key:"_navigate",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:t;if(t===void 0)throw new ue(ce.ENOENT,i);return t=t.replace(/\/+/,"/"),t=t.replace(/\/$/,"/."),t[0]==="/"||t===""?(t=t.substring(1),t?this._navigateFrom(this._root,t,r,[],i):{dir:this._root,target:this._root,name:"",remaining:"",pathStack:[]}):this._navigateFrom(this._cwd.getINode(),t,r,this._cwd.getPathStack(),i)}},{key:"_navigateFrom",value:function(t,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:[],o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:r;if(!r)throw new ue(ce.ENOENT,o);if(!this._checkPermissions(ie.X_OK,t.getMetadata()))throw new ue(ce.EACCES,o);var a=this._parsePath(r);a.segment!=="."&&(a.segment===".."?s.pop():s.push(a.segment));var u=void 0,l=void 0,c=t.getEntry(a.segment);if(c instanceof xi||c instanceof Zo||c instanceof V2){if(!a.rest)return{dir:t,target:c,name:a.segment,remaining:"",pathStack:s};throw new ue(ce.ENOTDIR,o)}else if(c instanceof ln){if(!a.rest)return{dir:t,target:c,name:a.segment,remaining:"",pathStack:s};u=c,l=a.rest}else if(c instanceof Kh){if(!i)return{dir:t,target:c,name:a.segment,remaining:a.rest,pathStack:s};if(l=KC(c.getLink(),a.rest),l[0]==="/")return this._navigate(l,i,o);s.pop(),u=t}else return{dir:t,target:null,name:a.segment,remaining:a.rest,pathStack:s};return this._navigateFrom(u,l,i,s,o)}}]),n}(),Y$={setPos:function(e,t,r){e._pos=0},read:function(e,t,r){return 0},write:function(e,t,r,i){return t.length}},X$={setPos:function(e,t,r){e._pos=0},read:function(e,t,r){return t.fill(0),t.length},write:function(e,t,r,i){return t.length}},Z$={setPos:function(e,t,r){e._pos=0},read:function(e,t,r){return t.fill(0),t.length},write:function(e,t,r,i){throw new ue(ce.ENOSPC)}},Bh;typeof window<"u"?Bh=window:typeof rd<"u"?Bh=rd:typeof self<"u"?Bh=self:Bh={};var Gl=Bh,hM={},JC=Object.freeze({default:hM}),YC=JC&&hM||JC;function Q$(n){if(Gl.crypto&&Gl.crypto.getRandomValues)return Gl.crypto.getRandomValues(n);if(typeof Gl.msCrypto=="object"&&typeof Gl.msCrypto.getRandomValues=="function")return Gl.msCrypto.getRandomValues(n);if(YC.randomBytes){if(!(n instanceof Uint8Array))throw new TypeError("expected Uint8Array");if(n.length>65536){var e=new Error;throw e.code=22,e.message="Failed to execute 'getRandomValues' on 'Crypto': The ArrayBufferView's byte length ("+n.length+") exceeds the number of bytes of entropy available via this API (65536).",e.name="QuotaExceededError",e}var t=YC.randomBytes(n.length);return n.set(t),n}else throw new Error("No secure random number generator available.")}var eW=Q$;function tW(){var n=new Uint8Array(1);return eW(n),n[0]}var nW=tW;function rW(n){for(var e="",t=0;t<n;t++)e+=String.fromCharCode(nW());return e}var iW=rW,dM={setPos:function(e,t,r){e._pos=0},read:function(e,t,r){var i=he.from(iW(t.length),"ascii");return i.copy(t),i.length},write:function(e,t,r,i){return t.length}},jc=new z2;jc.registerChr(Y$,1,3);jc.registerChr(X$,1,5);jc.registerChr(Z$,1,7);jc.registerChr(dM,1,8);jc.registerChr(dM,1,9);var _r=new fM(void 0,void 0,jc);_r.mkdirSync("/dev");_r.chmodSync("/dev",509);_r.mknodSync("/dev/null",ie.S_IFCHR,1,3);_r.mknodSync("/dev/zero",ie.S_IFCHR,1,5);_r.mknodSync("/dev/full",ie.S_IFCHR,1,7);_r.mknodSync("/dev/random",ie.S_IFCHR,1,8);_r.mknodSync("/dev/urandom",ie.S_IFCHR,1,9);_r.chmodSync("/dev/null",438);_r.chmodSync("/dev/zero",438);_r.chmodSync("/dev/full",438);_r.chmodSync("/dev/random",438);_r.chmodSync("/dev/urandom",438);_r.mkdirSync("/tmp");_r.chmodSync("/tmp",511);_r.mkdirSync("/root");_r.chmodSync("/root",448);function Q2(n){switch(n.mode&ie.S_IFMT){case ie.S_IFREG:return nd;case ie.S_IFDIR:return vc;case ie.S_IFBLK:return P7;case ie.S_IFCHR:return xT;case ie.S_IFLNK:return tl;case ie.S_IFIFO:return nd;case ie.S_IFSOCK:return I7;default:return O7}}function I1(n){return{dev:BigInt(n.dev),ino:BigInt(n.ino),nlink:BigInt(n.nlink),filetype:Q2(n),size:BigInt(n.size),atim:BigInt(n.atime),mtim:BigInt(n.mtime),ctim:BigInt(n.ctime)}}class pM{virtualFs;constructor(){const e=new z2,t=new V6(e),[r,i]=t.createINode(ln,{}),s=new K6(t);this.virtualFs=new fM(18,i,e,t,s)}fsname(){return"VirtualFilesystem"}async mkdirat(e,t){let r,i;if(e===void 0)r=this.virtualFs._navigate(t,!1);else if(e instanceof Vo)i=e,r=this.virtualFs._navigateFrom(i.dir,t,!1);else return xt;if(r.target)return ro;const[s,o]=this.virtualFs._iNodeMgr.createINode(ln,{mode:nw,uid:0,gid:0,parent:r.dir._dir["."]});return r.dir.addEntry(t,o),fe}async getFilestat(e){try{const t=this.virtualFs.statSync(e);return{err:fe,filestat:I1(t)}}catch(t){return t.errno}}async unlinkat(e,t,r){try{let i;if(e===void 0)i=this.virtualFs._navigate(t,!1);else if(e instanceof Vo)i=this.virtualFs._navigateFrom(e.dir,t,!1);else return xt;if(!i.target)return Ei;if(r)i.target instanceof ln;else if(i instanceof ln)return Lr;return i.dir.deleteEntry(i.name),fe}catch(i){return i.errno}}async open(e,t,r,i,s,o,a){const u=this.virtualFs._navigate(e,!1);if(u.target){let l,c;u.remaining?(l=Ya,c=e.length-u.remaining.length-1):(c=-1,r&uc&&r&Ub?l=ro:l=fe);let f;return u.target instanceof ln?f=new Vo(o,i,s,u.target,this.virtualFs._iNodeMgr):(u.target instanceof xi||u.target instanceof Kh)&&!(r&Xs)?f=new XC(o,i,s,this.virtualFs._fdMgr.createFd(u.target,ie.O_RDWR)[0]):(f=new Vo(o,i,s,u.dir,this.virtualFs._iNodeMgr),r&Xs?l=Ya:(u.target instanceof Zo||u.target instanceof V2)&&(l=kT)),{err:l,index:c,desc:f}}else if(r&uc){let[l,c]=this.virtualFs._iNodeMgr.createINode(xi,{mode:zi,uid:0,gid:0});u.dir.addEntry(u.name,c);const[f,d]=this.virtualFs._fdMgr.createFd(l,ie.O_RDWR);return{err:fe,index:-1,desc:new XC(o,i,s,f)}}else return{err:Ei,index:-1,desc:new Vo(o,i,s,u.dir,this.virtualFs._iNodeMgr)}}async renameat(e,t,r,i){let s,o;if(e===void 0)s=this.virtualFs._navigate(t,!1);else if(e instanceof Vo)o=e,s=this.virtualFs._navigateFrom(o.dir,t,!1);else return xt;let a,u;if(r===void 0)a=this.virtualFs._navigate(i,!1);else if(r instanceof Vo)u=r,a=this.virtualFs._navigateFrom(u.dir,i,!1);else return xt;if(!s.target)return Ei;if(a.target)return ro;if(a.remaining.length!==0)return Ei;const l=s.dir.getEntryIndex(s.name);return a.dir.addEntry(a.name,l),s.dir.deleteEntry(s.name,l),fe}async symlinkat(e,t,r){let i,s;if(t===void 0)i=this.virtualFs._navigate(r,!1);else if(t instanceof Vo)s=t,i=this.virtualFs._navigateFrom(s.dir,r,!1);else return xt;if(i.target)return ro;const[o,a]=this.virtualFs._iNodeMgr.createINode(Kh,{mode:E6,uid:0,gid:0,link:e});return s.dir.addEntry(i.name,a),fe}async initialize(e){return fe}async mknodat(e,t,r,i){return xt}}function gM(n,e,t,r,i){n.fdstat={fs_flags:e,fs_rights_base:t,fs_rights_inheriting:r,fs_filetype:Q2(i)}}class sW extends WritableStream{constructor(e){super({async write(t){await e.write(t.buffer),new WritableStream}})}}class XC extends DT{desc;cursor;constructor(e,t,r,i){super(),this.desc=i,gM(this,e,t,r,i._iNode.getMetadata()),e&ST&&this.fdstat.fs_filetype!==tl?this.cursor=i._iNode._data.byteLength:this.cursor=0}async arrayBuffer(){return{err:fe,buffer:this.desc._iNode._data}}async pread(e,t){return{err:fe,buffer:this.desc._iNode._data.slice(Number(t),e+Number(t))}}async read(e){const t=this.desc._iNode._data.slice(this.cursor,this.cursor+e);return this.cursor+=t.byteLength,{err:fe,buffer:t}}async read_str(){let e;return this.fdstat.fs_filetype===nd?new TextDecoder().decode(e=this.desc._iNode._data):e=this.desc._iNode._link,{err:fe,content:e}}async write(e){try{const t=await this.desc._iNode.write(e,this.cursor);return this.cursor+=t,{err:fe,written:t}}catch(t){return{err:t.errno,written:0n}}}async pwrite(e,t){try{return{err:fe,written:await this.desc._iNode.write(e,Number(t))}}catch(r){return r.errno}}async seek(e,t){let r;switch(this.fdstat.fs_filetype===tl?r=BigInt((await this.desc._iNode._link).length):r=BigInt((await this.desc._iNode._data).byteLength),t){case RT:if(this.cursor+Number(e)<0n)return{offset:BigInt(this.cursor),err:xt};this.cursor+=Number(e);break;case ET:if(e<0n)return{offset:BigInt(this.cursor),err:xt};this.cursor=Number(e);break;case AT:if(r<-e)return{offset:BigInt(this.cursor),err:xt};this.cursor=Number(r+e);break;default:return{offset:BigInt(this.cursor),err:xt}}return{err:fe,offset:BigInt(this.cursor)}}async truncate(e){try{return this.desc._iNode._data.resize(Number(e)),fe}catch(t){return t.errno}}async writableStream(){try{return{err:fe,stream:new sW(this)}}catch(e){return e.errno}}async getFilestat(){return{err:fe,filestat:I1(this.desc._iNode.getMetadata())}}async setFilestatTimes(e,t){return t!==void 0&&(this.desc._iNode._metadata.mtime=t),e!==void 0&&(this.desc._iNode._metadata.atime=e),fe}async close(){return fe}addPollSub(e,t,r){return Promise.resolve({userdata:e,eventType:t,error:fe,nbytes:BigInt(this.desc._iNode._data.byteLength)})}}class Vo extends TT{dir;inodeMgr;dirents;constructor(e,t,r,i,s){super(),this.dir=i,this.inodeMgr=s,gM(this,e,t,r,i.getMetadata()),this.dirents=void 0}async readdir(e){try{return(this.dirents===void 0||e)&&(this.dirents=Array.from(this.dir._dir).filter(([t,r])=>t!=="."&&t!=="..").map(([t,r],i)=>({d_next:BigInt(i+1),d_ino:BigInt(r),name:t,d_type:Q2(this.inodeMgr.getINode(r).getMetadata())}))),{err:fe,dirents:this.dirents}}catch(t){return{err:t.errno,dirents:[]}}}async getFilestat(){return{err:fe,filestat:I1(this.dir.getMetadata())}}async setFilestatTimes(e,t){return t!==void 0&&(this.dir._metadata.mtime=t),e!==void 0&&(this.dir._metadata.atime=e),fe}}class oW extends L7{ino;constructor(e,t,r,i){super(e,t,r),this.ino=i}async getFilestat(){return{err:fe,filestat:I1(this.ino._metadata)}}}class aW extends oW{remover;constructor(e,t,r,i,s){super(e,t,r,i),this.remover=s,(t&Jg)!==0n?this.ino.writer===-1?this.ino.writer=1:this.ino.writer++:(t&Kg)!==0n&&(this.ino.reader===-1?this.ino.reader=1:this.ino.reader++)}isatty(){return!1}async read(e){let t=await this.ino.read();return t.byteLength>e&&t.resize(e),{err:fe,buffer:t}}async write(e){return await this.ino.write(e),{err:fe,written:BigInt(e.byteLength)}}async addPollSub(e,t,r){const i=BigInt(await this.ino.addPollSub());return{userdata:e,error:fe,eventType:t,nbytes:i}}async ioctl(e,t){return this.ino.setMode(e,t[0]!==0),Promise.resolve(fe)}close(){return(this.fdstat.fs_rights_base&Jg)!==0n&&(this.ino.writer--,this.ino.writer===0&&this.ino.sendEof()),(this.fdstat.fs_rights_base&Kg)!==0n&&this.ino.reader--,this.ino.isCloserm()&&this.ino.writer===0&&this.ino.reader===0&&this.remover(),Promise.resolve(fe)}duplicateFd(){(this.fdstat.fs_rights_base&Jg)!==0n&&this.ino.writer++,(this.fdstat.fs_rights_base&Kg)!==0n&&this.ino.reader++}}class uW extends pM{driverManager;async initialize(e){const t=e;return this.driverManager=t.driverManager,fe}fsname(){return"DeviceFilesystem"}async mknodat(e,t,r){let i,s;if(e===void 0)i=this.virtualFs._navigate(t,!1);else if(e instanceof Vo)s=e,i=this.virtualFs._navigateFrom(s.dir,t,!1);else return xt;if(i.target)return ro;if(r<0){const[o,a]=this.virtualFs._iNodeMgr.createINode(V2,{mode:zi,uid:0,gid:0,parent:i.dir._dir["."]});i.dir.addEntry(t,a)}else{const[o,a]=this.virtualFs._iNodeMgr.createINode(Zo,{mode:zi,uid:0,gid:0,rdev:r,parent:i.dir._dir["."]});i.dir.addEntry(t,a)}return fe}async open(e,t,r,i,s,o,a){let u=await super.open(e,t,r,i,s,o,a);if(u.err!==kT)return u;const l=this.virtualFs._navigateFrom(u.desc.dir,pr(e),!1),c=()=>{try{u.desc.dir.deleteEntry(pr(e))}catch{}};if(l.target._metadata.isCharacterDevice()){const[f,d]=N6(l.target._metadata.rdev),g=this.driverManager.getDriver(f),{err:m,desc:y}=await g.getDesc(d,o,i,s,l.target);return m!==fe?u:{err:fe,index:-1,desc:y}}else return a!==-1&&(l.target.isKernW()&&(i&Jg)!==0n||l.target.isKernR()&&(i&Kg)!==0n)?{err:E2,index:-1,desc:void 0}:{err:fe,index:-1,desc:new aW(o,i,s,l.target,c)}}}const lW=40,cW={fsa:H7,vfs:pM,devfs:uW};async function fW(n,e){const t=cW[n];if(t){const r=new t;return{err:await r.initialize(e),filesystem:r}}return{err:xt,filesystem:void 0}}class hW{mounts;watchers;constructor(){this.mounts={},this.watchers=new Set}abspath(e,t){if(e!==void 0&&!t.startsWith("/")){const r=e.getPath();return t.length===0?r:`${r==="/"?"":r}/${t}`}return t}emit(e,t){if(!t)return;const r=h0(t);for(const i of Array.from(this.watchers)){if(i.signal.aborted){this.watchers.delete(i);continue}const s=i.path;let o=!1,a=null;if(r===s)o=!0,a=pr(r);else{const u=s==="/"?"/":s+"/";r.startsWith(u)&&(o=!0,a=r.slice(u.length))}o&&a!==null&&i.enqueue({eventType:e,filename:a,fullPath:r})}}async getDescInfo(e,t,r=0,i=0,s=ti,o=ti,a=0,u=lW){let l=h0(e),c,f;for(c=l.length;c>0;c=l.lastIndexOf("/",c-1)){let y=l.slice(0,c);if(f=this.mounts[y],f!==void 0)break}if(f===void 0&&(f=this.mounts["/"]),f===void 0)throw new Error("No filesystem mounted at root");let{err:d,index:g,desc:m}=await f.open(l.slice(c),r,i,s,o,a,t);if(m){const y=g>-1?l.slice(0,c+g):l;if(await m.initialize(y)!==fe)return{desc:void 0,err:gm,fs:void 0,path:l}}if(r&Qr)switch(d){case fe:case Ya:{let y=m.getFdstat();if(y!==void 0&&y.fs_filetype===tl){if(u===0)return{desc:m,err:T7,fs:f,path:l};let{err:b,content:w}=await m.read_str();if(b!==fe)return{desc:void 0,err:d,fs:f,path:void 0};let S;if(w.startsWith("/"))if(g!==-1){const k=l.slice(c+g);S=w.concat(k)}else S=w;else{let k=g===-1?m.getPath().lastIndexOf("/"):m.getPath().lastIndexOf("/",c+g-1),x=l.slice(0,k+1);if(d===fe)S=x.concat(w);else{let C=l.slice(c+g);S=x.concat(w,C)}}return await this.getDescInfo(S,t,r,i,s,o,a,u-1)}break}default:return{desc:void 0,err:d,fs:f,path:void 0}}return d===fe?(i&CT&&(await m.truncate(0n),this.emit("change",l)),{desc:m,err:d,fs:f,path:l}):{desc:void 0,err:d,fs:f,path:l}}async open(e,t=0,r=0,i=0,s=ti,o=ti,a=-1){return await this.getDescInfo(e,a,t,r,s,o,i)}async openat(e,t,r=0,i=0,s=0,o=ti,a=ti,u=-1){let l=this.abspath(e,t);return await this.getDescInfo(l,u,r,i,o,a,s)}async createDir(e,t=void 0,r=-1){let i=this.abspath(t,e);i.endsWith("/")&&(i=i.slice(0,-1));const{desc:s,fs:o,err:a}=await this.getDescInfo(Js(i),r,Qr);if(a!==fe)return a;const u=await o.mkdirat(s,pr(i));return u===fe&&this.emit("rename",i),u}async addSymlink(e,t,r=void 0,i=-1){let s;r!==void 0&&!t.startsWith("/")?s=`${r.getPath()}/${t}`:s=t;const{desc:o,fs:a,err:u}=await this.getDescInfo(Js(s),i,Qr);if(u!==fe)return u;const l=await a.symlinkat(e,o,pr(t));return l===fe&&this.emit("rename",h0(s)),l}async mknodat(e,t,r,i){let s=this.abspath(e,t);const{desc:o,fs:a,err:u}=await this.getDescInfo(Js(s),i,Qr);if(u!==fe)return u;const l=await a.mknodat(o,pr(s),r,{});return l===fe&&this.emit("rename",s),l}async removeEntry(e,t,r=void 0,i=-1){let s=this.abspath(r,e);const{desc:o,fs:a,err:u}=await this.getDescInfo(Js(s),i,Qr);if(u!==fe)return u;const l=await a.unlinkat(o,pr(s),t);return l===fe&&this.emit("rename",s),l}async move(e,t,r,i,s=-1){const o=this.abspath(e,t),a=Js(o),u=this.abspath(r,i),l=Js(u);if(Object.keys(this.mounts).some(w=>{w.startsWith(o)})||o.startsWith(u))return f0;const c=await this.getDescInfo(a,s,Qr,Xs);if(c.err!==fe)return c.err;const f=await this.getDescInfo(o,s,Qr);if(f.err!==fe)return f.err;const d=await f.desc.getFilestat();if(d.err!==fe)return d.err;const g=d.filestat,m=await this.getDescInfo(l,s,Qr,Xs);if(m.err!==fe)return m.err;const y=await this.getDescInfo(u,s,Qr);if(y.err===fe){const w=await y.desc.getFilestat();if(w.err!==fe)return w.err;const S=w.filestat;if(g.dev!==S.dev)return zb;if(S.filetype===vc){if(g.filetype!==vc)return Ya;const{err:k,dirents:x}=await y.desc.readdir(!1);if(k!==fe)return k;if(x.length!==0)return Gg}}const b=await m.fs.renameat(c.desc,pr(o),m.desc,pr(u));return b===fe&&(this.emit("rename",o),this.emit("rename",u)),b}async addMount(e,t,r,i,s,o,a,u=-1){const l=this.abspath(r,i);let c;if(l!=="/"){if(c=await this.getDescInfo(l,u,Qr,Xs),c.err!==fe)return c.err;if((await c.desc.readdir(!0)).dirents.length!==0)return Gg}else if(this.mounts["/"]!==void 0)return f0;const f=this.abspath(e,t);let d;if(f===""){const g=await fW(s,a);if(g.err!==fe)return g.err;d=g.filesystem}else{const g=await this.getDescInfo(f,u,Qr,Xs);if(g.err!==fe)return g.err;const m=await g.desc.mountFs(a);if(m.err!==fe)return m.err;d=m.fs}return this.mounts[l]=d,fe}async addMountFs(e,t,r=-1){if(this.mounts[e]!==void 0)return f0;if(e==="/")return this.mounts[e]=t,fe;let i=await this.getDescInfo(e,r,Qr,Xs);return i.err!==fe?i.err:(await i.desc.readdir(!0)).dirents.length===0?(this.mounts[e]=t,fe):Gg}removeMount(e){return Object.keys(this.mounts).every(t=>t===e||!t.startsWith(e))?this.mounts[e]?(delete this.mounts[e],fe):Ei:f0}async readLink(e,t,r=-1){let{err:i,desc:s}=await this.openat(e,t,0,0,0,ti,ti,r);if(i!==fe)return{err:i,path:void 0};if(s.getFdstat().fs_filetype!==tl)return{err:xt,path:void 0};const{err:a,content:u}=await s.read_str();return{err:a,path:u}}async*watch(e,t){const r=h0(e),i=t?.signal;if(!i)throw new Error("watch requires AbortSignal in options.signal");const s=[];let o=null;const a=()=>{const f=o;o=null,f&&f()},l={path:r,enqueue:f=>{s.push({eventType:f.eventType,filename:f.filename}),a()},signal:i};this.watchers.add(l);const c=()=>a();i.addEventListener("abort",c);try{for(;!i.aborted;){if(s.length===0){await new Promise(f=>{if(i.aborted)return f();o=()=>f()});continue}for(;s.length;)yield s.shift()}}finally{i.removeEventListener("abort",c),this.watchers.delete(l)}}getMounts(){return this.mounts}}let dw=[],mM=[];(()=>{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,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?mM:dw).push(t=t+n[e])})();function dW(n){if(n<768)return!1;for(let e=0,t=dw.length;;){let r=e+t>>1;if(n<dw[r])t=r;else if(n>=mM[r])e=r+1;else return!0;if(e==t)return!1}}function ZC(n){return n>=127462&&n<=127487}const QC=8205;function pW(n,e,t=!0,r=!0){return(t?vM:gW)(n,e,r)}function vM(n,e,t){if(e==n.length)return e;e&&yM(n.charCodeAt(e))&&bM(n.charCodeAt(e-1))&&e--;let r=Gy(n,e);for(e+=eE(r);e<n.length;){let i=Gy(n,e);if(r==QC||i==QC||t&&dW(i))e+=eE(i),r=i;else if(ZC(i)){let s=0,o=e-2;for(;o>=0&&ZC(Gy(n,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function gW(n,e,t){for(;e>0;){let r=vM(n,e-2,t);if(r<e)return r;e--}return 0}function Gy(n,e){let t=n.charCodeAt(e);if(!bM(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return yM(r)?(t-55296<<10)+(r-56320)+65536:t}function yM(n){return n>=56320&&n<57344}function bM(n){return n>=55296&&n<56320}function eE(n){return n<65536?1:2}class gt{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]=wc(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),eo.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]=wc(this,e,t);let r=[];return this.decompose(e,t,r,0),eo.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 Jh(this),s=new Jh(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 Jh(this,e)}iterRange(e,t=this.length){return new wM(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 _M(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]?gt.empty:e.length<=32?new kn(e):eo.from(kn.split(e,[]))}}class kn extends gt{constructor(e,t=mW(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 vW(i,a,r,o);i=a+1,r++}}decompose(e,t,r,i){let s=e<=0&&t>=this.length?this:new kn(tE(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),a=tm(s.text,o.text.slice(),0,s.length);if(a.length<=32)r.push(new kn(a,o.length+s.length));else{let u=a.length>>1;r.push(new kn(a.slice(0,u)),new kn(a.slice(u)))}}else r.push(s)}replace(e,t,r){if(!(r instanceof kn))return super.replace(e,t,r);[e,t]=wc(this,e,t);let i=tm(this.text,tm(r.text,tE(this.text,0,e)),t),s=this.length+r.length-(t-e);return i.length<=32?new kn(i,s):eo.from(kn.split(i,[]),s)}sliceString(e,t=this.length,r=`
|
|
28
|
-
`){[e,t]=wc(this,e,t);let i="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let a=this.text[o],u=s+a.length;s>e&&o&&(i+=r),e<u&&t>s&&(i+=a.slice(Math.max(0,e-s),t-s)),s=u+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 kn(r,i)),r=[],i=-1);return i>-1&&t.push(new kn(r,i)),t}}class eo extends gt{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,u=r+o.lines-1;if((t?u:a)>=e)return o.lineInner(e,t,r,i);i=a+1,r=u+1}}decompose(e,t,r,i){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let a=this.children[s],u=o+a.length;if(e<=u&&t>=o){let l=i&((o<=e?1:0)|(u>=t?2:0));o>=e&&u<=t&&!l?r.push(a):a.decompose(e-o,t-o,r,l)}o=u+1}}replace(e,t,r){if([e,t]=wc(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 u=o.replace(e-s,t-s,r),l=this.lines-o.lines+u.lines;if(u.lines<l>>4&&u.lines>l>>6){let c=this.children.slice();return c[i]=u,new eo(c,this.length-(t-e)+r.length)}return super.replace(s,a,u)}s=a+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=`
|
|
29
|
-
`){[e,t]=wc(this,e,t);let i="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let a=this.children[s],u=o+a.length;o>e&&s&&(i+=r),e<u&&t>o&&(i+=a.sliceString(e-o,t-o,r)),o=u+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof eo))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 u=this.children[i],l=e.children[s];if(u!=l)return r+u.scanIdentical(l,t);r+=u.length+1}}static from(e,t=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let g of e)r+=g.lines;if(r<32){let g=[];for(let m of e)m.flatten(g);return new kn(g,t)}let i=Math.max(32,r>>5),s=i<<1,o=i>>1,a=[],u=0,l=-1,c=[];function f(g){let m;if(g.lines>s&&g instanceof eo)for(let y of g.children)f(y);else g.lines>o&&(u>o||!u)?(d(),a.push(g)):g instanceof kn&&u&&(m=c[c.length-1])instanceof kn&&g.lines+m.lines<=32?(u+=g.lines,l+=g.length+1,c[c.length-1]=new kn(m.text.concat(g.text),m.length+1+g.length)):(u+g.lines>i&&d(),u+=g.lines,l+=g.length+1,c.push(g))}function d(){u!=0&&(a.push(c.length==1?c[0]:eo.from(c,l)),l=-1,u=c.length=0)}for(let g of e)f(g);return d(),a.length==1?a[0]:new eo(a,t)}}gt.empty=new kn([""],0);function mW(n){let e=-1;for(let t of n)e+=t.length+1;return e}function tm(n,e,t=0,r=1e9){for(let i=0,s=0,o=!0;s<n.length&&i<=r;s++){let a=n[s],u=i+a.length;u>=t&&(u>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=u+1}return e}function tE(n,e,t){return tm(n,[""],e,t)}class Jh{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 kn?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 kn?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=`
|
|
30
|
-
`,this;e--}else if(i instanceof kn){let u=i.text[o+(t<0?-1:0)];if(this.offsets[r]+=t,u.length>Math.max(0,e))return this.value=e==0?u:t>0?u.slice(e):u.slice(0,u.length-e),this;e-=u.length}else{let u=i.children[o+(t<0?-1:0)];e>u.length?(e-=u.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(u),this.offsets.push(t>0?1:(u instanceof kn?u.text.length:u.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class wM{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new Jh(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 _M{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"&&(gt.prototype[Symbol.iterator]=function(){return this.iter()},Jh.prototype[Symbol.iterator]=wM.prototype[Symbol.iterator]=_M.prototype[Symbol.iterator]=function(){return this});class vW{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 wc(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function nr(n,e,t=!0,r=!0){return pW(n,e,t,r)}function yW(n){return n>=56320&&n<57344}function bW(n){return n>=55296&&n<56320}function ri(n,e){let t=n.charCodeAt(e);if(!bW(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return yW(r)?(t-55296<<10)+(r-56320)+65536:t}function ek(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function to(n){return n<65536?1:2}const pw=/\r\n?|\n/;var tr=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(tr||(tr={}));class lo{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){gw(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 lo(e)}composeDesc(e){return this.empty?e:e.empty?this:kM(this,e)}mapDesc(e,t=!1){return e.empty?this:mw(this,e,t)}mapPos(e,t=-1,r=tr.Simple){let i=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],u=this.sections[o++],l=i+a;if(u<0){if(l>e)return s+(e-i);s+=a}else{if(r!=tr.Simple&&l>=e&&(r==tr.TrackDel&&i<e&&l>e||r==tr.TrackBefore&&i<e||r==tr.TrackAfter&&l>e))return null;if(l>e||l==e&&t<0&&!a)return e==i||t<0?s:s+u;s+=u}i=l}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 lo(e)}static create(e){return new lo(e)}}class Tn extends lo{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 gw(this,(t,r,i,s,o)=>e=e.replace(i,i+(r-t),o),!1),e}mapDesc(e,t=!1){return mw(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 u=i>>1;for(;r.length<u;)r.push(gt.empty);r.push(o?e.slice(s,s+o):gt.empty)}s+=o}return new Tn(t,r)}compose(e){return this.empty?e:e.empty?this:kM(this,e,!0)}map(e,t=!1){return e.empty?this:mw(this,e,t,!0)}iterChanges(e,t=!1){gw(this,e,t)}get desc(){return lo.create(this.sections)}filter(e){let t=[],r=[],i=[],s=new cd(this);e:for(let o=0,a=0;;){let u=o==e.length?1e9:e[o++];for(;a<u||a==u&&s.len==0;){if(s.done)break e;let c=Math.min(s.len,u-a);mr(i,c,-1);let f=s.ins==-1?-1:s.off==0?s.ins:0;mr(t,c,f),f>0&&ja(r,t,s.text),s.forward(c),a+=c}let l=e[o++];for(;a<l;){if(s.done)break e;let c=Math.min(s.len,l-a);mr(t,c,-1),mr(i,c,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(c),a+=c}}return{changes:new Tn(t,r),filtered:lo.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 u(c=!1){if(!c&&!i.length)return;o<t&&mr(i,t-o,-1);let f=new Tn(i,s);a=a?a.compose(f.map(a)):f,i=[],s=[],o=0}function l(c){if(Array.isArray(c))for(let f of c)l(f);else if(c instanceof Tn){if(c.length!=t)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${t})`);u(),a=a?a.compose(c.map(a)):c}else{let{from:f,to:d=f,insert:g}=c;if(f>d||f<0||d>t)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${t})`);let m=g?typeof g=="string"?gt.of(g.split(r||pw)):g:gt.empty,y=m.length;if(f==d&&y==0)return;f<o&&u(),f>o&&mr(i,f-o,-1),mr(i,d-f,y),ja(s,i,m),o=d}}return l(e),u(!a),a}static empty(e){return new Tn(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(gt.empty);r[i]=gt.of(s.slice(1)),t.push(s[0],r[i].length)}}}return new Tn(t,r)}static createSet(e,t){return new Tn(e,t)}}function mr(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 ja(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(gt.empty);n.push(t)}}function gw(n,e,t){let r=n.inserted;for(let i=0,s=0,o=0;o<n.sections.length;){let a=n.sections[o++],u=n.sections[o++];if(u<0)i+=a,s+=a;else{let l=i,c=s,f=gt.empty;for(;l+=a,c+=u,u&&r&&(f=f.append(r[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)a=n.sections[o++],u=n.sections[o++];e(i,l,s,c,f),i=l,s=c}}}function mw(n,e,t,r=!1){let i=[],s=r?[]:null,o=new cd(n),a=new cd(e);for(let u=-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 l=Math.min(o.len,a.len);mr(i,l,-1),o.forward(l),a.forward(l)}else if(a.ins>=0&&(o.ins<0||u==o.i||o.off==0&&(a.len<o.len||a.len==o.len&&!t))){let l=a.len;for(mr(i,a.ins,-1);l;){let c=Math.min(o.len,l);o.ins>=0&&u<o.i&&o.len<=c&&(mr(i,0,o.ins),s&&ja(s,i,o.text),u=o.i),o.forward(c),l-=c}a.next()}else if(o.ins>=0){let l=0,c=o.len;for(;c;)if(a.ins==-1){let f=Math.min(c,a.len);l+=f,c-=f,a.forward(f)}else if(a.ins==0&&a.len<c)c-=a.len,a.next();else break;mr(i,l,u<o.i?o.ins:0),s&&u<o.i&&ja(s,i,o.text),u=o.i,o.forward(o.len-c)}else{if(o.done&&a.done)return s?Tn.createSet(i,s):lo.create(i);throw new Error("Mismatched change set lengths")}}}function kM(n,e,t=!1){let r=[],i=t?[]:null,s=new cd(n),o=new cd(e);for(let a=!1;;){if(s.done&&o.done)return i?Tn.createSet(r,i):lo.create(r);if(s.ins==0)mr(r,s.len,0,a),s.next();else if(o.len==0&&!o.done)mr(r,0,o.ins,a),i&&ja(i,r,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let u=Math.min(s.len2,o.len),l=r.length;if(s.ins==-1){let c=o.ins==-1?-1:o.off?0:o.ins;mr(r,u,c,a),i&&c&&ja(i,r,o.text)}else o.ins==-1?(mr(r,s.off?0:s.len,u,a),i&&ja(i,r,s.textBit(u))):(mr(r,s.off?0:s.len,o.off?0:o.ins,a),i&&!o.off&&ja(i,r,o.text));a=(s.ins>u||o.ins>=0&&o.len>u)&&(a||r.length>l),s.forward2(u),o.forward(u)}}}}class cd{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?gt.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?gt.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)}}let k0=class vw{constructor(e,t,r){this.from=e,this.to=t,this.flags=r}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 bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0: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 vw(r,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return me.range(e,t);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return me.range(this.anchor,r)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return me.range(e.anchor,e.head)}static create(e,t,r){return new vw(e,t,r)}};class me{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:me.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 me([this.main],0)}addRange(e,t=!0){return me.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let r=this.ranges.slice();return r[t]=e,me.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 me(e.ranges.map(t=>k0.fromJSON(t)),e.main)}static single(e,t=e){return new me([me.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 me.normalized(e.slice(),t);r=s.to}return new me(e,t)}static cursor(e,t=0,r,i){return k0.create(e,e,(t==0?0:t<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,t,r,i){let s=(r??16777215)<<6|(i==null?7:Math.min(6,i));return t<e?k0.create(t,e,48|s):k0.create(e,t,(t>e?8:0)|s)}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,u=Math.max(s.to,o.to);i<=t&&t--,e.splice(--i,2,s.anchor>s.head?me.range(u,a):me.range(a,u))}}return new me(e,t)}}function xM(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let tk=0;class Ae{constructor(e,t,r,i,s){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=i,this.id=tk++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new Ae(e.combine||(t=>t),e.compareInput||((t,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:nk),!!e.static,e.enables)}of(e){return new nm([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new nm(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new nm(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}}function nk(n,e){return n==e||n.length==e.length&&n.every((t,r)=>t===e[r])}class nm{constructor(e,t,r,i){this.dependencies=e,this.facet=t,this.type=r,this.value=i,this.id=tk++}dynamicSlot(e){var t;let r=this.value,i=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,u=!1,l=!1,c=[];for(let f of this.dependencies)f=="doc"?u=!0:f=="selection"?l=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&c.push(e[f.id]);return{create(f){return f.values[o]=r(f),1},update(f,d){if(u&&d.docChanged||l&&(d.docChanged||d.selection)||yw(f,c)){let g=r(f);if(a?!nE(g,f.values[o],i):!i(g,f.values[o]))return f.values[o]=g,1}return 0},reconfigure:(f,d)=>{let g,m=d.config.address[s];if(m!=null){let y=Rm(d,m);if(this.dependencies.every(b=>b instanceof Ae?d.facet(b)===f.facet(b):b instanceof Rn?d.field(b,!1)==f.field(b,!1):!0)||(a?nE(g=r(f),y,i):i(g=r(f),y)))return f.values[o]=y,0}else g=r(f);return f.values[o]=g,1}}}}function nE(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 yw(n,e){let t=!1;for(let r of e)Yh(n,r)&1&&(t=!0);return t}function wW(n,e,t){let r=t.map(u=>n[u.id]),i=t.map(u=>u.type),s=r.filter(u=>!(u&1)),o=n[e.id]>>1;function a(u){let l=[];for(let c=0;c<r.length;c++){let f=Rm(u,r[c]);if(i[c]==2)for(let d of f)l.push(d);else l.push(f)}return e.combine(l)}return{create(u){for(let l of r)Yh(u,l);return u.values[o]=a(u),1},update(u,l){if(!yw(u,s))return 0;let c=a(u);return e.compare(c,u.values[o])?0:(u.values[o]=c,1)},reconfigure(u,l){let c=yw(u,r),f=l.config.facets[e.id],d=l.facet(e);if(f&&!c&&nk(t,f))return u.values[o]=d,0;let g=a(u);return e.compare(g,d)?(u.values[o]=d,0):(u.values[o]=g,1)}}}const x0=Ae.define({static:!0});class Rn{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 Rn(tk++,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(x0).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(x0),o=i.facet(x0),a;return(a=s.find(u=>u.field==this))&&a!=o.find(u=>u.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,x0.of({field:this,create:e})]}get extension(){return this}}const Wu={lowest:4,low:3,default:2,high:1,highest:0};function Uf(n){return e=>new SM(e,n)}const ou={highest:Uf(Wu.highest),high:Uf(Wu.high),default:Uf(Wu.default),low:Uf(Wu.low),lowest:Uf(Wu.lowest)};class SM{constructor(e,t){this.inner=e,this.prec=t}}class ca{of(e){return new bw(this,e)}reconfigure(e){return ca.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class bw{constructor(e,t){this.compartment=e,this.inner=t}}class Em{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 _W(e,t,o))d instanceof Rn?i.push(d):(s[d.facet.id]||(s[d.facet.id]=[])).push(d);let a=Object.create(null),u=[],l=[];for(let d of i)a[d.id]=l.length<<1,l.push(g=>d.slot(g));let c=r?.config.facets;for(let d in s){let g=s[d],m=g[0].facet,y=c&&c[d]||[];if(g.every(b=>b.type==0))if(a[m.id]=u.length<<1|1,nk(y,g))u.push(r.facet(m));else{let b=m.combine(g.map(w=>w.value));u.push(r&&m.compare(b,r.facet(m))?r.facet(m):b)}else{for(let b of g)b.type==0?(a[b.id]=u.length<<1|1,u.push(b.value)):(a[b.id]=l.length<<1,l.push(w=>b.dynamicSlot(w)));a[m.id]=l.length<<1,l.push(b=>wW(b,m,g))}}let f=l.map(d=>d(a));return new Em(e,o,f,a,u,s)}}function _W(n,e,t){let r=[[],[],[],[],[]],i=new Map;function s(o,a){let u=i.get(o);if(u!=null){if(u<=a)return;let l=r[u].indexOf(o);l>-1&&r[u].splice(l,1),o instanceof bw&&t.delete(o.compartment)}if(i.set(o,a),Array.isArray(o))for(let l of o)s(l,a);else if(o instanceof bw){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let l=e.get(o.compartment)||o.inner;t.set(o.compartment,l),s(l,a)}else if(o instanceof SM)s(o.inner,o.prec);else if(o instanceof Rn)r[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof nm)r[a].push(o),o.facet.extensions&&s(o.facet.extensions,Wu.default);else{let l=o.extension;if(!l)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(l,a)}}return s(n,Wu.default),r.reduce((o,a)=>o.concat(a))}function Yh(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 Rm(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const CM=Ae.define(),ww=Ae.define({combine:n=>n.some(e=>e),static:!0}),EM=Ae.define({combine:n=>n.length?n[0]:void 0,static:!0}),RM=Ae.define(),AM=Ae.define(),DM=Ae.define(),TM=Ae.define({combine:n=>n.length?n[0]:!1});class fa{constructor(e,t){this.type=e,this.value=t}static define(){return new kW}}class kW{of(e){return new fa(this,e)}}class xW{constructor(e){this.map=e}of(e){return new He(this,e)}}class He{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 He(this.type,t)}is(e){return this.type==e}static define(e={}){return new xW(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}}He.reconfigure=He.define();He.appendConfig=He.define();class En{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&&xM(r,t.newLength),s.some(a=>a.type==En.time)||(this.annotations=s.concat(En.time.of(Date.now())))}static create(e,t,r,i,s,o){return new En(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(En.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}En.time=fa.define();En.userEvent=fa.define();En.addToHistory=fa.define();En.remote=fa.define();function SW(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 MM(n,e,t){var r;let i,s,o;return t?(i=e.changes,s=Tn.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:He.mapEffects(n.effects,i).concat(He.mapEffects(e.effects,s)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function _w(n,e,t){let r=e.selection,i=fc(e.annotations);return e.userEvent&&(i=i.concat(En.userEvent.of(e.userEvent))),{changes:e.changes instanceof Tn?e.changes:Tn.of(e.changes||[],t,n.facet(EM)),selection:r&&(r instanceof me?r:me.single(r.anchor,r.head)),effects:fc(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function OM(n,e,t){let r=_w(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=MM(r,_w(n,e[s],o?r.changes.newLength:n.doc.length),o)}let i=En.create(n,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return EW(t?CW(i):i)}function CW(n){let e=n.startState,t=!0;for(let i of e.facet(RM)){let s=i(n);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:SW(t,s))}if(t!==!0){let i,s;if(t===!1)s=n.changes.invertedDesc,i=Tn.empty(e.doc.length);else{let o=n.changes.filter(t);i=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}n=En.create(e,i,n.selection&&n.selection.map(s),He.mapEffects(n.effects,s),n.annotations,n.scrollIntoView)}let r=e.facet(AM);for(let i=r.length-1;i>=0;i--){let s=r[i](n);s instanceof En?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof En?n=s[0]:n=OM(e,fc(s),!1)}return n}function EW(n){let e=n.startState,t=e.facet(DM),r=n;for(let i=t.length-1;i>=0;i--){let s=t[i](n);s&&Object.keys(s).length&&(r=MM(r,_w(e,s,n.changes.newLength),!0))}return r==n?n:En.create(e,n.changes,n.selection,r.effects,r.annotations,r.scrollIntoView)}const RW=[];function fc(n){return n==null?RW:Array.isArray(n)?n:[n]}var rn=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(rn||(rn={}));const AW=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let kw;try{kw=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function DW(n){if(kw)return kw.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||AW.test(t)))return!0}return!1}function TW(n){return e=>{if(!/\S/.test(e))return rn.Space;if(DW(e))return rn.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return rn.Word;return rn.Other}}class dt{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++)Yh(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 Yh(this,r),Rm(this,r)}update(...e){return OM(this,e,!0)}applyTransaction(e){let t=this.config,{base:r,compartments:i}=t;for(let a of e.effects)a.is(ca.reconfigure)?(t&&(i=new Map,t.compartments.forEach((u,l)=>i.set(l,u)),t=null),i.set(a.value.compartment,a.value.extension)):a.is(He.reconfigure)?(t=null,r=a.value):a.is(He.appendConfig)&&(t=null,r=fc(r).concat(a.value));let s;t?s=e.startState.values.slice():(t=Em.resolve(r,i,this),s=new dt(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(u,l)=>l.reconfigure(u,this),null).values);let o=e.startState.facet(ww)?e.newSelection:e.newSelection.asSingle();new dt(t,e.newDoc,o,s,(a,u)=>u.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:me.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),i=this.changes(r.changes),s=[r.range],o=fc(r.effects);for(let a=1;a<t.ranges.length;a++){let u=e(t.ranges[a]),l=this.changes(u.changes),c=l.map(i);for(let d=0;d<a;d++)s[d]=s[d].map(c);let f=i.mapDesc(l,!0);s.push(u.range.map(f)),i=i.compose(c),o=He.mapEffects(o,c).concat(He.mapEffects(fc(u.effects),f))}return{changes:i,selection:me.create(s,t.mainIndex),effects:o}}changes(e=[]){return e instanceof Tn?e:Tn.of(e,this.doc.length,this.facet(dt.lineSeparator))}toText(e){return gt.of(e.split(this.facet(dt.lineSeparator)||pw))}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:(Yh(this,t),Rm(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 Rn&&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(u=>o.spec.fromJSON(a,u)))}}return dt.create({doc:e.doc,selection:me.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=Em.resolve(e.extensions||[],new Map),r=e.doc instanceof gt?e.doc:gt.of((e.doc||"").split(t.staticFacet(dt.lineSeparator)||pw)),i=e.selection?e.selection instanceof me?e.selection:me.single(e.selection.anchor,e.selection.head):me.single(0);return xM(i,r.length),t.staticFacet(ww)||(i=i.asSingle()),new dt(t,r,i,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(dt.tabSize)}get lineBreak(){return this.facet(dt.lineSeparator)||`
|
|
31
|
-
`}get readOnly(){return this.facet(TM)}phrase(e,...t){for(let r of this.facet(dt.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>t.length?r:t[s-1]})),e}languageDataAt(e,t,r=-1){let i=[];for(let s of this.facet(CM))for(let o of s(this,t,r))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){return TW(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,a=e-r;for(;o>0;){let u=nr(t,o,!1);if(s(t.slice(u,o))!=rn.Word)break;o=u}for(;a<i;){let u=nr(t,a);if(s(t.slice(a,u))!=rn.Word)break;a=u}return o==a?null:me.range(o+r,a+r)}}dt.allowMultipleSelections=ww;dt.tabSize=Ae.define({combine:n=>n.length?n[0]:4});dt.lineSeparator=EM;dt.readOnly=TM;dt.phrases=Ae.define({compare(n,e){let t=Object.keys(n),r=Object.keys(e);return t.length==r.length&&t.every(i=>n[i]==e[i])}});dt.languageData=CM;dt.changeFilter=RM;dt.transactionFilter=AM;dt.transactionExtender=DM;ca.reconfigure=He.define();function yo(n,e,t={}){let r={};for(let i of n)for(let s of Object.keys(i)){let o=i[s],a=r[s];if(a===void 0)r[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))r[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class ol{eq(e){return this==e}range(e,t=e){return xw.create(e,t,this)}}ol.prototype.startSide=ol.prototype.endSide=0;ol.prototype.point=!1;ol.prototype.mapMode=tr.TrackDel;let xw=class PM{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new PM(e,t,r)}};function Sw(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class rk{constructor(e,t,r,i){this.from=e,this.to=t,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,i=0){let s=r?this.to:this.from;for(let o=i,a=s.length;;){if(o==a)return o;let u=o+a>>1,l=s[u]-e||(r?this.value[u].endSide:this.value[u].startSide)-t;if(u==o)return l>=0?o:a;l>=0?a=u:o=u+1}}between(e,t,r,i){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(r,1e9,!1,s);s<o;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let r=[],i=[],s=[],o=-1,a=-1;for(let u=0;u<this.value.length;u++){let l=this.value[u],c=this.from[u]+e,f=this.to[u]+e,d,g;if(c==f){let m=t.mapPos(c,l.startSide,l.mapMode);if(m==null||(d=g=m,l.startSide!=l.endSide&&(g=t.mapPos(c,l.endSide),g<d)))continue}else if(d=t.mapPos(c,l.startSide),g=t.mapPos(f,l.endSide),d>g||d==g&&l.startSide>0&&l.endSide<=0)continue;(g-d||l.endSide-l.startSide)<0||(o<0&&(o=d),l.point&&(a=Math.max(a,g-d)),r.push(l),i.push(d-o),s.push(g-o))}return{mapped:r.length?new rk(i,s,r,a):null,pos:o}}}class yt{constructor(e,t,r,i){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=i}static create(e,t,r,i){return new yt(e,t,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(r&&(t=t.slice().sort(Sw)),this.isEmpty)return t.length?yt.of(t):this;let a=new IM(this,null,-1).goto(0),u=0,l=[],c=new ia;for(;a.value||u<t.length;)if(u<t.length&&(a.from-t[u].from||a.startSide-t[u].value.startSide)>=0){let f=t[u++];c.addInner(f.from,f.to,f.value)||l.push(f)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(u==t.length||this.chunkEnd(a.chunkIndex)<t[u].from)&&(!o||i>this.chunkEnd(a.chunkIndex)||s<this.chunkPos[a.chunkIndex])&&c.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||i>a.to||s<a.from||o(a.from,a.to,a.value))&&(c.addInner(a.from,a.to,a.value)||l.push(xw.create(a.from,a.to,a.value))),a.next());return c.finishInner(this.nextLayer.isEmpty&&!l.length?yt.empty:this.nextLayer.update({add:l,filter:o,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],r=[],i=-1;for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],u=this.chunk[o],l=e.touchesRange(a,a+u.length);if(l===!1)i=Math.max(i,u.maxPoint),t.push(u),r.push(e.mapPos(a));else if(l===!0){let{mapped:c,pos:f}=u.map(a,e);c&&(i=Math.max(i,c.maxPoint),t.push(c),r.push(f))}}let s=this.nextLayer.map(e);return t.length==0?s:new yt(r,t,s||yt.empty,i)}between(e,t,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],o=this.chunk[i];if(t>=s&&e<=s+o.length&&o.between(s,e-s,t-s,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return fd.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return fd.from(e).goto(t)}static compare(e,t,r,i,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),u=rE(o,a,r),l=new Hf(o,u,s),c=new Hf(a,u,s);r.iterGaps((f,d,g)=>iE(l,f,c,d,g,i)),r.empty&&r.length==0&&iE(l,0,c,0,0,i)}static eq(e,t,r=0,i){i==null&&(i=999999999);let s=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=rE(s,o),u=new Hf(s,a,0).goto(r),l=new Hf(o,a,0).goto(r);for(;;){if(u.to!=l.to||!Cw(u.active,l.active)||u.point&&(!l.point||!u.point.eq(l.point)))return!1;if(u.to>i)return!0;u.next(),l.next()}}static spans(e,t,r,i,s=-1){let o=new Hf(e,null,s).goto(t),a=t,u=o.openStart;for(;;){let l=Math.min(o.to,r);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFrom<t?c.length+1:o.point.startSide<0?c.length:Math.min(c.length,u);i.point(a,l,o.point,c,f,o.pointRank),u=Math.min(o.openEnd(l),c.length)}else l>a&&(i.span(a,l,o.active,u),u=o.openEnd(l));if(o.to>r)return u+(o.point&&o.to>r?1:0);a=o.to,o.next()}}static of(e,t=!1){let r=new ia;for(let i of e instanceof xw?[e]:t?MW(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return yt.empty;let t=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=yt.empty;i=i.nextLayer)t=new yt(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}yt.empty=new yt([],[],null,-1);function MW(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let r=n[t];if(Sw(e,r)>0)return n.slice().sort(Sw);e=r}return n}yt.empty.nextLayer=yt.empty;class ia{finishChunk(e){this.chunks.push(new rk(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,r){this.addInner(e,t,r)||(this.nextLayer||(this.nextLayer=new ia)).add(e,t,r)}addInner(e,t,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=t,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let r=t.value.length-1;return this.last=t.value[r],this.lastFrom=t.from[r]+e,this.lastTo=t.to[r]+e,!0}finish(){return this.finishInner(yt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=yt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function rE(n,e,t){let r=new Map;for(let s of n)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&r.set(s.chunk[o],s.chunkPos[o]);let i=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let a=r.get(s.chunk[o]);a!=null&&(t?t.mapPos(a):a)==s.chunkPos[o]&&!t?.touchesRange(a,a+s.chunk[o].length)&&i.add(s.chunk[o])}return i}class IM{constructor(e,t,r,i=0){this.layer=e,this.skip=t,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],r=e+t.from[this.rangeIndex];if(this.from=r,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class fd{constructor(e){this.heap=e}static from(e,t=null,r=-1){let i=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=r&&i.push(new IM(o,t,r,s));return i.length==1?i[0]:new fd(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let r of this.heap)r.goto(e,t);for(let r=this.heap.length>>1;r>=0;r--)Ky(this.heap,r);return this.next(),this}forward(e,t){for(let r of this.heap)r.forward(e,t);for(let r=this.heap.length>>1;r>=0;r--)Ky(this.heap,r);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Ky(this.heap,0)}}}function Ky(n,e){for(let t=n[e];;){let r=(e<<1)+1;if(r>=n.length)break;let i=n[r];if(r+1<n.length&&i.compare(n[r+1])>=0&&(i=n[r+1],r++),t.compare(i)<0)break;n[r]=t,n[e]=i,e=r}}class Hf{constructor(e,t,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=fd.from(e,t,r)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){S0(this.active,e),S0(this.activeTo,e),S0(this.activeRank,e),this.minActive=sE(this.active,this.activeTo)}addActive(e){let t=0,{value:r,to:i,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||i-this.activeTo[t])>0;)t++;C0(this.active,t,r),C0(this.activeTo,t,i),C0(this.activeRank,t,s),e&&C0(e,t,this.cursor.from),this.minActive=sE(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&S0(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&t.push(this.active[r]);return t.reverse()}openEnd(e){let t=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)t++;return t}}function iE(n,e,t,r,i,s){n.goto(e),t.goto(r);let o=r+i,a=r,u=r-e;for(;;){let l=n.to+u-t.to,c=l||n.endSide-t.endSide,f=c<0?n.to+u:t.to,d=Math.min(f,o);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&Cw(n.activeForPoint(n.to),t.activeForPoint(t.to))||s.comparePoint(a,d,n.point,t.point):d>a&&!Cw(n.active,t.active)&&s.compareRange(a,d,n.active,t.active),f>o)break;(l||n.openEnd!=t.openEnd)&&s.boundChange&&s.boundChange(f),a=f,c<=0&&n.next(),c>=0&&t.next()}}function Cw(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!n[t].eq(e[t]))return!1;return!0}function S0(n,e){for(let t=e,r=n.length-1;t<r;t++)n[t]=n[t+1];n.pop()}function C0(n,e,t){for(let r=n.length-1;r>=e;r--)n[r+1]=n[r];n[e]=t}function sE(n,e){let t=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||n[i].endSide-n[t].endSide)<0&&(t=i,r=e[i]);return t}function $c(n,e,t=n.length){let r=0;for(let i=0;i<t&&i<n.length;)n.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=nr(n,i));return r}function Ew(n,e,t,r){for(let i=0,s=0;;){if(s>=e)return i;if(i==n.length)break;s+=n.charCodeAt(i)==9?t-s%t:1,i=nr(n,i)}return r===!0?-1:n.length}const Rw="ͼ",oE=typeof Symbol>"u"?"__"+Rw:Symbol.for(Rw),Aw=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),aE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class po{constructor(e,t){this.rules=[];let{finish:r}=t||{};function i(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,u,l){let c=[],f=/^@(\w+)\b/.exec(o[0]),d=f&&f[1]=="keyframes";if(f&&a==null)return u.push(o[0]+";");for(let g in a){let m=a[g];if(/&/.test(g))s(g.split(/,\s*/).map(y=>o.map(b=>y.replace(/&/,b))).reduce((y,b)=>y.concat(b)),m,u);else if(m&&typeof m=="object"){if(!f)throw new RangeError("The value of a property ("+g+") should be a primitive value.");s(i(g),m,c,d)}else m!=null&&c.push(g.replace(/_.*/,"").replace(/[A-Z]/g,y=>"-"+y.toLowerCase())+": "+m+";")}(c.length||d)&&u.push((r&&!f&&!l?o.map(r):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)s(i(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
32
|
-
`)}static newName(){let e=aE[oE]||1;return aE[oE]=e+1,Rw+e.toString(36)}static mount(e,t,r){let i=e[Aw],s=r&&r.nonce;i?s&&i.setNonce(s):i=new OW(e,s),i.mount(Array.isArray(t)?t:[t],e)}}let uE=new Map;class OW{constructor(e,t){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=uE.get(r);if(s)return e[Aw]=s;this.sheet=new i.CSSStyleSheet,uE.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Aw]=this}mount(e,t){let r=this.sheet,i=0,s=0;for(let o=0;o<e.length;o++){let a=e[o],u=this.modules.indexOf(a);if(u<s&&u>-1&&(this.modules.splice(u,1),s--,u=-1),u==-1){if(this.modules.splice(s++,0,a),r)for(let l=0;l<a.rules.length;l++)r.insertRule(a.rules[l],i++)}else{for(;s<u;)i+=this.modules[s++].rules.length;i+=a.rules.length,s++}}if(r)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o="";for(let u=0;u<this.modules.length;u++)o+=this.modules[u].getRules()+`
|
|
33
|
-
`;this.styleTag.textContent=o;let a=t.head||t;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var Qa={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},hd={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},PW=typeof navigator<"u"&&/Mac/.test(navigator.platform),IW=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Zn=0;Zn<10;Zn++)Qa[48+Zn]=Qa[96+Zn]=String(Zn);for(var Zn=1;Zn<=24;Zn++)Qa[Zn+111]="F"+Zn;for(var Zn=65;Zn<=90;Zn++)Qa[Zn]=String.fromCharCode(Zn+32),hd[Zn]=String.fromCharCode(Zn);for(var Jy in Qa)hd.hasOwnProperty(Jy)||(hd[Jy]=Qa[Jy]);function LW(n){var e=PW&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||IW&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?hd:Qa)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function dd(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Dw(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function rm(n,e){if(!e.anchorNode)return!1;try{return Dw(n,e.anchorNode)}catch{return!1}}function pd(n){return n.nodeType==3?ul(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function Xh(n,e,t,r){return t?lE(n,e,t,r,-1)||lE(n,e,t,r,1):!1}function al(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Am(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function lE(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:go(n))){if(n.nodeName=="DIV")return!1;let s=n.parentNode;if(!s||s.nodeType!=1)return!1;e=al(n)+(i<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=i<0?go(n):0}else return!1}}function go(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function L1(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function FW(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function LM(n,e){let t=e.width/n.offsetWidth,r=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-n.offsetHeight)<1)&&(r=1),{scaleX:t,scaleY:r}}function NW(n,e,t,r,i,s,o,a){let u=n.ownerDocument,l=u.defaultView||window;for(let c=n,f=!1;c&&!f;)if(c.nodeType==1){let d,g=c==u.body,m=1,y=1;if(g)d=FW(l);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let S=c.getBoundingClientRect();({scaleX:m,scaleY:y}=LM(c,S)),d={left:S.left,right:S.left+c.clientWidth*m,top:S.top,bottom:S.top+c.clientHeight*y}}let b=0,w=0;if(i=="nearest")e.top<d.top?(w=e.top-(d.top+o),t>0&&e.bottom>d.bottom+w&&(w=e.bottom-d.bottom+o)):e.bottom>d.bottom&&(w=e.bottom-d.bottom+o,t<0&&e.top-w<d.top&&(w=e.top-(d.top+o)));else{let S=e.bottom-e.top,k=d.bottom-d.top;w=(i=="center"&&S<=k?e.top+S/2-k/2:i=="start"||i=="center"&&t<0?e.top-o:e.bottom-k+o)-d.top}if(r=="nearest"?e.left<d.left?(b=e.left-(d.left+s),t>0&&e.right>d.right+b&&(b=e.right-d.right+s)):e.right>d.right&&(b=e.right-d.right+s,t<0&&e.left<d.left+b&&(b=e.left-(d.left+s))):b=(r=="center"?e.left+(e.right-e.left)/2-(d.right-d.left)/2:r=="start"==a?e.left-s:e.right-(d.right-d.left)+s)-d.left,b||w)if(g)l.scrollBy(b,w);else{let S=0,k=0;if(w){let x=c.scrollTop;c.scrollTop+=w/y,k=(c.scrollTop-x)*y}if(b){let x=c.scrollLeft;c.scrollLeft+=b/m,S=(c.scrollLeft-x)*m}e={left:e.left-S,top:e.top-k,right:e.right-S,bottom:e.bottom-k},S&&Math.abs(S-b)<1&&(r="nearest"),k&&Math.abs(k-w)<1&&(i="nearest")}if(g)break;(e.top<d.top||e.bottom>d.bottom||e.left<d.left||e.right>d.right)&&(e={left:Math.max(e.left,d.left),right:Math.min(e.right,d.right),top:Math.max(e.top,d.top),bottom:Math.min(e.bottom,d.bottom)}),c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function BW(n){let e=n.ownerDocument,t,r;for(let i=n.parentNode;i&&!(i==e.body||t&&r);)if(i.nodeType==1)!r&&i.scrollHeight>i.clientHeight&&(r=i),!t&&i.scrollWidth>i.clientWidth&&(t=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:t,y:r}}class qW{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:r}=e;this.set(t,Math.min(e.anchorOffset,t?go(t):0),r,Math.min(e.focusOffset,r?go(r):0))}set(e,t,r,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=r,this.focusOffset=i}}let Kl=null;function FM(n){if(n.setActive)return n.setActive();if(Kl)return n.focus(Kl);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(Kl==null?{get preventScroll(){return Kl={preventScroll:!0},!0}}:void 0),!Kl){Kl=!1;for(let t=0;t<e.length;){let r=e[t++],i=e[t++],s=e[t++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=s&&(r.scrollLeft=s)}}}let cE;function ul(n,e,t=e){let r=cE||(cE=document.createRange());return r.setEnd(n,t),r.setStart(n,e),r}function hc(n,e,t,r){let i={key:e,code:e,keyCode:t,which:t,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,n.dispatchEvent(s);let o=new KeyboardEvent("keyup",i);return o.synthetic=!0,n.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function jW(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function NM(n){for(;n.attributes.length;)n.removeAttributeNode(n.attributes[0])}function $W(n,e){let t=e.focusNode,r=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=r)return!1;for(r=Math.min(r,go(t));;)if(r){if(t.nodeType!=1)return!1;let i=t.childNodes[r-1];i.contentEditable=="false"?r--:(t=i,r=go(t))}else{if(t==n)return!0;r=al(t),t=t.parentNode}}function BM(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function qM(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r>0)return{node:t,offset:r};if(t.nodeType==1&&r>0){if(t.contentEditable=="false")return null;t=t.childNodes[r-1],r=go(t)}else if(t.parentNode&&!Am(t))r=al(t),t=t.parentNode;else return null}}function jM(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r<t.nodeValue.length)return{node:t,offset:r};if(t.nodeType==1&&r<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[r],r=0}else if(t.parentNode&&!Am(t))r=al(t)+1,t=t.parentNode;else return null}}class vr{constructor(e,t,r=!0){this.node=e,this.offset=t,this.precise=r}static before(e,t){return new vr(e.parentNode,al(e),t)}static after(e,t){return new vr(e.parentNode,al(e)+1,t)}}const ik=[];class jt{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let r of this.children){if(r==e)return t;t+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let r=this.dom,i=null,s;for(let o of this.children){if(o.flags&7){if(!o.dom&&(s=i?i.nextSibling:r.firstChild)){let a=jt.get(s);(!a||!a.parent&&a.canReuseDOM(o))&&o.reuseDOM(s)}o.sync(e,t),o.flags&=-8}if(s=i?i.nextSibling:r.firstChild,t&&!t.written&&t.node==r&&s!=o.dom&&(t.written=!0),o.dom.parentNode==r)for(;s&&s!=o.dom;)s=fE(s);else r.insertBefore(o.dom,s);i=o.dom}for(s=i?i.nextSibling:r.firstChild,s&&t&&t.node==r&&(t.written=!0);s;)s=fE(s)}else if(this.flags&1)for(let r of this.children)r.flags&7&&(r.sync(e,t),r.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let r;if(e==this.dom)r=this.dom.childNodes[t];else{let i=go(e)==0?0:t==0?-1:1;for(;;){let s=e.parentNode;if(s==this.dom)break;i==0&&s.firstChild!=s.lastChild&&(e==s.firstChild?i=-1:i=1),e=s}i<0?r=e:r=e.nextSibling}if(r==this.dom.firstChild)return 0;for(;r&&!jt.get(r);)r=r.nextSibling;if(!r)return this.length;for(let i=0,s=0;;i++){let o=this.children[i];if(o.dom==r)return s;s+=o.length+o.breakAfter}}domBoundsAround(e,t,r=0){let i=-1,s=-1,o=-1,a=-1;for(let u=0,l=r,c=r;u<this.children.length;u++){let f=this.children[u],d=l+f.length;if(l<e&&d>t)return f.domBoundsAround(e,t,l);if(d>=e&&i==-1&&(i=u,s=l),l>t&&f.dom.parentNode==this.dom){o=u,a=c;break}c=d,l=d+f.breakAfter}return{from:s,to:a<0?r+this.length:a,startDOM:(i?this.children[i-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,r=ik){this.markDirty();for(let i=e;i<t;i++){let s=this.children[i];s.parent==this&&r.indexOf(s)<0&&s.destroy()}r.length<250?this.children.splice(e,t-e,...r):this.children=[].concat(this.children.slice(0,e),r,this.children.slice(t));for(let i=0;i<r.length;i++)r[i].setParent(this)}ignoreMutation(e){return!1}ignoreEvent(e){return!1}childCursor(e=this.length){return new $M(this.children,e,this.children.length)}childPos(e,t=1){return this.childCursor().findPos(e,t)}toString(){let e=this.constructor.name.replace("View","");return e+(this.children.length?"("+this.children.join()+")":this.length?"["+(e=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(e){return e.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(e,t,r,i,s,o){return!1}become(e){return!1}canReuseDOM(e){return e.constructor==this.constructor&&!((this.flags|e.flags)&8)}getSide(){return 0}destroy(){for(let e of this.children)e.parent==this&&e.destroy();this.parent=null}}jt.prototype.breakAfter=0;function fE(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class $M{constructor(e,t,r){this.children=e,this.pos=t,this.i=r,this.off=0}findPos(e,t=1){for(;;){if(e>this.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let r=this.children[--this.i];this.pos-=r.length+r.breakAfter}}}function WM(n,e,t,r,i,s,o,a,u){let{children:l}=n,c=l.length?l[e]:null,f=s.length?s[s.length-1]:null,d=f?f.breakAfter:o;if(!(e==r&&c&&!o&&!d&&s.length<2&&c.merge(t,i,s.length?f:null,t==0,a,u))){if(r<l.length){let g=l[r];g&&(i<g.length||g.breakAfter&&f?.breakAfter)?(e==r&&(g=g.split(i),i=0),!d&&f&&g.merge(0,i,f,!0,0,u)?s[s.length-1]=g:((i||g.children.length&&!g.children[0].length)&&g.merge(0,i,null,!1,0,u),s.push(g))):g?.breakAfter&&(f?f.breakAfter=1:o=1),r++}for(c&&(c.breakAfter=o,t>0&&(!o&&s.length&&c.merge(t,c.length,s[0],!1,a,0)?c.breakAfter=s.shift().breakAfter:(t<c.length||c.children.length&&c.children[c.children.length-1].length==0)&&c.merge(t,c.length,null,!1,a,0),e++));e<r&&s.length;)if(l[r-1].become(s[s.length-1]))r--,s.pop(),u=s.length?0:a;else if(l[e].become(s[0]))e++,s.shift(),a=s.length?0:u;else break;!s.length&&e&&r<l.length&&!l[e-1].breakAfter&&l[r].merge(0,0,l[e-1],!1,a,u)&&e--,(e<r||s.length)&&n.replaceChildren(e,r,s)}}function zM(n,e,t,r,i,s){let o=n.childCursor(),{i:a,off:u}=o.findPos(t,1),{i:l,off:c}=o.findPos(e,-1),f=e-t;for(let d of r)f+=d.length;n.length+=f,WM(n,l,c,a,u,r,0,i,s)}let ii=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Tw=typeof document<"u"?document:{documentElement:{style:{}}};const Mw=/Edge\/(\d+)/.exec(ii.userAgent),UM=/MSIE \d/.test(ii.userAgent),Ow=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ii.userAgent),F1=!!(UM||Ow||Mw),hE=!F1&&/gecko\/(\d+)/i.test(ii.userAgent),Yy=!F1&&/Chrome\/(\d+)/.exec(ii.userAgent),WW="webkitFontSmoothing"in Tw.documentElement.style,HM=!F1&&/Apple Computer/.test(ii.vendor),dE=HM&&(/Mobile\/\w+/.test(ii.userAgent)||ii.maxTouchPoints>2);var Te={mac:dE||/Mac/.test(ii.platform),windows:/Win/.test(ii.platform),linux:/Linux|X11/.test(ii.platform),ie:F1,ie_version:UM?Tw.documentMode||6:Ow?+Ow[1]:Mw?+Mw[1]:0,gecko:hE,gecko_version:hE?+(/Firefox\/(\d+)/.exec(ii.userAgent)||[0,0])[1]:0,chrome:!!Yy,chrome_version:Yy?+Yy[1]:0,ios:dE,android:/Android\b/.test(ii.userAgent),safari:HM,webkit_version:WW?+(/\bAppleWebKit\/(\d+)/.exec(ii.userAgent)||[0,0])[1]:0,tabSize:Tw.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const zW=256;class Es extends jt{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,r){return this.flags&8||r&&(!(r instanceof Es)||this.length-(t-e)+r.length>zW||r.flags&8)?!1:(this.text=this.text.slice(0,e)+(r?r.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Es(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new vr(this.dom,e)}domBoundsAround(e,t,r){return{from:r,to:r+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return UW(this.dom,e,t)}}class sa extends jt{constructor(e,t=[],r=0){super(),this.mark=e,this.children=t,this.length=r;for(let i of t)i.setParent(this)}setAttrs(e){if(NM(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,r,i,s,o){return r&&(!(r instanceof sa&&r.mark.eq(this.mark))||e&&s<=0||t<this.length&&o<=0)?!1:(zM(this,e,t,r?r.children.slice():[],s-1,o-1),this.markDirty(),!0)}split(e){let t=[],r=0,i=-1,s=0;for(let a of this.children){let u=r+a.length;u>e&&t.push(r<e?a.split(e-r):a),i<0&&r>=e&&(i=s),r=u,s++}let o=this.length-e;return this.length=e,i>-1&&(this.children.length=i,this.markDirty()),new sa(this.mark,t,o)}domAtPos(e){return VM(this,e)}coordsAt(e,t){return KM(this,e,t)}}function UW(n,e,t){let r=n.nodeValue.length;e>r&&(e=r);let i=e,s=e,o=0;e==0&&t<0||e==r&&t>=0?Te.chrome||Te.gecko||(e?(i--,o=1):s<r&&(s++,o=-1)):t<0?i--:s<r&&s++;let a=ul(n,i,s).getClientRects();if(!a.length)return null;let u=a[(o?o<0:t>=0)?0:a.length-1];return Te.safari&&!o&&u.width==0&&(u=Array.prototype.find.call(a,l=>l.width)||u),o?L1(u,o<0):u||null}class $a extends jt{static create(e,t,r){return new $a(e,t,r)}constructor(e,t,r){super(),this.widget=e,this.length=t,this.side=r,this.prevWidget=null}split(e){let t=$a.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,r,i,s,o){return r&&(!(r instanceof $a)||!this.widget.compare(r.widget)||e>0&&s<=0||t<this.length&&o<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-t),!0)}become(e){return e instanceof $a&&e.side==this.side&&this.widget.constructor==e.widget.constructor?(this.widget.compare(e.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get overrideDOMText(){if(this.length==0)return gt.empty;let e=this;for(;e.parent;)e=e.parent;let{view:t}=e,r=t&&t.state.doc,i=this.posAtStart;return r?r.slice(i,i+this.length):gt.empty}domAtPos(e){return(this.length?e==0:this.side>0)?vr.before(this.dom):vr.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;let i=this.dom.getClientRects(),s=null;if(!i.length)return null;let o=this.side?this.side<0:e>0;for(let a=o?i.length-1:0;s=i[a],!(e>0?a==0:a==i.length-1||s.top<s.bottom);a+=o?-1:1);return L1(s,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class _c extends jt{constructor(e){super(),this.side=e}get length(){return 0}merge(){return!1}become(e){return e instanceof _c&&e.side==this.side}split(){return new _c(this.side)}sync(){if(!this.dom){let e=document.createElement("img");e.className="cm-widgetBuffer",e.setAttribute("aria-hidden","true"),this.setDOM(e)}}getSide(){return this.side}domAtPos(e){return this.side>0?vr.before(this.dom):vr.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return gt.empty}get isHidden(){return!0}}Es.prototype.children=$a.prototype.children=_c.prototype.children=ik;function VM(n,e){let t=n.dom,{children:r}=n,i=0;for(let s=0;i<r.length;i++){let o=r[i],a=s+o.length;if(!(a==s&&o.getSide()<=0)){if(e>s&&e<a&&o.dom.parentNode==t)return o.domAtPos(e-s);if(e<=s)break;s=a}}for(let s=i;s>0;s--){let o=r[s-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let s=i;s<r.length;s++){let o=r[s];if(o.dom.parentNode==t)return o.domAtPos(0)}return new vr(t,0)}function GM(n,e,t){let r,{children:i}=n;t>0&&e instanceof sa&&i.length&&(r=i[i.length-1])instanceof sa&&r.mark.eq(e.mark)?GM(r,e.children[0],t-1):(i.push(e),e.setParent(n)),n.length+=e.length}function KM(n,e,t){let r=null,i=-1,s=null,o=-1;function a(l,c){for(let f=0,d=0;f<l.children.length&&d<=c;f++){let g=l.children[f],m=d+g.length;m>=c&&(g.children.length?a(g,c-d):(!s||s.isHidden&&(t>0||VW(s,g)))&&(m>c||d==m&&g.getSide()>0)?(s=g,o=c-d):(d<c||d==m&&g.getSide()<0&&!g.isHidden)&&(r=g,i=c-d)),d=m}}a(n,e);let u=(t<0?r:s)||r||s;return u?u.coordsAt(Math.max(0,u==r?i:o),t):HW(n)}function HW(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=pd(e);return t[t.length-1]||null}function VW(n,e){let t=n.coordsAt(0,1),r=e.coordsAt(0,1);return t&&r&&r.top<t.bottom}function Pw(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const pE=Object.create(null);function Dm(n,e,t){if(n==e)return!0;n||(n=pE),e||(e=pE);let r=Object.keys(n),i=Object.keys(e);if(r.length-(t&&r.indexOf(t)>-1?1:0)!=i.length-(t&&i.indexOf(t)>-1?1:0))return!1;for(let s of r)if(s!=t&&(i.indexOf(s)==-1||n[s]!==e[s]))return!1;return!0}function Iw(n,e,t){let r=!1;if(e)for(let i in e)t&&i in t||(r=!0,i=="style"?n.style.cssText="":n.removeAttribute(i));if(t)for(let i in t)e&&e[i]==t[i]||(r=!0,i=="style"?n.style.cssText=t[i]:n.setAttribute(i,t[i]));return r}function GW(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let r=n.attributes[t];e[r.name]=r.value}return e}class ha{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Br=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(Br||(Br={}));class Be extends ol{constructor(e,t,r,i){super(),this.startSide=e,this.endSide=t,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new Jd(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return t+=r&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new eu(e,t,t,r,e.widget||null,!1)}static replace(e){let t=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:o}=JM(e,t);r=(s?t?-3e8:-1:5e8)-1,i=(o?t?2e8:1:-6e8)+1}return new eu(e,r,i,t,e.widget||null,!0)}static line(e){return new Yd(e)}static set(e,t=!1){return yt.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Be.none=yt.empty;class Jd extends Be{constructor(e){let{start:t,end:r}=JM(e);super(t?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,r;return this==e||e instanceof Jd&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((r=e.attrs)===null||r===void 0?void 0:r.class))&&Dm(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}Jd.prototype.point=!1;class Yd extends Be{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Yd&&this.spec.class==e.spec.class&&Dm(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}Yd.prototype.mapMode=tr.TrackBefore;Yd.prototype.point=!0;class eu extends Be{constructor(e,t,r,i,s,o){super(t,r,s,e),this.block=i,this.isReplace=o,this.mapMode=i?t<=0?tr.TrackBefore:tr.TrackAfter:tr.TrackDel}get type(){return this.startSide!=this.endSide?Br.WidgetRange:this.startSide<=0?Br.WidgetBefore:Br.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof eu&&KW(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}eu.prototype.point=!0;function JM(n,e=!1){let{inclusiveStart:t,inclusiveEnd:r}=n;return t==null&&(t=n.inclusive),r==null&&(r=n.inclusive),{start:t??e,end:r??e}}function KW(n,e){return n==e||!!(n&&e&&n.compare(e))}function im(n,e,t,r=0){let i=t.length-1;i>=0&&t[i]+r>=n?t[i]=Math.max(t[i],e):t.push(n,e)}class Cn extends jt{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,r,i,s,o){if(r){if(!(r instanceof Cn))return!1;this.dom||r.transferDOM(this)}return i&&this.setDeco(r?r.attrs:null),zM(this,e,t,r?r.children.slice():[],s,o),!0}split(e){let t=new Cn;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:r,off:i}=this.childPos(e);i&&(t.append(this.children[r].split(i),0),this.children[r].merge(i,this.children[r].length,null,!1,0,0),r++);for(let s=r;s<this.children.length;s++)t.append(this.children[s],0);for(;r>0&&this.children[r-1].length==0;)this.children[--r].destroy();return this.children.length=r,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Dm(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){GM(this,e,t)}addLineDeco(e){let t=e.spec.attributes,r=e.spec.class;t&&(this.attrs=Pw(t,this.attrs||{})),r&&(this.attrs=Pw({class:r},this.attrs||{}))}domAtPos(e){return VM(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var r;this.dom?this.flags&4&&(NM(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(Iw(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let i=this.dom.lastChild;for(;i&&jt.get(i)instanceof sa;)i=i.lastChild;if(!i||!this.length||i.nodeName!="BR"&&((r=jt.get(i))===null||r===void 0?void 0:r.isEditable)==!1&&(!Te.ios||!this.children.some(s=>s instanceof Es))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let r of this.children){if(!(r instanceof Es)||/[^ -~]/.test(r.text))return null;let i=pd(r.dom);if(i.length!=1)return null;e+=i[0].width,t=i[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let r=KM(this,e,t);if(!this.children.length&&r&&this.parent){let{heightOracle:i}=this.parent.view.viewState,s=r.bottom-r.top;if(Math.abs(s-i.lineHeight)<2&&i.textHeight<s){let o=(s-i.textHeight)/2;return{top:r.top+o,bottom:r.bottom-o,left:r.left,right:r.left}}}return r}become(e){return e instanceof Cn&&this.children.length==0&&e.children.length==0&&Dm(this.attrs,e.attrs)&&this.breakAfter==e.breakAfter}covers(){return!0}static find(e,t){for(let r=0,i=0;r<e.children.length;r++){let s=e.children[r],o=i+s.length;if(o>=t){if(s instanceof Cn)return s;if(o>t)break}i=o+s.breakAfter}return null}}class Qo extends jt{constructor(e,t,r){super(),this.widget=e,this.length=t,this.deco=r,this.breakAfter=0,this.prevWidget=null}merge(e,t,r,i,s,o){return r&&(!(r instanceof Qo)||!this.widget.compare(r.widget)||e>0&&s<=0||t<this.length&&o<=0)?!1:(this.length=e+(r?r.length:0)+(this.length-t),!0)}domAtPos(e){return e==0?vr.before(this.dom):vr.after(this.dom,e==this.length)}split(e){let t=this.length-e;this.length=e;let r=new Qo(this.widget,t,this.deco);return r.breakAfter=this.breakAfter,r}get children(){return ik}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):gt.empty}domBoundsAround(){return null}become(e){return e instanceof Qo&&e.widget.constructor==this.widget.constructor?(e.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=e.widget,this.length=e.length,this.deco=e.deco,this.breakAfter=e.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(e){return this.widget.ignoreEvent(e)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(e,t){let r=this.widget.coordsAt(this.dom,e,t);return r||(this.widget instanceof Lw?null:L1(this.dom.getBoundingClientRect(),this.length?e==0:t<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(e){let{startSide:t,endSide:r}=this.deco;return t==r?!1:e<0?t<0:r>0}}class Lw extends ha{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class Zh{constructor(e,t,r,i){this.doc=e,this.pos=t,this.end=r,this.disallowBlockEffectsFor=i,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Qo&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Cn),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(E0(new _c(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Qo)&&this.getLine()}buildText(e,t,r){for(;e>0;){if(this.textOff==this.text.length){let{value:s,lineBreak:o,done:a}=this.cursor.next(this.skip);if(this.skip=0,a)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=s,this.textOff=0}let i=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-r)),this.getLine().append(E0(new Es(this.text.slice(this.textOff,this.textOff+i)),t),r),this.atCursorPos=!0,this.textOff+=i,e-=i,r=0}}span(e,t,r,i){this.buildText(t-e,r,i),this.pos=t,this.openStart<0&&(this.openStart=i)}point(e,t,r,i,s,o){if(this.disallowBlockEffectsFor[o]&&r instanceof eu){if(r.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let a=t-e;if(r instanceof eu)if(r.block)r.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Qo(r.widget||kc.block,a,r));else{let u=$a.create(r.widget||kc.inline,a,a?0:r.startSide),l=this.atCursorPos&&!u.isEditable&&s<=i.length&&(e<t||r.startSide>0),c=!u.isEditable&&(e<t||s>i.length||r.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!l&&!u.isEditable&&(this.pendingBuffer=0),this.flushBuffer(i),l&&(f.append(E0(new _c(1),i),s),s=i.length+Math.max(0,s-i.length)),f.append(E0(u,i),s),this.atCursorPos=c,this.pendingBuffer=c?e<t||s>i.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=i.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(r);a&&(this.textOff+a<=this.text.length?this.textOff+=a:(this.skip+=a-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=s)}static build(e,t,r,i,s){let o=new Zh(e,t,r,s);return o.openEnd=yt.spans(i,t,r,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function E0(n,e){for(let t of e)n=new sa(t,[n],n.length);return n}class kc extends ha{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}kc.inline=new kc("span");kc.block=new kc("div");var tn=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(tn||(tn={}));const ll=tn.LTR,sk=tn.RTL;function YM(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const JW=YM("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),YW=YM("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Fw=Object.create(null),js=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);Fw[e]=t,Fw[t]=-e}function XM(n){return n<=247?JW[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?YW[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const XW=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Wa{get dir(){return this.level%2?sk:ll}constructor(e,t,r){this.from=e,this.to=t,this.level=r}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,r,i){let s=-1;for(let o=0;o<e.length;o++){let a=e[o];if(a.from<=t&&a.to>=t){if(a.level==r)return o;(s<0||(i!=0?i<0?a.from<t:a.to>t:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function ZM(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let r=n[t],i=e[t];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!ZM(r.inner,i.inner))return!1}return!0}const qt=[];function ZW(n,e,t,r,i){for(let s=0;s<=r.length;s++){let o=s?r[s-1].to:e,a=s<r.length?r[s].from:t,u=s?256:i;for(let l=o,c=u,f=u;l<a;l++){let d=XM(n.charCodeAt(l));d==512?d=c:d==8&&f==4&&(d=16),qt[l]=d==4?2:d,d&7&&(f=d),c=d}for(let l=o,c=u,f=u;l<a;l++){let d=qt[l];if(d==128)l<a-1&&c==qt[l+1]&&c&24?d=qt[l]=c:qt[l]=256;else if(d==64){let g=l+1;for(;g<a&&qt[g]==64;)g++;let m=l&&c==8||g<t&&qt[g]==8?f==1?1:8:256;for(let y=l;y<g;y++)qt[y]=m;l=g-1}else d==8&&f==1&&(qt[l]=1);c=d,d&7&&(f=d)}}}function QW(n,e,t,r,i){let s=i==1?2:1;for(let o=0,a=0,u=0;o<=r.length;o++){let l=o?r[o-1].to:e,c=o<r.length?r[o].from:t;for(let f=l,d,g,m;f<c;f++)if(g=Fw[d=n.charCodeAt(f)])if(g<0){for(let y=a-3;y>=0;y-=3)if(js[y+1]==-g){let b=js[y+2],w=b&2?i:b&4?b&1?s:i:0;w&&(qt[f]=qt[js[y]]=w),a=y;break}}else{if(js.length==189)break;js[a++]=f,js[a++]=d,js[a++]=u}else if((m=qt[f])==2||m==1){let y=m==i;u=y?0:1;for(let b=a-3;b>=0;b-=3){let w=js[b+2];if(w&2)break;if(y)js[b+2]|=2;else{if(w&4)break;js[b+2]|=4}}}}}function ez(n,e,t,r){for(let i=0,s=r;i<=t.length;i++){let o=i?t[i-1].to:n,a=i<t.length?t[i].from:e;for(let u=o;u<a;){let l=qt[u];if(l==256){let c=u+1;for(;;)if(c==a){if(i==t.length)break;c=t[i++].to,a=i<t.length?t[i].from:e}else if(qt[c]==256)c++;else break;let f=s==1,d=(c<e?qt[c]:r)==1,g=f==d?f?1:2:r;for(let m=c,y=i,b=y?t[y-1].to:n;m>u;)m==b&&(m=t[--y].from,b=y?t[y-1].to:n),qt[--m]=g;u=c}else s=l,u++}}}function Nw(n,e,t,r,i,s,o){let a=r%2?2:1;if(r%2==i%2)for(let u=e,l=0;u<t;){let c=!0,f=!1;if(l==s.length||u<s[l].from){let y=qt[u];y!=a&&(c=!1,f=y==16)}let d=!c&&a==1?[]:null,g=c?r:r+1,m=u;e:for(;;)if(l<s.length&&m==s[l].from){if(f)break e;let y=s[l];if(!c)for(let b=y.to,w=l+1;;){if(b==t)break e;if(w<s.length&&s[w].from==b)b=s[w++].to;else{if(qt[b]==a)break e;break}}if(l++,d)d.push(y);else{y.from>u&&o.push(new Wa(u,y.from,g));let b=y.direction==ll!=!(g%2);Bw(n,b?r+1:r,i,y.inner,y.from,y.to,o),u=y.to}m=y.to}else{if(m==t||(c?qt[m]!=a:qt[m]==a))break;m++}d?Nw(n,u,m,r+1,i,d,o):u<m&&o.push(new Wa(u,m,g)),u=m}else for(let u=t,l=s.length;u>e;){let c=!0,f=!1;if(!l||u>s[l-1].to){let y=qt[u-1];y!=a&&(c=!1,f=y==16)}let d=!c&&a==1?[]:null,g=c?r:r+1,m=u;e:for(;;)if(l&&m==s[l-1].to){if(f)break e;let y=s[--l];if(!c)for(let b=y.from,w=l;;){if(b==e)break e;if(w&&s[w-1].to==b)b=s[--w].from;else{if(qt[b-1]==a)break e;break}}if(d)d.push(y);else{y.to<u&&o.push(new Wa(y.to,u,g));let b=y.direction==ll!=!(g%2);Bw(n,b?r+1:r,i,y.inner,y.from,y.to,o),u=y.from}m=y.from}else{if(m==e||(c?qt[m-1]!=a:qt[m-1]==a))break;m--}d?Nw(n,m,u,r+1,i,d,o):m<u&&o.push(new Wa(m,u,g)),u=m}}function Bw(n,e,t,r,i,s,o){let a=e%2?2:1;ZW(n,i,s,r,a),QW(n,i,s,r,a),ez(i,s,r,a),Nw(n,i,s,e,t,r,o)}function tz(n,e,t){if(!n)return[new Wa(0,0,e==sk?1:0)];if(e==ll&&!t.length&&!XW.test(n))return QM(n.length);if(t.length)for(;n.length>qt.length;)qt[qt.length]=256;let r=[],i=e==ll?0:1;return Bw(n,i,i,t,0,n.length,r),r}function QM(n){return[new Wa(0,n,0)]}let eO="";function nz(n,e,t,r,i){var s;let o=r.head-n.from,a=Wa.find(e,o,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),u=e[a],l=u.side(i,t);if(o==l){let d=a+=i?1:-1;if(d<0||d>=e.length)return null;u=e[a=d],o=u.side(!i,t),l=u.side(i,t)}let c=nr(n.text,o,u.forward(i,t));(c<u.from||c>u.to)&&(c=l),eO=n.text.slice(Math.min(o,c),Math.max(o,c));let f=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return f&&c==l&&f.level+(i?0:1)<u.level?me.cursor(f.side(!i,t)+n.from,f.forward(i,t)?1:-1,f.level):me.cursor(c+n.from,u.forward(i,t)?-1:1,u.level)}function rz(n,e,t){for(let r=e;r<t;r++){let i=XM(n.charCodeAt(r));if(i==1)return ll;if(i==2||i==4)return sk}return ll}const tO=Ae.define(),nO=Ae.define(),rO=Ae.define(),iO=Ae.define(),qw=Ae.define(),sO=Ae.define(),oO=Ae.define(),ok=Ae.define(),ak=Ae.define(),aO=Ae.define({combine:n=>n.some(e=>e)}),uO=Ae.define({combine:n=>n.some(e=>e)}),lO=Ae.define();class dc{constructor(e,t="nearest",r="nearest",i=5,s=5,o=!1){this.range=e,this.y=t,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new dc(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new dc(me.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const R0=He.define({map:(n,e)=>n.map(e)}),cO=He.define();function oi(n,e,t){let r=n.facet(iO);r.length?r[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const Ko=Ae.define({combine:n=>n.length?n[0]:!0});let iz=0;const qh=Ae.define();class gn{constructor(e,t,r,i,s){this.id=e,this.create=t,this.domEventHandlers=r,this.domEventObservers=i,this.extension=s(this)}static define(e,t){const{eventHandlers:r,eventObservers:i,provide:s,decorations:o}=t||{};return new gn(iz++,e,r,i,a=>{let u=[qh.of(a)];return o&&u.push(gd.of(l=>{let c=l.plugin(a);return c?o(c):Be.none})),s&&u.push(s(a)),u})}static fromClass(e,t){return gn.define(r=>new e(r),t)}}class Xy{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(r){if(oi(t.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){oi(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(r){oi(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const fO=Ae.define(),uk=Ae.define(),gd=Ae.define(),hO=Ae.define(),lk=Ae.define(),dO=Ae.define();function gE(n,e){let t=n.state.facet(dO);if(!t.length)return t;let r=t.map(s=>s instanceof Function?s(n):s),i=[];return yt.spans(r,e.from,e.to,{point(){},span(s,o,a,u){let l=s-e.from,c=o-e.from,f=i;for(let d=a.length-1;d>=0;d--,u--){let g=a[d].spec.bidiIsolate,m;if(g==null&&(g=rz(e.text,l,c)),u>0&&f.length&&(m=f[f.length-1]).to==l&&m.direction==g)m.to=c,f=m.inner;else{let y={from:l,to:c,direction:g,inner:[]};f.push(y),f=y.inner}}}}),i}const pO=Ae.define();function ck(n){let e=0,t=0,r=0,i=0;for(let s of n.state.facet(pO)){let o=s(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:e,right:t,top:r,bottom:i}}const jh=Ae.define();class Zi{constructor(e,t,r,i){this.fromA=e,this.toA=t,this.fromB=r,this.toB=i}join(e){return new Zi(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,r=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(t-1,1)}}return e.splice(t,0,r),e}static extendWithRanges(e,t){if(t.length==0)return e;let r=[];for(let i=0,s=0,o=0,a=0;;i++){let u=i==e.length?null:e[i],l=o-a,c=u?u.fromB:1e9;for(;s<t.length&&t[s]<c;){let f=t[s],d=t[s+1],g=Math.max(a,f),m=Math.min(c,d);if(g<=m&&new Zi(g+l,m+l,g,m).addToSet(r),d>c)break;s+=2}if(!u)return r;new Zi(u.fromA,u.toA,u.fromB,u.toB).addToSet(r),o=u.toA,a=u.toB}}}class Tm{constructor(e,t,r){this.view=e,this.state=t,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Tn.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,o,a,u)=>i.push(new Zi(s,o,a,u))),this.changedRanges=i}static create(e,t,r){return new Tm(e,t,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class mE extends jt{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=Be.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new Cn],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new Zi(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:l,toA:c})=>c<this.minWidthFrom||l>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?i=this.domChanged.newSel.head:!fz(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?oz(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:l,to:c}=this.hasComposition;r=new Zi(l,c,e.changes.mapPos(l,-1),e.changes.mapPos(c,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Te.ie||Te.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.updateDeco(),u=lz(o,a,e.changes);return r=Zi.extendWithRanges(r,u),!(this.flags&7)&&r.length==0?!1:(this.updateInner(r,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,r){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,r);let{observer:i}=this.view;i.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=Te.chrome||Te.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||i.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.children)o instanceof Qo&&o.widget instanceof Lw&&s.push(o.dom);i.updateGaps(s)}updateChildren(e,t,r){let i=r?r.range.addToSet(e.slice()):e,s=this.childCursor(t);for(let o=i.length-1;;o--){let a=o>=0?i[o]:null;if(!a)break;let{fromA:u,toA:l,fromB:c,toB:f}=a,d,g,m,y;if(r&&r.range.fromB<f&&r.range.toB>c){let x=Zh.build(this.view.state.doc,c,r.range.fromB,this.decorations,this.dynamicDecorationMap),C=Zh.build(this.view.state.doc,r.range.toB,f,this.decorations,this.dynamicDecorationMap);g=x.breakAtStart,m=x.openStart,y=C.openEnd;let R=this.compositionView(r);C.breakAtStart?R.breakAfter=1:C.content.length&&R.merge(R.length,R.length,C.content[0],!1,C.openStart,0)&&(R.breakAfter=C.content[0].breakAfter,C.content.shift()),x.content.length&&R.merge(0,0,x.content[x.content.length-1],!0,0,x.openEnd)&&x.content.pop(),d=x.content.concat(R).concat(C.content)}else({content:d,breakAtStart:g,openStart:m,openEnd:y}=Zh.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:b,off:w}=s.findPos(l,1),{i:S,off:k}=s.findPos(u,-1);WM(this,S,k,b,w,d,g,m,y)}r&&this.fixCompositionDOM(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let r of t.effects)r.is(cO)&&(this.editContextFormatting=r.value)}compositionView(e){let t=new Es(e.text.nodeValue);t.flags|=8;for(let{deco:i}of e.marks)t=new sa(i,[t],t.length);let r=new Cn;return r.append(t,0),r}fixCompositionDOM(e){let t=(s,o)=>{o.flags|=8|(o.children.some(u=>u.flags&7)?1:0),this.markedForComposition.add(o);let a=jt.get(s);a&&a!=o&&(a.dom=null),o.setDOM(s)},r=this.childPos(e.range.fromB,1),i=this.children[r.i];t(e.line,i);for(let s=e.marks.length-1;s>=-1;s--)r=i.childPos(r.off,1),i=i.children[r.i],t(s>=0?e.marks[s].node:e.text,i)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let r=this.view.root.activeElement,i=r==this.dom,s=!i&&!(this.view.state.facet(Ko)||this.dom.tabIndex>-1)&&rm(this.dom,this.view.observer.selectionRange)&&!(r&&this.dom.contains(r));if(!(i||t||s))return;let o=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,u=this.moveToLine(this.domAtPos(a.anchor)),l=a.empty?u:this.moveToLine(this.domAtPos(a.head));if(Te.gecko&&a.empty&&!this.hasComposition&&sz(u)){let f=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(f,u.node.childNodes[u.offset]||null)),u=l=new vr(f,0),o=!0}let c=this.view.observer.selectionRange;(o||!c.focusNode||(!Xh(u.node,u.offset,c.anchorNode,c.anchorOffset)||!Xh(l.node,l.offset,c.focusNode,c.focusOffset))&&!this.suppressWidgetCursorChange(c,a))&&(this.view.observer.ignore(()=>{Te.android&&Te.chrome&&this.dom.contains(c.focusNode)&&cz(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=dd(this.view.root);if(f)if(a.empty){if(Te.gecko){let d=az(u.node,u.offset);if(d&&d!=3){let g=(d==1?qM:jM)(u.node,u.offset);g&&(u=new vr(g.node,g.offset))}}f.collapse(u.node,u.offset),a.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=a.bidiLevel)}else if(f.extend){f.collapse(u.node,u.offset);try{f.extend(l.node,l.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([u,l]=[l,u]),d.setEnd(l.node,l.offset),d.setStart(u.node,u.offset),f.removeAllRanges(),f.addRange(d)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(u,l)),this.impreciseAnchor=u.precise?null:new vr(c.anchorNode,c.anchorOffset),this.impreciseHead=l.precise?null:new vr(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Xh(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,r=dd(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!t.empty||!t.assoc||!r.modify)return;let o=Cn.find(this,t.head);if(!o)return;let a=o.posAtStart;if(t.head==a||t.head==a+o.length)return;let u=this.coordsAt(t.head,-1),l=this.coordsAt(t.head,1);if(!u||!l||u.bottom>l.top)return;let c=this.domAtPos(t.head+t.assoc);r.collapse(c.node,c.offset),r.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&r.collapse(i,s)}moveToLine(e){let t=this.dom,r;if(e.node!=t)return e;for(let i=e.offset;!r&&i<t.childNodes.length;i++){let s=jt.get(t.childNodes[i]);s instanceof Cn&&(r=s.domAtPos(0))}for(let i=e.offset-1;!r&&i>=0;i--){let s=jt.get(t.childNodes[i]);s instanceof Cn&&(r=s.domAtPos(s.length))}return r?new vr(r.node,r.offset,!0):e}nearest(e){for(let t=e;t;){let r=jt.get(t);if(r&&r.rootView==this)return r;t=t.parentNode}return null}posFromDOM(e,t){let r=this.nearest(e);if(!r)throw new RangeError("Trying to find position for a DOM position outside of the document");return r.localPosFromDOM(e,t)+r.posAtStart}domAtPos(e){let{i:t,off:r}=this.childCursor().findPos(e,-1);for(;t<this.children.length-1;){let i=this.children[t];if(r<i.length||i instanceof Cn)break;t++,r=0}return this.children[t].domAtPos(r)}coordsAt(e,t){let r=null,i=0;for(let s=this.length,o=this.children.length-1;o>=0;o--){let a=this.children[o],u=s-a.breakAfter,l=u-a.length;if(u<e)break;if(l<=e&&(l<e||a.covers(-1))&&(u>e||a.covers(1))&&(!r||a instanceof Cn&&!(r instanceof Cn&&t>=0)))r=a,i=l;else if(r&&l==e&&u==e&&a instanceof Qo&&Math.abs(t)<2){if(a.deco.startSide<0)break;o&&(r=null)}s=l}return r?r.coordsAt(e-i,t):null}coordsForChar(e){let{i:t,off:r}=this.childPos(e,1),i=this.children[t];if(!(i instanceof Cn))return null;for(;i.children.length;){let{i:a,off:u}=i.childPos(r,1);for(;;a++){if(a==i.children.length)return null;if((i=i.children[a]).length)break}r=u}if(!(i instanceof Es))return null;let s=nr(i.text,r);if(s==r)return null;let o=ul(i.dom,r,s).getClientRects();for(let a=0;a<o.length;a++){let u=o[a];if(a==o.length-1||u.top<u.bottom&&u.left<u.right)return u}return null}measureVisibleLineHeights(e){let t=[],{from:r,to:i}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,u=this.view.textDirection==tn.LTR;for(let l=0,c=0;c<this.children.length;c++){let f=this.children[c],d=l+f.length;if(d>i)break;if(l>=r){let g=f.dom.getBoundingClientRect();if(t.push(g.height),o){let m=f.dom.lastChild,y=m?pd(m):[];if(y.length){let b=y[y.length-1],w=u?b.right-g.left:g.right-b.left;w>a&&(a=w,this.minWidth=s,this.minWidthFrom=l,this.minWidthTo=d)}}}l=d+f.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?tn.RTL:tn.LTR}measureTextSize(){for(let s of this.children)if(s instanceof Cn){let o=s.measureTextSize();if(o)return o}let e=document.createElement("div"),t,r,i;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=pd(e.firstChild)[0];t=e.getBoundingClientRect().height,r=s?s.width/27:7,i=s?s.height:t,e.remove()}),{lineHeight:t,charWidth:r,textHeight:i}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new $M(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let r=0,i=0;;i++){let s=i==t.viewports.length?null:t.viewports[i],o=s?s.from-1:this.length;if(o>r){let a=(t.lineBlockAt(o).bottom-t.lineBlockAt(r).top)/this.view.scaleY;e.push(Be.replace({widget:new Lw(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,o))}if(!s)break;r=s.to+1}return Be.set(e)}updateDeco(){let e=1,t=this.view.state.facet(gd).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(hO).map((s,o)=>{let a=typeof s=="function";return a&&(r=!0),a?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,t.push(yt.join(i))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;return this.decorations}scrollIntoView(e){if(e.isSnapshot){let l=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=l.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let l of this.view.state.facet(lO))try{if(l(this.view,e.range,e))return!0}catch(c){oi(this.view.state,c,"scroll handler")}let{range:t}=e,r=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),i;if(!r)return;!t.empty&&(i=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let s=ck(this.view),o={left:r.left-s.left,top:r.top-s.top,right:r.right+s.right,bottom:r.bottom+s.bottom},{offsetWidth:a,offsetHeight:u}=this.view.scrollDOM;NW(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,u),-u),this.view.textDirection==tn.LTR)}}function sz(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function gO(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let r=qM(t.focusNode,t.focusOffset),i=jM(t.focusNode,t.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let a=jt.get(i.node);if(!a||a instanceof Es&&a.text!=i.node.nodeValue)s=i;else if(n.docView.lastCompositionAfterCursor){let u=jt.get(r.node);!u||u instanceof Es&&u.text!=r.node.nodeValue||(s=i)}}if(n.docView.lastCompositionAfterCursor=s!=r,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function oz(n,e,t){let r=gO(n,t);if(!r)return null;let{node:i,from:s,to:o}=r,a=i.nodeValue;if(/[\n\r]/.test(a)||n.state.doc.sliceString(r.from,r.to)!=a)return null;let u=e.invertedDesc,l=new Zi(u.mapPos(s),u.mapPos(o),s,o),c=[];for(let f=i.parentNode;;f=f.parentNode){let d=jt.get(f);if(d instanceof sa)c.push({node:f,deco:d.mark});else{if(d instanceof Cn||f.nodeName=="DIV"&&f.parentNode==n.contentDOM)return{range:l,text:i,marks:c,line:f};if(f!=n.contentDOM)c.push({node:f,deco:new Jd({inclusive:!0,attributes:GW(f),tagName:f.tagName.toLowerCase()})});else return null}}}function az(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0)}let uz=class{constructor(){this.changes=[]}compareRange(e,t){im(e,t,this.changes)}comparePoint(e,t){im(e,t,this.changes)}boundChange(e){im(e,e,this.changes)}};function lz(n,e,t){let r=new uz;return yt.compare(n,e,t,r),r.changes}function cz(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function fz(n,e){let t=!1;return e&&n.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(t=!0)}),t}function hz(n,e,t=1){let r=n.charCategorizer(e),i=n.doc.lineAt(e),s=e-i.from;if(i.length==0)return me.cursor(e);s==0?t=1:s==i.length&&(t=-1);let o=s,a=s;t<0?o=nr(i.text,s,!1):a=nr(i.text,s);let u=r(i.text.slice(o,a));for(;o>0;){let l=nr(i.text,o,!1);if(r(i.text.slice(l,o))!=u)break;o=l}for(;a<i.length;){let l=nr(i.text,a);if(r(i.text.slice(a,l))!=u)break;a=l}return me.range(o+i.from,a+i.from)}function dz(n,e){return e.left>n?e.left-n:Math.max(0,n-e.right)}function pz(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function Zy(n,e){return n.top<e.bottom-1&&n.bottom>e.top+1}function vE(n,e){return e<n.top?{top:e,left:n.left,right:n.right,bottom:n.bottom}:n}function yE(n,e){return e>n.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function jw(n,e,t){let r,i,s,o,a=!1,u,l,c,f;for(let m=n.firstChild;m;m=m.nextSibling){let y=pd(m);for(let b=0;b<y.length;b++){let w=y[b];i&&Zy(i,w)&&(w=vE(yE(w,i.bottom),i.top));let S=dz(e,w),k=pz(t,w);if(S==0&&k==0)return m.nodeType==3?bE(m,e,t):jw(m,e,t);if(!r||o>k||o==k&&s>S){r=m,i=w,s=S,o=k;let x=k?t<w.top?-1:1:S?e<w.left?-1:1:0;a=!x||(x>0?b<y.length-1:b>0)}S==0?t>w.bottom&&(!c||c.bottom<w.bottom)?(u=m,c=w):t<w.top&&(!f||f.top>w.top)&&(l=m,f=w):c&&Zy(c,w)?c=yE(c,w.bottom):f&&Zy(f,w)&&(f=vE(f,w.top))}}if(c&&c.bottom>=t?(r=u,i=c):f&&f.top<=t&&(r=l,i=f),!r)return{node:n,offset:0};let d=Math.max(i.left,Math.min(i.right,e));if(r.nodeType==3)return bE(r,d,t);if(a&&r.contentEditable!="false")return jw(r,d,t);let g=Array.prototype.indexOf.call(n.childNodes,r)+(e>=(i.left+i.right)/2?1:0);return{node:n,offset:g}}function bE(n,e,t){let r=n.nodeValue.length,i=-1,s=1e9,o=0;for(let a=0;a<r;a++){let u=ul(n,a,a+1).getClientRects();for(let l=0;l<u.length;l++){let c=u[l];if(c.top==c.bottom)continue;o||(o=e-c.left);let f=(c.top>t?c.top-t:t-c.bottom)-1;if(c.left-1<=e&&c.right+1>=e&&f<s){let d=e>=(c.left+c.right)/2,g=d;if((Te.chrome||Te.gecko)&&ul(n,a).getBoundingClientRect().left==c.right&&(g=!d),f<=0)return{node:n,offset:a+(g?1:0)};i=a+(g?1:0),s=f}}}return{node:n,offset:i>-1?i:o>0?n.nodeValue.length:0}}function mO(n,e,t,r=-1){var i,s;let o=n.contentDOM.getBoundingClientRect(),a=o.top+n.viewState.paddingTop,u,{docHeight:l}=n.viewState,{x:c,y:f}=e,d=f-a;if(d<0)return 0;if(d>l)return n.state.doc.length;for(let x=n.viewState.heightOracle.textHeight/2,C=!1;u=n.elementAtHeight(d),u.type!=Br.Text;)for(;d=r>0?u.bottom+x:u.top-x,!(d>=0&&d<=l);){if(C)return t?null:0;C=!0,r=-r}f=a+d;let g=u.from;if(g<n.viewport.from)return n.viewport.from==0?0:t?null:wE(n,o,u,c,f);if(g>n.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:wE(n,o,u,c,f);let m=n.dom.ownerDocument,y=n.root.elementFromPoint?n.root:m,b=y.elementFromPoint(c,f);b&&!n.contentDOM.contains(b)&&(b=null),b||(c=Math.max(o.left+1,Math.min(o.right-1,c)),b=y.elementFromPoint(c,f),b&&!n.contentDOM.contains(b)&&(b=null));let w,S=-1;if(b&&((i=n.docView.nearest(b))===null||i===void 0?void 0:i.isEditable)!=!1){if(m.caretPositionFromPoint){let x=m.caretPositionFromPoint(c,f);x&&({offsetNode:w,offset:S}=x)}else if(m.caretRangeFromPoint){let x=m.caretRangeFromPoint(c,f);x&&({startContainer:w,startOffset:S}=x,(!n.contentDOM.contains(w)||Te.safari&&gz(w,S,c)||Te.chrome&&mz(w,S,c))&&(w=void 0))}w&&(S=Math.min(go(w),S))}if(!w||!n.docView.dom.contains(w)){let x=Cn.find(n.docView,g);if(!x)return d>u.top+u.height/2?u.to:u.from;({node:w,offset:S}=jw(x.dom,c,f))}let k=n.docView.nearest(w);if(!k)return null;if(k.isWidget&&((s=k.dom)===null||s===void 0?void 0:s.nodeType)==1){let x=k.dom.getBoundingClientRect();return e.y<x.top||e.y<=x.bottom&&e.x<=(x.left+x.right)/2?k.posAtStart:k.posAtEnd}else return k.localPosFromDOM(w,S)+k.posAtStart}function wE(n,e,t,r,i){let s=Math.round((r-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let a=n.viewState.heightOracle.textHeight,u=Math.floor((i-t.top-(n.defaultLineHeight-a)*.5)/a);s+=u*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+Ew(o,s,n.state.tabSize)}function gz(n,e,t){let r;if(n.nodeType!=3||e!=(r=n.nodeValue.length))return!1;for(let i=n.nextSibling;i;i=i.nextSibling)if(i.nodeType!=1||i.nodeName!="BR")return!1;return ul(n,r-1,r).getBoundingClientRect().left>t}function mz(n,e,t){if(e!=0)return!1;for(let i=n;;){let s=i.parentNode;if(!s||s.nodeType!=1||s.firstChild!=i)return!1;if(s.classList.contains("cm-line"))break;i=s}let r=n.nodeType==1?n.getBoundingClientRect():ul(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-r.left>5}function $w(n,e,t){let r=n.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!i||s.type==Br.Text&&(i.type!=s.type||(t<0?s.from<e:s.to>e)))&&(i=s)}}return i||r}return r}function vz(n,e,t,r){let i=$w(n,e.head,e.assoc||-1),s=!r||i.type!=Br.Text||!(n.lineWrapping||i.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let o=n.dom.getBoundingClientRect(),a=n.textDirectionAt(i.from),u=n.posAtCoords({x:t==(a==tn.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(u!=null)return me.cursor(u,t?-1:1)}return me.cursor(t?i.to:i.from,t?-1:1)}function _E(n,e,t,r){let i=n.state.doc.lineAt(e.head),s=n.bidiSpans(i),o=n.textDirectionAt(i.from);for(let a=e,u=null;;){let l=nz(i,s,o,a,t),c=eO;if(!l){if(i.number==(t?n.state.doc.lines:1))return a;c=`
|
|
34
|
-
`,i=n.state.doc.line(i.number+(t?1:-1)),s=n.bidiSpans(i),l=n.visualLineSide(i,!t)}if(u){if(!u(c))return a}else{if(!r)return l;u=r(c)}a=l}}function yz(n,e,t){let r=n.state.charCategorizer(e),i=r(t);return s=>{let o=r(s);return i==rn.Space&&(i=o),i==o}}function bz(n,e,t,r){let i=e.head,s=t?1:-1;if(i==(t?n.state.doc.length:0))return me.cursor(i,e.assoc);let o=e.goalColumn,a,u=n.contentDOM.getBoundingClientRect(),l=n.coordsAtPos(i,e.assoc||-1),c=n.documentTop;if(l)o==null&&(o=l.left-u.left),a=s<0?l.top:l.bottom;else{let g=n.viewState.lineBlockAt(i);o==null&&(o=Math.min(u.right-u.left,n.defaultCharacterWidth*(i-g.from))),a=(s<0?g.top:g.bottom)+c}let f=u.left+o,d=r??n.viewState.heightOracle.textHeight>>1;for(let g=0;;g+=10){let m=a+(d+g)*s,y=mO(n,{x:f,y:m},!1,s);if(m<u.top||m>u.bottom||(s<0?y<i:y>i)){let b=n.docView.coordsForChar(y),w=!b||m<b.top?-1:1;return me.cursor(y,w,void 0,o)}}}function sm(n,e,t){for(;;){let r=0;for(let i of n)i.between(e-1,e+1,(s,o,a)=>{if(e>s&&e<o){let u=r||t||(e-s<o-e?-1:1);e=u<0?s:o,r=u}});if(!r)return e}}function Qy(n,e,t){let r=sm(n.state.facet(lk).map(i=>i(n)),t.from,e.head>t.from?-1:1);return r==t.from?t:me.cursor(r,r<t.from?1:-1)}const $h="";class wz{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(dt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=$h}readRange(e,t){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let o=i.nextSibling;if(o==t)break;let a=jt.get(i),u=jt.get(o);(a&&u?a.breakAfter:(a?a.breakAfter:Am(i))||Am(o)&&(i.nodeName!="BR"||i.cmIgnore)&&this.text.length>s)&&this.lineBreak(),i=o}return this.findPointBefore(r,t),this}readTextNode(e){let t=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,t.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,r),o=this.lineSeparator.length):(a=i.exec(t))&&(s=a.index,o=a[0].length),this.append(t.slice(r,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let u of this.points)u.node==e&&u.pos>this.text.length&&(u.pos-=o-1);r=s+o}}readNode(e){if(e.cmIgnore)return;let t=jt.get(e),r=t&&t.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==t&&(r.pos=this.text.length)}findPointInside(e,t){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(_z(e,r.node,r.offset)?t:0))}}function _z(n,e,t){for(;;){if(!e||t<go(e))return!1;if(e==n)return!0;t=al(e)+1,e=e.parentNode}}class kE{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class kz{constructor(e,t,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,r,0))){let a=s||o?[]:Cz(e),u=new wz(a,e.state);u.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=u.text,this.newSel=Ez(a,this.bounds.from)}else{let a=e.observer.selectionRange,u=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!Dw(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),l=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!Dw(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),c=e.viewport;if((Te.ios||Te.chrome)&&e.state.selection.main.empty&&u!=l&&(c.from>0||c.to<e.state.doc.length)){let f=Math.min(u,l),d=Math.max(u,l),g=c.from-f,m=c.to-d;(g==0||g==1||f==0)&&(m==0||m==-1||d==e.state.doc.length)&&(u=0,l=e.state.doc.length)}this.newSel=me.single(l,u)}}}function vO(n,e){let t,{newSel:r}=e,i=n.state.selection.main,s=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:a}=e.bounds,u=i.from,l=null;(s===8||Te.android&&e.text.length<a-o)&&(u=i.to,l="end");let c=Sz(n.state.doc.sliceString(o,a,$h),e.text,u-o,l);c&&(Te.chrome&&s==13&&c.toB==c.from+2&&e.text.slice(c.from,c.toB)==$h+$h&&c.toB--,t={from:o+c.from,to:o+c.toA,insert:gt.of(e.text.slice(c.from,c.toB).split($h))})}else r&&(!n.hasFocus&&n.state.facet(Ko)||r.main.eq(i))&&(r=null);if(!t&&!r)return!1;if(!t&&e.typeOver&&!i.empty&&r&&r.main.empty?t={from:i.from,to:i.to,insert:n.state.doc.slice(i.from,i.to)}:(Te.mac||Te.android)&&t&&t.from==t.to&&t.from==i.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(r&&t.insert.length==2&&(r=me.single(r.main.anchor-1,r.main.head-1)),t={from:t.from,to:t.to,insert:gt.of([t.insert.toString().replace("."," ")])}):t&&t.from>=i.from&&t.to<=i.to&&(t.from!=i.from||t.to!=i.to)&&i.to-i.from-(t.to-t.from)<=4?t={from:i.from,to:i.to,insert:n.state.doc.slice(i.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,i.to))}:Te.chrome&&t&&t.from==t.to&&t.from==i.head&&t.insert.toString()==`
|
|
35
|
-
`&&n.lineWrapping&&(r&&(r=me.single(r.main.anchor-1,r.main.head-1)),t={from:i.from,to:i.to,insert:gt.of([" "])}),t)return fk(n,t,r,s);if(r&&!r.main.eq(i)){let o=!1,a="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),a=n.inputState.lastSelectionOrigin),n.dispatch({selection:r,scrollIntoView:o,userEvent:a}),!0}else return!1}function fk(n,e,t,r=-1){if(Te.ios&&n.inputState.flushIOSKey(e))return!0;let i=n.state.selection.main;if(Te.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&n.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&hc(n.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&hc(n.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&hc(n.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,a=()=>o||(o=xz(n,e,t));return n.state.facet(sO).some(u=>u(n,e.from,e.to,s,a))||n.dispatch(a()),!0}function xz(n,e,t){let r,i=n.state,s=i.selection.main;if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let a=s.from<e.from?i.sliceDoc(s.from,e.from):"",u=s.to>e.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(n.state.toText(a+e.insert.sliceString(0,void 0,n.state.lineBreak)+u))}else{let a=i.changes(e),u=t&&t.main.to<=a.newLength?t.main:void 0;if(i.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let l=n.state.sliceDoc(e.from,e.to),c,f=t&&gO(n,t.main.head);if(f){let m=e.insert.length-(e.to-e.from);c={from:f.from,to:f.to-m}}else c=n.state.doc.lineAt(s.head);let d=s.to-e.to,g=s.to-s.from;r=i.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:a,range:u||m.map(a)};let y=m.to-d,b=y-l.length;if(m.to-m.from!=g||n.state.sliceDoc(b,y)!=l||m.to>=c.from&&m.from<=c.to)return{range:m};let w=i.changes({from:b,to:y,insert:e.insert}),S=m.to-s.to;return{changes:w,range:u?me.range(Math.max(0,u.anchor+S),Math.max(0,u.head+S)):m.map(w)}})}else r={changes:a,selection:u&&i.selection.replaceRange(u)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:o,scrollIntoView:!0})}function Sz(n,e,t,r){let i=Math.min(n.length,e.length),s=0;for(;s<i&&n.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&n.length==e.length)return null;let o=n.length,a=e.length;for(;o>0&&a>0&&n.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(r=="end"){let u=Math.max(0,s-Math.min(o,a));t-=o+u-s}if(o<s&&n.length<e.length){let u=t<=s&&t>=o?s-t:0;s-=u,a=s+(a-o),o=s}else if(a<s){let u=t<=s&&t>=a?s-t:0;s-=u,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function Cz(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:s}=n.observer.selectionRange;return t&&(e.push(new kE(t,r)),(i!=t||s!=r)&&e.push(new kE(i,s))),e}function Ez(n,e){if(n.length==0)return null;let t=n[0].pos,r=n.length==2?n[1].pos:t;return t>-1&&r>-1?me.single(t+e,r+e):null}class Rz{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Te.safari&&e.contentDOM.addEventListener("input",()=>null),Te.gecko&&zz(e.contentDOM.ownerDocument)}handleEvent(e){!Lz(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,t);for(let i of r.handlers){if(t.defaultPrevented)break;if(i(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Az(e),r=this.handlers,i=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].handlers.length,a=r[s];a&&o!=!a.handlers.length&&(i.removeEventListener(s,this.handleEvent),a=null),a||i.addEventListener(s,this.handleEvent,{passive:o})}for(let s in r)s!="scroll"&&!t[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&bO.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Te.android&&Te.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Te.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=yO.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||Dz.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,hc(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:Te.safari&&!Te.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function xE(n,e){return(t,r)=>{try{return e.call(n,r,t)}catch(i){oi(t.state,i)}}}function Az(n){let e=Object.create(null);function t(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of n){let i=r.spec;if(i&&i.domEventHandlers)for(let s in i.domEventHandlers){let o=i.domEventHandlers[s];o&&t(s).handlers.push(xE(r.value,o))}if(i&&i.domEventObservers)for(let s in i.domEventObservers){let o=i.domEventObservers[s];o&&t(s).observers.push(xE(r.value,o))}}for(let r in Rs)t(r).handlers.push(Rs[r]);for(let r in ts)t(r).observers.push(ts[r]);return e}const yO=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Dz="dthko",bO=[16,17,18,20,91,92,224,225],A0=6;function D0(n){return Math.max(0,n)*.7+8}function Tz(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class Mz{constructor(e,t,r,i){this.view=e,this.startEvent=t,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=BW(e.contentDOM),this.atoms=e.state.facet(lk).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(dt.allowMultipleSelections)&&Oz(e,t),this.dragging=Iz(e,t)&&kO(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Tz(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,r=0,i=0,s=0,o=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:a}=this.scrollParents.y.getBoundingClientRect());let u=ck(this.view);e.clientX-u.left<=i+A0?t=-D0(i-e.clientX):e.clientX+u.right>=o-A0&&(t=D0(e.clientX-o)),e.clientY-u.top<=s+A0?r=-D0(s-e.clientY):e.clientY+u.bottom>=a-A0&&(r=D0(e.clientY-a)),this.setScrollSpeed(t,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],s=null;if(i.empty){let o=sm(this.atoms,i.from,0);o!=i.from&&(s=me.cursor(o,-1))}else{let o=sm(this.atoms,i.from,-1),a=sm(this.atoms,i.to,1);(o!=i.from||a!=i.to)&&(s=me.range(i.from==i.anchor?o:a,i.from==i.head?o:a))}s&&(t||(t=e.ranges.slice()),t[r]=s)}return t?me.create(t,e.mainIndex):e}select(e){let{view:t}=this,r=this.skipAtoms(this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function Oz(n,e){let t=n.state.facet(tO);return t.length?t[0](e):Te.mac?e.metaKey:e.ctrlKey}function Pz(n,e){let t=n.state.facet(nO);return t.length?t[0](e):Te.mac?!e.altKey:!e.ctrlKey}function Iz(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let r=dd(n.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s<i.length;s++){let o=i[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Lz(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,r;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(r=jt.get(t))&&r.ignoreEvent(e))return!1;return!0}const Rs=Object.create(null),ts=Object.create(null),wO=Te.ie&&Te.ie_version<15||Te.ios&&Te.webkit_version<604;function Fz(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),_O(n,t.value)},50)}function N1(n,e,t){for(let r of n.facet(e))t=r(t,n);return t}function _O(n,e){e=N1(n.state,ok,e);let{state:t}=n,r,i=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(Ww!=null&&t.selection.ranges.every(u=>u.empty)&&Ww==s.toString()){let u=-1;r=t.changeByRange(l=>{let c=t.doc.lineAt(l.from);if(c.from==u)return{range:l};u=c.from;let f=t.toText((o?s.line(i++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:me.cursor(l.from+f.length)}})}else o?r=t.changeByRange(u=>{let l=s.line(i++);return{changes:{from:u.from,to:u.to,insert:l.text},range:me.cursor(u.from+l.length)}}):r=t.replaceSelection(s);n.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}ts.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Rs.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);ts.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};ts.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Rs.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let r of n.state.facet(rO))if(t=r(n,e),t)break;if(!t&&e.button==0&&(t=qz(n,e)),t){let r=!n.hasFocus;n.inputState.startMouseSelection(new Mz(n,e,t,r)),r&&n.observer.ignore(()=>{FM(n.contentDOM);let s=n.root.activeElement;s&&!s.contains(n.contentDOM)&&s.blur()});let i=n.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}return!1};function SE(n,e,t,r){if(r==1)return me.cursor(e,t);if(r==2)return hz(n.state,e,t);{let i=Cn.find(n.docView,e),s=n.state.doc.lineAt(i?i.posAtEnd:e),o=i?i.posAtStart:s.from,a=i?i.posAtEnd:s.to;return a<n.state.doc.length&&a==s.to&&a++,me.range(o,a)}}let CE=(n,e,t)=>e>=t.top&&e<=t.bottom&&n>=t.left&&n<=t.right;function Nz(n,e,t,r){let i=Cn.find(n.docView,e);if(!i)return 1;let s=e-i.posAtStart;if(s==0)return 1;if(s==i.length)return-1;let o=i.coordsAt(s,-1);if(o&&CE(t,r,o))return-1;let a=i.coordsAt(s,1);return a&&CE(t,r,a)?1:o&&o.bottom>=r?-1:1}function EE(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:Nz(n,t,e.clientX,e.clientY)}}const Bz=Te.ie&&Te.ie_version<=11;let RE=null,AE=0,DE=0;function kO(n){if(!Bz)return n.detail;let e=RE,t=DE;return RE=n,DE=Date.now(),AE=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(AE+1)%3:1}function qz(n,e){let t=EE(n,e),r=kO(e),i=n.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),i=i.map(s.changes))},get(s,o,a){let u=EE(n,s),l,c=SE(n,u.pos,u.bias,r);if(t.pos!=u.pos&&!o){let f=SE(n,t.pos,t.bias,r),d=Math.min(f.from,c.from),g=Math.max(f.to,c.to);c=d<c.from?me.range(d,g):me.range(g,d)}return o?i.replaceRange(i.main.extend(c.from,c.to)):a&&r==1&&i.ranges.length>1&&(l=jz(i,u.pos))?l:a?i.addRange(c):me.create([c])}}}function jz(n,e){for(let t=0;t<n.ranges.length;t++){let{from:r,to:i}=n.ranges[t];if(r<=e&&i>=e)return me.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}Rs.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let i=n.docView.nearest(e.target);if(i&&i.isWidget){let s=i.posAtStart,o=s+i.length;(s>=t.to||o<=t.from)&&(t=me.range(s,o))}}let{inputState:r}=n;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",N1(n.state,ak,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Rs.dragend=n=>(n.inputState.draggedContent=null,!1);function TE(n,e,t,r){if(t=N1(n.state,ok,t),!t)return;let i=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=n.inputState,o=r&&s&&Pz(n,e)?{from:s.from,to:s.to}:null,a={from:i,insert:t},u=n.state.changes(o?[o,a]:a);n.focus(),n.dispatch({changes:u,selection:{anchor:u.mapPos(i,-1),head:u.mapPos(i,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}Rs.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let r=Array(t.length),i=0,s=()=>{++i==t.length&&TE(n,e,r.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let a=new FileReader;a.onerror=s,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[o]=a.result),s()},a.readAsText(t[o])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return TE(n,e,r,!0),!0}return!1};Rs.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=wO?null:e.clipboardData;return t?(_O(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(Fz(n),!1)};function $z(n,e){let t=n.dom.parentNode;if(!t)return;let r=t.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),n.focus()},50)}function Wz(n){let e=[],t=[],r=!1;for(let i of n.selection.ranges)i.empty||(e.push(n.sliceDoc(i.from,i.to)),t.push(i));if(!e.length){let i=-1;for(let{from:s}of n.selection.ranges){let o=n.doc.lineAt(s);o.number>i&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),i=o.number}r=!0}return{text:N1(n,ak,e.join(n.lineBreak)),ranges:t,linewise:r}}let Ww=null;Rs.copy=Rs.cut=(n,e)=>{let{text:t,ranges:r,linewise:i}=Wz(n.state);if(!t&&!i)return!1;Ww=i?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=wO?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):($z(n,t),!1)};const xO=fa.define();function SO(n,e){let t=[];for(let r of n.facet(oO)){let i=r(n,e);i&&t.push(i)}return t.length?n.update({effects:t,annotations:xO.of(!0)}):null}function CO(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=SO(n.state,e);t?n.dispatch(t):n.update([])}},10)}ts.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),CO(n)};ts.blur=n=>{n.observer.clearSelectionRange(),CO(n)};ts.compositionstart=ts.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};ts.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,Te.chrome&&Te.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};ts.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Rs.beforeinput=(n,e)=>{var t,r;if(e.inputType=="insertReplacementText"&&n.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let a=o[0],u=n.posAtDOM(a.startContainer,a.startOffset),l=n.posAtDOM(a.endContainer,a.endOffset);return fk(n,{from:u,to:l,insert:n.state.toText(s)},null),!0}}let i;if(Te.chrome&&Te.android&&(i=yO.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return Te.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),Te.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>ts.compositionend(n,e),20),!1};const ME=new Set;function zz(n){ME.has(n)||(ME.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const OE=["pre-wrap","normal","pre-line","break-spaces"];let xc=!1;function PE(){xc=!1}class Uz{constructor(e){this.lineWrapping=e,this.doc=gt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let r=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((t-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return OE.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(t=!0,this.heightSamples[Math.floor(i*10)]=!0)}return t}refresh(e,t,r,i,s,o){let a=OE.indexOf(e)>-1,u=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=a;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=r,this.textHeight=i,this.lineLength=s,u){this.heightSamples={};for(let l=0;l<o.length;l++){let c=o[l];c<0?l++:this.heightSamples[Math.floor(c*10)]=!0}}return u}}class Hz{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class no{constructor(e,t,r,i,s){this.from=e,this.length=t,this.top=r,this.height=i,this._content=s}get type(){return typeof this._content=="number"?Br.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof eu?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new no(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var en=function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n}(en||(en={}));const om=.001;class qr{constructor(e,t,r=2){this.length=e,this.height=t,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>om&&(xc=!0),this.height=e)}replace(e,t,r){return qr.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,r,i){let s=this,o=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:u,toA:l,fromB:c,toB:f}=i[a],d=s.lineAt(u,en.ByPosNoHeight,r.setDoc(t),0,0),g=d.to>=l?d:s.lineAt(l,en.ByPosNoHeight,r,0,0);for(f+=g.to-l,l=g.to;a>0&&d.from<=i[a-1].toA;)u=i[a-1].fromA,c=i[a-1].fromB,a--,u<d.from&&(d=s.lineAt(u,en.ByPosNoHeight,r,0,0));c+=d.from-u,u=d.from;let m=hk.build(r.setDoc(o),e,c,f);s=Mm(s,s.replace(u,l,m))}return s.updateHeight(r,0)}static empty(){return new Si(0,0)}static of(e){if(e.length==1)return e[0];let t=0,r=e.length,i=0,s=0;for(;;)if(t==r)if(i>s*2){let a=e[t-1];a.break?e.splice(--t,1,a.left,null,a.right):e.splice(--t,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(s>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,s-=a.size}else break;else if(i<s){let a=e[t++];a&&(i+=a.size)}else{let a=e[--r];a&&(s+=a.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,r++),new Vz(qr.of(e.slice(0,t)),o,qr.of(e.slice(r)))}}function Mm(n,e){return n==e?n:(n.constructor!=e.constructor&&(xc=!0),e)}qr.prototype.size=1;class EO extends qr{constructor(e,t,r){super(e,t),this.deco=r}blockAt(e,t,r,i){return new no(i,this.length,r,this.height,this.deco||0)}lineAt(e,t,r,i,s){return this.blockAt(0,r,i,s)}forEachLine(e,t,r,i,s,o){e<=s+this.length&&t>=s&&o(this.blockAt(0,r,i,s))}updateHeight(e,t=0,r=!1,i){return i&&i.from<=t&&i.more&&this.setHeight(i.heights[i.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Si extends EO{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,r,i){return new no(i,this.length,r,this.height,this.breaks)}replace(e,t,r){let i=r[0];return r.length==1&&(i instanceof Si||i instanceof Jn&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Jn?i=new Si(i.length,this.height):i.height=this.height,this.outdated||(i.outdated=!1),i):qr.of(r)}updateHeight(e,t=0,r=!1,i){return i&&i.from<=t&&i.more?this.setHeight(i.heights[i.index++]):(r||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Jn extends qr{constructor(e){super(e,0)}heightMetrics(e,t){let r=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,s=i-r+1,o,a=0;if(e.lineWrapping){let u=Math.min(this.height,e.lineHeight*s);o=u/s,this.length>s+1&&(a=(this.height-u)/(this.length-s-1))}else o=this.height/s;return{firstLine:r,lastLine:i,perLine:o,perChar:a}}blockAt(e,t,r,i){let{firstLine:s,lastLine:o,perLine:a,perChar:u}=this.heightMetrics(t,i);if(t.lineWrapping){let l=i+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),c=t.doc.lineAt(l),f=a+c.length*u,d=Math.max(r,e-f/2);return new no(c.from,c.length,d,f,0)}else{let l=Math.max(0,Math.min(o-s,Math.floor((e-r)/a))),{from:c,length:f}=t.doc.line(s+l);return new no(c,f,r+a*l,a,0)}}lineAt(e,t,r,i,s){if(t==en.ByHeight)return this.blockAt(e,r,i,s);if(t==en.ByPosNoHeight){let{from:g,to:m}=r.doc.lineAt(e);return new no(g,m-g,0,0,0)}let{firstLine:o,perLine:a,perChar:u}=this.heightMetrics(r,s),l=r.doc.lineAt(e),c=a+l.length*u,f=l.number-o,d=i+a*f+u*(l.from-s-f);return new no(l.from,l.length,Math.max(i,Math.min(d,i+this.height-c)),c,0)}forEachLine(e,t,r,i,s,o){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:a,perLine:u,perChar:l}=this.heightMetrics(r,s);for(let c=e,f=i;c<=t;){let d=r.doc.lineAt(c);if(c==e){let m=d.number-a;f+=u*m+l*(e-s-m)}let g=u+l*d.length;o(new no(d.from,d.length,f,g,0)),f+=g,c=d.to+1}}replace(e,t,r){let i=this.length-t;if(i>0){let s=r[r.length-1];s instanceof Jn?r[r.length-1]=new Jn(s.length+i):r.push(null,new Jn(i-1))}if(e>0){let s=r[0];s instanceof Jn?r[0]=new Jn(e+s.length):r.unshift(new Jn(e-1),null)}return qr.of(r)}decomposeLeft(e,t){t.push(new Jn(e-1),null)}decomposeRight(e,t){t.push(null,new Jn(this.length-e-1))}updateHeight(e,t=0,r=!1,i){let s=t+this.length;if(i&&i.from<=t+this.length&&i.more){let o=[],a=Math.max(t,i.from),u=-1;for(i.from>t&&o.push(new Jn(i.from-t-1).updateHeight(e,t));a<=s&&i.more;){let c=e.doc.lineAt(a).length;o.length&&o.push(null);let f=i.heights[i.index++];u==-1?u=f:Math.abs(f-u)>=om&&(u=-2);let d=new Si(c,f);d.outdated=!1,o.push(d),a+=c+1}a<=s&&o.push(null,new Jn(s-a).updateHeight(e,a));let l=qr.of(o);return(u<0||Math.abs(l.height-this.height)>=om||Math.abs(u-this.heightMetrics(e,t).perLine)>=om)&&(xc=!0),Mm(this,l)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Vz extends qr{constructor(e,t,r){super(e.length+t+r.length,e.height+r.height,t|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,t,r,i){let s=r+this.left.height;return e<s?this.left.blockAt(e,t,r,i):this.right.blockAt(e,t,s,i+this.left.length+this.break)}lineAt(e,t,r,i,s){let o=i+this.left.height,a=s+this.left.length+this.break,u=t==en.ByHeight?e<o:e<a,l=u?this.left.lineAt(e,t,r,i,s):this.right.lineAt(e,t,r,o,a);if(this.break||(u?l.to<a:l.from>a))return l;let c=t==en.ByPosNoHeight?en.ByPosNoHeight:en.ByPos;return u?l.join(this.right.lineAt(a,c,r,o,a)):this.left.lineAt(a,c,r,i,s).join(l)}forEachLine(e,t,r,i,s,o){let a=i+this.left.height,u=s+this.left.length+this.break;if(this.break)e<u&&this.left.forEachLine(e,t,r,i,s,o),t>=u&&this.right.forEachLine(e,t,r,a,u,o);else{let l=this.lineAt(u,en.ByPos,r,i,s);e<l.from&&this.left.forEachLine(e,l.from-1,r,i,s,o),l.to>=e&&l.from<=t&&o(l),t>l.to&&this.right.forEachLine(l.to+1,t,r,a,u,o)}}replace(e,t,r){let i=this.left.length+this.break;if(t<i)return this.balanced(this.left.replace(e,t,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of r)s.push(a);if(e>0&&IE(s,o-1),t<this.length){let a=s.length;this.decomposeRight(t,s),IE(s,a)}return qr.of(s)}decomposeLeft(e,t){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(r++,e>=r&&t.push(null)),e>r&&this.right.decomposeLeft(e-r,t)}decomposeRight(e,t){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e<r&&this.left.decomposeRight(e,t),this.break&&e<i&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?qr.of(this.break?[e,null,t]:[e,t]):(this.left=Mm(this.left,e),this.right=Mm(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,r=!1,i){let{left:s,right:o}=this,a=t+s.length+this.break,u=null;return i&&i.from<=t+s.length&&i.more?u=s=s.updateHeight(e,t,r,i):s.updateHeight(e,t,r),i&&i.from<=a+o.length&&i.more?u=o=o.updateHeight(e,a,r,i):o.updateHeight(e,a,r),u?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function IE(n,e){let t,r;n[e]==null&&(t=n[e-1])instanceof Jn&&(r=n[e+1])instanceof Jn&&n.splice(e-1,3,new Jn(t.length+1+r.length))}const Gz=5;class hk{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let r=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Si?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Si(r-this.pos,-1)),this.writtenTo=r,t>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,r){if(e<t||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,s=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=t-e;r.block?this.addBlock(new EO(o,i,r)):(o||s||i>=Gz)&&this.addLineDeco(i,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Si(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let r=new Jn(t-e);return this.oracle.doc.lineAt(e).to==t&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Si)return e;let t=new Si(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+r}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Si)&&!this.isCovered?this.nodes.push(new Si(0,-1)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof Si&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,t,r,i){let s=new hk(r,e);return yt.spans(t,r,i,s,0),s.finish(r)}}function Kz(n,e,t){let r=new Jz;return yt.compare(n,e,t,r,0),r.changes}class Jz{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,r,i){(e<t||r&&r.heightRelevant||i&&i.heightRelevant)&&im(e,t,this.changes,5)}}function Yz(n,e){let t=n.getBoundingClientRect(),r=n.ownerDocument,i=r.defaultView||window,s=Math.max(0,t.left),o=Math.min(i.innerWidth,t.right),a=Math.max(0,t.top),u=Math.min(i.innerHeight,t.bottom);for(let l=n.parentNode;l&&l!=r.body;)if(l.nodeType==1){let c=l,f=window.getComputedStyle(c);if((c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let d=c.getBoundingClientRect();s=Math.max(s,d.left),o=Math.min(o,d.right),a=Math.max(a,d.top),u=Math.min(l==n.parentNode?i.innerHeight:u,d.bottom)}l=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(l.nodeType==11)l=l.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:a-(t.top+e),bottom:Math.max(a,u)-(t.top+e)}}function Xz(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function Zz(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class eb{constructor(e,t,r,i){this.from=e,this.to=t,this.size=r,this.displaySize=i}static same(e,t){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],s=t[r];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(e,t){return Be.replace({widget:new Qz(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class Qz extends ha{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class LE{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=FE,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=tn.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(uk).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new Uz(t),this.stateDeco=e.facet(gd).filter(r=>typeof r!="function"),this.heightMap=qr.empty().applyChanges(this.stateDeco,gt.empty,this.heightOracle.setDoc(e.doc),[new Zi(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Be.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let r=0;r<=1;r++){let i=r?t.head:t.anchor;if(!e.some(({from:s,to:o})=>i>=s&&i<=o)){let{from:s,to:o}=this.lineBlockAt(i);e.push(new T0(s,o))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?FE:new dk(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Wh(e,this.scaler))})}update(e,t=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=this.state.facet(gd).filter(c=>typeof c!="function");let i=e.changedRanges,s=Zi.extendWithRanges(i,Kz(r,this.stateDeco,e?e.changes:Tn.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);PE(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||xc)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let u=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<u.from||t.range.head>u.to)||!this.viewportIsAppropriate(u))&&(u=this.getViewport(0,t));let l=u.from!=this.viewport.from||u.to!=this.viewport.to;this.viewport=u,e.flags|=this.updateForViewport(),(l||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(uO)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,r=window.getComputedStyle(t),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?tn.RTL:tn.LTR;let o=this.heightOracle.mustRefreshForWrapping(s),a=t.getBoundingClientRect(),u=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let l=0,c=0;if(a.width&&a.height){let{scaleX:x,scaleY:C}=LM(t,a);(x>.005&&Math.abs(this.scaleX-x)>.005||C>.005&&Math.abs(this.scaleY-C)>.005)&&(this.scaleX=x,this.scaleY=C,l|=16,o=u=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=d)&&(this.paddingTop=f,this.paddingBottom=d,l|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(u=!0),this.editorWidth=e.scrollDOM.clientWidth,l|=16);let g=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=g&&(this.scrollAnchorHeight=-1,this.scrollTop=g),this.scrolledToBottom=BM(e.scrollDOM);let m=(this.printing?Zz:Yz)(t,this.paddingTop),y=m.top-this.pixelViewport.top,b=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView&&(this.inView=w,w&&(u=!0)),!this.inView&&!this.scrollTarget&&!Xz(e.dom))return 0;let S=a.width;if((this.contentDOMWidth!=S||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,l|=16),u){let x=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(x)&&(o=!0),o||i.lineWrapping&&Math.abs(S-this.contentDOMWidth)>i.charWidth){let{lineHeight:C,charWidth:R,textHeight:P}=e.docView.measureTextSize();o=C>0&&i.refresh(s,C,R,P,S/R,x),o&&(e.docView.minWidth=0,l|=16)}y>0&&b>0?c=Math.max(y,b):y<0&&b<0&&(c=Math.min(y,b)),PE();for(let C of this.viewports){let R=C.from==this.viewport.from?x:e.docView.measureVisibleLineHeights(C);this.heightMap=(o?qr.empty().applyChanges(this.stateDeco,gt.empty,this.heightOracle,[new Zi(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new Hz(C.from,R))}xc&&(l|=2)}let k=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return k&&(l&2&&(l|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),l|=this.updateForViewport()),(l&2||k)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),l|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),l}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,u=new T0(i.lineAt(o-r*1e3,en.ByHeight,s,0,0).from,i.lineAt(a+(1-r)*1e3,en.ByHeight,s,0,0).to);if(t){let{head:l}=t.range;if(l<u.from||l>u.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(l,en.ByPos,s,0,0),d;t.y=="center"?d=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&l<u.from?d=f.top:d=f.bottom-c,u=new T0(i.lineAt(d-1e3/2,en.ByHeight,s,0,0).from,i.lineAt(d+c+1e3/2,en.ByHeight,s,0,0).to)}}return u}mapViewport(e,t){let r=t.mapPos(e.from,-1),i=t.mapPos(e.to,1);return new T0(this.heightMap.lineAt(r,en.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,en.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,en.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(t,en.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:a}=this;return(e==0||i<=o-Math.max(10,Math.min(-r,250)))&&(t==this.state.doc.length||s>=a+Math.max(10,Math.min(r,250)))&&i>o-2*1e3&&s<a+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let r=[];for(let i of e)t.touchesRange(i.from,i.to)||r.push(new eb(t.mapPos(i.from),t.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,t){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,s=i>>1,o=i<<1;if(this.defaultTextDirection!=tn.LTR&&!r)return[];let a=[],u=(c,f,d,g)=>{if(f-c<s)return;let m=this.state.selection.main,y=[m.from];m.empty||y.push(m.to);for(let w of y)if(w>c&&w<f){u(c,w-10,d,g),u(w+10,f,d,g);return}let b=tU(e,w=>w.from>=d.from&&w.to<=d.to&&Math.abs(w.from-c)<s&&Math.abs(w.to-f)<s&&!y.some(S=>w.from<S&&w.to>S));if(!b){if(f<d.to&&t&&r&&t.visibleRanges.some(k=>k.from<=f&&k.to>=f)){let k=t.moveToLineBoundary(me.cursor(f),!1,!0).head;k>c&&(f=k)}let w=this.gapSize(d,c,f,g),S=r||w<2e6?w:2e6;b=new eb(c,f,w,S)}a.push(b)},l=c=>{if(c.length<o||c.type!=Br.Text)return;let f=eU(c.from,c.to,this.stateDeco);if(f.total<o)return;let d=this.scrollTarget?this.scrollTarget.range.head:null,g,m;if(r){let y=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,b,w;if(d!=null){let S=O0(f,d),k=((this.visibleBottom-this.visibleTop)/2+y)/c.height;b=S-k,w=S+k}else b=(this.visibleTop-c.top-y)/c.height,w=(this.visibleBottom-c.top+y)/c.height;g=M0(f,b),m=M0(f,w)}else{let y=f.total*this.heightOracle.charWidth,b=i*this.heightOracle.charWidth,w=0;if(y>2e6)for(let R of e)R.from>=c.from&&R.from<c.to&&R.size!=R.displaySize&&R.from*this.heightOracle.charWidth+w<this.pixelViewport.left&&(w=R.size-R.displaySize);let S=this.pixelViewport.left+w,k=this.pixelViewport.right+w,x,C;if(d!=null){let R=O0(f,d),P=((k-S)/2+b)/y;x=R-P,C=R+P}else x=(S-b)/y,C=(k+b)/y;g=M0(f,x),m=M0(f,C)}g>c.from&&u(c.from,g,c,f),m<c.to&&u(m,c.to,c,f)};for(let c of this.viewportLines)Array.isArray(c.type)?c.type.forEach(l):l(c);return a}gapSize(e,t,r,i){let s=O0(i,r)-O0(i,t);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){eb.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Be.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let r=[];yt.spans(t,this.viewport.from,this.viewport.to,{span(s,o){r.push({from:s,to:o})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s<r.length&&!(i&8);s++){let o=this.visibleRanges[s],a=r[s];(o.from!=a.from||o.to!=a.to)&&(i|=4,e&&e.mapPos(o.from,-1)==a.from&&e.mapPos(o.to,1)==a.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Wh(this.heightMap.lineAt(e,en.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Wh(this.heightMap.lineAt(this.scaler.fromDOM(e),en.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Wh(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class T0{constructor(e,t){this.from=e,this.to=t}}function eU(n,e,t){let r=[],i=n,s=0;return yt.spans(t,n,e,{span(){},point(o,a){o>i&&(r.push({from:i,to:o}),s+=o-i),i=a}},20),i<e&&(r.push({from:i,to:e}),s+=e-i),{total:s,ranges:r}}function M0({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let r=Math.floor(n*t);for(let i=0;;i++){let{from:s,to:o}=e[i],a=o-s;if(r<=a)return s+r;r-=a}}function O0(n,e){let t=0;for(let{from:r,to:i}of n.ranges){if(e<=i){t+=e-r;break}t+=i-r}return t/n.total}function tU(n,e){for(let t of n)if(e(t))return t}const FE={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};class dk{constructor(e,t,r){let i=0,s=0,o=0;this.viewports=r.map(({from:a,to:u})=>{let l=t.lineAt(a,en.ByPos,e,0,0).top,c=t.lineAt(u,en.ByPos,e,0,0).bottom;return i+=c-l,{from:a,to:u,top:l,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i);for(let a of this.viewports)a.domTop=o+(a.top-s)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),s=a.bottom}toDOM(e){for(let t=0,r=0,i=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.top)return i+(e-r)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);r=s.bottom,i=s.domBottom}}fromDOM(e){for(let t=0,r=0,i=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.domTop)return r+(e-i)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);r=s.bottom,i=s.domBottom}}eq(e){return e instanceof dk?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,r)=>t.from==e.viewports[r].from&&t.to==e.viewports[r].to):!1}}function Wh(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),r=e.toDOM(n.bottom);return new no(n.from,n.length,t,r-t,Array.isArray(n._content)?n._content.map(i=>Wh(i,e)):n._content)}const P0=Ae.define({combine:n=>n.join(" ")}),zw=Ae.define({combine:n=>n.indexOf(!0)>-1}),Uw=po.newName(),RO=po.newName(),AO=po.newName(),DO={"&light":"."+RO,"&dark":"."+AO};function Hw(n,e,t){return new po(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return n;if(!t||!t[i])throw new RangeError(`Unsupported selector: ${i}`);return t[i]}):n+" "+r}})}const nU=Hw("."+Uw,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},DO),rU={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},tb=Te.ie&&Te.ie_version<=11;class iU{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new qW,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let r of t)this.queue.push(r);(Te.ie&&Te.ie_version<=11||Te.ios&&e.composing)&&t.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(Te.chrome&&Te.chrome_version<126)&&(this.editContext=new oU(e),e.state.facet(Ko)&&(e.contentDOM.editContext=this.editContext.editContext)),tb&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,r)=>t!=e[r]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(Ko)?r.root.activeElement!=this.dom:!rm(this.dom,i))return;let s=i.anchorNode&&r.docView.nearest(i.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Te.ie&&Te.ie_version<=11||Te.android&&Te.chrome)&&!r.state.selection.main.empty&&i.focusNode&&Xh(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=dd(e.root);if(!t)return!1;let r=Te.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&sU(this.view,t)||t;if(!r||this.selectionRange.eq(r))return!1;let i=rm(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&$W(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let r=this.dom;r;)if(r.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=t)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,rU),tb&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),tb&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var r;if(!this.delayedAndroidKey){let i=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&hc(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,r=-1,i=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(i=!0),t==-1?{from:t,to:r}=o:(t=Math.min(o.from,t),r=Math.max(o.to,r)))}return{from:t,to:r,typeOver:i}}readChange(){let{from:e,to:t,typeOver:r}=this.processRecords(),i=this.selectionChanged&&rm(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new kz(this.view,e,t,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let r=this.view.state,i=vO(this.view,t);return this.view.state==r&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),i}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let r=NE(t,e.previousSibling||e.target.previousSibling,-1),i=NE(t,e.nextSibling||e.target.nextSibling,1);return{from:r?t.posAfter(r):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(Ko)!=e.state.facet(Ko)&&(e.view.contentDOM.editContext=e.state.facet(Ko)?this.editContext.editContext:null))}destroy(){var e,t,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function NE(n,e,t){for(;e;){let r=jt.get(e);if(r&&r.parent==n)return r;let i=e.parentNode;e=i!=n.dom?i:t>0?e.nextSibling:e.previousSibling}return null}function BE(n,e){let t=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor);return Xh(o.node,o.offset,i,s)&&([t,r,i,s]=[i,s,t,r]),{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:s}}function sU(n,e){if(e.getComposedRanges){let i=e.getComposedRanges(n.root)[0];if(i)return BE(n,i)}let t=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",r,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",r,!0),t?BE(n,t):null}class oU{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:s,head:o}=i,a=this.toEditorPos(r.updateRangeStart),u=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let l={from:a,to:u,insert:gt.of(r.text.split(`
|
|
36
|
-
`))};if(l.from==this.from&&s<this.from?l.from=s:l.to==this.to&&s>this.to&&(l.to=s),l.from==l.to&&!l.insert.length){let c=me.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));c.main.eq(i)||e.dispatch({selection:c,userEvent:"select"});return}if((Te.mac||Te.android)&&l.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(l={from:a,to:u,insert:gt.of([r.text.replace("."," ")])}),this.pendingContextChange=l,!e.state.readOnly){let c=this.to-this.from+(l.to-l.from+l.insert.length);fk(e,l,me.single(this.toEditorPos(r.selectionStart,c),this.toEditorPos(r.selectionEnd,c)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o<a;o++){let u=e.coordsForChar(o);s=u&&new DOMRect(u.left,u.top,u.right-u.left,u.bottom-u.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(o!="None"&&a!="None"){let u=this.toEditorPos(s.rangeStart),l=this.toEditorPos(s.rangeEnd);if(u<l){let c=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${a=="Thin"?1:2}px`;i.push(Be.mark({attributes:{style:c}}).range(u,l))}}}e.dispatch({effects:cO.of(Be.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=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=dd(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,u,l)=>{if(r)return;let c=l.length-(o-s);if(i&&o>=i.to)if(i.from==s&&i.to==o&&i.insert.eq(l)){i=this.pendingContextChange=null,t+=c,this.to+=c;return}else i=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=c,this.to+=c;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+l.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),l.toString()),this.to+=c}t+=c}),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 Re{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.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||jW(e.parent)||document,this.viewState=new LE(e.state||dt.create(e)),e.scrollTo&&e.scrollTo.is(R0)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(qh).map(i=>new Xy(i));for(let i of this.plugins)i.update(this);this.observer=new iU(this),this.inputState=new Rz(this),this.inputState.ensureHandlers(this.plugins),this.docView=new mE(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof En?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,u=null;e.some(d=>d.annotation(xO))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,u=SO(s,o),u||(a=1));let l=this.observer.delayedAndroidKey,c=null;if(l?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(c=null)):this.observer.clear(),s.facet(dt.phrases)!=this.state.facet(dt.phrases))return this.setState(s);i=Tm.create(this,s,e),i.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(f&&(f=f.map(d.changes)),d.scrollIntoView){let{main:g}=d.state.selection;f=new dc(g.empty?g:me.cursor(g.head,g.head>g.anchor?-1:1))}for(let g of d.effects)g.is(R0)&&(f=g.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=Om.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(jh)!=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(P0)!=i.state.facet(P0)&&(this.viewState.mustMeasureContent=!0),(t||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(qw))try{d(i)}catch(g){oi(this.state,g,"update listener")}(u||c)&&Promise.resolve().then(()=>{u&&this.state==u.startState&&this.dispatch(u),c&&!vO(this,c)&&l.force&&hc(this.contentDOM,l.key,l.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 LE(e),this.plugins=e.facet(qh).map(r=>new Xy(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new mE(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(qh),r=e.state.facet(qh);if(t!=r){let i=[];for(let s of r){let o=t.indexOf(s);if(o<0)i.push(new Xy(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){oi(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.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(BM(r))s=-1,o=this.viewState.heightMap.height;else{let g=this.viewState.scrollAnchorAt(i);s=g.from,o=g.top}this.updateState=1;let u=this.viewState.measure(this);if(!u&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let l=[];u&4||([this.measureRequests,l]=[l,this.measureRequests]);let c=l.map(g=>{try{return g.read(this)}catch(m){return oi(this.state,m),qE}}),f=Tm.create(this,this.state,[]),d=!1;f.flags|=u,t?t.flags|=u:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),d=this.docView.update(f),d&&this.docViewUpdate());for(let g=0;g<l.length;g++)if(c[g]!=qE)try{let m=l[g];m.write&&m.write(c[g],this)}catch(m){oi(this.state,m)}if(d&&this.docView.updateSelection(!0),!f.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 m=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o;if(m>1||m<-1){i=i+m,r.scrollTop=i/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(qw))a(t)}get themeClasses(){return Uw+" "+(this.state.facet(zw)?AO:RO)+" "+this.state.facet(P0)}updateAttrs(){let e=jE(this,fO,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ko)?"true":"false",class:"cm-content",style:`${Te.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),jE(this,uk,t);let r=this.observer.ignore(()=>{let i=Iw(this.contentDOM,this.contentAttrs,t),s=Iw(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(Re.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(jh);let e=this.state.facet(Re.cspNonce);po.mount(this.root,this.styleModules.concat(nU).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.spec!=e)&&this.pluginMap.set(e,t=this.plugins.find(r=>r.spec==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 Qy(this,e,_E(this,e,t,r))}moveByGroup(e,t){return Qy(this,e,_E(this,e,t,r=>yz(this,e.head,r)))}visualLineSide(e,t){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=r[t?r.length-1:0];return me.cursor(s.side(t,i)+e.from,s.forward(!t,i)?1:-1)}moveToLineBoundary(e,t,r=!0){return vz(this,e,t,r)}moveVertically(e,t,r){return Qy(this,e,bz(this,e,t,r))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),mO(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let r=this.docView.coordsAt(e,t);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),o=s[Wa.find(s,e-i.from,-1,t)];return L1(r,o.dir==tn.LTR==t>0)}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(aO)||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>aU)return QM(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||ZM(s.isolates,r=gE(this,e))))return s.order;r||(r=gE(this,e));let i=tz(e.text,t,r);return this.bidiCache.push(new Om(e.from,e.to,t,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Te.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{FM(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.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return R0.of(new dc(typeof e=="number"?me.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return R0.of(new dc(me.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 gn.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return gn.define(()=>({}),{eventObservers:e})}static theme(e,t){let r=po.newName(),i=[P0.of(r),jh.of(Hw(`.${r}`,e))];return t&&t.dark&&i.push(zw.of(!0)),i}static baseTheme(e){return ou.lowest(jh.of(Hw("."+Uw,e,DO)))}static findFromDOM(e){var t;let r=e.querySelector(".cm-content"),i=r&&jt.get(r)||jt.get(e);return((t=i?.rootView)===null||t===void 0?void 0:t.view)||null}}Re.styleModule=jh;Re.inputHandler=sO;Re.clipboardInputFilter=ok;Re.clipboardOutputFilter=ak;Re.scrollHandler=lO;Re.focusChangeEffect=oO;Re.perLineTextDirection=aO;Re.exceptionSink=iO;Re.updateListener=qw;Re.editable=Ko;Re.mouseSelectionStyle=rO;Re.dragMovesSelection=nO;Re.clickAddsSelectionRange=tO;Re.decorations=gd;Re.outerDecorations=hO;Re.atomicRanges=lk;Re.bidiIsolatedRanges=dO;Re.scrollMargins=pO;Re.darkTheme=zw;Re.cspNonce=Ae.define({combine:n=>n.length?n[0]:""});Re.contentAttributes=uk;Re.editorAttributes=fO;Re.lineWrapping=Re.contentAttributes.of({class:"cm-lineWrapping"});Re.announce=He.define();const aU=4096,qE={};class Om{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:tn.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 Om(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}}function jE(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&&Pw(o,t)}return t}const uU=Te.mac?"mac":Te.windows?"win":Te.linux?"linux":"key";function lU(n,e){const t=n.split(/-(?!$)/);let r=t[t.length-1];r=="Space"&&(r=" ");let i,s,o,a;for(let u=0;u<t.length-1;++u){const l=t[u];if(/^(cmd|meta|m)$/i.test(l))a=!0;else if(/^a(lt)?$/i.test(l))i=!0;else if(/^(c|ctrl|control)$/i.test(l))s=!0;else if(/^s(hift)?$/i.test(l))o=!0;else if(/^mod$/i.test(l))e=="mac"?a=!0:s=!0;else throw new Error("Unrecognized modifier name: "+l)}return i&&(r="Alt-"+r),s&&(r="Ctrl-"+r),a&&(r="Meta-"+r),o&&(r="Shift-"+r),r}function I0(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 cU=ou.default(Re.domEventHandlers({keydown(n,e){return MO(TO(e.state),n,e,"editor")}})),Wc=Ae.define({enables:cU}),$E=new WeakMap;function TO(n){let e=n.facet(Wc),t=$E.get(e);return t||$E.set(e,t=dU(e.reduce((r,i)=>r.concat(i),[]))),t}function fU(n,e,t){return MO(TO(n.state),e,n,t)}let La=null;const hU=4e3;function dU(n,e=uU){let t=Object.create(null),r=Object.create(null),i=(o,a)=>{let u=r[o];if(u==null)r[o]=a;else if(u!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,u,l,c)=>{var f,d;let g=t[o]||(t[o]=Object.create(null)),m=a.split(/ (?!$)/).map(w=>lU(w,e));for(let w=1;w<m.length;w++){let S=m.slice(0,w).join(" ");i(S,!0),g[S]||(g[S]={preventDefault:!0,stopPropagation:!1,run:[k=>{let x=La={view:k,prefix:S,scope:o};return setTimeout(()=>{La==x&&(La=null)},hU),!0}]})}let y=m.join(" ");i(y,!1);let b=g[y]||(g[y]={preventDefault:!1,stopPropagation:!1,run:((d=(f=g._any)===null||f===void 0?void 0:f.run)===null||d===void 0?void 0:d.slice())||[]});u&&b.run.push(u),l&&(b.preventDefault=!0),c&&(b.stopPropagation=!0)};for(let o of n){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let l of a){let c=t[l]||(t[l]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let d in c)c[d].run.push(g=>f(g,Vw))}let u=o[e]||o.key;if(u)for(let l of a)s(l,u,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(l,"Shift-"+u,o.shift,o.preventDefault,o.stopPropagation)}return t}let Vw=null;function MO(n,e,t,r){Vw=e;let i=LW(e),s=ri(i,0),o=to(s)==i.length&&i!=" ",a="",u=!1,l=!1,c=!1;La&&La.view==t&&La.scope==r&&(a=La.prefix+" ",bO.indexOf(e.keyCode)<0&&(l=!0,La=null));let f=new Set,d=b=>{if(b){for(let w of b.run)if(!f.has(w)&&(f.add(w),w(t)))return b.stopPropagation&&(c=!0),!0;b.preventDefault&&(b.stopPropagation&&(c=!0),l=!0)}return!1},g=n[r],m,y;return g&&(d(g[a+I0(i,e,!o)])?u=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Te.windows&&e.ctrlKey&&e.altKey)&&(m=Qa[e.keyCode])&&m!=i?(d(g[a+I0(m,e,!0)])||e.shiftKey&&(y=hd[e.keyCode])!=i&&y!=m&&d(g[a+I0(y,e,!1)]))&&(u=!0):o&&e.shiftKey&&d(g[a+I0(i,e,!0)])&&(u=!0),!u&&d(g._any)&&(u=!0)),l&&(u=!0),u&&c&&e.stopPropagation(),Vw=null,u}class Xd{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=OO(e);return[new Xd(t,i.left-s.left,i.top-s.top,null,i.bottom-i.top)]}else return pU(e,t,r)}}function OO(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==tn.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function WE(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}),u=n.posAtCoords({x:s.right-1,y:o});return a==null||u==null?r:{from:Math.max(r.from,Math.min(a,u)),to:Math.min(r.to,Math.max(a,u))}}function pU(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==tn.LTR,o=n.contentDOM,a=o.getBoundingClientRect(),u=OO(n),l=o.querySelector(".cm-line"),c=l&&window.getComputedStyle(l),f=a.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),d=a.right-(c?parseInt(c.paddingRight):0),g=$w(n,r,1),m=$w(n,i,-1),y=g.type==Br.Text?g:null,b=m.type==Br.Text?m:null;if(y&&(n.lineWrapping||g.widgetLineBreaks)&&(y=WE(n,r,1,y)),b&&(n.lineWrapping||m.widgetLineBreaks)&&(b=WE(n,i,-1,b)),y&&b&&y.from==b.from&&y.to==b.to)return S(k(t.from,t.to,y));{let C=y?k(t.from,null,y):x(g,!1),R=b?k(null,t.to,b):x(m,!0),P=[];return(y||g).to<(b||m).from-(y&&b?1:0)||g.widgetLineBreaks>1&&C.bottom+n.defaultLineHeight/2<R.top?P.push(w(f,C.bottom,d,R.top)):C.bottom<R.top&&n.elementAtHeight((C.bottom+R.top)/2).type==Br.Text&&(C.bottom=R.top=(C.bottom+R.top)/2),S(C).concat(P).concat(S(R))}function w(C,R,P,q){return new Xd(e,C-u.left,R-u.top,P-C,q-R)}function S({top:C,bottom:R,horizontal:P}){let q=[];for(let B=0;B<P.length;B+=2)q.push(w(P[B],C,P[B+1],R));return q}function k(C,R,P){let q=1e9,B=-1e9,G=[];function V(Y,N,ee,oe,be){let ve=n.coordsAtPos(Y,Y==P.to?-2:2),De=n.coordsAtPos(ee,ee==P.from?2:-2);!ve||!De||(q=Math.min(ve.top,De.top,q),B=Math.max(ve.bottom,De.bottom,B),be==tn.LTR?G.push(s&&N?f:ve.left,s&&oe?d:De.right):G.push(!s&&oe?f:De.left,!s&&N?d:ve.right))}let F=C??P.from,A=R??P.to;for(let Y of n.visibleRanges)if(Y.to>F&&Y.from<A)for(let N=Math.max(Y.from,F),ee=Math.min(Y.to,A);;){let oe=n.state.doc.lineAt(N);for(let be of n.bidiSpans(oe)){let ve=be.from+oe.from,De=be.to+oe.from;if(ve>=ee)break;De>N&&V(Math.max(ve,N),C==null&&ve<=F,Math.min(De,ee),R==null&&De>=A,be.dir)}if(N=oe.to+1,N>=ee)break}return G.length==0&&V(F,C==null,A,R==null,n.textDirection),{top:q,bottom:B,horizontal:G}}function x(C,R){let P=a.top+(R?C.top:C.bottom);return{top:P,bottom:P,horizontal:[]}}}function gU(n,e){return n.constructor==e.constructor&&n.eq(e)}class mU{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(am)!=e.state.facet(am)&&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(am);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)=>!gU(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}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const am=Ae.define();function PO(n){return[gn.define(e=>new mU(e,n)),am.of(n)]}const md=Ae.define({combine(n){return yo(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function vU(n={}){return[md.of(n),yU,bU,wU,uO.of(!0)]}function IO(n){return n.startState.facet(md)!=n.state.facet(md)}const yU=PO({above:!0,markers(n){let{state:e}=n,t=e.facet(md),r=[];for(let i of e.selection.ranges){let s=i==e.selection.main;if(i.empty||t.drawRangeCursor){let o=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",a=i.empty?i:me.cursor(i.head,i.head>i.anchor?-1:1);for(let u of Xd.forRange(n,o,a))r.push(u)}}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=IO(n);return t&&zE(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){zE(e.state,n)},class:"cm-cursorLayer"});function zE(n,e){e.style.animationDuration=n.facet(md).cursorBlinkRate+"ms"}const bU=PO({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:Xd.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||IO(n)},class:"cm-selectionLayer"}),wU=ou.highest(Re.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),LO=He.define({map(n,e){return n==null?null:e.mapPos(n)}}),zh=Rn.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,r)=>r.is(LO)?r.value:t,n)}}),_U=gn.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(zh);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(zh)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(zh),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(zh)!=n&&this.view.dispatch({effects:LO.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 kU(){return[zh,_U]}function UE(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 xU(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 SU{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,u,l,c)=>i(c,l,l+a[0].length,a,u);else if(typeof r=="function")this.addMatch=(a,u,l,c)=>{let f=r(a,u,l);f&&c(l,l+a[0].length,f)};else if(r)this.addMatch=(a,u,l,c)=>c(l,l+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 ia,r=t.add.bind(t);for(let{from:i,to:s}of xU(e,this.maxLength))UE(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,u)=>{u>=e.view.viewport.from&&a<=e.view.viewport.to&&(r=Math.min(a,r),i=Math.max(u,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 u=e.state.doc.lineAt(o),l=u.to<a?e.state.doc.lineAt(a):u,c=Math.max(s.from,u.from),f=Math.min(s.to,l.to);if(this.boundary){for(;o>u.from;o--)if(this.boundary.test(u.text[o-1-u.from])){c=o;break}for(;a<l.to;a++)if(this.boundary.test(l.text[a-l.from])){f=a;break}}let d=[],g,m=(y,b,w)=>d.push(w.range(y,b));if(u==l)for(this.regexp.lastIndex=c-u.from;(g=this.regexp.exec(u.text))&&g.index<f-u.from;)this.addMatch(g,e,g.index+u.from,m);else UE(e.state.doc,this.regexp,c,f,(y,b)=>this.addMatch(b,e,y,m));t=t.update({filterFrom:c,filterTo:f,filter:(y,b)=>y<c||b>f,add:d})}}return t}}const Gw=/x/.unicode!=null?"gu":"g",CU=new RegExp(`[\0-\b
|
|
37
|
-
--\u2028\u2029\uFEFF-]`,Gw),EU={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 nb=null;function RU(){var n;if(nb==null&&typeof document<"u"&&document.body){let e=document.body.style;nb=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return nb||!1}const um=Ae.define({combine(n){let e=yo(n,{render:null,specialChars:CU,addSpecialChars:null});return(e.replaceTabs=!RU())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Gw)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Gw)),e}});function AU(n={}){return[um.of(n),DU()]}let HE=null;function DU(){return HE||(HE=gn.fromClass(class{constructor(n){this.view=n,this.decorations=Be.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(um)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new SU({regexp:n.specialChars,decoration:(e,t,r)=>{let{doc:i}=t.state,s=ri(e[0],0);if(s==9){let o=i.lineAt(r),a=t.state.tabSize,u=$c(o.text,a,r-o.from);return Be.replace({widget:new PU((a-u%a)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Be.replace({widget:new OU(n,s)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(um);n.startState.facet(um)!=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 TU="•";function MU(n){return n>=32?TU:n==10?"":String.fromCharCode(9216+n)}class OU extends ha{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=MU(this.code),r=e.state.phrase("Control character")+" "+(EU[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 PU extends ha{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 IU(){return FU}const LU=Be.line({class:"cm-activeLine"}),FU=gn.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(LU.range(i.from)),e=i.from)}return Be.set(t)}},{decorations:n=>n.decorations}),Kw=2e3;function NU(n,e,t){let r=Math.min(e.line,t.line),i=Math.max(e.line,t.line),s=[];if(e.off>Kw||t.off>Kw||e.col<0||t.col<0){let o=Math.min(e.off,t.off),a=Math.max(e.off,t.off);for(let u=r;u<=i;u++){let l=n.doc.line(u);l.length<=a&&s.push(me.range(l.from+o,l.to+a))}}else{let o=Math.min(e.col,t.col),a=Math.max(e.col,t.col);for(let u=r;u<=i;u++){let l=n.doc.line(u),c=Ew(l.text,o,n.tabSize,!0);if(c<0)s.push(me.cursor(l.to));else{let f=Ew(l.text,a,n.tabSize);s.push(me.range(l.from+c,l.from+f))}}}return s}function BU(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function VE(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>Kw?-1:i==r.length?BU(n,e.clientX):$c(r.text,n.state.tabSize,t-r.from);return{line:r.number,col:s,off:i}}function qU(n,e){let t=VE(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=VE(n,i);if(!a)return r;let u=NU(n.state,t,a);return u.length?o?me.create(u.concat(r.ranges)):me.create(u):r}}:null}function jU(n){let e=t=>t.altKey&&t.button==0;return Re.mouseSelectionStyle.of((t,r)=>e(r)?qU(t,r):null)}const $U={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},WU={style:"cursor: crosshair"};function zU(n={}){let[e,t]=$U[n.key||"Alt"],r=gn.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,Re.contentAttributes.of(i=>{var s;return!((s=i.plugin(r))===null||s===void 0)&&s.isDown?WU:null})]}const Vf="-10000px";class FO{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(u=>u);if(i===this.input){for(let u of this.tooltipViews)u.update&&u.update(e);return!1}let o=[],a=t?[]:null;for(let u=0;u<s.length;u++){let l=s[u],c=-1;if(l){for(let f=0;f<this.tooltips.length;f++){let d=this.tooltips[f];d&&d.create==l.create&&(c=f)}if(c<0)o[u]=this.createTooltipView(l,u?o[u-1]:null),a&&(a[u]=!!l.above);else{let f=o[u]=this.tooltipViews[c];a&&(a[u]=t[c]),f.update&&f.update(e)}}}for(let u of this.tooltipViews)o.indexOf(u)<0&&(this.removeTooltipView(u),(r=u.destroy)===null||r===void 0||r.call(u));return t&&(a.forEach((u,l)=>t[l]=u),t.length=a.length),this.input=i,this.tooltips=s,this.tooltipViews=o,!0}}function UU(n={}){return lm.of(n)}function HU(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const lm=Ae.define({combine:n=>{var e,t,r;return{position:Te.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)||HU}}}),GE=new WeakMap,pk=gn.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(lm);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 FO(n,gk,(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(lm);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=Vf,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;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(Te.gecko)t=s.offsetParent!=this.container.ownerDocument.body;else if(s.style.top==Vf&&s.style.left=="0px"){let o=s.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(t||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(n=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=ck(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let a=this.manager.tooltipViews[o];return a.getCoords?a.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(lm).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}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 u=this.manager.tooltips[a],l=this.manager.tooltipViews[a],{dom:c}=l,f=n.pos[a],d=n.size[a];if(!f||u.clip!==!1&&(f.bottom<=Math.max(t.top,r.top)||f.top>=Math.min(t.bottom,r.bottom)||f.right<Math.max(t.left,r.left)-.1||f.left>Math.min(t.right,r.right)+.1)){c.style.top=Vf;continue}let g=u.arrow?l.dom.querySelector(".cm-tooltip-arrow"):null,m=g?7:0,y=d.right-d.left,b=(e=GE.get(l))!==null&&e!==void 0?e:d.bottom-d.top,w=l.offset||GU,S=this.view.textDirection==tn.LTR,k=d.width>r.right-r.left?S?r.left:r.right-d.width:S?Math.max(r.left,Math.min(f.left-(g?14:0)+w.x,r.right-y)):Math.min(Math.max(r.left,f.left-y+(g?14:0)-w.x),r.right-y),x=this.above[a];!u.strictSide&&(x?f.top-b-m-w.y<r.top:f.bottom+b+m+w.y>r.bottom)&&x==r.bottom-f.bottom>f.top-r.top&&(x=this.above[a]=!x);let C=(x?f.top-r.top:r.bottom-f.bottom)-m;if(C<b&&l.resize!==!1){if(C<this.view.defaultLineHeight){c.style.top=Vf;continue}GE.set(l,b),c.style.height=(b=C)/s+"px"}else c.style.height&&(c.style.height="");let R=x?f.top-b-m-w.y:f.bottom+m+w.y,P=k+y;if(l.overlap!==!0)for(let q of o)q.left<P&&q.right>k&&q.top<R+b&&q.bottom>R&&(R=x?q.top-b-2-m:q.bottom+m+2);if(this.position=="absolute"?(c.style.top=(R-n.parent.top)/s+"px",KE(c,(k-n.parent.left)/i)):(c.style.top=R/s+"px",KE(c,k/i)),g){let q=f.left+(S?w.x:-w.x)-(k+14-7);g.style.left=q/i+"px"}l.overlap!==!0&&o.push({left:k,top:R,right:P,bottom:R+b}),c.classList.toggle("cm-tooltip-above",x),c.classList.toggle("cm-tooltip-below",!x),l.positioned&&l.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=Vf}},{eventObservers:{scroll(){this.maybeMeasure()}}});function KE(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const VU=Re.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"}}}),GU={x:0,y:0},gk=Ae.define({enables:[pk,VU]}),Pm=Ae.define({combine:n=>n.reduce((e,t)=>e.concat(t),[])});class B1{static create(e){return new B1(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new FO(e,Pm,(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 KU=gk.compute([Pm],n=>{let e=n.facet(Pm);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:B1.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class JU{constructor(e,t,r,i,s){this.view=e,this.source=t,this.field=r,this.setHover=i,this.hoverTime=s,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(){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.nearest(t.target);if(!r)return;let i,s=1;if(r instanceof $a)i=r.posAtStart;else{if(i=e.posAtCoords(t),i==null)return;let a=e.coordsAtPos(i);if(!a||t.y<a.top||t.y>a.bottom||t.x<a.left-e.defaultCharacterWidth||t.x>a.right+e.defaultCharacterWidth)return;let u=e.bidiSpans(e.state.doc.lineAt(i)).find(c=>c.from<=i&&c.to>=i),l=u&&u.dir==tn.RTL?-1:1;s=t.x<a.left?-l:l}let o=this.source(e,i,s);if(o?.then){let a=this.pending={pos:i};o.then(u=>{this.pending==a&&(this.pending=null,u&&!(Array.isArray(u)&&!u.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(u)?u:[u])}))},u=>oi(e.state,u,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(pk),t=e?e.manager.tooltips.findIndex(r=>r.create==B1.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&&s&&!YU(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:!XU(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){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),this.active.length&&!this.view.dom.contains(r.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const L0=4;function YU(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-L0&&e.clientX<=r+L0&&e.clientY>=i-L0&&e.clientY<=s+L0}function XU(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 u=n.posAtCoords({x:r,y:i},!1);return u>=e&&u<=t}function NO(n,e={}){let t=He.define(),r=Rn.define({create(){return[]},update(i,s){if(i.length&&(e.hideOnChange&&(s.docChanged||s.selection)?i=[]:e.hideOn&&(i=i.filter(o=>!e.hideOn(s,o))),s.docChanged)){let o=[];for(let a of i){let u=s.changes.mapPos(a.pos,-1,tr.TrackDel);if(u!=null){let l=Object.assign(Object.create(null),a);l.pos=u,l.end!=null&&(l.end=s.changes.mapPos(l.end)),o.push(l)}}i=o}for(let o of s.effects)o.is(t)&&(i=o.value),o.is(ZU)&&(i=[]);return i},provide:i=>Pm.from(i)});return{active:r,extension:[r,gn.define(i=>new JU(i,n,r,t,e.hoverTime||300)),KU]}}function BO(n,e){let t=n.plugin(pk);if(!t)return null;let r=t.manager.tooltips.indexOf(e);return r<0?null:t.manager.tooltipViews[r]}const ZU=He.define(),JE=Ae.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 vd(n,e){let t=n.plugin(qO),r=t?t.specs.indexOf(e):-1;return r>-1?t.panels[r]:null}const qO=gn.fromClass(class{constructor(n){this.input=n.state.facet(Sc),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(JE);this.top=new F0(n,!0,e.topContainer),this.bottom=new F0(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(JE);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new F0(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new F0(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Sc);if(t!=this.input){let r=t.filter(u=>u),i=[],s=[],o=[],a=[];for(let u of r){let l=this.specs.indexOf(u),c;l<0?(c=u(n.view),a.push(c)):(c=this.panels[l],c.update&&c.update(n)),i.push(c),(c.top?s:o).push(c)}this.specs=r,this.panels=i,this.top.sync(s),this.bottom.sync(o);for(let u of a)u.dom.classList.add("cm-panel"),u.mount&&u.mount()}else for(let r of this.panels)r.update&&r.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>Re.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class F0{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",this.dom.style[this.top?"top":"bottom"]="0";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=YE(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=YE(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 YE(n){let e=n.nextSibling;return n.remove(),e}const Sc=Ae.define({enables:qO});class oa extends ol{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}oa.prototype.elementClass="";oa.prototype.toDOM=void 0;oa.prototype.mapMode=tr.TrackBefore;oa.prototype.startSide=oa.prototype.endSide=-1;oa.prototype.point=!0;const cm=Ae.define(),QU=Ae.define(),eH={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>yt.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Qh=Ae.define();function tH(n){return[jO(),Qh.of(Object.assign(Object.assign({},eH),n))]}const XE=Ae.define({combine:n=>n.some(e=>e)});function jO(n){return[nH]}const nH=gn.fromClass(class{constructor(n){this.view=n,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(Qh).map(e=>new QE(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(XE),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}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)}n.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(XE)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&this.dom.remove();let t=yt.iter(this.view.state.facet(cm),this.view.viewport.from),r=[],i=this.gutters.map(s=>new rH(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==Br.Text&&o){Jw(t,r,a.from);for(let u of i)u.line(this.view,a,r);o=!1}else if(a.widget)for(let u of i)u.widget(this.view,a)}else if(s.type==Br.Text){Jw(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)}updateGutters(n){let e=n.startState.facet(Qh),t=n.state.facet(Qh),r=n.docChanged||n.heightChanged||n.viewportChanged||!yt.eq(n.startState.facet(cm),n.state.facet(cm),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 QE(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)this.dom.appendChild(s.dom);this.gutters=i}return r}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>Re.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==tn.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function ZE(n){return Array.isArray(n)?n:[n]}function Jw(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class rH{constructor(e,t,r){this.gutter=e,this.height=r,this.i=0,this.cursor=yt.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 $O(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=[];Jw(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(QU)){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 QE{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 u=s.getBoundingClientRect();o=(u.top+u.bottom)/2}else o=i.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=ZE(t.markers(e)),t.initialSpacer&&(this.spacer=new $O(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=ZE(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!yt.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 $O{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":""),iH(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,u=s<t.length?t[s++]:null,l=!1;if(u){let c=u.elementClass;c&&(r+=" "+c);for(let f=o;f<this.markers.length;f++)if(this.markers[f].compare(u)){a=f,l=!0;break}}else a=this.markers.length;for(;o<a;){let c=this.markers[o++];if(c.toDOM){c.destroy(i);let f=i.nextSibling;i.remove(),i=f}}if(!u)break;u.toDOM&&(l?i=i.nextSibling:this.dom.insertBefore(u.toDOM(e),i)),l&&o++}this.dom.className=r,this.markers=t}destroy(){this.setMarkers(null,[])}}function iH(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 sH=Ae.define(),oH=Ae.define(),sc=Ae.define({combine(n){return yo(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,u,l)=>s(a,u,l)||o(a,u,l):o}return r}})}});class rb extends oa{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function ib(n,e){return n.state.facet(sc).formatNumber(e,n.state)}const aH=Qh.compute([sc],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(sH)},lineMarker(e,t,r){return r.some(i=>i.toDOM)?null:new rb(ib(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,r)=>{for(let i of e.state.facet(oH)){let s=i(e,t,r);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(sc)!=e.state.facet(sc),initialSpacer(e){return new rb(ib(e,e3(e.state.doc.lines)))},updateSpacer(e,t){let r=ib(t.view,e3(t.view.state.doc.lines));return r==e.number?e:new rb(r)},domEventHandlers:n.facet(sc).domEventHandlers}));function uH(n={}){return[sc.of(n),jO(),aH]}function e3(n){let e=9;for(;e<n;)e=e*10+9;return e}const lH=new class extends oa{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},cH=cm.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(lH.range(i)))}return yt.of(e)});function fH(){return cH}var N0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hH(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function q1(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var e=n.default;if(typeof e=="function"){var t=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),t}var Uh={exports:{}};/**
|
|
38
|
-
* @license
|
|
39
|
-
* Lodash <https://lodash.com/>
|
|
40
|
-
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
|
|
41
|
-
* Released under MIT license <https://lodash.com/license>
|
|
42
|
-
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
43
|
-
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
44
|
-
*/var dH=Uh.exports,t3;function pH(){return t3||(t3=1,function(n,e){(function(){var t,r="4.17.21",i=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",l=500,c="__lodash_placeholder__",f=1,d=2,g=4,m=1,y=2,b=1,w=2,S=4,k=8,x=16,C=32,R=64,P=128,q=256,B=512,G=30,V="...",F=800,A=16,Y=1,N=2,ee=3,oe=1/0,be=9007199254740991,ve=17976931348623157e292,De=NaN,we=4294967295,Ie=we-1,Rt=we>>>1,wt=[["ary",P],["bind",b],["bindKey",w],["curry",k],["curryRight",x],["flip",B],["partial",C],["partialRight",R],["rearg",q]],tt="[object Arguments]",Jt="[object Array]",In="[object AsyncFunction]",nn="[object Boolean]",mn="[object Date]",Pt="[object DOMException]",Se="[object Error]",Je="[object Function]",An="[object GeneratorFunction]",Le="[object Map]",$t="[object Number]",xn="[object Null]",Yt="[object Object]",st="[object Promise]",Ln="[object Proxy]",At="[object RegExp]",ut="[object Set]",or="[object String]",ss="[object Symbol]",pa="[object Undefined]",Ur="[object WeakMap]",Ts="[object WeakSet]",ar="[object ArrayBuffer]",Sn="[object DataView]",Dt="[object Float32Array]",os="[object Float64Array]",as="[object Int8Array]",Sr="[object Int16Array]",Ti="[object Int32Array]",us="[object Uint8Array]",fi="[object Uint8ClampedArray]",ls="[object Uint16Array]",Ms="[object Uint32Array]",ko=/\b__p \+= '';/g,ga=/\b(__p \+=) '' \+/g,xo=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ur=/&(?:amp|lt|gt|quot|#39);/g,Os=/[&<>"']/g,cs=RegExp(ur.source),fs=RegExp(Os.source),So=/<%-([\s\S]+?)%>/g,hs=/<%([\s\S]+?)%>/g,Co=/<%=([\s\S]+?)%>/g,Cr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Hr=/^\w*$/,Eo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Mi=/[\\^$.*+?()[\]{}|]/g,Oi=RegExp(Mi.source),ds=/^\s+/,L=/\s/,Xt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Zt=/\{\n\/\* \[wrapped with (.+)\] \*/,qe=/,? & /,W=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,de=/[()=,{}\[\]\/\s]/,ke=/\\(\\)?/g,Oe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_t=/\w*$/,bt=/^[-+]0x[0-9a-f]+$/i,Wt=/^0b[01]+$/i,Qt=/^\[object .+?Constructor\]$/,nt=/^0o[0-7]+$/i,Ft=/^(?:0|[1-9]\d*)$/,rt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,zt=/($^)/,sn=/['\n\r\u2028\u2029\\]/g,Hn="\\ud800-\\udfff",Zc="\\u0300-\\u036f",hp="\\ufe20-\\ufe2f",rv="\\u20d0-\\u20ff",uu=Zc+hp+rv,bl="\\u2700-\\u27bf",wl="a-z\\xdf-\\xf6\\xf8-\\xff",Qc="\\xac\\xb1\\xd7\\xf7",dp="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",iv="\\u2000-\\u206f",sv=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",pp="A-Z\\xc0-\\xd6\\xd8-\\xde",gp="\\ufe0e\\ufe0f",mp=Qc+dp+iv+sv,_l="['’]",ov="["+Hn+"]",kl="["+mp+"]",xl="["+uu+"]",ef="\\d+",Ps="["+bl+"]",vp="["+wl+"]",Sl="[^"+Hn+mp+ef+bl+wl+pp+"]",tf="\\ud83c[\\udffb-\\udfff]",av="(?:"+xl+"|"+tf+")",nf="[^"+Hn+"]",rf="(?:\\ud83c[\\udde6-\\uddff]){2}",lu="[\\ud800-\\udbff][\\udc00-\\udfff]",ma="["+pp+"]",Cl="\\u200d",yp="(?:"+vp+"|"+Sl+")",uv="(?:"+ma+"|"+Sl+")",sf="(?:"+_l+"(?:d|ll|m|re|s|t|ve))?",of="(?:"+_l+"(?:D|LL|M|RE|S|T|VE))?",bp=av+"?",af="["+gp+"]?",lv="(?:"+Cl+"(?:"+[nf,rf,lu].join("|")+")"+af+bp+")*",cv="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",wp="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",uf=af+bp+lv,fv="(?:"+[Ps,rf,lu].join("|")+")"+uf,lf="(?:"+[nf+xl+"?",xl,rf,lu,ov].join("|")+")",hv=RegExp(_l,"g"),_p=RegExp(xl,"g"),ps=RegExp(tf+"(?="+tf+")|"+lf+uf,"g"),kp=RegExp([ma+"?"+vp+"+"+sf+"(?="+[kl,ma,"$"].join("|")+")",uv+"+"+of+"(?="+[kl,ma+yp,"$"].join("|")+")",ma+"?"+yp+"+"+sf,ma+"+"+of,wp,cv,ef,fv].join("|"),"g"),lr=RegExp("["+Cl+Hn+uu+gp+"]"),El=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rl=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Is=-1,Xe={};Xe[Dt]=Xe[os]=Xe[as]=Xe[Sr]=Xe[Ti]=Xe[us]=Xe[fi]=Xe[ls]=Xe[Ms]=!0,Xe[tt]=Xe[Jt]=Xe[ar]=Xe[nn]=Xe[Sn]=Xe[mn]=Xe[Se]=Xe[Je]=Xe[Le]=Xe[$t]=Xe[Yt]=Xe[At]=Xe[ut]=Xe[or]=Xe[Ur]=!1;var Tt={};Tt[tt]=Tt[Jt]=Tt[ar]=Tt[Sn]=Tt[nn]=Tt[mn]=Tt[Dt]=Tt[os]=Tt[as]=Tt[Sr]=Tt[Ti]=Tt[Le]=Tt[$t]=Tt[Yt]=Tt[At]=Tt[ut]=Tt[or]=Tt[ss]=Tt[us]=Tt[fi]=Tt[ls]=Tt[Ms]=!0,Tt[Se]=Tt[Je]=Tt[Ur]=!1;var dv={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Al={"&":"&","<":"<",">":">",'"':""","'":"'"},gs={"&":"&","<":"<",">":">",""":'"',"'":"'"},cu={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},hi=parseFloat,va=parseInt,Dl=typeof N0=="object"&&N0&&N0.Object===Object&&N0,cf=typeof self=="object"&&self&&self.Object===Object&&self,vn=Dl||cf||Function("return this")(),Tl=e&&!e.nodeType&&e,ms=Tl&&!0&&n&&!n.nodeType&&n,fu=ms&&ms.exports===Tl,Ml=fu&&Dl.process,Vr=function(){try{var T=ms&&ms.require&&ms.require("util").types;return T||Ml&&Ml.binding&&Ml.binding("util")}catch{}}(),xp=Vr&&Vr.isArrayBuffer,ff=Vr&&Vr.isDate,hf=Vr&&Vr.isMap,df=Vr&&Vr.isRegExp,ya=Vr&&Vr.isSet,ba=Vr&&Vr.isTypedArray;function Er(T,j,H){switch(H.length){case 0:return T.call(j);case 1:return T.call(j,H[0]);case 2:return T.call(j,H[0],H[1]);case 3:return T.call(j,H[0],H[1],H[2])}return T.apply(j,H)}function Sp(T,j,H,ae){for(var _e=-1,$=T==null?0:T.length;++_e<$;){var Q=T[_e];j(ae,Q,H(Q),T)}return ae}function cr(T,j){for(var H=-1,ae=T==null?0:T.length;++H<ae&&j(T[H],H,T)!==!1;);return T}function pv(T,j){for(var H=T==null?0:T.length;H--&&j(T[H],H,T)!==!1;);return T}function pf(T,j){for(var H=-1,ae=T==null?0:T.length;++H<ae;)if(!j(T[H],H,T))return!1;return!0}function Ls(T,j){for(var H=-1,ae=T==null?0:T.length,_e=0,$=[];++H<ae;){var Q=T[H];j(Q,H,T)&&($[_e++]=Q)}return $}function Ol(T,j){var H=T==null?0:T.length;return!!H&&Pi(T,j,0)>-1}function gf(T,j,H){for(var ae=-1,_e=T==null?0:T.length;++ae<_e;)if(H(j,T[ae]))return!0;return!1}function Nt(T,j){for(var H=-1,ae=T==null?0:T.length,_e=Array(ae);++H<ae;)_e[H]=j(T[H],H,T);return _e}function Fs(T,j){for(var H=-1,ae=j.length,_e=T.length;++H<ae;)T[_e+H]=j[H];return T}function mf(T,j,H,ae){var _e=-1,$=T==null?0:T.length;for(ae&&$&&(H=T[++_e]);++_e<$;)H=j(H,T[_e],_e,T);return H}function Cp(T,j,H,ae){var _e=T==null?0:T.length;for(ae&&_e&&(H=T[--_e]);_e--;)H=j(H,T[_e],_e,T);return H}function vf(T,j){for(var H=-1,ae=T==null?0:T.length;++H<ae;)if(j(T[H],H,T))return!0;return!1}var Ep=hu("length");function gv(T){return T.split("")}function mv(T){return T.match(W)||[]}function Rp(T,j,H){var ae;return H(T,function(_e,$,Q){if(j(_e,$,Q))return ae=$,!1}),ae}function di(T,j,H,ae){for(var _e=T.length,$=H+(ae?1:-1);ae?$--:++$<_e;)if(j(T[$],$,T))return $;return-1}function Pi(T,j,H){return j===j?xv(T,j,H):di(T,Ap,H)}function Ro(T,j,H,ae){for(var _e=H-1,$=T.length;++_e<$;)if(ae(T[_e],j))return _e;return-1}function Ap(T){return T!==T}function yf(T,j){var H=T==null?0:T.length;return H?bf(T,j)/H:De}function hu(T){return function(j){return j==null?t:j[T]}}function Pl(T){return function(j){return T==null?t:T[j]}}function du(T,j,H,ae,_e){return _e(T,function($,Q,ne){H=ae?(ae=!1,$):j(H,$,Q,ne)}),H}function vv(T,j){var H=T.length;for(T.sort(j);H--;)T[H]=T[H].value;return T}function bf(T,j){for(var H,ae=-1,_e=T.length;++ae<_e;){var $=j(T[ae]);$!==t&&(H=H===t?$:H+$)}return H}function Il(T,j){for(var H=-1,ae=Array(T);++H<T;)ae[H]=j(H);return ae}function wf(T,j){return Nt(j,function(H){return[H,T[H]]})}function Dp(T){return T&&T.slice(0,Mp(T)+1).replace(ds,"")}function Rr(T){return function(j){return T(j)}}function _f(T,j){return Nt(j,function(H){return T[H]})}function pu(T,j){return T.has(j)}function kf(T,j){for(var H=-1,ae=T.length;++H<ae&&Pi(j,T[H],0)>-1;);return H}function Tp(T,j){for(var H=T.length;H--&&Pi(j,T[H],0)>-1;);return H}function yv(T,j){for(var H=T.length,ae=0;H--;)T[H]===j&&++ae;return ae}var bv=Pl(dv),xf=Pl(Al);function Sf(T){return"\\"+cu[T]}function wv(T,j){return T==null?t:T[j]}function wa(T){return lr.test(T)}function _v(T){return El.test(T)}function Ll(T){for(var j,H=[];!(j=T.next()).done;)H.push(j.value);return H}function Fl(T){var j=-1,H=Array(T.size);return T.forEach(function(ae,_e){H[++j]=[_e,ae]}),H}function Nl(T,j){return function(H){return T(j(H))}}function vs(T,j){for(var H=-1,ae=T.length,_e=0,$=[];++H<ae;){var Q=T[H];(Q===j||Q===c)&&(T[H]=c,$[_e++]=H)}return $}function Bl(T){var j=-1,H=Array(T.size);return T.forEach(function(ae){H[++j]=ae}),H}function kv(T){var j=-1,H=Array(T.size);return T.forEach(function(ae){H[++j]=[ae,ae]}),H}function xv(T,j,H){for(var ae=H-1,_e=T.length;++ae<_e;)if(T[ae]===j)return ae;return-1}function Sv(T,j,H){for(var ae=H+1;ae--;)if(T[ae]===j)return ae;return ae}function _a(T){return wa(T)?O(T):Ep(T)}function Ar(T){return wa(T)?U(T):gv(T)}function Mp(T){for(var j=T.length;j--&&L.test(T.charAt(j)););return j}var D=Pl(gs);function O(T){for(var j=ps.lastIndex=0;ps.test(T);)++j;return j}function U(T){return T.match(ps)||[]}function J(T){return T.match(kp)||[]}var Z=function T(j){j=j==null?vn:X.defaults(vn.Object(),j,X.pick(vn,Rl));var H=j.Array,ae=j.Date,_e=j.Error,$=j.Function,Q=j.Math,ne=j.Object,le=j.RegExp,Ee=j.String,Pe=j.TypeError,Ue=H.prototype,Ve=$.prototype,je=ne.prototype,Ut=j["__core-js_shared__"],yn=Ve.toString,lt=je.hasOwnProperty,Ao=0,Cf=function(){var h=/[^.]+$/.exec(Ut&&Ut.keys&&Ut.keys.IE_PROTO||"");return h?"Symbol(src)_1."+h:""}(),Op=je.toString,xI=yn.call(ne),SI=vn._,CI=le("^"+yn.call(lt).replace(Mi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pp=fu?j.Buffer:t,ka=j.Symbol,Ip=j.Uint8Array,mx=Pp?Pp.allocUnsafe:t,Lp=Nl(ne.getPrototypeOf,ne),vx=ne.create,yx=je.propertyIsEnumerable,Fp=Ue.splice,bx=ka?ka.isConcatSpreadable:t,Ef=ka?ka.iterator:t,gu=ka?ka.toStringTag:t,Np=function(){try{var h=wu(ne,"defineProperty");return h({},"",{}),h}catch{}}(),EI=j.clearTimeout!==vn.clearTimeout&&j.clearTimeout,RI=ae&&ae.now!==vn.Date.now&&ae.now,AI=j.setTimeout!==vn.setTimeout&&j.setTimeout,Bp=Q.ceil,qp=Q.floor,Cv=ne.getOwnPropertySymbols,DI=Pp?Pp.isBuffer:t,wx=j.isFinite,TI=Ue.join,MI=Nl(ne.keys,ne),Dn=Q.max,fr=Q.min,OI=ae.now,PI=j.parseInt,_x=Q.random,II=Ue.reverse,Ev=wu(j,"DataView"),Rf=wu(j,"Map"),Rv=wu(j,"Promise"),ql=wu(j,"Set"),Af=wu(j,"WeakMap"),Df=wu(ne,"create"),jp=Af&&new Af,jl={},LI=_u(Ev),FI=_u(Rf),NI=_u(Rv),BI=_u(ql),qI=_u(Af),$p=ka?ka.prototype:t,Tf=$p?$p.valueOf:t,kx=$p?$p.toString:t;function M(h){if(dn(h)&&!Ke(h)&&!(h instanceof ct)){if(h instanceof Ii)return h;if(lt.call(h,"__wrapped__"))return xS(h)}return new Ii(h)}var $l=function(){function h(){}return function(p){if(!on(p))return{};if(vx)return vx(p);h.prototype=p;var v=new h;return h.prototype=t,v}}();function Wp(){}function Ii(h,p){this.__wrapped__=h,this.__actions__=[],this.__chain__=!!p,this.__index__=0,this.__values__=t}M.templateSettings={escape:So,evaluate:hs,interpolate:Co,variable:"",imports:{_:M}},M.prototype=Wp.prototype,M.prototype.constructor=M,Ii.prototype=$l(Wp.prototype),Ii.prototype.constructor=Ii;function ct(h){this.__wrapped__=h,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=we,this.__views__=[]}function jI(){var h=new ct(this.__wrapped__);return h.__actions__=Gr(this.__actions__),h.__dir__=this.__dir__,h.__filtered__=this.__filtered__,h.__iteratees__=Gr(this.__iteratees__),h.__takeCount__=this.__takeCount__,h.__views__=Gr(this.__views__),h}function $I(){if(this.__filtered__){var h=new ct(this);h.__dir__=-1,h.__filtered__=!0}else h=this.clone(),h.__dir__*=-1;return h}function WI(){var h=this.__wrapped__.value(),p=this.__dir__,v=Ke(h),_=p<0,E=v?h.length:0,I=eL(0,E,this.__views__),z=I.start,K=I.end,te=K-z,pe=_?K:z-1,ge=this.__iteratees__,ye=ge.length,Ce=0,Fe=fr(te,this.__takeCount__);if(!v||!_&&E==te&&Fe==te)return Vx(h,this.__actions__);var We=[];e:for(;te--&&Ce<Fe;){pe+=p;for(var Ze=-1,ze=h[pe];++Ze<ye;){var ot=ge[Ze],ht=ot.iteratee,mi=ot.type,Mr=ht(ze);if(mi==N)ze=Mr;else if(!Mr){if(mi==Y)continue e;break e}}We[Ce++]=ze}return We}ct.prototype=$l(Wp.prototype),ct.prototype.constructor=ct;function mu(h){var p=-1,v=h==null?0:h.length;for(this.clear();++p<v;){var _=h[p];this.set(_[0],_[1])}}function zI(){this.__data__=Df?Df(null):{},this.size=0}function UI(h){var p=this.has(h)&&delete this.__data__[h];return this.size-=p?1:0,p}function HI(h){var p=this.__data__;if(Df){var v=p[h];return v===u?t:v}return lt.call(p,h)?p[h]:t}function VI(h){var p=this.__data__;return Df?p[h]!==t:lt.call(p,h)}function GI(h,p){var v=this.__data__;return this.size+=this.has(h)?0:1,v[h]=Df&&p===t?u:p,this}mu.prototype.clear=zI,mu.prototype.delete=UI,mu.prototype.get=HI,mu.prototype.has=VI,mu.prototype.set=GI;function Do(h){var p=-1,v=h==null?0:h.length;for(this.clear();++p<v;){var _=h[p];this.set(_[0],_[1])}}function KI(){this.__data__=[],this.size=0}function JI(h){var p=this.__data__,v=zp(p,h);if(v<0)return!1;var _=p.length-1;return v==_?p.pop():Fp.call(p,v,1),--this.size,!0}function YI(h){var p=this.__data__,v=zp(p,h);return v<0?t:p[v][1]}function XI(h){return zp(this.__data__,h)>-1}function ZI(h,p){var v=this.__data__,_=zp(v,h);return _<0?(++this.size,v.push([h,p])):v[_][1]=p,this}Do.prototype.clear=KI,Do.prototype.delete=JI,Do.prototype.get=YI,Do.prototype.has=XI,Do.prototype.set=ZI;function To(h){var p=-1,v=h==null?0:h.length;for(this.clear();++p<v;){var _=h[p];this.set(_[0],_[1])}}function QI(){this.size=0,this.__data__={hash:new mu,map:new(Rf||Do),string:new mu}}function e5(h){var p=t0(this,h).delete(h);return this.size-=p?1:0,p}function t5(h){return t0(this,h).get(h)}function n5(h){return t0(this,h).has(h)}function r5(h,p){var v=t0(this,h),_=v.size;return v.set(h,p),this.size+=v.size==_?0:1,this}To.prototype.clear=QI,To.prototype.delete=e5,To.prototype.get=t5,To.prototype.has=n5,To.prototype.set=r5;function vu(h){var p=-1,v=h==null?0:h.length;for(this.__data__=new To;++p<v;)this.add(h[p])}function i5(h){return this.__data__.set(h,u),this}function s5(h){return this.__data__.has(h)}vu.prototype.add=vu.prototype.push=i5,vu.prototype.has=s5;function ys(h){var p=this.__data__=new Do(h);this.size=p.size}function o5(){this.__data__=new Do,this.size=0}function a5(h){var p=this.__data__,v=p.delete(h);return this.size=p.size,v}function u5(h){return this.__data__.get(h)}function l5(h){return this.__data__.has(h)}function c5(h,p){var v=this.__data__;if(v instanceof Do){var _=v.__data__;if(!Rf||_.length<i-1)return _.push([h,p]),this.size=++v.size,this;v=this.__data__=new To(_)}return v.set(h,p),this.size=v.size,this}ys.prototype.clear=o5,ys.prototype.delete=a5,ys.prototype.get=u5,ys.prototype.has=l5,ys.prototype.set=c5;function xx(h,p){var v=Ke(h),_=!v&&ku(h),E=!v&&!_&&Ra(h),I=!v&&!_&&!E&&Hl(h),z=v||_||E||I,K=z?Il(h.length,Ee):[],te=K.length;for(var pe in h)(p||lt.call(h,pe))&&!(z&&(pe=="length"||E&&(pe=="offset"||pe=="parent")||I&&(pe=="buffer"||pe=="byteLength"||pe=="byteOffset")||Io(pe,te)))&&K.push(pe);return K}function Sx(h){var p=h.length;return p?h[Bv(0,p-1)]:t}function f5(h,p){return n0(Gr(h),yu(p,0,h.length))}function h5(h){return n0(Gr(h))}function Av(h,p,v){(v!==t&&!bs(h[p],v)||v===t&&!(p in h))&&Mo(h,p,v)}function Mf(h,p,v){var _=h[p];(!(lt.call(h,p)&&bs(_,v))||v===t&&!(p in h))&&Mo(h,p,v)}function zp(h,p){for(var v=h.length;v--;)if(bs(h[v][0],p))return v;return-1}function d5(h,p,v,_){return xa(h,function(E,I,z){p(_,E,v(E),z)}),_}function Cx(h,p){return h&&Bs(p,Fn(p),h)}function p5(h,p){return h&&Bs(p,Jr(p),h)}function Mo(h,p,v){p=="__proto__"&&Np?Np(h,p,{configurable:!0,enumerable:!0,value:v,writable:!0}):h[p]=v}function Dv(h,p){for(var v=-1,_=p.length,E=H(_),I=h==null;++v<_;)E[v]=I?t:ly(h,p[v]);return E}function yu(h,p,v){return h===h&&(v!==t&&(h=h<=v?h:v),p!==t&&(h=h>=p?h:p)),h}function Li(h,p,v,_,E,I){var z,K=p&f,te=p&d,pe=p&g;if(v&&(z=E?v(h,_,E,I):v(h)),z!==t)return z;if(!on(h))return h;var ge=Ke(h);if(ge){if(z=nL(h),!K)return Gr(h,z)}else{var ye=hr(h),Ce=ye==Je||ye==An;if(Ra(h))return Jx(h,K);if(ye==Yt||ye==tt||Ce&&!E){if(z=te||Ce?{}:pS(h),!K)return te?H5(h,p5(z,h)):U5(h,Cx(z,h))}else{if(!Tt[ye])return E?h:{};z=rL(h,ye,K)}}I||(I=new ys);var Fe=I.get(h);if(Fe)return Fe;I.set(h,z),zS(h)?h.forEach(function(ze){z.add(Li(ze,p,v,ze,h,I))}):$S(h)&&h.forEach(function(ze,ot){z.set(ot,Li(ze,p,v,ot,h,I))});var We=pe?te?Jv:Kv:te?Jr:Fn,Ze=ge?t:We(h);return cr(Ze||h,function(ze,ot){Ze&&(ot=ze,ze=h[ot]),Mf(z,ot,Li(ze,p,v,ot,h,I))}),z}function g5(h){var p=Fn(h);return function(v){return Ex(v,h,p)}}function Ex(h,p,v){var _=v.length;if(h==null)return!_;for(h=ne(h);_--;){var E=v[_],I=p[E],z=h[E];if(z===t&&!(E in h)||!I(z))return!1}return!0}function Rx(h,p,v){if(typeof h!="function")throw new Pe(o);return Bf(function(){h.apply(t,v)},p)}function Of(h,p,v,_){var E=-1,I=Ol,z=!0,K=h.length,te=[],pe=p.length;if(!K)return te;v&&(p=Nt(p,Rr(v))),_?(I=gf,z=!1):p.length>=i&&(I=pu,z=!1,p=new vu(p));e:for(;++E<K;){var ge=h[E],ye=v==null?ge:v(ge);if(ge=_||ge!==0?ge:0,z&&ye===ye){for(var Ce=pe;Ce--;)if(p[Ce]===ye)continue e;te.push(ge)}else I(p,ye,_)||te.push(ge)}return te}var xa=eS(Ns),Ax=eS(Mv,!0);function m5(h,p){var v=!0;return xa(h,function(_,E,I){return v=!!p(_,E,I),v}),v}function Up(h,p,v){for(var _=-1,E=h.length;++_<E;){var I=h[_],z=p(I);if(z!=null&&(K===t?z===z&&!gi(z):v(z,K)))var K=z,te=I}return te}function v5(h,p,v,_){var E=h.length;for(v=Ye(v),v<0&&(v=-v>E?0:E+v),_=_===t||_>E?E:Ye(_),_<0&&(_+=E),_=v>_?0:HS(_);v<_;)h[v++]=p;return h}function Dx(h,p){var v=[];return xa(h,function(_,E,I){p(_,E,I)&&v.push(_)}),v}function Vn(h,p,v,_,E){var I=-1,z=h.length;for(v||(v=sL),E||(E=[]);++I<z;){var K=h[I];p>0&&v(K)?p>1?Vn(K,p-1,v,_,E):Fs(E,K):_||(E[E.length]=K)}return E}var Tv=tS(),Tx=tS(!0);function Ns(h,p){return h&&Tv(h,p,Fn)}function Mv(h,p){return h&&Tx(h,p,Fn)}function Hp(h,p){return Ls(p,function(v){return Lo(h[v])})}function bu(h,p){p=Ca(p,h);for(var v=0,_=p.length;h!=null&&v<_;)h=h[qs(p[v++])];return v&&v==_?h:t}function Mx(h,p,v){var _=p(h);return Ke(h)?_:Fs(_,v(h))}function Dr(h){return h==null?h===t?pa:xn:gu&&gu in ne(h)?Q5(h):hL(h)}function Ov(h,p){return h>p}function y5(h,p){return h!=null&<.call(h,p)}function b5(h,p){return h!=null&&p in ne(h)}function w5(h,p,v){return h>=fr(p,v)&&h<Dn(p,v)}function Pv(h,p,v){for(var _=v?gf:Ol,E=h[0].length,I=h.length,z=I,K=H(I),te=1/0,pe=[];z--;){var ge=h[z];z&&p&&(ge=Nt(ge,Rr(p))),te=fr(ge.length,te),K[z]=!v&&(p||E>=120&&ge.length>=120)?new vu(z&&ge):t}ge=h[0];var ye=-1,Ce=K[0];e:for(;++ye<E&&pe.length<te;){var Fe=ge[ye],We=p?p(Fe):Fe;if(Fe=v||Fe!==0?Fe:0,!(Ce?pu(Ce,We):_(pe,We,v))){for(z=I;--z;){var Ze=K[z];if(!(Ze?pu(Ze,We):_(h[z],We,v)))continue e}Ce&&Ce.push(We),pe.push(Fe)}}return pe}function _5(h,p,v,_){return Ns(h,function(E,I,z){p(_,v(E),I,z)}),_}function Pf(h,p,v){p=Ca(p,h),h=yS(h,p);var _=h==null?h:h[qs(Ni(p))];return _==null?t:Er(_,h,v)}function Ox(h){return dn(h)&&Dr(h)==tt}function k5(h){return dn(h)&&Dr(h)==ar}function x5(h){return dn(h)&&Dr(h)==mn}function If(h,p,v,_,E){return h===p?!0:h==null||p==null||!dn(h)&&!dn(p)?h!==h&&p!==p:S5(h,p,v,_,If,E)}function S5(h,p,v,_,E,I){var z=Ke(h),K=Ke(p),te=z?Jt:hr(h),pe=K?Jt:hr(p);te=te==tt?Yt:te,pe=pe==tt?Yt:pe;var ge=te==Yt,ye=pe==Yt,Ce=te==pe;if(Ce&&Ra(h)){if(!Ra(p))return!1;z=!0,ge=!1}if(Ce&&!ge)return I||(I=new ys),z||Hl(h)?fS(h,p,v,_,E,I):X5(h,p,te,v,_,E,I);if(!(v&m)){var Fe=ge&<.call(h,"__wrapped__"),We=ye&<.call(p,"__wrapped__");if(Fe||We){var Ze=Fe?h.value():h,ze=We?p.value():p;return I||(I=new ys),E(Ze,ze,v,_,I)}}return Ce?(I||(I=new ys),Z5(h,p,v,_,E,I)):!1}function C5(h){return dn(h)&&hr(h)==Le}function Iv(h,p,v,_){var E=v.length,I=E,z=!_;if(h==null)return!I;for(h=ne(h);E--;){var K=v[E];if(z&&K[2]?K[1]!==h[K[0]]:!(K[0]in h))return!1}for(;++E<I;){K=v[E];var te=K[0],pe=h[te],ge=K[1];if(z&&K[2]){if(pe===t&&!(te in h))return!1}else{var ye=new ys;if(_)var Ce=_(pe,ge,te,h,p,ye);if(!(Ce===t?If(ge,pe,m|y,_,ye):Ce))return!1}}return!0}function Px(h){if(!on(h)||aL(h))return!1;var p=Lo(h)?CI:Qt;return p.test(_u(h))}function E5(h){return dn(h)&&Dr(h)==At}function R5(h){return dn(h)&&hr(h)==ut}function A5(h){return dn(h)&&u0(h.length)&&!!Xe[Dr(h)]}function Ix(h){return typeof h=="function"?h:h==null?Yr:typeof h=="object"?Ke(h)?Nx(h[0],h[1]):Fx(h):nC(h)}function Lv(h){if(!Nf(h))return MI(h);var p=[];for(var v in ne(h))lt.call(h,v)&&v!="constructor"&&p.push(v);return p}function D5(h){if(!on(h))return fL(h);var p=Nf(h),v=[];for(var _ in h)_=="constructor"&&(p||!lt.call(h,_))||v.push(_);return v}function Fv(h,p){return h<p}function Lx(h,p){var v=-1,_=Kr(h)?H(h.length):[];return xa(h,function(E,I,z){_[++v]=p(E,I,z)}),_}function Fx(h){var p=Xv(h);return p.length==1&&p[0][2]?mS(p[0][0],p[0][1]):function(v){return v===h||Iv(v,h,p)}}function Nx(h,p){return Qv(h)&&gS(p)?mS(qs(h),p):function(v){var _=ly(v,h);return _===t&&_===p?cy(v,h):If(p,_,m|y)}}function Vp(h,p,v,_,E){h!==p&&Tv(p,function(I,z){if(E||(E=new ys),on(I))T5(h,p,z,v,Vp,_,E);else{var K=_?_(ty(h,z),I,z+"",h,p,E):t;K===t&&(K=I),Av(h,z,K)}},Jr)}function T5(h,p,v,_,E,I,z){var K=ty(h,v),te=ty(p,v),pe=z.get(te);if(pe){Av(h,v,pe);return}var ge=I?I(K,te,v+"",h,p,z):t,ye=ge===t;if(ye){var Ce=Ke(te),Fe=!Ce&&Ra(te),We=!Ce&&!Fe&&Hl(te);ge=te,Ce||Fe||We?Ke(K)?ge=K:bn(K)?ge=Gr(K):Fe?(ye=!1,ge=Jx(te,!0)):We?(ye=!1,ge=Yx(te,!0)):ge=[]:qf(te)||ku(te)?(ge=K,ku(K)?ge=VS(K):(!on(K)||Lo(K))&&(ge=pS(te))):ye=!1}ye&&(z.set(te,ge),E(ge,te,_,I,z),z.delete(te)),Av(h,v,ge)}function Bx(h,p){var v=h.length;if(v)return p+=p<0?v:0,Io(p,v)?h[p]:t}function qx(h,p,v){p.length?p=Nt(p,function(I){return Ke(I)?function(z){return bu(z,I.length===1?I[0]:I)}:I}):p=[Yr];var _=-1;p=Nt(p,Rr($e()));var E=Lx(h,function(I,z,K){var te=Nt(p,function(pe){return pe(I)});return{criteria:te,index:++_,value:I}});return vv(E,function(I,z){return z5(I,z,v)})}function M5(h,p){return jx(h,p,function(v,_){return cy(h,_)})}function jx(h,p,v){for(var _=-1,E=p.length,I={};++_<E;){var z=p[_],K=bu(h,z);v(K,z)&&Lf(I,Ca(z,h),K)}return I}function O5(h){return function(p){return bu(p,h)}}function Nv(h,p,v,_){var E=_?Ro:Pi,I=-1,z=p.length,K=h;for(h===p&&(p=Gr(p)),v&&(K=Nt(h,Rr(v)));++I<z;)for(var te=0,pe=p[I],ge=v?v(pe):pe;(te=E(K,ge,te,_))>-1;)K!==h&&Fp.call(K,te,1),Fp.call(h,te,1);return h}function $x(h,p){for(var v=h?p.length:0,_=v-1;v--;){var E=p[v];if(v==_||E!==I){var I=E;Io(E)?Fp.call(h,E,1):$v(h,E)}}return h}function Bv(h,p){return h+qp(_x()*(p-h+1))}function P5(h,p,v,_){for(var E=-1,I=Dn(Bp((p-h)/(v||1)),0),z=H(I);I--;)z[_?I:++E]=h,h+=v;return z}function qv(h,p){var v="";if(!h||p<1||p>be)return v;do p%2&&(v+=h),p=qp(p/2),p&&(h+=h);while(p);return v}function Qe(h,p){return ny(vS(h,p,Yr),h+"")}function I5(h){return Sx(Vl(h))}function L5(h,p){var v=Vl(h);return n0(v,yu(p,0,v.length))}function Lf(h,p,v,_){if(!on(h))return h;p=Ca(p,h);for(var E=-1,I=p.length,z=I-1,K=h;K!=null&&++E<I;){var te=qs(p[E]),pe=v;if(te==="__proto__"||te==="constructor"||te==="prototype")return h;if(E!=z){var ge=K[te];pe=_?_(ge,te,K):t,pe===t&&(pe=on(ge)?ge:Io(p[E+1])?[]:{})}Mf(K,te,pe),K=K[te]}return h}var Wx=jp?function(h,p){return jp.set(h,p),h}:Yr,F5=Np?function(h,p){return Np(h,"toString",{configurable:!0,enumerable:!1,value:hy(p),writable:!0})}:Yr;function N5(h){return n0(Vl(h))}function Fi(h,p,v){var _=-1,E=h.length;p<0&&(p=-p>E?0:E+p),v=v>E?E:v,v<0&&(v+=E),E=p>v?0:v-p>>>0,p>>>=0;for(var I=H(E);++_<E;)I[_]=h[_+p];return I}function B5(h,p){var v;return xa(h,function(_,E,I){return v=p(_,E,I),!v}),!!v}function Gp(h,p,v){var _=0,E=h==null?_:h.length;if(typeof p=="number"&&p===p&&E<=Rt){for(;_<E;){var I=_+E>>>1,z=h[I];z!==null&&!gi(z)&&(v?z<=p:z<p)?_=I+1:E=I}return E}return jv(h,p,Yr,v)}function jv(h,p,v,_){var E=0,I=h==null?0:h.length;if(I===0)return 0;p=v(p);for(var z=p!==p,K=p===null,te=gi(p),pe=p===t;E<I;){var ge=qp((E+I)/2),ye=v(h[ge]),Ce=ye!==t,Fe=ye===null,We=ye===ye,Ze=gi(ye);if(z)var ze=_||We;else pe?ze=We&&(_||Ce):K?ze=We&&Ce&&(_||!Fe):te?ze=We&&Ce&&!Fe&&(_||!Ze):Fe||Ze?ze=!1:ze=_?ye<=p:ye<p;ze?E=ge+1:I=ge}return fr(I,Ie)}function zx(h,p){for(var v=-1,_=h.length,E=0,I=[];++v<_;){var z=h[v],K=p?p(z):z;if(!v||!bs(K,te)){var te=K;I[E++]=z===0?0:z}}return I}function Ux(h){return typeof h=="number"?h:gi(h)?De:+h}function pi(h){if(typeof h=="string")return h;if(Ke(h))return Nt(h,pi)+"";if(gi(h))return kx?kx.call(h):"";var p=h+"";return p=="0"&&1/h==-oe?"-0":p}function Sa(h,p,v){var _=-1,E=Ol,I=h.length,z=!0,K=[],te=K;if(v)z=!1,E=gf;else if(I>=i){var pe=p?null:J5(h);if(pe)return Bl(pe);z=!1,E=pu,te=new vu}else te=p?[]:K;e:for(;++_<I;){var ge=h[_],ye=p?p(ge):ge;if(ge=v||ge!==0?ge:0,z&&ye===ye){for(var Ce=te.length;Ce--;)if(te[Ce]===ye)continue e;p&&te.push(ye),K.push(ge)}else E(te,ye,v)||(te!==K&&te.push(ye),K.push(ge))}return K}function $v(h,p){return p=Ca(p,h),h=yS(h,p),h==null||delete h[qs(Ni(p))]}function Hx(h,p,v,_){return Lf(h,p,v(bu(h,p)),_)}function Kp(h,p,v,_){for(var E=h.length,I=_?E:-1;(_?I--:++I<E)&&p(h[I],I,h););return v?Fi(h,_?0:I,_?I+1:E):Fi(h,_?I+1:0,_?E:I)}function Vx(h,p){var v=h;return v instanceof ct&&(v=v.value()),mf(p,function(_,E){return E.func.apply(E.thisArg,Fs([_],E.args))},v)}function Wv(h,p,v){var _=h.length;if(_<2)return _?Sa(h[0]):[];for(var E=-1,I=H(_);++E<_;)for(var z=h[E],K=-1;++K<_;)K!=E&&(I[E]=Of(I[E]||z,h[K],p,v));return Sa(Vn(I,1),p,v)}function Gx(h,p,v){for(var _=-1,E=h.length,I=p.length,z={};++_<E;){var K=_<I?p[_]:t;v(z,h[_],K)}return z}function zv(h){return bn(h)?h:[]}function Uv(h){return typeof h=="function"?h:Yr}function Ca(h,p){return Ke(h)?h:Qv(h,p)?[h]:kS(kt(h))}var q5=Qe;function Ea(h,p,v){var _=h.length;return v=v===t?_:v,!p&&v>=_?h:Fi(h,p,v)}var Kx=EI||function(h){return vn.clearTimeout(h)};function Jx(h,p){if(p)return h.slice();var v=h.length,_=mx?mx(v):new h.constructor(v);return h.copy(_),_}function Hv(h){var p=new h.constructor(h.byteLength);return new Ip(p).set(new Ip(h)),p}function j5(h,p){var v=p?Hv(h.buffer):h.buffer;return new h.constructor(v,h.byteOffset,h.byteLength)}function $5(h){var p=new h.constructor(h.source,_t.exec(h));return p.lastIndex=h.lastIndex,p}function W5(h){return Tf?ne(Tf.call(h)):{}}function Yx(h,p){var v=p?Hv(h.buffer):h.buffer;return new h.constructor(v,h.byteOffset,h.length)}function Xx(h,p){if(h!==p){var v=h!==t,_=h===null,E=h===h,I=gi(h),z=p!==t,K=p===null,te=p===p,pe=gi(p);if(!K&&!pe&&!I&&h>p||I&&z&&te&&!K&&!pe||_&&z&&te||!v&&te||!E)return 1;if(!_&&!I&&!pe&&h<p||pe&&v&&E&&!_&&!I||K&&v&&E||!z&&E||!te)return-1}return 0}function z5(h,p,v){for(var _=-1,E=h.criteria,I=p.criteria,z=E.length,K=v.length;++_<z;){var te=Xx(E[_],I[_]);if(te){if(_>=K)return te;var pe=v[_];return te*(pe=="desc"?-1:1)}}return h.index-p.index}function Zx(h,p,v,_){for(var E=-1,I=h.length,z=v.length,K=-1,te=p.length,pe=Dn(I-z,0),ge=H(te+pe),ye=!_;++K<te;)ge[K]=p[K];for(;++E<z;)(ye||E<I)&&(ge[v[E]]=h[E]);for(;pe--;)ge[K++]=h[E++];return ge}function Qx(h,p,v,_){for(var E=-1,I=h.length,z=-1,K=v.length,te=-1,pe=p.length,ge=Dn(I-K,0),ye=H(ge+pe),Ce=!_;++E<ge;)ye[E]=h[E];for(var Fe=E;++te<pe;)ye[Fe+te]=p[te];for(;++z<K;)(Ce||E<I)&&(ye[Fe+v[z]]=h[E++]);return ye}function Gr(h,p){var v=-1,_=h.length;for(p||(p=H(_));++v<_;)p[v]=h[v];return p}function Bs(h,p,v,_){var E=!v;v||(v={});for(var I=-1,z=p.length;++I<z;){var K=p[I],te=_?_(v[K],h[K],K,v,h):t;te===t&&(te=h[K]),E?Mo(v,K,te):Mf(v,K,te)}return v}function U5(h,p){return Bs(h,Zv(h),p)}function H5(h,p){return Bs(h,hS(h),p)}function Jp(h,p){return function(v,_){var E=Ke(v)?Sp:d5,I=p?p():{};return E(v,h,$e(_,2),I)}}function Wl(h){return Qe(function(p,v){var _=-1,E=v.length,I=E>1?v[E-1]:t,z=E>2?v[2]:t;for(I=h.length>3&&typeof I=="function"?(E--,I):t,z&&Tr(v[0],v[1],z)&&(I=E<3?t:I,E=1),p=ne(p);++_<E;){var K=v[_];K&&h(p,K,_,I)}return p})}function eS(h,p){return function(v,_){if(v==null)return v;if(!Kr(v))return h(v,_);for(var E=v.length,I=p?E:-1,z=ne(v);(p?I--:++I<E)&&_(z[I],I,z)!==!1;);return v}}function tS(h){return function(p,v,_){for(var E=-1,I=ne(p),z=_(p),K=z.length;K--;){var te=z[h?K:++E];if(v(I[te],te,I)===!1)break}return p}}function V5(h,p,v){var _=p&b,E=Ff(h);function I(){var z=this&&this!==vn&&this instanceof I?E:h;return z.apply(_?v:this,arguments)}return I}function nS(h){return function(p){p=kt(p);var v=wa(p)?Ar(p):t,_=v?v[0]:p.charAt(0),E=v?Ea(v,1).join(""):p.slice(1);return _[h]()+E}}function zl(h){return function(p){return mf(eC(QS(p).replace(hv,"")),h,"")}}function Ff(h){return function(){var p=arguments;switch(p.length){case 0:return new h;case 1:return new h(p[0]);case 2:return new h(p[0],p[1]);case 3:return new h(p[0],p[1],p[2]);case 4:return new h(p[0],p[1],p[2],p[3]);case 5:return new h(p[0],p[1],p[2],p[3],p[4]);case 6:return new h(p[0],p[1],p[2],p[3],p[4],p[5]);case 7:return new h(p[0],p[1],p[2],p[3],p[4],p[5],p[6])}var v=$l(h.prototype),_=h.apply(v,p);return on(_)?_:v}}function G5(h,p,v){var _=Ff(h);function E(){for(var I=arguments.length,z=H(I),K=I,te=Ul(E);K--;)z[K]=arguments[K];var pe=I<3&&z[0]!==te&&z[I-1]!==te?[]:vs(z,te);if(I-=pe.length,I<v)return aS(h,p,Yp,E.placeholder,t,z,pe,t,t,v-I);var ge=this&&this!==vn&&this instanceof E?_:h;return Er(ge,this,z)}return E}function rS(h){return function(p,v,_){var E=ne(p);if(!Kr(p)){var I=$e(v,3);p=Fn(p),v=function(K){return I(E[K],K,E)}}var z=h(p,v,_);return z>-1?E[I?p[z]:z]:t}}function iS(h){return Po(function(p){var v=p.length,_=v,E=Ii.prototype.thru;for(h&&p.reverse();_--;){var I=p[_];if(typeof I!="function")throw new Pe(o);if(E&&!z&&e0(I)=="wrapper")var z=new Ii([],!0)}for(_=z?_:v;++_<v;){I=p[_];var K=e0(I),te=K=="wrapper"?Yv(I):t;te&&ey(te[0])&&te[1]==(P|k|C|q)&&!te[4].length&&te[9]==1?z=z[e0(te[0])].apply(z,te[3]):z=I.length==1&&ey(I)?z[K]():z.thru(I)}return function(){var pe=arguments,ge=pe[0];if(z&&pe.length==1&&Ke(ge))return z.plant(ge).value();for(var ye=0,Ce=v?p[ye].apply(this,pe):ge;++ye<v;)Ce=p[ye].call(this,Ce);return Ce}})}function Yp(h,p,v,_,E,I,z,K,te,pe){var ge=p&P,ye=p&b,Ce=p&w,Fe=p&(k|x),We=p&B,Ze=Ce?t:Ff(h);function ze(){for(var ot=arguments.length,ht=H(ot),mi=ot;mi--;)ht[mi]=arguments[mi];if(Fe)var Mr=Ul(ze),vi=yv(ht,Mr);if(_&&(ht=Zx(ht,_,E,Fe)),I&&(ht=Qx(ht,I,z,Fe)),ot-=vi,Fe&&ot<pe){var wn=vs(ht,Mr);return aS(h,p,Yp,ze.placeholder,v,ht,wn,K,te,pe-ot)}var ws=ye?v:this,No=Ce?ws[h]:h;return ot=ht.length,K?ht=dL(ht,K):We&&ot>1&&ht.reverse(),ge&&te<ot&&(ht.length=te),this&&this!==vn&&this instanceof ze&&(No=Ze||Ff(No)),No.apply(ws,ht)}return ze}function sS(h,p){return function(v,_){return _5(v,h,p(_),{})}}function Xp(h,p){return function(v,_){var E;if(v===t&&_===t)return p;if(v!==t&&(E=v),_!==t){if(E===t)return _;typeof v=="string"||typeof _=="string"?(v=pi(v),_=pi(_)):(v=Ux(v),_=Ux(_)),E=h(v,_)}return E}}function Vv(h){return Po(function(p){return p=Nt(p,Rr($e())),Qe(function(v){var _=this;return h(p,function(E){return Er(E,_,v)})})})}function Zp(h,p){p=p===t?" ":pi(p);var v=p.length;if(v<2)return v?qv(p,h):p;var _=qv(p,Bp(h/_a(p)));return wa(p)?Ea(Ar(_),0,h).join(""):_.slice(0,h)}function K5(h,p,v,_){var E=p&b,I=Ff(h);function z(){for(var K=-1,te=arguments.length,pe=-1,ge=_.length,ye=H(ge+te),Ce=this&&this!==vn&&this instanceof z?I:h;++pe<ge;)ye[pe]=_[pe];for(;te--;)ye[pe++]=arguments[++K];return Er(Ce,E?v:this,ye)}return z}function oS(h){return function(p,v,_){return _&&typeof _!="number"&&Tr(p,v,_)&&(v=_=t),p=Fo(p),v===t?(v=p,p=0):v=Fo(v),_=_===t?p<v?1:-1:Fo(_),P5(p,v,_,h)}}function Qp(h){return function(p,v){return typeof p=="string"&&typeof v=="string"||(p=Bi(p),v=Bi(v)),h(p,v)}}function aS(h,p,v,_,E,I,z,K,te,pe){var ge=p&k,ye=ge?z:t,Ce=ge?t:z,Fe=ge?I:t,We=ge?t:I;p|=ge?C:R,p&=~(ge?R:C),p&S||(p&=-4);var Ze=[h,p,E,Fe,ye,We,Ce,K,te,pe],ze=v.apply(t,Ze);return ey(h)&&bS(ze,Ze),ze.placeholder=_,wS(ze,h,p)}function Gv(h){var p=Q[h];return function(v,_){if(v=Bi(v),_=_==null?0:fr(Ye(_),292),_&&wx(v)){var E=(kt(v)+"e").split("e"),I=p(E[0]+"e"+(+E[1]+_));return E=(kt(I)+"e").split("e"),+(E[0]+"e"+(+E[1]-_))}return p(v)}}var J5=ql&&1/Bl(new ql([,-0]))[1]==oe?function(h){return new ql(h)}:gy;function uS(h){return function(p){var v=hr(p);return v==Le?Fl(p):v==ut?kv(p):wf(p,h(p))}}function Oo(h,p,v,_,E,I,z,K){var te=p&w;if(!te&&typeof h!="function")throw new Pe(o);var pe=_?_.length:0;if(pe||(p&=-97,_=E=t),z=z===t?z:Dn(Ye(z),0),K=K===t?K:Ye(K),pe-=E?E.length:0,p&R){var ge=_,ye=E;_=E=t}var Ce=te?t:Yv(h),Fe=[h,p,v,_,E,ge,ye,I,z,K];if(Ce&&cL(Fe,Ce),h=Fe[0],p=Fe[1],v=Fe[2],_=Fe[3],E=Fe[4],K=Fe[9]=Fe[9]===t?te?0:h.length:Dn(Fe[9]-pe,0),!K&&p&(k|x)&&(p&=-25),!p||p==b)var We=V5(h,p,v);else p==k||p==x?We=G5(h,p,K):(p==C||p==(b|C))&&!E.length?We=K5(h,p,v,_):We=Yp.apply(t,Fe);var Ze=Ce?Wx:bS;return wS(Ze(We,Fe),h,p)}function lS(h,p,v,_){return h===t||bs(h,je[v])&&!lt.call(_,v)?p:h}function cS(h,p,v,_,E,I){return on(h)&&on(p)&&(I.set(p,h),Vp(h,p,t,cS,I),I.delete(p)),h}function Y5(h){return qf(h)?t:h}function fS(h,p,v,_,E,I){var z=v&m,K=h.length,te=p.length;if(K!=te&&!(z&&te>K))return!1;var pe=I.get(h),ge=I.get(p);if(pe&&ge)return pe==p&&ge==h;var ye=-1,Ce=!0,Fe=v&y?new vu:t;for(I.set(h,p),I.set(p,h);++ye<K;){var We=h[ye],Ze=p[ye];if(_)var ze=z?_(Ze,We,ye,p,h,I):_(We,Ze,ye,h,p,I);if(ze!==t){if(ze)continue;Ce=!1;break}if(Fe){if(!vf(p,function(ot,ht){if(!pu(Fe,ht)&&(We===ot||E(We,ot,v,_,I)))return Fe.push(ht)})){Ce=!1;break}}else if(!(We===Ze||E(We,Ze,v,_,I))){Ce=!1;break}}return I.delete(h),I.delete(p),Ce}function X5(h,p,v,_,E,I,z){switch(v){case Sn:if(h.byteLength!=p.byteLength||h.byteOffset!=p.byteOffset)return!1;h=h.buffer,p=p.buffer;case ar:return!(h.byteLength!=p.byteLength||!I(new Ip(h),new Ip(p)));case nn:case mn:case $t:return bs(+h,+p);case Se:return h.name==p.name&&h.message==p.message;case At:case or:return h==p+"";case Le:var K=Fl;case ut:var te=_&m;if(K||(K=Bl),h.size!=p.size&&!te)return!1;var pe=z.get(h);if(pe)return pe==p;_|=y,z.set(h,p);var ge=fS(K(h),K(p),_,E,I,z);return z.delete(h),ge;case ss:if(Tf)return Tf.call(h)==Tf.call(p)}return!1}function Z5(h,p,v,_,E,I){var z=v&m,K=Kv(h),te=K.length,pe=Kv(p),ge=pe.length;if(te!=ge&&!z)return!1;for(var ye=te;ye--;){var Ce=K[ye];if(!(z?Ce in p:lt.call(p,Ce)))return!1}var Fe=I.get(h),We=I.get(p);if(Fe&&We)return Fe==p&&We==h;var Ze=!0;I.set(h,p),I.set(p,h);for(var ze=z;++ye<te;){Ce=K[ye];var ot=h[Ce],ht=p[Ce];if(_)var mi=z?_(ht,ot,Ce,p,h,I):_(ot,ht,Ce,h,p,I);if(!(mi===t?ot===ht||E(ot,ht,v,_,I):mi)){Ze=!1;break}ze||(ze=Ce=="constructor")}if(Ze&&!ze){var Mr=h.constructor,vi=p.constructor;Mr!=vi&&"constructor"in h&&"constructor"in p&&!(typeof Mr=="function"&&Mr instanceof Mr&&typeof vi=="function"&&vi instanceof vi)&&(Ze=!1)}return I.delete(h),I.delete(p),Ze}function Po(h){return ny(vS(h,t,ES),h+"")}function Kv(h){return Mx(h,Fn,Zv)}function Jv(h){return Mx(h,Jr,hS)}var Yv=jp?function(h){return jp.get(h)}:gy;function e0(h){for(var p=h.name+"",v=jl[p],_=lt.call(jl,p)?v.length:0;_--;){var E=v[_],I=E.func;if(I==null||I==h)return E.name}return p}function Ul(h){var p=lt.call(M,"placeholder")?M:h;return p.placeholder}function $e(){var h=M.iteratee||dy;return h=h===dy?Ix:h,arguments.length?h(arguments[0],arguments[1]):h}function t0(h,p){var v=h.__data__;return oL(p)?v[typeof p=="string"?"string":"hash"]:v.map}function Xv(h){for(var p=Fn(h),v=p.length;v--;){var _=p[v],E=h[_];p[v]=[_,E,gS(E)]}return p}function wu(h,p){var v=wv(h,p);return Px(v)?v:t}function Q5(h){var p=lt.call(h,gu),v=h[gu];try{h[gu]=t;var _=!0}catch{}var E=Op.call(h);return _&&(p?h[gu]=v:delete h[gu]),E}var Zv=Cv?function(h){return h==null?[]:(h=ne(h),Ls(Cv(h),function(p){return yx.call(h,p)}))}:my,hS=Cv?function(h){for(var p=[];h;)Fs(p,Zv(h)),h=Lp(h);return p}:my,hr=Dr;(Ev&&hr(new Ev(new ArrayBuffer(1)))!=Sn||Rf&&hr(new Rf)!=Le||Rv&&hr(Rv.resolve())!=st||ql&&hr(new ql)!=ut||Af&&hr(new Af)!=Ur)&&(hr=function(h){var p=Dr(h),v=p==Yt?h.constructor:t,_=v?_u(v):"";if(_)switch(_){case LI:return Sn;case FI:return Le;case NI:return st;case BI:return ut;case qI:return Ur}return p});function eL(h,p,v){for(var _=-1,E=v.length;++_<E;){var I=v[_],z=I.size;switch(I.type){case"drop":h+=z;break;case"dropRight":p-=z;break;case"take":p=fr(p,h+z);break;case"takeRight":h=Dn(h,p-z);break}}return{start:h,end:p}}function tL(h){var p=h.match(Zt);return p?p[1].split(qe):[]}function dS(h,p,v){p=Ca(p,h);for(var _=-1,E=p.length,I=!1;++_<E;){var z=qs(p[_]);if(!(I=h!=null&&v(h,z)))break;h=h[z]}return I||++_!=E?I:(E=h==null?0:h.length,!!E&&u0(E)&&Io(z,E)&&(Ke(h)||ku(h)))}function nL(h){var p=h.length,v=new h.constructor(p);return p&&typeof h[0]=="string"&<.call(h,"index")&&(v.index=h.index,v.input=h.input),v}function pS(h){return typeof h.constructor=="function"&&!Nf(h)?$l(Lp(h)):{}}function rL(h,p,v){var _=h.constructor;switch(p){case ar:return Hv(h);case nn:case mn:return new _(+h);case Sn:return j5(h,v);case Dt:case os:case as:case Sr:case Ti:case us:case fi:case ls:case Ms:return Yx(h,v);case Le:return new _;case $t:case or:return new _(h);case At:return $5(h);case ut:return new _;case ss:return W5(h)}}function iL(h,p){var v=p.length;if(!v)return h;var _=v-1;return p[_]=(v>1?"& ":"")+p[_],p=p.join(v>2?", ":" "),h.replace(Xt,`{
|
|
45
|
-
/* [wrapped with `+p+`] */
|
|
46
|
-
`)}function sL(h){return Ke(h)||ku(h)||!!(bx&&h&&h[bx])}function Io(h,p){var v=typeof h;return p=p??be,!!p&&(v=="number"||v!="symbol"&&Ft.test(h))&&h>-1&&h%1==0&&h<p}function Tr(h,p,v){if(!on(v))return!1;var _=typeof p;return(_=="number"?Kr(v)&&Io(p,v.length):_=="string"&&p in v)?bs(v[p],h):!1}function Qv(h,p){if(Ke(h))return!1;var v=typeof h;return v=="number"||v=="symbol"||v=="boolean"||h==null||gi(h)?!0:Hr.test(h)||!Cr.test(h)||p!=null&&h in ne(p)}function oL(h){var p=typeof h;return p=="string"||p=="number"||p=="symbol"||p=="boolean"?h!=="__proto__":h===null}function ey(h){var p=e0(h),v=M[p];if(typeof v!="function"||!(p in ct.prototype))return!1;if(h===v)return!0;var _=Yv(v);return!!_&&h===_[0]}function aL(h){return!!Cf&&Cf in h}var uL=Ut?Lo:vy;function Nf(h){var p=h&&h.constructor,v=typeof p=="function"&&p.prototype||je;return h===v}function gS(h){return h===h&&!on(h)}function mS(h,p){return function(v){return v==null?!1:v[h]===p&&(p!==t||h in ne(v))}}function lL(h){var p=o0(h,function(_){return v.size===l&&v.clear(),_}),v=p.cache;return p}function cL(h,p){var v=h[1],_=p[1],E=v|_,I=E<(b|w|P),z=_==P&&v==k||_==P&&v==q&&h[7].length<=p[8]||_==(P|q)&&p[7].length<=p[8]&&v==k;if(!(I||z))return h;_&b&&(h[2]=p[2],E|=v&b?0:S);var K=p[3];if(K){var te=h[3];h[3]=te?Zx(te,K,p[4]):K,h[4]=te?vs(h[3],c):p[4]}return K=p[5],K&&(te=h[5],h[5]=te?Qx(te,K,p[6]):K,h[6]=te?vs(h[5],c):p[6]),K=p[7],K&&(h[7]=K),_&P&&(h[8]=h[8]==null?p[8]:fr(h[8],p[8])),h[9]==null&&(h[9]=p[9]),h[0]=p[0],h[1]=E,h}function fL(h){var p=[];if(h!=null)for(var v in ne(h))p.push(v);return p}function hL(h){return Op.call(h)}function vS(h,p,v){return p=Dn(p===t?h.length-1:p,0),function(){for(var _=arguments,E=-1,I=Dn(_.length-p,0),z=H(I);++E<I;)z[E]=_[p+E];E=-1;for(var K=H(p+1);++E<p;)K[E]=_[E];return K[p]=v(z),Er(h,this,K)}}function yS(h,p){return p.length<2?h:bu(h,Fi(p,0,-1))}function dL(h,p){for(var v=h.length,_=fr(p.length,v),E=Gr(h);_--;){var I=p[_];h[_]=Io(I,v)?E[I]:t}return h}function ty(h,p){if(!(p==="constructor"&&typeof h[p]=="function")&&p!="__proto__")return h[p]}var bS=_S(Wx),Bf=AI||function(h,p){return vn.setTimeout(h,p)},ny=_S(F5);function wS(h,p,v){var _=p+"";return ny(h,iL(_,pL(tL(_),v)))}function _S(h){var p=0,v=0;return function(){var _=OI(),E=A-(_-v);if(v=_,E>0){if(++p>=F)return arguments[0]}else p=0;return h.apply(t,arguments)}}function n0(h,p){var v=-1,_=h.length,E=_-1;for(p=p===t?_:p;++v<p;){var I=Bv(v,E),z=h[I];h[I]=h[v],h[v]=z}return h.length=p,h}var kS=lL(function(h){var p=[];return h.charCodeAt(0)===46&&p.push(""),h.replace(Eo,function(v,_,E,I){p.push(E?I.replace(ke,"$1"):_||v)}),p});function qs(h){if(typeof h=="string"||gi(h))return h;var p=h+"";return p=="0"&&1/h==-oe?"-0":p}function _u(h){if(h!=null){try{return yn.call(h)}catch{}try{return h+""}catch{}}return""}function pL(h,p){return cr(wt,function(v){var _="_."+v[0];p&v[1]&&!Ol(h,_)&&h.push(_)}),h.sort()}function xS(h){if(h instanceof ct)return h.clone();var p=new Ii(h.__wrapped__,h.__chain__);return p.__actions__=Gr(h.__actions__),p.__index__=h.__index__,p.__values__=h.__values__,p}function gL(h,p,v){(v?Tr(h,p,v):p===t)?p=1:p=Dn(Ye(p),0);var _=h==null?0:h.length;if(!_||p<1)return[];for(var E=0,I=0,z=H(Bp(_/p));E<_;)z[I++]=Fi(h,E,E+=p);return z}function mL(h){for(var p=-1,v=h==null?0:h.length,_=0,E=[];++p<v;){var I=h[p];I&&(E[_++]=I)}return E}function vL(){var h=arguments.length;if(!h)return[];for(var p=H(h-1),v=arguments[0],_=h;_--;)p[_-1]=arguments[_];return Fs(Ke(v)?Gr(v):[v],Vn(p,1))}var yL=Qe(function(h,p){return bn(h)?Of(h,Vn(p,1,bn,!0)):[]}),bL=Qe(function(h,p){var v=Ni(p);return bn(v)&&(v=t),bn(h)?Of(h,Vn(p,1,bn,!0),$e(v,2)):[]}),wL=Qe(function(h,p){var v=Ni(p);return bn(v)&&(v=t),bn(h)?Of(h,Vn(p,1,bn,!0),t,v):[]});function _L(h,p,v){var _=h==null?0:h.length;return _?(p=v||p===t?1:Ye(p),Fi(h,p<0?0:p,_)):[]}function kL(h,p,v){var _=h==null?0:h.length;return _?(p=v||p===t?1:Ye(p),p=_-p,Fi(h,0,p<0?0:p)):[]}function xL(h,p){return h&&h.length?Kp(h,$e(p,3),!0,!0):[]}function SL(h,p){return h&&h.length?Kp(h,$e(p,3),!0):[]}function CL(h,p,v,_){var E=h==null?0:h.length;return E?(v&&typeof v!="number"&&Tr(h,p,v)&&(v=0,_=E),v5(h,p,v,_)):[]}function SS(h,p,v){var _=h==null?0:h.length;if(!_)return-1;var E=v==null?0:Ye(v);return E<0&&(E=Dn(_+E,0)),di(h,$e(p,3),E)}function CS(h,p,v){var _=h==null?0:h.length;if(!_)return-1;var E=_-1;return v!==t&&(E=Ye(v),E=v<0?Dn(_+E,0):fr(E,_-1)),di(h,$e(p,3),E,!0)}function ES(h){var p=h==null?0:h.length;return p?Vn(h,1):[]}function EL(h){var p=h==null?0:h.length;return p?Vn(h,oe):[]}function RL(h,p){var v=h==null?0:h.length;return v?(p=p===t?1:Ye(p),Vn(h,p)):[]}function AL(h){for(var p=-1,v=h==null?0:h.length,_={};++p<v;){var E=h[p];_[E[0]]=E[1]}return _}function RS(h){return h&&h.length?h[0]:t}function DL(h,p,v){var _=h==null?0:h.length;if(!_)return-1;var E=v==null?0:Ye(v);return E<0&&(E=Dn(_+E,0)),Pi(h,p,E)}function TL(h){var p=h==null?0:h.length;return p?Fi(h,0,-1):[]}var ML=Qe(function(h){var p=Nt(h,zv);return p.length&&p[0]===h[0]?Pv(p):[]}),OL=Qe(function(h){var p=Ni(h),v=Nt(h,zv);return p===Ni(v)?p=t:v.pop(),v.length&&v[0]===h[0]?Pv(v,$e(p,2)):[]}),PL=Qe(function(h){var p=Ni(h),v=Nt(h,zv);return p=typeof p=="function"?p:t,p&&v.pop(),v.length&&v[0]===h[0]?Pv(v,t,p):[]});function IL(h,p){return h==null?"":TI.call(h,p)}function Ni(h){var p=h==null?0:h.length;return p?h[p-1]:t}function LL(h,p,v){var _=h==null?0:h.length;if(!_)return-1;var E=_;return v!==t&&(E=Ye(v),E=E<0?Dn(_+E,0):fr(E,_-1)),p===p?Sv(h,p,E):di(h,Ap,E,!0)}function FL(h,p){return h&&h.length?Bx(h,Ye(p)):t}var NL=Qe(AS);function AS(h,p){return h&&h.length&&p&&p.length?Nv(h,p):h}function BL(h,p,v){return h&&h.length&&p&&p.length?Nv(h,p,$e(v,2)):h}function qL(h,p,v){return h&&h.length&&p&&p.length?Nv(h,p,t,v):h}var jL=Po(function(h,p){var v=h==null?0:h.length,_=Dv(h,p);return $x(h,Nt(p,function(E){return Io(E,v)?+E:E}).sort(Xx)),_});function $L(h,p){var v=[];if(!(h&&h.length))return v;var _=-1,E=[],I=h.length;for(p=$e(p,3);++_<I;){var z=h[_];p(z,_,h)&&(v.push(z),E.push(_))}return $x(h,E),v}function ry(h){return h==null?h:II.call(h)}function WL(h,p,v){var _=h==null?0:h.length;return _?(v&&typeof v!="number"&&Tr(h,p,v)?(p=0,v=_):(p=p==null?0:Ye(p),v=v===t?_:Ye(v)),Fi(h,p,v)):[]}function zL(h,p){return Gp(h,p)}function UL(h,p,v){return jv(h,p,$e(v,2))}function HL(h,p){var v=h==null?0:h.length;if(v){var _=Gp(h,p);if(_<v&&bs(h[_],p))return _}return-1}function VL(h,p){return Gp(h,p,!0)}function GL(h,p,v){return jv(h,p,$e(v,2),!0)}function KL(h,p){var v=h==null?0:h.length;if(v){var _=Gp(h,p,!0)-1;if(bs(h[_],p))return _}return-1}function JL(h){return h&&h.length?zx(h):[]}function YL(h,p){return h&&h.length?zx(h,$e(p,2)):[]}function XL(h){var p=h==null?0:h.length;return p?Fi(h,1,p):[]}function ZL(h,p,v){return h&&h.length?(p=v||p===t?1:Ye(p),Fi(h,0,p<0?0:p)):[]}function QL(h,p,v){var _=h==null?0:h.length;return _?(p=v||p===t?1:Ye(p),p=_-p,Fi(h,p<0?0:p,_)):[]}function eF(h,p){return h&&h.length?Kp(h,$e(p,3),!1,!0):[]}function tF(h,p){return h&&h.length?Kp(h,$e(p,3)):[]}var nF=Qe(function(h){return Sa(Vn(h,1,bn,!0))}),rF=Qe(function(h){var p=Ni(h);return bn(p)&&(p=t),Sa(Vn(h,1,bn,!0),$e(p,2))}),iF=Qe(function(h){var p=Ni(h);return p=typeof p=="function"?p:t,Sa(Vn(h,1,bn,!0),t,p)});function sF(h){return h&&h.length?Sa(h):[]}function oF(h,p){return h&&h.length?Sa(h,$e(p,2)):[]}function aF(h,p){return p=typeof p=="function"?p:t,h&&h.length?Sa(h,t,p):[]}function iy(h){if(!(h&&h.length))return[];var p=0;return h=Ls(h,function(v){if(bn(v))return p=Dn(v.length,p),!0}),Il(p,function(v){return Nt(h,hu(v))})}function DS(h,p){if(!(h&&h.length))return[];var v=iy(h);return p==null?v:Nt(v,function(_){return Er(p,t,_)})}var uF=Qe(function(h,p){return bn(h)?Of(h,p):[]}),lF=Qe(function(h){return Wv(Ls(h,bn))}),cF=Qe(function(h){var p=Ni(h);return bn(p)&&(p=t),Wv(Ls(h,bn),$e(p,2))}),fF=Qe(function(h){var p=Ni(h);return p=typeof p=="function"?p:t,Wv(Ls(h,bn),t,p)}),hF=Qe(iy);function dF(h,p){return Gx(h||[],p||[],Mf)}function pF(h,p){return Gx(h||[],p||[],Lf)}var gF=Qe(function(h){var p=h.length,v=p>1?h[p-1]:t;return v=typeof v=="function"?(h.pop(),v):t,DS(h,v)});function TS(h){var p=M(h);return p.__chain__=!0,p}function mF(h,p){return p(h),h}function r0(h,p){return p(h)}var vF=Po(function(h){var p=h.length,v=p?h[0]:0,_=this.__wrapped__,E=function(I){return Dv(I,h)};return p>1||this.__actions__.length||!(_ instanceof ct)||!Io(v)?this.thru(E):(_=_.slice(v,+v+(p?1:0)),_.__actions__.push({func:r0,args:[E],thisArg:t}),new Ii(_,this.__chain__).thru(function(I){return p&&!I.length&&I.push(t),I}))});function yF(){return TS(this)}function bF(){return new Ii(this.value(),this.__chain__)}function wF(){this.__values__===t&&(this.__values__=US(this.value()));var h=this.__index__>=this.__values__.length,p=h?t:this.__values__[this.__index__++];return{done:h,value:p}}function _F(){return this}function kF(h){for(var p,v=this;v instanceof Wp;){var _=xS(v);_.__index__=0,_.__values__=t,p?E.__wrapped__=_:p=_;var E=_;v=v.__wrapped__}return E.__wrapped__=h,p}function xF(){var h=this.__wrapped__;if(h instanceof ct){var p=h;return this.__actions__.length&&(p=new ct(this)),p=p.reverse(),p.__actions__.push({func:r0,args:[ry],thisArg:t}),new Ii(p,this.__chain__)}return this.thru(ry)}function SF(){return Vx(this.__wrapped__,this.__actions__)}var CF=Jp(function(h,p,v){lt.call(h,v)?++h[v]:Mo(h,v,1)});function EF(h,p,v){var _=Ke(h)?pf:m5;return v&&Tr(h,p,v)&&(p=t),_(h,$e(p,3))}function RF(h,p){var v=Ke(h)?Ls:Dx;return v(h,$e(p,3))}var AF=rS(SS),DF=rS(CS);function TF(h,p){return Vn(i0(h,p),1)}function MF(h,p){return Vn(i0(h,p),oe)}function OF(h,p,v){return v=v===t?1:Ye(v),Vn(i0(h,p),v)}function MS(h,p){var v=Ke(h)?cr:xa;return v(h,$e(p,3))}function OS(h,p){var v=Ke(h)?pv:Ax;return v(h,$e(p,3))}var PF=Jp(function(h,p,v){lt.call(h,v)?h[v].push(p):Mo(h,v,[p])});function IF(h,p,v,_){h=Kr(h)?h:Vl(h),v=v&&!_?Ye(v):0;var E=h.length;return v<0&&(v=Dn(E+v,0)),l0(h)?v<=E&&h.indexOf(p,v)>-1:!!E&&Pi(h,p,v)>-1}var LF=Qe(function(h,p,v){var _=-1,E=typeof p=="function",I=Kr(h)?H(h.length):[];return xa(h,function(z){I[++_]=E?Er(p,z,v):Pf(z,p,v)}),I}),FF=Jp(function(h,p,v){Mo(h,v,p)});function i0(h,p){var v=Ke(h)?Nt:Lx;return v(h,$e(p,3))}function NF(h,p,v,_){return h==null?[]:(Ke(p)||(p=p==null?[]:[p]),v=_?t:v,Ke(v)||(v=v==null?[]:[v]),qx(h,p,v))}var BF=Jp(function(h,p,v){h[v?0:1].push(p)},function(){return[[],[]]});function qF(h,p,v){var _=Ke(h)?mf:du,E=arguments.length<3;return _(h,$e(p,4),v,E,xa)}function jF(h,p,v){var _=Ke(h)?Cp:du,E=arguments.length<3;return _(h,$e(p,4),v,E,Ax)}function $F(h,p){var v=Ke(h)?Ls:Dx;return v(h,a0($e(p,3)))}function WF(h){var p=Ke(h)?Sx:I5;return p(h)}function zF(h,p,v){(v?Tr(h,p,v):p===t)?p=1:p=Ye(p);var _=Ke(h)?f5:L5;return _(h,p)}function UF(h){var p=Ke(h)?h5:N5;return p(h)}function HF(h){if(h==null)return 0;if(Kr(h))return l0(h)?_a(h):h.length;var p=hr(h);return p==Le||p==ut?h.size:Lv(h).length}function VF(h,p,v){var _=Ke(h)?vf:B5;return v&&Tr(h,p,v)&&(p=t),_(h,$e(p,3))}var GF=Qe(function(h,p){if(h==null)return[];var v=p.length;return v>1&&Tr(h,p[0],p[1])?p=[]:v>2&&Tr(p[0],p[1],p[2])&&(p=[p[0]]),qx(h,Vn(p,1),[])}),s0=RI||function(){return vn.Date.now()};function KF(h,p){if(typeof p!="function")throw new Pe(o);return h=Ye(h),function(){if(--h<1)return p.apply(this,arguments)}}function PS(h,p,v){return p=v?t:p,p=h&&p==null?h.length:p,Oo(h,P,t,t,t,t,p)}function IS(h,p){var v;if(typeof p!="function")throw new Pe(o);return h=Ye(h),function(){return--h>0&&(v=p.apply(this,arguments)),h<=1&&(p=t),v}}var sy=Qe(function(h,p,v){var _=b;if(v.length){var E=vs(v,Ul(sy));_|=C}return Oo(h,_,p,v,E)}),LS=Qe(function(h,p,v){var _=b|w;if(v.length){var E=vs(v,Ul(LS));_|=C}return Oo(p,_,h,v,E)});function FS(h,p,v){p=v?t:p;var _=Oo(h,k,t,t,t,t,t,p);return _.placeholder=FS.placeholder,_}function NS(h,p,v){p=v?t:p;var _=Oo(h,x,t,t,t,t,t,p);return _.placeholder=NS.placeholder,_}function BS(h,p,v){var _,E,I,z,K,te,pe=0,ge=!1,ye=!1,Ce=!0;if(typeof h!="function")throw new Pe(o);p=Bi(p)||0,on(v)&&(ge=!!v.leading,ye="maxWait"in v,I=ye?Dn(Bi(v.maxWait)||0,p):I,Ce="trailing"in v?!!v.trailing:Ce);function Fe(wn){var ws=_,No=E;return _=E=t,pe=wn,z=h.apply(No,ws),z}function We(wn){return pe=wn,K=Bf(ot,p),ge?Fe(wn):z}function Ze(wn){var ws=wn-te,No=wn-pe,rC=p-ws;return ye?fr(rC,I-No):rC}function ze(wn){var ws=wn-te,No=wn-pe;return te===t||ws>=p||ws<0||ye&&No>=I}function ot(){var wn=s0();if(ze(wn))return ht(wn);K=Bf(ot,Ze(wn))}function ht(wn){return K=t,Ce&&_?Fe(wn):(_=E=t,z)}function mi(){K!==t&&Kx(K),pe=0,_=te=E=K=t}function Mr(){return K===t?z:ht(s0())}function vi(){var wn=s0(),ws=ze(wn);if(_=arguments,E=this,te=wn,ws){if(K===t)return We(te);if(ye)return Kx(K),K=Bf(ot,p),Fe(te)}return K===t&&(K=Bf(ot,p)),z}return vi.cancel=mi,vi.flush=Mr,vi}var JF=Qe(function(h,p){return Rx(h,1,p)}),YF=Qe(function(h,p,v){return Rx(h,Bi(p)||0,v)});function XF(h){return Oo(h,B)}function o0(h,p){if(typeof h!="function"||p!=null&&typeof p!="function")throw new Pe(o);var v=function(){var _=arguments,E=p?p.apply(this,_):_[0],I=v.cache;if(I.has(E))return I.get(E);var z=h.apply(this,_);return v.cache=I.set(E,z)||I,z};return v.cache=new(o0.Cache||To),v}o0.Cache=To;function a0(h){if(typeof h!="function")throw new Pe(o);return function(){var p=arguments;switch(p.length){case 0:return!h.call(this);case 1:return!h.call(this,p[0]);case 2:return!h.call(this,p[0],p[1]);case 3:return!h.call(this,p[0],p[1],p[2])}return!h.apply(this,p)}}function ZF(h){return IS(2,h)}var QF=q5(function(h,p){p=p.length==1&&Ke(p[0])?Nt(p[0],Rr($e())):Nt(Vn(p,1),Rr($e()));var v=p.length;return Qe(function(_){for(var E=-1,I=fr(_.length,v);++E<I;)_[E]=p[E].call(this,_[E]);return Er(h,this,_)})}),oy=Qe(function(h,p){var v=vs(p,Ul(oy));return Oo(h,C,t,p,v)}),qS=Qe(function(h,p){var v=vs(p,Ul(qS));return Oo(h,R,t,p,v)}),e9=Po(function(h,p){return Oo(h,q,t,t,t,p)});function t9(h,p){if(typeof h!="function")throw new Pe(o);return p=p===t?p:Ye(p),Qe(h,p)}function n9(h,p){if(typeof h!="function")throw new Pe(o);return p=p==null?0:Dn(Ye(p),0),Qe(function(v){var _=v[p],E=Ea(v,0,p);return _&&Fs(E,_),Er(h,this,E)})}function r9(h,p,v){var _=!0,E=!0;if(typeof h!="function")throw new Pe(o);return on(v)&&(_="leading"in v?!!v.leading:_,E="trailing"in v?!!v.trailing:E),BS(h,p,{leading:_,maxWait:p,trailing:E})}function i9(h){return PS(h,1)}function s9(h,p){return oy(Uv(p),h)}function o9(){if(!arguments.length)return[];var h=arguments[0];return Ke(h)?h:[h]}function a9(h){return Li(h,g)}function u9(h,p){return p=typeof p=="function"?p:t,Li(h,g,p)}function l9(h){return Li(h,f|g)}function c9(h,p){return p=typeof p=="function"?p:t,Li(h,f|g,p)}function f9(h,p){return p==null||Ex(h,p,Fn(p))}function bs(h,p){return h===p||h!==h&&p!==p}var h9=Qp(Ov),d9=Qp(function(h,p){return h>=p}),ku=Ox(function(){return arguments}())?Ox:function(h){return dn(h)&<.call(h,"callee")&&!yx.call(h,"callee")},Ke=H.isArray,p9=xp?Rr(xp):k5;function Kr(h){return h!=null&&u0(h.length)&&!Lo(h)}function bn(h){return dn(h)&&Kr(h)}function g9(h){return h===!0||h===!1||dn(h)&&Dr(h)==nn}var Ra=DI||vy,m9=ff?Rr(ff):x5;function v9(h){return dn(h)&&h.nodeType===1&&!qf(h)}function y9(h){if(h==null)return!0;if(Kr(h)&&(Ke(h)||typeof h=="string"||typeof h.splice=="function"||Ra(h)||Hl(h)||ku(h)))return!h.length;var p=hr(h);if(p==Le||p==ut)return!h.size;if(Nf(h))return!Lv(h).length;for(var v in h)if(lt.call(h,v))return!1;return!0}function b9(h,p){return If(h,p)}function w9(h,p,v){v=typeof v=="function"?v:t;var _=v?v(h,p):t;return _===t?If(h,p,t,v):!!_}function ay(h){if(!dn(h))return!1;var p=Dr(h);return p==Se||p==Pt||typeof h.message=="string"&&typeof h.name=="string"&&!qf(h)}function _9(h){return typeof h=="number"&&wx(h)}function Lo(h){if(!on(h))return!1;var p=Dr(h);return p==Je||p==An||p==In||p==Ln}function jS(h){return typeof h=="number"&&h==Ye(h)}function u0(h){return typeof h=="number"&&h>-1&&h%1==0&&h<=be}function on(h){var p=typeof h;return h!=null&&(p=="object"||p=="function")}function dn(h){return h!=null&&typeof h=="object"}var $S=hf?Rr(hf):C5;function k9(h,p){return h===p||Iv(h,p,Xv(p))}function x9(h,p,v){return v=typeof v=="function"?v:t,Iv(h,p,Xv(p),v)}function S9(h){return WS(h)&&h!=+h}function C9(h){if(uL(h))throw new _e(s);return Px(h)}function E9(h){return h===null}function R9(h){return h==null}function WS(h){return typeof h=="number"||dn(h)&&Dr(h)==$t}function qf(h){if(!dn(h)||Dr(h)!=Yt)return!1;var p=Lp(h);if(p===null)return!0;var v=lt.call(p,"constructor")&&p.constructor;return typeof v=="function"&&v instanceof v&&yn.call(v)==xI}var uy=df?Rr(df):E5;function A9(h){return jS(h)&&h>=-be&&h<=be}var zS=ya?Rr(ya):R5;function l0(h){return typeof h=="string"||!Ke(h)&&dn(h)&&Dr(h)==or}function gi(h){return typeof h=="symbol"||dn(h)&&Dr(h)==ss}var Hl=ba?Rr(ba):A5;function D9(h){return h===t}function T9(h){return dn(h)&&hr(h)==Ur}function M9(h){return dn(h)&&Dr(h)==Ts}var O9=Qp(Fv),P9=Qp(function(h,p){return h<=p});function US(h){if(!h)return[];if(Kr(h))return l0(h)?Ar(h):Gr(h);if(Ef&&h[Ef])return Ll(h[Ef]());var p=hr(h),v=p==Le?Fl:p==ut?Bl:Vl;return v(h)}function Fo(h){if(!h)return h===0?h:0;if(h=Bi(h),h===oe||h===-oe){var p=h<0?-1:1;return p*ve}return h===h?h:0}function Ye(h){var p=Fo(h),v=p%1;return p===p?v?p-v:p:0}function HS(h){return h?yu(Ye(h),0,we):0}function Bi(h){if(typeof h=="number")return h;if(gi(h))return De;if(on(h)){var p=typeof h.valueOf=="function"?h.valueOf():h;h=on(p)?p+"":p}if(typeof h!="string")return h===0?h:+h;h=Dp(h);var v=Wt.test(h);return v||nt.test(h)?va(h.slice(2),v?2:8):bt.test(h)?De:+h}function VS(h){return Bs(h,Jr(h))}function I9(h){return h?yu(Ye(h),-be,be):h===0?h:0}function kt(h){return h==null?"":pi(h)}var L9=Wl(function(h,p){if(Nf(p)||Kr(p)){Bs(p,Fn(p),h);return}for(var v in p)lt.call(p,v)&&Mf(h,v,p[v])}),GS=Wl(function(h,p){Bs(p,Jr(p),h)}),c0=Wl(function(h,p,v,_){Bs(p,Jr(p),h,_)}),F9=Wl(function(h,p,v,_){Bs(p,Fn(p),h,_)}),N9=Po(Dv);function B9(h,p){var v=$l(h);return p==null?v:Cx(v,p)}var q9=Qe(function(h,p){h=ne(h);var v=-1,_=p.length,E=_>2?p[2]:t;for(E&&Tr(p[0],p[1],E)&&(_=1);++v<_;)for(var I=p[v],z=Jr(I),K=-1,te=z.length;++K<te;){var pe=z[K],ge=h[pe];(ge===t||bs(ge,je[pe])&&!lt.call(h,pe))&&(h[pe]=I[pe])}return h}),j9=Qe(function(h){return h.push(t,cS),Er(KS,t,h)});function $9(h,p){return Rp(h,$e(p,3),Ns)}function W9(h,p){return Rp(h,$e(p,3),Mv)}function z9(h,p){return h==null?h:Tv(h,$e(p,3),Jr)}function U9(h,p){return h==null?h:Tx(h,$e(p,3),Jr)}function H9(h,p){return h&&Ns(h,$e(p,3))}function V9(h,p){return h&&Mv(h,$e(p,3))}function G9(h){return h==null?[]:Hp(h,Fn(h))}function K9(h){return h==null?[]:Hp(h,Jr(h))}function ly(h,p,v){var _=h==null?t:bu(h,p);return _===t?v:_}function J9(h,p){return h!=null&&dS(h,p,y5)}function cy(h,p){return h!=null&&dS(h,p,b5)}var Y9=sS(function(h,p,v){p!=null&&typeof p.toString!="function"&&(p=Op.call(p)),h[p]=v},hy(Yr)),X9=sS(function(h,p,v){p!=null&&typeof p.toString!="function"&&(p=Op.call(p)),lt.call(h,p)?h[p].push(v):h[p]=[v]},$e),Z9=Qe(Pf);function Fn(h){return Kr(h)?xx(h):Lv(h)}function Jr(h){return Kr(h)?xx(h,!0):D5(h)}function Q9(h,p){var v={};return p=$e(p,3),Ns(h,function(_,E,I){Mo(v,p(_,E,I),_)}),v}function eN(h,p){var v={};return p=$e(p,3),Ns(h,function(_,E,I){Mo(v,E,p(_,E,I))}),v}var tN=Wl(function(h,p,v){Vp(h,p,v)}),KS=Wl(function(h,p,v,_){Vp(h,p,v,_)}),nN=Po(function(h,p){var v={};if(h==null)return v;var _=!1;p=Nt(p,function(I){return I=Ca(I,h),_||(_=I.length>1),I}),Bs(h,Jv(h),v),_&&(v=Li(v,f|d|g,Y5));for(var E=p.length;E--;)$v(v,p[E]);return v});function rN(h,p){return JS(h,a0($e(p)))}var iN=Po(function(h,p){return h==null?{}:M5(h,p)});function JS(h,p){if(h==null)return{};var v=Nt(Jv(h),function(_){return[_]});return p=$e(p),jx(h,v,function(_,E){return p(_,E[0])})}function sN(h,p,v){p=Ca(p,h);var _=-1,E=p.length;for(E||(E=1,h=t);++_<E;){var I=h==null?t:h[qs(p[_])];I===t&&(_=E,I=v),h=Lo(I)?I.call(h):I}return h}function oN(h,p,v){return h==null?h:Lf(h,p,v)}function aN(h,p,v,_){return _=typeof _=="function"?_:t,h==null?h:Lf(h,p,v,_)}var YS=uS(Fn),XS=uS(Jr);function uN(h,p,v){var _=Ke(h),E=_||Ra(h)||Hl(h);if(p=$e(p,4),v==null){var I=h&&h.constructor;E?v=_?new I:[]:on(h)?v=Lo(I)?$l(Lp(h)):{}:v={}}return(E?cr:Ns)(h,function(z,K,te){return p(v,z,K,te)}),v}function lN(h,p){return h==null?!0:$v(h,p)}function cN(h,p,v){return h==null?h:Hx(h,p,Uv(v))}function fN(h,p,v,_){return _=typeof _=="function"?_:t,h==null?h:Hx(h,p,Uv(v),_)}function Vl(h){return h==null?[]:_f(h,Fn(h))}function hN(h){return h==null?[]:_f(h,Jr(h))}function dN(h,p,v){return v===t&&(v=p,p=t),v!==t&&(v=Bi(v),v=v===v?v:0),p!==t&&(p=Bi(p),p=p===p?p:0),yu(Bi(h),p,v)}function pN(h,p,v){return p=Fo(p),v===t?(v=p,p=0):v=Fo(v),h=Bi(h),w5(h,p,v)}function gN(h,p,v){if(v&&typeof v!="boolean"&&Tr(h,p,v)&&(p=v=t),v===t&&(typeof p=="boolean"?(v=p,p=t):typeof h=="boolean"&&(v=h,h=t)),h===t&&p===t?(h=0,p=1):(h=Fo(h),p===t?(p=h,h=0):p=Fo(p)),h>p){var _=h;h=p,p=_}if(v||h%1||p%1){var E=_x();return fr(h+E*(p-h+hi("1e-"+((E+"").length-1))),p)}return Bv(h,p)}var mN=zl(function(h,p,v){return p=p.toLowerCase(),h+(v?ZS(p):p)});function ZS(h){return fy(kt(h).toLowerCase())}function QS(h){return h=kt(h),h&&h.replace(rt,bv).replace(_p,"")}function vN(h,p,v){h=kt(h),p=pi(p);var _=h.length;v=v===t?_:yu(Ye(v),0,_);var E=v;return v-=p.length,v>=0&&h.slice(v,E)==p}function yN(h){return h=kt(h),h&&fs.test(h)?h.replace(Os,xf):h}function bN(h){return h=kt(h),h&&Oi.test(h)?h.replace(Mi,"\\$&"):h}var wN=zl(function(h,p,v){return h+(v?"-":"")+p.toLowerCase()}),_N=zl(function(h,p,v){return h+(v?" ":"")+p.toLowerCase()}),kN=nS("toLowerCase");function xN(h,p,v){h=kt(h),p=Ye(p);var _=p?_a(h):0;if(!p||_>=p)return h;var E=(p-_)/2;return Zp(qp(E),v)+h+Zp(Bp(E),v)}function SN(h,p,v){h=kt(h),p=Ye(p);var _=p?_a(h):0;return p&&_<p?h+Zp(p-_,v):h}function CN(h,p,v){h=kt(h),p=Ye(p);var _=p?_a(h):0;return p&&_<p?Zp(p-_,v)+h:h}function EN(h,p,v){return v||p==null?p=0:p&&(p=+p),PI(kt(h).replace(ds,""),p||0)}function RN(h,p,v){return(v?Tr(h,p,v):p===t)?p=1:p=Ye(p),qv(kt(h),p)}function AN(){var h=arguments,p=kt(h[0]);return h.length<3?p:p.replace(h[1],h[2])}var DN=zl(function(h,p,v){return h+(v?"_":"")+p.toLowerCase()});function TN(h,p,v){return v&&typeof v!="number"&&Tr(h,p,v)&&(p=v=t),v=v===t?we:v>>>0,v?(h=kt(h),h&&(typeof p=="string"||p!=null&&!uy(p))&&(p=pi(p),!p&&wa(h))?Ea(Ar(h),0,v):h.split(p,v)):[]}var MN=zl(function(h,p,v){return h+(v?" ":"")+fy(p)});function ON(h,p,v){return h=kt(h),v=v==null?0:yu(Ye(v),0,h.length),p=pi(p),h.slice(v,v+p.length)==p}function PN(h,p,v){var _=M.templateSettings;v&&Tr(h,p,v)&&(p=t),h=kt(h),p=c0({},p,_,lS);var E=c0({},p.imports,_.imports,lS),I=Fn(E),z=_f(E,I),K,te,pe=0,ge=p.interpolate||zt,ye="__p += '",Ce=le((p.escape||zt).source+"|"+ge.source+"|"+(ge===Co?Oe:zt).source+"|"+(p.evaluate||zt).source+"|$","g"),Fe="//# sourceURL="+(lt.call(p,"sourceURL")?(p.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Is+"]")+`
|
|
47
|
-
`;h.replace(Ce,function(ze,ot,ht,mi,Mr,vi){return ht||(ht=mi),ye+=h.slice(pe,vi).replace(sn,Sf),ot&&(K=!0,ye+=`' +
|
|
48
|
-
__e(`+ot+`) +
|
|
49
|
-
'`),Mr&&(te=!0,ye+=`';
|
|
50
|
-
`+Mr+`;
|
|
51
|
-
__p += '`),ht&&(ye+=`' +
|
|
52
|
-
((__t = (`+ht+`)) == null ? '' : __t) +
|
|
53
|
-
'`),pe=vi+ze.length,ze}),ye+=`';
|
|
54
|
-
`;var We=lt.call(p,"variable")&&p.variable;if(!We)ye=`with (obj) {
|
|
55
|
-
`+ye+`
|
|
56
|
-
}
|
|
57
|
-
`;else if(de.test(We))throw new _e(a);ye=(te?ye.replace(ko,""):ye).replace(ga,"$1").replace(xo,"$1;"),ye="function("+(We||"obj")+`) {
|
|
58
|
-
`+(We?"":`obj || (obj = {});
|
|
59
|
-
`)+"var __t, __p = ''"+(K?", __e = _.escape":"")+(te?`, __j = Array.prototype.join;
|
|
60
|
-
function print() { __p += __j.call(arguments, '') }
|
|
61
|
-
`:`;
|
|
62
|
-
`)+ye+`return __p
|
|
63
|
-
}`;var Ze=tC(function(){return $(I,Fe+"return "+ye).apply(t,z)});if(Ze.source=ye,ay(Ze))throw Ze;return Ze}function IN(h){return kt(h).toLowerCase()}function LN(h){return kt(h).toUpperCase()}function FN(h,p,v){if(h=kt(h),h&&(v||p===t))return Dp(h);if(!h||!(p=pi(p)))return h;var _=Ar(h),E=Ar(p),I=kf(_,E),z=Tp(_,E)+1;return Ea(_,I,z).join("")}function NN(h,p,v){if(h=kt(h),h&&(v||p===t))return h.slice(0,Mp(h)+1);if(!h||!(p=pi(p)))return h;var _=Ar(h),E=Tp(_,Ar(p))+1;return Ea(_,0,E).join("")}function BN(h,p,v){if(h=kt(h),h&&(v||p===t))return h.replace(ds,"");if(!h||!(p=pi(p)))return h;var _=Ar(h),E=kf(_,Ar(p));return Ea(_,E).join("")}function qN(h,p){var v=G,_=V;if(on(p)){var E="separator"in p?p.separator:E;v="length"in p?Ye(p.length):v,_="omission"in p?pi(p.omission):_}h=kt(h);var I=h.length;if(wa(h)){var z=Ar(h);I=z.length}if(v>=I)return h;var K=v-_a(_);if(K<1)return _;var te=z?Ea(z,0,K).join(""):h.slice(0,K);if(E===t)return te+_;if(z&&(K+=te.length-K),uy(E)){if(h.slice(K).search(E)){var pe,ge=te;for(E.global||(E=le(E.source,kt(_t.exec(E))+"g")),E.lastIndex=0;pe=E.exec(ge);)var ye=pe.index;te=te.slice(0,ye===t?K:ye)}}else if(h.indexOf(pi(E),K)!=K){var Ce=te.lastIndexOf(E);Ce>-1&&(te=te.slice(0,Ce))}return te+_}function jN(h){return h=kt(h),h&&cs.test(h)?h.replace(ur,D):h}var $N=zl(function(h,p,v){return h+(v?" ":"")+p.toUpperCase()}),fy=nS("toUpperCase");function eC(h,p,v){return h=kt(h),p=v?t:p,p===t?_v(h)?J(h):mv(h):h.match(p)||[]}var tC=Qe(function(h,p){try{return Er(h,t,p)}catch(v){return ay(v)?v:new _e(v)}}),WN=Po(function(h,p){return cr(p,function(v){v=qs(v),Mo(h,v,sy(h[v],h))}),h});function zN(h){var p=h==null?0:h.length,v=$e();return h=p?Nt(h,function(_){if(typeof _[1]!="function")throw new Pe(o);return[v(_[0]),_[1]]}):[],Qe(function(_){for(var E=-1;++E<p;){var I=h[E];if(Er(I[0],this,_))return Er(I[1],this,_)}})}function UN(h){return g5(Li(h,f))}function hy(h){return function(){return h}}function HN(h,p){return h==null||h!==h?p:h}var VN=iS(),GN=iS(!0);function Yr(h){return h}function dy(h){return Ix(typeof h=="function"?h:Li(h,f))}function KN(h){return Fx(Li(h,f))}function JN(h,p){return Nx(h,Li(p,f))}var YN=Qe(function(h,p){return function(v){return Pf(v,h,p)}}),XN=Qe(function(h,p){return function(v){return Pf(h,v,p)}});function py(h,p,v){var _=Fn(p),E=Hp(p,_);v==null&&!(on(p)&&(E.length||!_.length))&&(v=p,p=h,h=this,E=Hp(p,Fn(p)));var I=!(on(v)&&"chain"in v)||!!v.chain,z=Lo(h);return cr(E,function(K){var te=p[K];h[K]=te,z&&(h.prototype[K]=function(){var pe=this.__chain__;if(I||pe){var ge=h(this.__wrapped__),ye=ge.__actions__=Gr(this.__actions__);return ye.push({func:te,args:arguments,thisArg:h}),ge.__chain__=pe,ge}return te.apply(h,Fs([this.value()],arguments))})}),h}function ZN(){return vn._===this&&(vn._=SI),this}function gy(){}function QN(h){return h=Ye(h),Qe(function(p){return Bx(p,h)})}var e7=Vv(Nt),t7=Vv(pf),n7=Vv(vf);function nC(h){return Qv(h)?hu(qs(h)):O5(h)}function r7(h){return function(p){return h==null?t:bu(h,p)}}var i7=oS(),s7=oS(!0);function my(){return[]}function vy(){return!1}function o7(){return{}}function a7(){return""}function u7(){return!0}function l7(h,p){if(h=Ye(h),h<1||h>be)return[];var v=we,_=fr(h,we);p=$e(p),h-=we;for(var E=Il(_,p);++v<h;)p(v);return E}function c7(h){return Ke(h)?Nt(h,qs):gi(h)?[h]:Gr(kS(kt(h)))}function f7(h){var p=++Ao;return kt(h)+p}var h7=Xp(function(h,p){return h+p},0),d7=Gv("ceil"),p7=Xp(function(h,p){return h/p},1),g7=Gv("floor");function m7(h){return h&&h.length?Up(h,Yr,Ov):t}function v7(h,p){return h&&h.length?Up(h,$e(p,2),Ov):t}function y7(h){return yf(h,Yr)}function b7(h,p){return yf(h,$e(p,2))}function w7(h){return h&&h.length?Up(h,Yr,Fv):t}function _7(h,p){return h&&h.length?Up(h,$e(p,2),Fv):t}var k7=Xp(function(h,p){return h*p},1),x7=Gv("round"),S7=Xp(function(h,p){return h-p},0);function C7(h){return h&&h.length?bf(h,Yr):0}function E7(h,p){return h&&h.length?bf(h,$e(p,2)):0}return M.after=KF,M.ary=PS,M.assign=L9,M.assignIn=GS,M.assignInWith=c0,M.assignWith=F9,M.at=N9,M.before=IS,M.bind=sy,M.bindAll=WN,M.bindKey=LS,M.castArray=o9,M.chain=TS,M.chunk=gL,M.compact=mL,M.concat=vL,M.cond=zN,M.conforms=UN,M.constant=hy,M.countBy=CF,M.create=B9,M.curry=FS,M.curryRight=NS,M.debounce=BS,M.defaults=q9,M.defaultsDeep=j9,M.defer=JF,M.delay=YF,M.difference=yL,M.differenceBy=bL,M.differenceWith=wL,M.drop=_L,M.dropRight=kL,M.dropRightWhile=xL,M.dropWhile=SL,M.fill=CL,M.filter=RF,M.flatMap=TF,M.flatMapDeep=MF,M.flatMapDepth=OF,M.flatten=ES,M.flattenDeep=EL,M.flattenDepth=RL,M.flip=XF,M.flow=VN,M.flowRight=GN,M.fromPairs=AL,M.functions=G9,M.functionsIn=K9,M.groupBy=PF,M.initial=TL,M.intersection=ML,M.intersectionBy=OL,M.intersectionWith=PL,M.invert=Y9,M.invertBy=X9,M.invokeMap=LF,M.iteratee=dy,M.keyBy=FF,M.keys=Fn,M.keysIn=Jr,M.map=i0,M.mapKeys=Q9,M.mapValues=eN,M.matches=KN,M.matchesProperty=JN,M.memoize=o0,M.merge=tN,M.mergeWith=KS,M.method=YN,M.methodOf=XN,M.mixin=py,M.negate=a0,M.nthArg=QN,M.omit=nN,M.omitBy=rN,M.once=ZF,M.orderBy=NF,M.over=e7,M.overArgs=QF,M.overEvery=t7,M.overSome=n7,M.partial=oy,M.partialRight=qS,M.partition=BF,M.pick=iN,M.pickBy=JS,M.property=nC,M.propertyOf=r7,M.pull=NL,M.pullAll=AS,M.pullAllBy=BL,M.pullAllWith=qL,M.pullAt=jL,M.range=i7,M.rangeRight=s7,M.rearg=e9,M.reject=$F,M.remove=$L,M.rest=t9,M.reverse=ry,M.sampleSize=zF,M.set=oN,M.setWith=aN,M.shuffle=UF,M.slice=WL,M.sortBy=GF,M.sortedUniq=JL,M.sortedUniqBy=YL,M.split=TN,M.spread=n9,M.tail=XL,M.take=ZL,M.takeRight=QL,M.takeRightWhile=eF,M.takeWhile=tF,M.tap=mF,M.throttle=r9,M.thru=r0,M.toArray=US,M.toPairs=YS,M.toPairsIn=XS,M.toPath=c7,M.toPlainObject=VS,M.transform=uN,M.unary=i9,M.union=nF,M.unionBy=rF,M.unionWith=iF,M.uniq=sF,M.uniqBy=oF,M.uniqWith=aF,M.unset=lN,M.unzip=iy,M.unzipWith=DS,M.update=cN,M.updateWith=fN,M.values=Vl,M.valuesIn=hN,M.without=uF,M.words=eC,M.wrap=s9,M.xor=lF,M.xorBy=cF,M.xorWith=fF,M.zip=hF,M.zipObject=dF,M.zipObjectDeep=pF,M.zipWith=gF,M.entries=YS,M.entriesIn=XS,M.extend=GS,M.extendWith=c0,py(M,M),M.add=h7,M.attempt=tC,M.camelCase=mN,M.capitalize=ZS,M.ceil=d7,M.clamp=dN,M.clone=a9,M.cloneDeep=l9,M.cloneDeepWith=c9,M.cloneWith=u9,M.conformsTo=f9,M.deburr=QS,M.defaultTo=HN,M.divide=p7,M.endsWith=vN,M.eq=bs,M.escape=yN,M.escapeRegExp=bN,M.every=EF,M.find=AF,M.findIndex=SS,M.findKey=$9,M.findLast=DF,M.findLastIndex=CS,M.findLastKey=W9,M.floor=g7,M.forEach=MS,M.forEachRight=OS,M.forIn=z9,M.forInRight=U9,M.forOwn=H9,M.forOwnRight=V9,M.get=ly,M.gt=h9,M.gte=d9,M.has=J9,M.hasIn=cy,M.head=RS,M.identity=Yr,M.includes=IF,M.indexOf=DL,M.inRange=pN,M.invoke=Z9,M.isArguments=ku,M.isArray=Ke,M.isArrayBuffer=p9,M.isArrayLike=Kr,M.isArrayLikeObject=bn,M.isBoolean=g9,M.isBuffer=Ra,M.isDate=m9,M.isElement=v9,M.isEmpty=y9,M.isEqual=b9,M.isEqualWith=w9,M.isError=ay,M.isFinite=_9,M.isFunction=Lo,M.isInteger=jS,M.isLength=u0,M.isMap=$S,M.isMatch=k9,M.isMatchWith=x9,M.isNaN=S9,M.isNative=C9,M.isNil=R9,M.isNull=E9,M.isNumber=WS,M.isObject=on,M.isObjectLike=dn,M.isPlainObject=qf,M.isRegExp=uy,M.isSafeInteger=A9,M.isSet=zS,M.isString=l0,M.isSymbol=gi,M.isTypedArray=Hl,M.isUndefined=D9,M.isWeakMap=T9,M.isWeakSet=M9,M.join=IL,M.kebabCase=wN,M.last=Ni,M.lastIndexOf=LL,M.lowerCase=_N,M.lowerFirst=kN,M.lt=O9,M.lte=P9,M.max=m7,M.maxBy=v7,M.mean=y7,M.meanBy=b7,M.min=w7,M.minBy=_7,M.stubArray=my,M.stubFalse=vy,M.stubObject=o7,M.stubString=a7,M.stubTrue=u7,M.multiply=k7,M.nth=FL,M.noConflict=ZN,M.noop=gy,M.now=s0,M.pad=xN,M.padEnd=SN,M.padStart=CN,M.parseInt=EN,M.random=gN,M.reduce=qF,M.reduceRight=jF,M.repeat=RN,M.replace=AN,M.result=sN,M.round=x7,M.runInContext=T,M.sample=WF,M.size=HF,M.snakeCase=DN,M.some=VF,M.sortedIndex=zL,M.sortedIndexBy=UL,M.sortedIndexOf=HL,M.sortedLastIndex=VL,M.sortedLastIndexBy=GL,M.sortedLastIndexOf=KL,M.startCase=MN,M.startsWith=ON,M.subtract=S7,M.sum=C7,M.sumBy=E7,M.template=PN,M.times=l7,M.toFinite=Fo,M.toInteger=Ye,M.toLength=HS,M.toLower=IN,M.toNumber=Bi,M.toSafeInteger=I9,M.toString=kt,M.toUpper=LN,M.trim=FN,M.trimEnd=NN,M.trimStart=BN,M.truncate=qN,M.unescape=jN,M.uniqueId=f7,M.upperCase=$N,M.upperFirst=fy,M.each=MS,M.eachRight=OS,M.first=RS,py(M,function(){var h={};return Ns(M,function(p,v){lt.call(M.prototype,v)||(h[v]=p)}),h}(),{chain:!1}),M.VERSION=r,cr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(h){M[h].placeholder=M}),cr(["drop","take"],function(h,p){ct.prototype[h]=function(v){v=v===t?1:Dn(Ye(v),0);var _=this.__filtered__&&!p?new ct(this):this.clone();return _.__filtered__?_.__takeCount__=fr(v,_.__takeCount__):_.__views__.push({size:fr(v,we),type:h+(_.__dir__<0?"Right":"")}),_},ct.prototype[h+"Right"]=function(v){return this.reverse()[h](v).reverse()}}),cr(["filter","map","takeWhile"],function(h,p){var v=p+1,_=v==Y||v==ee;ct.prototype[h]=function(E){var I=this.clone();return I.__iteratees__.push({iteratee:$e(E,3),type:v}),I.__filtered__=I.__filtered__||_,I}}),cr(["head","last"],function(h,p){var v="take"+(p?"Right":"");ct.prototype[h]=function(){return this[v](1).value()[0]}}),cr(["initial","tail"],function(h,p){var v="drop"+(p?"":"Right");ct.prototype[h]=function(){return this.__filtered__?new ct(this):this[v](1)}}),ct.prototype.compact=function(){return this.filter(Yr)},ct.prototype.find=function(h){return this.filter(h).head()},ct.prototype.findLast=function(h){return this.reverse().find(h)},ct.prototype.invokeMap=Qe(function(h,p){return typeof h=="function"?new ct(this):this.map(function(v){return Pf(v,h,p)})}),ct.prototype.reject=function(h){return this.filter(a0($e(h)))},ct.prototype.slice=function(h,p){h=Ye(h);var v=this;return v.__filtered__&&(h>0||p<0)?new ct(v):(h<0?v=v.takeRight(-h):h&&(v=v.drop(h)),p!==t&&(p=Ye(p),v=p<0?v.dropRight(-p):v.take(p-h)),v)},ct.prototype.takeRightWhile=function(h){return this.reverse().takeWhile(h).reverse()},ct.prototype.toArray=function(){return this.take(we)},Ns(ct.prototype,function(h,p){var v=/^(?:filter|find|map|reject)|While$/.test(p),_=/^(?:head|last)$/.test(p),E=M[_?"take"+(p=="last"?"Right":""):p],I=_||/^find/.test(p);E&&(M.prototype[p]=function(){var z=this.__wrapped__,K=_?[1]:arguments,te=z instanceof ct,pe=K[0],ge=te||Ke(z),ye=function(ot){var ht=E.apply(M,Fs([ot],K));return _&&Ce?ht[0]:ht};ge&&v&&typeof pe=="function"&&pe.length!=1&&(te=ge=!1);var Ce=this.__chain__,Fe=!!this.__actions__.length,We=I&&!Ce,Ze=te&&!Fe;if(!I&&ge){z=Ze?z:new ct(this);var ze=h.apply(z,K);return ze.__actions__.push({func:r0,args:[ye],thisArg:t}),new Ii(ze,Ce)}return We&&Ze?h.apply(this,K):(ze=this.thru(ye),We?_?ze.value()[0]:ze.value():ze)})}),cr(["pop","push","shift","sort","splice","unshift"],function(h){var p=Ue[h],v=/^(?:push|sort|unshift)$/.test(h)?"tap":"thru",_=/^(?:pop|shift)$/.test(h);M.prototype[h]=function(){var E=arguments;if(_&&!this.__chain__){var I=this.value();return p.apply(Ke(I)?I:[],E)}return this[v](function(z){return p.apply(Ke(z)?z:[],E)})}}),Ns(ct.prototype,function(h,p){var v=M[p];if(v){var _=v.name+"";lt.call(jl,_)||(jl[_]=[]),jl[_].push({name:p,func:v})}}),jl[Yp(t,w).name]=[{name:"wrapper",func:t}],ct.prototype.clone=jI,ct.prototype.reverse=$I,ct.prototype.value=WI,M.prototype.at=vF,M.prototype.chain=yF,M.prototype.commit=bF,M.prototype.next=wF,M.prototype.plant=kF,M.prototype.reverse=xF,M.prototype.toJSON=M.prototype.valueOf=M.prototype.value=SF,M.prototype.first=M.prototype.head,Ef&&(M.prototype[Ef]=_F),M},X=Z();ms?((ms.exports=X)._=X,Tl._=X):vn._=X}).call(dH)}(Uh,Uh.exports)),Uh.exports}var gH=pH();const mH=Re.theme({"&:not(.cm-focused)":{"& .cm-activeLine, & .cm-activeLineGutter":{color:"inherit",backgroundColor:"transparent"}},".cm-toolbar-input":{fontFamily:"var(--cm-font-family)",lineHeight:1.4,border:"none",background:"transparent",outline:"none",fontSize:"16px",color:"var(--cm-toolbar-color)",padding:"0 2px 0 6px",width:"100%",flex:1},".cm-toolbar-input-container":{position:"relative",display:"flex",alignItems:"center",flex:1},".cm-toolbar-panel":{padding:0,background:"var(--cm-toolbar-background)",display:"flex",alignItems:"center"},".cm-command-result > span":{color:"var(--cm-command-result-color)"},".cm-search-result":{color:"var(--cm-search-result-color)",display:"flex",cursor:"pointer","&.cm-command-result":{color:"var(--cm-command-result-color)"},"& > .cm-search-result-icon-container":{width:"var(--cm-gutter-width)","& > .cm-search-result-icon":{fontSize:"16px",textAlign:"right",boxSizing:"border-box",padding:"0 3px 0 5px",width:"var(--cm-gutter-lineno-width)"}},"&:hover":{"& div":{color:"var(--cm-search-result-color-hover)"},backgroundColor:"var(--cm-search-result-bg-hover)"},"&.selected":{"& div":{color:"var(--cm-search-result-color-selected)"},backgroundColor:"var(--cm-search-result-select-bg)"},"& > .cm-search-result-label":{flex:1,padding:"0 2px 0 6px"}},".cm-toolbar-state-icon-container":{width:"var(--cm-gutter-width)"},".cm-toolbar-state-icon":{fontSize:"16px",textAlign:"right",boxSizing:"border-box",padding:"0 3px 0 5px",color:"var(--cm-foreground)",width:"var(--cm-gutter-lineno-width)"},".cm-content":{padding:0},".cm-tooltip":{display:"flex",flexDirection:"column",fontFamily:"var(--cm-font-family)",boxShadow:"-12px 12px 1px rgba(0,0,0,0.3)",fontSize:"1rem",maxWidth:"min(calc(100% - 2rem), 62ch)",border:"2px solid var(--cm-tooltip-border)",overflow:"auto",background:"var(--cm-tooltip-background)",color:"var(--cm-tooltip-color)"},".cm-tooltip a":{color:"var(--cm-link)"},".cm-tooltip-section:not(:first-child)":{borderTop:"none"},".cm-tooltip-lint":{order:-1},".cm-diagnostic":{padding:"3px 6px",whiteSpace:"pre-wrap",marginLeft:0,borderLeft:"none"},".cm-diagnostic-info":{backgroundColor:"var(--cm-diagnostic-info-bg)",color:"var(--cm-diagnostic-info-color)"},".cm-diagnostic-error":{borderLeft:"none",backgroundColor:"var(--cm-diagnostic-error-bg)",color:"var(--cm-diagnostic-error-color)"},".cm-diagnosticSource":{display:"none"},".documentation":{padding:"2px"},".documentation > *":{margin:0,padding:"0.25rem 6px",fontSize:"1rem"},".documentation > p > code":{backgroundColor:"var(--cm-comment-bg)",padding:"2px 4px",margin:"2px 0",display:"inline-block"},".documentation > pre > code":{whiteSpace:"break-spaces"},".cm-diagnosticAction":{display:"none"},".cm-diagnosticText div":{display:"flex",height:"fit-content"},".cm-diagnosticText p":{margin:0},".cm-search-results":{position:"absolute",top:"100%",margin:0,padding:0,background:"var(--cm-toolbar-background)",fontFamily:"var(--cm-font-family)",fontSize:"1rem",listStyleType:"none",width:"100%",maxHeight:"25vh",overflowY:"auto"},".cm-gutters":{borderRight:"none"},".cm-panels-top":{borderBottom:"none"}}),vH=1024;let yH=0,Vi=class{constructor(e,t){this.from=e,this.to=t}};class it{constructor(e={}){this.id=yH++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=jr.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}it.closedBy=new it({deserialize:n=>n.split(" ")});it.openedBy=new it({deserialize:n=>n.split(" ")});it.group=new it({deserialize:n=>n.split(" ")});it.isolate=new it({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});it.contextHash=new it({perNode:!0});it.lookAhead=new it({perNode:!0});it.mounted=new it({perNode:!0});class yd{constructor(e,t,r){this.tree=e,this.overlay=t,this.parser=r}static get(e){return e&&e.props&&e.props[it.mounted.id]}}const bH=Object.create(null);class jr{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):bH,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new jr(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(it.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(it.group),s=-1;s<(i?i.length:0);s++){let o=t[s<0?r.name:i[s]];if(o)return o}}}}jr.none=new jr("",Object.create(null),0,8);class mk{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);o&&(i||(i=Object.assign({},r.props)),i[o[0].id]=o[1])}t.push(i?new jr(r.name,i,r.id,r.flags):r)}return new mk(t)}}const B0=new WeakMap,n3=new WeakMap;var cn;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays"})(cn||(cn={}));class Vt{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=yd.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 Im(this.topNode,e)}cursorAt(e,t=0,r=0){let i=B0.get(this)||this.topNode,s=new Im(i);return s.moveTo(e,t),B0.set(this,s._tree),s}get topNode(){return new yr(this,0,0,null)}resolve(e,t=0){let r=bd(B0.get(this)||this.topNode,e,t,!1);return B0.set(this,r),r}resolveInner(e,t=0){let r=bd(n3.get(this)||this.topNode,e,t,!0);return n3.set(this,r),r}resolveStack(e,t=0){return kH(this,e,t)}iterate(e){let{enter:t,leave:r,from:i=0,to:s=this.length}=e,o=e.mode||0,a=(o&cn.IncludeAnonymous)>0;for(let u=this.cursor(o|cn.IncludeAnonymous);;){let l=!1;if(u.from<=s&&u.to>=i&&(!a&&u.type.isAnonymous||t(u)!==!1)){if(u.firstChild())continue;l=!0}for(;l&&r&&(a||!u.type.isAnonymous)&&r(u),!u.nextSibling();){if(!u.parent())return;l=!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:bk(jr.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,i)=>new Vt(this.type,t,r,i,this.propValues),e.makeTree||((t,r,i)=>new Vt(jr.none,t,r,i)))}static build(e){return xH(e)}}Vt.empty=new Vt(jr.none,[],[],0);class vk{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 vk(this.buffer,this.index)}}class tu{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return jr.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 u=e;u!=t&&!(WO(s,i,o[u+1],o[u+2])&&(a=u,r>0));u=o[u+3]);return a}slice(e,t,r){let i=this.buffer,s=new Uint16Array(t-e),o=0;for(let a=e,u=0;a<t;){s[u++]=i[a++],s[u++]=i[a++]-r;let l=s[u++]=i[a++]-r;s[u++]=i[a++]-e,o=Math.max(o,l)}return new tu(s,o,this.set)}}function WO(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 bd(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 yr&&n.index<0?null:n.parent;if(!o)return n;n=o}let s=r?0:cn.IgnoreOverlays;if(r)for(let o=n,a=o.parent;a;o=a,a=o.parent)o instanceof yr&&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 zO{cursor(e=0){return new Im(this,e)}getChild(e,t=null,r=null){let i=r3(this,e,t,r);return i.length?i[0]:null}getChildren(e,t=null,r=null){return r3(this,e,t,r)}resolve(e,t=0){return bd(this,e,t,!1)}resolveInner(e,t=0){return bd(this,e,t,!0)}matchContext(e){return Yw(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 yr extends zO{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:u}=o._tree,l=t>0?a.length:-1;e!=l;e+=t){let c=a[e],f=u[e]+o.from;if(WO(i,r,f,f+c.length)){if(c instanceof tu){if(s&cn.ExcludeBuffers)continue;let d=c.findChild(0,c.buffer.length,t,r-f,i);if(d>-1)return new io(new wH(o,c,e,f),null,d)}else if(s&cn.IncludeAnonymous||!c.type.isAnonymous||yk(c)){let d;if(!(s&cn.IgnoreMounts)&&(d=yd.get(c))&&!d.overlay)return new yr(d.tree,f,e,o);let g=new yr(c,f,e,o);return s&cn.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(t<0?c.children.length-1:0,t,r,i)}}}if(s&cn.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)}enter(e,t,r=0){let i;if(!(r&cn.IgnoreOverlays)&&(i=yd.get(this._tree))&&i.overlay){let s=e-this.from;for(let{from:o,to:a}of i.overlay)if((t>0?o<=s:o<s)&&(t<0?a>=s:a>s))return new yr(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 r3(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 Yw(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 wH{constructor(e,t,r,i){this.parent=e,this.buffer=t,this.index=r,this.start=i}}class io extends zO{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 io(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)}enter(e,t,r=0){if(r&cn.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 io(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 io(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 io(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 Vt(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function UO(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 yr&&t.index<0?null:t.parent,i=n.slice();return r?i[e]=r:i.splice(e,1),new _H(i,t)}class _H{constructor(e,t){this.heads=e,this.node=t}get next(){return UO(this.heads)}}function kH(n,e,t){let r=n.resolveInner(e,t),i=null;for(let s=r instanceof yr?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=yd.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let a=new yr(o.tree,o.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(bd(a,e,t,!1))}}return i?UO(i):r}class Im{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof yr)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 yr?(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&cn.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&cn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&cn.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&cn.IncludeAnonymous||a instanceof tu||!a.type.isAnonymous||yk(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 io(this.buffer,t,this.stack[i]);return this.bufferNode=new io(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 Yw(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 Yw(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 yk(n){return n.children.some(e=>e instanceof tu||!e.type.isAnonymous||yk(e))}function xH(n){var e;let{buffer:t,nodeSet:r,maxBufferLength:i=vH,reused:s=[],minRepeatType:o=r.types.length}=n,a=Array.isArray(t)?new vk(t,t.length):t,u=r.types,l=0,c=0;function f(C,R,P,q,B,G){let{id:V,start:F,end:A,size:Y}=a,N=c,ee=l;for(;Y<0;)if(a.next(),Y==-1){let we=s[V];P.push(we),q.push(F-C);return}else if(Y==-3){l=V;return}else if(Y==-4){c=V;return}else throw new RangeError(`Unrecognized record size: ${Y}`);let oe=u[V],be,ve,De=F-C;if(A-F<=i&&(ve=b(a.pos-R,B))){let we=new Uint16Array(ve.size-ve.skip),Ie=a.pos-ve.size,Rt=we.length;for(;a.pos>Ie;)Rt=w(ve.start,we,Rt);be=new tu(we,A-ve.start,r),De=ve.start-C}else{let we=a.pos-Y;a.next();let Ie=[],Rt=[],wt=V>=o?V:-1,tt=0,Jt=A;for(;a.pos>we;)wt>=0&&a.id==wt&&a.size>=0?(a.end<=Jt-i&&(m(Ie,Rt,F,tt,a.end,Jt,wt,N,ee),tt=Ie.length,Jt=a.end),a.next()):G>2500?d(F,we,Ie,Rt):f(F,we,Ie,Rt,wt,G+1);if(wt>=0&&tt>0&&tt<Ie.length&&m(Ie,Rt,F,tt,F,Jt,wt,N,ee),Ie.reverse(),Rt.reverse(),wt>-1&&tt>0){let In=g(oe,ee);be=bk(oe,Ie,Rt,0,Ie.length,0,A-F,In,In)}else be=y(oe,Ie,Rt,A-F,N-A,ee)}P.push(be),q.push(De)}function d(C,R,P,q){let B=[],G=0,V=-1;for(;a.pos>R;){let{id:F,start:A,end:Y,size:N}=a;if(N>4)a.next();else{if(V>-1&&A<V)break;V<0&&(V=Y-i),B.push(F,A,Y),G++,a.next()}}if(G){let F=new Uint16Array(G*4),A=B[B.length-2];for(let Y=B.length-3,N=0;Y>=0;Y-=3)F[N++]=B[Y],F[N++]=B[Y+1]-A,F[N++]=B[Y+2]-A,F[N++]=N;P.push(new tu(F,B[2]-A,r)),q.push(A-C)}}function g(C,R){return(P,q,B)=>{let G=0,V=P.length-1,F,A;if(V>=0&&(F=P[V])instanceof Vt){if(!V&&F.type==C&&F.length==B)return F;(A=F.prop(it.lookAhead))&&(G=q[V]+F.length+A)}return y(C,P,q,B,G,R)}}function m(C,R,P,q,B,G,V,F,A){let Y=[],N=[];for(;C.length>q;)Y.push(C.pop()),N.push(R.pop()+P-B);C.push(y(r.types[V],Y,N,G-B,F-G,A)),R.push(B-P)}function y(C,R,P,q,B,G,V){if(G){let F=[it.contextHash,G];V=V?[F].concat(V):[F]}if(B>25){let F=[it.lookAhead,B];V=V?[F].concat(V):[F]}return new Vt(C,R,P,q,V)}function b(C,R){let P=a.fork(),q=0,B=0,G=0,V=P.end-i,F={size:0,start:0,skip:0};e:for(let A=P.pos-C;P.pos>A;){let Y=P.size;if(P.id==R&&Y>=0){F.size=q,F.start=B,F.skip=G,G+=4,q+=4,P.next();continue}let N=P.pos-Y;if(Y<0||N<A||P.start<V)break;let ee=P.id>=o?4:0,oe=P.start;for(P.next();P.pos>N;){if(P.size<0)if(P.size==-3)ee+=4;else break e;else P.id>=o&&(ee+=4);P.next()}B=oe,q+=Y,G+=ee}return(R<0||q==C)&&(F.size=q,F.start=B,F.skip=G),F.size>4?F:void 0}function w(C,R,P){let{id:q,start:B,end:G,size:V}=a;if(a.next(),V>=0&&q<o){let F=P;if(V>4){let A=a.pos-(V-4);for(;a.pos>A;)P=w(C,R,P)}R[--P]=F,R[--P]=G-C,R[--P]=B-C,R[--P]=q}else V==-3?l=q:V==-4&&(c=q);return P}let S=[],k=[];for(;a.pos>0;)f(n.start||0,n.bufferStart||0,S,k,-1,0);let x=(e=n.length)!==null&&e!==void 0?e:S.length?k[0]+S[0].length:0;return new Vt(u[n.topID],S.reverse(),k.reverse(),x)}const i3=new WeakMap;function fm(n,e){if(!n.isAnonymous||e instanceof tu||e.type!=n)return 1;let t=i3.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=n||!(r instanceof Vt)){t=1;break}t+=fm(n,r)}i3.set(e,t)}return t}function bk(n,e,t,r,i,s,o,a,u){let l=0;for(let m=r;m<i;m++)l+=fm(n,e[m]);let c=Math.ceil(l*1.5/8),f=[],d=[];function g(m,y,b,w,S){for(let k=b;k<w;){let x=k,C=y[k],R=fm(n,m[k]);for(k++;k<w;k++){let P=fm(n,m[k]);if(R+P>=c)break;R+=P}if(k==x+1){if(R>c){let P=m[x];g(P.children,P.positions,0,P.children.length,y[x]+S);continue}f.push(m[x])}else{let P=y[k-1]+m[k-1].length-C;f.push(bk(n,m,y,x,k,C,P,null,u))}d.push(C+S-s)}}return g(e,t,r,i,0),(a||u)(f,d,o)}class Ere{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 io?this.setBuffer(e.context.buffer,e.index,t):e instanceof yr&&this.map.set(e.tree,t)}get(e){return e instanceof io?this.getBuffer(e.context.buffer,e.index):e instanceof yr?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 ea{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 ea(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,u=0,l=0;;a++){let c=a<t.length?t[a]:null,f=c?c.fromA:1e9;if(f-u>=r)for(;o&&o.from<f;){let d=o;if(u>=d.from||f<=d.to||l){let g=Math.max(d.from,u)-l,m=Math.min(d.to,f)-l;d=g>=m?null:new ea(g,m,d.tree,d.offset+l,a>0,!!c)}if(d&&i.push(d),o.to>f)break;o=s<e.length?e[s++]:null}if(!c)break;u=c.toA,l=c.toA-c.toB}return i}}class HO{startParse(e,t,r){return typeof e=="string"&&(e=new SH(e)),r=r?r.length?r.map(i=>new Vi(i.from,i.to)):[new Vi(0,0)]:[new Vi(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 SH{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 Rre(n){return(e,t,r,i)=>new EH(e,n,t,r,i)}class s3{constructor(e,t,r,i,s){this.parser=e,this.parse=t,this.overlay=r,this.target=i,this.from=s}}function o3(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class CH{constructor(e,t,r,i,s,o,a){this.parser=e,this.predicate=t,this.mounts=r,this.index=i,this.start=s,this.target=o,this.prev=a,this.depth=0,this.ranges=[]}}const Xw=new it({perNode:!0});class EH{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 Vt(r.type,r.children,r.positions,r.length,r.propValues.concat([[Xw,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[it.mounted.id]=new yd(t,e.overlay,e.parser),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 DH(this.fragments),t=null,r=null,i=new Im(new yr(this.baseTree,this.ranges[0].from,0,null),cn.IncludeAnonymous|cn.IgnoreMounts);e:for(let s,o;;){let a=!0,u;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)a=!1;else if(e.hasNode(i)){if(t){let l=t.mounts.find(c=>c.frag.from<=i.from&&c.frag.to>=i.to&&c.mount.overlay);if(l)for(let c of l.mount.overlay){let f=c.from+l.pos,d=c.to+l.pos;f>=i.from&&d<=i.to&&!t.ranges.some(g=>g.from<d&&g.to>f)&&t.ranges.push({from:f,to:d})}}a=!1}else if(r&&(o=RH(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||AH(i);let l=e.findMounts(i.from,s.parser);if(typeof s.overlay=="function")t=new CH(s.parser,s.overlay,l,this.inner.length,i.from,i.tree,t);else{let c=l3(this.ranges,s.overlay||(i.from<i.to?[new Vi(i.from,i.to)]:[]));c.length&&o3(c),(c.length||!s.overlay)&&this.inner.push(new s3(s.parser,c.length?s.parser.startParse(this.input,c3(l,c),c):s.parser.startParse(""),s.overlay?s.overlay.map(f=>new Vi(f.from-i.from,f.to-i.from)):null,i.tree,c.length?c[0].from:i.from)),s.overlay?c.length&&(r={ranges:c,depth:0,prev:r}):a=!1}}else if(t&&(u=t.predicate(i))&&(u===!0&&(u=new Vi(i.from,i.to)),u.from<u.to)){let l=t.ranges.length-1;l>=0&&t.ranges[l].to==u.from?t.ranges[l]={from:t.ranges[l].from,to:u.to}:t.ranges.push(u)}if(a&&i.firstChild())t&&t.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(t&&!--t.depth){let l=l3(this.ranges,t.ranges);l.length&&(o3(l),this.inner.splice(t.index,0,new s3(t.parser,t.parser.startParse(this.input,c3(t.mounts,l),l),t.ranges.map(c=>new Vi(c.from-t.start,c.to-t.start)),t.target,l[0].from))),t=t.prev}r&&!--r.depth&&(r=r.prev)}}}}function RH(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 a3(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 AH(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,u=[s];function l(c,f,d,g,m,y){let b=t[y],w=[],S=[];a3(o,c,b,w,S,g);let k=a[b+1],x=a[b+2];u.push(w.length);let C=y?l(b+4,a[b+3],o.set.types[a[b]],k,x-k,y-1):e.toTree();return w.push(C),S.push(k-g),a3(o,a[b+3],f,w,S,g),new Vt(d,w,S,m)}i.children[s]=l(0,a.length,jr.none,0,o.length,t.length-1);for(let c of u){let f=n.tree.children[c],d=n.tree.positions[c];n.yield(new yr(f,d+n.from,c,n._tree))}}class u3{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(cn.IncludeAnonymous|cn.IgnoreMounts)}moveTo(e){let{cursor:t}=this,r=e-this.offset;for(;!this.done&&t.from<r;)t.to>=e&&t.enter(r,1,cn.IgnoreOverlays|cn.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof Vt)t=t.children[0];else break}return!1}}class DH{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(Xw))!==null&&t!==void 0?t:r.to,this.inner=new u3(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(Xw))!==null&&e!==void 0?e:t.to,this.inner=new u3(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(it.mounted);if(o&&o.parser==t)for(let a=this.fragI;a<this.fragments.length;a++){let u=this.fragments[a];if(u.from>=s.to)break;u.tree==this.curFrag.tree&&i.push({frag:u,pos:s.from-u.offset,mount:o})}}}return i}}function l3(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 u=r[s];if(u.from>=a)break;u.to<=o||(t||(r=t=e.slice()),u.from<o?(t[s]=new Vi(u.from,o),u.to>a&&t.splice(s+1,0,new Vi(a,u.to))):u.to>a?t[s--]=new Vi(a,u.to):t.splice(s--,1))}}return r}function TH(n,e,t,r){let i=0,s=0,o=!1,a=!1,u=-1e9,l=[];for(;;){let c=i==n.length?1e9:o?n[i].to:n[i].from,f=s==e.length?1e9:a?e[s].to:e[s].from;if(o!=a){let d=Math.max(u,t),g=Math.min(c,f,r);d<g&&l.push(new Vi(d,g))}if(u=Math.min(c,f),u==1e9)break;c==u&&(o?(o=!1,i++):o=!0),f==u&&(a?(a=!1,s++):a=!0)}return l}function c3(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,u=Math.max(s.from,o),l=Math.min(s.to,a);if(i.overlay){let c=i.overlay.map(d=>new Vi(d.from+r,d.to+r)),f=TH(e,c,u,l);for(let d=0,g=u;;d++){let m=d==f.length,y=m?l:f[d].from;if(y>g&&t.push(new ea(g,y,i.tree,-o,s.from>=g||s.openStart,s.to<=y||s.openEnd)),m)break;g=f[d].to}}else t.push(new ea(u,l,i.tree,-o,s.from>=o||s.openStart,s.to<=a||s.openEnd))}return t}let MH=0;class Ui{constructor(e,t,r,i){this.name=e,this.set=t,this.base=r,this.modified=i,this.id=MH++}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 Ui&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let i=new Ui(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 Lm(e);return r=>r.modified.indexOf(t)>-1?r:Lm.get(r.base||r,r.modified.concat(t).sort((i,s)=>i.id-s.id))}}let OH=0;class Lm{constructor(e){this.name=e,this.instances=[],this.id=OH++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(a=>a.base==e&&PH(t,a.modified));if(r)return r;let i=[],s=new Ui(e.name,i,e,t);for(let a of t)a.instances.push(s);let o=IH(t);for(let a of e.set)if(!a.modified.length)for(let u of o)i.push(Lm.get(a,u));return s}}function PH(n,e){return n.length==e.length&&n.every((t,r)=>t==e[r])}function IH(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 LH(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 f=0;;){if(a=="..."&&f>0&&f+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]),f+=d[0].length,f==i.length)break;let g=i[f++];if(f==i.length&&g=="!"){o=0;break}if(g!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let u=s.length-1,l=s[u];if(!l)throw new RangeError("Invalid path: "+i);let c=new Fm(r,o,u>0?s.slice(0,u):null);e[l]=c.sort(e[l])}}return VO.add(e)}const VO=new it;class Fm{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}}Fm.empty=new Fm([],2,null);function GO(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 u of a.set){let l=t[u.id];if(l){o=o?o+" "+l:l;break}}return o},scope:r}}function FH(n,e){let t=null;for(let r of n){let i=r.style(e);i&&(t=t?t+" "+i:i)}return t}function KO(n,e,t,r=0,i=n.length){let s=new BH(r,Array.isArray(e)?e:[e],t);s.highlightRange(n.cursor(),r,i,"",s.highlighters),s.flush(i)}function NH(n,e,t,r,i,s=0,o=n.length){let a=s;function u(l,c){if(!(l<=a)){for(let f=n.slice(a,l),d=0;;){let g=f.indexOf(`
|
|
64
|
-
`,d),m=g<0?f.length:g;if(m>d&&r(f.slice(d,m),c),g<0)break;i(),d=g+1}a=l}}KO(e,t,(l,c,f)=>{u(l,""),u(c,f)},s,o),u(o,"")}class BH{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:u}=e;if(a>=r||u<=t)return;o.isTop&&(s=this.highlighters.filter(g=>!g.scope||g.scope(o)));let l=i,c=qH(e)||Fm.empty,f=FH(s,c.tags);if(f&&(l&&(l+=" "),l+=f,c.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(t,a),l),c.opaque)return;let d=e.tree&&e.tree.prop(it.mounted);if(d&&d.overlay){let g=e.node.enter(d.overlay[0].from+a,1),m=this.highlighters.filter(b=>!b.scope||b.scope(d.tree.type)),y=e.firstChild();for(let b=0,w=a;;b++){let S=b<d.overlay.length?d.overlay[b]:null,k=S?S.from+a:u,x=Math.max(t,w),C=Math.min(r,k);if(x<C&&y)for(;e.from<C&&(this.highlightRange(e,x,C,i,s),this.startSpan(Math.min(C,e.to),l),!(e.to>=k||!e.nextSibling())););if(!S||k>r)break;w=S.to+a,w>t&&(this.highlightRange(g.cursor(),Math.max(t,S.from+a),Math.min(r,w),"",m),this.startSpan(Math.min(r,w),l))}y&&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),l)}while(e.nextSibling());e.parent()}}}function qH(n){let e=n.type.prop(VO);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const xe=Ui.define,q0=xe(),Oa=xe(),f3=xe(Oa),h3=xe(Oa),Pa=xe(),j0=xe(Pa),sb=xe(Pa),Gs=xe(),Su=xe(Gs),$s=xe(),Ws=xe(),Zw=xe(),Gf=xe(Zw),$0=xe(),se={comment:q0,lineComment:xe(q0),blockComment:xe(q0),docComment:xe(q0),name:Oa,variableName:xe(Oa),typeName:f3,tagName:xe(f3),propertyName:h3,attributeName:xe(h3),className:xe(Oa),labelName:xe(Oa),namespace:xe(Oa),macroName:xe(Oa),literal:Pa,string:j0,docString:xe(j0),character:xe(j0),attributeValue:xe(j0),number:sb,integer:xe(sb),float:xe(sb),bool:xe(Pa),regexp:xe(Pa),escape:xe(Pa),color:xe(Pa),url:xe(Pa),keyword:$s,self:xe($s),null:xe($s),atom:xe($s),unit:xe($s),modifier:xe($s),operatorKeyword:xe($s),controlKeyword:xe($s),definitionKeyword:xe($s),moduleKeyword:xe($s),operator:Ws,derefOperator:xe(Ws),arithmeticOperator:xe(Ws),logicOperator:xe(Ws),bitwiseOperator:xe(Ws),compareOperator:xe(Ws),updateOperator:xe(Ws),definitionOperator:xe(Ws),typeOperator:xe(Ws),controlOperator:xe(Ws),punctuation:Zw,separator:xe(Zw),bracket:Gf,angleBracket:xe(Gf),squareBracket:xe(Gf),paren:xe(Gf),brace:xe(Gf),content:Gs,heading:Su,heading1:xe(Su),heading2:xe(Su),heading3:xe(Su),heading4:xe(Su),heading5:xe(Su),heading6:xe(Su),contentSeparator:xe(Gs),list:xe(Gs),quote:xe(Gs),emphasis:xe(Gs),strong:xe(Gs),link:xe(Gs),monospace:xe(Gs),strikethrough:xe(Gs),inserted:xe(),deleted:xe(),changed:xe(),invalid:xe(),meta:$0,documentMeta:xe($0),annotation:xe($0),processingInstruction:xe($0),definition:Ui.defineModifier("definition"),constant:Ui.defineModifier("constant"),function:Ui.defineModifier("function"),standard:Ui.defineModifier("standard"),local:Ui.defineModifier("local"),special:Ui.defineModifier("special")};for(let n in se){let e=se[n];e instanceof Ui&&(e.name=n)}GO([{tag:se.link,class:"tok-link"},{tag:se.heading,class:"tok-heading"},{tag:se.emphasis,class:"tok-emphasis"},{tag:se.strong,class:"tok-strong"},{tag:se.keyword,class:"tok-keyword"},{tag:se.atom,class:"tok-atom"},{tag:se.bool,class:"tok-bool"},{tag:se.url,class:"tok-url"},{tag:se.labelName,class:"tok-labelName"},{tag:se.inserted,class:"tok-inserted"},{tag:se.deleted,class:"tok-deleted"},{tag:se.literal,class:"tok-literal"},{tag:se.string,class:"tok-string"},{tag:se.number,class:"tok-number"},{tag:[se.regexp,se.escape,se.special(se.string)],class:"tok-string2"},{tag:se.variableName,class:"tok-variableName"},{tag:se.local(se.variableName),class:"tok-variableName tok-local"},{tag:se.definition(se.variableName),class:"tok-variableName tok-definition"},{tag:se.special(se.variableName),class:"tok-variableName2"},{tag:se.definition(se.propertyName),class:"tok-propertyName tok-definition"},{tag:se.typeName,class:"tok-typeName"},{tag:se.namespace,class:"tok-namespace"},{tag:se.className,class:"tok-className"},{tag:se.macroName,class:"tok-macroName"},{tag:se.propertyName,class:"tok-propertyName"},{tag:se.operator,class:"tok-operator"},{tag:se.comment,class:"tok-comment"},{tag:se.meta,class:"tok-meta"},{tag:se.invalid,class:"tok-invalid"},{tag:se.punctuation,class:"tok-punctuation"}]);var ob;const Ju=new it;function JO(n){return Ae.define({combine:n?e=>e.concat(n):void 0})}const jH=new it;class Gi{constructor(e,t,r=[],i=""){this.data=e,this.name=i,dt.prototype.hasOwnProperty("tree")||Object.defineProperty(dt.prototype,"tree",{get(){return ir(this)}}),this.parser=t,this.extension=[nu.of(this),dt.languageData.of((s,o,a)=>{let u=d3(s,o,a),l=u.type.prop(Ju);if(!l)return[];let c=s.facet(l),f=u.type.prop(jH);if(f){let d=u.resolve(o-u.from,a);for(let g of f)if(g.test(d,s)){let m=s.facet(g.facet);return g.type=="replace"?m:m.concat(c)}}return c})].concat(r)}isActiveAt(e,t,r=-1){return d3(e,t,r).type.prop(Ju)==this.data}findRegions(e){let t=e.facet(nu);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(Ju)==this.data){r.push({from:o,to:o+s.length});return}let a=s.prop(it.mounted);if(a){if(a.tree.prop(Ju)==this.data){if(a.overlay)for(let u of a.overlay)r.push({from:u.from+o,to:u.to+o});else r.push({from:o,to:o+s.length});return}else if(a.overlay){let u=r.length;if(i(a.tree,a.overlay[0].from+o),r.length>u)return}}for(let u=0;u<s.children.length;u++){let l=s.children[u];l instanceof Vt&&i(l,s.positions[u]+o)}};return i(ir(e),0),r}get allowsNesting(){return!0}}Gi.setState=He.define();function d3(n,e,t){let r=n.facet(nu),i=ir(n).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,t,cn.ExcludeBuffers))s.type.isTop&&(i=s);return i}class Qw extends Gi{constructor(e,t,r){super(e,t,[],r),this.parser=t}static define(e){let t=JO(e.languageData);return new Qw(t,e.parser.configure({props:[Ju.add(r=>r.isTop?t:void 0)]}),e.name)}configure(e,t){return new Qw(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ir(n){let e=n.field(Gi.state,!1);return e?e.tree:Vt.empty}class $H{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 Kf=null;class Cc{constructor(e,t,r=[],i,s,o,a,u){this.parser=e,this.state=t,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=u,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new Cc(e,t,[],Vt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new $H(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Vt.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(ea.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(ea.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Kf;Kf=this;try{return e()}finally{Kf=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=p3(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 u=[];if(e.iterChangedRanges((l,c,f,d)=>u.push({fromA:l,toA:c,fromB:f,toB:d})),r=ea.applyChanges(r,u),i=Vt.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let l of this.skipped){let c=e.mapPos(l.from,1),f=e.mapPos(l.to,-1);c<f&&a.push({from:c,to:f})}}}return new Cc(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=p3(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 HO{createParse(t,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let u=Kf;if(u){for(let l of i)u.tempSkipped.push(l);e&&(u.scheduleOn=u.scheduleOn?Promise.all([u.scheduleOn,e]):e)}return this.parsedPos=o,new Vt(jr.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 Kf}}function p3(n,e,t){return ea.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class Ec{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 Ec(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=Cc.create(e.facet(nu).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new Ec(r)}}Gi.state=Rn.define({create:Ec.init,update(n,e){for(let t of e.effects)if(t.is(Gi.setState))return t.value;return e.startState.facet(nu)!=e.state.facet(nu)?Ec.init(e.state):n.apply(e)}});let YO=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(YO=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const ab=typeof navigator<"u"&&(!((ob=navigator.scheduling)===null||ob===void 0)&&ob.isInputPending)?()=>navigator.scheduling.isInputPending():null,WH=gn.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(Gi.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(Gi.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=YO(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(Gi.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!ab?Math.max(25,e.timeRemaining()-5):1e9),a=s.context.treeLen<i&&r.doc.length>i+1e3,u=s.context.work(()=>ab&&ab()||Date.now()>o,i+(a?0:1e5));this.chunkBudget-=Date.now()-t,(u||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Gi.setState.of(new Ec(s.context))})),this.chunkBudget>0&&!(u&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>oi(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()}}}),nu=Ae.define({combine(n){return n.length?n[0]:null},enables:n=>[Gi.state,WH,Re.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Dre{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class XO{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 XO(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 zH=Ae.define(),zc=Ae.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 cl(n){let e=n.facet(zc);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function wd(n,e){let t="",r=n.tabSize,i=n.facet(zc)[0];if(i==" "){for(;e>=r;)t+=" ",e-=r;i=" "}for(let s=0;s<e;s++)t+=i;return t}function wk(n,e){n instanceof dt&&(n=new j1(n));for(let r of n.state.facet(zH)){let i=r(n,e);if(i!==void 0)return i}let t=ir(n.state);return t.length>=e?UH(n,t,e):null}class j1{constructor(e,t={}){this.state=e,this.options=t,this.unit=cl(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 $c(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 ZO=new it;function UH(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.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 QO(r,n,t)}function QO(n,e,t){for(let r=n;r;r=r.next){let i=VH(r.node);if(i)return i(_k.create(e,t,r))}return 0}function HH(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function VH(n){let e=n.type.prop(ZO);if(e)return e;let t=n.firstChild,r;if(t&&(r=t.type.prop(it.closedBy))){let i=n.lastChild,s=i&&r.indexOf(i.name)>-1;return o=>e8(o,!0,1,void 0,s&&!HH(o)?i.from:void 0)}return n.parent==null?GH:null}function GH(){return 0}class _k extends j1{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 _k(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(KH(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return QO(this.context.next,this.base,this.pos)}}function KH(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function JH(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 u=e.childAfter(a);if(!u||u==r)return null;if(!u.type.isSkipped){if(u.from>=o)return null;let l=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+l}}a=u.to}}function Tre({closing:n,align:e=!0,units:t=1}){return r=>e8(r,e,t,n)}function e8(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,u=e?JH(n):null;return u?a?n.column(u.from):n.column(u.to):n.baseIndent+(a?0:n.unit*t)}const Mre=n=>n.baseIndent;function Ore({except:n,units:e=1}={}){return t=>{let r=n&&n.test(t.textAfter);return t.baseIndent+(r?0:e*t.unit)}}const YH=200;function XH(){return dt.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+YH)return n;let s=t.sliceString(i.from,r);if(!e.some(l=>l.test(s)))return n;let{state:o}=n,a=-1,u=[];for(let{head:l}of o.selection.ranges){let c=o.doc.lineAt(l);if(c.from==a)continue;a=c.from;let f=wk(o,c.from);if(f==null)continue;let d=/^\s*/.exec(c.text)[0],g=wd(o,f);d!=g&&u.push({from:c.from,to:c.from+d.length,insert:g})}return u.length?[n,{changes:u,sequential:!0}]:n})}const ZH=Ae.define(),QH=new it;function Pre(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 eV(n,e,t){let r=ir(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 u=a.type.prop(QH);if(u&&(a.to<r.length-50||r.length==n.doc.length||!tV(a))){let l=u(a,n);l&&l.from<=t&&l.from>=e&&l.to>t&&(s=l)}}return s}function tV(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function Nm(n,e,t){for(let r of n.facet(ZH)){let i=r(n,e,t);if(i)return i}return eV(n,e,t)}function t8(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 $1=He.define({map:t8}),Zd=He.define({map:t8});function n8(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 fl=Rn.define({create(){return Be.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)if(t.is($1)&&!nV(n,t.value.from,t.value.to)){let{preparePlaceholder:r}=e.state.facet(s8),i=r?Be.replace({widget:new lV(r(e.state,t.value))}):g3;n=n.update({add:[i.range(t.value.from,t.value.to)]})}else t.is(Zd)&&(n=n.update({filter:(r,i)=>t.value.from!=r||t.value.to!=i,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:r}=e.selection.main;n.between(r,r,(i,s)=>{i<r&&s>r&&(t=!0)}),t&&(n=n.update({filterFrom:r,filterTo:r,filter:(i,s)=>s<=r||i>=r}))}return n},provide:n=>Re.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(g3.range(r,i))}return Be.set(e,!0)}});function Bm(n,e,t){var r;let i=null;return(r=n.field(fl,!1))===null||r===void 0||r.between(e,t,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function nV(n,e,t){let r=!1;return n.between(e,e,(i,s)=>{i==e&&s==t&&(r=!0)}),r}function r8(n,e){return n.field(fl,!1)?e:e.concat(He.appendConfig.of(o8()))}const rV=n=>{for(let e of n8(n)){let t=Nm(n.state,e.from,e.to);if(t)return n.dispatch({effects:r8(n.state,[$1.of(t),i8(n,t)])}),!0}return!1},iV=n=>{if(!n.state.field(fl,!1))return!1;let e=[];for(let t of n8(n)){let r=Bm(n.state,t.from,t.to);r&&e.push(Zd.of(r),i8(n,r,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function i8(n,e,t=!0){let r=n.state.doc.lineAt(e.from).number,i=n.state.doc.lineAt(e.to).number;return Re.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${r} ${n.state.phrase("to")} ${i}.`)}const sV=n=>{let{state:e}=n,t=[];for(let r=0;r<e.doc.length;){let i=n.lineBlockAt(r),s=Nm(e,i.from,i.to);s&&t.push($1.of(s)),r=(s?n.lineBlockAt(s.to):i).to+1}return t.length&&n.dispatch({effects:r8(n.state,t)}),!!t.length},oV=n=>{let e=n.state.field(fl,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(r,i)=>{t.push(Zd.of({from:r,to:i}))}),n.dispatch({effects:t}),!0},aV=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:rV},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:iV},{key:"Ctrl-Alt-[",run:sV},{key:"Ctrl-Alt-]",run:oV}],uV={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},s8=Ae.define({combine(n){return yo(n,uV)}});function o8(n){return[fl,hV]}function a8(n,e){let{state:t}=n,r=t.facet(s8),i=o=>{let a=n.lineBlockAt(n.posAtDOM(o.target)),u=Bm(n.state,a.from,a.to);u&&n.dispatch({effects:Zd.of(u)}),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 g3=Be.replace({widget:new class extends ha{toDOM(n){return a8(n,null)}}});class lV extends ha{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return a8(e,this.value)}}const cV={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class ub extends oa{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 fV(n={}){let e=Object.assign(Object.assign({},cV),n),t=new ub(e,!0),r=new ub(e,!1),i=gn.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(nu)!=o.state.facet(nu)||o.startState.field(fl,!1)!=o.state.field(fl,!1)||ir(o.startState)!=ir(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let a=new ia;for(let u of o.viewportLineBlocks){let l=Bm(o.state,u.from,u.to)?r:Nm(o.state,u.from,u.to)?t:null;l&&a.add(u.from,u.from,l)}return a.finish()}}),{domEventHandlers:s}=e;return[i,tH({class:"cm-foldGutter",markers(o){var a;return((a=o.plugin(i))===null||a===void 0?void 0:a.markers)||yt.empty},initialSpacer(){return new ub(e,!1)},domEventHandlers:Object.assign(Object.assign({},s),{click:(o,a,u)=>{if(s.click&&s.click(o,a,u))return!0;let l=Bm(o.state,a.from,a.to);if(l)return o.dispatch({effects:Zd.of(l)}),!0;let c=Nm(o.state,a.from,a.to);return c?(o.dispatch({effects:$1.of(c)}),!0):!1}})}),o8()]}const hV=Re.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 Uc{constructor(e,t){this.specs=e;let r;function i(a){let u=po.newName();return(r||(r=Object.create(null)))["."+u]=a,u}const s=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,o=t.scope;this.scope=o instanceof Gi?a=>a.prop(Ju)==o.data:o?a=>a==o:void 0,this.style=GO(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=r?new po(r):null,this.themeType=t.themeType}static define(e,t){return new Uc(e,t||{})}}const e_=Ae.define(),u8=Ae.define({combine(n){return n.length?[n[0]]:null}});function lb(n){let e=n.facet(e_);return e.length?e:n.facet(u8)}function l8(n,e){let t=[pV],r;return n instanceof Uc&&(n.module&&t.push(Re.styleModule.of(n.module)),r=n.themeType),e?.fallback?t.push(u8.of(n)):r?t.push(e_.computeN([Re.darkTheme],i=>i.facet(Re.darkTheme)==(r=="dark")?[n]:[])):t.push(e_.of(n)),t}class dV{constructor(e){this.markCache=Object.create(null),this.tree=ir(e.state),this.decorations=this.buildDeco(e,lb(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=ir(e.state),r=lb(e.state),i=r!=lb(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 Be.none;let r=new ia;for(let{from:i,to:s}of e.visibleRanges)KO(this.tree,t,(o,a,u)=>{r.add(o,a,this.markCache[u]||(this.markCache[u]=Be.mark({class:u})))},i,s);return r.finish()}}const pV=ou.high(gn.fromClass(dV,{decorations:n=>n.decorations})),gV=Uc.define([{tag:se.meta,color:"#404740"},{tag:se.link,textDecoration:"underline"},{tag:se.heading,textDecoration:"underline",fontWeight:"bold"},{tag:se.emphasis,fontStyle:"italic"},{tag:se.strong,fontWeight:"bold"},{tag:se.strikethrough,textDecoration:"line-through"},{tag:se.keyword,color:"#708"},{tag:[se.atom,se.bool,se.url,se.contentSeparator,se.labelName],color:"#219"},{tag:[se.literal,se.inserted],color:"#164"},{tag:[se.string,se.deleted],color:"#a11"},{tag:[se.regexp,se.escape,se.special(se.string)],color:"#e40"},{tag:se.definition(se.variableName),color:"#00f"},{tag:se.local(se.variableName),color:"#30a"},{tag:[se.typeName,se.namespace],color:"#085"},{tag:se.className,color:"#167"},{tag:[se.special(se.variableName),se.macroName],color:"#256"},{tag:se.definition(se.propertyName),color:"#00c"},{tag:se.comment,color:"#940"},{tag:se.invalid,color:"#f00"}]),mV=Re.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),c8=1e4,f8="()[]{}",h8=Ae.define({combine(n){return yo(n,{afterCursor:!0,brackets:f8,maxScanDistance:c8,renderMatch:bV})}}),vV=Be.mark({class:"cm-matchingBracket"}),yV=Be.mark({class:"cm-nonmatchingBracket"});function bV(n){let e=[],t=n.matched?vV:yV;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const wV=Rn.define({create(){return Be.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],r=e.state.facet(h8);for(let i of e.state.selection.ranges){if(!i.empty)continue;let s=so(e.state,i.head,-1,r)||i.head>0&&so(e.state,i.head-1,1,r)||r.afterCursor&&(so(e.state,i.head,1,r)||i.head<e.state.doc.length&&so(e.state,i.head+1,-1,r));s&&(t=t.concat(r.renderMatch(s,e.state)))}return Be.set(t,!0)},provide:n=>Re.decorations.from(n)}),_V=[wV,mV];function kV(n={}){return[h8.of(n),_V]}const xV=new it;function t_(n,e,t){let r=n.prop(e<0?it.openedBy:it.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 n_(n){let e=n.type.prop(xV);return e?e(n.node):n}function so(n,e,t,r={}){let i=r.maxScanDistance||c8,s=r.brackets||f8,o=ir(n),a=o.resolveInner(e,t);for(let u=a;u;u=u.parent){let l=t_(u.type,t,s);if(l&&u.from<u.to){let c=n_(u);if(c&&(t>0?e>=c.from&&e<c.to:e>c.from&&e<=c.to))return SV(n,e,t,u,c,l,s)}}return CV(n,e,t,o,a.type,i,s)}function SV(n,e,t,r,i,s,o){let a=r.parent,u={from:i.from,to:i.to},l=0,c=a?.cursor();if(c&&(t<0?c.childBefore(r.from):c.childAfter(r.to)))do if(t<0?c.to<=r.from:c.from>=r.to){if(l==0&&s.indexOf(c.type.name)>-1&&c.from<c.to){let f=n_(c);return{start:u,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(t_(c.type,t,o))l++;else if(t_(c.type,-t,o)){if(l==0){let f=n_(c);return{start:u,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}l--}}while(t<0?c.prevSibling():c.nextSibling());return{start:u,matched:!1}}function CV(n,e,t,r,i,s,o){let a=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),u=o.indexOf(a);if(u<0||u%2==0!=t>0)return null;let l={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let d=0;!c.next().done&&d<=s;){let g=c.value;t<0&&(d+=g.length);let m=e+d*t;for(let y=t>0?0:g.length-1,b=t>0?g.length:-1;y!=b;y+=t){let w=o.indexOf(g[y]);if(!(w<0||r.resolveInner(m+y,1).type!=i))if(w%2==0==t>0)f++;else{if(f==1)return{start:l,end:{from:m+y,to:m+y+1},matched:w>>1==u>>1};f--}}t>0&&(d+=g.length)}return c.done?{start:l,matched:!1}:null}function m3(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 d8{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=m3(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:m3(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)}}function EV(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||RV,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||xk,mergeTokens:n.mergeTokens!==!1}}function RV(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 v3=new WeakMap;class Bn extends Gi{constructor(e){let t=JO(e.languageData),r=EV(e),i,s=new class extends HO{createParse(o,a,u){return new DV(i,o,a,u)}};super(t,s,[],e.name),this.topNode=OV(t,this),i=this,this.streamParser=r,this.stateAfter=new it({perNode:!0}),this.tokenTable=e.tokenTable?new v8(r.tokenTable):MV}static define(e){return new Bn(e)}getIndent(e){let t,{overrideIndentation:r}=e.options;r&&(t=v3.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let i=kk(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 u=e.state.doc.lineAt(s),l=Math.min(e.pos,u.to);if(u.length){let c=r?r(u.from):-1,f=new d8(u.text,e.state.tabSize,e.unit,c<0?void 0:c);for(;f.pos<l-u.from;)g8(this.streamParser.token,f,o)}else this.streamParser.blankLine(o,e.unit);if(l==e.pos)break;s=u.to+1}let a=e.lineAt(e.pos);return r&&t==null&&v3.set(e.state,a.from),this.streamParser.indent(o,/^\s*(.*)/.exec(a.text)[1],e)}get allowsNesting(){return!1}}function kk(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],u=t+e.positions[o],l=a instanceof Vt&&u<i&&kk(n,a,u,r,i);if(l)return l}return null}function p8(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],u;if(o<r&&a instanceof Vt){if(!(u=p8(n,a,t-o,r-o,i)))break;return i?new Vt(e.type,e.children.slice(0,s).concat(u),e.positions.slice(0,s+1),o+u.length):u}}return null}function AV(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),u=o<=t&&a>t&&kk(n,s.tree,0-s.offset,t,a),l;if(u&&u.pos<=r&&(l=p8(n,s.tree,t+s.offset,u.pos+s.offset,!1)))return{state:u.state,tree:l}}return{state:n.streamParser.startState(i?cl(i):4),tree:Vt.empty}}class DV{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=Cc.get(),o=i[0].from,{state:a,tree:u}=AV(e,r,o,this.to,s?.state);this.state=a,this.parsedPos=this.chunkStart=o+u.length;for(let l=0;l<u.children.length;l++)this.chunks.push(u.children[l]),this.chunkPos.push(u.positions[l]);s&&this.parsedPos<s.viewport.from-1e5&&i.some(l=>l.from<=s.viewport.from&&l.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(cl(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let e=Cc.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),r=Math.min(t,this.chunkStart+2048);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==`
|
|
65
|
-
`&&(t="");else{let r=t.indexOf(`
|
|
66
|
-
`);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 d8(t,e?e.state.tabSize:4,e?cl(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=g8(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=Vt.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:TV,topID:0,maxBufferLength:2048,reused:this.chunkReused});e=new Vt(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 Vt(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function g8(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 xk=Object.create(null),_d=[jr.none],TV=new mk(_d),y3=[],b3=Object.create(null),m8=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"]])m8[n]=y8(xk,e);class v8{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),m8)}resolve(e){return e?this.table[e]||(this.table[e]=y8(this.extra,e)):0}}const MV=new v8(xk);function cb(n,e){y3.indexOf(n)>-1||(y3.push(n),console.warn(e))}function y8(n,e){let t=[];for(let a of e.split(" ")){let u=[];for(let l of a.split(".")){let c=n[l]||se[l];c?typeof c=="function"?u.length?u=u.map(c):cb(l,`Modifier ${l} used at start of tag`):u.length?cb(l,`Tag ${l} used as modifier`):u=Array.isArray(c)?c:[c]:cb(l,`Unknown highlighting tag ${l}`)}for(let l of u)t.push(l)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+t.map(a=>a.id),s=b3[i];if(s)return s.id;let o=b3[i]=jr.define({id:_d.length,name:r,props:[LH({[r]:t})]});return _d.push(o),o.id}function OV(n,e){let t=jr.define({id:_d.length,name:"Document",props:[Ju.add(()=>n),ZO.add(()=>r=>e.getIndent(r))],top:!0});return _d.push(t),t}tn.RTL,tn.LTR;function PV({theme:n,settings:e={},styles:t=[]}){const r={".cm-gutters":{}},i={};e.background&&(i.backgroundColor=e.background),e.backgroundImage&&(i.backgroundImage=e.backgroundImage),e.foreground&&(i.color=e.foreground),e.fontSize&&(i.fontSize=e.fontSize),Object.keys(i).length>0&&(r["&"]=i),e.fontFamily&&(r["&.cm-editor .cm-scroller"]={fontFamily:e.fontFamily}),e.gutterBackground&&(r[".cm-gutters"].backgroundColor=e.gutterBackground),e.gutterForeground&&(r[".cm-gutters"].color=e.gutterForeground),e.gutterBorder&&(r[".cm-gutters"].borderRightColor=e.gutterBorder),e.caret&&(r[".cm-content"]={caretColor:e.caret},r[".cm-cursor, .cm-dropCursor"]={borderLeftColor:e.caret});const s={};e.gutterActiveForeground&&(s.color=e.gutterActiveForeground),e.lineHighlight&&(r[".cm-activeLine"]={backgroundColor:e.lineHighlight},s.backgroundColor=e.lineHighlight),r[".cm-activeLineGutter"]=s,e.selection&&(r["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:`${e.selection} !important`}),e.selectionMatch&&(r["& .cm-selectionMatch"]={backgroundColor:e.selectionMatch});const o=Re.theme(r,{dark:n==="dark"}),a=Uc.define(t);return[o,l8(a)]}const IV={background:"var(--cm-background)",foreground:"var(--cm-foreground)",caret:"var(--cm-caret)",selection:"var(--cm-selection)",selectionMatch:"var(--cm-selection-match)",lineHighlight:"var(--cm-line-highlight)",gutterBackground:"var(--cm-gutter-background)",gutterForeground:"var(--cm-gutter-foreground)",gutterActiveForeground:"var(--cm-gutter-active-foreground)",fontFamily:"var(--cm-font-family)"},LV=[{tag:[se.keyword,se.operatorKeyword,se.modifier,se.color,se.constant(se.name),se.standard(se.name),se.standard(se.tagName),se.special(se.brace),se.atom,se.bool,se.special(se.variableName)],color:"var(--cm-keyword)"},{tag:[se.controlKeyword,se.moduleKeyword],color:"var(--cm-control)"},{tag:[se.name,se.deleted,se.character,se.macroName,se.propertyName,se.variableName,se.labelName,se.definition(se.name)],color:"var(--cm-name)"},{tag:se.heading,fontWeight:"bold",color:"var(--cm-heading)"},{tag:[se.typeName,se.className,se.tagName,se.number,se.changed,se.annotation,se.self,se.namespace],color:"var(--cm-type)"},{tag:[se.function(se.variableName),se.function(se.propertyName)],color:"var(--cm-function)"},{tag:[se.number],color:"var(--cm-number)"},{tag:[se.operator,se.punctuation,se.separator,se.url,se.escape,se.regexp],color:"var(--cm-operator)"},{tag:[se.regexp],color:"var(--cm-regexp)"},{tag:[se.special(se.string),se.processingInstruction,se.string,se.inserted],color:"var(--cm-string)"},{tag:[se.angleBracket],color:"var(--cm-angle-bracket)"},{tag:se.strong,fontWeight:"bold"},{tag:se.emphasis,fontStyle:"italic"},{tag:se.strikethrough,textDecoration:"line-through"},{tag:[se.meta,se.comment],color:"var(--cm-comment)"},{tag:se.link,color:"var(--cm-link)",textDecoration:"underline"},{tag:se.invalid,color:"var(--cm-invalid)"}];function FV(n){const{theme:e="light",settings:t={},styles:r=[]}={};return PV({theme:e,settings:{...IV,...t},styles:[...LV,...r]})}const b8=FV(),w3={"--cm-background":"#1e1e1e","--cm-foreground":"#9cdcfe","--cm-caret":"#c6c6c6","--cm-selection":"#6199ff2f","--cm-selection-match":"#72a1ff59","--cm-line-highlight":"#ffffff0f","--cm-gutter-background":"#1e1e1e","--cm-gutter-foreground":"#838383","--cm-gutter-active-foreground":"#ffffff","--cm-keyword":"#569cd6","--cm-control":"#c586c0","--cm-name":"#9cdcfe","--cm-heading":"#9cdcfe","--cm-type":"#4ec9b0","--cm-function":"#dcdcaa","--cm-number":"#b5cea8","--cm-operator":"#d4d4d4","--cm-regexp":"#d16969","--cm-string":"#ce9178","--cm-angle-bracket":"#808080","--cm-comment":"#6a9955","--cm-link":"#4078f2","--cm-invalid":"#ff0000","--cm-search-result-color":"var(--cm-angle-bracket)","--cm-search-result-color-hover":"#ffffff","--cm-command-result-color":"var(--cm-search-result-color-hover)","--cm-toolbar-background":"var(--cm-toolbar-bg-dark)","--cm-toolbar-color":"var(--cm-toolbar-color-dark)","--cm-toolbar-foreground":"#ffffff","--cm-tooltip-color":"var(--cm-gutter-active-foreground)","--cm-tooltip-background":"var(--cm-toolbar-background)","--cm-tooltip-border":"#000000","--cm-diagnostic-error-bg":"#d11","--cm-comment-bg":"rgba(0,0,0,0.32)"},NV=new po({":root, .cm-editor[data-theme='light'], [data-theme='light'] .cm-editor":{"--cm-font-family":'Menlo, Monaco, Consolas, "Andale Mono", "Ubuntu Mono", "Courier New", monospace',"--cm-background":"#ffffff","--cm-foreground":"#383a42","--cm-caret":"#000000","--cm-selection":"#add6ff","--cm-selection-match":"#a8ac94","--cm-line-highlight":"#99999914","--cm-gutter-background":"#ffffff","--cm-gutter-foreground":"#237893","--cm-gutter-active-foreground":"#0b216f","--cm-keyword":"#0000ff","--cm-control":"#af00db","--cm-name":"#0070c1","--cm-heading":"#0070c1","--cm-type":"#267f99","--cm-function":"#795e26","--cm-number":"#098658","--cm-operator":"#383a42","--cm-regexp":"#af00db","--cm-string":"#a31515","--cm-angle-bracket":"#383a42","--cm-comment":"#008000","--cm-link":"#4078f2","--cm-invalid":"#e45649","--cm-search-result-color":"#838383","--cm-search-result-color-hover":"var(--cm-toolbar-color)","--cm-search-result-bg-hover":"#2490e94f","--cm-search-result-color-selected":"#ffffff","--cm-search-result-select-bg":"#2490e9","--cm-command-result-color":"var(--cm-toolbar-color)","--cm-toolbar-bg-light":"#f3f3f3","--cm-toolbar-bg-dark":"#2a2a2f","--cm-toolbar-color-light":"#000000","--cm-toolbar-color-dark":"#ffffff","--cm-toolbar-background":"var(--cm-toolbar-bg-light)","--cm-toolbar-color":"var(--cm-toolbar-color-light)","--cm-toolbar-foreground":"var(--cm-foreground)","--cm-tooltip-color":"var(--cm-foreground)","--cm-tooltip-background":"#ffffff","--cm-tooltip-border":"#000000","--cm-diagnostic-info-color":"white","--cm-diagnostic-info-bg":"#545454","--cm-diagnostic-error-color":"white","--cm-diagnostic-error-bg":"#e45649","--cm-comment-bg":"rgba(0,0,0,0.1)"},":root[data-theme='dark'], .cm-editor[data-theme='dark'], [data-theme='dark'] .cm-editor":w3,"@media (prefers-color-scheme: dark)":{":root":w3}}),BV=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),r=Ck(n.state,t.from);return r.line?qV(n):r.block?$V(n):!1};function Sk(n,e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let i=n(e,t);return i?(r(t.update(i)),!0):!1}}const qV=Sk(UV,0),jV=Sk(w8,0),$V=Sk((n,e)=>w8(n,e,zV(e)),0);function Ck(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const Jf=50;function WV(n,{open:e,close:t},r,i){let s=n.sliceDoc(r-Jf,r),o=n.sliceDoc(i,i+Jf),a=/\s*$/.exec(s)[0].length,u=/^\s*/.exec(o)[0].length,l=s.length-a;if(s.slice(l-e.length,l)==e&&o.slice(u,u+t.length)==t)return{open:{pos:r-a,margin:a&&1},close:{pos:i+u,margin:u&&1}};let c,f;i-r<=2*Jf?c=f=n.sliceDoc(r,i):(c=n.sliceDoc(r,r+Jf),f=n.sliceDoc(i-Jf,i));let d=/^\s*/.exec(c)[0].length,g=/\s*$/.exec(f)[0].length,m=f.length-g-t.length;return c.slice(d,d+e.length)==e&&f.slice(m,m+t.length)==t?{open:{pos:r+d+e.length,margin:/\s/.test(c.charAt(d+e.length))?1:0},close:{pos:i-g-t.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function zV(n){let e=[];for(let t of n.selection.ranges){let r=n.doc.lineAt(t.from),i=t.to<=r.to?r:n.doc.lineAt(t.to);i.from>r.from&&i.from==t.to&&(i=t.to==r.to+1?r:n.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function w8(n,e,t=e.selection.ranges){let r=t.map(s=>Ck(e,s.from).block);if(!r.every(s=>s))return null;let i=t.map((s,o)=>WV(e,r[o],s.from,s.to));if(n!=2&&!i.every(s=>s))return{changes:e.changes(t.map((s,o)=>i[o]?[]:[{from:s.from,insert:r[o].open+" "},{from:s.to,insert:" "+r[o].close}]))};if(n!=1&&i.some(s=>s)){let s=[];for(let o=0,a;o<i.length;o++)if(a=i[o]){let u=r[o],{open:l,close:c}=a;s.push({from:l.pos-u.open.length,to:l.pos+l.margin},{from:c.pos-c.margin,to:c.pos+u.close.length})}return{changes:s}}return null}function UV(n,e,t=e.selection.ranges){let r=[],i=-1;for(let{from:s,to:o}of t){let a=r.length,u=1e9,l=Ck(e,s).line;if(l){for(let c=s;c<=o;){let f=e.doc.lineAt(c);if(f.from>i&&(s==o||o>f.from)){i=f.from;let d=/^\s*/.exec(f.text)[0].length,g=d==f.length,m=f.text.slice(d,d+l.length)==l?d:-1;d<f.text.length&&d<u&&(u=d),r.push({line:f,comment:m,token:l,indent:d,empty:g,single:!1})}c=f.to+1}if(u<1e9)for(let c=a;c<r.length;c++)r[c].indent<r[c].line.text.length&&(r[c].indent=u);r.length==a+1&&(r[a].single=!0)}}if(n!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:u,indent:l,empty:c,single:f}of r)(f||!c)&&s.push({from:a.from+l,insert:u+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:u}of r)if(a>=0){let l=o.from+a,c=l+u.length;o.text[c-o.from]==" "&&c++,s.push({from:l,to:c})}return{changes:s}}return null}const r_=fa.define(),HV=fa.define(),VV=Ae.define(),_8=Ae.define({combine(n){return yo(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(r,i)=>e(r,i)||t(r,i)})}}),k8=Rn.define({create(){return oo.empty},update(n,e){let t=e.state.facet(_8),r=e.annotation(r_);if(r){let u=ai.fromTransaction(e,r.selection),l=r.side,c=l==0?n.undone:n.done;return u?c=qm(c,c.length,t.minDepth,u):c=C8(c,e.startState.selection),new oo(l==0?r.rest:c,l==0?c:r.rest)}let i=e.annotation(HV);if((i=="full"||i=="before")&&(n=n.isolate()),e.annotation(En.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let s=ai.fromTransaction(e),o=e.annotation(En.time),a=e.annotation(En.userEvent);return s?n=n.addChanges(s,o,a,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,a,t.newGroupDelay)),(i=="full"||i=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new oo(n.done.map(ai.fromJSON),n.undone.map(ai.fromJSON))}});function GV(n={}){return[k8,_8.of(n),Re.domEventHandlers({beforeinput(e,t){let r=e.inputType=="historyUndo"?x8:e.inputType=="historyRedo"?i_:null;return r?(e.preventDefault(),r(t)):!1}})]}function W1(n,e){return function({state:t,dispatch:r}){if(!e&&t.readOnly)return!1;let i=t.field(k8,!1);if(!i)return!1;let s=i.pop(n,t,e);return s?(r(s),!0):!1}}const x8=W1(0,!1),i_=W1(1,!1),KV=W1(0,!0),JV=W1(1,!0);class ai{constructor(e,t,r,i,s){this.changes=e,this.effects=t,this.mapped=r,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new ai(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new ai(e.changes&&Tn.fromJSON(e.changes),[],e.mapped&&lo.fromJSON(e.mapped),e.startSelection&&me.fromJSON(e.startSelection),e.selectionsAfter.map(me.fromJSON))}static fromTransaction(e,t){let r=Ki;for(let i of e.startState.facet(VV)){let s=i(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new ai(e.changes.invert(e.startState.doc),r,void 0,t||e.startState.selection,Ki)}static selection(e){return new ai(void 0,Ki,void 0,void 0,e)}}function qm(n,e,t,r){let i=e+1>t+20?e-t-1:0,s=n.slice(i,e);return s.push(r),s}function YV(n,e){let t=[],r=!1;return n.iterChangedRanges((i,s)=>t.push(i,s)),e.iterChangedRanges((i,s,o,a)=>{for(let u=0;u<t.length;){let l=t[u++],c=t[u++];a>=l&&o<=c&&(r=!0)}}),r}function XV(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,r)=>t.empty!=e.ranges[r].empty).length===0}function S8(n,e){return n.length?e.length?n.concat(e):n:e}const Ki=[],ZV=200;function C8(n,e){if(n.length){let t=n[n.length-1],r=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-ZV));return r.length&&r[r.length-1].eq(e)?n:(r.push(e),qm(n,n.length-1,1e9,t.setSelAfter(r)))}else return[ai.selection([e])]}function QV(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function fb(n,e){if(!n.length)return n;let t=n.length,r=Ki;for(;t;){let i=eG(n[t-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let s=n.slice(0,t);return s[t-1]=i,s}else e=i.mapped,t--,r=i.selectionsAfter}return r.length?[ai.selection(r)]:Ki}function eG(n,e,t){let r=S8(n.selectionsAfter.length?n.selectionsAfter.map(a=>a.map(e)):Ki,t);if(!n.changes)return ai.selection(r);let i=n.changes.map(e),s=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(s):s;return new ai(i,He.mapEffects(n.effects,e),o,n.startSelection.map(s),r)}const tG=/^(input\.type|delete)($|\.)/;class oo{constructor(e,t,r=0,i=void 0){this.done=e,this.undone=t,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new oo(this.done,this.undone):this}addChanges(e,t,r,i,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||tG.test(r))&&(!a.selectionsAfter.length&&t-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,YV(a.changes,e.changes))||r=="input.type.compose")?o=qm(o,o.length-1,i.minDepth,new ai(e.changes.compose(a.changes),S8(He.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,Ki)):o=qm(o,o.length,i.minDepth,e),new oo(o,Ki,t,r)}addSelection(e,t,r,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:Ki;return s.length>0&&t-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&XV(s[s.length-1],e)?this:new oo(C8(this.done,e),this.undone,t,r)}addMapping(e){return new oo(fb(this.done,e),fb(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let s=i[i.length-1],o=s.selectionsAfter[0]||t.selection;if(r&&s.selectionsAfter.length)return t.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:r_.of({side:e,rest:QV(i),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let a=i.length==1?Ki:i.slice(0,i.length-1);return s.mapped&&(a=fb(a,s.mapped)),t.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:r_.of({side:e,rest:a,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}oo.empty=new oo(Ki,Ki);const nG=[{key:"Mod-z",run:x8,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:i_,preventDefault:!0},{linux:"Ctrl-Shift-z",run:i_,preventDefault:!0},{key:"Mod-u",run:KV,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:JV,preventDefault:!0}];function Hc(n,e){return me.create(n.ranges.map(e),n.mainIndex)}function bo(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function As({state:n,dispatch:e},t){let r=Hc(n.selection,t);return r.eq(n.selection,!0)?!1:(e(bo(n,r)),!0)}function z1(n,e){return me.cursor(e?n.to:n.from)}function E8(n,e){return As(n,t=>t.empty?n.moveByChar(t,e):z1(t,e))}function kr(n){return n.textDirectionAt(n.state.selection.main.head)==tn.LTR}const R8=n=>E8(n,!kr(n)),A8=n=>E8(n,kr(n));function D8(n,e){return As(n,t=>t.empty?n.moveByGroup(t,e):z1(t,e))}const rG=n=>D8(n,!kr(n)),iG=n=>D8(n,kr(n));function sG(n,e,t){if(e.type.prop(t))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function U1(n,e,t){let r=ir(n).resolveInner(e.head),i=t?it.closedBy:it.openedBy;for(let u=e.head;;){let l=t?r.childAfter(u):r.childBefore(u);if(!l)break;sG(n,l,i)?r=l:u=t?l.to:l.from}let s=r.type.prop(i),o,a;return s&&(o=t?so(n,r.from,1):so(n,r.to,-1))&&o.matched?a=t?o.end.to:o.end.from:a=t?r.to:r.from,me.cursor(a,t?-1:1)}const oG=n=>As(n,e=>U1(n.state,e,!kr(n))),aG=n=>As(n,e=>U1(n.state,e,kr(n)));function T8(n,e){return As(n,t=>{if(!t.empty)return z1(t,e);let r=n.moveVertically(t,e);return r.head!=t.head?r:n.moveToLineBoundary(t,e)})}const M8=n=>T8(n,!1),O8=n=>T8(n,!0);function P8(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,r=0,i;if(e){for(let s of n.state.facet(Re.scrollMargins)){let o=s(n);o?.top&&(t=Math.max(o?.top,t)),o?.bottom&&(r=Math.max(o?.bottom,r))}i=n.scrollDOM.clientHeight-t-r}else i=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:r,selfScroll:e,height:Math.max(n.defaultLineHeight,i-5)}}function I8(n,e){let t=P8(n),{state:r}=n,i=Hc(r.selection,o=>o.empty?n.moveVertically(o,e,t.height):z1(o,e));if(i.eq(r.selection))return!1;let s;if(t.selfScroll){let o=n.coordsAtPos(r.selection.main.head),a=n.scrollDOM.getBoundingClientRect(),u=a.top+t.marginTop,l=a.bottom-t.marginBottom;o&&o.top>u&&o.bottom<l&&(s=Re.scrollIntoView(i.main.head,{y:"start",yMargin:o.top-u}))}return n.dispatch(bo(r,i),{effects:s}),!0}const _3=n=>I8(n,!1),s_=n=>I8(n,!0);function au(n,e,t){let r=n.lineBlockAt(e.head),i=n.moveToLineBoundary(e,t);if(i.head==e.head&&i.head!=(t?r.to:r.from)&&(i=n.moveToLineBoundary(e,t,!1)),!t&&i.head==r.from&&r.length){let s=/^\s*/.exec(n.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(i=me.cursor(r.from+s))}return i}const uG=n=>As(n,e=>au(n,e,!0)),lG=n=>As(n,e=>au(n,e,!1)),cG=n=>As(n,e=>au(n,e,!kr(n))),fG=n=>As(n,e=>au(n,e,kr(n))),hG=n=>As(n,e=>me.cursor(n.lineBlockAt(e.head).from,1)),dG=n=>As(n,e=>me.cursor(n.lineBlockAt(e.head).to,-1));function pG(n,e,t){let r=!1,i=Hc(n.selection,s=>{let o=so(n,s.head,-1)||so(n,s.head,1)||s.head>0&&so(n,s.head-1,1)||s.head<n.doc.length&&so(n,s.head+1,-1);if(!o||!o.end)return s;r=!0;let a=o.start.from==s.head?o.end.to:o.end.from;return me.cursor(a)});return r?(e(bo(n,i)),!0):!1}const gG=({state:n,dispatch:e})=>pG(n,e);function is(n,e){let t=Hc(n.state.selection,r=>{let i=e(r);return me.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(bo(n.state,t)),!0)}function L8(n,e){return is(n,t=>n.moveByChar(t,e))}const F8=n=>L8(n,!kr(n)),N8=n=>L8(n,kr(n));function B8(n,e){return is(n,t=>n.moveByGroup(t,e))}const mG=n=>B8(n,!kr(n)),vG=n=>B8(n,kr(n)),yG=n=>is(n,e=>U1(n.state,e,!kr(n))),bG=n=>is(n,e=>U1(n.state,e,kr(n)));function q8(n,e){return is(n,t=>n.moveVertically(t,e))}const j8=n=>q8(n,!1),$8=n=>q8(n,!0);function W8(n,e){return is(n,t=>n.moveVertically(t,e,P8(n).height))}const k3=n=>W8(n,!1),x3=n=>W8(n,!0),wG=n=>is(n,e=>au(n,e,!0)),_G=n=>is(n,e=>au(n,e,!1)),kG=n=>is(n,e=>au(n,e,!kr(n))),xG=n=>is(n,e=>au(n,e,kr(n))),SG=n=>is(n,e=>me.cursor(n.lineBlockAt(e.head).from)),CG=n=>is(n,e=>me.cursor(n.lineBlockAt(e.head).to)),S3=({state:n,dispatch:e})=>(e(bo(n,{anchor:0})),!0),C3=({state:n,dispatch:e})=>(e(bo(n,{anchor:n.doc.length})),!0),E3=({state:n,dispatch:e})=>(e(bo(n,{anchor:n.selection.main.anchor,head:0})),!0),R3=({state:n,dispatch:e})=>(e(bo(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),EG=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),RG=({state:n,dispatch:e})=>{let t=H1(n).map(({from:r,to:i})=>me.range(r,Math.min(i+1,n.doc.length)));return e(n.update({selection:me.create(t),userEvent:"select"})),!0},AG=({state:n,dispatch:e})=>{let t=Hc(n.selection,r=>{let i=ir(n),s=i.resolveStack(r.from,1);if(r.empty){let o=i.resolveStack(r.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:a}=o;if((a.from<r.from&&a.to>=r.to||a.to>r.to&&a.from<=r.from)&&o.next)return me.range(a.to,a.from)}return r});return t.eq(n.selection)?!1:(e(bo(n,t)),!0)},DG=({state:n,dispatch:e})=>{let t=n.selection,r=null;return t.ranges.length>1?r=me.create([t.main]):t.main.empty||(r=me.create([me.cursor(t.main.head)])),r?(e(bo(n,r)),!0):!1};function Qd(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:r}=n,i=r.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let u=e(s);u<o?(t="delete.backward",u=W0(n,u,!1)):u>o&&(t="delete.forward",u=W0(n,u,!0)),o=Math.min(o,u),a=Math.max(a,u)}else o=W0(n,o,!1),a=W0(n,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:me.cursor(o,o<s.head?-1:1)}});return i.changes.empty?!1:(n.dispatch(r.update(i,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?Re.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function W0(n,e,t){if(n instanceof Re)for(let r of n.state.facet(Re.atomicRanges).map(i=>i(n)))r.between(e,e,(i,s)=>{i<e&&s>e&&(e=t?s:i)});return e}const z8=(n,e,t)=>Qd(n,r=>{let i=r.from,{state:s}=n,o=s.doc.lineAt(i),a,u;if(t&&!e&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(a=o.text.slice(0,i-o.from))){if(a[a.length-1]==" ")return i-1;let l=$c(a,s.tabSize),c=l%cl(s)||cl(s);for(let f=0;f<c&&a[a.length-1-f]==" ";f++)i--;u=i}else u=nr(o.text,i-o.from,e,e)+o.from,u==i&&o.number!=(e?s.doc.lines:1)?u+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(u-o.from,i-o.from))&&(u=nr(o.text,u-o.from,!1,!1)+o.from);return u}),o_=n=>z8(n,!1,!0),U8=n=>z8(n,!0,!1),H8=(n,e)=>Qd(n,t=>{let r=t.head,{state:i}=n,s=i.doc.lineAt(r),o=i.charCategorizer(r);for(let a=null;;){if(r==(e?s.to:s.from)){r==t.head&&s.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let u=nr(s.text,r-s.from,e)+s.from,l=s.text.slice(Math.min(r,u)-s.from,Math.max(r,u)-s.from),c=o(l);if(a!=null&&c!=a)break;(l!=" "||r!=t.head)&&(a=c),r=u}return r}),V8=n=>H8(n,!1),TG=n=>H8(n,!0),MG=n=>Qd(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),OG=n=>Qd(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),PG=n=>Qd(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),IG=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:gt.of(["",""])},range:me.cursor(r.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},LG=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>{if(!r.empty||r.from==0||r.from==n.doc.length)return{range:r};let i=r.from,s=n.doc.lineAt(i),o=i==s.from?i-1:nr(s.text,i-s.from,!1)+s.from,a=i==s.to?i+1:nr(s.text,i-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:n.doc.slice(i,a).append(n.doc.slice(o,i))},range:me.cursor(a)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function H1(n){let e=[],t=-1;for(let r of n.selection.ranges){let i=n.doc.lineAt(r.from),s=n.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=n.doc.lineAt(r.to-1)),t>=i.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(r)}else e.push({from:i.from,to:s.to,ranges:[r]});t=s.number+1}return e}function G8(n,e,t){if(n.readOnly)return!1;let r=[],i=[];for(let s of H1(n)){if(t?s.to==n.doc.length:s.from==0)continue;let o=n.doc.lineAt(t?s.to+1:s.from-1),a=o.length+1;if(t){r.push({from:s.to,to:o.to},{from:s.from,insert:o.text+n.lineBreak});for(let u of s.ranges)i.push(me.range(Math.min(n.doc.length,u.anchor+a),Math.min(n.doc.length,u.head+a)))}else{r.push({from:o.from,to:s.from},{from:s.to,insert:n.lineBreak+o.text});for(let u of s.ranges)i.push(me.range(u.anchor-a,u.head-a))}}return r.length?(e(n.update({changes:r,scrollIntoView:!0,selection:me.create(i,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const FG=({state:n,dispatch:e})=>G8(n,e,!1),NG=({state:n,dispatch:e})=>G8(n,e,!0);function K8(n,e,t){if(n.readOnly)return!1;let r=[];for(let i of H1(n))t?r.push({from:i.from,insert:n.doc.slice(i.from,i.to)+n.lineBreak}):r.push({from:i.to,insert:n.lineBreak+n.doc.slice(i.from,i.to)});return e(n.update({changes:r,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const BG=({state:n,dispatch:e})=>K8(n,e,!1),qG=({state:n,dispatch:e})=>K8(n,e,!0),jG=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(H1(e).map(({from:i,to:s})=>(i>0?i--:s<e.doc.length&&s++,{from:i,to:s}))),r=Hc(e.selection,i=>{let s;if(n.lineWrapping){let o=n.lineBlockAt(i.head),a=n.coordsAtPos(i.head,i.assoc||1);a&&(s=o.bottom+n.documentTop-a.bottom+n.defaultLineHeight/2)}return n.moveVertically(i,!0,s)}).map(t);return n.dispatch({changes:t,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function $G(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=ir(n).resolveInner(e),r=t.childBefore(e),i=t.childAfter(e),s;return r&&i&&r.to<=e&&i.from>=e&&(s=r.type.prop(it.closedBy))&&s.indexOf(i.name)>-1&&n.doc.lineAt(r.to).from==n.doc.lineAt(i.from).from&&!/\S/.test(n.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const A3=J8(!1),WG=J8(!0);function J8(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:s,to:o}=i,a=e.doc.lineAt(s),u=!n&&s==o&&$G(e,s);n&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let l=new j1(e,{simulateBreak:s,simulateDoubleBreak:!!u}),c=wk(l,s);for(c==null&&(c=$c(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<a.to&&/\s/.test(a.text[o-a.from]);)o++;u?{from:s,to:o}=u:s>a.from&&s<a.from+100&&!/\S/.test(a.text.slice(0,s))&&(s=a.from);let f=["",wd(e,c)];return u&&f.push(wd(e,l.lineIndent(a.from,-1))),{changes:{from:s,to:o,insert:gt.of(f)},range:me.cursor(s+1+f[1].length)}});return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function Ek(n,e){let t=-1;return n.changeByRange(r=>{let i=[];for(let o=r.from;o<=r.to;){let a=n.doc.lineAt(o);a.number>t&&(r.empty||r.to>a.from)&&(e(a,i,r),t=a.number),o=a.to+1}let s=n.changes(i);return{changes:i,range:me.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const zG=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),r=new j1(n,{overrideIndentation:s=>{let o=t[s];return o??-1}}),i=Ek(n,(s,o,a)=>{let u=wk(r,s.from);if(u==null)return;/\S/.test(s.text)||(u=0);let l=/^\s*/.exec(s.text)[0],c=wd(n,u);(l!=c||a.from<s.from+l.length)&&(t[s.from]=u,o.push({from:s.from,to:s.from+l.length,insert:c}))});return i.changes.empty||e(n.update(i,{userEvent:"indent"})),!0},Y8=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Ek(n,(t,r)=>{r.push({from:t.from,insert:n.facet(zc)})}),{userEvent:"input.indent"})),!0),X8=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Ek(n,(t,r)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let s=$c(i,n.tabSize),o=0,a=wd(n,Math.max(0,s-cl(n)));for(;o<i.length&&o<a.length&&i.charCodeAt(o)==a.charCodeAt(o);)o++;r.push({from:t.from+o,to:t.from+i.length,insert:a.slice(o)})}),{userEvent:"delete.dedent"})),!0),UG=n=>(n.setTabFocusMode(),!0),HG=[{key:"Ctrl-b",run:R8,shift:F8,preventDefault:!0},{key:"Ctrl-f",run:A8,shift:N8},{key:"Ctrl-p",run:M8,shift:j8},{key:"Ctrl-n",run:O8,shift:$8},{key:"Ctrl-a",run:hG,shift:SG},{key:"Ctrl-e",run:dG,shift:CG},{key:"Ctrl-d",run:U8},{key:"Ctrl-h",run:o_},{key:"Ctrl-k",run:MG},{key:"Ctrl-Alt-h",run:V8},{key:"Ctrl-o",run:IG},{key:"Ctrl-t",run:LG},{key:"Ctrl-v",run:s_}],VG=[{key:"ArrowLeft",run:R8,shift:F8,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:rG,shift:mG,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:cG,shift:kG,preventDefault:!0},{key:"ArrowRight",run:A8,shift:N8,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:iG,shift:vG,preventDefault:!0},{mac:"Cmd-ArrowRight",run:fG,shift:xG,preventDefault:!0},{key:"ArrowUp",run:M8,shift:j8,preventDefault:!0},{mac:"Cmd-ArrowUp",run:S3,shift:E3},{mac:"Ctrl-ArrowUp",run:_3,shift:k3},{key:"ArrowDown",run:O8,shift:$8,preventDefault:!0},{mac:"Cmd-ArrowDown",run:C3,shift:R3},{mac:"Ctrl-ArrowDown",run:s_,shift:x3},{key:"PageUp",run:_3,shift:k3},{key:"PageDown",run:s_,shift:x3},{key:"Home",run:lG,shift:_G,preventDefault:!0},{key:"Mod-Home",run:S3,shift:E3},{key:"End",run:uG,shift:wG,preventDefault:!0},{key:"Mod-End",run:C3,shift:R3},{key:"Enter",run:A3,shift:A3},{key:"Mod-a",run:EG},{key:"Backspace",run:o_,shift:o_},{key:"Delete",run:U8},{key:"Mod-Backspace",mac:"Alt-Backspace",run:V8},{key:"Mod-Delete",mac:"Alt-Delete",run:TG},{mac:"Mod-Backspace",run:OG},{mac:"Mod-Delete",run:PG}].concat(HG.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),GG=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:oG,shift:yG},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:aG,shift:bG},{key:"Alt-ArrowUp",run:FG},{key:"Shift-Alt-ArrowUp",run:BG},{key:"Alt-ArrowDown",run:NG},{key:"Shift-Alt-ArrowDown",run:qG},{key:"Escape",run:DG},{key:"Mod-Enter",run:WG},{key:"Alt-l",mac:"Ctrl-l",run:RG},{key:"Mod-i",run:AG,preventDefault:!0},{key:"Mod-[",run:X8},{key:"Mod-]",run:Y8},{key:"Mod-Alt-\\",run:zG},{key:"Shift-Mod-k",run:jG},{key:"Shift-Mod-\\",run:gG},{key:"Mod-/",run:BV},{key:"Alt-A",run:jV},{key:"Ctrl-m",mac:"Shift-Alt-m",run:UG}].concat(VG),KG={key:"Tab",run:Y8,shift:X8},D3=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var hb,T3;function JG(){if(T3)return hb;T3=1,hb=n;function n(r,i,s){r instanceof RegExp&&(r=e(r,s)),i instanceof RegExp&&(i=e(i,s));var o=t(r,i,s);return o&&{start:o[0],end:o[1],pre:s.slice(0,o[0]),body:s.slice(o[0]+r.length,o[1]),post:s.slice(o[1]+i.length)}}function e(r,i){var s=i.match(r);return s?s[0]:null}n.range=t;function t(r,i,s){var o,a,u,l,c,f=s.indexOf(r),d=s.indexOf(i,f+1),g=f;if(f>=0&&d>0){if(r===i)return[f,d];for(o=[],u=s.length;g>=0&&!c;)g==f?(o.push(g),f=s.indexOf(r,g+1)):o.length==1?c=[o.pop(),d]:(a=o.pop(),a<u&&(u=a,l=d),d=s.indexOf(i,g+1)),g=f<d&&f>=0?f:d;o.length&&(c=[u,l])}return c}return hb}var db,M3;function YG(){if(M3)return db;M3=1;var n=JG();db=c;var e="\0SLASH"+Math.random()+"\0",t="\0OPEN"+Math.random()+"\0",r="\0CLOSE"+Math.random()+"\0",i="\0COMMA"+Math.random()+"\0",s="\0PERIOD"+Math.random()+"\0";function o(b){return parseInt(b,10)==b?parseInt(b,10):b.charCodeAt(0)}function a(b){return b.split("\\\\").join(e).split("\\{").join(t).split("\\}").join(r).split("\\,").join(i).split("\\.").join(s)}function u(b){return b.split(e).join("\\").split(t).join("{").split(r).join("}").split(i).join(",").split(s).join(".")}function l(b){if(!b)return[""];var w=[],S=n("{","}",b);if(!S)return b.split(",");var k=S.pre,x=S.body,C=S.post,R=k.split(",");R[R.length-1]+="{"+x+"}";var P=l(C);return C.length&&(R[R.length-1]+=P.shift(),R.push.apply(R,P)),w.push.apply(w,R),w}function c(b){return b?(b.substr(0,2)==="{}"&&(b="\\{\\}"+b.substr(2)),y(a(b),!0).map(u)):[]}function f(b){return"{"+b+"}"}function d(b){return/^-?0\d/.test(b)}function g(b,w){return b<=w}function m(b,w){return b>=w}function y(b,w){var S=[],k=n("{","}",b);if(!k)return[b];var x=k.pre,C=k.post.length?y(k.post,!1):[""];if(/\$$/.test(k.pre))for(var R=0;R<C.length;R++){var P=x+"{"+k.body+"}"+C[R];S.push(P)}else{var q=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(k.body),B=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(k.body),G=q||B,V=k.body.indexOf(",")>=0;if(!G&&!V)return k.post.match(/,.*\}/)?(b=k.pre+"{"+k.body+r+k.post,y(b)):[b];var F;if(G)F=k.body.split(/\.\./);else if(F=l(k.body),F.length===1&&(F=y(F[0],!1).map(f),F.length===1))return C.map(function(Jt){return k.pre+F[0]+Jt});var A;if(G){var Y=o(F[0]),N=o(F[1]),ee=Math.max(F[0].length,F[1].length),oe=F.length==3?Math.abs(o(F[2])):1,be=g,ve=N<Y;ve&&(oe*=-1,be=m);var De=F.some(d);A=[];for(var we=Y;be(we,N);we+=oe){var Ie;if(B)Ie=String.fromCharCode(we),Ie==="\\"&&(Ie="");else if(Ie=String(we),De){var Rt=ee-Ie.length;if(Rt>0){var wt=new Array(Rt+1).join("0");we<0?Ie="-"+wt+Ie.slice(1):Ie=wt+Ie}}A.push(Ie)}}else{A=[];for(var tt=0;tt<F.length;tt++)A.push.apply(A,y(F[tt],!1))}for(var tt=0;tt<A.length;tt++)for(var R=0;R<C.length;R++){var P=x+A[tt]+C[R];(!w||G||P)&&S.push(P)}}return S}return db}var XG=YG();const ZG=hH(XG),QG=1024*64,jm=n=>{if(typeof n!="string")throw new TypeError("invalid pattern");if(n.length>QG)throw new TypeError("pattern is too long")},eK={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Yf=n=>n.replace(/[[\]\\-]/g,"\\$&"),tK=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),O3=n=>n.join(""),nK=(n,e)=>{const t=e;if(n.charAt(t)!=="[")throw new Error("not in a brace expression");const r=[],i=[];let s=t+1,o=!1,a=!1,u=!1,l=!1,c=t,f="";e:for(;s<n.length;){const y=n.charAt(s);if((y==="!"||y==="^")&&s===t+1){l=!0,s++;continue}if(y==="]"&&o&&!u){c=s+1;break}if(o=!0,y==="\\"&&!u){u=!0,s++;continue}if(y==="["&&!u){for(const[b,[w,S,k]]of Object.entries(eK))if(n.startsWith(b,s)){if(f)return["$.",!1,n.length-t,!0];s+=b.length,k?i.push(w):r.push(w),a=a||S;continue e}}if(u=!1,f){y>f?r.push(Yf(f)+"-"+Yf(y)):y===f&&r.push(Yf(y)),f="",s++;continue}if(n.startsWith("-]",s+1)){r.push(Yf(y+"-")),s+=2;continue}if(n.startsWith("-",s+1)){f=y,s+=2;continue}r.push(Yf(y)),s++}if(c<s)return["",!1,0,!1];if(!r.length&&!i.length)return["$.",!1,n.length-t,!0];if(i.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!l){const y=r[0].length===2?r[0].slice(-1):r[0];return[tK(y),!1,c-t,!1]}const d="["+(l?"^":"")+O3(r)+"]",g="["+(l?"":"^")+O3(i)+"]";return[r.length&&i.length?"("+d+"|"+g+")":r.length?d:g,a,c-t,!0]},Hh=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/\[([^\/\\])\]/g,"$1"):n.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"),rK=new Set(["!","?","+","*","@"]),P3=n=>rK.has(n),iK="(?!(?:^|/)\\.\\.?(?:$|/))",z0="(?!\\.)",sK=new Set(["[","."]),oK=new Set(["..","."]),aK=new Set("().*{}+?[]^$\\!"),uK=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Rk="[^/]",I3=Rk+"*?",L3=Rk+"+?";class Ir{type;#n;#r;#s=!1;#e=[];#t;#o;#u;#a=!1;#i;#l;#f=!1;constructor(e,t,r={}){this.type=e,e&&(this.#r=!0),this.#t=t,this.#n=this.#t?this.#t.#n:this,this.#i=this.#n===this?r:this.#n.#i,this.#u=this.#n===this?[]:this.#n.#u,e==="!"&&!this.#n.#a&&this.#u.push(this),this.#o=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(const e of this.#e)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#l!==void 0?this.#l:this.type?this.#l=this.type+"("+this.#e.map(e=>String(e)).join("|")+")":this.#l=this.#e.map(e=>String(e)).join("")}#d(){if(this!==this.#n)throw new Error("should only call on root");if(this.#a)return this;this.toString(),this.#a=!0;let e;for(;e=this.#u.pop();){if(e.type!=="!")continue;let t=e,r=t.#t;for(;r;){for(let i=t.#o+1;!r.type&&i<r.#e.length;i++)for(const s of e.#e){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#e[i])}t=r,r=t.#t}}return this}push(...e){for(const t of e)if(t!==""){if(typeof t!="string"&&!(t instanceof Ir&&t.#t===this))throw new Error("invalid part: "+t);this.#e.push(t)}}toJSON(){const e=this.type===null?this.#e.slice().map(t=>typeof t=="string"?t:t.toJSON()):[this.type,...this.#e.map(t=>t.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#a&&this.#t?.type==="!")&&e.push({}),e}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#o===0)return!0;const e=this.#t;for(let t=0;t<this.#o;t++){const r=e.#e[t];if(!(r instanceof Ir&&r.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();const e=this.#t?this.#t.#e.length:0;return this.#o===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){const t=new Ir(this.type,e);for(const r of this.#e)t.copyIn(r);return t}static#c(e,t,r,i){let s=!1,o=!1,a=-1,u=!1;if(t.type===null){let g=r,m="";for(;g<e.length;){const y=e.charAt(g++);if(s||y==="\\"){s=!s,m+=y;continue}if(o){g===a+1?(y==="^"||y==="!")&&(u=!0):y==="]"&&!(g===a+2&&u)&&(o=!1),m+=y;continue}else if(y==="["){o=!0,a=g,u=!1,m+=y;continue}if(!i.noext&&P3(y)&&e.charAt(g)==="("){t.push(m),m="";const b=new Ir(y,t);g=Ir.#c(e,b,g,i),t.push(b);continue}m+=y}return t.push(m),g}let l=r+1,c=new Ir(null,t);const f=[];let d="";for(;l<e.length;){const g=e.charAt(l++);if(s||g==="\\"){s=!s,d+=g;continue}if(o){l===a+1?(g==="^"||g==="!")&&(u=!0):g==="]"&&!(l===a+2&&u)&&(o=!1),d+=g;continue}else if(g==="["){o=!0,a=l,u=!1,d+=g;continue}if(P3(g)&&e.charAt(l)==="("){c.push(d),d="";const m=new Ir(g,c);c.push(m),l=Ir.#c(e,m,l,i);continue}if(g==="|"){c.push(d),d="",f.push(c),c=new Ir(null,t);continue}if(g===")")return d===""&&t.#e.length===0&&(t.#f=!0),c.push(d),d="",t.push(...f,c),l;d+=g}return t.type=null,t.#r=void 0,t.#e=[e.substring(r-1)],l}static fromGlob(e,t={}){const r=new Ir(null,void 0,t);return Ir.#c(e,r,0,t),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();const e=this.toString(),[t,r,i,s]=this.toRegExpSource();if(!(i||this.#r||this.#i.nocase&&!this.#i.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;const a=(this.#i.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${t}$`,a),{_src:t,_glob:e})}get options(){return this.#i}toRegExpSource(e){const t=e??!!this.#i.dot;if(this.#n===this&&this.#d(),!this.type){const u=this.isStart()&&this.isEnd(),l=this.#e.map(g=>{const[m,y,b,w]=typeof g=="string"?Ir.#p(g,this.#r,u):g.toRegExpSource(e);return this.#r=this.#r||b,this.#s=this.#s||w,m}).join("");let c="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&oK.has(this.#e[0]))){const m=sK,y=t&&m.has(l.charAt(0))||l.startsWith("\\.")&&m.has(l.charAt(2))||l.startsWith("\\.\\.")&&m.has(l.charAt(4)),b=!t&&!e&&m.has(l.charAt(0));c=y?iK:b?z0:""}let f="";return this.isEnd()&&this.#n.#a&&this.#t?.type==="!"&&(f="(?:$|\\/)"),[c+l+f,Hh(l),this.#r=!!this.#r,this.#s]}const r=this.type==="*"||this.type==="+",i=this.type==="!"?"(?:(?!(?:":"(?:";let s=this.#h(t);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){const u=this.toString();return this.#e=[u],this.type=null,this.#r=void 0,[u,Hh(this.toString()),!1,!1]}let o=!r||e||t||!z0?"":this.#h(!0);o===s&&(o=""),o&&(s=`(?:${s})(?:${o})*?`);let a="";if(this.type==="!"&&this.#f)a=(this.isStart()&&!t?z0:"")+L3;else{const u=this.type==="!"?"))"+(this.isStart()&&!t&&!e?z0:"")+I3+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&o?")":this.type==="*"&&o?")?":`)${this.type}`;a=i+s+u}return[a,Hh(s),this.#r=!!this.#r,this.#s]}#h(e){return this.#e.map(t=>{if(typeof t=="string")throw new Error("string type in extglob ast??");const[r,i,s,o]=t.toRegExpSource(e);return this.#s=this.#s||o,r}).filter(t=>!(this.isStart()&&this.isEnd())||!!t).join("|")}static#p(e,t,r=!1){let i=!1,s="",o=!1;for(let a=0;a<e.length;a++){const u=e.charAt(a);if(i){i=!1,s+=(aK.has(u)?"\\":"")+u;continue}if(u==="\\"){a===e.length-1?s+="\\\\":i=!0;continue}if(u==="["){const[l,c,f,d]=nK(e,a);if(f){s+=l,o=o||c,a+=f-1,t=t||d;continue}}if(u==="*"){r&&e==="*"?s+=L3:s+=I3,t=!0;continue}if(u==="?"){s+=Rk,t=!0;continue}s+=uK(u)}return[s,Hh(e),!!t,o]}}const lK=(n,{windowsPathsNoEscape:e=!1}={})=>e?n.replace(/[?*()[\]]/g,"[$&]"):n.replace(/[?*()[\]\\]/g,"\\$&");var pb={};const $r=(n,e,t={})=>(jm(e),!t.nocomment&&e.charAt(0)==="#"?!1:new V1(e,t).match(n)),cK=/^\*+([^+@!?\*\[\(]*)$/,fK=n=>e=>!e.startsWith(".")&&e.endsWith(n),hK=n=>e=>e.endsWith(n),dK=n=>(n=n.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(n)),pK=n=>(n=n.toLowerCase(),e=>e.toLowerCase().endsWith(n)),gK=/^\*+\.\*+$/,mK=n=>!n.startsWith(".")&&n.includes("."),vK=n=>n!=="."&&n!==".."&&n.includes("."),yK=/^\.\*+$/,bK=n=>n!=="."&&n!==".."&&n.startsWith("."),wK=/^\*+$/,_K=n=>n.length!==0&&!n.startsWith("."),kK=n=>n.length!==0&&n!=="."&&n!=="..",xK=/^\?+([^+@!?\*\[\(]*)?$/,SK=([n,e=""])=>{const t=Z8([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},CK=([n,e=""])=>{const t=Q8([n]);return e?(e=e.toLowerCase(),r=>t(r)&&r.toLowerCase().endsWith(e)):t},EK=([n,e=""])=>{const t=Q8([n]);return e?r=>t(r)&&r.endsWith(e):t},RK=([n,e=""])=>{const t=Z8([n]);return e?r=>t(r)&&r.endsWith(e):t},Z8=([n])=>{const e=n.length;return t=>t.length===e&&!t.startsWith(".")},Q8=([n])=>{const e=n.length;return t=>t.length===e&&t!=="."&&t!==".."},e4=typeof process=="object"&&process?typeof pb=="object"&&pb&&pb.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",F3={win32:{sep:"\\"},posix:{sep:"/"}},AK=e4==="win32"?F3.win32.sep:F3.posix.sep;$r.sep=AK;const $i=Symbol("globstar **");$r.GLOBSTAR=$i;const DK="[^/]",TK=DK+"*?",MK="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",OK="(?:(?!(?:\\/|^)\\.).)*?",PK=(n,e={})=>t=>$r(t,n,e);$r.filter=PK;const qi=(n,e={})=>Object.assign({},n,e),IK=n=>{if(!n||typeof n!="object"||!Object.keys(n).length)return $r;const e=$r;return Object.assign((r,i,s={})=>e(r,i,qi(n,s)),{Minimatch:class extends e.Minimatch{constructor(i,s={}){super(i,qi(n,s))}static defaults(i){return e.defaults(qi(n,i)).Minimatch}},AST:class extends e.AST{constructor(i,s,o={}){super(i,s,qi(n,o))}static fromGlob(i,s={}){return e.AST.fromGlob(i,qi(n,s))}},unescape:(r,i={})=>e.unescape(r,qi(n,i)),escape:(r,i={})=>e.escape(r,qi(n,i)),filter:(r,i={})=>e.filter(r,qi(n,i)),defaults:r=>e.defaults(qi(n,r)),makeRe:(r,i={})=>e.makeRe(r,qi(n,i)),braceExpand:(r,i={})=>e.braceExpand(r,qi(n,i)),match:(r,i,s={})=>e.match(r,i,qi(n,s)),sep:e.sep,GLOBSTAR:$i})};$r.defaults=IK;const t4=(n,e={})=>(jm(n),e.nobrace||!/\{(?:(?!\{).)*\}/.test(n)?[n]:ZG(n));$r.braceExpand=t4;const LK=(n,e={})=>new V1(n,e).makeRe();$r.makeRe=LK;const FK=(n,e,t={})=>{const r=new V1(e,t);return n=n.filter(i=>r.match(i)),r.options.nonull&&!n.length&&n.push(e),n};$r.match=FK;const N3=/[?*]|[+@!]\(.*?\)|\[|\]/,NK=n=>n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class V1{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(e,t={}){jm(e),t=t||{},this.options=t,this.pattern=e,this.platform=t.platform||e4,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!t.windowsPathsNoEscape||t.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!t.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!t.nonegate,this.comment=!1,this.empty=!1,this.partial=!!t.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=t.windowsNoMagicRoot!==void 0?t.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(const e of this.set)for(const t of e)if(typeof t!="string")return!0;return!1}debug(...e){}make(){const e=this.pattern,t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],t.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);const r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let i=this.globParts.map((s,o,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){const u=s[0]===""&&s[1]===""&&(s[2]==="?"||!N3.test(s[2]))&&!N3.test(s[3]),l=/^[a-z]:/i.test(s[0]);if(u)return[...s.slice(0,4),...s.slice(4).map(c=>this.parse(c))];if(l)return[s[0],...s.slice(1).map(c=>this.parse(c))]}return s.map(u=>this.parse(u))});if(this.debug(this.pattern,i),this.set=i.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){const o=this.set[s];o[0]===""&&o[1]===""&&this.globParts[s][2]==="?"&&typeof o[3]=="string"&&/^[a-z]:$/i.test(o[3])&&(o[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]==="**"&&(e[r][i]="*");const{optimizationLevel:t=1}=this.options;return t>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):t>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(t=>{let r=-1;for(;(r=t.indexOf("**",r+1))!==-1;){let i=r;for(;t[i+1]==="**";)i++;i!==r&&t.splice(r,i-r)}return t})}levelOneOptimize(e){return e.map(t=>(t=t.reduce((r,i)=>{const s=r[r.length-1];return i==="**"&&s==="**"?r:i===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(i),r)},[]),t.length===0?[""]:t))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let t=!1;do{if(t=!1,!this.preserveMultipleSlashes){for(let i=1;i<e.length-1;i++){const s=e[i];i===1&&s===""&&e[0]===""||(s==="."||s==="")&&(t=!0,e.splice(i,1),i--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(t=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){const i=e[r-1];i&&i!=="."&&i!==".."&&i!=="**"&&(t=!0,e.splice(r-1,2),r-=2)}}while(t);return e.length===0?[""]:e}firstPhasePreProcess(e){let t=!1;do{t=!1;for(let r of e){let i=-1;for(;(i=r.indexOf("**",i+1))!==-1;){let o=i;for(;r[o+1]==="**";)o++;o>i&&r.splice(i+1,o-i);let a=r[i+1];const u=r[i+2],l=r[i+3];if(a!==".."||!u||u==="."||u===".."||!l||l==="."||l==="..")continue;t=!0,r.splice(i,1);const c=r.slice(0);c[i]="**",e.push(c),i--}if(!this.preserveMultipleSlashes){for(let o=1;o<r.length-1;o++){const a=r[o];o===1&&a===""&&r[0]===""||(a==="."||a==="")&&(t=!0,r.splice(o,1),o--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(t=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){const o=r[s-1];if(o&&o!=="."&&o!==".."&&o!=="**"){t=!0;const u=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...u),r.length===0&&r.push(""),s-=2}}}}while(t);return e}secondPhasePreProcess(e){for(let t=0;t<e.length-1;t++)for(let r=t+1;r<e.length;r++){const i=this.partsMatch(e[t],e[r],!this.preserveMultipleSlashes);if(i){e[t]=[],e[r]=i;break}}return e.filter(t=>t.length)}partsMatch(e,t,r=!1){let i=0,s=0,o=[],a="";for(;i<e.length&&s<t.length;)if(e[i]===t[s])o.push(a==="b"?t[s]:e[i]),i++,s++;else if(r&&e[i]==="**"&&t[s]===e[i+1])o.push(e[i]),i++;else if(r&&t[s]==="**"&&e[i]===t[s+1])o.push(t[s]),s++;else if(e[i]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(a==="b")return!1;a="a",o.push(e[i]),i++,s++}else if(t[s]==="*"&&e[i]&&(this.options.dot||!e[i].startsWith("."))&&e[i]!=="**"){if(a==="a")return!1;a="b",o.push(t[s]),i++,s++}else return!1;return e.length===t.length&&o}parseNegate(){if(this.nonegate)return;const e=this.pattern;let t=!1,r=0;for(let i=0;i<e.length&&e.charAt(i)==="!";i++)t=!t,r++;r&&(this.pattern=e.slice(r)),this.negate=t}matchOne(e,t,r=!1){const i=this.options;if(this.isWindows){const y=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),b=!y&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),w=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),S=!w&&t[0]===""&&t[1]===""&&t[2]==="?"&&typeof t[3]=="string"&&/^[a-z]:$/i.test(t[3]),k=b?3:y?0:void 0,x=S?3:w?0:void 0;if(typeof k=="number"&&typeof x=="number"){const[C,R]=[e[k],t[x]];C.toLowerCase()===R.toLowerCase()&&(t[x]=C,x>k?t=t.slice(x):k>x&&(e=e.slice(k)))}}const{optimizationLevel:s=1}=this.options;s>=2&&(e=this.levelTwoFileOptimize(e)),this.debug("matchOne",this,{file:e,pattern:t}),this.debug("matchOne",e.length,t.length);for(var o=0,a=0,u=e.length,l=t.length;o<u&&a<l;o++,a++){this.debug("matchOne loop");var c=t[a],f=e[o];if(this.debug(t,c,f),c===!1)return!1;if(c===$i){this.debug("GLOBSTAR",[t,c,f]);var d=o,g=a+1;if(g===l){for(this.debug("** at the end");o<u;o++)if(e[o]==="."||e[o]===".."||!i.dot&&e[o].charAt(0)===".")return!1;return!0}for(;d<u;){var m=e[d];if(this.debug(`
|
|
67
|
-
globstar while`,e,d,t,g,m),this.matchOne(e.slice(d),t.slice(g),r))return this.debug("globstar found match!",d,u,m),!0;if(m==="."||m===".."||!i.dot&&m.charAt(0)==="."){this.debug("dot detected!",e,d,t,g);break}this.debug("globstar swallow a segment, and continue"),d++}return!!(r&&(this.debug(`
|
|
68
|
-
>>> no match, partial?`,e,d,t,g),d===u))}let y;if(typeof c=="string"?(y=f===c,this.debug("string match",c,f,y)):(y=c.test(f),this.debug("pattern match",c,f,y)),!y)return!1}if(o===u&&a===l)return!0;if(o===u)return r;if(a===l)return o===u-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return t4(this.pattern,this.options)}parse(e){jm(e);const t=this.options;if(e==="**")return $i;if(e==="")return"";let r,i=null;(r=e.match(wK))?i=t.dot?kK:_K:(r=e.match(cK))?i=(t.nocase?t.dot?pK:dK:t.dot?hK:fK)(r[1]):(r=e.match(xK))?i=(t.nocase?t.dot?CK:SK:t.dot?EK:RK)(r):(r=e.match(gK))?i=t.dot?vK:mK:(r=e.match(yK))&&(i=bK);const s=Ir.fromGlob(e,this.options).toMMPattern();return i&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:i}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;const e=this.set;if(!e.length)return this.regexp=!1,this.regexp;const t=this.options,r=t.noglobstar?TK:t.dot?MK:OK,i=new Set(t.nocase?["i"]:[]);let s=e.map(u=>{const l=u.map(c=>{if(c instanceof RegExp)for(const f of c.flags.split(""))i.add(f);return typeof c=="string"?NK(c):c===$i?$i:c._src});return l.forEach((c,f)=>{const d=l[f+1],g=l[f-1];c!==$i||g===$i||(g===void 0?d!==void 0&&d!==$i?l[f+1]="(?:\\/|"+r+"\\/)?"+d:l[f]=r:d===void 0?l[f-1]=g+"(?:\\/|"+r+")?":d!==$i&&(l[f-1]=g+"(?:\\/|\\/"+r+"\\/)"+d,l[f+1]=$i))}),l.filter(c=>c!==$i).join("/")}).join("|");const[o,a]=e.length>1?["(?:",")"]:["",""];s="^"+o+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...i].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,t=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&t)return!0;const r=this.options;this.isWindows&&(e=e.split("\\").join("/"));const i=this.slashSplit(e);this.debug(this.pattern,"split",i);const s=this.set;this.debug(this.pattern,"set",s);let o=i[i.length-1];if(!o)for(let a=i.length-2;!o&&a>=0;a--)o=i[a];for(let a=0;a<s.length;a++){const u=s[a];let l=i;if(r.matchBase&&u.length===1&&(l=[o]),this.matchOne(l,u,t))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return $r.defaults(e).Minimatch}}$r.AST=Ir;$r.Minimatch=V1;$r.escape=lK;$r.unescape=Hh;var Xf={},Zf={},B3;function BK(){if(B3)return Zf;B3=1,Object.defineProperty(Zf,"__esModule",{value:!0}),Zf.isFloat32=void 0;const n=new DataView(new ArrayBuffer(4)),e=t=>(n.setFloat32(0,t),t===n.getFloat32(0));return Zf.isFloat32=e,Zf}var Qf={},q3;function n4(){if(q3)return Qf;q3=1,Object.defineProperty(Qf,"__esModule",{value:!0}),Qf.JsonPackExtension=void 0;let n=class{constructor(t,r){this.tag=t,this.val=r}};return Qf.JsonPackExtension=n,Qf}var eh={},th={},nh={},j3;function qK(){if(j3)return nh;j3=1,Object.defineProperty(nh,"__esModule",{value:!0}),nh.Slice=void 0;let n=class{constructor(t,r,i,s){this.uint8=t,this.view=r,this.start=i,this.end=s}subarray(){return this.uint8.subarray(this.start,this.end)}};return nh.Slice=n,nh}var $3;function r4(){if($3)return th;$3=1,Object.defineProperty(th,"__esModule",{value:!0}),th.Writer=void 0;const n=qK(),e=new Uint8Array([]),t=new DataView(e.buffer),r=typeof Buffer=="function",i=r?Buffer.prototype.utf8Write:null,s=r?Buffer.from:null,o=typeof TextEncoder<"u"?new TextEncoder:null;let a=class{constructor(l=64*1024){this.allocSize=l,this.view=t,this.x0=0,this.x=0,this.uint8=new Uint8Array(l),this.size=l,this.view=new DataView(this.uint8.buffer)}grow(l){const c=this.x0,f=this.x,d=this.uint8,g=new Uint8Array(l),m=new DataView(g.buffer),y=d.subarray(c,f);g.set(y,0),this.x=f-c,this.x0=0,this.uint8=g,this.size=l,this.view=m}ensureCapacity(l){const c=this.size,f=c-this.x;if(f<l){const d=c-this.x0,g=l-f,m=d+g;this.grow(m<=this.allocSize?this.allocSize:m*2)}}move(l){this.ensureCapacity(l),this.x+=l}reset(){this.x0=this.x}newBuffer(l){const c=this.uint8=new Uint8Array(l);this.size=l,this.view=new DataView(c.buffer),this.x=this.x0=0}flush(){const l=this.uint8.subarray(this.x0,this.x);return this.x0=this.x,l}flushSlice(){const l=new n.Slice(this.uint8,this.view,this.x0,this.x);return this.x0=this.x,l}u8(l){this.ensureCapacity(1),this.uint8[this.x++]=l}u16(l){this.ensureCapacity(2),this.view.setUint16(this.x,l),this.x+=2}u32(l){this.ensureCapacity(4),this.view.setUint32(this.x,l),this.x+=4}i32(l){this.ensureCapacity(4),this.view.setInt32(this.x,l),this.x+=4}u64(l){this.ensureCapacity(8),this.view.setBigUint64(this.x,BigInt(l)),this.x+=8}f64(l){this.ensureCapacity(8),this.view.setFloat64(this.x,l),this.x+=8}u8u16(l,c){this.ensureCapacity(3);let f=this.x;this.uint8[f++]=l,this.uint8[f++]=c>>>8,this.uint8[f++]=c&255,this.x=f}u8u32(l,c){this.ensureCapacity(5);let f=this.x;this.uint8[f++]=l,this.view.setUint32(f,c),this.x=f+4}u8u64(l,c){this.ensureCapacity(9);let f=this.x;this.uint8[f++]=l,this.view.setBigUint64(f,BigInt(c)),this.x=f+8}u8f32(l,c){this.ensureCapacity(5);let f=this.x;this.uint8[f++]=l,this.view.setFloat32(f,c),this.x=f+4}u8f64(l,c){this.ensureCapacity(9);let f=this.x;this.uint8[f++]=l,this.view.setFloat64(f,c),this.x=f+8}buf(l,c){this.ensureCapacity(c);const f=this.x;this.uint8.set(l,f),this.x=f+c}utf8(l){const c=l.length*4;if(c<168)return this.utf8Native(l);if(i){const f=i.call(this.uint8,l,this.x,c);return this.x+=f,f}else if(s){const f=this.uint8,d=f.byteOffset+this.x,m=s(f.buffer).subarray(d,d+c).write(l,0,c,"utf8");return this.x+=m,m}else if(c>1024&&o){const f=o.encodeInto(l,this.uint8.subarray(this.x,this.x+c)).written;return this.x+=f,f}return this.utf8Native(l)}utf8Native(l){const c=l.length,f=this.uint8;let d=this.x,g=0;for(;g<c;){let y=l.charCodeAt(g++);if((y&4294967168)===0){f[d++]=y;continue}else if((y&4294965248)===0)f[d++]=y>>6&31|192;else{if(y>=55296&&y<=56319&&g<c){const b=l.charCodeAt(g);(b&64512)===56320&&(g++,y=((y&1023)<<10)+(b&1023)+65536)}(y&4294901760)===0?(f[d++]=y>>12&15|224,f[d++]=y>>6&63|128):(f[d++]=y>>18&7|240,f[d++]=y>>12&63|128,f[d++]=y>>6&63|128)}f[d++]=y&63|128}const m=d-this.x;return this.x=d,m}ascii(l){const c=l.length;this.ensureCapacity(c);const f=this.uint8;let d=this.x,g=0;for(;g<c;)f[d++]=l.charCodeAt(g++);this.x=d}};return th.Writer=a,th}var W3;function jK(){if(W3)return eh;W3=1,Object.defineProperty(eh,"__esModule",{value:!0}),eh.CborEncoderFast=void 0;const n=r4(),e=Number.isSafeInteger;let t=class{constructor(i=new n.Writer){this.writer=i}encode(i){return this.writeAny(i),this.writer.flush()}encodeToSlice(i){return this.writeAny(i),this.writer.flushSlice()}writeAny(i){switch(typeof i){case"number":return this.writeNumber(i);case"string":return this.writeStr(i);case"boolean":return this.writer.u8(244+ +i);case"object":{if(!i)return this.writer.u8(246);switch(i.constructor){case Array:return this.writeArr(i);default:return this.writeObj(i)}}}}writeCbor(){this.writer.u8u16(217,55799)}writeEnd(){this.writer.u8(255)}writeNull(){this.writer.u8(246)}writeBoolean(i){i?this.writer.u8(245):this.writer.u8(244)}writeNumber(i){e(i)?this.writeInteger(i):typeof i=="bigint"?this.writeBigInt(i):this.writeFloat(i)}writeBigInt(i){i>=0?this.writeBigUint(i):this.writeBigSint(i)}writeBigUint(i){if(i<=Number.MAX_SAFE_INTEGER)return this.writeUInteger(Number(i));this.writer.u8u64(27,i)}writeBigSint(i){if(i>=Number.MIN_SAFE_INTEGER)return this.encodeNint(Number(i));const s=-BigInt(1)-i;this.writer.u8u64(59,s)}writeInteger(i){i>=0?this.writeUInteger(i):this.encodeNint(i)}writeUInteger(i){const s=this.writer;s.ensureCapacity(9);const o=s.uint8;let a=s.x;i<=23?o[a++]=0+i:i<=255?(o[a++]=24,o[a++]=i):i<=65535?(o[a++]=25,s.view.setUint16(a,i),a+=2):i<=4294967295?(o[a++]=26,s.view.setUint32(a,i),a+=4):(o[a++]=27,s.view.setBigUint64(a,BigInt(i)),a+=8),s.x=a}encodeNumber(i){this.writeNumber(i)}encodeInteger(i){this.writeInteger(i)}encodeUint(i){this.writeUInteger(i)}encodeNint(i){const s=-1-i,o=this.writer;o.ensureCapacity(9);const a=o.uint8;let u=o.x;s<24?a[u++]=32+s:s<=255?(a[u++]=56,a[u++]=s):s<=65535?(a[u++]=57,o.view.setUint16(u,s),u+=2):s<=4294967295?(a[u++]=58,o.view.setUint32(u,s),u+=4):(a[u++]=59,o.view.setBigUint64(u,BigInt(s)),u+=8),o.x=u}writeFloat(i){this.writer.u8f64(251,i)}writeBin(i){const s=i.length;this.writeBinHdr(s),this.writer.buf(i,s)}writeBinHdr(i){const s=this.writer;i<=23?s.u8(64+i):i<=255?s.u16(22528+i):i<=65535?s.u8u16(89,i):i<=4294967295?s.u8u32(90,i):s.u8u64(91,i)}writeStr(i){const s=this.writer,a=i.length*4;s.ensureCapacity(5+a);const u=s.uint8;let l=s.x;a<=23?s.x++:a<=255?(u[s.x++]=120,l=s.x,s.x++):a<=65535?(u[s.x++]=121,l=s.x,s.x+=2):(u[s.x++]=122,l=s.x,s.x+=4);const c=s.utf8(i);a<=23?u[l]=96+c:a<=255?u[l]=c:a<=65535?s.view.setUint16(l,c):s.view.setUint32(l,c)}writeStrHdr(i){const s=this.writer;i<=23?s.u8(96+i):i<=255?s.u16(30720+i):i<=65535?s.u8u16(121,i):s.u8u32(122,i)}writeAsciiStr(i){this.writeStrHdr(i.length),this.writer.ascii(i)}writeArr(i){const s=i.length;this.writeArrHdr(s);for(let o=0;o<s;o++)this.writeAny(i[o])}writeArrHdr(i){const s=this.writer;i<=23?s.u8(128+i):i<=255?s.u16(38912+i):i<=65535?s.u8u16(153,i):i<=4294967295?s.u8u32(154,i):s.u8u64(155,i)}writeObj(i){const s=Object.keys(i),o=s.length;this.writeObjHdr(o);for(let a=0;a<o;a++){const u=s[a];this.writeStr(u),this.writeAny(i[u])}}writeObjHdr(i){const s=this.writer;i<=23?s.u8(160+i):i<=255?s.u16(47104+i):i<=65535?s.u8u16(185,i):i<=4294967295?s.u8u32(186,i):s.u8u64(187,i)}writeMapHdr(i){this.writeObjHdr(i)}writeStartMap(){this.writer.u8(191)}writeTag(i,s){this.writeTagHdr(i),this.writeAny(s)}writeTagHdr(i){const s=this.writer;i<=23?s.u8(192+i):i<=255?s.u16(55296+i):i<=65535?s.u8u16(217,i):i<=4294967295?s.u8u32(218,i):s.u8u64(219,i)}writeTkn(i){const s=this.writer;i<=23?s.u8(224+i):i<=255&&s.u16(63488+i)}writeStartStr(){this.writer.u8(127)}writeStrChunk(i){throw new Error("Not implemented")}writeEndStr(){throw new Error("Not implemented")}writeStartBin(){this.writer.u8(95)}writeBinChunk(i){throw new Error("Not implemented")}writeEndBin(){throw new Error("Not implemented")}writeStartArr(){this.writer.u8(159)}writeArrChunk(i){throw new Error("Not implemented")}writeEndArr(){this.writer.u8(255)}writeStartObj(){this.writer.u8(191)}writeObjChunk(i,s){throw new Error("Not implemented")}writeEndObj(){this.writer.u8(255)}};return eh.CborEncoderFast=t,eh}var rh={},z3;function Ak(){if(z3)return rh;z3=1,Object.defineProperty(rh,"__esModule",{value:!0}),rh.JsonPackValue=void 0;let n=class{constructor(t){this.val=t}};return rh.JsonPackValue=n,rh}var U3;function $K(){if(U3)return Xf;U3=1,Object.defineProperty(Xf,"__esModule",{value:!0}),Xf.CborEncoder=void 0;const n=BK(),e=n4(),t=jK(),r=Ak();let i=class extends t.CborEncoderFast{writeUnknown(o){this.writeNull()}writeAny(o){switch(typeof o){case"number":return this.writeNumber(o);case"string":return this.writeStr(o);case"boolean":return this.writer.u8(244+ +o);case"object":{if(!o)return this.writer.u8(246);switch(o.constructor){case Object:return this.writeObj(o);case Array:return this.writeArr(o);case Uint8Array:return this.writeBin(o);case Map:return this.writeMap(o);case e.JsonPackExtension:return this.writeTag(o.tag,o.val);case r.JsonPackValue:const u=o.val;return this.writer.buf(u,u.length);default:return o instanceof Uint8Array?this.writeBin(o):Array.isArray(o)?this.writeArr(o):o instanceof Map?this.writeMap(o):this.writeUnknown(o)}}case"undefined":return this.writeUndef();case"bigint":return this.writeBigInt(o);default:return this.writeUnknown(o)}}writeFloat(o){(0,n.isFloat32)(o)?this.writer.u8f32(250,o):this.writer.u8f64(251,o)}writeMap(o){this.writeMapHdr(o.size),o.forEach((a,u)=>{this.writeAny(u),this.writeAny(a)})}writeUndef(){this.writer.u8(247)}};return Xf.CborEncoder=i,Xf}var WK=$K(),ih={},sh={},a_=function(n,e){return a_=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])},a_(n,e)};function i4(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");a_(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var $m=function(){return $m=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++){t=arguments[r];for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s])}return e},$m.apply(this,arguments)};function s4(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(n);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(n,r[i])&&(t[r[i]]=n[r[i]]);return t}function o4(n,e,t,r){var i=arguments.length,s=i<3?e:r===null?r=Object.getOwnPropertyDescriptor(e,t):r,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(n,e,t,r);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(i<3?o(s):i>3?o(e,t,s):o(e,t))||s);return i>3&&s&&Object.defineProperty(e,t,s),s}function a4(n,e){return function(t,r){e(t,r,n)}}function u4(n,e,t,r,i,s){function o(w){if(w!==void 0&&typeof w!="function")throw new TypeError("Function expected");return w}for(var a=r.kind,u=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&n?r.static?n:n.prototype:null,c=e||(l?Object.getOwnPropertyDescriptor(l,r.name):{}),f,d=!1,g=t.length-1;g>=0;g--){var m={};for(var y in r)m[y]=y==="access"?{}:r[y];for(var y in r.access)m.access[y]=r.access[y];m.addInitializer=function(w){if(d)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(w||null))};var b=(0,t[g])(a==="accessor"?{get:c.get,set:c.set}:c[u],m);if(a==="accessor"){if(b===void 0)continue;if(b===null||typeof b!="object")throw new TypeError("Object expected");(f=o(b.get))&&(c.get=f),(f=o(b.set))&&(c.set=f),(f=o(b.init))&&i.unshift(f)}else(f=o(b))&&(a==="field"?i.unshift(f):c[u]=f)}l&&Object.defineProperty(l,r.name,c),d=!0}function l4(n,e,t){for(var r=arguments.length>2,i=0;i<e.length;i++)t=r?e[i].call(n,t):e[i].call(n);return r?t:void 0}function c4(n){return typeof n=="symbol"?n:"".concat(n)}function f4(n,e,t){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(n,"name",{configurable:!0,value:t?"".concat(t," ",e):e})}function h4(n,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,e)}function d4(n,e,t,r){function i(s){return s instanceof t?s:new t(function(o){o(s)})}return new(t||(t=Promise))(function(s,o){function a(c){try{l(r.next(c))}catch(f){o(f)}}function u(c){try{l(r.throw(c))}catch(f){o(f)}}function l(c){c.done?s(c.value):i(c.value).then(a,u)}l((r=r.apply(n,e||[])).next())})}function p4(n,e){var t={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=a(0),o.throw=a(1),o.return=a(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(c){return u([l,c])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(t=0)),t;)try{if(r=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return t.label++,{value:l[1],done:!1};case 5:t.label++,i=l[1],l=[0];continue;case 7:l=t.ops.pop(),t.trys.pop();continue;default:if(s=t.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){t.label=l[1];break}if(l[0]===6&&t.label<s[1]){t.label=s[1],s=l;break}if(s&&t.label<s[2]){t.label=s[2],t.ops.push(l);break}s[2]&&t.ops.pop(),t.trys.pop();continue}l=e.call(n,t)}catch(c){l=[6,c],i=0}finally{r=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var G1=Object.create?function(n,e,t,r){r===void 0&&(r=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,r,i)}:function(n,e,t,r){r===void 0&&(r=t),n[r]=e[t]};function g4(n,e){for(var t in n)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&G1(e,n,t)}function Wm(n){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&n[e],r=0;if(t)return t.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&r>=n.length&&(n=void 0),{value:n&&n[r++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Dk(n,e){var t=typeof Symbol=="function"&&n[Symbol.iterator];if(!t)return n;var r=t.call(n),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(o)throw o.error}}return s}function m4(){for(var n=[],e=0;e<arguments.length;e++)n=n.concat(Dk(arguments[e]));return n}function v4(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var r=Array(n),i=0,e=0;e<t;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)r[i]=s[o];return r}function y4(n,e,t){if(t||arguments.length===2)for(var r=0,i=e.length,s;r<i;r++)(s||!(r in e))&&(s||(s=Array.prototype.slice.call(e,0,r)),s[r]=e[r]);return n.concat(s||Array.prototype.slice.call(e))}function Rc(n){return this instanceof Rc?(this.v=n,this):new Rc(n)}function b4(n,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=t.apply(n,e||[]),i,s=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),i[Symbol.asyncIterator]=function(){return this},i;function o(g){return function(m){return Promise.resolve(m).then(g,f)}}function a(g,m){r[g]&&(i[g]=function(y){return new Promise(function(b,w){s.push([g,y,b,w])>1||u(g,y)})},m&&(i[g]=m(i[g])))}function u(g,m){try{l(r[g](m))}catch(y){d(s[0][3],y)}}function l(g){g.value instanceof Rc?Promise.resolve(g.value.v).then(c,f):d(s[0][2],g)}function c(g){u("next",g)}function f(g){u("throw",g)}function d(g,m){g(m),s.shift(),s.length&&u(s[0][0],s[0][1])}}function w4(n){var e,t;return e={},r("next"),r("throw",function(i){throw i}),r("return"),e[Symbol.iterator]=function(){return this},e;function r(i,s){e[i]=n[i]?function(o){return(t=!t)?{value:Rc(n[i](o)),done:!1}:s?s(o):o}:s}}function _4(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],t;return e?e.call(n):(n=typeof Wm=="function"?Wm(n):n[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(s){t[s]=n[s]&&function(o){return new Promise(function(a,u){o=n[s](o),i(a,u,o.done,o.value)})}}function i(s,o,a,u){Promise.resolve(u).then(function(l){s({value:l,done:a})},o)}}function k4(n,e){return Object.defineProperty?Object.defineProperty(n,"raw",{value:e}):n.raw=e,n}var zK=Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e},u_=function(n){return u_=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},u_(n)};function x4(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t=u_(n),r=0;r<t.length;r++)t[r]!=="default"&&G1(e,n,t[r]);return zK(e,n),e}function S4(n){return n&&n.__esModule?n:{default:n}}function C4(n,e,t,r){if(t==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!r:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?r:t==="a"?r.call(n):r?r.value:e.get(n)}function E4(n,e,t,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(n,t):i?i.value=t:e.set(n,t),t}function R4(n,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?e===n:n.has(e)}function A4(n,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var r,i;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");r=e[Symbol.asyncDispose]}if(r===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");r=e[Symbol.dispose],t&&(i=r)}if(typeof r!="function")throw new TypeError("Object not disposable.");i&&(r=function(){try{i.call(this)}catch(s){return Promise.reject(s)}}),n.stack.push({value:e,dispose:r,async:t})}else t&&n.stack.push({async:!0});return e}var UK=typeof SuppressedError=="function"?SuppressedError:function(n,e,t){var r=new Error(t);return r.name="SuppressedError",r.error=n,r.suppressed=e,r};function D4(n){function e(s){n.error=n.hasError?new UK(s,n.error,"An error was suppressed during disposal."):s,n.hasError=!0}var t,r=0;function i(){for(;t=n.stack.pop();)try{if(!t.async&&r===1)return r=0,n.stack.push(t),Promise.resolve().then(i);if(t.dispose){var s=t.dispose.call(t.value);if(t.async)return r|=2,Promise.resolve(s).then(i,function(o){return e(o),i()})}else r|=1}catch(o){e(o)}if(r===1)return n.hasError?Promise.reject(n.error):Promise.resolve();if(n.hasError)throw n.error}return i()}function T4(n,e){return typeof n=="string"&&/^\.\.?\//.test(n)?n.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(t,r,i,s,o){return r?e?".jsx":".js":i&&(!s||!o)?t:i+s+"."+o.toLowerCase()+"js"}):n}const HK={__extends:i4,__assign:$m,__rest:s4,__decorate:o4,__param:a4,__esDecorate:u4,__runInitializers:l4,__propKey:c4,__setFunctionName:f4,__metadata:h4,__awaiter:d4,__generator:p4,__createBinding:G1,__exportStar:g4,__values:Wm,__read:Dk,__spread:m4,__spreadArrays:v4,__spreadArray:y4,__await:Rc,__asyncGenerator:b4,__asyncDelegator:w4,__asyncValues:_4,__makeTemplateObject:k4,__importStar:x4,__importDefault:S4,__classPrivateFieldGet:C4,__classPrivateFieldSet:E4,__classPrivateFieldIn:R4,__addDisposableResource:A4,__disposeResources:D4,__rewriteRelativeImportExtension:T4},VK=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:A4,get __assign(){return $m},__asyncDelegator:w4,__asyncGenerator:b4,__asyncValues:_4,__await:Rc,__awaiter:d4,__classPrivateFieldGet:C4,__classPrivateFieldIn:R4,__classPrivateFieldSet:E4,__createBinding:G1,__decorate:o4,__disposeResources:D4,__esDecorate:u4,__exportStar:g4,__extends:i4,__generator:p4,__importDefault:S4,__importStar:x4,__makeTemplateObject:k4,__metadata:h4,__param:a4,__propKey:c4,__read:Dk,__rest:s4,__rewriteRelativeImportExtension:T4,__runInitializers:l4,__setFunctionName:f4,__spread:m4,__spreadArray:y4,__spreadArrays:v4,__values:Wm,default:HK},Symbol.toStringTag,{value:"Module"})),K1=q1(VK);var oh={},H3;function GK(){if(H3)return oh;H3=1,Object.defineProperty(oh,"__esModule",{value:!0}),oh.decodeF16=void 0;const n=Math.pow,e=t=>{const r=(t&31744)>>10,i=t&1023;return(t>>15?-1:1)*(r?r===31?i?NaN:1/0:n(2,r-15)*(1+i/1024):6103515625e-14*(i/1024))};return oh.decodeF16=e,oh}var ah={},uh={},U0={},Cu={},V3;function KK(){if(V3)return Cu;V3=1,Object.defineProperty(Cu,"__esModule",{value:!0}),Cu.decodeAsciiMax15=Cu.decodeAscii=void 0;const n=String.fromCharCode,e=(r,i,s)=>{const o=[];for(let a=0;a<s;a++){const u=r[i++];if(u&128)return;o.push(u)}return n.apply(String,o)};Cu.decodeAscii=e;const t=(r,i,s)=>{if(s<4)if(s<2){if(s===0)return"";{const o=r[i++];if((o&128)>1){i-=1;return}return n(o)}}else{const o=r[i++],a=r[i++];if((o&128)>0||(a&128)>0){i-=2;return}if(s<3)return n(o,a);const u=r[i++];if((u&128)>0){i-=3;return}return n(o,a,u)}else{const o=r[i++],a=r[i++],u=r[i++],l=r[i++];if((o&128)>0||(a&128)>0||(u&128)>0||(l&128)>0){i-=4;return}if(s<6){if(s===4)return n(o,a,u,l);{const c=r[i++];if((c&128)>0){i-=5;return}return n(o,a,u,l,c)}}else if(s<8){const c=r[i++],f=r[i++];if((c&128)>0||(f&128)>0){i-=6;return}if(s<7)return n(o,a,u,l,c,f);const d=r[i++];if((d&128)>0){i-=7;return}return n(o,a,u,l,c,f,d)}else{const c=r[i++],f=r[i++],d=r[i++],g=r[i++];if((c&128)>0||(f&128)>0||(d&128)>0||(g&128)>0){i-=8;return}if(s<10){if(s===8)return n(o,a,u,l,c,f,d,g);{const m=r[i++];if((m&128)>0){i-=9;return}return n(o,a,u,l,c,f,d,g,m)}}else if(s<12){const m=r[i++],y=r[i++];if((m&128)>0||(y&128)>0){i-=10;return}if(s<11)return n(o,a,u,l,c,f,d,g,m,y);const b=r[i++];if((b&128)>0){i-=11;return}return n(o,a,u,l,c,f,d,g,m,y,b)}else{const m=r[i++],y=r[i++],b=r[i++],w=r[i++];if((m&128)>0||(y&128)>0||(b&128)>0||(w&128)>0){i-=12;return}if(s<14){if(s===12)return n(o,a,u,l,c,f,d,g,m,y,b,w);{const S=r[i++];if((S&128)>0){i-=13;return}return n(o,a,u,l,c,f,d,g,m,y,b,w,S)}}else{const S=r[i++],k=r[i++];if((S&128)>0||(k&128)>0){i-=14;return}if(s<15)return n(o,a,u,l,c,f,d,g,m,y,b,w,S,k);const x=r[i++];if((x&128)>0){i-=15;return}return n(o,a,u,l,c,f,d,g,m,y,b,w,S,k,x)}}}}};return Cu.decodeAsciiMax15=t,Cu}var H0={},G3;function JK(){if(G3)return H0;G3=1,Object.defineProperty(H0,"__esModule",{value:!0});const n=String.fromCharCode;return H0.default=(e,t,r)=>{let i=t;const s=i+r,o=[];for(;i<s;){let a=e[i++];if((a&128)!==0){const u=e[i++]&63;if((a&224)===192)a=(a&31)<<6|u;else{const l=e[i++]&63;if((a&240)===224)a=(a&31)<<12|u<<6|l;else if((a&248)===240){const c=e[i++]&63;let f=(a&7)<<18|u<<12|l<<6|c;if(f>65535){f-=65536;const d=f>>>10&1023|55296;a=56320|f&1023,o.push(d)}else a=f}}}o.push(a)}return n.apply(String,o)},H0}var K3;function YK(){if(K3)return U0;K3=1,Object.defineProperty(U0,"__esModule",{value:!0});const n=K1,e=KK(),t=n.__importDefault(JK()),r=typeof Buffer<"u",i=r?Buffer.prototype.utf8Slice:null,s=r?Buffer.from:null,o=(c,f,d)=>(0,e.decodeAsciiMax15)(c,f,d)??(0,t.default)(c,f,d),a=(c,f,d)=>(0,e.decodeAscii)(c,f,d)??(0,t.default)(c,f,d),u=i?(c,f,d)=>i.call(c,f,f+d):s?(c,f,d)=>s(c).subarray(f,f+d).toString("utf8"):t.default,l=(c,f,d)=>d<16?o(c,f,d):d<32?a(c,f,d):u(c,f,d);return U0.default=l,U0}var J3;function XK(){if(J3)return uh;J3=1,Object.defineProperty(uh,"__esModule",{value:!0}),uh.decodeUtf8=void 0;const e=K1.__importDefault(YK());return uh.decodeUtf8=e.default,uh}var Y3;function ZK(){if(Y3)return ah;Y3=1,Object.defineProperty(ah,"__esModule",{value:!0}),ah.Reader=void 0;const n=XK();let e=class{constructor(){this.uint8=new Uint8Array([]),this.view=new DataView(this.uint8.buffer),this.x=0}reset(r){this.x=0,this.uint8=r,this.view=new DataView(r.buffer,r.byteOffset,r.length)}peak(){return this.view.getUint8(this.x)}skip(r){this.x+=r}buf(r){const i=this.x+r,s=this.uint8.subarray(this.x,i);return this.x=i,s}u8(){return this.uint8[this.x++]}i8(){return this.view.getInt8(this.x++)}u16(){let r=this.x;const i=(this.uint8[r++]<<8)+this.uint8[r++];return this.x=r,i}i16(){const r=this.view.getInt16(this.x);return this.x+=2,r}u32(){const r=this.view.getUint32(this.x);return this.x+=4,r}i32(){const r=this.view.getInt32(this.x);return this.x+=4,r}u64(){const r=this.view.getBigUint64(this.x);return this.x+=8,r}i64(){const r=this.view.getBigInt64(this.x);return this.x+=8,r}f32(){const r=this.x;return this.x+=4,this.view.getFloat32(r)}f64(){const r=this.x;return this.x+=8,this.view.getFloat64(r)}utf8(r){const i=this.x;return this.x+=r,(0,n.decodeUtf8)(this.uint8,i,r)}ascii(r){const i=this.uint8;let s="";const o=this.x+r;for(let a=this.x;a<o;a++)s+=String.fromCharCode(i[a]);return this.x=o,s}};return ah.Reader=e,ah}var V0={},lh={},G0={},X3;function QK(){if(X3)return G0;X3=1,Object.defineProperty(G0,"__esModule",{value:!0});const n=String.fromCharCode;return G0.default=(e,t,r)=>{let i=t;const s=i+r;let o="";for(;i<s;){const a=e[i++];if((a&128)===0){o+=n(a);continue}const u=e[i++]&63;if((a&224)===192){o+=n((a&31)<<6|u);continue}const l=e[i++]&63;if((a&240)===224){o+=n((a&31)<<12|u<<6|l);continue}if((a&248)===240){const c=e[i++]&63;let f=(a&7)<<18|u<<12|l<<6|c;if(f>65535){f-=65536;const d=f>>>10&1023|55296;f=56320|f&1023,o+=n(d,f)}else o+=n(f)}else o+=n(a)}return o},G0}var Z3;function eJ(){if(Z3)return lh;Z3=1,Object.defineProperty(lh,"__esModule",{value:!0}),lh.CachedUtf8Decoder=void 0;const e=K1.__importDefault(QK());let t=1+Math.round(Math.random()*((-1>>>0)-1));function r(o,a){return t^=t<<13,t^=t>>>17,t^=t<<5,(t>>>0)%(a-o+1)+o}class i{constructor(a,u){this.bytes=a,this.value=u}}let s=class{constructor(){this.caches=[];for(let a=0;a<31;a++)this.caches.push([])}get(a,u,l){const c=this.caches[l-1],f=c.length;e:for(let d=0;d<f;d++){const g=c[d],m=g.bytes;for(let y=0;y<l;y++)if(m[y]!==a[u+y])continue e;return g.value}return null}store(a,u){const l=this.caches[a.length-1],c=new i(a,u);l.length>=16?l[r(0,15)]=c:l.push(c)}decode(a,u,l){if(!l)return"";const c=this.get(a,u,l);if(c!==null)return c;const f=(0,e.default)(a,u,l),d=Uint8Array.prototype.slice.call(a,u,u+l);return this.store(d,f),f}};return lh.CachedUtf8Decoder=s,lh}var Q3;function tJ(){if(Q3)return V0;Q3=1,Object.defineProperty(V0,"__esModule",{value:!0});const n=eJ();return V0.default=new n.CachedUtf8Decoder,V0}var eR;function nJ(){if(eR)return sh;eR=1,Object.defineProperty(sh,"__esModule",{value:!0}),sh.CborDecoderBase=void 0;const n=K1,e=GK(),t=n4(),r=Ak(),i=ZK(),s=n.__importDefault(tJ());let o=class{constructor(u=new i.Reader,l=s.default){this.reader=u,this.keyDecoder=l}read(u){return this.reader.reset(u),this.val()}decode(u){return this.reader.reset(u),this.val()}val(){const l=this.reader.u8(),c=l>>5,f=l&31;return c<4?c<2?c===0?this.readUint(f):this.readNint(f):c===2?this.readBin(f):this.readStr(f):c<6?c===4?this.readArr(f):this.readObj(f):c===6?this.readTag(f):this.readTkn(f)}readAnyRaw(u){const l=u>>5,c=u&31;return l<4?l<2?l===0?this.readUint(c):this.readNint(c):l===2?this.readBin(c):this.readStr(c):l<6?l===4?this.readArr(c):this.readObj(c):l===6?this.readTag(c):this.readTkn(c)}readMinorLen(u){if(u<24)return u;switch(u){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());case 31:return-1;default:throw 1}}readUint(u){if(u<25)return u===24?this.reader.u8():u;if(u<27)return u===25?this.reader.u16():this.reader.u32();{const l=this.reader.u64();return l>9007199254740991?l:Number(l)}}readNint(u){if(u<25)return u===24?-this.reader.u8()-1:-u-1;if(u<27)return u===25?-this.reader.u16()-1:-this.reader.u32()-1;{const l=this.reader.u64();return l>9007199254740991-1?-l-BigInt(1):-Number(l)-1}}readBin(u){const l=this.reader;if(u<=23)return l.buf(u);switch(u){case 24:return l.buf(l.u8());case 25:return l.buf(l.u16());case 26:return l.buf(l.u32());case 27:return l.buf(Number(l.u64()));case 31:{let c=0;const f=[];for(;this.reader.peak()!==255;){const y=this.readBinChunk();c+=y.length,f.push(y)}this.reader.x++;const d=new Uint8Array(c);let g=0;const m=f.length;for(let y=0;y<m;y++){const b=f[y];d.set(b,g),g+=b.length}return d}default:throw 1}}readBinChunk(){const u=this.reader.u8(),l=u>>5,c=u&31;if(l!==2)throw 2;if(c>27)throw 3;return this.readBin(c)}readAsStr(){const l=this.reader.u8(),c=l>>5,f=l&31;if(c!==3)throw 11;return this.readStr(f)}readStr(u){const l=this.reader;if(u<=23)return l.utf8(u);switch(u){case 24:return l.utf8(l.u8());case 25:return l.utf8(l.u16());case 26:return l.utf8(l.u32());case 27:return l.utf8(Number(l.u64()));case 31:{let c="";for(;l.peak()!==255;)c+=this.readStrChunk();return this.reader.x++,c}default:throw 1}}readStrLen(u){if(u<=23)return u;switch(u){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());default:throw 1}}readStrChunk(){const u=this.reader.u8(),l=u>>5,c=u&31;if(l!==3)throw 4;if(c>27)throw 5;return this.readStr(c)}readArr(u){const l=this.readMinorLen(u);return l>=0?this.readArrRaw(l):this.readArrIndef()}readArrRaw(u){const l=[];for(let c=0;c<u;c++)l.push(this.val());return l}readArrIndef(){const u=[];for(;this.reader.peak()!==255;)u.push(this.val());return this.reader.x++,u}readObj(u){if(u<28){let l=u;switch(u){case 24:l=this.reader.u8();break;case 25:l=this.reader.u16();break;case 26:l=this.reader.u32();break;case 27:l=Number(this.reader.u64());break}const c={};for(let f=0;f<l;f++){const d=this.key();if(d==="__proto__")throw 6;const g=this.val();c[d]=g}return c}else{if(u===31)return this.readObjIndef();throw 1}}readObjRaw(u){const l={};for(let c=0;c<u;c++){const f=this.key(),d=this.val();l[f]=d}return l}readObjIndef(){const u={};for(;this.reader.peak()!==255;){const l=this.key();if(this.reader.peak()===255)throw 7;const c=this.val();u[l]=c}return this.reader.x++,u}key(){const u=this.reader.u8(),l=u>>5,c=u&31;if(l!==3)return String(this.readAnyRaw(u));const f=this.readStrLen(c);if(f>31)return this.reader.utf8(f);const d=this.keyDecoder.decode(this.reader.uint8,this.reader.x,f);return this.reader.skip(f),d}readTag(u){if(u<=23)return this.readTagRaw(u);switch(u){case 24:return this.readTagRaw(this.reader.u8());case 25:return this.readTagRaw(this.reader.u16());case 26:return this.readTagRaw(this.reader.u32());case 27:return this.readTagRaw(Number(this.reader.u64()));default:throw 1}}readTagRaw(u){return new t.JsonPackExtension(u,this.val())}readTkn(u){switch(u){case 20:return!1;case 21:return!0;case 22:return null;case 23:return;case 24:return new r.JsonPackValue(this.reader.u8());case 25:return this.f16();case 26:return this.reader.f32();case 27:return this.reader.f64()}if(u<=23)return new r.JsonPackValue(u);throw 1}f16(){return(0,e.decodeF16)(this.reader.u16())}};return sh.CborDecoderBase=o,sh}var tR;function rJ(){if(tR)return ih;tR=1,Object.defineProperty(ih,"__esModule",{value:!0}),ih.CborDecoder=void 0;const n=nJ(),e=Ak();let t=class extends n.CborDecoderBase{readAsMap(){const i=this.reader.u8(),s=i>>5,o=i&31;switch(s){case 5:return this.readMap(o);default:throw 0}}readMap(i){const s=this.readMinorLen(i);return s>=0?this.readMapRaw(s):this.readMapIndef()}readMapRaw(i){const s=new Map;for(let o=0;o<i;o++){const a=this.val(),u=this.val();s.set(a,u)}return s}readMapIndef(){const i=new Map;for(;this.reader.peak()!==255;){const s=this.val();if(this.reader.peak()===255)throw 7;const o=this.val();i.set(s,o)}return this.reader.x++,i}skipN(i){for(let s=0;s<i;s++)this.skipAny()}skipAny(){this.skipAnyRaw(this.reader.u8())}skipAnyRaw(i){const s=i>>5,o=i&31;switch(s){case 0:case 1:this.skipUNint(o);break;case 2:this.skipBin(o);break;case 3:this.skipStr(o);break;case 4:this.skipArr(o);break;case 5:this.skipObj(o);break;case 7:this.skipTkn(o);break;case 6:this.skipTag(o);break}}skipMinorLen(i){if(i<=23)return i;switch(i){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());case 31:return-1;default:throw 1}}skipUNint(i){if(!(i<=23))switch(i){case 24:return this.reader.skip(1);case 25:return this.reader.skip(2);case 26:return this.reader.skip(4);case 27:return this.reader.skip(8);default:throw 1}}skipBin(i){const s=this.skipMinorLen(i);if(s>=0)this.reader.skip(s);else{for(;this.reader.peak()!==255;)this.skipBinChunk();this.reader.x++}}skipBinChunk(){const i=this.reader.u8(),s=i>>5,o=i&31;if(s!==2)throw 2;if(o>27)throw 3;this.skipBin(o)}skipStr(i){const s=this.skipMinorLen(i);if(s>=0)this.reader.skip(s);else{for(;this.reader.peak()!==255;)this.skipStrChunk();this.reader.x++}}skipStrChunk(){const i=this.reader.u8(),s=i>>5,o=i&31;if(s!==3)throw 4;if(o>27)throw 5;this.skipStr(o)}skipArr(i){const s=this.skipMinorLen(i);if(s>=0)this.skipN(s);else{for(;this.reader.peak()!==255;)this.skipAny();this.reader.x++}}skipObj(i){const s=this.readMinorLen(i);if(s>=0)return this.skipN(s*2);for(;this.reader.peak()!==255;){if(this.skipAny(),this.reader.peak()===255)throw 7;this.skipAny()}this.reader.x++}skipTag(i){if(this.skipMinorLen(i)<0)throw 1;this.skipAny()}skipTkn(i){switch(i){case 24:this.reader.skip(1);return;case 25:this.reader.skip(2);return;case 26:this.reader.skip(4);return;case 27:this.reader.skip(8);return}if(!(i<=23))throw 1}validate(i,s=0,o=i.length){this.reader.reset(i),this.reader.x=s;const a=s;if(this.skipAny(),this.reader.x-a!==o)throw 8}decodeLevel(i){return this.reader.reset(i),this.readLevel()}readLevel(){const i=this.reader.u8(),s=i>>5,o=i&31;switch(s){case 4:return this.readArrLevel(o);case 5:return this.readObjLevel(o);default:return super.readAnyRaw(i)}}readPrimitiveOrVal(){switch(this.reader.peak()>>5){case 4:case 5:return this.readAsValue();default:return this.val()}}readAsValue(){const i=this.reader,s=i.x;this.skipAny();const o=i.x;return new e.JsonPackValue(i.uint8.subarray(s,o))}readObjLevel(i){const s=this.readMinorLen(i);return s>=0?this.readObjRawLevel(s):this.readObjIndefLevel()}readObjRawLevel(i){const s={};for(let o=0;o<i;o++){const a=this.key(),u=this.readPrimitiveOrVal();s[a]=u}return s}readObjIndefLevel(){const i={};for(;this.reader.peak()!==255;){const s=this.key();if(this.reader.peak()===255)throw 7;const o=this.readPrimitiveOrVal();i[s]=o}return this.reader.x++,i}readArrLevel(i){const s=this.readMinorLen(i);return s>=0?this.readArrRawLevel(s):this.readArrIndefLevel()}readArrRawLevel(i){const s=[];for(let o=0;o<i;o++)s.push(this.readPrimitiveOrVal());return s}readArrIndefLevel(){const i=[];for(;this.reader.peak()!==255;)i.push(this.readPrimitiveOrVal());return this.reader.x++,i}readHdr(i){const s=this.reader.u8();if(s>>5!==i)throw 0;const a=s&31;if(a<24)return a;switch(a){case 24:return this.reader.u8();case 25:return this.reader.u16();case 26:return this.reader.u32();case 27:return Number(this.reader.u64());case 31:return-1}throw 1}readStrHdr(){return this.readHdr(3)}readObjHdr(){return this.readHdr(5)}readArrHdr(){return this.readHdr(4)}findKey(i){const s=this.readObjHdr();for(let o=0;o<s;o++){if(this.key()===i)return this;this.skipAny()}throw 9}findIndex(i){const s=this.readArrHdr();if(i>=s)throw 10;for(let o=0;o<i;o++)this.skipAny();return this}find(i){for(let s=0;s<i.length;s++){const o=i[s];typeof o=="string"?this.findKey(o):this.findIndex(o)}return this}};return ih.CborDecoder=t,ih}var iJ=rJ(),sJ=r4();const oJ=new sJ.Writer(1024*32);new WK.CborEncoder(oJ);const aJ=new iJ.CborDecoder,uJ=typeof process<"u"&&process.versions?.node,M4=n=>n.length>=2&&n[0]===31&&n[1]===139,lJ=async n=>{if(console.debug("decompressData: Starting decompression, data length:",n.length),console.debug("decompressData: First few bytes:",Array.from(n.slice(0,10)).map(e=>"0x"+e.toString(16).padStart(2,"0")).join(" ")),!M4(n))return console.debug("decompressData: Data does not appear to be gzip compressed, returning as-is"),n;if(console.debug("decompressData: Data appears to be gzip compressed"),uJ){console.debug("decompressData: Using Node.js zlib");const{gunzip:e}=await pt(async()=>{const{gunzip:s}=await Promise.resolve().then(()=>D3);return{gunzip:s}},void 0),{promisify:t}=await pt(async()=>{const{promisify:s}=await Promise.resolve().then(()=>D3);return{promisify:s}},void 0),r=t(e),i=new Uint8Array(await r(n));return console.debug("decompressData: Node.js decompression successful, result length:",i.length),i}else{if(console.debug("decompressData: Using browser DecompressionStream"),typeof DecompressionStream>"u")return console.warn("decompressData: DecompressionStream not available, assuming uncompressed data"),n;try{const e=new DecompressionStream("gzip"),t=e.writable.getWriter(),r=e.readable.getReader();console.debug("decompressData: Writing data to decompression stream"),t.write(new Uint8Array(n)),t.close();const i=[];let s=!1;for(console.debug("decompressData: Reading decompressed chunks");!s;){const{value:l,done:c}=await r.read();s=c,l&&(console.debug("decompressData: Received chunk of length:",l.length),i.push(l))}const o=i.reduce((l,c)=>l+c.length,0);console.debug("decompressData: Total decompressed length:",o);const a=new Uint8Array(o);let u=0;for(const l of i)a.set(l,u),u+=l.length;return console.debug("decompressData: Browser decompression successful"),a}catch(e){return console.warn("decompressData: Browser decompression failed, returning original data:",e),n}}};typeof process<"u"&&process.cwd();var nR;(n=>{n.take=async({fs:e,path:t,filter:r,separator:i="/"})=>{if(r&&!await r(t))return null;const s=await e.stat(t);if(s.isDirectory()){const o=await e.readdir(t),a={},u=t.endsWith(i)?t:t+i;for(const l of o){const c=await n.take({fs:e,path:`${u}${l}`,separator:i,filter:r});c&&(a[l]=c)}return[0,{},a]}else if(s.isFile()){const o=await e.readFile(t),a=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);return[1,s,a]}else if(s.isSymbolicLink())return[2,{target:await e.readlink(t,{encoding:"utf8"})}];return null},n.mount=async(e,{fs:t,path:r="/",separator:i="/"})=>{try{console.debug("Snapshot.mount: Starting mount process"),console.debug("Snapshot.mount: Buffer type:",typeof e),console.debug("Snapshot.mount: Buffer length:",e?.byteLength||e?.length||"unknown"),console.debug("Snapshot.mount: Buffer constructor:",e?.constructor?.name);const s=e instanceof Uint8Array?e:new Uint8Array(e);console.debug("Snapshot.mount: Converted to Uint8Array, length:",s.length);const o=M4(s);console.debug("Snapshot.mount: Data appears compressed:",o);let a;try{a=await lJ(s),console.debug("Snapshot.mount: Successfully processed buffer, decompressed length:",a.length)}catch(l){console.warn("Snapshot.mount: Decompression failed, using original buffer:",l),a=s}console.debug("Snapshot.mount: Attempting to decode CBOR data...");const u=await aJ.decode(a);console.debug("Snapshot.mount: Successfully decoded snapshot, type:",typeof u),console.debug("Snapshot.mount: Snapshot structure:",Array.isArray(u)?`Array[${u.length}]`:u),u?(console.debug("Snapshot.mount: Starting fromSnapshot process..."),await O4(u,{fs:t,path:r,separator:i}),console.debug("Snapshot.mount: Successfully mounted snapshot")):console.warn("Snapshot.mount: Decoded snapshot is null or undefined")}catch(s){throw console.error("Snapshot.mount: Failed to mount snapshot:",s),s}},n.loadAndMount=async(e,{fs:t,path:r="/",separator:i="/"})=>{try{console.debug("Snapshot.loadAndMount: Starting direct load from URL:",e);const s=await fetch(e);if(!s.ok)throw new Error(`Failed to fetch snapshot: ${s.status} ${s.statusText}`);console.debug("Snapshot.loadAndMount: Response received, content-length:",s.headers.get("content-length"));const o=await s.arrayBuffer(),a=new Uint8Array(o);console.debug("Snapshot.loadAndMount: Downloaded buffer length:",a.length),await n.mount(a,{fs:t,path:r,separator:i})}catch(s){throw console.error("Snapshot.loadAndMount: Failed to load and mount snapshot:",s),s}}})(nR||(nR={}));const O4=async(n,{fs:e,path:t="/",separator:r="/"})=>{if(n)switch(n[0]){case 0:{t.endsWith(r)||(t=t+r);const[,,i]=n;e.mkdirSync(t,{recursive:!0});for(const[s,o]of Object.entries(i))await O4(o,{fs:e,path:`${t}${s}`,separator:r});break}case 1:{const[,,i]=n;e.writeFileSync(t,i);break}case 2:{const[,{target:i}]=n;e.symlinkSync(i,t);break}}},cJ=(n,e=1024)=>{const t=n.split(/\r?\n/,e).filter(l=>l.trim().length>0),r={};let i=new Set,s=0,o=0,a=" ";for(const l of t){const c=l.match(/^(\s+)/);if(!c)continue;const f=c[0];f.includes(" ")?s++:o++,i.add(f),r[f]=(r[f]||0)+1}if(Object.keys(r).length===0)return null;a=s>o?" ":" ";const u=Array.from(i).filter(l=>l.startsWith(a)).map(l=>l.length);if(u.length>0){const l=(...f)=>f.reduce((d,g)=>g===0?d:l(g,d%g)),c=l(...u);return a.repeat(c)}return null};class P4{constructor(e,t,r,i){this.state=e,this.pos=t,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=ir(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),r=Math.max(t.from,this.pos-250),i=t.text.slice(r-t.from,this.pos-t.from),s=i.search(I4(e,!1));return s<0?null:{from:r+s,to:this.pos,text:i.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function rR(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function fJ(n){let e=Object.create(null),t=Object.create(null);for(let{label:i}of n){e[i[0]]=!0;for(let s=1;s<i.length;s++)t[i[s]]=!0}let r=rR(e)+rR(t)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function hJ(n){let e=n.map(i=>typeof i=="string"?{label:i}:i),[t,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:fJ(e);return i=>{let s=i.matchBefore(r);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:t}:null}}function Vre(n,e){return t=>{for(let r=ir(t.state).resolveInner(t.pos,-1);r;r=r.parent){if(n.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(t)}}class iR{constructor(e,t,r,i){this.completion=e,this.source=t,this.match=r,this.score=i}}function Zu(n){return n.selection.main.from}function I4(n,e){var t;let{source:r}=n,i=e&&r[0]!="^",s=r[r.length-1]!="$";return!i&&!s?n:new RegExp(`${i?"^":""}(?:${r})${s?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const Tk=fa.define();function l_(n,e,t,r){let{main:i}=n.selection,s=t-i.from,o=r-i.from;return Object.assign(Object.assign({},n.changeByRange(a=>{if(a!=i&&t!=r&&n.sliceDoc(a.from+s,a.from+o)!=n.sliceDoc(t,r))return{range:a};let u=n.toText(e);return{changes:{from:a.from+s,to:r==i.from?a.to:a.from+o,insert:u},range:me.cursor(a.from+s+u.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}const sR=new WeakMap;function dJ(n){if(!Array.isArray(n))return n;let e=sR.get(n);return e||sR.set(n,e=hJ(n)),e}const zm=He.define(),kd=He.define();class pJ{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let r=ri(e,t),i=to(r);this.chars.push(r);let s=e.slice(t,t+i),o=s.toUpperCase();this.folded.push(ri(o==s?s.toLowerCase():o,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:r,any:i,precise:s,byWord:o}=this;if(t.length==1){let S=ri(e,0),k=to(S),x=k==e.length?0:-100;if(S!=t[0])if(S==r[0])x+=-200;else return null;return this.ret(x,[0,k])}let a=e.indexOf(this.pattern);if(a==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let u=t.length,l=0;if(a<0){for(let S=0,k=Math.min(e.length,200);S<k&&l<u;){let x=ri(e,S);(x==t[l]||x==r[l])&&(i[l++]=S),S+=to(x)}if(l<u)return null}let c=0,f=0,d=!1,g=0,m=-1,y=-1,b=/[a-z]/.test(e),w=!0;for(let S=0,k=Math.min(e.length,200),x=0;S<k&&f<u;){let C=ri(e,S);a<0&&(c<u&&C==t[c]&&(s[c++]=S),g<u&&(C==t[g]||C==r[g]?(g==0&&(m=S),y=S+1,g++):g=0));let R,P=C<255?C>=48&&C<=57||C>=97&&C<=122?2:C>=65&&C<=90?1:0:(R=ek(C))!=R.toLowerCase()?1:R!=R.toUpperCase()?2:0;(!S||P==1&&b||x==0&&P!=0)&&(t[f]==C||r[f]==C&&(d=!0)?o[f++]=S:o.length&&(w=!1)),x=P,S+=to(C)}return f==u&&o[0]==0&&w?this.result(-100+(d?-200:0),o,e):g==u&&m==0?this.ret(-200-e.length+(y==e.length?0:-100),[0,y]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):g==u?this.ret(-900-e.length,[m,y]):f==u?this.result(-100+(d?-200:0)+-700+(w?0:-1100),o,e):t.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,r){let i=[],s=0;for(let o of t){let a=o+(this.astral?to(ri(r,o)):1);s&&i[s-1]==o?i[s-1]=a:(i[s++]=o,i[s++]=a)}return this.ret(e-r.length,i)}}class gJ{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),r=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,t.length],this.score=r+(e.length==this.pattern.length?0:-100),this)}}const $n=Ae.define({combine(n){return yo(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:mJ,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>r=>oR(e(r),t(r)),optionClass:(e,t)=>r=>oR(e(r),t(r)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function oR(n,e){return n?e?n+" "+e:n:e}function mJ(n,e,t,r,i,s){let o=n.textDirection==tn.RTL,a=o,u=!1,l="top",c,f,d=e.left-i.left,g=i.right-e.right,m=r.right-r.left,y=r.bottom-r.top;if(a&&d<Math.min(m,g)?a=!1:!a&&g<Math.min(m,d)&&(a=!0),m<=(a?d:g))c=Math.max(i.top,Math.min(t.top,i.bottom-y))-e.top,f=Math.min(400,a?d:g);else{u=!0,f=Math.min(400,(o?e.right:i.right-e.left)-30);let S=i.bottom-e.bottom;S>=y||S>e.top?c=t.bottom-e.top:(l="bottom",c=e.bottom-t.top)}let b=(e.bottom-e.top)/s.offsetHeight,w=(e.right-e.left)/s.offsetWidth;return{style:`${l}: ${c/b}px; max-width: ${f/w}px`,class:"cm-completionInfo-"+(u?o?"left-narrow":"right-narrow":a?"left":"right")}}function vJ(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),t.type&&r.classList.add(...t.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(t,r,i,s){let o=document.createElement("span");o.className="cm-completionLabel";let a=t.displayLabel||t.label,u=0;for(let l=0;l<s.length;){let c=s[l++],f=s[l++];c>u&&o.appendChild(document.createTextNode(a.slice(u,c)));let d=o.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(a.slice(c,f))),d.className="cm-completionMatchedText",u=f}return u<a.length&&o.appendChild(document.createTextNode(a.slice(u))),o},position:50},{render(t){if(!t.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=t.detail,r},position:80}),e.sort((t,r)=>t.position-r.position).map(t=>t.render)}function gb(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let i=Math.floor(e/t);return{from:i*t,to:(i+1)*t}}let r=Math.floor((n-e)/t);return{from:n-(r+1)*t,to:n-r*t}}class yJ{constructor(e,t,r){this.view=e,this.stateField=t,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:u=>this.placeInfo(u),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:s,selected:o}=i.open,a=e.state.facet($n);this.optionContent=vJ(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=gb(s.length,o,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",u=>{let{options:l}=e.state.field(t).open;for(let c=u.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(f=/-(\d+)$/.exec(c.id))&&+f[1]<l.length){this.applyCompletion(e,l[+f[1]]),u.preventDefault();return}}),this.dom.addEventListener("focusout",u=>{let l=e.state.field(this.stateField,!1);l&&l.tooltip&&e.state.facet($n).closeOnBlur&&u.relatedTarget!=e.contentDOM&&e.dispatch({effects:kd.of(null)})}),this.showOptions(s,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:s,selected:o,disabled:a}=r.open;(!i.open||i.open.options!=s)&&(this.range=gb(s.length,o,e.state.facet($n).maxRenderedOptions),this.showOptions(s,r.id)),this.updateSel(),a!=((t=i.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of t.split(" "))r&&this.dom.classList.add(r);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=gb(t.options.length,t.selected,this.view.state.facet($n).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:r}=t.options[t.selected],{info:i}=r;if(!i)return;let s=typeof i=="string"?document.createTextNode(i):i(r);if(!s)return;"then"in s?s.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,r)}).catch(o=>oi(this.view.state,o,"completion info")):this.addInfoPane(s,r)}}addInfoPane(e,t){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:s}=e;r.appendChild(i),this.infoDestroy=s||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),t=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return t&&wJ(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return i.top>Math.min(s.bottom,t.bottom)-10||i.bottom<Math.max(s.top,t.top)+10?null:this.view.state.facet($n).positionInfo(this.view,t,i,r,s,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,r){const i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",o=>{o.target==i&&o.preventDefault()});let s=null;for(let o=r.from;o<r.to;o++){let{completion:a,match:u}=e[o],{section:l}=a;if(l){let d=typeof l=="string"?l:l.name;if(d!=s&&(o>r.from||r.from==0))if(s=d,typeof l!="string"&&l.header)i.appendChild(l.header(l));else{let g=i.appendChild(document.createElement("completion-section"));g.textContent=d}}const c=i.appendChild(document.createElement("li"));c.id=t+"-"+o,c.setAttribute("role","option");let f=this.optionClass(a);f&&(c.className=f);for(let d of this.optionContent){let g=d(a,this.view.state,this.view,u);g&&c.appendChild(g)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function bJ(n,e){return t=>new yJ(t,n,e)}function wJ(n,e){let t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),i=t.height/n.offsetHeight;r.top<t.top?n.scrollTop-=(t.top-r.top)/i:r.bottom>t.bottom&&(n.scrollTop+=(r.bottom-t.bottom)/i)}function aR(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function _J(n,e){let t=[],r=null,i=l=>{t.push(l);let{section:c}=l.completion;if(c){r||(r=[]);let f=typeof c=="string"?c:c.name;r.some(d=>d.name==f)||r.push(typeof c=="string"?{name:f}:c)}},s=e.facet($n);for(let l of n)if(l.hasResult()){let c=l.result.getMatch;if(l.result.filter===!1)for(let f of l.result.options)i(new iR(f,l.source,c?c(f):[],1e9-t.length));else{let f=e.sliceDoc(l.from,l.to),d,g=s.filterStrict?new gJ(f):new pJ(f);for(let m of l.result.options)if(d=g.match(m.label)){let y=m.displayLabel?c?c(m,d.matched):[]:d.matched;i(new iR(m,l.source,y,d.score+(m.boost||0)))}}}if(r){let l=Object.create(null),c=0,f=(d,g)=>{var m,y;return((m=d.rank)!==null&&m!==void 0?m:1e9)-((y=g.rank)!==null&&y!==void 0?y:1e9)||(d.name<g.name?-1:1)};for(let d of r.sort(f))c-=1e5,l[d.name]=c;for(let d of t){let{section:g}=d.completion;g&&(d.score+=l[typeof g=="string"?g:g.name])}}let o=[],a=null,u=s.compareCompletions;for(let l of t.sort((c,f)=>f.score-c.score||u(c.completion,f.completion))){let c=l.completion;!a||a.label!=c.label||a.detail!=c.detail||a.type!=null&&c.type!=null&&a.type!=c.type||a.apply!=c.apply||a.boost!=c.boost?o.push(l):aR(l.completion)>aR(a)&&(o[o.length-1]=l),a=l.completion}return o}class oc{constructor(e,t,r,i,s,o){this.options=e,this.attrs=t,this.tooltip=r,this.timestamp=i,this.selected=s,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new oc(this.options,uR(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,r,i,s,o){if(i&&!o&&e.some(l=>l.isPending))return i.setDisabled();let a=_J(e,t);if(!a.length)return i&&e.some(l=>l.isPending)?i.setDisabled():null;let u=t.facet($n).selectOnOpen?0:-1;if(i&&i.selected!=u&&i.selected!=-1){let l=i.options[i.selected].completion;for(let c=0;c<a.length;c++)if(a[c].completion==l){u=c;break}}return new oc(a,uR(r,u),{pos:e.reduce((l,c)=>c.hasResult()?Math.min(l,c.from):l,1e8),create:RJ,above:s.aboveCursor},i?i.timestamp:Date.now(),u,!1)}map(e){return new oc(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new oc(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Um{constructor(e,t,r){this.active=e,this.id=t,this.open=r}static start(){return new Um(CJ,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,r=t.facet($n),s=(r.override||t.languageDataAt("autocomplete",Zu(t)).map(dJ)).map(u=>(this.active.find(c=>c.source==u)||new Ji(u,this.active.some(c=>c.state!=0)?1:0)).update(e,r));s.length==this.active.length&&s.every((u,l)=>u==this.active[l])&&(s=this.active);let o=this.open,a=e.effects.some(u=>u.is(Mk));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(u=>u.hasResult()&&e.changes.touchesRange(u.from,u.to))||!kJ(s,this.active)||a?o=oc.build(s,t,this.id,o,r,a):o&&o.disabled&&!s.some(u=>u.isPending)&&(o=null),!o&&s.every(u=>!u.isPending)&&s.some(u=>u.hasResult())&&(s=s.map(u=>u.hasResult()?new Ji(u.source,0):u));for(let u of e.effects)u.is(F4)&&(o=o&&o.setSelected(u.value,this.id));return s==this.active&&o==this.open?this:new Um(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?xJ:SJ}}function kJ(n,e){if(n==e)return!0;for(let t=0,r=0;;){for(;t<n.length&&!n[t].hasResult();)t++;for(;r<e.length&&!e[r].hasResult();)r++;let i=t==n.length,s=r==e.length;if(i||s)return i==s;if(n[t++].result!=e[r++].result)return!1}}const xJ={"aria-autocomplete":"list"},SJ={};function uR(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const CJ=[];function L4(n,e){if(n.isUserEvent("input.complete")){let r=n.annotation(Tk);if(r&&e.activateOnCompletion(r))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class Ji{constructor(e,t,r=!1){this.source=e,this.state=t,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let r=L4(e,t),i=this;(r&8||r&16&&this.touches(e))&&(i=new Ji(i.source,0)),r&4&&i.state==0&&(i=new Ji(this.source,1)),i=i.updateFor(e,r);for(let s of e.effects)if(s.is(zm))i=new Ji(i.source,1,s.value);else if(s.is(kd))i=new Ji(i.source,0);else if(s.is(Mk))for(let o of s.value)o.source==i.source&&(i=o);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Zu(e.state))}}class pc extends Ji{constructor(e,t,r,i,s,o){super(e,3,t),this.limit=r,this.result=i,this.from=s,this.to=o}hasResult(){return!0}updateFor(e,t){var r;if(!(t&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=Zu(e.state);if(a>o||!i||t&2&&(Zu(e.startState)==this.from||a<this.limit))return new Ji(this.source,t&4?1:0);let u=e.changes.mapPos(this.limit);return EJ(i.validFor,e.state,s,o)?new pc(this.source,this.explicit,u,i,s,o):i.update&&(i=i.update(i,s,o,new P4(e.state,a,!1)))?new pc(this.source,this.explicit,u,i,i.from,(r=i.to)!==null&&r!==void 0?r:Zu(e.state)):new Ji(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new pc(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Ji(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function EJ(n,e,t,r){if(!n)return!1;let i=e.sliceDoc(t,r);return typeof n=="function"?n(i,t,r,e):I4(n,!0).test(i)}const Mk=He.define({map(n,e){return n.map(t=>t.map(e))}}),F4=He.define(),si=Rn.define({create(){return Um.start()},update(n,e){return n.update(e)},provide:n=>[gk.from(n,e=>e.tooltip),Re.contentAttributes.from(n,e=>e.attrs)]});function Ok(n,e){const t=e.completion.apply||e.completion.label;let r=n.state.field(si).active.find(i=>i.source==e.source);return r instanceof pc?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},l_(n.state,t,r.from,r.to)),{annotations:Tk.of(e.completion)})):t(n,e.completion,r.from,r.to),!0):!1}const RJ=bJ(si,Ok);function K0(n,e="option"){return t=>{let r=t.state.field(si,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<t.state.facet($n).interactionDelay)return!1;let i=1,s;e=="page"&&(s=BO(t,r.open.tooltip))&&(i=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:o}=r.open.options,a=r.open.selected>-1?r.open.selected+i*(n?1:-1):n?0:o-1;return a<0?a=e=="page"?0:o-1:a>=o&&(a=e=="page"?o-1:0),t.dispatch({effects:F4.of(a)}),!0}}const AJ=n=>{let e=n.state.field(si,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet($n).interactionDelay?!1:Ok(n,e.open.options[e.open.selected])},lR=n=>n.state.field(si,!1)?(n.dispatch({effects:zm.of(!0)}),!0):!1,DJ=n=>{let e=n.state.field(si,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:kd.of(null)}),!0)};class TJ{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const MJ=50,OJ=1e3,PJ=gn.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(si).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(si),t=n.state.facet($n);if(!n.selectionSet&&!n.docChanged&&n.startState.field(si)==e)return;let r=n.transactions.some(s=>{let o=L4(s,t);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;s<this.running.length;s++){let o=this.running[s];if(r||o.context.abortOnDocChange&&n.docChanged||o.updates.length+n.transactions.length>MJ&&Date.now()-o.time>OJ){for(let a of o.context.abortListeners)try{a()}catch(u){oi(this.view.state,u)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(s=>s.effects.some(o=>o.is(zm)))&&(this.pendingStart=!0);let i=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let s of n.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(si);for(let t of e.active)t.isPending&&!this.running.some(r=>r.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet($n).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=Zu(e),r=new P4(e,t,n.explicit,this.view),i=new TJ(n,r);this.running.push(i),Promise.resolve(n.source(r)).then(s=>{i.context.aborted||(i.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:kd.of(null)}),oi(this.view.state,s)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet($n).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet($n),r=this.view.state.field(si);for(let i=0;i<this.running.length;i++){let s=this.running[i];if(s.done===void 0)continue;if(this.running.splice(i--,1),s.done){let a=Zu(s.updates.length?s.updates[0].startState:this.view.state),u=Math.min(a,s.done.from+(s.active.explicit?0:1)),l=new pc(s.active.source,s.active.explicit,u,s.done,s.done.from,(n=s.done.to)!==null&&n!==void 0?n:a);for(let c of s.updates)l=l.update(c,t);if(l.hasResult()){e.push(l);continue}}let o=r.active.find(a=>a.source==s.active.source);if(o&&o.isPending)if(s.done==null){let a=new Ji(s.active.source,0);for(let u of s.updates)a=a.update(u,t);a.isPending||e.push(a)}else this.startQuery(o)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:Mk.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(si,!1);if(e&&e.tooltip&&this.view.state.facet($n).closeOnBlur){let t=e.open&&BO(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:kd.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:zm.of(!1)}),20),this.composing=0}}}),IJ=typeof navigator=="object"&&/Win/.test(navigator.platform),LJ=ou.highest(Re.domEventHandlers({keydown(n,e){let t=e.state.field(si,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(IJ&&n.altKey)||n.metaKey)return!1;let r=t.open.options[t.open.selected],i=t.active.find(o=>o.source==r.source),s=r.completion.commitCharacters||i.result.commitCharacters;return s&&s.indexOf(n.key)>-1&&Ok(e,r),!1}})),N4=Re.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class FJ{constructor(e,t,r,i){this.field=e,this.line=t,this.from=r,this.to=i}}class Pk{constructor(e,t,r){this.field=e,this.from=t,this.to=r}map(e){let t=e.mapPos(this.from,-1,tr.TrackDel),r=e.mapPos(this.to,1,tr.TrackDel);return t==null||r==null?null:new Pk(this.field,t,r)}}class Ik{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let r=[],i=[t],s=e.doc.lineAt(t),o=/^\s*/.exec(s.text)[0];for(let u of this.lines){if(r.length){let l=o,c=/^\t*/.exec(u)[0].length;for(let f=0;f<c;f++)l+=e.facet(zc);i.push(t+l.length-c),u=l+u.slice(c)}r.push(u),t+=u.length+1}let a=this.fieldPositions.map(u=>new Pk(u.field,i[u.line]+u.from,i[u.line]+u.to));return{text:r,ranges:a}}static parse(e){let t=[],r=[],i=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let a=s[1]?+s[1]:null,u=s[2]||s[3]||"",l=-1,c=u.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f<t.length;f++)(a!=null?t[f].seq==a:c&&t[f].name==c)&&(l=f);if(l<0){let f=0;for(;f<t.length&&(a==null||t[f].seq!=null&&t[f].seq<a);)f++;t.splice(f,0,{seq:a,name:c}),l=f;for(let d of i)d.field>=l&&d.field++}i.push(new FJ(l,r.length,s.index,s.index+c.length)),o=o.slice(0,s.index)+u+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(a,u,l)=>{for(let c of i)c.line==r.length&&c.from>l&&(c.from--,c.to--);return u}),r.push(o)}return new Ik(r,i)}}let NJ=Be.widget({widget:new class extends ha{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),BJ=Be.mark({class:"cm-snippetField"});class Vc{constructor(e,t){this.ranges=e,this.active=t,this.deco=Be.set(e.map(r=>(r.from==r.to?NJ:BJ).range(r.from,r.to)))}map(e){let t=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;t.push(i)}return new Vc(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(r=>r.field==this.active&&r.from<=t.from&&r.to>=t.to))}}const ep=He.define({map(n,e){return n&&n.map(e)}}),qJ=He.define(),xd=Rn.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(ep))return t.value;if(t.is(qJ)&&n)return new Vc(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>Re.decorations.from(n,e=>e?e.deco:Be.none)});function Lk(n,e){return me.create(n.filter(t=>t.field==e).map(t=>me.range(t.from,t.to)))}function B4(n){let e=Ik.parse(n);return(t,r,i,s)=>{let{text:o,ranges:a}=e.instantiate(t.state,i),{main:u}=t.state.selection,l={changes:{from:i,to:s==u.from?u.to:s,insert:gt.of(o)},scrollIntoView:!0,annotations:r?[Tk.of(r),En.userEvent.of("input.complete")]:void 0};if(a.length&&(l.selection=Lk(a,0)),a.some(c=>c.field>0)){let c=new Vc(a,0),f=l.effects=[ep.of(c)];t.state.field(xd,!1)===void 0&&f.push(He.appendConfig.of([xd,UJ,HJ,N4]))}t.dispatch(t.state.update(l))}}function q4(n){return({state:e,dispatch:t})=>{let r=e.field(xd,!1);if(!r||n<0&&r.active==0)return!1;let i=r.active+n,s=n>0&&!r.ranges.some(o=>o.field==i+n);return t(e.update({selection:Lk(r.ranges,i),effects:ep.of(s?null:new Vc(r.ranges,i)),scrollIntoView:!0})),!0}}const jJ=({state:n,dispatch:e})=>n.field(xd,!1)?(e(n.update({effects:ep.of(null)})),!0):!1,$J=q4(1),WJ=q4(-1),zJ=[{key:"Tab",run:$J,shift:WJ},{key:"Escape",run:jJ}],cR=Ae.define({combine(n){return n.length?n[0]:zJ}}),UJ=ou.highest(Wc.compute([cR],n=>n.facet(cR)));function Gre(n,e){return Object.assign(Object.assign({},e),{apply:B4(n)})}const HJ=Re.domEventHandlers({mousedown(n,e){let t=e.state.field(xd,!1),r;if(!t||(r=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let i=t.ranges.find(s=>s.from<=r&&s.to>=r);return!i||i.field==t.active?!1:(e.dispatch({selection:Lk(t.ranges,i.field),effects:ep.of(t.ranges.some(s=>s.field>i.field)?new Vc(t.ranges,i.field):null),scrollIntoView:!0}),!0)}}),Sd={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Yu=He.define({map(n,e){let t=e.mapPos(n,-1,tr.TrackAfter);return t??void 0}}),Fk=new class extends ol{};Fk.startSide=1;Fk.endSide=-1;const j4=Rn.define({create(){return yt.empty},update(n,e){if(n=n.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:r=>r>=t.from&&r<=t.to})}for(let t of e.effects)t.is(Yu)&&(n=n.update({add:[Fk.range(t.value,t.value+1)]}));return n}});function VJ(){return[KJ,j4]}const mb="()[]{}<>«»»«[]{}";function $4(n){for(let e=0;e<mb.length;e+=2)if(mb.charCodeAt(e)==n)return mb.charAt(e+1);return ek(n<128?n:n+1)}function W4(n,e){return n.languageDataAt("closeBrackets",e)[0]||Sd}const GJ=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),KJ=Re.inputHandler.of((n,e,t,r)=>{if((GJ?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let i=n.state.selection.main;if(r.length>2||r.length==2&&to(ri(r,0))==1||e!=i.from||t!=i.to)return!1;let s=XJ(n.state,r);return s?(n.dispatch(s),!0):!1}),JJ=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let r=W4(n,n.selection.main.head).brackets||Sd.brackets,i=null,s=n.changeByRange(o=>{if(o.empty){let a=ZJ(n.doc,o.head);for(let u of r)if(u==a&&J1(n.doc,o.head)==$4(ri(u,0)))return{changes:{from:o.head-u.length,to:o.head+u.length},range:me.cursor(o.head-u.length)}}return{range:i=o}});return i||e(n.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!i},YJ=[{key:"Backspace",run:JJ}];function XJ(n,e){let t=W4(n,n.selection.main.head),r=t.brackets||Sd.brackets;for(let i of r){let s=$4(ri(i,0));if(e==i)return s==i?tY(n,i,r.indexOf(i+i+i)>-1,t):QJ(n,i,s,t.before||Sd.before);if(e==s&&z4(n,n.selection.main.from))return eY(n,i,s)}return null}function z4(n,e){let t=!1;return n.field(j4).between(0,n.doc.length,r=>{r==e&&(t=!0)}),t}function J1(n,e){let t=n.sliceString(e,e+2);return t.slice(0,to(ri(t,0)))}function ZJ(n,e){let t=n.sliceString(e-2,e);return to(ri(t,0))==t.length?t:t.slice(1)}function QJ(n,e,t,r){let i=null,s=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:Yu.of(o.to+e.length),range:me.range(o.anchor+e.length,o.head+e.length)};let a=J1(n.doc,o.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+t,from:o.head},effects:Yu.of(o.head+e.length),range:me.cursor(o.head+e.length)}:{range:i=o}});return i?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function eY(n,e,t){let r=null,i=n.changeByRange(s=>s.empty&&J1(n.doc,s.head)==t?{changes:{from:s.head,to:s.head+t.length,insert:t},range:me.cursor(s.head+t.length)}:r={range:s});return r?null:n.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function tY(n,e,t,r){let i=r.stringPrefixes||Sd.stringPrefixes,s=null,o=n.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:Yu.of(a.to+e.length),range:me.range(a.anchor+e.length,a.head+e.length)};let u=a.head,l=J1(n.doc,u),c;if(l==e){if(fR(n,u))return{changes:{insert:e+e,from:u},effects:Yu.of(u+e.length),range:me.cursor(u+e.length)};if(z4(n,u)){let d=t&&n.sliceDoc(u,u+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:u,to:u+d.length,insert:d},range:me.cursor(u+d.length)}}}else{if(t&&n.sliceDoc(u-2*e.length,u)==e+e&&(c=hR(n,u-2*e.length,i))>-1&&fR(n,c))return{changes:{insert:e+e+e+e,from:u},effects:Yu.of(u+e.length),range:me.cursor(u+e.length)};if(n.charCategorizer(u)(l)!=rn.Word&&hR(n,u,i)>-1&&!nY(n,u,e,i))return{changes:{insert:e+e,from:u},effects:Yu.of(u+e.length),range:me.cursor(u+e.length)}}return{range:s=a}});return s?null:n.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function fR(n,e){let t=ir(n).resolveInner(e+1);return t.parent&&t.from==e}function nY(n,e,t,r){let i=ir(n).resolveInner(e,-1),s=r.reduce((o,a)=>Math.max(o,a.length),0);for(let o=0;o<5;o++){let a=n.sliceDoc(i.from,Math.min(i.to,i.from+t.length+s)),u=a.indexOf(t);if(!u||u>-1&&r.indexOf(a.slice(0,u))>-1){let c=i.firstChild;for(;c&&c.from==i.from&&c.to-c.from>t.length+u;){if(n.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let l=i.to==e&&i.parent;if(!l)break;i=l}return!1}function hR(n,e,t){let r=n.charCategorizer(e);if(r(n.sliceDoc(e-1,e))!=rn.Word)return e;for(let i of t){let s=e-i.length;if(n.sliceDoc(s,e)==i&&r(n.sliceDoc(s-1,s))!=rn.Word)return s}return-1}function rY(n={}){return[LJ,si,$n.of(n),PJ,iY,N4]}const U4=[{key:"Ctrl-Space",run:lR},{mac:"Alt-`",run:lR},{key:"Escape",run:DJ},{key:"ArrowDown",run:K0(!0)},{key:"ArrowUp",run:K0(!1)},{key:"PageDown",run:K0(!0,"page")},{key:"PageUp",run:K0(!1,"page")},{key:"Enter",run:AJ}],iY=ou.highest(Wc.computeN([$n],n=>n.facet($n).defaultKeymap?[U4]:[]));function Bt(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=t[r];typeof i=="string"?n.setAttribute(r,i):i!=null&&(n[r]=i)}e++}for(;e<arguments.length;e++)H4(n,arguments[e]);return n}function H4(n,e){if(typeof e=="string")n.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)n.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)H4(n,e[t]);else throw new RangeError("Unsupported child node: "+e)}const dR=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class Ac{constructor(e,t,r=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=s?a=>s(dR(a)):dR,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return ri(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=ek(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=to(e);let i=this.normalize(t);if(i.length)for(let s=0,o=r;;s++){let a=i.charCodeAt(s),u=this.match(a,o,this.bufferPos+this.bufferStart);if(s==i.length-1){if(u)return this.value=u,this;break}o==r&&s<t.length&&t.charCodeAt(s)==a&&o++}}}match(e,t,r){let i=null;for(let s=0;s<this.matches.length;s+=2){let o=this.matches[s],a=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?i={from:this.matches[s+1],to:r}:(this.matches[s]++,a=!0)),a||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?i={from:t,to:r}:this.matches.push(1,t)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}typeof Symbol<"u"&&(Ac.prototype[Symbol.iterator]=function(){return this});const V4={from:-1,to:-1,match:/.*/.exec("")},Nk="gm"+(/x/.unicode==null?"":"u");class G4{constructor(e,t,r,i=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=V4,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new K4(e,t,r,i,s);this.re=new RegExp(t,Nk+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=Hm(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let r=this.curLineStart+t.index,i=r+t[0].length;if(this.matchPos=Hm(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const vb=new WeakMap;class gc{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,r){let i=vb.get(e);if(!i||i.from>=r||i.to<=t){let a=new gc(t,e.sliceString(t,r));return vb.set(e,a),a}if(i.from==t&&i.to==r)return i;let{text:s,from:o}=i;return o>t&&(s=e.sliceString(t,o)+s,o=t),i.to<r&&(s+=e.sliceString(i.to,r)),vb.set(e,new gc(o,s)),new gc(t,s.slice(t-o,r-o))}}class K4{constructor(e,t,r,i,s){this.text=e,this.to=s,this.done=!1,this.value=V4,this.matchPos=Hm(e,i),this.re=new RegExp(t,Nk+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=gc.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let r=this.flat.from+t.index,i=r+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this.matchPos=Hm(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=gc.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(G4.prototype[Symbol.iterator]=K4.prototype[Symbol.iterator]=function(){return this});function sY(n){try{return new RegExp(n,Nk),!0}catch{return!1}}function Hm(n,e){if(e>=n.length)return e;let t=n.lineAt(e),r;for(;e<t.to&&(r=t.text.charCodeAt(e-t.from))>=56320&&r<57344;)e++;return e}function c_(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=Bt("input",{class:"cm-textfield",name:"line",value:e}),r=Bt("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:ed.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),i())},onsubmit:s=>{s.preventDefault(),i()}},Bt("label",n.state.phrase("Go to line"),": ",t)," ",Bt("button",{class:"cm-button",type:"submit"},n.state.phrase("go")),Bt("button",{name:"close",onclick:()=>{n.dispatch({effects:ed.of(!1)}),n.focus()},"aria-label":n.state.phrase("close"),type:"button"},["×"]));function i(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!s)return;let{state:o}=n,a=o.doc.lineAt(o.selection.main.head),[,u,l,c,f]=s,d=c?+c.slice(1):0,g=l?+l:a.number;if(l&&f){let b=g/100;u&&(b=b*(u=="-"?-1:1)+a.number/o.doc.lines),g=Math.round(o.doc.lines*b)}else l&&u&&(g=g*(u=="-"?-1:1)+a.number);let m=o.doc.line(Math.max(1,Math.min(o.doc.lines,g))),y=me.cursor(m.from+Math.max(0,Math.min(d,m.length)));n.dispatch({effects:[ed.of(!1),Re.scrollIntoView(y.from,{y:"center"})],selection:y}),n.focus()}return{dom:r}}const ed=He.define(),pR=Rn.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(ed)&&(n=t.value);return n},provide:n=>Sc.from(n,e=>e?c_:null)}),oY=n=>{let e=vd(n,c_);if(!e){let t=[ed.of(!0)];n.state.field(pR,!1)==null&&t.push(He.appendConfig.of([pR,aY])),n.dispatch({effects:t}),e=vd(n,c_)}return e&&e.dom.querySelector("input").select(),!0},aY=Re.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),uY={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},lY=Ae.define({combine(n){return yo(n,uY,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function cY(n){return[gY,pY]}const fY=Be.mark({class:"cm-selectionMatch"}),hY=Be.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function gR(n,e,t,r){return(t==0||n(e.sliceDoc(t-1,t))!=rn.Word)&&(r==e.doc.length||n(e.sliceDoc(r,r+1))!=rn.Word)}function dY(n,e,t,r){return n(e.sliceDoc(t,t+1))==rn.Word&&n(e.sliceDoc(r-1,r))==rn.Word}const pY=gn.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(lY),{state:t}=n,r=t.selection;if(r.ranges.length>1)return Be.none;let i=r.main,s,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return Be.none;let u=t.wordAt(i.head);if(!u)return Be.none;o=t.charCategorizer(i.head),s=t.sliceDoc(u.from,u.to)}else{let u=i.to-i.from;if(u<e.minSelectionLength||u>200)return Be.none;if(e.wholeWords){if(s=t.sliceDoc(i.from,i.to),o=t.charCategorizer(i.head),!(gR(o,t,i.from,i.to)&&dY(o,t,i.from,i.to)))return Be.none}else if(s=t.sliceDoc(i.from,i.to),!s)return Be.none}let a=[];for(let u of n.visibleRanges){let l=new Ac(t.doc,s,u.from,u.to);for(;!l.next().done;){let{from:c,to:f}=l.value;if((!o||gR(o,t,c,f))&&(i.empty&&c<=i.from&&f>=i.to?a.push(hY.range(c,f)):(c>=i.to||f<=i.from)&&a.push(fY.range(c,f)),a.length>e.maxMatches))return Be.none}}return Be.set(a)}},{decorations:n=>n.decorations}),gY=Re.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),mY=({state:n,dispatch:e})=>{let{selection:t}=n,r=me.create(t.ranges.map(i=>n.wordAt(i.head)||me.cursor(i.head)),t.mainIndex);return r.eq(t)?!1:(e(n.update({selection:r})),!0)};function vY(n,e){let{main:t,ranges:r}=n.selection,i=n.wordAt(t.head),s=i&&i.from==t.from&&i.to==t.to;for(let o=!1,a=new Ac(n.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(o)return null;a=new Ac(n.doc,e,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(u=>u.from==a.value.from))continue;if(s){let u=n.wordAt(a.value.from);if(!u||u.from!=a.value.from||u.to!=a.value.to)continue}return a.value}}const yY=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(s=>s.from===s.to))return mY({state:n,dispatch:e});let r=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(s=>n.sliceDoc(s.from,s.to)!=r))return!1;let i=vY(n,r);return i?(e(n.update({selection:n.selection.addRange(me.range(i.from,i.to),!1),effects:Re.scrollIntoView(i.to)})),!0):!1},Gc=Ae.define({combine(n){return yo(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new TY(e),scrollToMatch:e=>Re.scrollIntoView(e)})}});class J4{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||sY(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,r)=>r=="n"?`
|
|
69
|
-
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new kY(this):new wY(this)}getCursor(e,t=0,r){let i=e.doc?e:dt.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?tc(this,i,t,r):ec(this,i,t,r)}}class Y4{constructor(e){this.spec=e}}function ec(n,e,t,r){return new Ac(e.doc,n.unquoted,t,r,n.caseSensitive?void 0:i=>i.toLowerCase(),n.wholeWord?bY(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function bY(n,e){return(t,r,i,s)=>((s>t||s+i.length<r)&&(s=Math.max(0,t-2),i=n.sliceString(s,Math.min(n.length,r+2))),(e(Vm(i,t-s))!=rn.Word||e(Gm(i,t-s))!=rn.Word)&&(e(Gm(i,r-s))!=rn.Word||e(Vm(i,r-s))!=rn.Word))}class wY extends Y4{constructor(e){super(e)}nextMatch(e,t,r){let i=ec(this.spec,e,r,e.doc.length).nextOverlapping();if(i.done){let s=Math.min(e.doc.length,t+this.spec.unquoted.length);i=ec(this.spec,e,0,s).nextOverlapping()}return i.done||i.value.from==t&&i.value.to==r?null:i.value}prevMatchInRange(e,t,r){for(let i=r;;){let s=Math.max(t,i-1e4-this.spec.unquoted.length),o=ec(this.spec,e,s,i),a=null;for(;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(s==t)return null;i-=1e4}}prevMatch(e,t,r){let i=this.prevMatchInRange(e,0,t);return i||(i=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=t||i.to!=r)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let r=ec(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=ec(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function tc(n,e,t,r){return new G4(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?_Y(e.charCategorizer(e.selection.main.head)):void 0},t,r)}function Vm(n,e){return n.slice(nr(n,e,!1),e)}function Gm(n,e){return n.slice(e,nr(n,e))}function _Y(n){return(e,t,r)=>!r[0].length||(n(Vm(r.input,r.index))!=rn.Word||n(Gm(r.input,r.index))!=rn.Word)&&(n(Gm(r.input,r.index+r[0].length))!=rn.Word||n(Vm(r.input,r.index+r[0].length))!=rn.Word)}class kY extends Y4{nextMatch(e,t,r){let i=tc(this.spec,e,r,e.doc.length).next();return i.done&&(i=tc(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=1;;i++){let s=Math.max(t,r-i*1e4),o=tc(this.spec,e,s,r),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==t||a.from>s+10))return a;if(s==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let s=+r.slice(0,i);if(s>0&&s<e.match.length)return e.match[s]+r.slice(i)}return t})}matchAll(e,t){let r=tc(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=tc(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const Cd=He.define(),Bk=He.define(),Ja=Rn.define({create(n){return new yb(f_(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Cd)?n=new yb(t.value.create(),n.panel):t.is(Bk)&&(n=new yb(n.query,t.value?qk:null));return n},provide:n=>Sc.from(n,e=>e.panel)});class yb{constructor(e,t){this.query=e,this.panel=t}}const xY=Be.mark({class:"cm-searchMatch"}),SY=Be.mark({class:"cm-searchMatch cm-searchMatch-selected"}),CY=gn.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(Ja))}update(n){let e=n.state.field(Ja);(e!=n.startState.field(Ja)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Be.none;let{view:t}=this,r=new ia;for(let i=0,s=t.visibleRanges,o=s.length;i<o;i++){let{from:a,to:u}=s[i];for(;i<o-1&&u>s[i+1].from-500;)u=s[++i].to;n.highlight(t.state,a,u,(l,c)=>{let f=t.state.selection.ranges.some(d=>d.from==l&&d.to==c);r.add(l,c,f?SY:xY)})}return r.finish()}},{decorations:n=>n.decorations});function tp(n){return e=>{let t=e.state.field(Ja,!1);return t&&t.query.spec.valid?n(e,t):Q4(e)}}const Km=tp((n,{query:e})=>{let{to:t}=n.state.selection.main,r=e.nextMatch(n.state,t,t);if(!r)return!1;let i=me.single(r.from,r.to),s=n.state.facet(Gc);return n.dispatch({selection:i,effects:[jk(n,r),s.scrollToMatch(i.main,n)],userEvent:"select.search"}),Z4(n),!0}),Jm=tp((n,{query:e})=>{let{state:t}=n,{from:r}=t.selection.main,i=e.prevMatch(t,r,r);if(!i)return!1;let s=me.single(i.from,i.to),o=n.state.facet(Gc);return n.dispatch({selection:s,effects:[jk(n,i),o.scrollToMatch(s.main,n)],userEvent:"select.search"}),Z4(n),!0}),EY=tp((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:me.create(t.map(r=>me.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),RY=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:r,to:i}=t.main,s=[],o=0;for(let a=new Ac(n.doc,n.sliceDoc(r,i));!a.next().done;){if(s.length>1e3)return!1;a.value.from==r&&(o=s.length),s.push(me.range(a.value.from,a.value.to))}return e(n.update({selection:me.create(s,o),userEvent:"select.search.matches"})),!0},mR=tp((n,{query:e})=>{let{state:t}=n,{from:r,to:i}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,r,r);if(!s)return!1;let o=s,a=[],u,l,c=[];if(o.from==r&&o.to==i&&(l=t.toText(e.getReplacement(o)),a.push({from:o.from,to:o.to,insert:l}),o=e.nextMatch(t,o.from,o.to),c.push(Re.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(r).number)+"."))),o){let f=a.length==0||a[0].from>=s.to?0:s.to-s.from-l.length;u=me.single(o.from-f,o.to-f),c.push(jk(n,o)),c.push(t.facet(Gc).scrollToMatch(u.main,n))}return n.dispatch({changes:a,selection:u,effects:c,userEvent:"input.replace"}),!0}),AY=tp((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(i=>{let{from:s,to:o}=i;return{from:s,to:o,insert:e.getReplacement(i)}});if(!t.length)return!1;let r=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:Re.announce.of(r),userEvent:"input.replace.all"}),!0});function qk(n){return n.state.facet(Gc).createPanel(n)}function f_(n,e){var t,r,i,s,o;let a=n.selection.main,u=a.empty||a.to>a.from+100?"":n.sliceDoc(a.from,a.to);if(e&&!u)return e;let l=n.facet(Gc);return new J4({search:((t=e?.literal)!==null&&t!==void 0?t:l.literal)?u:u.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:l.caseSensitive,literal:(i=e?.literal)!==null&&i!==void 0?i:l.literal,regexp:(s=e?.regexp)!==null&&s!==void 0?s:l.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:l.wholeWord})}function X4(n){let e=vd(n,qk);return e&&e.dom.querySelector("[main-field]")}function Z4(n){let e=X4(n);e&&e==n.root.activeElement&&e.select()}const Q4=n=>{let e=n.state.field(Ja,!1);if(e&&e.panel){let t=X4(n);if(t&&t!=n.root.activeElement){let r=f_(n.state,e.query.spec);r.valid&&n.dispatch({effects:Cd.of(r)}),t.focus(),t.select()}}else n.dispatch({effects:[Bk.of(!0),e?Cd.of(f_(n.state,e.query.spec)):He.appendConfig.of(OY)]});return!0},eP=n=>{let e=n.state.field(Ja,!1);if(!e||!e.panel)return!1;let t=vd(n,qk);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Bk.of(!1)}),!0},DY=[{key:"Mod-f",run:Q4,scope:"editor search-panel"},{key:"F3",run:Km,shift:Jm,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Km,shift:Jm,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:eP,scope:"editor search-panel"},{key:"Mod-Shift-l",run:RY},{key:"Mod-Alt-g",run:oY},{key:"Mod-d",run:yY,preventDefault:!0}];class TY{constructor(e){this.view=e;let t=this.query=e.state.field(Ja).query.spec;this.commit=this.commit.bind(this),this.searchField=Bt("input",{value:t.search,placeholder:bi(e,"Find"),"aria-label":bi(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Bt("input",{value:t.replace,placeholder:bi(e,"Replace"),"aria-label":bi(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Bt("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Bt("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Bt("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function r(i,s,o){return Bt("button",{class:"cm-button",name:i,onclick:s,type:"button"},o)}this.dom=Bt("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>Km(e),[bi(e,"next")]),r("prev",()=>Jm(e),[bi(e,"previous")]),r("select",()=>EY(e),[bi(e,"all")]),Bt("label",null,[this.caseField,bi(e,"match case")]),Bt("label",null,[this.reField,bi(e,"regexp")]),Bt("label",null,[this.wordField,bi(e,"by word")]),...e.state.readOnly?[]:[Bt("br"),this.replaceField,r("replace",()=>mR(e),[bi(e,"replace")]),r("replaceAll",()=>AY(e),[bi(e,"replace all")])],Bt("button",{name:"close",onclick:()=>eP(e),"aria-label":bi(e,"close"),type:"button"},["×"])])}commit(){let e=new J4({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Cd.of(e)}))}keydown(e){fU(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Jm:Km)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),mR(this.view))}update(e){for(let t of e.transactions)for(let r of t.effects)r.is(Cd)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Gc).top}}function bi(n,e){return n.state.phrase(e)}const J0=30,Y0=/[\s\.,:;?!]/;function jk(n,{from:e,to:t}){let r=n.state.doc.lineAt(e),i=n.state.doc.lineAt(t).to,s=Math.max(r.from,e-J0),o=Math.min(i,t+J0),a=n.state.sliceDoc(s,o);if(s!=r.from){for(let u=0;u<J0;u++)if(!Y0.test(a[u+1])&&Y0.test(a[u])){a=a.slice(u);break}}if(o!=i){for(let u=a.length-1;u>a.length-J0;u--)if(!Y0.test(a[u-1])&&Y0.test(a[u])){a=a.slice(0,u);break}}return Re.announce.of(`${n.state.phrase("current match")}. ${a} ${n.state.phrase("on line")} ${r.number}.`)}const MY=Re.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),OY=[Ja,ou.low(CY),MY],bb={},PY={javascript:async()=>{const{javascript:n}=await pt(async()=>{const{javascript:e}=await import("./index-BfYmUKH9.js");return{javascript:e}},__vite__mapDeps([0,1]));return n({jsx:!0,typescript:!0})},python:async()=>{const{python:n}=await pt(async()=>{const{python:e}=await import("./index-CaANcgI2.js");return{python:e}},__vite__mapDeps([2,1]));return n()},rust:async()=>{const{rust:n}=await pt(async()=>{const{rust:e}=await import("./index-CIi8tLT6.js");return{rust:e}},__vite__mapDeps([3,1]));return n()},html:async()=>{const{html:n}=await pt(async()=>{const{html:e}=await import("./index-BBC9WDX6.js");return{html:e}},__vite__mapDeps([4,1,5,0]));return n()},css:async()=>{const{css:n}=await pt(async()=>{const{css:e}=await import("./index-BEXYxRro.js");return{css:e}},__vite__mapDeps([5,1]));return n()},scss:async()=>{const{sass:n}=await pt(async()=>{const{sass:e}=await import("./index-DmX_vI7D.js");return{sass:e}},__vite__mapDeps([6,1,5]));return n({indented:!1})},less:async()=>{const{less:n}=await pt(async()=>{const{less:e}=await import("./index-DkmiPfkD.js");return{less:e}},__vite__mapDeps([7,5,1]));return n()},json:async()=>{const{json:n}=await pt(async()=>{const{json:e}=await import("./index-BAnLzvMk.js");return{json:e}},__vite__mapDeps([8,1]));return n()},xml:async()=>{const{xml:n}=await pt(async()=>{const{xml:e}=await import("./index-DogEEevD.js");return{xml:e}},__vite__mapDeps([9,1]));return n()},markdown:async()=>{const{markdown:n}=await pt(async()=>{const{markdown:e}=await import("./index-DmNlLMQ4.js");return{markdown:e}},__vite__mapDeps([10,4,1,5,0]));return n()},sql:async()=>{const{sql:n}=await pt(async()=>{const{sql:e}=await import("./index-DsDl5qZV.js");return{sql:e}},__vite__mapDeps([11,1]));return n()},php:async()=>{const{php:n}=await pt(async()=>{const{php:e}=await import("./index-D_XGv9QZ.js");return{php:e}},__vite__mapDeps([12,1,4,5,0]));return n()},java:async()=>{const{java:n}=await pt(async()=>{const{java:e}=await import("./index-i5qJLB2h.js");return{java:e}},__vite__mapDeps([13,1]));return n()},cpp:async()=>{const{cpp:n}=await pt(async()=>{const{cpp:e}=await import("./index-BhaTNAWE.js");return{cpp:e}},__vite__mapDeps([14,1]));return n()},c:async()=>{const{cpp:n}=await pt(async()=>{const{cpp:e}=await import("./index-BhaTNAWE.js");return{cpp:e}},__vite__mapDeps([14,1]));return n()},yaml:async()=>{const{yaml:n}=await pt(async()=>{const{yaml:e}=await import("./index-gAy5mDg-.js");return{yaml:e}},__vite__mapDeps([15,1]));return n()},ruby:async()=>{const{ruby:n}=await pt(async()=>{const{ruby:e}=await import("./ruby-B2Rjki9n.js");return{ruby:e}},[]);return Bn.define(n)},csharp:async()=>{const{csharp:n}=await pt(async()=>{const{csharp:e}=await import("./clike-C8IJ2oj_.js");return{csharp:e}},[]);return Bn.define(n)},go:async()=>{const{go:n}=await pt(async()=>{const{go:e}=await import("./go-CTD25R5P.js");return{go:e}},[]);return Bn.define(n)},swift:async()=>{const{swift:n}=await pt(async()=>{const{swift:e}=await import("./swift-BzpIVaGY.js");return{swift:e}},[]);return Bn.define(n)},kotlin:async()=>{const{kotlin:n}=await pt(async()=>{const{kotlin:e}=await import("./clike-C8IJ2oj_.js");return{kotlin:e}},[]);return Bn.define(n)},scala:async()=>{const{scala:n}=await pt(async()=>{const{scala:e}=await import("./clike-C8IJ2oj_.js");return{scala:e}},[]);return Bn.define(n)},vb:async()=>{const{vb:n}=await pt(async()=>{const{vb:e}=await import("./vb-CmGdzxic.js");return{vb:e}},[]);return Bn.define(n)},haskell:async()=>{const{haskell:n}=await pt(async()=>{const{haskell:e}=await import("./haskell-BWDZoCOh.js");return{haskell:e}},[]);return Bn.define(n)},lua:async()=>{const{lua:n}=await pt(async()=>{const{lua:e}=await import("./lua-BgMRiT3U.js");return{lua:e}},[]);return Bn.define(n)},perl:async()=>{const{perl:n}=await pt(async()=>{const{perl:e}=await import("./perl-CdXCOZ3F.js");return{perl:e}},[]);return Bn.define(n)},bash:async()=>{const{shell:n}=await pt(async()=>{const{shell:e}=await import("./shell-CjFT_Tl9.js");return{shell:e}},[]);return Bn.define(n)},toml:async()=>{const{toml:n}=await pt(async()=>{const{toml:e}=await import("./toml-BXUEaScT.js");return{toml:e}},[]);return Bn.define(n)},ini:async()=>{const{properties:n}=await pt(async()=>{const{properties:e}=await import("./properties-C78fOPTZ.js");return{properties:e}},[]);return Bn.define(n)},dockerfile:async()=>{const{dockerFile:n}=await pt(async()=>{const{dockerFile:e}=await import("./dockerfile-C_y-rIpk.js");return{dockerFile:e}},[]);return Bn.define(n)},makefile:async()=>{const{cmake:n}=await pt(async()=>{const{cmake:e}=await import("./cmake-BQqOBYOt.js");return{cmake:e}},[]);return Bn.define(n)},gitignore:async()=>{const{properties:n}=await pt(async()=>{const{properties:e}=await import("./properties-C78fOPTZ.js");return{properties:e}},[]);return Bn.define(n)}},vR=async n=>{if(bb[n])return bb[n];const e=PY[n],t=await e();return bb[n]=t,t},Ym={javascript:"javascript",js:"javascript",typescript:"javascript",ts:"javascript",jsx:"javascript",tsx:"javascript",python:"python",py:"python",ruby:"ruby",rb:"ruby",php:"php",java:"java",cpp:"cpp",c:"c",csharp:"csharp",cs:"csharp",go:"go",swift:"swift",kotlin:"kotlin",kt:"kotlin",rust:"rust",rs:"rust",scala:"scala",vb:"vb",haskell:"haskell",hs:"haskell",lua:"lua",perl:"perl",pl:"perl",bash:"bash",shell:"bash",sh:"bash",zsh:"bash",mysql:"sql",sql:"sql",html:"html",css:"css",scss:"scss",less:"less",json:"json",yaml:"yaml",yml:"yaml",xml:"xml",markdown:"markdown",md:"markdown",toml:"toml",ini:"ini",conf:"ini",log:"ini",env:"ini",dockerfile:"dockerfile",makefile:"makefile",dockerignore:"gitignore",gitignore:"gitignore"};class yR{constructor(e,t,r){this.from=e,this.to=t,this.diagnostic=r}}class zu{constructor(e,t,r){this.diagnostics=e,this.panel=t,this.selected=r}static init(e,t,r){let i=r.facet(Ed).markerFilter;i&&(e=i(e,r));let s=e.slice().sort((c,f)=>c.from-f.from||c.to-f.to),o=new ia,a=[],u=0;for(let c=0;;){let f=c==s.length?null:s[c];if(!f&&!a.length)break;let d,g;for(a.length?(d=u,g=a.reduce((y,b)=>Math.min(y,b.to),f&&f.from>d?f.from:1e8)):(d=f.from,g=f.to,a.push(f),c++);c<s.length;){let y=s[c];if(y.from==d&&(y.to>y.from||y.to==d))a.push(y),c++,g=Math.min(y.to,g);else{g=Math.min(y.from,g);break}}let m=HY(a);if(a.some(y=>y.from==y.to||y.from==y.to-1&&r.doc.lineAt(y.from).to==y.from))o.add(d,d,Be.widget({widget:new $Y(m),diagnostics:a.slice()}));else{let y=a.reduce((b,w)=>w.markClass?b+" "+w.markClass:b,"");o.add(d,g,Be.mark({class:"cm-lintRange cm-lintRange-"+m+y,diagnostics:a.slice(),inclusiveEnd:a.some(b=>b.to>g)}))}u=g;for(let y=0;y<a.length;y++)a[y].to<=u&&a.splice(y--,1)}let l=o.finish();return new zu(l,t,Dc(l))}}function Dc(n,e=null,t=0){let r=null;return n.between(t,1e9,(i,s,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!r)r=new yR(i,s,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(r.diagnostic)<0)return!1;r=new yR(r.from,s,r.diagnostic)}}),r}function IY(n,e){let t=e.pos,r=e.end||t,i=n.state.facet(Ed).hideOn(n,t,r);if(i!=null)return i;let s=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(o=>o.is($k))||n.changes.touchesRange(s.from,Math.max(s.to,r)))}function tP(n,e){return n.field(Ri,!1)?e:e.concat(He.appendConfig.of(VY))}function bR(n,e){return{effects:tP(n,[$k.of(e)])}}const $k=He.define(),Wk=He.define(),nP=He.define(),Ri=Rn.define({create(){return new zu(Be.none,null,null)},update(n,e){if(e.docChanged&&n.diagnostics.size){let t=n.diagnostics.map(e.changes),r=null,i=n.panel;if(n.selected){let s=e.changes.mapPos(n.selected.from,1);r=Dc(t,n.selected.diagnostic,s)||Dc(t,null,s)}!t.size&&i&&e.state.facet(Ed).autoPanel&&(i=null),n=new zu(t,i,r)}for(let t of e.effects)if(t.is($k)){let r=e.state.facet(Ed).autoPanel?t.value.length?Rd.open:null:n.panel;n=zu.init(t.value,r,e.state)}else t.is(Wk)?n=new zu(n.diagnostics,t.value?Rd.open:null,n.selected):t.is(nP)&&(n=new zu(n.diagnostics,n.panel,t.value));return n},provide:n=>[Sc.from(n,e=>e.panel),Re.decorations.from(n,e=>e.diagnostics)]}),LY=Be.mark({class:"cm-lintRange cm-lintRange-active"});function FY(n,e,t){let{diagnostics:r}=n.state.field(Ri),i,s=-1,o=-1;r.between(e-(t<0?1:0),e+(t>0?1:0),(u,l,{spec:c})=>{if(e>=u&&e<=l&&(u==l||(e>u||t>0)&&(e<l||t<0)))return i=c.diagnostics,s=u,o=l,!1});let a=n.state.facet(Ed).tooltipFilter;return i&&a&&(i=a(i,n.state)),i?{pos:s,end:o,above:n.state.doc.lineAt(s).to<o,create(){return{dom:NY(n,i)}}}:null}function NY(n,e){return Bt("ul",{class:"cm-tooltip-lint"},e.map(t=>iP(n,t,!1)))}const BY=n=>{let e=n.state.field(Ri,!1);(!e||!e.panel)&&n.dispatch({effects:tP(n.state,[Wk.of(!0)])});let t=vd(n,Rd.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},wR=n=>{let e=n.state.field(Ri,!1);return!e||!e.panel?!1:(n.dispatch({effects:Wk.of(!1)}),!0)},qY=n=>{let e=n.state.field(Ri,!1);if(!e)return!1;let t=n.state.selection.main,r=e.diagnostics.iter(t.to+1);return!r.value&&(r=e.diagnostics.iter(0),!r.value||r.from==t.from&&r.to==t.to)?!1:(n.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),!0)},jY=[{key:"Mod-Shift-m",run:BY,preventDefault:!0},{key:"F8",run:qY}],Ed=Ae.define({combine(n){return Object.assign({sources:n.map(e=>e.source).filter(e=>e!=null)},yo(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?r=>e(r)||t(r):e:t}))}});function rP(n){let e=[];if(n)e:for(let{name:t}of n){for(let r=0;r<t.length;r++){let i=t[r];if(/[a-zA-Z]/.test(i)&&!e.some(s=>s.toLowerCase()==i.toLowerCase())){e.push(i);continue e}}e.push("")}return e}function iP(n,e,t){var r;let i=t?rP(e.actions):[];return Bt("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Bt("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(n):e.message),(r=e.actions)===null||r===void 0?void 0:r.map((s,o)=>{let a=!1,u=d=>{if(d.preventDefault(),a)return;a=!0;let g=Dc(n.state.field(Ri).diagnostics,e);g&&s.apply(n,g.from,g.to)},{name:l}=s,c=i[o]?l.indexOf(i[o]):-1,f=c<0?l:[l.slice(0,c),Bt("u",l.slice(c,c+1)),l.slice(c+1)];return Bt("button",{type:"button",class:"cm-diagnosticAction",onclick:u,onmousedown:u,"aria-label":` Action: ${l}${c<0?"":` (access key "${i[o]})"`}.`},f)}),e.source&&Bt("div",{class:"cm-diagnosticSource"},e.source))}class $Y extends ha{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return Bt("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class _R{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=iP(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Rd{constructor(e){this.view=e,this.items=[];let t=i=>{if(i.keyCode==27)wR(this.view),this.view.focus();else if(i.keyCode==38||i.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(i.keyCode==40||i.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(i.keyCode==36)this.moveSelection(0);else if(i.keyCode==35)this.moveSelection(this.items.length-1);else if(i.keyCode==13)this.view.focus();else if(i.keyCode>=65&&i.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],o=rP(s.actions);for(let a=0;a<o.length;a++)if(o[a].toUpperCase().charCodeAt(0)==i.keyCode){let u=Dc(this.view.state.field(Ri).diagnostics,s);u&&s.actions[a].apply(e,u.from,u.to)}}else return;i.preventDefault()},r=i=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(i.target)&&this.moveSelection(s)};this.list=Bt("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:r}),this.dom=Bt("div",{class:"cm-panel-lint"},this.list,Bt("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>wR(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Ri).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(Ri),r=0,i=!1,s=null,o=new Set;for(e.between(0,this.view.state.doc.length,(a,u,{spec:l})=>{for(let c of l.diagnostics){if(o.has(c))continue;o.add(c);let f=-1,d;for(let g=r;g<this.items.length;g++)if(this.items[g].diagnostic==c){f=g;break}f<0?(d=new _R(this.view,c),this.items.splice(r,0,d),i=!0):(d=this.items[f],f>r&&(this.items.splice(r,f-r),i=!0)),t&&d.diagnostic==t.diagnostic?d.dom.hasAttribute("aria-selected")||(d.dom.setAttribute("aria-selected","true"),s=d):d.dom.hasAttribute("aria-selected")&&d.dom.removeAttribute("aria-selected"),r++}});r<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)i=!0,this.items.pop();this.items.length==0&&(this.items.push(new _R(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),i=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:u})=>{let l=u.height/this.list.offsetHeight;a.top<u.top?this.list.scrollTop-=(u.top-a.top)/l:a.bottom>u.bottom&&(this.list.scrollTop+=(a.bottom-u.bottom)/l)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),i&&this.sync()}sync(){let e=this.list.firstChild;function t(){let r=e;e=r.nextSibling,r.remove()}for(let r of this.items)if(r.dom.parentNode==this.list){for(;e!=r.dom;)t();e=r.dom.nextSibling}else this.list.insertBefore(r.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Ri),r=Dc(t.diagnostics,this.items[e].diagnostic);r&&this.view.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0,effects:nP.of(r)})}static open(e){return new Rd(e)}}function WY(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(n)}</svg>')`}function X0(n){return WY(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${n}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const zY=Re.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:X0("#d11")},".cm-lintRange-warning":{backgroundImage:X0("orange")},".cm-lintRange-info":{backgroundImage:X0("#999")},".cm-lintRange-hint":{backgroundImage:X0("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function UY(n){return n=="error"?4:n=="warning"?3:n=="info"?2:1}function HY(n){let e="hint",t=1;for(let r of n){let i=UY(r.severity);i>t&&(t=i,e=r.severity)}return e}const VY=[Ri,Re.decorations.compute([Ri],n=>{let{selected:e,panel:t}=n.field(Ri);return!e||!t||e.from==e.to?Be.none:Be.set([LY.range(e.from,e.to)])}),NO(FY,{hideOn:IY}),zY];var ch={},Eu={},Z0={exports:{}},kR;function sP(){if(kR)return Z0.exports;kR=1;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(C,R,P){return Function.prototype.apply.call(C,R,P)},t;n&&typeof n.ownKeys=="function"?t=n.ownKeys:Object.getOwnPropertySymbols?t=function(C){return Object.getOwnPropertyNames(C).concat(Object.getOwnPropertySymbols(C))}:t=function(C){return Object.getOwnPropertyNames(C)};function r(x){console&&console.warn&&console.warn(x)}var i=Number.isNaN||function(C){return C!==C};function s(){s.init.call(this)}Z0.exports=s,Z0.exports.once=w,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(x){if(typeof x!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof x)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(x){if(typeof x!="number"||x<0||i(x))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+x+".");o=x}}),s.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(C){if(typeof C!="number"||C<0||i(C))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+C+".");return this._maxListeners=C,this};function u(x){return x._maxListeners===void 0?s.defaultMaxListeners:x._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(C){for(var R=[],P=1;P<arguments.length;P++)R.push(arguments[P]);var q=C==="error",B=this._events;if(B!==void 0)q=q&&B.error===void 0;else if(!q)return!1;if(q){var G;if(R.length>0&&(G=R[0]),G instanceof Error)throw G;var V=new Error("Unhandled error."+(G?" ("+G.message+")":""));throw V.context=G,V}var F=B[C];if(F===void 0)return!1;if(typeof F=="function")e(F,this,R);else for(var A=F.length,Y=m(F,A),P=0;P<A;++P)e(Y[P],this,R);return!0};function l(x,C,R,P){var q,B,G;if(a(R),B=x._events,B===void 0?(B=x._events=Object.create(null),x._eventsCount=0):(B.newListener!==void 0&&(x.emit("newListener",C,R.listener?R.listener:R),B=x._events),G=B[C]),G===void 0)G=B[C]=R,++x._eventsCount;else if(typeof G=="function"?G=B[C]=P?[R,G]:[G,R]:P?G.unshift(R):G.push(R),q=u(x),q>0&&G.length>q&&!G.warned){G.warned=!0;var V=new Error("Possible EventEmitter memory leak detected. "+G.length+" "+String(C)+" listeners added. Use emitter.setMaxListeners() to increase limit");V.name="MaxListenersExceededWarning",V.emitter=x,V.type=C,V.count=G.length,r(V)}return x}s.prototype.addListener=function(C,R){return l(this,C,R,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(C,R){return l(this,C,R,!0)};function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(x,C,R){var P={fired:!1,wrapFn:void 0,target:x,type:C,listener:R},q=c.bind(P);return q.listener=R,P.wrapFn=q,q}s.prototype.once=function(C,R){return a(R),this.on(C,f(this,C,R)),this},s.prototype.prependOnceListener=function(C,R){return a(R),this.prependListener(C,f(this,C,R)),this},s.prototype.removeListener=function(C,R){var P,q,B,G,V;if(a(R),q=this._events,q===void 0)return this;if(P=q[C],P===void 0)return this;if(P===R||P.listener===R)--this._eventsCount===0?this._events=Object.create(null):(delete q[C],q.removeListener&&this.emit("removeListener",C,P.listener||R));else if(typeof P!="function"){for(B=-1,G=P.length-1;G>=0;G--)if(P[G]===R||P[G].listener===R){V=P[G].listener,B=G;break}if(B<0)return this;B===0?P.shift():y(P,B),P.length===1&&(q[C]=P[0]),q.removeListener!==void 0&&this.emit("removeListener",C,V||R)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(C){var R,P,q;if(P=this._events,P===void 0)return this;if(P.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):P[C]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete P[C]),this;if(arguments.length===0){var B=Object.keys(P),G;for(q=0;q<B.length;++q)G=B[q],G!=="removeListener"&&this.removeAllListeners(G);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(R=P[C],typeof R=="function")this.removeListener(C,R);else if(R!==void 0)for(q=R.length-1;q>=0;q--)this.removeListener(C,R[q]);return this};function d(x,C,R){var P=x._events;if(P===void 0)return[];var q=P[C];return q===void 0?[]:typeof q=="function"?R?[q.listener||q]:[q]:R?b(q):m(q,q.length)}s.prototype.listeners=function(C){return d(this,C,!0)},s.prototype.rawListeners=function(C){return d(this,C,!1)},s.listenerCount=function(x,C){return typeof x.listenerCount=="function"?x.listenerCount(C):g.call(x,C)},s.prototype.listenerCount=g;function g(x){var C=this._events;if(C!==void 0){var R=C[x];if(typeof R=="function")return 1;if(R!==void 0)return R.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function m(x,C){for(var R=new Array(C),P=0;P<C;++P)R[P]=x[P];return R}function y(x,C){for(;C+1<x.length;C++)x[C]=x[C+1];x.pop()}function b(x){for(var C=new Array(x.length),R=0;R<C.length;++R)C[R]=x[R].listener||x[R];return C}function w(x,C){return new Promise(function(R,P){function q(G){x.removeListener(C,B),P(G)}function B(){typeof x.removeListener=="function"&&x.removeListener("error",q),R([].slice.call(arguments))}k(x,C,B,{once:!0}),C!=="error"&&S(x,q,{once:!0})})}function S(x,C,R){typeof x.on=="function"&&k(x,"error",C,R)}function k(x,C,R,P){if(typeof x.on=="function")P.once?x.once(C,R):x.on(C,R);else if(typeof x.addEventListener=="function")x.addEventListener(C,function q(B){P.once&&x.removeEventListener(C,q),R(B)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof x)}return Z0.exports}var xR;function GY(){return xR||(xR=1,function(n){var e=Eu&&Eu.__awaiter||function(s,o,a,u){function l(c){return c instanceof a?c:new a(function(f){f(c)})}return new(a||(a=Promise))(function(c,f){function d(y){try{m(u.next(y))}catch(b){f(b)}}function g(y){try{m(u.throw(y))}catch(b){f(b)}}function m(y){y.done?c(y.value):l(y.value).then(d,g)}m((u=u.apply(s,o||[])).next())})},t=Eu&&Eu.__generator||function(s,o){var a={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},u,l,c,f;return f={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function d(m){return function(y){return g([m,y])}}function g(m){if(u)throw new TypeError("Generator is already executing.");for(;a;)try{if(u=1,l&&(c=m[0]&2?l.return:m[0]?l.throw||((c=l.return)&&c.call(l),0):l.next)&&!(c=c.call(l,m[1])).done)return c;switch(l=0,c&&(m=[m[0]&2,c.value]),m[0]){case 0:case 1:c=m;break;case 4:return a.label++,{value:m[1],done:!1};case 5:a.label++,l=m[1],m=[0];continue;case 7:m=a.ops.pop(),a.trys.pop();continue;default:if(c=a.trys,!(c=c.length>0&&c[c.length-1])&&(m[0]===6||m[0]===2)){a=0;continue}if(m[0]===3&&(!c||m[1]>c[0]&&m[1]<c[3])){a.label=m[1];break}if(m[0]===6&&a.label<c[1]){a.label=c[1],c=m;break}if(c&&a.label<c[2]){a.label=c[2],a.ops.push(m);break}c[2]&&a.ops.pop(),a.trys.pop();continue}m=o.call(s,a)}catch(y){m=[6,y],l=0}finally{u=c=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}};Object.defineProperty(n,"__esModule",{value:!0}),n.defaultNextRequest=void 0;var r=sP();n.defaultNextRequest=function(){var s=-1;return function(){return++s}};var i=function(){function s(o,a){a===void 0&&(a=n.defaultNextRequest()),this.batch=[],this.batchStarted=!1,this.lastId=-1,this.transports=o,this.requests={},this.connectPromise=this.connect(),this.requestChannel=new r.EventEmitter,this.nextID=a}return s.prototype.connect=function(){var o=this;return Promise.all(this.transports.map(function(a){return e(o,void 0,void 0,function(){return t(this,function(u){switch(u.label){case 0:return a.subscribe("error",this.handleError.bind(this)),a.subscribe("notification",this.handleNotification.bind(this)),[4,a.connect()];case 1:return u.sent(),[2]}})})}))},s.prototype.getPrimaryTransport=function(){return this.transports[0]},s.prototype.request=function(o,a,u){return a===void 0&&(a=!1),e(this,void 0,void 0,function(){var l,c,f,d,g=this;return t(this,function(m){return l=this.nextID().toString(),c=a?null:l,f={request:this.makeRequest(o.method,o.params||[],c),internalID:l},this.batchStarted?(d=new Promise(function(y,b){g.batch.push({resolve:y,reject:b,request:f})}),[2,d]):[2,this.getPrimaryTransport().sendData(f,u)]})})},s.prototype.close=function(){this.requestChannel.removeAllListeners(),this.transports.forEach(function(o){o.unsubscribe(),o.close()})},s.prototype.startBatch=function(){this.batchStarted=!0},s.prototype.stopBatch=function(){if(this.batchStarted===!1)throw new Error("cannot end that which has never started");if(this.batch.length===0){this.batchStarted=!1;return}this.getPrimaryTransport().sendData(this.batch),this.batch=[],this.batchStarted=!1},s.prototype.makeRequest=function(o,a,u){return u?{jsonrpc:"2.0",id:u,method:o,params:a}:{jsonrpc:"2.0",method:o,params:a}},s.prototype.handleError=function(o){this.requestChannel.emit("error",o)},s.prototype.handleNotification=function(o){this.requestChannel.emit("notification",o)},s}();n.default=i}(Eu)),Eu}var Jl={},fh={},hh={},dh={},SR;function np(){return SR||(SR=1,function(n){var e=dh&&dh.__extends||function(){var r=function(i,s){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,a){o.__proto__=a}||function(o,a){for(var u in a)a.hasOwnProperty(u)&&(o[u]=a[u])},r(i,s)};return function(i,s){r(i,s);function o(){this.constructor=i}i.prototype=s===null?Object.create(s):(o.prototype=s.prototype,new o)}}();Object.defineProperty(n,"__esModule",{value:!0}),n.convertJSONToRPCError=n.JSONRPCError=n.ERR_UNKNOWN=n.ERR_MISSIING_ID=n.ERR_TIMEOUT=void 0,n.ERR_TIMEOUT=7777,n.ERR_MISSIING_ID=7878,n.ERR_UNKNOWN=7979;var t=function(r){e(i,r);function i(s,o,a){var u=this.constructor,l=r.call(this,s)||this;return l.message=s,l.code=o,l.data=a,Object.setPrototypeOf(l,u.prototype),l}return i}(Error);n.JSONRPCError=t,n.convertJSONToRPCError=function(r){if(r.error){var i=r.error,s=i.message,o=i.code,a=i.data;return new t(s,o,a)}return new t("Unknown error",n.ERR_UNKNOWN,r)}}(dh)),dh}var CR;function KY(){if(CR)return hh;CR=1,Object.defineProperty(hh,"__esModule",{value:!0}),hh.TransportRequestManager=void 0;var n=sP(),e=np(),t=function(){function r(){this.pendingRequest={},this.pendingBatchRequest={},this.transportEventChannel=new n.EventEmitter}return r.prototype.addRequest=function(i,s){return this.transportEventChannel.emit("pending",i),i instanceof Array?(this.addBatchReq(i,s),Promise.resolve()):this.addReq(i.internalID,s)},r.prototype.settlePendingRequest=function(i,s){var o=this;i.forEach(function(a){var u=o.pendingRequest[a.internalID];if(delete o.pendingBatchRequest[a.internalID],u!==void 0){if(s){u.reject(s);return}u.resolve(),(a.request.id===null||a.request.id===void 0)&&delete o.pendingRequest[a.internalID]}})},r.prototype.isPendingRequest=function(i){return this.pendingRequest.hasOwnProperty(i)},r.prototype.resolveResponse=function(i,s){s===void 0&&(s=!0);var o=i;try{return o=JSON.parse(i),this.checkJSONRPC(o)===!1?void 0:o instanceof Array?this.resolveBatch(o,s):this.resolveRes(o,s)}catch{var a=new e.JSONRPCError("Bad response format",e.ERR_UNKNOWN,i);return s&&this.transportEventChannel.emit("error",a),a}},r.prototype.addBatchReq=function(i,s){var o=this;return i.forEach(function(a){var u=a.resolve,l=a.reject,c=a.request.internalID;o.pendingBatchRequest[c]=!0,o.pendingRequest[c]={resolve:u,reject:l}}),Promise.resolve()},r.prototype.addReq=function(i,s){var o=this;return new Promise(function(a,u){s!==null&&s&&o.setRequestTimeout(i,s,u),o.pendingRequest[i]={resolve:a,reject:u}})},r.prototype.checkJSONRPC=function(i){var s=[i];return i instanceof Array&&(s=i),s.every(function(o){return o.result!==void 0||o.error!==void 0||o.method!==void 0})},r.prototype.processResult=function(i,s){if(i.error){var o=e.convertJSONToRPCError(i);s.reject(o);return}s.resolve(i.result)},r.prototype.resolveBatch=function(i,s){var o=this,a=i.map(function(l){return o.resolveRes(l,s)}),u=a.filter(function(l){return l});if(u.length>0)return u[0]},r.prototype.resolveRes=function(i,s){var o=i.id,a=i.error,u=this.pendingRequest[o];if(u){delete this.pendingRequest[o],this.processResult(i,u),this.transportEventChannel.emit("response",i);return}if(o===void 0&&a===void 0){this.transportEventChannel.emit("notification",i);return}var l;return a&&(l=e.convertJSONToRPCError(i)),s&&a&&l&&this.transportEventChannel.emit("error",l),l},r.prototype.setRequestTimeout=function(i,s,o){var a=this;setTimeout(function(){delete a.pendingRequest[i],o(new e.JSONRPCError("Request timeout request took longer than "+s+" ms to resolve",e.ERR_TIMEOUT))},s)},r}();return hh.TransportRequestManager=t,hh}var ER;function Kc(){if(ER)return fh;ER=1,Object.defineProperty(fh,"__esModule",{value:!0}),fh.Transport=void 0;var n=KY(),e=function(){function t(){this.transportRequestManager=new n.TransportRequestManager,this.transportRequestManager.transportEventChannel.on("error",function(){})}return t.prototype.subscribe=function(r,i){this.transportRequestManager.transportEventChannel.addListener(r,i)},t.prototype.unsubscribe=function(r,i){if(!r)return this.transportRequestManager.transportEventChannel.removeAllListeners();r&&i&&this.transportRequestManager.transportEventChannel.removeListener(r,i)},t.prototype.parseData=function(r){return r instanceof Array?r.map(function(i){return i.request.request}):r.request},t}();return fh.Transport=e,fh}var wb={},RR;function rp(){return RR||(RR=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.getNotifications=n.getBatchRequests=n.isNotification=void 0,n.isNotification=function(e){return e.request.id===void 0||e.request.id===null},n.getBatchRequests=function(e){return e instanceof Array?e.filter(function(t){var r=t.request.request.id;return r!=null}).map(function(t){return t.request}):[]},n.getNotifications=function(e){return e instanceof Array?e.filter(function(t){return n.isNotification(t.request)}).map(function(t){return t.request}):n.isNotification(e)?[e]:[]}}(wb)),wb}var AR;function JY(){if(AR)return Jl;AR=1;var n=Jl&&Jl.__extends||function(){var s=function(o,a){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,l){u.__proto__=l}||function(u,l){for(var c in l)l.hasOwnProperty(c)&&(u[c]=l[c])},s(o,a)};return function(o,a){s(o,a);function u(){this.constructor=o}o.prototype=a===null?Object.create(a):(u.prototype=a.prototype,new u)}}();Object.defineProperty(Jl,"__esModule",{value:!0});var e=Kc(),t=rp(),r=np(),i=function(s){n(o,s);function o(a,u,l){var c=s.call(this)||this;return c.connection=a,c.reqUri=u,c.resUri=l,c}return o.prototype.connect=function(){var a=this;return this.connection.on(this.resUri,function(u){a.transportRequestManager.resolveResponse(u)}),Promise.resolve()},o.prototype.sendData=function(a,u){u===void 0&&(u=null);var l=this.transportRequestManager.addRequest(a,u),c=t.getNotifications(a),f=this.parseData(a);try{return this.connection.emit(this.reqUri,f),this.transportRequestManager.settlePendingRequest(c),l}catch(g){var d=new r.JSONRPCError(g.message,r.ERR_UNKNOWN,g);return this.transportRequestManager.settlePendingRequest(c,d),Promise.reject(d)}},o.prototype.close=function(){this.connection.removeAllListeners()},o}(e.Transport);return Jl.default=i,Jl}var Xr={},Qn=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},Fr={searchParams:"URLSearchParams"in Qn,iterable:"Symbol"in Qn&&"iterator"in Symbol,blob:"FileReader"in Qn&&"Blob"in Qn&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in Qn,arrayBuffer:"ArrayBuffer"in Qn};function YY(n){return n&&DataView.prototype.isPrototypeOf(n)}if(Fr.arrayBuffer)var XY=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],ZY=ArrayBuffer.isView||function(n){return n&&XY.indexOf(Object.prototype.toString.call(n))>-1};function Jc(n){if(typeof n!="string"&&(n=String(n)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(n)||n==="")throw new TypeError('Invalid character in header field name: "'+n+'"');return n.toLowerCase()}function zk(n){return typeof n!="string"&&(n=String(n)),n}function Uk(n){var e={next:function(){var t=n.shift();return{done:t===void 0,value:t}}};return Fr.iterable&&(e[Symbol.iterator]=function(){return e}),e}function On(n){this.map={},n instanceof On?n.forEach(function(e,t){this.append(t,e)},this):Array.isArray(n)?n.forEach(function(e){if(e.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):n&&Object.getOwnPropertyNames(n).forEach(function(e){this.append(e,n[e])},this)}On.prototype.append=function(n,e){n=Jc(n),e=zk(e);var t=this.map[n];this.map[n]=t?t+", "+e:e};On.prototype.delete=function(n){delete this.map[Jc(n)]};On.prototype.get=function(n){return n=Jc(n),this.has(n)?this.map[n]:null};On.prototype.has=function(n){return this.map.hasOwnProperty(Jc(n))};On.prototype.set=function(n,e){this.map[Jc(n)]=zk(e)};On.prototype.forEach=function(n,e){for(var t in this.map)this.map.hasOwnProperty(t)&&n.call(e,this.map[t],t,this)};On.prototype.keys=function(){var n=[];return this.forEach(function(e,t){n.push(t)}),Uk(n)};On.prototype.values=function(){var n=[];return this.forEach(function(e){n.push(e)}),Uk(n)};On.prototype.entries=function(){var n=[];return this.forEach(function(e,t){n.push([t,e])}),Uk(n)};Fr.iterable&&(On.prototype[Symbol.iterator]=On.prototype.entries);function _b(n){if(!n._noBody){if(n.bodyUsed)return Promise.reject(new TypeError("Already read"));n.bodyUsed=!0}}function oP(n){return new Promise(function(e,t){n.onload=function(){e(n.result)},n.onerror=function(){t(n.error)}})}function QY(n){var e=new FileReader,t=oP(e);return e.readAsArrayBuffer(n),t}function eX(n){var e=new FileReader,t=oP(e),r=/charset=([A-Za-z0-9_-]+)/.exec(n.type),i=r?r[1]:"utf-8";return e.readAsText(n,i),t}function tX(n){for(var e=new Uint8Array(n),t=new Array(e.length),r=0;r<e.length;r++)t[r]=String.fromCharCode(e[r]);return t.join("")}function DR(n){if(n.slice)return n.slice(0);var e=new Uint8Array(n.byteLength);return e.set(new Uint8Array(n)),e.buffer}function aP(){return this.bodyUsed=!1,this._initBody=function(n){this.bodyUsed=this.bodyUsed,this._bodyInit=n,n?typeof n=="string"?this._bodyText=n:Fr.blob&&Blob.prototype.isPrototypeOf(n)?this._bodyBlob=n:Fr.formData&&FormData.prototype.isPrototypeOf(n)?this._bodyFormData=n:Fr.searchParams&&URLSearchParams.prototype.isPrototypeOf(n)?this._bodyText=n.toString():Fr.arrayBuffer&&Fr.blob&&YY(n)?(this._bodyArrayBuffer=DR(n.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):Fr.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(n)||ZY(n))?this._bodyArrayBuffer=DR(n):this._bodyText=n=Object.prototype.toString.call(n):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof n=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):Fr.searchParams&&URLSearchParams.prototype.isPrototypeOf(n)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},Fr.blob&&(this.blob=function(){var n=_b(this);if(n)return n;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var n=_b(this);return n||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(Fr.blob)return this.blob().then(QY);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var n=_b(this);if(n)return n;if(this._bodyBlob)return eX(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(tX(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},Fr.formData&&(this.formData=function(){return this.text().then(iX)}),this.json=function(){return this.text().then(JSON.parse)},this}var nX=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function rX(n){var e=n.toUpperCase();return nX.indexOf(e)>-1?e:n}function hl(n,e){if(!(this instanceof hl))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var t=e.body;if(n instanceof hl){if(n.bodyUsed)throw new TypeError("Already read");this.url=n.url,this.credentials=n.credentials,e.headers||(this.headers=new On(n.headers)),this.method=n.method,this.mode=n.mode,this.signal=n.signal,!t&&n._bodyInit!=null&&(t=n._bodyInit,n.bodyUsed=!0)}else this.url=String(n);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new On(e.headers)),this.method=rX(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in Qn){var s=new AbortController;return s.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&t)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(t),(this.method==="GET"||this.method==="HEAD")&&(e.cache==="no-store"||e.cache==="no-cache")){var r=/([?&])_=[^&]*/;if(r.test(this.url))this.url=this.url.replace(r,"$1_="+new Date().getTime());else{var i=/\?/;this.url+=(i.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}hl.prototype.clone=function(){return new hl(this,{body:this._bodyInit})};function iX(n){var e=new FormData;return n.trim().split("&").forEach(function(t){if(t){var r=t.split("="),i=r.shift().replace(/\+/g," "),s=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(i),decodeURIComponent(s))}}),e}function sX(n){var e=new On,t=n.replace(/\r?\n[\t ]+/g," ");return t.split("\r").map(function(r){return r.indexOf(`
|
|
70
|
-
`)===0?r.substr(1,r.length):r}).forEach(function(r){var i=r.split(":"),s=i.shift().trim();if(s){var o=i.join(":").trim();try{e.append(s,o)}catch(a){console.warn("Response "+a.message)}}}),e}aP.call(hl.prototype);function mo(n,e){if(!(this instanceof mo))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new On(e.headers),this.url=e.url||"",this._initBody(n)}aP.call(mo.prototype);mo.prototype.clone=function(){return new mo(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new On(this.headers),url:this.url})};mo.error=function(){var n=new mo(null,{status:200,statusText:""});return n.ok=!1,n.status=0,n.type="error",n};var oX=[301,302,303,307,308];mo.redirect=function(n,e){if(oX.indexOf(e)===-1)throw new RangeError("Invalid status code");return new mo(null,{status:e,headers:{location:n}})};var Uu=Qn.DOMException;try{new Uu}catch{Uu=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},Uu.prototype=Object.create(Error.prototype),Uu.prototype.constructor=Uu}function uP(n,e){return new Promise(function(t,r){var i=new hl(n,e);if(i.signal&&i.signal.aborted)return r(new Uu("Aborted","AbortError"));var s=new XMLHttpRequest;function o(){s.abort()}s.onload=function(){var l={statusText:s.statusText,headers:sX(s.getAllResponseHeaders()||"")};i.url.indexOf("file://")===0&&(s.status<200||s.status>599)?l.status=200:l.status=s.status,l.url="responseURL"in s?s.responseURL:l.headers.get("X-Request-URL");var c="response"in s?s.response:s.responseText;setTimeout(function(){t(new mo(c,l))},0)},s.onerror=function(){setTimeout(function(){r(new TypeError("Network request failed"))},0)},s.ontimeout=function(){setTimeout(function(){r(new TypeError("Network request timed out"))},0)},s.onabort=function(){setTimeout(function(){r(new Uu("Aborted","AbortError"))},0)};function a(l){try{return l===""&&Qn.location.href?Qn.location.href:l}catch{return l}}if(s.open(i.method,a(i.url),!0),i.credentials==="include"?s.withCredentials=!0:i.credentials==="omit"&&(s.withCredentials=!1),"responseType"in s&&(Fr.blob?s.responseType="blob":Fr.arrayBuffer&&(s.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof On||Qn.Headers&&e.headers instanceof Qn.Headers)){var u=[];Object.getOwnPropertyNames(e.headers).forEach(function(l){u.push(Jc(l)),s.setRequestHeader(l,zk(e.headers[l]))}),i.headers.forEach(function(l,c){u.indexOf(c)===-1&&s.setRequestHeader(c,l)})}else i.headers.forEach(function(l,c){s.setRequestHeader(c,l)});i.signal&&(i.signal.addEventListener("abort",o),s.onreadystatechange=function(){s.readyState===4&&i.signal.removeEventListener("abort",o)}),s.send(typeof i._bodyInit>"u"?null:i._bodyInit)})}uP.polyfill=!0;Qn.fetch||(Qn.fetch=uP,Qn.Headers=On,Qn.Request=hl,Qn.Response=mo);var kb,TR;function aX(){return TR||(TR=1,kb=self.fetch.bind(self)),kb}var MR;function uX(){if(MR)return Xr;MR=1;var n=Xr&&Xr.__extends||function(){var l=function(c,f){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,g){d.__proto__=g}||function(d,g){for(var m in g)g.hasOwnProperty(m)&&(d[m]=g[m])},l(c,f)};return function(c,f){l(c,f);function d(){this.constructor=c}c.prototype=f===null?Object.create(f):(d.prototype=f.prototype,new d)}}(),e=Xr&&Xr.__awaiter||function(l,c,f,d){function g(m){return m instanceof f?m:new f(function(y){y(m)})}return new(f||(f=Promise))(function(m,y){function b(k){try{S(d.next(k))}catch(x){y(x)}}function w(k){try{S(d.throw(k))}catch(x){y(x)}}function S(k){k.done?m(k.value):g(k.value).then(b,w)}S((d=d.apply(l,c||[])).next())})},t=Xr&&Xr.__generator||function(l,c){var f={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},d,g,m,y;return y={next:b(0),throw:b(1),return:b(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function b(S){return function(k){return w([S,k])}}function w(S){if(d)throw new TypeError("Generator is already executing.");for(;f;)try{if(d=1,g&&(m=S[0]&2?g.return:S[0]?g.throw||((m=g.return)&&m.call(g),0):g.next)&&!(m=m.call(g,S[1])).done)return m;switch(g=0,m&&(S=[S[0]&2,m.value]),S[0]){case 0:case 1:m=S;break;case 4:return f.label++,{value:S[1],done:!1};case 5:f.label++,g=S[1],S=[0];continue;case 7:S=f.ops.pop(),f.trys.pop();continue;default:if(m=f.trys,!(m=m.length>0&&m[m.length-1])&&(S[0]===6||S[0]===2)){f=0;continue}if(S[0]===3&&(!m||S[1]>m[0]&&S[1]<m[3])){f.label=S[1];break}if(S[0]===6&&f.label<m[1]){f.label=m[1],m=S;break}if(m&&f.label<m[2]){f.label=m[2],f.ops.push(S);break}m[2]&&f.ops.pop(),f.trys.pop();continue}S=c.call(l,f)}catch(k){S=[6,k],g=0}finally{d=m=0}if(S[0]&5)throw S[1];return{value:S[0]?S[1]:void 0,done:!0}}},r=Xr&&Xr.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(Xr,"__esModule",{value:!0}),Xr.HTTPTransport=void 0;var i=r(aX()),s=Kc(),o=rp(),a=np(),u=function(l){n(c,l);function c(f,d){var g=l.call(this)||this;return g.onlyNotifications=function(m){return m instanceof Array?m.every(function(y){return y.request.request.id===null||y.request.request.id===void 0}):m.request.id===null||m.request.id===void 0},g.uri=f,g.credentials=d&&d.credentials,g.headers=c.setupHeaders(d&&d.headers),g.injectedFetcher=d?.fetcher,g}return c.prototype.connect=function(){return Promise.resolve()},c.prototype.sendData=function(f,d){return d===void 0&&(d=null),e(this,void 0,void 0,function(){var g,m,y,b,w,S,x,k,x;return t(this,function(C){switch(C.label){case 0:g=this.transportRequestManager.addRequest(f,d),m=o.getNotifications(f),y=o.getBatchRequests(f),b=this.injectedFetcher||i.default,C.label=1;case 1:return C.trys.push([1,4,,5]),[4,b(this.uri,{method:"POST",headers:this.headers,body:JSON.stringify(this.parseData(f)),credentials:this.credentials})];case 2:return w=C.sent(),this.transportRequestManager.settlePendingRequest(m),this.onlyNotifications(f)?[2,Promise.resolve()]:[4,w.text()];case 3:return S=C.sent(),x=this.transportRequestManager.resolveResponse(S),x?(this.transportRequestManager.settlePendingRequest(y,x),[2,Promise.reject(x)]):[3,5];case 4:return k=C.sent(),x=new a.JSONRPCError(k.message,a.ERR_UNKNOWN,k),this.transportRequestManager.settlePendingRequest(m,x),this.transportRequestManager.settlePendingRequest(o.getBatchRequests(f),x),[2,Promise.reject(x)];case 5:return[2,g]}})})},c.prototype.close=function(){},c.setupHeaders=function(f){var d=new Headers(f);return d.set("Content-Type","application/json"),d},c}(s.Transport);return Xr.HTTPTransport=u,Xr.default=u,Xr}var ji={},nc=null;typeof WebSocket<"u"?nc=WebSocket:typeof MozWebSocket<"u"?nc=MozWebSocket:typeof global<"u"?nc=global.WebSocket||global.MozWebSocket:typeof window<"u"?nc=window.WebSocket||window.MozWebSocket:typeof self<"u"&&(nc=self.WebSocket||self.MozWebSocket);const lX=nc,cX=Object.freeze(Object.defineProperty({__proto__:null,default:lX},Symbol.toStringTag,{value:"Module"})),fX=q1(cX);var OR;function hX(){if(OR)return ji;OR=1;var n=ji&&ji.__extends||function(){var l=function(c,f){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,g){d.__proto__=g}||function(d,g){for(var m in g)g.hasOwnProperty(m)&&(d[m]=g[m])},l(c,f)};return function(c,f){l(c,f);function d(){this.constructor=c}c.prototype=f===null?Object.create(f):(d.prototype=f.prototype,new d)}}(),e=ji&&ji.__awaiter||function(l,c,f,d){function g(m){return m instanceof f?m:new f(function(y){y(m)})}return new(f||(f=Promise))(function(m,y){function b(k){try{S(d.next(k))}catch(x){y(x)}}function w(k){try{S(d.throw(k))}catch(x){y(x)}}function S(k){k.done?m(k.value):g(k.value).then(b,w)}S((d=d.apply(l,c||[])).next())})},t=ji&&ji.__generator||function(l,c){var f={label:0,sent:function(){if(m[0]&1)throw m[1];return m[1]},trys:[],ops:[]},d,g,m,y;return y={next:b(0),throw:b(1),return:b(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function b(S){return function(k){return w([S,k])}}function w(S){if(d)throw new TypeError("Generator is already executing.");for(;f;)try{if(d=1,g&&(m=S[0]&2?g.return:S[0]?g.throw||((m=g.return)&&m.call(g),0):g.next)&&!(m=m.call(g,S[1])).done)return m;switch(g=0,m&&(S=[S[0]&2,m.value]),S[0]){case 0:case 1:m=S;break;case 4:return f.label++,{value:S[1],done:!1};case 5:f.label++,g=S[1],S=[0];continue;case 7:S=f.ops.pop(),f.trys.pop();continue;default:if(m=f.trys,!(m=m.length>0&&m[m.length-1])&&(S[0]===6||S[0]===2)){f=0;continue}if(S[0]===3&&(!m||S[1]>m[0]&&S[1]<m[3])){f.label=S[1];break}if(S[0]===6&&f.label<m[1]){f.label=m[1],m=S;break}if(m&&f.label<m[2]){f.label=m[2],f.ops.push(S);break}m[2]&&f.ops.pop(),f.trys.pop();continue}S=c.call(l,f)}catch(k){S=[6,k],g=0}finally{d=m=0}if(S[0]&5)throw S[1];return{value:S[0]?S[1]:void 0,done:!0}}},r=ji&&ji.__importDefault||function(l){return l&&l.__esModule?l:{default:l}};Object.defineProperty(ji,"__esModule",{value:!0});var i=r(fX),s=Kc(),o=rp(),a=np(),u=function(l){n(c,l);function c(f){var d=l.call(this)||this;return d.uri=f,d.connection=new i.default(f),d}return c.prototype.connect=function(){var f=this;return new Promise(function(d,g){var m=function(){f.connection.removeEventListener("open",m),d()};f.connection.addEventListener("open",m),f.connection.addEventListener("message",function(y){var b=y.data;f.transportRequestManager.resolveResponse(b)})})},c.prototype.sendData=function(f,d){return d===void 0&&(d=5e3),e(this,void 0,void 0,function(){var g,m,y;return t(this,function(b){g=this.transportRequestManager.addRequest(f,d),m=o.getNotifications(f);try{this.connection.send(JSON.stringify(this.parseData(f))),this.transportRequestManager.settlePendingRequest(m)}catch(w){y=new a.JSONRPCError(w.message,a.ERR_UNKNOWN,w),this.transportRequestManager.settlePendingRequest(m,y),this.transportRequestManager.settlePendingRequest(o.getBatchRequests(f),y),g=Promise.reject(y)}return[2,g]})})},c.prototype.close=function(){this.connection.close()},c}(s.Transport);return ji.default=u,ji}var zs={},PR;function dX(){if(PR)return zs;PR=1;var n=zs&&zs.__extends||function(){var a=function(u,l){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,f){c.__proto__=f}||function(c,f){for(var d in f)f.hasOwnProperty(d)&&(c[d]=f[d])},a(u,l)};return function(u,l){a(u,l);function c(){this.constructor=u}u.prototype=l===null?Object.create(l):(c.prototype=l.prototype,new c)}}(),e=zs&&zs.__awaiter||function(a,u,l,c){function f(d){return d instanceof l?d:new l(function(g){g(d)})}return new(l||(l=Promise))(function(d,g){function m(w){try{b(c.next(w))}catch(S){g(S)}}function y(w){try{b(c.throw(w))}catch(S){g(S)}}function b(w){w.done?d(w.value):f(w.value).then(m,y)}b((c=c.apply(a,u||[])).next())})},t=zs&&zs.__generator||function(a,u){var l={label:0,sent:function(){if(d[0]&1)throw d[1];return d[1]},trys:[],ops:[]},c,f,d,g;return g={next:m(0),throw:m(1),return:m(2)},typeof Symbol=="function"&&(g[Symbol.iterator]=function(){return this}),g;function m(b){return function(w){return y([b,w])}}function y(b){if(c)throw new TypeError("Generator is already executing.");for(;l;)try{if(c=1,f&&(d=b[0]&2?f.return:b[0]?f.throw||((d=f.return)&&d.call(f),0):f.next)&&!(d=d.call(f,b[1])).done)return d;switch(f=0,d&&(b=[b[0]&2,d.value]),b[0]){case 0:case 1:d=b;break;case 4:return l.label++,{value:b[1],done:!1};case 5:l.label++,f=b[1],b=[0];continue;case 7:b=l.ops.pop(),l.trys.pop();continue;default:if(d=l.trys,!(d=d.length>0&&d[d.length-1])&&(b[0]===6||b[0]===2)){l=0;continue}if(b[0]===3&&(!d||b[1]>d[0]&&b[1]<d[3])){l.label=b[1];break}if(b[0]===6&&l.label<d[1]){l.label=d[1],d=b;break}if(d&&l.label<d[2]){l.label=d[2],l.ops.push(b);break}d[2]&&l.ops.pop(),l.trys.pop();continue}b=u.call(a,l)}catch(w){b=[6,w],f=0}finally{c=d=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}};Object.defineProperty(zs,"__esModule",{value:!0});var r=Kc(),i=rp(),s=function(a){var u=400,l=window.screen.height,c=0,f=0;return window.open(a,"inspector:popup","left="+c+",top="+f+",width="+u+",height="+l+",resizable,scrollbars=yes,status=1")},o=function(a){n(u,a);function u(l){var c=a.call(this)||this;return c.messageHandler=function(f){c.transportRequestManager.resolveResponse(JSON.stringify(f.data))},c.uri=l,c.postMessageID="post-message-transport-"+Math.random(),c}return u.prototype.createWindow=function(l){return new Promise(function(c,f){var d;d=s(l),setTimeout(function(){c(d)},3e3)})},u.prototype.connect=function(){var l=this,c=/^(http|https):\/\/.*$/;return new Promise(function(f,d){return e(l,void 0,void 0,function(){var g;return t(this,function(m){switch(m.label){case 0:return c.test(this.uri)||d(new Error("Bad URI")),g=this,[4,this.createWindow(this.uri)];case 1:return g.frame=m.sent(),window.addEventListener("message",this.messageHandler),f(),[2]}})})})},u.prototype.sendData=function(l,c){return e(this,void 0,void 0,function(){var f,d;return t(this,function(g){return f=this.transportRequestManager.addRequest(l,null),d=i.getNotifications(l),this.frame&&(this.frame.postMessage(l.request,this.uri),this.transportRequestManager.settlePendingRequest(d)),[2,f]})})},u.prototype.close=function(){this.frame&&(window.removeEventListener("message",this.messageHandler),this.frame.close())},u}(r.Transport);return zs.default=o,zs}var Us={},IR;function pX(){if(IR)return Us;IR=1;var n=Us&&Us.__extends||function(){var o=function(a,u){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,c){l.__proto__=c}||function(l,c){for(var f in c)c.hasOwnProperty(f)&&(l[f]=c[f])},o(a,u)};return function(a,u){o(a,u);function l(){this.constructor=a}a.prototype=u===null?Object.create(u):(l.prototype=u.prototype,new l)}}(),e=Us&&Us.__awaiter||function(o,a,u,l){function c(f){return f instanceof u?f:new u(function(d){d(f)})}return new(u||(u=Promise))(function(f,d){function g(b){try{y(l.next(b))}catch(w){d(w)}}function m(b){try{y(l.throw(b))}catch(w){d(w)}}function y(b){b.done?f(b.value):c(b.value).then(g,m)}y((l=l.apply(o,a||[])).next())})},t=Us&&Us.__generator||function(o,a){var u={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},l,c,f,d;return d={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function g(y){return function(b){return m([y,b])}}function m(y){if(l)throw new TypeError("Generator is already executing.");for(;u;)try{if(l=1,c&&(f=y[0]&2?c.return:y[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,y[1])).done)return f;switch(c=0,f&&(y=[y[0]&2,f.value]),y[0]){case 0:case 1:f=y;break;case 4:return u.label++,{value:y[1],done:!1};case 5:u.label++,c=y[1],y=[0];continue;case 7:y=u.ops.pop(),u.trys.pop();continue;default:if(f=u.trys,!(f=f.length>0&&f[f.length-1])&&(y[0]===6||y[0]===2)){u=0;continue}if(y[0]===3&&(!f||y[1]>f[0]&&y[1]<f[3])){u.label=y[1];break}if(y[0]===6&&u.label<f[1]){u.label=f[1],f=y;break}if(f&&u.label<f[2]){u.label=f[2],u.ops.push(y);break}f[2]&&u.ops.pop(),u.trys.pop();continue}y=a.call(o,u)}catch(b){y=[6,b],c=0}finally{l=f=0}if(y[0]&5)throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}};Object.defineProperty(Us,"__esModule",{value:!0});var r=Kc(),i=rp(),s=function(o){n(a,o);function a(u){var l=o.call(this)||this;return l.messageHandler=function(c){l.transportRequestManager.resolveResponse(JSON.stringify(c.data))},l.uri=u,l.postMessageID="post-message-transport-"+Math.random(),l}return a.prototype.createWindow=function(u){var l=this;return new Promise(function(c,f){var d,g=document.createElement("iframe");g.setAttribute("id",l.postMessageID),g.setAttribute("width","0px"),g.setAttribute("height","0px"),g.setAttribute("style","visiblity:hidden;border:none;outline:none;"),g.addEventListener("load",function(){c(d)}),g.setAttribute("src",u),window.document.body.appendChild(g),d=g.contentWindow})},a.prototype.connect=function(){var u=this,l=/^(http|https):\/\/.*$/;return new Promise(function(c,f){return e(u,void 0,void 0,function(){var d;return t(this,function(g){switch(g.label){case 0:return l.test(this.uri)||f(new Error("Bad URI")),d=this,[4,this.createWindow(this.uri)];case 1:return d.frame=g.sent(),window.addEventListener("message",this.messageHandler),c(),[2]}})})})},a.prototype.sendData=function(u,l){return e(this,void 0,void 0,function(){var c,f;return t(this,function(d){return c=this.transportRequestManager.addRequest(u,null),f=i.getNotifications(u),this.frame&&(this.frame.postMessage(u.request,"*"),this.transportRequestManager.settlePendingRequest(f)),[2,c]})})},a.prototype.close=function(){var u=document.getElementById(this.postMessageID);u?.remove(),window.removeEventListener("message",this.messageHandler)},a}(r.Transport);return Us.default=s,Us}var Aa={},LR;function gX(){if(LR)return Aa;LR=1;var n=Aa&&Aa.__awaiter||function(r,i,s,o){function a(u){return u instanceof s?u:new s(function(l){l(u)})}return new(s||(s=Promise))(function(u,l){function c(g){try{d(o.next(g))}catch(m){l(m)}}function f(g){try{d(o.throw(g))}catch(m){l(m)}}function d(g){g.done?u(g.value):a(g.value).then(c,f)}d((o=o.apply(r,i||[])).next())})},e=Aa&&Aa.__generator||function(r,i){var s={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,l;return l={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function c(d){return function(g){return f([d,g])}}function f(d){if(o)throw new TypeError("Generator is already executing.");for(;s;)try{if(o=1,a&&(u=d[0]&2?a.return:d[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,d[1])).done)return u;switch(a=0,u&&(d=[d[0]&2,u.value]),d[0]){case 0:case 1:u=d;break;case 4:return s.label++,{value:d[1],done:!1};case 5:s.label++,a=d[1],d=[0];continue;case 7:d=s.ops.pop(),s.trys.pop();continue;default:if(u=s.trys,!(u=u.length>0&&u[u.length-1])&&(d[0]===6||d[0]===2)){s=0;continue}if(d[0]===3&&(!u||d[1]>u[0]&&d[1]<u[3])){s.label=d[1];break}if(d[0]===6&&s.label<u[1]){s.label=u[1],u=d;break}if(u&&s.label<u[2]){s.label=u[2],s.ops.push(d);break}u[2]&&s.ops.pop(),s.trys.pop();continue}d=i.call(r,s)}catch(g){d=[6,g],a=0}finally{o=u=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}};Object.defineProperty(Aa,"__esModule",{value:!0});var t=function(){function r(i){this.requestManager=i}return r.prototype.startBatch=function(){return this.requestManager.startBatch()},r.prototype.stopBatch=function(){return this.requestManager.stopBatch()},r.prototype.request=function(i,s){return n(this,void 0,void 0,function(){return e(this,function(o){switch(o.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:o.sent(),o.label=2;case 2:return[2,this.requestManager.request(i,!1,s)]}})})},r.prototype.notify=function(i){return n(this,void 0,void 0,function(){return e(this,function(s){switch(s.label){case 0:return this.requestManager.connectPromise?[4,this.requestManager.connectPromise]:[3,2];case 1:s.sent(),s.label=2;case 2:return[2,this.requestManager.request(i,!0,null)]}})})},r.prototype.onNotification=function(i){this.requestManager.requestChannel.addListener("notification",i)},r.prototype.onError=function(i){this.requestManager.requestChannel.addListener("error",i)},r.prototype.close=function(){this.requestManager.close()},r}();return Aa.default=t,Aa}var FR;function mX(){return FR||(FR=1,function(n){var e=ch&&ch.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(n,"__esModule",{value:!0}),n.PostMessageIframeTransport=n.PostMessageWindowTransport=n.JSONRPCError=n.WebSocketTransport=n.EventEmitterTransport=n.HTTPTransport=n.RequestManager=n.Client=void 0;var t=e(GY());n.RequestManager=t.default;var r=e(JY());n.EventEmitterTransport=r.default;var i=e(uX());n.HTTPTransport=i.default;var s=e(hX());n.WebSocketTransport=s.default;var o=e(dX());n.PostMessageWindowTransport=o.default;var a=e(pX());n.PostMessageIframeTransport=a.default;var u=np();Object.defineProperty(n,"JSONRPCError",{enumerable:!0,get:function(){return u.JSONRPCError}});var l=e(gX());n.Client=l.default,n.default=l.default}(ch)),ch}var NR=mX(),Ru={},Au={},Q0={},xb={},Ne={},Gn={},BR;function ip(){if(BR)return Gn;BR=1,Object.defineProperty(Gn,"__esModule",{value:!0}),Gn.stringArray=Gn.array=Gn.func=Gn.error=Gn.number=Gn.string=Gn.boolean=void 0;function n(a){return a===!0||a===!1}Gn.boolean=n;function e(a){return typeof a=="string"||a instanceof String}Gn.string=e;function t(a){return typeof a=="number"||a instanceof Number}Gn.number=t;function r(a){return a instanceof Error}Gn.error=r;function i(a){return typeof a=="function"}Gn.func=i;function s(a){return Array.isArray(a)}Gn.array=s;function o(a){return s(a)&&a.every(u=>e(u))}return Gn.stringArray=o,Gn}var qR;function lP(){if(qR)return Ne;qR=1,Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.Message=Ne.NotificationType9=Ne.NotificationType8=Ne.NotificationType7=Ne.NotificationType6=Ne.NotificationType5=Ne.NotificationType4=Ne.NotificationType3=Ne.NotificationType2=Ne.NotificationType1=Ne.NotificationType0=Ne.NotificationType=Ne.RequestType9=Ne.RequestType8=Ne.RequestType7=Ne.RequestType6=Ne.RequestType5=Ne.RequestType4=Ne.RequestType3=Ne.RequestType2=Ne.RequestType1=Ne.RequestType=Ne.RequestType0=Ne.AbstractMessageSignature=Ne.ParameterStructures=Ne.ResponseError=Ne.ErrorCodes=void 0;const n=ip();var e;(function(F){F.ParseError=-32700,F.InvalidRequest=-32600,F.MethodNotFound=-32601,F.InvalidParams=-32602,F.InternalError=-32603,F.jsonrpcReservedErrorRangeStart=-32099,F.serverErrorStart=-32099,F.MessageWriteError=-32099,F.MessageReadError=-32098,F.PendingResponseRejected=-32097,F.ConnectionInactive=-32096,F.ServerNotInitialized=-32002,F.UnknownErrorCode=-32001,F.jsonrpcReservedErrorRangeEnd=-32e3,F.serverErrorEnd=-32e3})(e||(Ne.ErrorCodes=e={}));class t extends Error{constructor(A,Y,N){super(Y),this.code=n.number(A)?A:e.UnknownErrorCode,this.data=N,Object.setPrototypeOf(this,t.prototype)}toJson(){const A={code:this.code,message:this.message};return this.data!==void 0&&(A.data=this.data),A}}Ne.ResponseError=t;class r{constructor(A){this.kind=A}static is(A){return A===r.auto||A===r.byName||A===r.byPosition}toString(){return this.kind}}Ne.ParameterStructures=r,r.auto=new r("auto"),r.byPosition=new r("byPosition"),r.byName=new r("byName");class i{constructor(A,Y){this.method=A,this.numberOfParams=Y}get parameterStructures(){return r.auto}}Ne.AbstractMessageSignature=i;class s extends i{constructor(A){super(A,0)}}Ne.RequestType0=s;class o extends i{constructor(A,Y=r.auto){super(A,1),this._parameterStructures=Y}get parameterStructures(){return this._parameterStructures}}Ne.RequestType=o;class a extends i{constructor(A,Y=r.auto){super(A,1),this._parameterStructures=Y}get parameterStructures(){return this._parameterStructures}}Ne.RequestType1=a;class u extends i{constructor(A){super(A,2)}}Ne.RequestType2=u;class l extends i{constructor(A){super(A,3)}}Ne.RequestType3=l;class c extends i{constructor(A){super(A,4)}}Ne.RequestType4=c;class f extends i{constructor(A){super(A,5)}}Ne.RequestType5=f;class d extends i{constructor(A){super(A,6)}}Ne.RequestType6=d;class g extends i{constructor(A){super(A,7)}}Ne.RequestType7=g;class m extends i{constructor(A){super(A,8)}}Ne.RequestType8=m;class y extends i{constructor(A){super(A,9)}}Ne.RequestType9=y;class b extends i{constructor(A,Y=r.auto){super(A,1),this._parameterStructures=Y}get parameterStructures(){return this._parameterStructures}}Ne.NotificationType=b;class w extends i{constructor(A){super(A,0)}}Ne.NotificationType0=w;class S extends i{constructor(A,Y=r.auto){super(A,1),this._parameterStructures=Y}get parameterStructures(){return this._parameterStructures}}Ne.NotificationType1=S;class k extends i{constructor(A){super(A,2)}}Ne.NotificationType2=k;class x extends i{constructor(A){super(A,3)}}Ne.NotificationType3=x;class C extends i{constructor(A){super(A,4)}}Ne.NotificationType4=C;class R extends i{constructor(A){super(A,5)}}Ne.NotificationType5=R;class P extends i{constructor(A){super(A,6)}}Ne.NotificationType6=P;class q extends i{constructor(A){super(A,7)}}Ne.NotificationType7=q;class B extends i{constructor(A){super(A,8)}}Ne.NotificationType8=B;class G extends i{constructor(A){super(A,9)}}Ne.NotificationType9=G;var V;return function(F){function A(ee){const oe=ee;return oe&&n.string(oe.method)&&(n.string(oe.id)||n.number(oe.id))}F.isRequest=A;function Y(ee){const oe=ee;return oe&&n.string(oe.method)&&ee.id===void 0}F.isNotification=Y;function N(ee){const oe=ee;return oe&&(oe.result!==void 0||!!oe.error)&&(n.string(oe.id)||n.number(oe.id)||oe.id===null)}F.isResponse=N}(V||(Ne.Message=V={})),Ne}var Bo={},jR;function cP(){if(jR)return Bo;jR=1;var n;Object.defineProperty(Bo,"__esModule",{value:!0}),Bo.LRUCache=Bo.LinkedMap=Bo.Touch=void 0;var e;(function(i){i.None=0,i.First=1,i.AsOld=i.First,i.Last=2,i.AsNew=i.Last})(e||(Bo.Touch=e={}));class t{constructor(){this[n]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(s){return this._map.has(s)}get(s,o=e.None){const a=this._map.get(s);if(a)return o!==e.None&&this.touch(a,o),a.value}set(s,o,a=e.None){let u=this._map.get(s);if(u)u.value=o,a!==e.None&&this.touch(u,a);else{switch(u={key:s,value:o,next:void 0,previous:void 0},a){case e.None:this.addItemLast(u);break;case e.First:this.addItemFirst(u);break;case e.Last:this.addItemLast(u);break;default:this.addItemLast(u);break}this._map.set(s,u),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){const o=this._map.get(s);if(o)return this._map.delete(s),this.removeItem(o),this._size--,o.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,o){const a=this._state;let u=this._head;for(;u;){if(o?s.bind(o)(u.value,u.key,this):s(u.value,u.key,this),this._state!==a)throw new Error("LinkedMap got modified during iteration.");u=u.next}}keys(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:o.key,done:!1};return o=o.next,u}else return{value:void 0,done:!0}}};return a}values(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:o.value,done:!1};return o=o.next,u}else return{value:void 0,done:!0}}};return a}entries(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const u={value:[o.key,o.value],done:!1};return o=o.next,u}else return{value:void 0,done:!0}}};return a}[(n=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let o=this._head,a=this.size;for(;o&&a>s;)this._map.delete(o.key),o=o.next,a--;this._head=o,this._size=a,o&&(o.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw new Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw new Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw new Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw new Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{const o=s.next,a=s.previous;if(!o||!a)throw new Error("Invalid list");o.previous=a,a.next=o}s.next=void 0,s.previous=void 0,this._state++}touch(s,o){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(o!==e.First&&o!==e.Last)){if(o===e.First){if(s===this._head)return;const a=s.next,u=s.previous;s===this._tail?(u.next=void 0,this._tail=u):(a.previous=u,u.next=a),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(o===e.Last){if(s===this._tail)return;const a=s.next,u=s.previous;s===this._head?(a.previous=void 0,this._head=a):(a.previous=u,u.next=a),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){const s=[];return this.forEach((o,a)=>{s.push([a,o])}),s}fromJSON(s){this.clear();for(const[o,a]of s)this.set(o,a)}}Bo.LinkedMap=t;class r extends t{constructor(s,o=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,o),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,o=e.AsNew){return super.get(s,o)}peek(s){return super.get(s,e.None)}set(s,o){return super.set(s,o,e.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}return Bo.LRUCache=r,Bo}var ph={},$R;function vX(){if($R)return ph;$R=1,Object.defineProperty(ph,"__esModule",{value:!0}),ph.Disposable=void 0;var n;return function(e){function t(r){return{dispose:r}}e.create=t}(n||(ph.Disposable=n={})),ph}var Du={},eg={},WR;function vl(){if(WR)return eg;WR=1,Object.defineProperty(eg,"__esModule",{value:!0});let n;function e(){if(n===void 0)throw new Error("No runtime abstraction layer installed");return n}return function(t){function r(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");n=i}t.install=r}(e||(e={})),eg.default=e,eg}var zR;function sp(){if(zR)return Du;zR=1,Object.defineProperty(Du,"__esModule",{value:!0}),Du.Emitter=Du.Event=void 0;const n=vl();var e;(function(i){const s={dispose(){}};i.None=function(){return s}})(e||(Du.Event=e={}));class t{add(s,o=null,a){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(s),this._contexts.push(o),Array.isArray(a)&&a.push({dispose:()=>this.remove(s,o)})}remove(s,o=null){if(!this._callbacks)return;let a=!1;for(let u=0,l=this._callbacks.length;u<l;u++)if(this._callbacks[u]===s)if(this._contexts[u]===o){this._callbacks.splice(u,1),this._contexts.splice(u,1);return}else a=!0;if(a)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...s){if(!this._callbacks)return[];const o=[],a=this._callbacks.slice(0),u=this._contexts.slice(0);for(let l=0,c=a.length;l<c;l++)try{o.push(a[l].apply(u[l],s))}catch(f){(0,n.default)().console.error(f)}return o}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class r{constructor(s){this._options=s}get event(){return this._event||(this._event=(s,o,a)=>{this._callbacks||(this._callbacks=new t),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(s,o);const u={dispose:()=>{this._callbacks&&(this._callbacks.remove(s,o),u.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(a)&&a.push(u),u}),this._event}fire(s){this._callbacks&&this._callbacks.invoke.call(this._callbacks,s)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return Du.Emitter=r,r._noop=function(){},Du}var Tu={},UR;function Hk(){if(UR)return Tu;UR=1,Object.defineProperty(Tu,"__esModule",{value:!0}),Tu.CancellationTokenSource=Tu.CancellationToken=void 0;const n=vl(),e=ip(),t=sp();var r;(function(a){a.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:t.Event.None}),a.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:t.Event.None});function u(l){const c=l;return c&&(c===a.None||c===a.Cancelled||e.boolean(c.isCancellationRequested)&&!!c.onCancellationRequested)}a.is=u})(r||(Tu.CancellationToken=r={}));const i=Object.freeze(function(a,u){const l=(0,n.default)().timer.setTimeout(a.bind(u),0);return{dispose(){l.dispose()}}});class s{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?i:(this._emitter||(this._emitter=new t.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class o{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=r.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=r.None}}return Tu.CancellationTokenSource=o,Tu}var Mu={},HR;function yX(){if(HR)return Mu;HR=1,Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.SharedArrayReceiverStrategy=Mu.SharedArraySenderStrategy=void 0;const n=Hk();var e;(function(o){o.Continue=0,o.Cancelled=1})(e||(e={}));class t{constructor(){this.buffers=new Map}enableCancellation(a){if(a.id===null)return;const u=new SharedArrayBuffer(4),l=new Int32Array(u,0,1);l[0]=e.Continue,this.buffers.set(a.id,u),a.$cancellationData=u}async sendCancellation(a,u){const l=this.buffers.get(u);if(l===void 0)return;const c=new Int32Array(l,0,1);Atomics.store(c,0,e.Cancelled)}cleanup(a){this.buffers.delete(a)}dispose(){this.buffers.clear()}}Mu.SharedArraySenderStrategy=t;class r{constructor(a){this.data=new Int32Array(a,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===e.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class i{constructor(a){this.token=new r(a)}cancel(){}dispose(){}}class s{constructor(){this.kind="request"}createCancellationTokenSource(a){const u=a.$cancellationData;return u===void 0?new n.CancellationTokenSource:new i(u)}}return Mu.SharedArrayReceiverStrategy=s,Mu}var qo={},gh={},VR;function fP(){if(VR)return gh;VR=1,Object.defineProperty(gh,"__esModule",{value:!0}),gh.Semaphore=void 0;const n=vl();class e{constructor(r=1){if(r<=0)throw new Error("Capacity must be greater than 0");this._capacity=r,this._active=0,this._waiting=[]}lock(r){return new Promise((i,s)=>{this._waiting.push({thunk:r,resolve:i,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,n.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const r=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const i=r.thunk();i instanceof Promise?i.then(s=>{this._active--,r.resolve(s),this.runNext()},s=>{this._active--,r.reject(s),this.runNext()}):(this._active--,r.resolve(i),this.runNext())}catch(i){this._active--,r.reject(i),this.runNext()}}}return gh.Semaphore=e,gh}var GR;function bX(){if(GR)return qo;GR=1,Object.defineProperty(qo,"__esModule",{value:!0}),qo.ReadableStreamMessageReader=qo.AbstractMessageReader=qo.MessageReader=void 0;const n=vl(),e=ip(),t=sp(),r=fP();var i;(function(u){function l(c){let f=c;return f&&e.func(f.listen)&&e.func(f.dispose)&&e.func(f.onError)&&e.func(f.onClose)&&e.func(f.onPartialMessage)}u.is=l})(i||(qo.MessageReader=i={}));class s{constructor(){this.errorEmitter=new t.Emitter,this.closeEmitter=new t.Emitter,this.partialMessageEmitter=new t.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(l){this.errorEmitter.fire(this.asError(l))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(l){this.partialMessageEmitter.fire(l)}asError(l){return l instanceof Error?l:new Error(`Reader received error. Reason: ${e.string(l.message)?l.message:"unknown"}`)}}qo.AbstractMessageReader=s;var o;(function(u){function l(c){let f,d;const g=new Map;let m;const y=new Map;if(c===void 0||typeof c=="string")f=c??"utf-8";else{if(f=c.charset??"utf-8",c.contentDecoder!==void 0&&(d=c.contentDecoder,g.set(d.name,d)),c.contentDecoders!==void 0)for(const b of c.contentDecoders)g.set(b.name,b);if(c.contentTypeDecoder!==void 0&&(m=c.contentTypeDecoder,y.set(m.name,m)),c.contentTypeDecoders!==void 0)for(const b of c.contentTypeDecoders)y.set(b.name,b)}return m===void 0&&(m=(0,n.default)().applicationJson.decoder,y.set(m.name,m)),{charset:f,contentDecoder:d,contentDecoders:g,contentTypeDecoder:m,contentTypeDecoders:y}}u.fromOptions=l})(o||(o={}));class a extends s{constructor(l,c){super(),this.readable=l,this.options=o.fromOptions(c),this.buffer=(0,n.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new r.Semaphore(1)}set partialMessageTimeout(l){this._partialMessageTimeout=l}get partialMessageTimeout(){return this._partialMessageTimeout}listen(l){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=l;const c=this.readable.onData(f=>{this.onData(f)});return this.readable.onError(f=>this.fireError(f)),this.readable.onClose(()=>this.fireClose()),c}onData(l){try{for(this.buffer.append(l);;){if(this.nextMessageLength===-1){const f=this.buffer.tryReadHeaders(!0);if(!f)return;const d=f.get("content-length");if(!d){this.fireError(new Error(`Header must provide a Content-Length property.
|
|
71
|
-
${JSON.stringify(Object.fromEntries(f))}`));return}const g=parseInt(d);if(isNaN(g)){this.fireError(new Error(`Content-Length value must be a number. Got ${d}`));return}this.nextMessageLength=g}const c=this.buffer.tryReadBody(this.nextMessageLength);if(c===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const f=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(c):c,d=await this.options.contentTypeDecoder.decode(f,this.options);this.callback(d)}).catch(f=>{this.fireError(f)})}}catch(c){this.fireError(c)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,n.default)().timer.setTimeout((l,c)=>{this.partialMessageTimer=void 0,l===this.messageToken&&(this.firePartialMessage({messageToken:l,waitingTime:c}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return qo.ReadableStreamMessageReader=a,qo}var jo={},KR;function wX(){if(KR)return jo;KR=1,Object.defineProperty(jo,"__esModule",{value:!0}),jo.WriteableStreamMessageWriter=jo.AbstractMessageWriter=jo.MessageWriter=void 0;const n=vl(),e=ip(),t=fP(),r=sp(),i="Content-Length: ",s=`\r
|
|
72
|
-
`;var o;(function(c){function f(d){let g=d;return g&&e.func(g.dispose)&&e.func(g.onClose)&&e.func(g.onError)&&e.func(g.write)}c.is=f})(o||(jo.MessageWriter=o={}));class a{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(f,d,g){this.errorEmitter.fire([this.asError(f),d,g])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(f){return f instanceof Error?f:new Error(`Writer received error. Reason: ${e.string(f.message)?f.message:"unknown"}`)}}jo.AbstractMessageWriter=a;var u;(function(c){function f(d){return d===void 0||typeof d=="string"?{charset:d??"utf-8",contentTypeEncoder:(0,n.default)().applicationJson.encoder}:{charset:d.charset??"utf-8",contentEncoder:d.contentEncoder,contentTypeEncoder:d.contentTypeEncoder??(0,n.default)().applicationJson.encoder}}c.fromOptions=f})(u||(u={}));class l extends a{constructor(f,d){super(),this.writable=f,this.options=u.fromOptions(d),this.errorCount=0,this.writeSemaphore=new t.Semaphore(1),this.writable.onError(g=>this.fireError(g)),this.writable.onClose(()=>this.fireClose())}async write(f){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(f,this.options).then(g=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(g):g).then(g=>{const m=[];return m.push(i,g.byteLength.toString(),s),m.push(s),this.doWrite(f,m,g)},g=>{throw this.fireError(g),g}))}async doWrite(f,d,g){try{return await this.writable.write(d.join(""),"ascii"),this.writable.write(g)}catch(m){return this.handleError(m,f),Promise.reject(m)}}handleError(f,d){this.errorCount++,this.fireError(f,d,this.errorCount)}end(){this.writable.end()}}return jo.WriteableStreamMessageWriter=l,jo}var mh={},JR;function _X(){if(JR)return mh;JR=1,Object.defineProperty(mh,"__esModule",{value:!0}),mh.AbstractMessageBuffer=void 0;const n=13,e=10,t=`\r
|
|
73
|
-
`;class r{constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){const o=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(o),this._totalLength+=o.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let o=0,a=0,u=0,l=0;e:for(;a<this._chunks.length;){const g=this._chunks[a];for(u=0;u<g.length;){switch(g[u]){case n:switch(o){case 0:o=1;break;case 2:o=3;break;default:o=0}break;case e:switch(o){case 1:o=2;break;case 3:o=4,u++;break e;default:o=0}break;default:o=0}u++}l+=g.byteLength,a++}if(o!==4)return;const c=this._read(l+u),f=new Map,d=this.toString(c,"ascii").split(t);if(d.length<2)return f;for(let g=0;g<d.length-2;g++){const m=d[g],y=m.indexOf(":");if(y===-1)throw new Error(`Message header must separate key and value using ':'
|
|
74
|
-
${m}`);const b=m.substr(0,y),w=m.substr(y+1).trim();f.set(s?b.toLowerCase():b,w)}return f}tryReadBody(s){if(!(this._totalLength<s))return this._read(s)}get numberOfBytes(){return this._totalLength}_read(s){if(s===0)return this.emptyBuffer();if(s>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){const l=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(l)}if(this._chunks[0].byteLength>s){const l=this._chunks[0],c=this.asNative(l,s);return this._chunks[0]=l.slice(s),this._totalLength-=s,c}const o=this.allocNative(s);let a=0,u=0;for(;s>0;){const l=this._chunks[u];if(l.byteLength>s){const c=l.slice(0,s);o.set(c,a),a+=s,this._chunks[u]=l.slice(s),this._totalLength-=s,s-=s}else o.set(l,a),a+=l.byteLength,this._chunks.shift(),this._totalLength-=l.byteLength,s-=l.byteLength}return o}}return mh.AbstractMessageBuffer=r,mh}var Sb={},YR;function kX(){return YR||(YR=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.createMessageConnection=n.ConnectionOptions=n.MessageStrategy=n.CancellationStrategy=n.CancellationSenderStrategy=n.CancellationReceiverStrategy=n.RequestCancellationReceiverStrategy=n.IdCancellationReceiverStrategy=n.ConnectionStrategy=n.ConnectionError=n.ConnectionErrors=n.LogTraceNotification=n.SetTraceNotification=n.TraceFormat=n.TraceValues=n.Trace=n.NullLogger=n.ProgressType=n.ProgressToken=void 0;const e=vl(),t=ip(),r=lP(),i=cP(),s=sp(),o=Hk();var a;(function(A){A.type=new r.NotificationType("$/cancelRequest")})(a||(a={}));var u;(function(A){function Y(N){return typeof N=="string"||typeof N=="number"}A.is=Y})(u||(n.ProgressToken=u={}));var l;(function(A){A.type=new r.NotificationType("$/progress")})(l||(l={}));class c{constructor(){}}n.ProgressType=c;var f;(function(A){function Y(N){return t.func(N)}A.is=Y})(f||(f={})),n.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var d;(function(A){A[A.Off=0]="Off",A[A.Messages=1]="Messages",A[A.Compact=2]="Compact",A[A.Verbose=3]="Verbose"})(d||(n.Trace=d={}));var g;(function(A){A.Off="off",A.Messages="messages",A.Compact="compact",A.Verbose="verbose"})(g||(n.TraceValues=g={})),function(A){function Y(ee){if(!t.string(ee))return A.Off;switch(ee=ee.toLowerCase(),ee){case"off":return A.Off;case"messages":return A.Messages;case"compact":return A.Compact;case"verbose":return A.Verbose;default:return A.Off}}A.fromString=Y;function N(ee){switch(ee){case A.Off:return"off";case A.Messages:return"messages";case A.Compact:return"compact";case A.Verbose:return"verbose";default:return"off"}}A.toString=N}(d||(n.Trace=d={}));var m;(function(A){A.Text="text",A.JSON="json"})(m||(n.TraceFormat=m={})),function(A){function Y(N){return t.string(N)?(N=N.toLowerCase(),N==="json"?A.JSON:A.Text):A.Text}A.fromString=Y}(m||(n.TraceFormat=m={}));var y;(function(A){A.type=new r.NotificationType("$/setTrace")})(y||(n.SetTraceNotification=y={}));var b;(function(A){A.type=new r.NotificationType("$/logTrace")})(b||(n.LogTraceNotification=b={}));var w;(function(A){A[A.Closed=1]="Closed",A[A.Disposed=2]="Disposed",A[A.AlreadyListening=3]="AlreadyListening"})(w||(n.ConnectionErrors=w={}));class S extends Error{constructor(Y,N){super(N),this.code=Y,Object.setPrototypeOf(this,S.prototype)}}n.ConnectionError=S;var k;(function(A){function Y(N){const ee=N;return ee&&t.func(ee.cancelUndispatched)}A.is=Y})(k||(n.ConnectionStrategy=k={}));var x;(function(A){function Y(N){const ee=N;return ee&&(ee.kind===void 0||ee.kind==="id")&&t.func(ee.createCancellationTokenSource)&&(ee.dispose===void 0||t.func(ee.dispose))}A.is=Y})(x||(n.IdCancellationReceiverStrategy=x={}));var C;(function(A){function Y(N){const ee=N;return ee&&ee.kind==="request"&&t.func(ee.createCancellationTokenSource)&&(ee.dispose===void 0||t.func(ee.dispose))}A.is=Y})(C||(n.RequestCancellationReceiverStrategy=C={}));var R;(function(A){A.Message=Object.freeze({createCancellationTokenSource(N){return new o.CancellationTokenSource}});function Y(N){return x.is(N)||C.is(N)}A.is=Y})(R||(n.CancellationReceiverStrategy=R={}));var P;(function(A){A.Message=Object.freeze({sendCancellation(N,ee){return N.sendNotification(a.type,{id:ee})},cleanup(N){}});function Y(N){const ee=N;return ee&&t.func(ee.sendCancellation)&&t.func(ee.cleanup)}A.is=Y})(P||(n.CancellationSenderStrategy=P={}));var q;(function(A){A.Message=Object.freeze({receiver:R.Message,sender:P.Message});function Y(N){const ee=N;return ee&&R.is(ee.receiver)&&P.is(ee.sender)}A.is=Y})(q||(n.CancellationStrategy=q={}));var B;(function(A){function Y(N){const ee=N;return ee&&t.func(ee.handleMessage)}A.is=Y})(B||(n.MessageStrategy=B={}));var G;(function(A){function Y(N){const ee=N;return ee&&(q.is(ee.cancellationStrategy)||k.is(ee.connectionStrategy)||B.is(ee.messageStrategy))}A.is=Y})(G||(n.ConnectionOptions=G={}));var V;(function(A){A[A.New=1]="New",A[A.Listening=2]="Listening",A[A.Closed=3]="Closed",A[A.Disposed=4]="Disposed"})(V||(V={}));function F(A,Y,N,ee){const oe=N!==void 0?N:n.NullLogger;let be=0,ve=0,De=0;const we="2.0";let Ie;const Rt=new Map;let wt;const tt=new Map,Jt=new Map;let In,nn=new i.LinkedMap,mn=new Map,Pt=new Set,Se=new Map,Je=d.Off,An=m.Text,Le,$t=V.New;const xn=new s.Emitter,Yt=new s.Emitter,st=new s.Emitter,Ln=new s.Emitter,At=new s.Emitter,ut=ee&&ee.cancellationStrategy?ee.cancellationStrategy:q.Message;function or(W){if(W===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+W.toString()}function ss(W){return W===null?"res-unknown-"+(++De).toString():"res-"+W.toString()}function pa(){return"not-"+(++ve).toString()}function Ur(W,de){r.Message.isRequest(de)?W.set(or(de.id),de):r.Message.isResponse(de)?W.set(ss(de.id),de):W.set(pa(),de)}function Ts(W){}function ar(){return $t===V.Listening}function Sn(){return $t===V.Closed}function Dt(){return $t===V.Disposed}function os(){($t===V.New||$t===V.Listening)&&($t=V.Closed,Yt.fire(void 0))}function as(W){xn.fire([W,void 0,void 0])}function Sr(W){xn.fire(W)}A.onClose(os),A.onError(as),Y.onClose(os),Y.onError(Sr);function Ti(){In||nn.size===0||(In=(0,e.default)().timer.setImmediate(()=>{In=void 0,fi()}))}function us(W){r.Message.isRequest(W)?Ms(W):r.Message.isNotification(W)?ga(W):r.Message.isResponse(W)?ko(W):xo(W)}function fi(){if(nn.size===0)return;const W=nn.shift();try{const de=ee?.messageStrategy;B.is(de)?de.handleMessage(W,us):us(W)}finally{Ti()}}const ls=W=>{try{if(r.Message.isNotification(W)&&W.method===a.type.method){const de=W.params.id,ke=or(de),Oe=nn.get(ke);if(r.Message.isRequest(Oe)){const bt=ee?.connectionStrategy,Wt=bt&&bt.cancelUndispatched?bt.cancelUndispatched(Oe,Ts):void 0;if(Wt&&(Wt.error!==void 0||Wt.result!==void 0)){nn.delete(ke),Se.delete(de),Wt.id=Oe.id,fs(Wt,W.method,Date.now()),Y.write(Wt).catch(()=>oe.error("Sending response for canceled message failed."));return}}const _t=Se.get(de);if(_t!==void 0){_t.cancel(),hs(W);return}else Pt.add(de)}Ur(nn,W)}finally{Ti()}};function Ms(W){if(Dt())return;function de(nt,Ft,rt){const zt={jsonrpc:we,id:W.id};nt instanceof r.ResponseError?zt.error=nt.toJson():zt.result=nt===void 0?null:nt,fs(zt,Ft,rt),Y.write(zt).catch(()=>oe.error("Sending response failed."))}function ke(nt,Ft,rt){const zt={jsonrpc:we,id:W.id,error:nt.toJson()};fs(zt,Ft,rt),Y.write(zt).catch(()=>oe.error("Sending response failed."))}function Oe(nt,Ft,rt){nt===void 0&&(nt=null);const zt={jsonrpc:we,id:W.id,result:nt};fs(zt,Ft,rt),Y.write(zt).catch(()=>oe.error("Sending response failed."))}So(W);const _t=Rt.get(W.method);let bt,Wt;_t&&(bt=_t.type,Wt=_t.handler);const Qt=Date.now();if(Wt||Ie){const nt=W.id??String(Date.now()),Ft=x.is(ut.receiver)?ut.receiver.createCancellationTokenSource(nt):ut.receiver.createCancellationTokenSource(W);W.id!==null&&Pt.has(W.id)&&Ft.cancel(),W.id!==null&&Se.set(nt,Ft);try{let rt;if(Wt)if(W.params===void 0){if(bt!==void 0&&bt.numberOfParams!==0){ke(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${W.method} defines ${bt.numberOfParams} params but received none.`),W.method,Qt);return}rt=Wt(Ft.token)}else if(Array.isArray(W.params)){if(bt!==void 0&&bt.parameterStructures===r.ParameterStructures.byName){ke(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${W.method} defines parameters by name but received parameters by position`),W.method,Qt);return}rt=Wt(...W.params,Ft.token)}else{if(bt!==void 0&&bt.parameterStructures===r.ParameterStructures.byPosition){ke(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${W.method} defines parameters by position but received parameters by name`),W.method,Qt);return}rt=Wt(W.params,Ft.token)}else Ie&&(rt=Ie(W.method,W.params,Ft.token));const zt=rt;rt?zt.then?zt.then(sn=>{Se.delete(nt),de(sn,W.method,Qt)},sn=>{Se.delete(nt),sn instanceof r.ResponseError?ke(sn,W.method,Qt):sn&&t.string(sn.message)?ke(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${W.method} failed with message: ${sn.message}`),W.method,Qt):ke(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${W.method} failed unexpectedly without providing any details.`),W.method,Qt)}):(Se.delete(nt),de(rt,W.method,Qt)):(Se.delete(nt),Oe(rt,W.method,Qt))}catch(rt){Se.delete(nt),rt instanceof r.ResponseError?de(rt,W.method,Qt):rt&&t.string(rt.message)?ke(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${W.method} failed with message: ${rt.message}`),W.method,Qt):ke(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${W.method} failed unexpectedly without providing any details.`),W.method,Qt)}}else ke(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${W.method}`),W.method,Qt)}function ko(W){if(!Dt())if(W.id===null)W.error?oe.error(`Received response message without id: Error is:
|
|
75
|
-
${JSON.stringify(W.error,void 0,4)}`):oe.error("Received response message without id. No further error information provided.");else{const de=W.id,ke=mn.get(de);if(Co(W,ke),ke!==void 0){mn.delete(de);try{if(W.error){const Oe=W.error;ke.reject(new r.ResponseError(Oe.code,Oe.message,Oe.data))}else if(W.result!==void 0)ke.resolve(W.result);else throw new Error("Should never happen.")}catch(Oe){Oe.message?oe.error(`Response handler '${ke.method}' failed with message: ${Oe.message}`):oe.error(`Response handler '${ke.method}' failed unexpectedly.`)}}}}function ga(W){if(Dt())return;let de,ke;if(W.method===a.type.method){const Oe=W.params.id;Pt.delete(Oe),hs(W);return}else{const Oe=tt.get(W.method);Oe&&(ke=Oe.handler,de=Oe.type)}if(ke||wt)try{if(hs(W),ke)if(W.params===void 0)de!==void 0&&de.numberOfParams!==0&&de.parameterStructures!==r.ParameterStructures.byName&&oe.error(`Notification ${W.method} defines ${de.numberOfParams} params but received none.`),ke();else if(Array.isArray(W.params)){const Oe=W.params;W.method===l.type.method&&Oe.length===2&&u.is(Oe[0])?ke({token:Oe[0],value:Oe[1]}):(de!==void 0&&(de.parameterStructures===r.ParameterStructures.byName&&oe.error(`Notification ${W.method} defines parameters by name but received parameters by position`),de.numberOfParams!==W.params.length&&oe.error(`Notification ${W.method} defines ${de.numberOfParams} params but received ${Oe.length} arguments`)),ke(...Oe))}else de!==void 0&&de.parameterStructures===r.ParameterStructures.byPosition&&oe.error(`Notification ${W.method} defines parameters by position but received parameters by name`),ke(W.params);else wt&&wt(W.method,W.params)}catch(Oe){Oe.message?oe.error(`Notification handler '${W.method}' failed with message: ${Oe.message}`):oe.error(`Notification handler '${W.method}' failed unexpectedly.`)}else st.fire(W)}function xo(W){if(!W){oe.error("Received empty message.");return}oe.error(`Received message which is neither a response nor a notification message:
|
|
76
|
-
${JSON.stringify(W,null,4)}`);const de=W;if(t.string(de.id)||t.number(de.id)){const ke=de.id,Oe=mn.get(ke);Oe&&Oe.reject(new Error("The received response has neither a result nor an error property."))}}function ur(W){if(W!=null)switch(Je){case d.Verbose:return JSON.stringify(W,null,4);case d.Compact:return JSON.stringify(W);default:return}}function Os(W){if(!(Je===d.Off||!Le))if(An===m.Text){let de;(Je===d.Verbose||Je===d.Compact)&&W.params&&(de=`Params: ${ur(W.params)}
|
|
77
|
-
|
|
78
|
-
`),Le.log(`Sending request '${W.method} - (${W.id})'.`,de)}else Cr("send-request",W)}function cs(W){if(!(Je===d.Off||!Le))if(An===m.Text){let de;(Je===d.Verbose||Je===d.Compact)&&(W.params?de=`Params: ${ur(W.params)}
|
|
79
|
-
|
|
80
|
-
`:de=`No parameters provided.
|
|
81
|
-
|
|
82
|
-
`),Le.log(`Sending notification '${W.method}'.`,de)}else Cr("send-notification",W)}function fs(W,de,ke){if(!(Je===d.Off||!Le))if(An===m.Text){let Oe;(Je===d.Verbose||Je===d.Compact)&&(W.error&&W.error.data?Oe=`Error data: ${ur(W.error.data)}
|
|
83
|
-
|
|
84
|
-
`:W.result?Oe=`Result: ${ur(W.result)}
|
|
85
|
-
|
|
86
|
-
`:W.error===void 0&&(Oe=`No result returned.
|
|
87
|
-
|
|
88
|
-
`)),Le.log(`Sending response '${de} - (${W.id})'. Processing request took ${Date.now()-ke}ms`,Oe)}else Cr("send-response",W)}function So(W){if(!(Je===d.Off||!Le))if(An===m.Text){let de;(Je===d.Verbose||Je===d.Compact)&&W.params&&(de=`Params: ${ur(W.params)}
|
|
89
|
-
|
|
90
|
-
`),Le.log(`Received request '${W.method} - (${W.id})'.`,de)}else Cr("receive-request",W)}function hs(W){if(!(Je===d.Off||!Le||W.method===b.type.method))if(An===m.Text){let de;(Je===d.Verbose||Je===d.Compact)&&(W.params?de=`Params: ${ur(W.params)}
|
|
91
|
-
|
|
92
|
-
`:de=`No parameters provided.
|
|
93
|
-
|
|
94
|
-
`),Le.log(`Received notification '${W.method}'.`,de)}else Cr("receive-notification",W)}function Co(W,de){if(!(Je===d.Off||!Le))if(An===m.Text){let ke;if((Je===d.Verbose||Je===d.Compact)&&(W.error&&W.error.data?ke=`Error data: ${ur(W.error.data)}
|
|
95
|
-
|
|
96
|
-
`:W.result?ke=`Result: ${ur(W.result)}
|
|
97
|
-
|
|
98
|
-
`:W.error===void 0&&(ke=`No result returned.
|
|
99
|
-
|
|
100
|
-
`)),de){const Oe=W.error?` Request failed: ${W.error.message} (${W.error.code}).`:"";Le.log(`Received response '${de.method} - (${W.id})' in ${Date.now()-de.timerStart}ms.${Oe}`,ke)}else Le.log(`Received response ${W.id} without active response promise.`,ke)}else Cr("receive-response",W)}function Cr(W,de){if(!Le||Je===d.Off)return;const ke={isLSPMessage:!0,type:W,message:de,timestamp:Date.now()};Le.log(ke)}function Hr(){if(Sn())throw new S(w.Closed,"Connection is closed.");if(Dt())throw new S(w.Disposed,"Connection is disposed.")}function Eo(){if(ar())throw new S(w.AlreadyListening,"Connection is already listening")}function Mi(){if(!ar())throw new Error("Call listen() first.")}function Oi(W){return W===void 0?null:W}function ds(W){if(W!==null)return W}function L(W){return W!=null&&!Array.isArray(W)&&typeof W=="object"}function Xt(W,de){switch(W){case r.ParameterStructures.auto:return L(de)?ds(de):[Oi(de)];case r.ParameterStructures.byName:if(!L(de))throw new Error("Received parameters by name but param is not an object literal.");return ds(de);case r.ParameterStructures.byPosition:return[Oi(de)];default:throw new Error(`Unknown parameter structure ${W.toString()}`)}}function Zt(W,de){let ke;const Oe=W.numberOfParams;switch(Oe){case 0:ke=void 0;break;case 1:ke=Xt(W.parameterStructures,de[0]);break;default:ke=[];for(let _t=0;_t<de.length&&_t<Oe;_t++)ke.push(Oi(de[_t]));if(de.length<Oe)for(let _t=de.length;_t<Oe;_t++)ke.push(null);break}return ke}const qe={sendNotification:(W,...de)=>{Hr();let ke,Oe;if(t.string(W)){ke=W;const bt=de[0];let Wt=0,Qt=r.ParameterStructures.auto;r.ParameterStructures.is(bt)&&(Wt=1,Qt=bt);let nt=de.length;const Ft=nt-Wt;switch(Ft){case 0:Oe=void 0;break;case 1:Oe=Xt(Qt,de[Wt]);break;default:if(Qt===r.ParameterStructures.byName)throw new Error(`Received ${Ft} parameters for 'by Name' notification parameter structure.`);Oe=de.slice(Wt,nt).map(rt=>Oi(rt));break}}else{const bt=de;ke=W.method,Oe=Zt(W,bt)}const _t={jsonrpc:we,method:ke,params:Oe};return cs(_t),Y.write(_t).catch(bt=>{throw oe.error("Sending notification failed."),bt})},onNotification:(W,de)=>{Hr();let ke;return t.func(W)?wt=W:de&&(t.string(W)?(ke=W,tt.set(W,{type:void 0,handler:de})):(ke=W.method,tt.set(W.method,{type:W,handler:de}))),{dispose:()=>{ke!==void 0?tt.delete(ke):wt=void 0}}},onProgress:(W,de,ke)=>{if(Jt.has(de))throw new Error(`Progress handler for token ${de} already registered`);return Jt.set(de,ke),{dispose:()=>{Jt.delete(de)}}},sendProgress:(W,de,ke)=>qe.sendNotification(l.type,{token:de,value:ke}),onUnhandledProgress:Ln.event,sendRequest:(W,...de)=>{Hr(),Mi();let ke,Oe,_t;if(t.string(W)){ke=W;const nt=de[0],Ft=de[de.length-1];let rt=0,zt=r.ParameterStructures.auto;r.ParameterStructures.is(nt)&&(rt=1,zt=nt);let sn=de.length;o.CancellationToken.is(Ft)&&(sn=sn-1,_t=Ft);const Hn=sn-rt;switch(Hn){case 0:Oe=void 0;break;case 1:Oe=Xt(zt,de[rt]);break;default:if(zt===r.ParameterStructures.byName)throw new Error(`Received ${Hn} parameters for 'by Name' request parameter structure.`);Oe=de.slice(rt,sn).map(Zc=>Oi(Zc));break}}else{const nt=de;ke=W.method,Oe=Zt(W,nt);const Ft=W.numberOfParams;_t=o.CancellationToken.is(nt[Ft])?nt[Ft]:void 0}const bt=be++;let Wt;_t&&(Wt=_t.onCancellationRequested(()=>{const nt=ut.sender.sendCancellation(qe,bt);return nt===void 0?(oe.log(`Received no promise from cancellation strategy when cancelling id ${bt}`),Promise.resolve()):nt.catch(()=>{oe.log(`Sending cancellation messages for id ${bt} failed`)})}));const Qt={jsonrpc:we,id:bt,method:ke,params:Oe};return Os(Qt),typeof ut.sender.enableCancellation=="function"&&ut.sender.enableCancellation(Qt),new Promise(async(nt,Ft)=>{const rt=Hn=>{nt(Hn),ut.sender.cleanup(bt),Wt?.dispose()},zt=Hn=>{Ft(Hn),ut.sender.cleanup(bt),Wt?.dispose()},sn={method:ke,timerStart:Date.now(),resolve:rt,reject:zt};try{await Y.write(Qt),mn.set(bt,sn)}catch(Hn){throw oe.error("Sending request failed."),sn.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,Hn.message?Hn.message:"Unknown reason")),Hn}})},onRequest:(W,de)=>{Hr();let ke=null;return f.is(W)?(ke=void 0,Ie=W):t.string(W)?(ke=null,de!==void 0&&(ke=W,Rt.set(W,{handler:de,type:void 0}))):de!==void 0&&(ke=W.method,Rt.set(W.method,{type:W,handler:de})),{dispose:()=>{ke!==null&&(ke!==void 0?Rt.delete(ke):Ie=void 0)}}},hasPendingResponse:()=>mn.size>0,trace:async(W,de,ke)=>{let Oe=!1,_t=m.Text;ke!==void 0&&(t.boolean(ke)?Oe=ke:(Oe=ke.sendNotification||!1,_t=ke.traceFormat||m.Text)),Je=W,An=_t,Je===d.Off?Le=void 0:Le=de,Oe&&!Sn()&&!Dt()&&await qe.sendNotification(y.type,{value:d.toString(W)})},onError:xn.event,onClose:Yt.event,onUnhandledNotification:st.event,onDispose:At.event,end:()=>{Y.end()},dispose:()=>{if(Dt())return;$t=V.Disposed,At.fire(void 0);const W=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const de of mn.values())de.reject(W);mn=new Map,Se=new Map,Pt=new Set,nn=new i.LinkedMap,t.func(Y.dispose)&&Y.dispose(),t.func(A.dispose)&&A.dispose()},listen:()=>{Hr(),Eo(),$t=V.Listening,A.listen(ls)},inspect:()=>{(0,e.default)().console.log("inspect")}};return qe.onNotification(b.type,W=>{if(Je===d.Off||!Le)return;const de=Je===d.Verbose||Je===d.Compact;Le.log(W.message,de?W.verbose:void 0)}),qe.onNotification(l.type,W=>{const de=Jt.get(W.token);de?de(W.value):Ln.fire(W)}),qe}n.createMessageConnection=F}(Sb)),Sb}var XR;function h_(){return XR||(XR=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.ProgressType=n.ProgressToken=n.createMessageConnection=n.NullLogger=n.ConnectionOptions=n.ConnectionStrategy=n.AbstractMessageBuffer=n.WriteableStreamMessageWriter=n.AbstractMessageWriter=n.MessageWriter=n.ReadableStreamMessageReader=n.AbstractMessageReader=n.MessageReader=n.SharedArrayReceiverStrategy=n.SharedArraySenderStrategy=n.CancellationToken=n.CancellationTokenSource=n.Emitter=n.Event=n.Disposable=n.LRUCache=n.Touch=n.LinkedMap=n.ParameterStructures=n.NotificationType9=n.NotificationType8=n.NotificationType7=n.NotificationType6=n.NotificationType5=n.NotificationType4=n.NotificationType3=n.NotificationType2=n.NotificationType1=n.NotificationType0=n.NotificationType=n.ErrorCodes=n.ResponseError=n.RequestType9=n.RequestType8=n.RequestType7=n.RequestType6=n.RequestType5=n.RequestType4=n.RequestType3=n.RequestType2=n.RequestType1=n.RequestType0=n.RequestType=n.Message=n.RAL=void 0,n.MessageStrategy=n.CancellationStrategy=n.CancellationSenderStrategy=n.CancellationReceiverStrategy=n.ConnectionError=n.ConnectionErrors=n.LogTraceNotification=n.SetTraceNotification=n.TraceFormat=n.TraceValues=n.Trace=void 0;const e=lP();Object.defineProperty(n,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(n,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(n,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(n,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(n,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(n,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(n,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(n,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(n,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(n,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(n,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(n,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(n,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(n,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(n,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(n,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(n,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(n,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(n,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(n,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(n,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(n,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(n,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(n,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(n,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(n,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const t=cP();Object.defineProperty(n,"LinkedMap",{enumerable:!0,get:function(){return t.LinkedMap}}),Object.defineProperty(n,"LRUCache",{enumerable:!0,get:function(){return t.LRUCache}}),Object.defineProperty(n,"Touch",{enumerable:!0,get:function(){return t.Touch}});const r=vX();Object.defineProperty(n,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=sp();Object.defineProperty(n,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(n,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const s=Hk();Object.defineProperty(n,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(n,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const o=yX();Object.defineProperty(n,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return o.SharedArraySenderStrategy}}),Object.defineProperty(n,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return o.SharedArrayReceiverStrategy}});const a=bX();Object.defineProperty(n,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(n,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(n,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const u=wX();Object.defineProperty(n,"MessageWriter",{enumerable:!0,get:function(){return u.MessageWriter}}),Object.defineProperty(n,"AbstractMessageWriter",{enumerable:!0,get:function(){return u.AbstractMessageWriter}}),Object.defineProperty(n,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return u.WriteableStreamMessageWriter}});const l=_X();Object.defineProperty(n,"AbstractMessageBuffer",{enumerable:!0,get:function(){return l.AbstractMessageBuffer}});const c=kX();Object.defineProperty(n,"ConnectionStrategy",{enumerable:!0,get:function(){return c.ConnectionStrategy}}),Object.defineProperty(n,"ConnectionOptions",{enumerable:!0,get:function(){return c.ConnectionOptions}}),Object.defineProperty(n,"NullLogger",{enumerable:!0,get:function(){return c.NullLogger}}),Object.defineProperty(n,"createMessageConnection",{enumerable:!0,get:function(){return c.createMessageConnection}}),Object.defineProperty(n,"ProgressToken",{enumerable:!0,get:function(){return c.ProgressToken}}),Object.defineProperty(n,"ProgressType",{enumerable:!0,get:function(){return c.ProgressType}}),Object.defineProperty(n,"Trace",{enumerable:!0,get:function(){return c.Trace}}),Object.defineProperty(n,"TraceValues",{enumerable:!0,get:function(){return c.TraceValues}}),Object.defineProperty(n,"TraceFormat",{enumerable:!0,get:function(){return c.TraceFormat}}),Object.defineProperty(n,"SetTraceNotification",{enumerable:!0,get:function(){return c.SetTraceNotification}}),Object.defineProperty(n,"LogTraceNotification",{enumerable:!0,get:function(){return c.LogTraceNotification}}),Object.defineProperty(n,"ConnectionErrors",{enumerable:!0,get:function(){return c.ConnectionErrors}}),Object.defineProperty(n,"ConnectionError",{enumerable:!0,get:function(){return c.ConnectionError}}),Object.defineProperty(n,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return c.CancellationReceiverStrategy}}),Object.defineProperty(n,"CancellationSenderStrategy",{enumerable:!0,get:function(){return c.CancellationSenderStrategy}}),Object.defineProperty(n,"CancellationStrategy",{enumerable:!0,get:function(){return c.CancellationStrategy}}),Object.defineProperty(n,"MessageStrategy",{enumerable:!0,get:function(){return c.MessageStrategy}});const f=vl();n.RAL=f.default}(xb)),xb}var ZR;function xX(){if(ZR)return Q0;ZR=1,Object.defineProperty(Q0,"__esModule",{value:!0});const n=h_();class e extends n.AbstractMessageBuffer{constructor(u="utf-8"){super(u),this.asciiDecoder=new TextDecoder("ascii")}emptyBuffer(){return e.emptyBuffer}fromString(u,l){return new TextEncoder().encode(u)}toString(u,l){return l==="ascii"?this.asciiDecoder.decode(u):new TextDecoder(l).decode(u)}asNative(u,l){return l===void 0?u:u.slice(0,l)}allocNative(u){return new Uint8Array(u)}}e.emptyBuffer=new Uint8Array(0);class t{constructor(u){this.socket=u,this._onData=new n.Emitter,this._messageListener=l=>{l.data.arrayBuffer().then(f=>{this._onData.fire(new Uint8Array(f))},()=>{(0,n.RAL)().console.error("Converting blob to array buffer failed.")})},this.socket.addEventListener("message",this._messageListener)}onClose(u){return this.socket.addEventListener("close",u),n.Disposable.create(()=>this.socket.removeEventListener("close",u))}onError(u){return this.socket.addEventListener("error",u),n.Disposable.create(()=>this.socket.removeEventListener("error",u))}onEnd(u){return this.socket.addEventListener("end",u),n.Disposable.create(()=>this.socket.removeEventListener("end",u))}onData(u){return this._onData.event(u)}}class r{constructor(u){this.socket=u}onClose(u){return this.socket.addEventListener("close",u),n.Disposable.create(()=>this.socket.removeEventListener("close",u))}onError(u){return this.socket.addEventListener("error",u),n.Disposable.create(()=>this.socket.removeEventListener("error",u))}onEnd(u){return this.socket.addEventListener("end",u),n.Disposable.create(()=>this.socket.removeEventListener("end",u))}write(u,l){if(typeof u=="string"){if(l!==void 0&&l!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${l}`);this.socket.send(u)}else this.socket.send(u);return Promise.resolve()}end(){this.socket.close()}}const i=new TextEncoder,s=Object.freeze({messageBuffer:Object.freeze({create:a=>new e(a)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(a,u)=>{if(u.charset!=="utf-8")throw new Error(`In a Browser environments only utf-8 text encoding is supported. But got encoding: ${u.charset}`);return Promise.resolve(i.encode(JSON.stringify(a,void 0,0)))}}),decoder:Object.freeze({name:"application/json",decode:(a,u)=>{if(!(a instanceof Uint8Array))throw new Error("In a Browser environments only Uint8Arrays are supported.");return Promise.resolve(JSON.parse(new TextDecoder(u.charset).decode(a)))}})}),stream:Object.freeze({asReadableStream:a=>new t(a),asWritableStream:a=>new r(a)}),console,timer:Object.freeze({setTimeout(a,u,...l){const c=setTimeout(a,u,...l);return{dispose:()=>clearTimeout(c)}},setImmediate(a,...u){const l=setTimeout(a,0,...u);return{dispose:()=>clearTimeout(l)}},setInterval(a,u,...l){const c=setInterval(a,u,...l);return{dispose:()=>clearInterval(c)}}})});function o(){return s}return function(a){function u(){n.RAL.install(s)}a.install=u}(o||(o={})),Q0.default=o,Q0}var QR;function Yc(){return QR||(QR=1,function(n){var e=Au&&Au.__createBinding||(Object.create?function(u,l,c,f){f===void 0&&(f=c);var d=Object.getOwnPropertyDescriptor(l,c);(!d||("get"in d?!l.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return l[c]}}),Object.defineProperty(u,f,d)}:function(u,l,c,f){f===void 0&&(f=c),u[f]=l[c]}),t=Au&&Au.__exportStar||function(u,l){for(var c in u)c!=="default"&&!Object.prototype.hasOwnProperty.call(l,c)&&e(l,u,c)};Object.defineProperty(n,"__esModule",{value:!0}),n.createMessageConnection=n.BrowserMessageWriter=n.BrowserMessageReader=void 0,xX().default.install();const i=h_();t(h_(),n);class s extends i.AbstractMessageReader{constructor(l){super(),this._onData=new i.Emitter,this._messageListener=c=>{this._onData.fire(c.data)},l.addEventListener("error",c=>this.fireError(c)),l.onmessage=this._messageListener}listen(l){return this._onData.event(l)}}n.BrowserMessageReader=s;class o extends i.AbstractMessageWriter{constructor(l){super(),this.port=l,this.errorCount=0,l.addEventListener("error",c=>this.fireError(c))}write(l){try{return this.port.postMessage(l),Promise.resolve()}catch(c){return this.handleError(c,l),Promise.reject(c)}}handleError(l,c){this.errorCount++,this.fireError(l,c,this.errorCount)}end(){}}n.BrowserMessageWriter=o;function a(u,l,c,f){return c===void 0&&(c=i.NullLogger),i.ConnectionStrategy.is(f)&&(f={connectionStrategy:f}),(0,i.createMessageConnection)(u,l,c,f)}n.createMessageConnection=a}(Au)),Au}var Cb,eA;function tA(){return eA||(eA=1,Cb=Yc()),Cb}var Ou={},d_;(function(n){function e(t){return typeof t=="string"}n.is=e})(d_||(d_={}));var Xm;(function(n){function e(t){return typeof t=="string"}n.is=e})(Xm||(Xm={}));var p_;(function(n){n.MIN_VALUE=-2147483648,n.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&n.MIN_VALUE<=t&&t<=n.MAX_VALUE}n.is=e})(p_||(p_={}));var Ad;(function(n){n.MIN_VALUE=0,n.MAX_VALUE=2147483647;function e(t){return typeof t=="number"&&n.MIN_VALUE<=t&&t<=n.MAX_VALUE}n.is=e})(Ad||(Ad={}));var Hi;(function(n){function e(r,i){return r===Number.MAX_VALUE&&(r=Ad.MAX_VALUE),i===Number.MAX_VALUE&&(i=Ad.MAX_VALUE),{line:r,character:i}}n.create=e;function t(r){let i=r;return re.objectLiteral(i)&&re.uinteger(i.line)&&re.uinteger(i.character)}n.is=t})(Hi||(Hi={}));var pn;(function(n){function e(r,i,s,o){if(re.uinteger(r)&&re.uinteger(i)&&re.uinteger(s)&&re.uinteger(o))return{start:Hi.create(r,i),end:Hi.create(s,o)};if(Hi.is(r)&&Hi.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${o}]`)}n.create=e;function t(r){let i=r;return re.objectLiteral(i)&&Hi.is(i.start)&&Hi.is(i.end)}n.is=t})(pn||(pn={}));var Dd;(function(n){function e(r,i){return{uri:r,range:i}}n.create=e;function t(r){let i=r;return re.objectLiteral(i)&&pn.is(i.range)&&(re.string(i.uri)||re.undefined(i.uri))}n.is=t})(Dd||(Dd={}));var g_;(function(n){function e(r,i,s,o){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:o}}n.create=e;function t(r){let i=r;return re.objectLiteral(i)&&pn.is(i.targetRange)&&re.string(i.targetUri)&&pn.is(i.targetSelectionRange)&&(pn.is(i.originSelectionRange)||re.undefined(i.originSelectionRange))}n.is=t})(g_||(g_={}));var Zm;(function(n){function e(r,i,s,o){return{red:r,green:i,blue:s,alpha:o}}n.create=e;function t(r){const i=r;return re.objectLiteral(i)&&re.numberRange(i.red,0,1)&&re.numberRange(i.green,0,1)&&re.numberRange(i.blue,0,1)&&re.numberRange(i.alpha,0,1)}n.is=t})(Zm||(Zm={}));var m_;(function(n){function e(r,i){return{range:r,color:i}}n.create=e;function t(r){const i=r;return re.objectLiteral(i)&&pn.is(i.range)&&Zm.is(i.color)}n.is=t})(m_||(m_={}));var v_;(function(n){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}n.create=e;function t(r){const i=r;return re.objectLiteral(i)&&re.string(i.label)&&(re.undefined(i.textEdit)||co.is(i))&&(re.undefined(i.additionalTextEdits)||re.typedArray(i.additionalTextEdits,co.is))}n.is=t})(v_||(v_={}));var y_;(function(n){n.Comment="comment",n.Imports="imports",n.Region="region"})(y_||(y_={}));var b_;(function(n){function e(r,i,s,o,a,u){const l={startLine:r,endLine:i};return re.defined(s)&&(l.startCharacter=s),re.defined(o)&&(l.endCharacter=o),re.defined(a)&&(l.kind=a),re.defined(u)&&(l.collapsedText=u),l}n.create=e;function t(r){const i=r;return re.objectLiteral(i)&&re.uinteger(i.startLine)&&re.uinteger(i.startLine)&&(re.undefined(i.startCharacter)||re.uinteger(i.startCharacter))&&(re.undefined(i.endCharacter)||re.uinteger(i.endCharacter))&&(re.undefined(i.kind)||re.string(i.kind))}n.is=t})(b_||(b_={}));var Qm;(function(n){function e(r,i){return{location:r,message:i}}n.create=e;function t(r){let i=r;return re.defined(i)&&Dd.is(i.location)&&re.string(i.message)}n.is=t})(Qm||(Qm={}));var w_;(function(n){n.Error=1,n.Warning=2,n.Information=3,n.Hint=4})(w_||(w_={}));var __;(function(n){n.Unnecessary=1,n.Deprecated=2})(__||(__={}));var k_;(function(n){function e(t){const r=t;return re.objectLiteral(r)&&re.string(r.href)}n.is=e})(k_||(k_={}));var Td;(function(n){function e(r,i,s,o,a,u){let l={range:r,message:i};return re.defined(s)&&(l.severity=s),re.defined(o)&&(l.code=o),re.defined(a)&&(l.source=a),re.defined(u)&&(l.relatedInformation=u),l}n.create=e;function t(r){var i;let s=r;return re.defined(s)&&pn.is(s.range)&&re.string(s.message)&&(re.number(s.severity)||re.undefined(s.severity))&&(re.integer(s.code)||re.string(s.code)||re.undefined(s.code))&&(re.undefined(s.codeDescription)||re.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(re.string(s.source)||re.undefined(s.source))&&(re.undefined(s.relatedInformation)||re.typedArray(s.relatedInformation,Qm.is))}n.is=t})(Td||(Td={}));var dl;(function(n){function e(r,i,...s){let o={title:r,command:i};return re.defined(s)&&s.length>0&&(o.arguments=s),o}n.create=e;function t(r){let i=r;return re.defined(i)&&re.string(i.title)&&re.string(i.command)}n.is=t})(dl||(dl={}));var co;(function(n){function e(s,o){return{range:s,newText:o}}n.replace=e;function t(s,o){return{range:{start:s,end:s},newText:o}}n.insert=t;function r(s){return{range:s,newText:""}}n.del=r;function i(s){const o=s;return re.objectLiteral(o)&&re.string(o.newText)&&pn.is(o.range)}n.is=i})(co||(co={}));var Qu;(function(n){function e(r,i,s){const o={label:r};return i!==void 0&&(o.needsConfirmation=i),s!==void 0&&(o.description=s),o}n.create=e;function t(r){const i=r;return re.objectLiteral(i)&&re.string(i.label)&&(re.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(re.string(i.description)||i.description===void 0)}n.is=t})(Qu||(Qu={}));var er;(function(n){function e(t){const r=t;return re.string(r)}n.is=e})(er||(er={}));var Go;(function(n){function e(s,o,a){return{range:s,newText:o,annotationId:a}}n.replace=e;function t(s,o,a){return{range:{start:s,end:s},newText:o,annotationId:a}}n.insert=t;function r(s,o){return{range:s,newText:"",annotationId:o}}n.del=r;function i(s){const o=s;return co.is(o)&&(Qu.is(o.annotationId)||er.is(o.annotationId))}n.is=i})(Go||(Go={}));var Md;(function(n){function e(r,i){return{textDocument:r,edits:i}}n.create=e;function t(r){let i=r;return re.defined(i)&&Od.is(i.textDocument)&&Array.isArray(i.edits)}n.is=t})(Md||(Md={}));var Tc;(function(n){function e(r,i,s){let o={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}n.create=e;function t(r){let i=r;return i&&i.kind==="create"&&re.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||re.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||re.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||er.is(i.annotationId))}n.is=t})(Tc||(Tc={}));var Mc;(function(n){function e(r,i,s,o){let a={kind:"rename",oldUri:r,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(a.options=s),o!==void 0&&(a.annotationId=o),a}n.create=e;function t(r){let i=r;return i&&i.kind==="rename"&&re.string(i.oldUri)&&re.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||re.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||re.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||er.is(i.annotationId))}n.is=t})(Mc||(Mc={}));var Oc;(function(n){function e(r,i,s){let o={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}n.create=e;function t(r){let i=r;return i&&i.kind==="delete"&&re.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||re.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||re.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||er.is(i.annotationId))}n.is=t})(Oc||(Oc={}));var e1;(function(n){function e(t){let r=t;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>re.string(i.kind)?Tc.is(i)||Mc.is(i)||Oc.is(i):Md.is(i)))}n.is=e})(e1||(e1={}));class tg{constructor(e,t){this.edits=e,this.changeAnnotations=t}insert(e,t,r){let i,s;if(r===void 0?i=co.insert(e,t):er.is(r)?(s=r,i=Go.insert(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(r),i=Go.insert(e,t,s)),this.edits.push(i),s!==void 0)return s}replace(e,t,r){let i,s;if(r===void 0?i=co.replace(e,t):er.is(r)?(s=r,i=Go.replace(e,t,r)):(this.assertChangeAnnotations(this.changeAnnotations),s=this.changeAnnotations.manage(r),i=Go.replace(e,t,s)),this.edits.push(i),s!==void 0)return s}delete(e,t){let r,i;if(t===void 0?r=co.del(e):er.is(t)?(i=t,r=Go.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(t),r=Go.del(e,i)),this.edits.push(r),i!==void 0)return i}add(e){this.edits.push(e)}all(){return this.edits}clear(){this.edits.splice(0,this.edits.length)}assertChangeAnnotations(e){if(e===void 0)throw new Error("Text edit change is not configured to manage change annotations.")}}class nA{constructor(e){this._annotations=e===void 0?Object.create(null):e,this._counter=0,this._size=0}all(){return this._annotations}get size(){return this._size}manage(e,t){let r;if(er.is(e)?r=e:(r=this.nextId(),t=e),this._annotations[r]!==void 0)throw new Error(`Id ${r} is already in use.`);if(t===void 0)throw new Error(`No annotation provided for id ${r}`);return this._annotations[r]=t,this._size++,r}nextId(){return this._counter++,this._counter.toString()}}class SX{constructor(e){this._textEditChanges=Object.create(null),e!==void 0?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new nA(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach(t=>{if(Md.is(t)){const r=new tg(t.edits,this._changeAnnotations);this._textEditChanges[t.textDocument.uri]=r}})):e.changes&&Object.keys(e.changes).forEach(t=>{const r=new tg(e.changes[t]);this._textEditChanges[t]=r})):this._workspaceEdit={}}get edit(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit}getTextEditChange(e){if(Od.is(e)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");const t={uri:e.uri,version:e.version};let r=this._textEditChanges[t.uri];if(!r){const i=[],s={textDocument:t,edits:i};this._workspaceEdit.documentChanges.push(s),r=new tg(i,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");let t=this._textEditChanges[e];if(!t){let r=[];this._workspaceEdit.changes[e]=r,t=new tg(r),this._textEditChanges[e]=t}return t}}initDocumentChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new nA,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())}initChanges(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))}createFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;Qu.is(t)||er.is(t)?i=t:r=t;let s,o;if(i===void 0?s=Tc.create(e,r):(o=er.is(i)?i:this._changeAnnotations.manage(i),s=Tc.create(e,r,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}renameFile(e,t,r,i){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let s;Qu.is(r)||er.is(r)?s=r:i=r;let o,a;if(s===void 0?o=Mc.create(e,t,i):(a=er.is(s)?s:this._changeAnnotations.manage(s),o=Mc.create(e,t,i,a)),this._workspaceEdit.documentChanges.push(o),a!==void 0)return a}deleteFile(e,t,r){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");let i;Qu.is(t)||er.is(t)?i=t:r=t;let s,o;if(i===void 0?s=Oc.create(e,r):(o=er.is(i)?i:this._changeAnnotations.manage(i),s=Oc.create(e,r,o)),this._workspaceEdit.documentChanges.push(s),o!==void 0)return o}}var x_;(function(n){function e(r){return{uri:r}}n.create=e;function t(r){let i=r;return re.defined(i)&&re.string(i.uri)}n.is=t})(x_||(x_={}));var S_;(function(n){function e(r,i){return{uri:r,version:i}}n.create=e;function t(r){let i=r;return re.defined(i)&&re.string(i.uri)&&re.integer(i.version)}n.is=t})(S_||(S_={}));var Od;(function(n){function e(r,i){return{uri:r,version:i}}n.create=e;function t(r){let i=r;return re.defined(i)&&re.string(i.uri)&&(i.version===null||re.integer(i.version))}n.is=t})(Od||(Od={}));var C_;(function(n){function e(r,i,s,o){return{uri:r,languageId:i,version:s,text:o}}n.create=e;function t(r){let i=r;return re.defined(i)&&re.string(i.uri)&&re.string(i.languageId)&&re.integer(i.version)&&re.string(i.text)}n.is=t})(C_||(C_={}));var t1;(function(n){n.PlainText="plaintext",n.Markdown="markdown";function e(t){const r=t;return r===n.PlainText||r===n.Markdown}n.is=e})(t1||(t1={}));var Pc;(function(n){function e(t){const r=t;return re.objectLiteral(t)&&t1.is(r.kind)&&re.string(r.value)}n.is=e})(Pc||(Pc={}));var E_;(function(n){n.Text=1,n.Method=2,n.Function=3,n.Constructor=4,n.Field=5,n.Variable=6,n.Class=7,n.Interface=8,n.Module=9,n.Property=10,n.Unit=11,n.Value=12,n.Enum=13,n.Keyword=14,n.Snippet=15,n.Color=16,n.File=17,n.Reference=18,n.Folder=19,n.EnumMember=20,n.Constant=21,n.Struct=22,n.Event=23,n.Operator=24,n.TypeParameter=25})(E_||(E_={}));var R_;(function(n){n.PlainText=1,n.Snippet=2})(R_||(R_={}));var A_;(function(n){n.Deprecated=1})(A_||(A_={}));var D_;(function(n){function e(r,i,s){return{newText:r,insert:i,replace:s}}n.create=e;function t(r){const i=r;return i&&re.string(i.newText)&&pn.is(i.insert)&&pn.is(i.replace)}n.is=t})(D_||(D_={}));var T_;(function(n){n.asIs=1,n.adjustIndentation=2})(T_||(T_={}));var M_;(function(n){function e(t){const r=t;return r&&(re.string(r.detail)||r.detail===void 0)&&(re.string(r.description)||r.description===void 0)}n.is=e})(M_||(M_={}));var O_;(function(n){function e(t){return{label:t}}n.create=e})(O_||(O_={}));var P_;(function(n){function e(t,r){return{items:t||[],isIncomplete:!!r}}n.create=e})(P_||(P_={}));var Pd;(function(n){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}n.fromPlainText=e;function t(r){const i=r;return re.string(i)||re.objectLiteral(i)&&re.string(i.language)&&re.string(i.value)}n.is=t})(Pd||(Pd={}));var I_;(function(n){function e(t){let r=t;return!!r&&re.objectLiteral(r)&&(Pc.is(r.contents)||Pd.is(r.contents)||re.typedArray(r.contents,Pd.is))&&(t.range===void 0||pn.is(t.range))}n.is=e})(I_||(I_={}));var L_;(function(n){function e(t,r){return r?{label:t,documentation:r}:{label:t}}n.create=e})(L_||(L_={}));var F_;(function(n){function e(t,r,...i){let s={label:t};return re.defined(r)&&(s.documentation=r),re.defined(i)?s.parameters=i:s.parameters=[],s}n.create=e})(F_||(F_={}));var N_;(function(n){n.Text=1,n.Read=2,n.Write=3})(N_||(N_={}));var B_;(function(n){function e(t,r){let i={range:t};return re.number(r)&&(i.kind=r),i}n.create=e})(B_||(B_={}));var q_;(function(n){n.File=1,n.Module=2,n.Namespace=3,n.Package=4,n.Class=5,n.Method=6,n.Property=7,n.Field=8,n.Constructor=9,n.Enum=10,n.Interface=11,n.Function=12,n.Variable=13,n.Constant=14,n.String=15,n.Number=16,n.Boolean=17,n.Array=18,n.Object=19,n.Key=20,n.Null=21,n.EnumMember=22,n.Struct=23,n.Event=24,n.Operator=25,n.TypeParameter=26})(q_||(q_={}));var j_;(function(n){n.Deprecated=1})(j_||(j_={}));var $_;(function(n){function e(t,r,i,s,o){let a={name:t,kind:r,location:{uri:s,range:i}};return o&&(a.containerName=o),a}n.create=e})($_||($_={}));var W_;(function(n){function e(t,r,i,s){return s!==void 0?{name:t,kind:r,location:{uri:i,range:s}}:{name:t,kind:r,location:{uri:i}}}n.create=e})(W_||(W_={}));var z_;(function(n){function e(r,i,s,o,a,u){let l={name:r,detail:i,kind:s,range:o,selectionRange:a};return u!==void 0&&(l.children=u),l}n.create=e;function t(r){let i=r;return i&&re.string(i.name)&&re.number(i.kind)&&pn.is(i.range)&&pn.is(i.selectionRange)&&(i.detail===void 0||re.string(i.detail))&&(i.deprecated===void 0||re.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}n.is=t})(z_||(z_={}));var U_;(function(n){n.Empty="",n.QuickFix="quickfix",n.Refactor="refactor",n.RefactorExtract="refactor.extract",n.RefactorInline="refactor.inline",n.RefactorRewrite="refactor.rewrite",n.Source="source",n.SourceOrganizeImports="source.organizeImports",n.SourceFixAll="source.fixAll"})(U_||(U_={}));var Id;(function(n){n.Invoked=1,n.Automatic=2})(Id||(Id={}));var H_;(function(n){function e(r,i,s){let o={diagnostics:r};return i!=null&&(o.only=i),s!=null&&(o.triggerKind=s),o}n.create=e;function t(r){let i=r;return re.defined(i)&&re.typedArray(i.diagnostics,Td.is)&&(i.only===void 0||re.typedArray(i.only,re.string))&&(i.triggerKind===void 0||i.triggerKind===Id.Invoked||i.triggerKind===Id.Automatic)}n.is=t})(H_||(H_={}));var V_;(function(n){function e(r,i,s){let o={title:r},a=!0;return typeof i=="string"?(a=!1,o.kind=i):dl.is(i)?o.command=i:o.edit=i,a&&s!==void 0&&(o.kind=s),o}n.create=e;function t(r){let i=r;return i&&re.string(i.title)&&(i.diagnostics===void 0||re.typedArray(i.diagnostics,Td.is))&&(i.kind===void 0||re.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||dl.is(i.command))&&(i.isPreferred===void 0||re.boolean(i.isPreferred))&&(i.edit===void 0||e1.is(i.edit))}n.is=t})(V_||(V_={}));var G_;(function(n){function e(r,i){let s={range:r};return re.defined(i)&&(s.data=i),s}n.create=e;function t(r){let i=r;return re.defined(i)&&pn.is(i.range)&&(re.undefined(i.command)||dl.is(i.command))}n.is=t})(G_||(G_={}));var K_;(function(n){function e(r,i){return{tabSize:r,insertSpaces:i}}n.create=e;function t(r){let i=r;return re.defined(i)&&re.uinteger(i.tabSize)&&re.boolean(i.insertSpaces)}n.is=t})(K_||(K_={}));var J_;(function(n){function e(r,i,s){return{range:r,target:i,data:s}}n.create=e;function t(r){let i=r;return re.defined(i)&&pn.is(i.range)&&(re.undefined(i.target)||re.string(i.target))}n.is=t})(J_||(J_={}));var Y_;(function(n){function e(r,i){return{range:r,parent:i}}n.create=e;function t(r){let i=r;return re.objectLiteral(i)&&pn.is(i.range)&&(i.parent===void 0||n.is(i.parent))}n.is=t})(Y_||(Y_={}));var X_;(function(n){n.namespace="namespace",n.type="type",n.class="class",n.enum="enum",n.interface="interface",n.struct="struct",n.typeParameter="typeParameter",n.parameter="parameter",n.variable="variable",n.property="property",n.enumMember="enumMember",n.event="event",n.function="function",n.method="method",n.macro="macro",n.keyword="keyword",n.modifier="modifier",n.comment="comment",n.string="string",n.number="number",n.regexp="regexp",n.operator="operator",n.decorator="decorator"})(X_||(X_={}));var Z_;(function(n){n.declaration="declaration",n.definition="definition",n.readonly="readonly",n.static="static",n.deprecated="deprecated",n.abstract="abstract",n.async="async",n.modification="modification",n.documentation="documentation",n.defaultLibrary="defaultLibrary"})(Z_||(Z_={}));var Q_;(function(n){function e(t){const r=t;return re.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}n.is=e})(Q_||(Q_={}));var e2;(function(n){function e(r,i){return{range:r,text:i}}n.create=e;function t(r){const i=r;return i!=null&&pn.is(i.range)&&re.string(i.text)}n.is=t})(e2||(e2={}));var t2;(function(n){function e(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}n.create=e;function t(r){const i=r;return i!=null&&pn.is(i.range)&&re.boolean(i.caseSensitiveLookup)&&(re.string(i.variableName)||i.variableName===void 0)}n.is=t})(t2||(t2={}));var n2;(function(n){function e(r,i){return{range:r,expression:i}}n.create=e;function t(r){const i=r;return i!=null&&pn.is(i.range)&&(re.string(i.expression)||i.expression===void 0)}n.is=t})(n2||(n2={}));var r2;(function(n){function e(r,i){return{frameId:r,stoppedLocation:i}}n.create=e;function t(r){const i=r;return re.defined(i)&&pn.is(r.stoppedLocation)}n.is=t})(r2||(r2={}));var n1;(function(n){n.Type=1,n.Parameter=2;function e(t){return t===1||t===2}n.is=e})(n1||(n1={}));var r1;(function(n){function e(r){return{value:r}}n.create=e;function t(r){const i=r;return re.objectLiteral(i)&&(i.tooltip===void 0||re.string(i.tooltip)||Pc.is(i.tooltip))&&(i.location===void 0||Dd.is(i.location))&&(i.command===void 0||dl.is(i.command))}n.is=t})(r1||(r1={}));var i2;(function(n){function e(r,i,s){const o={position:r,label:i};return s!==void 0&&(o.kind=s),o}n.create=e;function t(r){const i=r;return re.objectLiteral(i)&&Hi.is(i.position)&&(re.string(i.label)||re.typedArray(i.label,r1.is))&&(i.kind===void 0||n1.is(i.kind))&&i.textEdits===void 0||re.typedArray(i.textEdits,co.is)&&(i.tooltip===void 0||re.string(i.tooltip)||Pc.is(i.tooltip))&&(i.paddingLeft===void 0||re.boolean(i.paddingLeft))&&(i.paddingRight===void 0||re.boolean(i.paddingRight))}n.is=t})(i2||(i2={}));var s2;(function(n){function e(t){return{kind:"snippet",value:t}}n.createSnippet=e})(s2||(s2={}));var o2;(function(n){function e(t,r,i,s){return{insertText:t,filterText:r,range:i,command:s}}n.create=e})(o2||(o2={}));var a2;(function(n){function e(t){return{items:t}}n.create=e})(a2||(a2={}));var u2;(function(n){n.Invoked=0,n.Automatic=1})(u2||(u2={}));var l2;(function(n){function e(t,r){return{range:t,text:r}}n.create=e})(l2||(l2={}));var c2;(function(n){function e(t,r){return{triggerKind:t,selectedCompletionInfo:r}}n.create=e})(c2||(c2={}));var f2;(function(n){function e(t){const r=t;return re.objectLiteral(r)&&Xm.is(r.uri)&&re.string(r.name)}n.is=e})(f2||(f2={}));const CX=[`
|
|
101
|
-
`,`\r
|
|
102
|
-
`,"\r"];var h2;(function(n){function e(s,o,a,u){return new EX(s,o,a,u)}n.create=e;function t(s){let o=s;return!!(re.defined(o)&&re.string(o.uri)&&(re.undefined(o.languageId)||re.string(o.languageId))&&re.uinteger(o.lineCount)&&re.func(o.getText)&&re.func(o.positionAt)&&re.func(o.offsetAt))}n.is=t;function r(s,o){let a=s.getText(),u=i(o,(c,f)=>{let d=c.range.start.line-f.range.start.line;return d===0?c.range.start.character-f.range.start.character:d}),l=a.length;for(let c=u.length-1;c>=0;c--){let f=u[c],d=s.offsetAt(f.range.start),g=s.offsetAt(f.range.end);if(g<=l)a=a.substring(0,d)+f.newText+a.substring(g,a.length);else throw new Error("Overlapping edit");l=d}return a}n.applyEdits=r;function i(s,o){if(s.length<=1)return s;const a=s.length/2|0,u=s.slice(0,a),l=s.slice(a);i(u,o),i(l,o);let c=0,f=0,d=0;for(;c<u.length&&f<l.length;)o(u[c],l[f])<=0?s[d++]=u[c++]:s[d++]=l[f++];for(;c<u.length;)s[d++]=u[c++];for(;f<l.length;)s[d++]=l[f++];return s}})(h2||(h2={}));let EX=class{constructor(e,t,r,i){this._uri=e,this._languageId=t,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(t,r)}return this._content}update(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],t=this._content,r=!0;for(let i=0;i<t.length;i++){r&&(e.push(i),r=!1);let s=t.charAt(i);r=s==="\r"||s===`
|
|
103
|
-
`,s==="\r"&&i+1<t.length&&t.charAt(i+1)===`
|
|
104
|
-
`&&i++}r&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),r=0,i=t.length;if(i===0)return Hi.create(0,e);for(;r<i;){let o=Math.floor((r+i)/2);t[o]>e?i=o:r=o+1}let s=r-1;return Hi.create(s,e-t[s])}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;let r=t[e.line],i=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var re;(function(n){const e=Object.prototype.toString;function t(g){return typeof g<"u"}n.defined=t;function r(g){return typeof g>"u"}n.undefined=r;function i(g){return g===!0||g===!1}n.boolean=i;function s(g){return e.call(g)==="[object String]"}n.string=s;function o(g){return e.call(g)==="[object Number]"}n.number=o;function a(g,m,y){return e.call(g)==="[object Number]"&&m<=g&&g<=y}n.numberRange=a;function u(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}n.integer=u;function l(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}n.uinteger=l;function c(g){return e.call(g)==="[object Function]"}n.func=c;function f(g){return g!==null&&typeof g=="object"}n.objectLiteral=f;function d(g,m){return Array.isArray(g)&&g.every(m)}n.typedArray=d})(re||(re={}));const RX=Object.freeze(Object.defineProperty({__proto__:null,get AnnotatedTextEdit(){return Go},get ChangeAnnotation(){return Qu},get ChangeAnnotationIdentifier(){return er},get CodeAction(){return V_},get CodeActionContext(){return H_},get CodeActionKind(){return U_},get CodeActionTriggerKind(){return Id},get CodeDescription(){return k_},get CodeLens(){return G_},get Color(){return Zm},get ColorInformation(){return m_},get ColorPresentation(){return v_},get Command(){return dl},get CompletionItem(){return O_},get CompletionItemKind(){return E_},get CompletionItemLabelDetails(){return M_},get CompletionItemTag(){return A_},get CompletionList(){return P_},get CreateFile(){return Tc},get DeleteFile(){return Oc},get Diagnostic(){return Td},get DiagnosticRelatedInformation(){return Qm},get DiagnosticSeverity(){return w_},get DiagnosticTag(){return __},get DocumentHighlight(){return B_},get DocumentHighlightKind(){return N_},get DocumentLink(){return J_},get DocumentSymbol(){return z_},get DocumentUri(){return d_},EOL:CX,get FoldingRange(){return b_},get FoldingRangeKind(){return y_},get FormattingOptions(){return K_},get Hover(){return I_},get InlayHint(){return i2},get InlayHintKind(){return n1},get InlayHintLabelPart(){return r1},get InlineCompletionContext(){return c2},get InlineCompletionItem(){return o2},get InlineCompletionList(){return a2},get InlineCompletionTriggerKind(){return u2},get InlineValueContext(){return r2},get InlineValueEvaluatableExpression(){return n2},get InlineValueText(){return e2},get InlineValueVariableLookup(){return t2},get InsertReplaceEdit(){return D_},get InsertTextFormat(){return R_},get InsertTextMode(){return T_},get Location(){return Dd},get LocationLink(){return g_},get MarkedString(){return Pd},get MarkupContent(){return Pc},get MarkupKind(){return t1},get OptionalVersionedTextDocumentIdentifier(){return Od},get ParameterInformation(){return L_},get Position(){return Hi},get Range(){return pn},get RenameFile(){return Mc},get SelectedCompletionInfo(){return l2},get SelectionRange(){return Y_},get SemanticTokenModifiers(){return Z_},get SemanticTokenTypes(){return X_},get SemanticTokens(){return Q_},get SignatureInformation(){return F_},get StringValue(){return s2},get SymbolInformation(){return $_},get SymbolKind(){return q_},get SymbolTag(){return j_},get TextDocument(){return h2},get TextDocumentEdit(){return Md},get TextDocumentIdentifier(){return x_},get TextDocumentItem(){return C_},get TextEdit(){return co},get URI(){return Xm},get VersionedTextDocumentIdentifier(){return S_},WorkspaceChange:SX,get WorkspaceEdit(){return e1},get WorkspaceFolder(){return f2},get WorkspaceSymbol(){return W_},get integer(){return p_},get uinteger(){return Ad}},Symbol.toStringTag,{value:"Module"})),Vk=q1(RX);var Or={},rA;function hn(){if(rA)return Or;rA=1,Object.defineProperty(Or,"__esModule",{value:!0}),Or.ProtocolNotificationType=Or.ProtocolNotificationType0=Or.ProtocolRequestType=Or.ProtocolRequestType0=Or.RegistrationType=Or.MessageDirection=void 0;const n=Yc();var e;(function(a){a.clientToServer="clientToServer",a.serverToClient="serverToClient",a.both="both"})(e||(Or.MessageDirection=e={}));class t{constructor(u){this.method=u}}Or.RegistrationType=t;class r extends n.RequestType0{constructor(u){super(u)}}Or.ProtocolRequestType0=r;class i extends n.RequestType{constructor(u){super(u,n.ParameterStructures.byName)}}Or.ProtocolRequestType=i;class s extends n.NotificationType0{constructor(u){super(u)}}Or.ProtocolNotificationType0=s;class o extends n.NotificationType{constructor(u){super(u,n.ParameterStructures.byName)}}return Or.ProtocolNotificationType=o,Or}var Eb={},_n={},iA;function Gk(){if(iA)return _n;iA=1,Object.defineProperty(_n,"__esModule",{value:!0}),_n.objectLiteral=_n.typedArray=_n.stringArray=_n.array=_n.func=_n.error=_n.number=_n.string=_n.boolean=void 0;function n(l){return l===!0||l===!1}_n.boolean=n;function e(l){return typeof l=="string"||l instanceof String}_n.string=e;function t(l){return typeof l=="number"||l instanceof Number}_n.number=t;function r(l){return l instanceof Error}_n.error=r;function i(l){return typeof l=="function"}_n.func=i;function s(l){return Array.isArray(l)}_n.array=s;function o(l){return s(l)&&l.every(c=>e(c))}_n.stringArray=o;function a(l,c){return Array.isArray(l)&&l.every(c)}_n.typedArray=a;function u(l){return l!==null&&typeof l=="object"}return _n.objectLiteral=u,_n}var vh={},sA;function AX(){if(sA)return vh;sA=1,Object.defineProperty(vh,"__esModule",{value:!0}),vh.ImplementationRequest=void 0;const n=hn();var e;return function(t){t.method="textDocument/implementation",t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)}(e||(vh.ImplementationRequest=e={})),vh}var yh={},oA;function DX(){if(oA)return yh;oA=1,Object.defineProperty(yh,"__esModule",{value:!0}),yh.TypeDefinitionRequest=void 0;const n=hn();var e;return function(t){t.method="textDocument/typeDefinition",t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)}(e||(yh.TypeDefinitionRequest=e={})),yh}var Pu={},aA;function TX(){if(aA)return Pu;aA=1,Object.defineProperty(Pu,"__esModule",{value:!0}),Pu.DidChangeWorkspaceFoldersNotification=Pu.WorkspaceFoldersRequest=void 0;const n=hn();var e;(function(r){r.method="workspace/workspaceFolders",r.messageDirection=n.MessageDirection.serverToClient,r.type=new n.ProtocolRequestType0(r.method)})(e||(Pu.WorkspaceFoldersRequest=e={}));var t;return function(r){r.method="workspace/didChangeWorkspaceFolders",r.messageDirection=n.MessageDirection.clientToServer,r.type=new n.ProtocolNotificationType(r.method)}(t||(Pu.DidChangeWorkspaceFoldersNotification=t={})),Pu}var bh={},uA;function MX(){if(uA)return bh;uA=1,Object.defineProperty(bh,"__esModule",{value:!0}),bh.ConfigurationRequest=void 0;const n=hn();var e;return function(t){t.method="workspace/configuration",t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType(t.method)}(e||(bh.ConfigurationRequest=e={})),bh}var Iu={},lA;function OX(){if(lA)return Iu;lA=1,Object.defineProperty(Iu,"__esModule",{value:!0}),Iu.ColorPresentationRequest=Iu.DocumentColorRequest=void 0;const n=hn();var e;(function(r){r.method="textDocument/documentColor",r.messageDirection=n.MessageDirection.clientToServer,r.type=new n.ProtocolRequestType(r.method)})(e||(Iu.DocumentColorRequest=e={}));var t;return function(r){r.method="textDocument/colorPresentation",r.messageDirection=n.MessageDirection.clientToServer,r.type=new n.ProtocolRequestType(r.method)}(t||(Iu.ColorPresentationRequest=t={})),Iu}var Lu={},cA;function PX(){if(cA)return Lu;cA=1,Object.defineProperty(Lu,"__esModule",{value:!0}),Lu.FoldingRangeRefreshRequest=Lu.FoldingRangeRequest=void 0;const n=hn();var e;(function(r){r.method="textDocument/foldingRange",r.messageDirection=n.MessageDirection.clientToServer,r.type=new n.ProtocolRequestType(r.method)})(e||(Lu.FoldingRangeRequest=e={}));var t;return function(r){r.method="workspace/foldingRange/refresh",r.messageDirection=n.MessageDirection.serverToClient,r.type=new n.ProtocolRequestType0(r.method)}(t||(Lu.FoldingRangeRefreshRequest=t={})),Lu}var wh={},fA;function IX(){if(fA)return wh;fA=1,Object.defineProperty(wh,"__esModule",{value:!0}),wh.DeclarationRequest=void 0;const n=hn();var e;return function(t){t.method="textDocument/declaration",t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)}(e||(wh.DeclarationRequest=e={})),wh}var _h={},hA;function LX(){if(hA)return _h;hA=1,Object.defineProperty(_h,"__esModule",{value:!0}),_h.SelectionRangeRequest=void 0;const n=hn();var e;return function(t){t.method="textDocument/selectionRange",t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)}(e||(_h.SelectionRangeRequest=e={})),_h}var $o={},dA;function FX(){if(dA)return $o;dA=1,Object.defineProperty($o,"__esModule",{value:!0}),$o.WorkDoneProgressCancelNotification=$o.WorkDoneProgressCreateRequest=$o.WorkDoneProgress=void 0;const n=Yc(),e=hn();var t;(function(s){s.type=new n.ProgressType;function o(a){return a===s.type}s.is=o})(t||($o.WorkDoneProgress=t={}));var r;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=e.MessageDirection.serverToClient,s.type=new e.ProtocolRequestType(s.method)})(r||($o.WorkDoneProgressCreateRequest=r={}));var i;return function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolNotificationType(s.method)}(i||($o.WorkDoneProgressCancelNotification=i={})),$o}var Wo={},pA;function NX(){if(pA)return Wo;pA=1,Object.defineProperty(Wo,"__esModule",{value:!0}),Wo.CallHierarchyOutgoingCallsRequest=Wo.CallHierarchyIncomingCallsRequest=Wo.CallHierarchyPrepareRequest=void 0;const n=hn();var e;(function(i){i.method="textDocument/prepareCallHierarchy",i.messageDirection=n.MessageDirection.clientToServer,i.type=new n.ProtocolRequestType(i.method)})(e||(Wo.CallHierarchyPrepareRequest=e={}));var t;(function(i){i.method="callHierarchy/incomingCalls",i.messageDirection=n.MessageDirection.clientToServer,i.type=new n.ProtocolRequestType(i.method)})(t||(Wo.CallHierarchyIncomingCallsRequest=t={}));var r;return function(i){i.method="callHierarchy/outgoingCalls",i.messageDirection=n.MessageDirection.clientToServer,i.type=new n.ProtocolRequestType(i.method)}(r||(Wo.CallHierarchyOutgoingCallsRequest=r={})),Wo}var Pr={},gA;function BX(){if(gA)return Pr;gA=1,Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.SemanticTokensRefreshRequest=Pr.SemanticTokensRangeRequest=Pr.SemanticTokensDeltaRequest=Pr.SemanticTokensRequest=Pr.SemanticTokensRegistrationType=Pr.TokenFormat=void 0;const n=hn();var e;(function(a){a.Relative="relative"})(e||(Pr.TokenFormat=e={}));var t;(function(a){a.method="textDocument/semanticTokens",a.type=new n.RegistrationType(a.method)})(t||(Pr.SemanticTokensRegistrationType=t={}));var r;(function(a){a.method="textDocument/semanticTokens/full",a.messageDirection=n.MessageDirection.clientToServer,a.type=new n.ProtocolRequestType(a.method),a.registrationMethod=t.method})(r||(Pr.SemanticTokensRequest=r={}));var i;(function(a){a.method="textDocument/semanticTokens/full/delta",a.messageDirection=n.MessageDirection.clientToServer,a.type=new n.ProtocolRequestType(a.method),a.registrationMethod=t.method})(i||(Pr.SemanticTokensDeltaRequest=i={}));var s;(function(a){a.method="textDocument/semanticTokens/range",a.messageDirection=n.MessageDirection.clientToServer,a.type=new n.ProtocolRequestType(a.method),a.registrationMethod=t.method})(s||(Pr.SemanticTokensRangeRequest=s={}));var o;return function(a){a.method="workspace/semanticTokens/refresh",a.messageDirection=n.MessageDirection.serverToClient,a.type=new n.ProtocolRequestType0(a.method)}(o||(Pr.SemanticTokensRefreshRequest=o={})),Pr}var kh={},mA;function qX(){if(mA)return kh;mA=1,Object.defineProperty(kh,"__esModule",{value:!0}),kh.ShowDocumentRequest=void 0;const n=hn();var e;return function(t){t.method="window/showDocument",t.messageDirection=n.MessageDirection.serverToClient,t.type=new n.ProtocolRequestType(t.method)}(e||(kh.ShowDocumentRequest=e={})),kh}var xh={},vA;function jX(){if(vA)return xh;vA=1,Object.defineProperty(xh,"__esModule",{value:!0}),xh.LinkedEditingRangeRequest=void 0;const n=hn();var e;return function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)}(e||(xh.LinkedEditingRangeRequest=e={})),xh}var Kn={},yA;function $X(){if(yA)return Kn;yA=1,Object.defineProperty(Kn,"__esModule",{value:!0}),Kn.WillDeleteFilesRequest=Kn.DidDeleteFilesNotification=Kn.DidRenameFilesNotification=Kn.WillRenameFilesRequest=Kn.DidCreateFilesNotification=Kn.WillCreateFilesRequest=Kn.FileOperationPatternKind=void 0;const n=hn();var e;(function(u){u.file="file",u.folder="folder"})(e||(Kn.FileOperationPatternKind=e={}));var t;(function(u){u.method="workspace/willCreateFiles",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method)})(t||(Kn.WillCreateFilesRequest=t={}));var r;(function(u){u.method="workspace/didCreateFiles",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolNotificationType(u.method)})(r||(Kn.DidCreateFilesNotification=r={}));var i;(function(u){u.method="workspace/willRenameFiles",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method)})(i||(Kn.WillRenameFilesRequest=i={}));var s;(function(u){u.method="workspace/didRenameFiles",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolNotificationType(u.method)})(s||(Kn.DidRenameFilesNotification=s={}));var o;(function(u){u.method="workspace/didDeleteFiles",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolNotificationType(u.method)})(o||(Kn.DidDeleteFilesNotification=o={}));var a;return function(u){u.method="workspace/willDeleteFiles",u.messageDirection=n.MessageDirection.clientToServer,u.type=new n.ProtocolRequestType(u.method)}(a||(Kn.WillDeleteFilesRequest=a={})),Kn}var zo={},bA;function WX(){if(bA)return zo;bA=1,Object.defineProperty(zo,"__esModule",{value:!0}),zo.MonikerRequest=zo.MonikerKind=zo.UniquenessLevel=void 0;const n=hn();var e;(function(i){i.document="document",i.project="project",i.group="group",i.scheme="scheme",i.global="global"})(e||(zo.UniquenessLevel=e={}));var t;(function(i){i.$import="import",i.$export="export",i.local="local"})(t||(zo.MonikerKind=t={}));var r;return function(i){i.method="textDocument/moniker",i.messageDirection=n.MessageDirection.clientToServer,i.type=new n.ProtocolRequestType(i.method)}(r||(zo.MonikerRequest=r={})),zo}var Uo={},wA;function zX(){if(wA)return Uo;wA=1,Object.defineProperty(Uo,"__esModule",{value:!0}),Uo.TypeHierarchySubtypesRequest=Uo.TypeHierarchySupertypesRequest=Uo.TypeHierarchyPrepareRequest=void 0;const n=hn();var e;(function(i){i.method="textDocument/prepareTypeHierarchy",i.messageDirection=n.MessageDirection.clientToServer,i.type=new n.ProtocolRequestType(i.method)})(e||(Uo.TypeHierarchyPrepareRequest=e={}));var t;(function(i){i.method="typeHierarchy/supertypes",i.messageDirection=n.MessageDirection.clientToServer,i.type=new n.ProtocolRequestType(i.method)})(t||(Uo.TypeHierarchySupertypesRequest=t={}));var r;return function(i){i.method="typeHierarchy/subtypes",i.messageDirection=n.MessageDirection.clientToServer,i.type=new n.ProtocolRequestType(i.method)}(r||(Uo.TypeHierarchySubtypesRequest=r={})),Uo}var Fu={},_A;function UX(){if(_A)return Fu;_A=1,Object.defineProperty(Fu,"__esModule",{value:!0}),Fu.InlineValueRefreshRequest=Fu.InlineValueRequest=void 0;const n=hn();var e;(function(r){r.method="textDocument/inlineValue",r.messageDirection=n.MessageDirection.clientToServer,r.type=new n.ProtocolRequestType(r.method)})(e||(Fu.InlineValueRequest=e={}));var t;return function(r){r.method="workspace/inlineValue/refresh",r.messageDirection=n.MessageDirection.serverToClient,r.type=new n.ProtocolRequestType0(r.method)}(t||(Fu.InlineValueRefreshRequest=t={})),Fu}var Ho={},kA;function HX(){if(kA)return Ho;kA=1,Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.InlayHintRefreshRequest=Ho.InlayHintResolveRequest=Ho.InlayHintRequest=void 0;const n=hn();var e;(function(i){i.method="textDocument/inlayHint",i.messageDirection=n.MessageDirection.clientToServer,i.type=new n.ProtocolRequestType(i.method)})(e||(Ho.InlayHintRequest=e={}));var t;(function(i){i.method="inlayHint/resolve",i.messageDirection=n.MessageDirection.clientToServer,i.type=new n.ProtocolRequestType(i.method)})(t||(Ho.InlayHintResolveRequest=t={}));var r;return function(i){i.method="workspace/inlayHint/refresh",i.messageDirection=n.MessageDirection.serverToClient,i.type=new n.ProtocolRequestType0(i.method)}(r||(Ho.InlayHintRefreshRequest=r={})),Ho}var wi={},xA;function VX(){if(xA)return wi;xA=1,Object.defineProperty(wi,"__esModule",{value:!0}),wi.DiagnosticRefreshRequest=wi.WorkspaceDiagnosticRequest=wi.DocumentDiagnosticRequest=wi.DocumentDiagnosticReportKind=wi.DiagnosticServerCancellationData=void 0;const n=Yc(),e=Gk(),t=hn();var r;(function(u){function l(c){const f=c;return f&&e.boolean(f.retriggerRequest)}u.is=l})(r||(wi.DiagnosticServerCancellationData=r={}));var i;(function(u){u.Full="full",u.Unchanged="unchanged"})(i||(wi.DocumentDiagnosticReportKind=i={}));var s;(function(u){u.method="textDocument/diagnostic",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method),u.partialResult=new n.ProgressType})(s||(wi.DocumentDiagnosticRequest=s={}));var o;(function(u){u.method="workspace/diagnostic",u.messageDirection=t.MessageDirection.clientToServer,u.type=new t.ProtocolRequestType(u.method),u.partialResult=new n.ProgressType})(o||(wi.WorkspaceDiagnosticRequest=o={}));var a;return function(u){u.method="workspace/diagnostic/refresh",u.messageDirection=t.MessageDirection.serverToClient,u.type=new t.ProtocolRequestType0(u.method)}(a||(wi.DiagnosticRefreshRequest=a={})),wi}var an={},SA;function GX(){if(SA)return an;SA=1,Object.defineProperty(an,"__esModule",{value:!0}),an.DidCloseNotebookDocumentNotification=an.DidSaveNotebookDocumentNotification=an.DidChangeNotebookDocumentNotification=an.NotebookCellArrayChange=an.DidOpenNotebookDocumentNotification=an.NotebookDocumentSyncRegistrationType=an.NotebookDocument=an.NotebookCell=an.ExecutionSummary=an.NotebookCellKind=void 0;const n=Vk,e=Gk(),t=hn();var r;(function(g){g.Markup=1,g.Code=2;function m(y){return y===1||y===2}g.is=m})(r||(an.NotebookCellKind=r={}));var i;(function(g){function m(w,S){const k={executionOrder:w};return(S===!0||S===!1)&&(k.success=S),k}g.create=m;function y(w){const S=w;return e.objectLiteral(S)&&n.uinteger.is(S.executionOrder)&&(S.success===void 0||e.boolean(S.success))}g.is=y;function b(w,S){return w===S?!0:w==null||S===null||S===void 0?!1:w.executionOrder===S.executionOrder&&w.success===S.success}g.equals=b})(i||(an.ExecutionSummary=i={}));var s;(function(g){function m(S,k){return{kind:S,document:k}}g.create=m;function y(S){const k=S;return e.objectLiteral(k)&&r.is(k.kind)&&n.DocumentUri.is(k.document)&&(k.metadata===void 0||e.objectLiteral(k.metadata))}g.is=y;function b(S,k){const x=new Set;return S.document!==k.document&&x.add("document"),S.kind!==k.kind&&x.add("kind"),S.executionSummary!==k.executionSummary&&x.add("executionSummary"),(S.metadata!==void 0||k.metadata!==void 0)&&!w(S.metadata,k.metadata)&&x.add("metadata"),(S.executionSummary!==void 0||k.executionSummary!==void 0)&&!i.equals(S.executionSummary,k.executionSummary)&&x.add("executionSummary"),x}g.diff=b;function w(S,k){if(S===k)return!0;if(S==null||k===null||k===void 0||typeof S!=typeof k||typeof S!="object")return!1;const x=Array.isArray(S),C=Array.isArray(k);if(x!==C)return!1;if(x&&C){if(S.length!==k.length)return!1;for(let R=0;R<S.length;R++)if(!w(S[R],k[R]))return!1}if(e.objectLiteral(S)&&e.objectLiteral(k)){const R=Object.keys(S),P=Object.keys(k);if(R.length!==P.length||(R.sort(),P.sort(),!w(R,P)))return!1;for(let q=0;q<R.length;q++){const B=R[q];if(!w(S[B],k[B]))return!1}}return!0}})(s||(an.NotebookCell=s={}));var o;(function(g){function m(b,w,S,k){return{uri:b,notebookType:w,version:S,cells:k}}g.create=m;function y(b){const w=b;return e.objectLiteral(w)&&e.string(w.uri)&&n.integer.is(w.version)&&e.typedArray(w.cells,s.is)}g.is=y})(o||(an.NotebookDocument=o={}));var a;(function(g){g.method="notebookDocument/sync",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.RegistrationType(g.method)})(a||(an.NotebookDocumentSyncRegistrationType=a={}));var u;(function(g){g.method="notebookDocument/didOpen",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolNotificationType(g.method),g.registrationMethod=a.method})(u||(an.DidOpenNotebookDocumentNotification=u={}));var l;(function(g){function m(b){const w=b;return e.objectLiteral(w)&&n.uinteger.is(w.start)&&n.uinteger.is(w.deleteCount)&&(w.cells===void 0||e.typedArray(w.cells,s.is))}g.is=m;function y(b,w,S){const k={start:b,deleteCount:w};return S!==void 0&&(k.cells=S),k}g.create=y})(l||(an.NotebookCellArrayChange=l={}));var c;(function(g){g.method="notebookDocument/didChange",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolNotificationType(g.method),g.registrationMethod=a.method})(c||(an.DidChangeNotebookDocumentNotification=c={}));var f;(function(g){g.method="notebookDocument/didSave",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolNotificationType(g.method),g.registrationMethod=a.method})(f||(an.DidSaveNotebookDocumentNotification=f={}));var d;return function(g){g.method="notebookDocument/didClose",g.messageDirection=t.MessageDirection.clientToServer,g.type=new t.ProtocolNotificationType(g.method),g.registrationMethod=a.method}(d||(an.DidCloseNotebookDocumentNotification=d={})),an}var Sh={},CA;function KX(){if(CA)return Sh;CA=1,Object.defineProperty(Sh,"__esModule",{value:!0}),Sh.InlineCompletionRequest=void 0;const n=hn();var e;return function(t){t.method="textDocument/inlineCompletion",t.messageDirection=n.MessageDirection.clientToServer,t.type=new n.ProtocolRequestType(t.method)}(e||(Sh.InlineCompletionRequest=e={})),Sh}var EA;function JX(){return EA||(EA=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.WorkspaceSymbolRequest=n.CodeActionResolveRequest=n.CodeActionRequest=n.DocumentSymbolRequest=n.DocumentHighlightRequest=n.ReferencesRequest=n.DefinitionRequest=n.SignatureHelpRequest=n.SignatureHelpTriggerKind=n.HoverRequest=n.CompletionResolveRequest=n.CompletionRequest=n.CompletionTriggerKind=n.PublishDiagnosticsNotification=n.WatchKind=n.RelativePattern=n.FileChangeType=n.DidChangeWatchedFilesNotification=n.WillSaveTextDocumentWaitUntilRequest=n.WillSaveTextDocumentNotification=n.TextDocumentSaveReason=n.DidSaveTextDocumentNotification=n.DidCloseTextDocumentNotification=n.DidChangeTextDocumentNotification=n.TextDocumentContentChangeEvent=n.DidOpenTextDocumentNotification=n.TextDocumentSyncKind=n.TelemetryEventNotification=n.LogMessageNotification=n.ShowMessageRequest=n.ShowMessageNotification=n.MessageType=n.DidChangeConfigurationNotification=n.ExitNotification=n.ShutdownRequest=n.InitializedNotification=n.InitializeErrorCodes=n.InitializeRequest=n.WorkDoneProgressOptions=n.TextDocumentRegistrationOptions=n.StaticRegistrationOptions=n.PositionEncodingKind=n.FailureHandlingKind=n.ResourceOperationKind=n.UnregistrationRequest=n.RegistrationRequest=n.DocumentSelector=n.NotebookCellTextDocumentFilter=n.NotebookDocumentFilter=n.TextDocumentFilter=void 0,n.MonikerRequest=n.MonikerKind=n.UniquenessLevel=n.WillDeleteFilesRequest=n.DidDeleteFilesNotification=n.WillRenameFilesRequest=n.DidRenameFilesNotification=n.WillCreateFilesRequest=n.DidCreateFilesNotification=n.FileOperationPatternKind=n.LinkedEditingRangeRequest=n.ShowDocumentRequest=n.SemanticTokensRegistrationType=n.SemanticTokensRefreshRequest=n.SemanticTokensRangeRequest=n.SemanticTokensDeltaRequest=n.SemanticTokensRequest=n.TokenFormat=n.CallHierarchyPrepareRequest=n.CallHierarchyOutgoingCallsRequest=n.CallHierarchyIncomingCallsRequest=n.WorkDoneProgressCancelNotification=n.WorkDoneProgressCreateRequest=n.WorkDoneProgress=n.SelectionRangeRequest=n.DeclarationRequest=n.FoldingRangeRefreshRequest=n.FoldingRangeRequest=n.ColorPresentationRequest=n.DocumentColorRequest=n.ConfigurationRequest=n.DidChangeWorkspaceFoldersNotification=n.WorkspaceFoldersRequest=n.TypeDefinitionRequest=n.ImplementationRequest=n.ApplyWorkspaceEditRequest=n.ExecuteCommandRequest=n.PrepareRenameRequest=n.RenameRequest=n.PrepareSupportDefaultBehavior=n.DocumentOnTypeFormattingRequest=n.DocumentRangesFormattingRequest=n.DocumentRangeFormattingRequest=n.DocumentFormattingRequest=n.DocumentLinkResolveRequest=n.DocumentLinkRequest=n.CodeLensRefreshRequest=n.CodeLensResolveRequest=n.CodeLensRequest=n.WorkspaceSymbolResolveRequest=void 0,n.InlineCompletionRequest=n.DidCloseNotebookDocumentNotification=n.DidSaveNotebookDocumentNotification=n.DidChangeNotebookDocumentNotification=n.NotebookCellArrayChange=n.DidOpenNotebookDocumentNotification=n.NotebookDocumentSyncRegistrationType=n.NotebookDocument=n.NotebookCell=n.ExecutionSummary=n.NotebookCellKind=n.DiagnosticRefreshRequest=n.WorkspaceDiagnosticRequest=n.DocumentDiagnosticRequest=n.DocumentDiagnosticReportKind=n.DiagnosticServerCancellationData=n.InlayHintRefreshRequest=n.InlayHintResolveRequest=n.InlayHintRequest=n.InlineValueRefreshRequest=n.InlineValueRequest=n.TypeHierarchySupertypesRequest=n.TypeHierarchySubtypesRequest=n.TypeHierarchyPrepareRequest=void 0;const e=hn(),t=Vk,r=Gk(),i=AX();Object.defineProperty(n,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const s=DX();Object.defineProperty(n,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const o=TX();Object.defineProperty(n,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return o.WorkspaceFoldersRequest}}),Object.defineProperty(n,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return o.DidChangeWorkspaceFoldersNotification}});const a=MX();Object.defineProperty(n,"ConfigurationRequest",{enumerable:!0,get:function(){return a.ConfigurationRequest}});const u=OX();Object.defineProperty(n,"DocumentColorRequest",{enumerable:!0,get:function(){return u.DocumentColorRequest}}),Object.defineProperty(n,"ColorPresentationRequest",{enumerable:!0,get:function(){return u.ColorPresentationRequest}});const l=PX();Object.defineProperty(n,"FoldingRangeRequest",{enumerable:!0,get:function(){return l.FoldingRangeRequest}}),Object.defineProperty(n,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return l.FoldingRangeRefreshRequest}});const c=IX();Object.defineProperty(n,"DeclarationRequest",{enumerable:!0,get:function(){return c.DeclarationRequest}});const f=LX();Object.defineProperty(n,"SelectionRangeRequest",{enumerable:!0,get:function(){return f.SelectionRangeRequest}});const d=FX();Object.defineProperty(n,"WorkDoneProgress",{enumerable:!0,get:function(){return d.WorkDoneProgress}}),Object.defineProperty(n,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return d.WorkDoneProgressCreateRequest}}),Object.defineProperty(n,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return d.WorkDoneProgressCancelNotification}});const g=NX();Object.defineProperty(n,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return g.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(n,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return g.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(n,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return g.CallHierarchyPrepareRequest}});const m=BX();Object.defineProperty(n,"TokenFormat",{enumerable:!0,get:function(){return m.TokenFormat}}),Object.defineProperty(n,"SemanticTokensRequest",{enumerable:!0,get:function(){return m.SemanticTokensRequest}}),Object.defineProperty(n,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return m.SemanticTokensDeltaRequest}}),Object.defineProperty(n,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return m.SemanticTokensRangeRequest}}),Object.defineProperty(n,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return m.SemanticTokensRefreshRequest}}),Object.defineProperty(n,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return m.SemanticTokensRegistrationType}});const y=qX();Object.defineProperty(n,"ShowDocumentRequest",{enumerable:!0,get:function(){return y.ShowDocumentRequest}});const b=jX();Object.defineProperty(n,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return b.LinkedEditingRangeRequest}});const w=$X();Object.defineProperty(n,"FileOperationPatternKind",{enumerable:!0,get:function(){return w.FileOperationPatternKind}}),Object.defineProperty(n,"DidCreateFilesNotification",{enumerable:!0,get:function(){return w.DidCreateFilesNotification}}),Object.defineProperty(n,"WillCreateFilesRequest",{enumerable:!0,get:function(){return w.WillCreateFilesRequest}}),Object.defineProperty(n,"DidRenameFilesNotification",{enumerable:!0,get:function(){return w.DidRenameFilesNotification}}),Object.defineProperty(n,"WillRenameFilesRequest",{enumerable:!0,get:function(){return w.WillRenameFilesRequest}}),Object.defineProperty(n,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return w.DidDeleteFilesNotification}}),Object.defineProperty(n,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return w.WillDeleteFilesRequest}});const S=WX();Object.defineProperty(n,"UniquenessLevel",{enumerable:!0,get:function(){return S.UniquenessLevel}}),Object.defineProperty(n,"MonikerKind",{enumerable:!0,get:function(){return S.MonikerKind}}),Object.defineProperty(n,"MonikerRequest",{enumerable:!0,get:function(){return S.MonikerRequest}});const k=zX();Object.defineProperty(n,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return k.TypeHierarchyPrepareRequest}}),Object.defineProperty(n,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return k.TypeHierarchySubtypesRequest}}),Object.defineProperty(n,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return k.TypeHierarchySupertypesRequest}});const x=UX();Object.defineProperty(n,"InlineValueRequest",{enumerable:!0,get:function(){return x.InlineValueRequest}}),Object.defineProperty(n,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return x.InlineValueRefreshRequest}});const C=HX();Object.defineProperty(n,"InlayHintRequest",{enumerable:!0,get:function(){return C.InlayHintRequest}}),Object.defineProperty(n,"InlayHintResolveRequest",{enumerable:!0,get:function(){return C.InlayHintResolveRequest}}),Object.defineProperty(n,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return C.InlayHintRefreshRequest}});const R=VX();Object.defineProperty(n,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return R.DiagnosticServerCancellationData}}),Object.defineProperty(n,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return R.DocumentDiagnosticReportKind}}),Object.defineProperty(n,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return R.DocumentDiagnosticRequest}}),Object.defineProperty(n,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return R.WorkspaceDiagnosticRequest}}),Object.defineProperty(n,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return R.DiagnosticRefreshRequest}});const P=GX();Object.defineProperty(n,"NotebookCellKind",{enumerable:!0,get:function(){return P.NotebookCellKind}}),Object.defineProperty(n,"ExecutionSummary",{enumerable:!0,get:function(){return P.ExecutionSummary}}),Object.defineProperty(n,"NotebookCell",{enumerable:!0,get:function(){return P.NotebookCell}}),Object.defineProperty(n,"NotebookDocument",{enumerable:!0,get:function(){return P.NotebookDocument}}),Object.defineProperty(n,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return P.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(n,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return P.DidOpenNotebookDocumentNotification}}),Object.defineProperty(n,"NotebookCellArrayChange",{enumerable:!0,get:function(){return P.NotebookCellArrayChange}}),Object.defineProperty(n,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return P.DidChangeNotebookDocumentNotification}}),Object.defineProperty(n,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return P.DidSaveNotebookDocumentNotification}}),Object.defineProperty(n,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return P.DidCloseNotebookDocumentNotification}});const q=KX();Object.defineProperty(n,"InlineCompletionRequest",{enumerable:!0,get:function(){return q.InlineCompletionRequest}});var B;(function(L){function Xt(Zt){const qe=Zt;return r.string(qe)||r.string(qe.language)||r.string(qe.scheme)||r.string(qe.pattern)}L.is=Xt})(B||(n.TextDocumentFilter=B={}));var G;(function(L){function Xt(Zt){const qe=Zt;return r.objectLiteral(qe)&&(r.string(qe.notebookType)||r.string(qe.scheme)||r.string(qe.pattern))}L.is=Xt})(G||(n.NotebookDocumentFilter=G={}));var V;(function(L){function Xt(Zt){const qe=Zt;return r.objectLiteral(qe)&&(r.string(qe.notebook)||G.is(qe.notebook))&&(qe.language===void 0||r.string(qe.language))}L.is=Xt})(V||(n.NotebookCellTextDocumentFilter=V={}));var F;(function(L){function Xt(Zt){if(!Array.isArray(Zt))return!1;for(let qe of Zt)if(!r.string(qe)&&!B.is(qe)&&!V.is(qe))return!1;return!0}L.is=Xt})(F||(n.DocumentSelector=F={}));var A;(function(L){L.method="client/registerCapability",L.messageDirection=e.MessageDirection.serverToClient,L.type=new e.ProtocolRequestType(L.method)})(A||(n.RegistrationRequest=A={}));var Y;(function(L){L.method="client/unregisterCapability",L.messageDirection=e.MessageDirection.serverToClient,L.type=new e.ProtocolRequestType(L.method)})(Y||(n.UnregistrationRequest=Y={}));var N;(function(L){L.Create="create",L.Rename="rename",L.Delete="delete"})(N||(n.ResourceOperationKind=N={}));var ee;(function(L){L.Abort="abort",L.Transactional="transactional",L.TextOnlyTransactional="textOnlyTransactional",L.Undo="undo"})(ee||(n.FailureHandlingKind=ee={}));var oe;(function(L){L.UTF8="utf-8",L.UTF16="utf-16",L.UTF32="utf-32"})(oe||(n.PositionEncodingKind=oe={}));var be;(function(L){function Xt(Zt){const qe=Zt;return qe&&r.string(qe.id)&&qe.id.length>0}L.hasId=Xt})(be||(n.StaticRegistrationOptions=be={}));var ve;(function(L){function Xt(Zt){const qe=Zt;return qe&&(qe.documentSelector===null||F.is(qe.documentSelector))}L.is=Xt})(ve||(n.TextDocumentRegistrationOptions=ve={}));var De;(function(L){function Xt(qe){const W=qe;return r.objectLiteral(W)&&(W.workDoneProgress===void 0||r.boolean(W.workDoneProgress))}L.is=Xt;function Zt(qe){const W=qe;return W&&r.boolean(W.workDoneProgress)}L.hasWorkDoneProgress=Zt})(De||(n.WorkDoneProgressOptions=De={}));var we;(function(L){L.method="initialize",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(we||(n.InitializeRequest=we={}));var Ie;(function(L){L.unknownProtocolVersion=1})(Ie||(n.InitializeErrorCodes=Ie={}));var Rt;(function(L){L.method="initialized",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolNotificationType(L.method)})(Rt||(n.InitializedNotification=Rt={}));var wt;(function(L){L.method="shutdown",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType0(L.method)})(wt||(n.ShutdownRequest=wt={}));var tt;(function(L){L.method="exit",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolNotificationType0(L.method)})(tt||(n.ExitNotification=tt={}));var Jt;(function(L){L.method="workspace/didChangeConfiguration",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolNotificationType(L.method)})(Jt||(n.DidChangeConfigurationNotification=Jt={}));var In;(function(L){L.Error=1,L.Warning=2,L.Info=3,L.Log=4,L.Debug=5})(In||(n.MessageType=In={}));var nn;(function(L){L.method="window/showMessage",L.messageDirection=e.MessageDirection.serverToClient,L.type=new e.ProtocolNotificationType(L.method)})(nn||(n.ShowMessageNotification=nn={}));var mn;(function(L){L.method="window/showMessageRequest",L.messageDirection=e.MessageDirection.serverToClient,L.type=new e.ProtocolRequestType(L.method)})(mn||(n.ShowMessageRequest=mn={}));var Pt;(function(L){L.method="window/logMessage",L.messageDirection=e.MessageDirection.serverToClient,L.type=new e.ProtocolNotificationType(L.method)})(Pt||(n.LogMessageNotification=Pt={}));var Se;(function(L){L.method="telemetry/event",L.messageDirection=e.MessageDirection.serverToClient,L.type=new e.ProtocolNotificationType(L.method)})(Se||(n.TelemetryEventNotification=Se={}));var Je;(function(L){L.None=0,L.Full=1,L.Incremental=2})(Je||(n.TextDocumentSyncKind=Je={}));var An;(function(L){L.method="textDocument/didOpen",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolNotificationType(L.method)})(An||(n.DidOpenTextDocumentNotification=An={}));var Le;(function(L){function Xt(qe){let W=qe;return W!=null&&typeof W.text=="string"&&W.range!==void 0&&(W.rangeLength===void 0||typeof W.rangeLength=="number")}L.isIncremental=Xt;function Zt(qe){let W=qe;return W!=null&&typeof W.text=="string"&&W.range===void 0&&W.rangeLength===void 0}L.isFull=Zt})(Le||(n.TextDocumentContentChangeEvent=Le={}));var $t;(function(L){L.method="textDocument/didChange",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolNotificationType(L.method)})($t||(n.DidChangeTextDocumentNotification=$t={}));var xn;(function(L){L.method="textDocument/didClose",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolNotificationType(L.method)})(xn||(n.DidCloseTextDocumentNotification=xn={}));var Yt;(function(L){L.method="textDocument/didSave",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolNotificationType(L.method)})(Yt||(n.DidSaveTextDocumentNotification=Yt={}));var st;(function(L){L.Manual=1,L.AfterDelay=2,L.FocusOut=3})(st||(n.TextDocumentSaveReason=st={}));var Ln;(function(L){L.method="textDocument/willSave",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolNotificationType(L.method)})(Ln||(n.WillSaveTextDocumentNotification=Ln={}));var At;(function(L){L.method="textDocument/willSaveWaitUntil",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(At||(n.WillSaveTextDocumentWaitUntilRequest=At={}));var ut;(function(L){L.method="workspace/didChangeWatchedFiles",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolNotificationType(L.method)})(ut||(n.DidChangeWatchedFilesNotification=ut={}));var or;(function(L){L.Created=1,L.Changed=2,L.Deleted=3})(or||(n.FileChangeType=or={}));var ss;(function(L){function Xt(Zt){const qe=Zt;return r.objectLiteral(qe)&&(t.URI.is(qe.baseUri)||t.WorkspaceFolder.is(qe.baseUri))&&r.string(qe.pattern)}L.is=Xt})(ss||(n.RelativePattern=ss={}));var pa;(function(L){L.Create=1,L.Change=2,L.Delete=4})(pa||(n.WatchKind=pa={}));var Ur;(function(L){L.method="textDocument/publishDiagnostics",L.messageDirection=e.MessageDirection.serverToClient,L.type=new e.ProtocolNotificationType(L.method)})(Ur||(n.PublishDiagnosticsNotification=Ur={}));var Ts;(function(L){L.Invoked=1,L.TriggerCharacter=2,L.TriggerForIncompleteCompletions=3})(Ts||(n.CompletionTriggerKind=Ts={}));var ar;(function(L){L.method="textDocument/completion",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(ar||(n.CompletionRequest=ar={}));var Sn;(function(L){L.method="completionItem/resolve",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Sn||(n.CompletionResolveRequest=Sn={}));var Dt;(function(L){L.method="textDocument/hover",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Dt||(n.HoverRequest=Dt={}));var os;(function(L){L.Invoked=1,L.TriggerCharacter=2,L.ContentChange=3})(os||(n.SignatureHelpTriggerKind=os={}));var as;(function(L){L.method="textDocument/signatureHelp",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(as||(n.SignatureHelpRequest=as={}));var Sr;(function(L){L.method="textDocument/definition",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Sr||(n.DefinitionRequest=Sr={}));var Ti;(function(L){L.method="textDocument/references",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Ti||(n.ReferencesRequest=Ti={}));var us;(function(L){L.method="textDocument/documentHighlight",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(us||(n.DocumentHighlightRequest=us={}));var fi;(function(L){L.method="textDocument/documentSymbol",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(fi||(n.DocumentSymbolRequest=fi={}));var ls;(function(L){L.method="textDocument/codeAction",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(ls||(n.CodeActionRequest=ls={}));var Ms;(function(L){L.method="codeAction/resolve",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Ms||(n.CodeActionResolveRequest=Ms={}));var ko;(function(L){L.method="workspace/symbol",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(ko||(n.WorkspaceSymbolRequest=ko={}));var ga;(function(L){L.method="workspaceSymbol/resolve",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(ga||(n.WorkspaceSymbolResolveRequest=ga={}));var xo;(function(L){L.method="textDocument/codeLens",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(xo||(n.CodeLensRequest=xo={}));var ur;(function(L){L.method="codeLens/resolve",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(ur||(n.CodeLensResolveRequest=ur={}));var Os;(function(L){L.method="workspace/codeLens/refresh",L.messageDirection=e.MessageDirection.serverToClient,L.type=new e.ProtocolRequestType0(L.method)})(Os||(n.CodeLensRefreshRequest=Os={}));var cs;(function(L){L.method="textDocument/documentLink",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(cs||(n.DocumentLinkRequest=cs={}));var fs;(function(L){L.method="documentLink/resolve",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(fs||(n.DocumentLinkResolveRequest=fs={}));var So;(function(L){L.method="textDocument/formatting",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(So||(n.DocumentFormattingRequest=So={}));var hs;(function(L){L.method="textDocument/rangeFormatting",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(hs||(n.DocumentRangeFormattingRequest=hs={}));var Co;(function(L){L.method="textDocument/rangesFormatting",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Co||(n.DocumentRangesFormattingRequest=Co={}));var Cr;(function(L){L.method="textDocument/onTypeFormatting",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Cr||(n.DocumentOnTypeFormattingRequest=Cr={}));var Hr;(function(L){L.Identifier=1})(Hr||(n.PrepareSupportDefaultBehavior=Hr={}));var Eo;(function(L){L.method="textDocument/rename",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Eo||(n.RenameRequest=Eo={}));var Mi;(function(L){L.method="textDocument/prepareRename",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Mi||(n.PrepareRenameRequest=Mi={}));var Oi;(function(L){L.method="workspace/executeCommand",L.messageDirection=e.MessageDirection.clientToServer,L.type=new e.ProtocolRequestType(L.method)})(Oi||(n.ExecuteCommandRequest=Oi={}));var ds;(function(L){L.method="workspace/applyEdit",L.messageDirection=e.MessageDirection.serverToClient,L.type=new e.ProtocolRequestType("workspace/applyEdit")})(ds||(n.ApplyWorkspaceEditRequest=ds={}))}(Eb)),Eb}var Ch={},RA;function YX(){if(RA)return Ch;RA=1,Object.defineProperty(Ch,"__esModule",{value:!0}),Ch.createProtocolConnection=void 0;const n=Yc();function e(t,r,i,s){return n.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,n.createMessageConnection)(t,r,i,s)}return Ch.createProtocolConnection=e,Ch}var AA;function XX(){return AA||(AA=1,function(n){var e=Ou&&Ou.__createBinding||(Object.create?function(s,o,a,u){u===void 0&&(u=a);var l=Object.getOwnPropertyDescriptor(o,a);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,u,l)}:function(s,o,a,u){u===void 0&&(u=a),s[u]=o[a]}),t=Ou&&Ou.__exportStar||function(s,o){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,s,a)};Object.defineProperty(n,"__esModule",{value:!0}),n.LSPErrorCodes=n.createProtocolConnection=void 0,t(Yc(),n),t(Vk,n),t(hn(),n),t(JX(),n);var r=YX();Object.defineProperty(n,"createProtocolConnection",{enumerable:!0,get:function(){return r.createProtocolConnection}});var i;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(i||(n.LSPErrorCodes=i={}))}(Ou)),Ou}var DA;function ZX(){return DA||(DA=1,function(n){var e=Ru&&Ru.__createBinding||(Object.create?function(s,o,a,u){u===void 0&&(u=a);var l=Object.getOwnPropertyDescriptor(o,a);(!l||("get"in l?!o.__esModule:l.writable||l.configurable))&&(l={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,u,l)}:function(s,o,a,u){u===void 0&&(u=a),s[u]=o[a]}),t=Ru&&Ru.__exportStar||function(s,o){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,s,a)};Object.defineProperty(n,"__esModule",{value:!0}),n.createProtocolConnection=void 0;const r=tA();t(tA(),n),t(XX(),n);function i(s,o,a,u){return(0,r.createMessageConnection)(s,o,a,u)}n.createProtocolConnection=i}(Ru)),Ru}var Jo=ZX();function Kk(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let yl=Kk();function hP(n){yl=n}const td={exec:()=>null};function Ct(n,e=""){let t=typeof n=="string"?n:n.source;const r={replace:(i,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(Nr.caret,"$1"),t=t.replace(i,o),r},getRegex:()=>new RegExp(t,e)};return r}const Nr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},QX=/^(?:[ \t]*(?:\n|$))+/,eZ=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,tZ=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,op=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,nZ=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Jk=/(?:[*+-]|\d{1,9}[.)])/,dP=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,pP=Ct(dP).replace(/bull/g,Jk).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),rZ=Ct(dP).replace(/bull/g,Jk).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Yk=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,iZ=/^[^\n]+/,Xk=/(?!\s*\])(?:\\.|[^\[\]\\])+/,sZ=Ct(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Xk).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),oZ=Ct(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Jk).getRegex(),Y1="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Zk=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,aZ=Ct("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Zk).replace("tag",Y1).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),gP=Ct(Yk).replace("hr",op).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Y1).getRegex(),uZ=Ct(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",gP).getRegex(),Qk={blockquote:uZ,code:eZ,def:sZ,fences:tZ,heading:nZ,hr:op,html:aZ,lheading:pP,list:oZ,newline:QX,paragraph:gP,table:td,text:iZ},TA=Ct("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",op).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Y1).getRegex(),lZ={...Qk,lheading:rZ,table:TA,paragraph:Ct(Yk).replace("hr",op).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",TA).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Y1).getRegex()},cZ={...Qk,html:Ct(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Zk).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:td,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ct(Yk).replace("hr",op).replace("heading",` *#{1,6} *[^
|
|
105
|
-
]`).replace("lheading",pP).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},fZ=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hZ=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,mP=/^( {2,}|\\)\n(?!\s*$)/,dZ=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,X1=/[\p{P}\p{S}]/u,ex=/[\s\p{P}\p{S}]/u,vP=/[^\s\p{P}\p{S}]/u,pZ=Ct(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ex).getRegex(),yP=/(?!~)[\p{P}\p{S}]/u,gZ=/(?!~)[\s\p{P}\p{S}]/u,mZ=/(?:[^\s\p{P}\p{S}]|~)/u,vZ=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,bP=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,yZ=Ct(bP,"u").replace(/punct/g,X1).getRegex(),bZ=Ct(bP,"u").replace(/punct/g,yP).getRegex(),wP="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",wZ=Ct(wP,"gu").replace(/notPunctSpace/g,vP).replace(/punctSpace/g,ex).replace(/punct/g,X1).getRegex(),_Z=Ct(wP,"gu").replace(/notPunctSpace/g,mZ).replace(/punctSpace/g,gZ).replace(/punct/g,yP).getRegex(),kZ=Ct("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,vP).replace(/punctSpace/g,ex).replace(/punct/g,X1).getRegex(),xZ=Ct(/\\(punct)/,"gu").replace(/punct/g,X1).getRegex(),SZ=Ct(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),CZ=Ct(Zk).replace("(?:-->|$)","-->").getRegex(),EZ=Ct("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",CZ).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),i1=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,RZ=Ct(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",i1).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),_P=Ct(/^!?\[(label)\]\[(ref)\]/).replace("label",i1).replace("ref",Xk).getRegex(),kP=Ct(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xk).getRegex(),AZ=Ct("reflink|nolink(?!\\()","g").replace("reflink",_P).replace("nolink",kP).getRegex(),tx={_backpedal:td,anyPunctuation:xZ,autolink:SZ,blockSkip:vZ,br:mP,code:hZ,del:td,emStrongLDelim:yZ,emStrongRDelimAst:wZ,emStrongRDelimUnd:kZ,escape:fZ,link:RZ,nolink:kP,punctuation:pZ,reflink:_P,reflinkSearch:AZ,tag:EZ,text:dZ,url:td},DZ={...tx,link:Ct(/^!?\[(label)\]\((.*?)\)/).replace("label",i1).getRegex(),reflink:Ct(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",i1).getRegex()},d2={...tx,emStrongRDelimAst:_Z,emStrongLDelim:bZ,url:Ct(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},TZ={...d2,br:Ct(mP).replace("{2,}","*").getRegex(),text:Ct(d2.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ng={normal:Qk,gfm:lZ,pedantic:cZ},Eh={normal:tx,gfm:d2,breaks:TZ,pedantic:DZ},MZ={"&":"&","<":"<",">":">",'"':""","'":"'"},MA=n=>MZ[n];function Ks(n,e){if(e){if(Nr.escapeTest.test(n))return n.replace(Nr.escapeReplace,MA)}else if(Nr.escapeTestNoEncode.test(n))return n.replace(Nr.escapeReplaceNoEncode,MA);return n}function OA(n){try{n=encodeURI(n).replace(Nr.percentDecode,"%")}catch{return null}return n}function PA(n,e){const t=n.replace(Nr.findPipe,(s,o,a)=>{let u=!1,l=o;for(;--l>=0&&a[l]==="\\";)u=!u;return u?"|":" |"}),r=t.split(Nr.splitPipe);let i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Nr.slashPipe,"|");return r}function Rh(n,e,t){const r=n.length;if(r===0)return"";let i=0;for(;i<r&&n.charAt(r-i-1)===e;)i++;return n.slice(0,r-i)}function OZ(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<n.length;r++)if(n[r]==="\\")r++;else if(n[r]===e[0])t++;else if(n[r]===e[1]&&(t--,t<0))return r;return t>0?-2:-1}function IA(n,e,t,r,i){const s=e.href,o=e.title||null,a=n[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;const u={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:s,title:o,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,u}function PZ(n,e,t){const r=n.match(t.other.indentCodeCompensation);if(r===null)return e;const i=r[1];return e.split(`
|
|
106
|
-
`).map(s=>{const o=s.match(t.other.beginningSpace);if(o===null)return s;const[a]=o;return a.length>=i.length?s.slice(i.length):s}).join(`
|
|
107
|
-
`)}class s1{options;rules;lexer;constructor(e){this.options=e||yl}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const r=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?r:Rh(r,`
|
|
108
|
-
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const r=t[0],i=PZ(r,t[3]||"",this.rules);return{type:"code",raw:r,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let r=t[2].trim();if(this.rules.other.endingHash.test(r)){const i=Rh(r,"#");(this.options.pedantic||!i||this.rules.other.endingSpaceChar.test(i))&&(r=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Rh(t[0],`
|
|
109
|
-
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let r=Rh(t[0],`
|
|
110
|
-
`).split(`
|
|
111
|
-
`),i="",s="";const o=[];for(;r.length>0;){let a=!1;const u=[];let l;for(l=0;l<r.length;l++)if(this.rules.other.blockquoteStart.test(r[l]))u.push(r[l]),a=!0;else if(!a)u.push(r[l]);else break;r=r.slice(l);const c=u.join(`
|
|
112
|
-
`),f=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
113
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");i=i?`${i}
|
|
114
|
-
${c}`:c,s=s?`${s}
|
|
115
|
-
${f}`:f;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,o,!0),this.lexer.state.top=d,r.length===0)break;const g=o.at(-1);if(g?.type==="code")break;if(g?.type==="blockquote"){const m=g,y=m.raw+`
|
|
116
|
-
`+r.join(`
|
|
117
|
-
`),b=this.blockquote(y);o[o.length-1]=b,i=i.substring(0,i.length-m.raw.length)+b.raw,s=s.substring(0,s.length-m.text.length)+b.text;break}else if(g?.type==="list"){const m=g,y=m.raw+`
|
|
118
|
-
`+r.join(`
|
|
119
|
-
`),b=this.list(y);o[o.length-1]=b,i=i.substring(0,i.length-g.raw.length)+b.raw,s=s.substring(0,s.length-m.raw.length)+b.raw,r=y.substring(o.at(-1).raw.length).split(`
|
|
120
|
-
`);continue}}return{type:"blockquote",raw:i,tokens:o,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let r=t[1].trim();const i=r.length>1,s={type:"list",raw:"",ordered:i,start:i?+r.slice(0,-1):"",loose:!1,items:[]};r=i?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=i?r:"[*+-]");const o=this.rules.other.listItemRegex(r);let a=!1;for(;e;){let l=!1,c="",f="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;c=t[0],e=e.substring(c.length);let d=t[2].split(`
|
|
121
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,S=>" ".repeat(3*S.length)),g=e.split(`
|
|
122
|
-
`,1)[0],m=!d.trim(),y=0;if(this.options.pedantic?(y=2,f=d.trimStart()):m?y=t[1].length+1:(y=t[2].search(this.rules.other.nonSpaceChar),y=y>4?1:y,f=d.slice(y),y+=t[1].length),m&&this.rules.other.blankLine.test(g)&&(c+=g+`
|
|
123
|
-
`,e=e.substring(g.length+1),l=!0),!l){const S=this.rules.other.nextBulletRegex(y),k=this.rules.other.hrRegex(y),x=this.rules.other.fencesBeginRegex(y),C=this.rules.other.headingBeginRegex(y),R=this.rules.other.htmlBeginRegex(y);for(;e;){const P=e.split(`
|
|
124
|
-
`,1)[0];let q;if(g=P,this.options.pedantic?(g=g.replace(this.rules.other.listReplaceNesting," "),q=g):q=g.replace(this.rules.other.tabCharGlobal," "),x.test(g)||C.test(g)||R.test(g)||S.test(g)||k.test(g))break;if(q.search(this.rules.other.nonSpaceChar)>=y||!g.trim())f+=`
|
|
125
|
-
`+q.slice(y);else{if(m||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||x.test(d)||C.test(d)||k.test(d))break;f+=`
|
|
126
|
-
`+g}!m&&!g.trim()&&(m=!0),c+=P+`
|
|
127
|
-
`,e=e.substring(P.length+1),d=q.slice(y)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(a=!0));let b=null,w;this.options.gfm&&(b=this.rules.other.listIsTask.exec(f),b&&(w=b[0]!=="[ ] ",f=f.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:c,task:!!b,checked:w,loose:!1,text:f,tokens:[]}),s.raw+=c}const u=s.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let l=0;l<s.items.length;l++)if(this.lexer.state.top=!1,s.items[l].tokens=this.lexer.blockTokens(s.items[l].text,[]),!s.loose){const c=s.items[l].tokens.filter(d=>d.type==="space"),f=c.length>0&&c.some(d=>this.rules.other.anyLine.test(d.raw));s.loose=f}if(s.loose)for(let l=0;l<s.items.length;l++)s.items[l].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const r=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),i=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:r,raw:t[0],href:i,title:s}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const r=PA(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
128
|
-
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(r.length===i.length){for(const a of i)this.rules.other.tableAlignRight.test(a)?o.align.push("right"):this.rules.other.tableAlignCenter.test(a)?o.align.push("center"):this.rules.other.tableAlignLeft.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a<r.length;a++)o.header.push({text:r[a],tokens:this.lexer.inline(r[a]),header:!0,align:o.align[a]});for(const a of s)o.rows.push(PA(a,o.header.length).map((u,l)=>({text:u,tokens:this.lexer.inline(u),header:!1,align:o.align[l]})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const r=t[1].charAt(t[1].length-1)===`
|
|
129
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:r,tokens:this.lexer.inline(r)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const r=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;const o=Rh(r.slice(0,-1),"\\");if((r.length-o.length)%2===0)return}else{const o=OZ(t[2],"()");if(o===-2)return;if(o>-1){const u=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,u).trim(),t[3]=""}}let i=t[2],s="";if(this.options.pedantic){const o=this.rules.other.pedanticHrefTitle.exec(i);o&&(i=o[1],s=o[3])}else s=t[3]?t[3].slice(1,-1):"";return i=i.trim(),this.rules.other.startAngleBracket.test(i)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?i=i.slice(1):i=i.slice(1,-1)),IA(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){const i=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[i.toLowerCase()];if(!s){const o=r[0].charAt(0);return{type:"text",raw:o,text:o}}return IA(r,s,r[0],this.lexer,this.rules)}}emStrong(e,t,r=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&r.match(this.rules.other.unicodeAlphaNumeric))return;if(!(i[1]||i[2]||"")||!r||this.rules.inline.punctuation.exec(r)){const o=[...i[0]].length-1;let a,u,l=o,c=0;const f=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+o);(i=f.exec(t))!=null;){if(a=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!a)continue;if(u=[...a].length,i[3]||i[4]){l+=u;continue}else if((i[5]||i[6])&&o%3&&!((o+u)%3)){c+=u;continue}if(l-=u,l>0)continue;u=Math.min(u,u+l+c);const d=[...i[0]][0].length,g=e.slice(0,o+i.index+d+u);if(Math.min(o,u)%2){const y=g.slice(1,-1);return{type:"em",raw:g,text:y,tokens:this.lexer.inlineTokens(y)}}const m=g.slice(2,-2);return{type:"strong",raw:g,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let r=t[2].replace(this.rules.other.newLineCharGlobal," ");const i=this.rules.other.nonSpaceChar.test(r),s=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return i&&s&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:t[0],text:r}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let r,i;return t[2]==="@"?(r=t[1],i="mailto:"+r):(r=t[1],i=r),{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let r,i;if(t[2]==="@")r=t[0],i="mailto:"+r;else{let s;do s=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??"";while(s!==t[0]);r=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const r=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:r}}}}class Yi{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||yl,this.options.tokenizer=this.options.tokenizer||new s1,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:Nr,block:ng.normal,inline:Eh.normal};this.options.pedantic?(t.block=ng.pedantic,t.inline=Eh.pedantic):this.options.gfm&&(t.block=ng.gfm,this.options.breaks?t.inline=Eh.breaks:t.inline=Eh.gfm),this.tokenizer.rules=t}static get rules(){return{block:ng,inline:Eh}}static lex(e,t){return new Yi(t).lex(e)}static lexInline(e,t){return new Yi(t).inlineTokens(e)}lex(e){e=e.replace(Nr.carriageReturn,`
|
|
130
|
-
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){for(this.options.pedantic&&(e=e.replace(Nr.tabCharGlobal," ").replace(Nr.spaceLine,""));e;){let i;if(this.options.extensions?.block?.some(o=>(i=o.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);const o=t.at(-1);i.raw.length===1&&o!==void 0?o.raw+=`
|
|
131
|
-
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);const o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
|
|
132
|
-
`+i.raw,o.text+=`
|
|
133
|
-
`+i.text,this.inlineQueue.at(-1).src=o.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);const o=t.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=`
|
|
134
|
-
`+i.raw,o.text+=`
|
|
135
|
-
`+i.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let s=e;if(this.options.extensions?.startBlock){let o=1/0;const a=e.slice(1);let u;this.options.extensions.startBlock.forEach(l=>{u=l.call({lexer:this},a),typeof u=="number"&&u>=0&&(o=Math.min(o,u))}),o<1/0&&o>=0&&(s=e.substring(0,o+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){const o=t.at(-1);r&&o?.type==="paragraph"?(o.raw+=`
|
|
136
|
-
`+i.raw,o.text+=`
|
|
137
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(i),r=s.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);const o=t.at(-1);o?.type==="text"?(o.raw+=`
|
|
138
|
-
`+i.raw,o.text+=`
|
|
139
|
-
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):t.push(i);continue}if(e){const o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let r=e,i=null;if(this.tokens.links){const a=Object.keys(this.tokens.links);if(a.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)a.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let s=!1,o="";for(;e;){s||(o=""),s=!1;let a;if(this.options.extensions?.inline?.some(l=>(a=l.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);const l=t.at(-1);a.type==="text"&&l?.type==="text"?(l.raw+=a.raw,l.text+=a.text):t.push(a);continue}if(a=this.tokenizer.emStrong(e,r,o)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),t.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),t.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),t.push(a);continue}let u=e;if(this.options.extensions?.startInline){let l=1/0;const c=e.slice(1);let f;this.options.extensions.startInline.forEach(d=>{f=d.call({lexer:this},c),typeof f=="number"&&f>=0&&(l=Math.min(l,f))}),l<1/0&&l>=0&&(u=e.substring(0,l+1))}if(a=this.tokenizer.inlineText(u)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(o=a.raw.slice(-1)),s=!0;const l=t.at(-1);l?.type==="text"?(l.raw+=a.raw,l.text+=a.text):t.push(a);continue}if(e){const l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return t}}class o1{options;parser;constructor(e){this.options=e||yl}space(e){return""}code({text:e,lang:t,escaped:r}){const i=(t||"").match(Nr.notSpaceStart)?.[0],s=e.replace(Nr.endingNewline,"")+`
|
|
140
|
-
`;return i?'<pre><code class="language-'+Ks(i)+'">'+(r?s:Ks(s,!0))+`</code></pre>
|
|
141
|
-
`:"<pre><code>"+(r?s:Ks(s,!0))+`</code></pre>
|
|
142
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
143
|
-
${this.parser.parse(e)}</blockquote>
|
|
144
|
-
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
145
|
-
`}hr(e){return`<hr>
|
|
146
|
-
`}list(e){const t=e.ordered,r=e.start;let i="";for(let a=0;a<e.items.length;a++){const u=e.items[a];i+=this.listitem(u)}const s=t?"ol":"ul",o=t&&r!==1?' start="'+r+'"':"";return"<"+s+o+`>
|
|
147
|
-
`+i+"</"+s+`>
|
|
148
|
-
`}listitem(e){let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+Ks(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
149
|
-
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
150
|
-
`}table(e){let t="",r="";for(let s=0;s<e.header.length;s++)r+=this.tablecell(e.header[s]);t+=this.tablerow({text:r});let i="";for(let s=0;s<e.rows.length;s++){const o=e.rows[s];r="";for(let a=0;a<o.length;a++)r+=this.tablecell(o[a]);i+=this.tablerow({text:r})}return i&&(i=`<tbody>${i}</tbody>`),`<table>
|
|
151
|
-
<thead>
|
|
152
|
-
`+t+`</thead>
|
|
153
|
-
`+i+`</table>
|
|
154
|
-
`}tablerow({text:e}){return`<tr>
|
|
155
|
-
${e}</tr>
|
|
156
|
-
`}tablecell(e){const t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
|
|
157
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Ks(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:r}){const i=this.parser.parseInline(r),s=OA(e);if(s===null)return i;e=s;let o='<a href="'+e+'"';return t&&(o+=' title="'+Ks(t)+'"'),o+=">"+i+"</a>",o}image({href:e,title:t,text:r,tokens:i}){i&&(r=this.parser.parseInline(i,this.parser.textRenderer));const s=OA(e);if(s===null)return Ks(r);e=s;let o=`<img src="${e}" alt="${r}"`;return t&&(o+=` title="${Ks(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Ks(e.text)}}class nx{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class Xi{options;renderer;textRenderer;constructor(e){this.options=e||yl,this.options.renderer=this.options.renderer||new o1,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new nx}static parse(e,t){return new Xi(t).parse(e)}static parseInline(e,t){return new Xi(t).parseInline(e)}parse(e,t=!0){let r="";for(let i=0;i<e.length;i++){const s=e[i];if(this.options.extensions?.renderers?.[s.type]){const a=s,u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){r+=u||"";continue}}const o=s;switch(o.type){case"space":{r+=this.renderer.space(o);continue}case"hr":{r+=this.renderer.hr(o);continue}case"heading":{r+=this.renderer.heading(o);continue}case"code":{r+=this.renderer.code(o);continue}case"table":{r+=this.renderer.table(o);continue}case"blockquote":{r+=this.renderer.blockquote(o);continue}case"list":{r+=this.renderer.list(o);continue}case"html":{r+=this.renderer.html(o);continue}case"paragraph":{r+=this.renderer.paragraph(o);continue}case"text":{let a=o,u=this.renderer.text(a);for(;i+1<e.length&&e[i+1].type==="text";)a=e[++i],u+=`
|
|
158
|
-
`+this.renderer.text(a);t?r+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):r+=u;continue}default:{const a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(e,t=this.renderer){let r="";for(let i=0;i<e.length;i++){const s=e[i];if(this.options.extensions?.renderers?.[s.type]){const a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=a||"";continue}}const o=s;switch(o.type){case"escape":{r+=t.text(o);break}case"html":{r+=t.html(o);break}case"link":{r+=t.link(o);break}case"image":{r+=t.image(o);break}case"strong":{r+=t.strong(o);break}case"em":{r+=t.em(o);break}case"codespan":{r+=t.codespan(o);break}case"br":{r+=t.br(o);break}case"del":{r+=t.del(o);break}case"text":{r+=t.text(o);break}default:{const a='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}}class hm{options;block;constructor(e){this.options=e||yl}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Yi.lex:Yi.lexInline}provideParser(){return this.block?Xi.parse:Xi.parseInline}}class IZ{defaults=Kk();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Xi;Renderer=o1;TextRenderer=nx;Lexer=Yi;Tokenizer=s1;Hooks=hm;constructor(...e){this.use(...e)}walkTokens(e,t){let r=[];for(const i of e)switch(r=r.concat(t.call(this,i)),i.type){case"table":{const s=i;for(const o of s.header)r=r.concat(this.walkTokens(o.tokens,t));for(const o of s.rows)for(const a of o)r=r.concat(this.walkTokens(a.tokens,t));break}case"list":{const s=i;r=r.concat(this.walkTokens(s.items,t));break}default:{const s=i;this.defaults.extensions?.childTokens?.[s.type]?this.defaults.extensions.childTokens[s.type].forEach(o=>{const a=s[o].flat(1/0);r=r.concat(this.walkTokens(a,t))}):s.tokens&&(r=r.concat(this.walkTokens(s.tokens,t)))}}return r}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{const i={...r};if(i.async=this.defaults.async||i.async||!1,r.extensions&&(r.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const o=t.renderers[s.name];o?t.renderers[s.name]=function(...a){let u=s.renderer.apply(this,a);return u===!1&&(u=o.apply(this,a)),u}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[s.level];o?o.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),i.extensions=t),r.renderer){const s=this.defaults.renderer||new o1(this.defaults);for(const o in r.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;const a=o,u=r.renderer[a],l=s[a];s[a]=(...c)=>{let f=u.apply(s,c);return f===!1&&(f=l.apply(s,c)),f||""}}i.renderer=s}if(r.tokenizer){const s=this.defaults.tokenizer||new s1(this.defaults);for(const o in r.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const a=o,u=r.tokenizer[a],l=s[a];s[a]=(...c)=>{let f=u.apply(s,c);return f===!1&&(f=l.apply(s,c)),f}}i.tokenizer=s}if(r.hooks){const s=this.defaults.hooks||new hm;for(const o in r.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;const a=o,u=r.hooks[a],l=s[a];hm.passThroughHooks.has(o)?s[a]=c=>{if(this.defaults.async)return Promise.resolve(u.call(s,c)).then(d=>l.call(s,d));const f=u.call(s,c);return l.call(s,f)}:s[a]=(...c)=>{let f=u.apply(s,c);return f===!1&&(f=l.apply(s,c)),f}}i.hooks=s}if(r.walkTokens){const s=this.defaults.walkTokens,o=r.walkTokens;i.walkTokens=function(a){let u=[];return u.push(o.call(this,a)),s&&(u=u.concat(s.call(this,a))),u}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Yi.lex(e,t??this.defaults)}parser(e,t){return Xi.parse(e,t??this.defaults)}parseMarkdown(e){return(r,i)=>{const s={...i},o={...this.defaults,...s},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const u=o.hooks?o.hooks.provideLexer():e?Yi.lex:Yi.lexInline,l=o.hooks?o.hooks.provideParser():e?Xi.parse:Xi.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(r):r).then(c=>u(c,o)).then(c=>o.hooks?o.hooks.processAllTokens(c):c).then(c=>o.walkTokens?Promise.all(this.walkTokens(c,o.walkTokens)).then(()=>c):c).then(c=>l(c,o)).then(c=>o.hooks?o.hooks.postprocess(c):c).catch(a);try{o.hooks&&(r=o.hooks.preprocess(r));let c=u(r,o);o.hooks&&(c=o.hooks.processAllTokens(c)),o.walkTokens&&this.walkTokens(c,o.walkTokens);let f=l(c,o);return o.hooks&&(f=o.hooks.postprocess(f)),f}catch(c){return a(c)}}}onError(e,t){return r=>{if(r.message+=`
|
|
159
|
-
Please report this to https://github.com/markedjs/marked.`,e){const i="<p>An error occurred:</p><pre>"+Ks(r.message+"",!0)+"</pre>";return t?Promise.resolve(i):i}if(t)return Promise.reject(r);throw r}}}const pl=new IZ;function St(n,e){return pl.parse(n,e)}St.options=St.setOptions=function(n){return pl.setOptions(n),St.defaults=pl.defaults,hP(St.defaults),St};St.getDefaults=Kk;St.defaults=yl;St.use=function(...n){return pl.use(...n),St.defaults=pl.defaults,hP(St.defaults),St};St.walkTokens=function(n,e){return pl.walkTokens(n,e)};St.parseInline=pl.parseInline;St.Parser=Xi;St.parser=Xi.parse;St.Renderer=o1;St.TextRenderer=nx;St.Lexer=Yi;St.lexer=Yi.lex;St.Tokenizer=s1;St.Hooks=hm;St.parse=St;St.options;St.setOptions;St.use;St.walkTokens;St.parseInline;Xi.parse;Yi.lex;function qn(n,e){if(e.line>=n.lines)return e.character===0?n.length:void 0;const t=n.line(e.line+1).from+e.character;if(!(t>n.length))return t}function xs(n,e){return qn(n,e)||0}function Fa(n,e){const t=n.lineAt(e);return{character:e-t.from,line:t.number-1}}const a1=new St.Renderer,LZ=a1.code;a1.code=n=>n.text.trim()?LZ.call(a1,n):"";function xP(n){return St(n,{async:!1,gfm:!0,breaks:!0,renderer:a1})}function Ss(n,e=xP){if(!n)return"";if(qZ(n)){let t=n.value;return n.kind==="markdown"&&(t=e(t.trim())),t}return Array.isArray(n)?n.map(t=>Ss(t,e)).filter(Boolean).join(`
|
|
160
|
-
|
|
161
|
-
`):typeof n=="string"?n:""}function FZ(n){if(n.length===0)return"";if(n.length===1)return n[0]||"";n.sort();const e=n[0]||"",t=n[n.length-1]||"";let r=0;for(;r<e.length&&e[r]===t[r];)r++;return e.substring(0,r)}function NZ(n){if(n.length===0)return;const e=n.map(o=>o.textEdit?.newText||o.label),t=FZ(e);if(t==="")return;const r=[];for(let o=0;o<t.length;o++){const a=t.slice(0,o+1);if(a.length>0){const u=a.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");r.push(u)}}const i=r.join("|");return new RegExp(`(${i})$`)}function BZ(n){return n?.range!==void 0}function qZ(n){return n.kind!==void 0}function ki(n,e){const t=document.createElement("div");t.className="cm-error-message",t.style.cssText=`
|
|
162
|
-
position: absolute;
|
|
163
|
-
padding: 8px;
|
|
164
|
-
background: #fee;
|
|
165
|
-
border: 1px solid #fcc;
|
|
166
|
-
border-radius: 4px;
|
|
167
|
-
color: #c00;
|
|
168
|
-
font-size: 14px;
|
|
169
|
-
z-index: 100;
|
|
170
|
-
max-width: 300px;
|
|
171
|
-
box-shadow: 0 2px 8px rgba(0,0,0,.15);
|
|
172
|
-
`,t.textContent=e;const r=n.coordsAtPos(n.state.selection.main.head);r&&(t.style.left=`${r.left}px`,t.style.top=`${r.bottom+5}px`),document.body.appendChild(t),setTimeout(()=>{t.style.opacity="0",t.style.transition="opacity 0.2s",setTimeout(()=>t.remove(),200)},3e3)}function u1(n){if(n==null)return!0;if(Array.isArray(n))return n.length===0||n.every(u1);if(typeof n=="string")return LA(n);const e=n.value;return typeof e=="string"?LA(e):!1}function LA(n){return n==null?!0:typeof n=="string"?n.trim()===""||/^[\s\n`]*$/.test(n):!1}function jZ(n,e){const t=[];return e.iterChanges((r,i,s,o,a)=>{const u=a.toString();if(r===0&&i===n.length){t.push({text:u});return}const l=Fa(n,r),c=Fa(n,i);t.push({range:{start:l,end:c},text:u})}),t.sort((r,i)=>{if(!r.range)return 1;if(!i.range)return-1;const s=r.range.start.line??-1,o=i.range.start.line??-1;if(s!==o)return o-s;const a=r.range.start.character??-1;return(i.range.start.character??-1)-a}),t}const $Z=Object.fromEntries(Object.entries(Jo.CompletionItemKind).map(([n,e])=>[e,n]));var p2;(function(n){n.PlainText=1,n.Snippet=2})(p2||(p2={}));function WZ(n){return n.replaceAll(/\\\\/g,"").replaceAll(/(\$(\d+))/g,(t,r,i)=>"${"+i+"}")}function zZ(n,e){const{detail:t,labelDetails:r,label:i,kind:s,textEdit:o,insertText:a,documentation:u,additionalTextEdits:l,insertTextFormat:c}=n,f={label:i,detail:r?.detail||t,apply(d,g,m,y){if(o&&BZ(o)?d.dispatch(l_(d.state,o.newText,xs(d.state.doc,o.range.start),xs(d.state.doc,o.range.end))):a&&c===p2.Snippet&&e.useSnippetOnCompletion?B4(WZ(a))(d,null,m,y):d.dispatch(l_(d.state,i,m,y)),!l)return;const b=l.sort(({range:{end:w}},{range:{end:S}})=>xs(d.state.doc,w)<xs(d.state.doc,S)?1:xs(d.state.doc,w)>xs(d.state.doc,S)?-1:0);for(const w of b)d.dispatch(d.state.update({changes:{from:xs(d.state.doc,w.range.start),to:qn(d.state.doc,w.range.end),insert:w.newText}}))},type:s&&$Z[s].toLowerCase()};return e.hasResolveProvider&&e.resolveItem?f.info=async()=>{try{const d=await e.resolveItem?.(n),g=document.createElement("div");g.classList.add("documentation");const m=d?.documentation||u;return!m||u1(m)?null:(e.allowHTMLContent?g.innerHTML=Ss(m,e.markdownRenderer):g.textContent=Ss(m,e.markdownRenderer),g)}catch(d){if(console.error("Failed to resolve completion item:",d),u1(u))return null;if(u){const g=document.createElement("div");return g.classList.add("documentation"),e.allowHTMLContent?g.innerHTML=Ss(u,e.markdownRenderer):g.textContent=Ss(u,e.markdownRenderer),g}return null}}:u&&(f.info=()=>{const d=document.createElement("div");return d.classList.add("documentation"),e.allowHTMLContent?d.innerHTML=Ss(u,e.markdownRenderer):d.textContent=Ss(u,e.markdownRenderer),d}),f}function UZ(n,e,t){const r=[e?HZ(e):VZ,t==="python"?GZ:void 0].filter(Boolean);let i=n;if(e){const s=e.toLowerCase();/^\w+$/.test(s)&&(i=i.filter(({label:o,filterText:a})=>(a??o).toLowerCase().startsWith(s)))}for(const s of r)i.sort(s);return i}function HZ(n){return(e,t)=>{const r=e.sortText??e.label,i=t.sortText??t.label;switch(!0){case(r.startsWith(n)&&!i.startsWith(n)):return-1;case(!r.startsWith(n)&&i.startsWith(n)):return 1}return r.localeCompare(i)}}function VZ(n,e){const t=n.sortText??n.label,r=e.sortText??e.label;return t.localeCompare(r)}function GZ(n,e){const t=n.label.endsWith("="),r=e.label.endsWith("=");return t&&!r?-1:!t&&r?1:0}function SP(n){const e=new Proxy({},{get(){throw new Error(n)}});return function(r){return r.at(-1)??e}}const CP=Ae.define({combine:SP("No document URI provided. Either pass a one into the extension or use documentUri.of().")}),EP=Ae.define({combine:SP("No language ID provided. Either pass a one into the extension or use languageId.of().")}),KZ=1e4;class JZ{ready;capabilities;initializePromise;rootUri;workspaceFolders;timeout;transport;requestManager;client;initializationOptions;clientCapabilities;notificationListeners=new Set;constructor({rootUri:e,workspaceFolders:t,transport:r,initializationOptions:i,capabilities:s,timeout:o=KZ,getWorkspaceConfiguration:a}){this.rootUri=e,this.workspaceFolders=t,this.transport=r,this.initializationOptions=i,this.clientCapabilities=s,this.timeout=o,this.ready=!1,this.capabilities=null,this.requestManager=new NR.RequestManager([this.transport]),this.client=new NR.Client(this.requestManager),this.client.onNotification(l=>{this.processNotification(l)});const u=this.transport;u?.connection&&u.connection.addEventListener("message",l=>{const c=JSON.parse(l.data);c.method==="workspace/configuration"&&a?u.connection.send(JSON.stringify({jsonrpc:"2.0",id:c.id,result:a(c.params)})):c.method&&c.id&&u.connection.send(JSON.stringify({jsonrpc:"2.0",id:c.id,result:null}))}),this.initializePromise=this.initialize()}getInitializationOptions(){const e={textDocument:{hover:{dynamicRegistration:!0,contentFormat:["markdown","plaintext"]},moniker:{},synchronization:{dynamicRegistration:!0,willSave:!1,didSave:!1,willSaveWaitUntil:!1},codeAction:{dynamicRegistration:!0,codeActionLiteralSupport:{codeActionKind:{valueSet:["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},resolveSupport:{properties:["edit"]}},completion:{dynamicRegistration:!0,completionItem:{snippetSupport:!0,commitCharactersSupport:!0,documentationFormat:["markdown","plaintext"],deprecatedSupport:!1,preselectSupport:!1},contextSupport:!1},signatureHelp:{dynamicRegistration:!0,signatureInformation:{documentationFormat:["markdown","plaintext"]}},declaration:{dynamicRegistration:!0,linkSupport:!0},definition:{dynamicRegistration:!0,linkSupport:!0},typeDefinition:{dynamicRegistration:!0,linkSupport:!0},implementation:{dynamicRegistration:!0,linkSupport:!0},rename:{dynamicRegistration:!0,prepareSupport:!0}},workspace:{didChangeConfiguration:{dynamicRegistration:!0}}};return{capabilities:this.clientCapabilities?typeof this.clientCapabilities=="function"?this.clientCapabilities(e):this.clientCapabilities:e,initializationOptions:this.initializationOptions,processId:null,rootUri:this.rootUri,workspaceFolders:this.workspaceFolders}}async initialize(){const{capabilities:e}=await this.request("initialize",this.getInitializationOptions(),this.timeout*3);this.capabilities=e,this.notify("initialized",{}),this.ready=!0}close(){this.client.close()}textDocumentDidOpen(e){return this.notify("textDocument/didOpen",e)}textDocumentDidChange(e){return this.notify("textDocument/didChange",e)}async textDocumentHover(e){return await this.request("textDocument/hover",e,this.timeout)}async textDocumentCompletion(e){return await this.request("textDocument/completion",e,this.timeout)}async completionItemResolve(e){return await this.request("completionItem/resolve",e,this.timeout)}async textDocumentDefinition(e){return await this.request("textDocument/definition",e,this.timeout)}async textDocumentCodeAction(e){return await this.request("textDocument/codeAction",e,this.timeout)}async textDocumentRename(e){return await this.request("textDocument/rename",e,this.timeout)}async textDocumentPrepareRename(e){return await this.request("textDocument/prepareRename",e,this.timeout)}async textDocumentSignatureHelp(e){return await this.request("textDocument/signatureHelp",e,this.timeout)}onNotification(e){return this.notificationListeners.add(e),()=>this.notificationListeners.delete(e)}request(e,t,r){return this.client.request({method:e,params:t},r)}notify(e,t){return this.client.notify({method:e,params:t})}processNotification(e){this.notificationListeners.forEach(t=>t(e))}}const FA=console.log;function YZ(){return String(Date.now()+Math.random())}class XZ{documentVersion;pluginId;client;documentUri;languageId;view;allowHTMLContent;useSnippetOnCompletion;sendIncrementalChanges;featureOptions;onGoToDefinition;markdownRenderer;disposeListener;constructor(e){const{client:t,documentUri:r,languageId:i,view:s,featureOptions:o,sendIncrementalChanges:a=!0,allowHTMLContent:u=!1,useSnippetOnCompletion:l=!1,onGoToDefinition:c,markdownRenderer:f=xP}=e;this.documentVersion=0,this.pluginId=YZ(),this.client=t,this.documentUri=r,this.languageId=i,this.view=s,this.allowHTMLContent=u,this.useSnippetOnCompletion=l,this.sendIncrementalChanges=a,this.featureOptions=o,this.onGoToDefinition=c,this.markdownRenderer=f,this.disposeListener=t.onNotification(this.processNotification.bind(this)),this.initialize({documentText:this.view.state.doc.toString()})}update({state:e,docChanged:t,startState:{doc:r},changes:i}){t&&(this.sendIncrementalChanges?this.sendChanges(jZ(r,i)):this.sendChanges([{text:e.doc.toString()}]))}destroy(){this.disposeListener?.()}async initialize({documentText:e}){this.client.initializePromise&&await this.client.initializePromise,await this.client.textDocumentDidOpen({textDocument:{uri:this.documentUri,languageId:this.languageId,text:e,version:this.documentVersion}})}async sendChanges(e){if(this.client.ready)try{await this.client.textDocumentDidChange({textDocument:{uri:this.documentUri,version:++this.documentVersion},contentChanges:e})}catch(t){console.error(t)}}requestDiagnostics(e){this.sendChanges([{text:e.state.doc.toString()}])}async requestHoverTooltip(e,{line:t,character:r}){if(!this.featureOptions.hoverEnabled||!(this.client.ready&&this.client.capabilities?.hoverProvider))return null;const i=await this.client.textDocumentHover({textDocument:{uri:this.documentUri},position:{line:t,character:r}});if(!i)return null;const{contents:s,range:o}=i;let a=qn(e.state.doc,{line:t,character:r}),u;if(o&&(a=qn(e.state.doc,o.start),u=qn(e.state.doc,o.end)),a==null||u1(s))return null;const l=document.createElement("div");return l.classList.add("documentation","cm-lsp-hover-tooltip"),this.allowHTMLContent?l.innerHTML=Ss(s,this.markdownRenderer):l.textContent=Ss(s,this.markdownRenderer),{pos:a,end:u,create:c=>({dom:l}),above:!0}}async requestCompletion(e,{line:t,character:r},{triggerKind:i,triggerCharacter:s}){if(!this.featureOptions.completionEnabled||!(this.client.ready&&this.client.capabilities?.completionProvider))return null;const o=await this.client.textDocumentCompletion({textDocument:{uri:this.documentUri},position:{line:t,character:r},context:{triggerKind:i,triggerCharacter:s}});if(!o)return null;const a="items"in o?o.items:o,u=NZ(a),l=u?e.matchBefore(u):e.matchBefore(/[a-zA-Z0-9]+/);let{pos:c}=e;const f=UZ(a,l?.text,this.languageId);l&&(c=l.from);const d=f.map(g=>zZ(g,{allowHTMLContent:this.allowHTMLContent,useSnippetOnCompletion:this.useSnippetOnCompletion,hasResolveProvider:this.client.capabilities?.completionProvider?.resolveProvider??!1,resolveItem:this.client.completionItemResolve.bind(this.client)}));return{from:c,options:d,filter:!1}}async requestDefinition(e,{line:t,character:r}){if(!this.featureOptions.definitionEnabled||!(this.client.ready&&this.client.capabilities?.definitionProvider))return;const i=await this.client.textDocumentDefinition({textDocument:{uri:this.documentUri},position:{line:t,character:r}});if(!i)return;const s=Array.isArray(i)?i:[i];if(s.length===0)return;const o=s[0];if(!o)return;const a="uri"in o?o.uri:o.targetUri,u="range"in o?o.range:o.targetRange,l=a!==this.documentUri,c={uri:a,range:u,isExternalDocument:l};return l||e.dispatch(e.state.update({selection:{anchor:xs(e.state.doc,u.start),head:qn(e.state.doc,u.end)}})),this.onGoToDefinition&&this.onGoToDefinition(c),c}processNotification(e){try{switch(e.method){case"textDocument/publishDiagnostics":this.processDiagnostics(e.params)}}catch(t){FA(t)}}lastSeenDiagnosticsVersion=0;async processDiagnostics(e){if(e.uri!==this.documentUri)return;if(e.version!=null&&e.version>this.lastSeenDiagnosticsVersion)this.lastSeenDiagnosticsVersion=e.version,this.clearDiagnostics();else if(e.version!=null&&e.version<=this.lastSeenDiagnosticsVersion)return;if(!this.featureOptions.diagnosticsEnabled){this.clearDiagnostics();return}const r={[Jo.DiagnosticSeverity.Error]:"error",[Jo.DiagnosticSeverity.Warning]:"warning",[Jo.DiagnosticSeverity.Information]:"info",[Jo.DiagnosticSeverity.Hint]:"info"},i=e.diagnostics.map(async({range:o,message:a,severity:u,code:l,source:c})=>{const d=(await this.requestCodeActions(o,[l]))?.map(m=>({name:"command"in m&&typeof m.command=="object"&&m.command?.title||m.title,apply:async()=>{if("edit"in m&&m.edit?.changes){const y=m.edit.changes[this.documentUri];if(!y)return;for(const b of y)this.view.dispatch(this.view.state.update({changes:{from:xs(this.view.state.doc,b.range.start),to:qn(this.view.state.doc,b.range.end),insert:b.newText}}))}"command"in m&&m.command&&FA("Executing command:",m.command)}}));return{from:xs(this.view.state.doc,o.start),to:xs(this.view.state.doc,o.end),severity:r[u??Jo.DiagnosticSeverity.Error],message:a,renderMessage:()=>{const m=document.createElement("div");return m.innerHTML=this.markdownRenderer(a),m},source:c||this.languageId,markClass:this.pluginId,actions:d}}),s=await Promise.all(i);this.view.dispatch(bR(this.view.state,s))}clearDiagnostics(){this.view.dispatch(bR(this.view.state,[]))}async requestCodeActions(e,t){return!this.featureOptions.codeActionsEnabled||!(this.client.ready&&this.client.capabilities?.codeActionProvider)?null:await this.client.textDocumentCodeAction({textDocument:{uri:this.documentUri},range:e,context:{diagnostics:[{range:e,code:t[0],source:this.languageId,message:""}]}})}async requestRename(e,{line:t,character:r}){if(this.featureOptions.renameEnabled){if(!this.client.ready){ki(e,"Language server not ready");return}if(!this.client.capabilities?.renameProvider){ki(e,"Rename not supported by language server");return}try{const i=await this.client.textDocumentPrepareRename({textDocument:{uri:this.documentUri},position:{line:t,character:r}}).catch(()=>this.prepareRenameFallback(e,{line:t,character:r}));if(!i||"defaultBehavior"in i){ki(e,"Cannot rename this symbol");return}const s=document.createElement("div");s.className="cm-rename-popup",s.style.cssText="position: absolute; padding: 4px; background: white; border: 1px solid #ddd; box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 99;";const o=document.createElement("input");o.type="text",o.style.cssText="width: 200px; padding: 4px; border: 1px solid #ddd;";const a="range"in i?i.range:i,u=qn(e.state.doc,a.start);if(u==null)return;const l=qn(e.state.doc,a.end);o.value=e.state.doc.sliceString(u,l),s.appendChild(o);const c=e.coordsAtPos(u);if(!c)return;s.style.left=`${c.left}px`,s.style.top=`${c.bottom+5}px`;const f=async()=>{const g=o.value.trim();if(!g){ki(e,"New name cannot be empty"),s.remove();return}if(g===o.defaultValue){s.remove();return}try{const m=await this.client.textDocumentRename({textDocument:{uri:this.documentUri},position:{line:t,character:r},newName:g});await this.applyRenameEdit(e,m)}catch(m){ki(e,`Rename failed: ${m instanceof Error?m.message:"Unknown error"}`)}finally{s.remove()}};o.addEventListener("keydown",g=>{g.key==="Enter"?f():g.key==="Escape"&&s.remove(),g.stopPropagation()});const d=g=>{s.contains(g.target)||(s.remove(),document.removeEventListener("mousedown",d))};document.addEventListener("mousedown",d),document.body.appendChild(s),o.focus(),o.select()}catch(i){ki(e,`Rename failed: ${i instanceof Error?i.message:"Unknown error"}`)}}}async requestSignatureHelp(e,{line:t,character:r},i=void 0){if(!(this.featureOptions.signatureHelpEnabled&&this.client.ready&&this.client.capabilities?.signatureHelpProvider))return null;try{const s=await this.client.textDocumentSignatureHelp({textDocument:{uri:this.documentUri},position:{line:t,character:r},context:{isRetrigger:!1,triggerKind:1,triggerCharacter:i}});if(!s?.signatures||s.signatures.length===0)return null;const o=this.createTooltipContainer(),a=s.activeSignature??0,u=s.signatures[a]||s.signatures[0];if(!u)return null;const l=s.activeParameter??u.activeParameter??0,c=this.createSignatureElement(u,l);o.appendChild(c),u.documentation&&o.appendChild(this.createDocumentationElement(u.documentation));const f=u.parameters?.[l];f?.documentation&&o.appendChild(this.createParameterDocElement(f.documentation));const d=qn(e.state.doc,{line:t,character:r});return d==null?null:{pos:d,end:d,create:g=>({dom:o}),above:!1}}catch(s){return console.error("Signature help error:",s),null}}async showSignatureHelpTooltip(e,t,r){const i=await this.requestSignatureHelp(e,Fa(e.state.doc,t),r);if(i){const{pos:s,create:o}=i,a=o(e),u=document.createElement("div");u.className="cm-tooltip cm-signature-tooltip",u.style.position="absolute",u.appendChild(a.dom);const l=e.coordsAtPos(s);if(l){u.style.left=`${l.left}px`,u.style.top=`${l.bottom+5}px`,document.body.appendChild(u),setTimeout(()=>{u.remove()},1e4);const c=()=>{u.remove(),e.dom.removeEventListener("keydown",c),e.dom.removeEventListener("mousedown",c)};e.dom.addEventListener("keydown",c),e.dom.addEventListener("mousedown",c)}}}createTooltipContainer(){const e=document.createElement("div");return e.classList.add("cm-signature-help"),e.style.cssText="padding: 6px; max-width: 400px;",e}createSignatureElement(e,t){const r=document.createElement("div");if(r.classList.add("cm-signature"),r.style.cssText="font-family: monospace; margin-bottom: 4px;",!e.label||typeof e.label!="string")return r.textContent="Signature information unavailable",r;const i=e.label,s=e.parameters||[];if(s.length===0||!s[t])return r.textContent=i,r;const o=s[t].label;return typeof o=="string"?this.allowHTMLContent?r.innerHTML=i.replace(o,`<strong class="cm-signature-active-param">${o}</strong>`):r.textContent=i.replace(o,`«${o}»`):Array.isArray(o)&&o.length===2?this.applyRangeHighlighting(r,i,o[0],o[1]):r.textContent=i,r}applyRangeHighlighting(e,t,r,i){e.textContent="";const s=t.substring(0,r),o=t.substring(r,i),a=t.substring(i);e.appendChild(document.createTextNode(s));const u=document.createElement("span");u.classList.add("cm-signature-active-param"),u.style.cssText="font-weight: bold; text-decoration: underline;",u.textContent=o,e.appendChild(u),e.appendChild(document.createTextNode(a))}createDocumentationElement(e){const t=document.createElement("div");t.classList.add("cm-signature-docs"),t.style.cssText="margin-top: 4px; color: #666;";const r=Ss(e,this.markdownRenderer);return this.allowHTMLContent?t.innerHTML=r:t.textContent=r,t}createParameterDocElement(e){const t=document.createElement("div");t.classList.add("cm-parameter-docs"),t.style.cssText="margin-top: 4px; font-style: italic; border-top: 1px solid #eee; padding-top: 4px;";const r=Ss(e,this.markdownRenderer);return this.allowHTMLContent?t.innerHTML=r:t.textContent=r,t}prepareRenameFallback(e,{line:t,character:r}){const s=e.state.doc.line(t+1).text,o=/\w+/g;let a,u=r,l=r;for(;(a=o.exec(s))!==null;){const c=a.index,f=a.index+a[0].length;if(r>=c&&r<=f){u=c,l=f;break}}return u===r&&l===r?null:{range:{start:{line:t,character:u},end:{line:t,character:l}},placeholder:s.slice(u,l)}}async applyRenameEdit(e,t){if(!t)return ki(e,"No edit returned from language server"),!1;const r=t.changes??{},i=t.documentChanges??[];if(Object.keys(r).length===0&&i.length===0)return ki(e,"No changes to apply"),!1;if(i.length>0)for(const s of i){if("textDocument"in s){if(s.textDocument.uri!==this.documentUri){ki(e,"Multi-file rename not supported yet");continue}const u=s.edits.sort((l,c)=>{const f=qn(e.state.doc,l.range.start);return(qn(e.state.doc,c.range.start)??0)-(f??0)}).map(l=>({from:qn(e.state.doc,l.range.start)??0,to:qn(e.state.doc,l.range.end)??0,insert:l.newText}));return e.dispatch(e.state.update({changes:u})),!0}return ki(e,"File creation, deletion, or renaming operations not supported yet"),!1}else if(Object.keys(r).length>0)for(const[s,o]of Object.entries(r)){if(s!==this.documentUri){ki(e,"Multi-file rename not supported yet");continue}const u=o.sort((l,c)=>{const f=qn(e.state.doc,l.range.start);return(qn(e.state.doc,c.range.start)??0)-(f??0)}).map(l=>({from:qn(e.state.doc,l.range.start)??0,to:qn(e.state.doc,l.range.end)??0,insert:l.newText}));e.dispatch(e.state.update({changes:u}))}return!1}}function ZZ(n){let e=null;const t={rename:"F2",goToDefinition:"F12",signatureHelp:"Mod-Shift-Space",...n.keyboardShortcuts},r=n.client,i={diagnosticsEnabled:!0,hoverEnabled:!0,completionEnabled:!0,definitionEnabled:!0,renameEnabled:!0,codeActionsEnabled:!0,signatureHelpEnabled:!0,signatureActivateOnTyping:!1,...n},s=[gn.define(o=>(e=new XZ({client:r,documentUri:n.documentUri??o.state.facet(CP),languageId:n.languageId??o.state.facet(EP),view:o,featureOptions:i,sendIncrementalChanges:n.sendIncrementalChanges,allowHTMLContent:n.allowHTMLContent,useSnippetOnCompletion:n.useSnippetOnCompletion,onGoToDefinition:n.onGoToDefinition,markdownRenderer:n.markdownRenderer}),e))];return s.push(Wc.of([{key:t.signatureHelp,run:o=>{if(!(e&&i.signatureHelpEnabled))return!1;const a=o.state.selection.main.head;return e.showSignatureHelpTooltip(o,a),!0}},{key:t.rename,run:o=>{if(!(e&&i.renameEnabled))return!1;const a=o.state.selection.main.head;return e.requestRename(o,Fa(o.state.doc,a)),!0}},{key:t.goToDefinition,run:o=>{if(!(e&&i.definitionEnabled))return!1;const a=o.state.selection.main.head;return e.requestDefinition(o,Fa(o.state.doc,a)).catch(u=>ki(o,`Go to definition failed: ${u instanceof Error?u.message:"Unknown error"}`)),!0}}])),i.hoverEnabled&&s.push(NO((o,a)=>e==null?null:e.requestHoverTooltip(o,Fa(o.state.doc,a)),n.hoverConfig)),i.signatureHelpEnabled&&s.push(Re.updateListener.of(async o=>{if(!(e&&o.docChanged)||!e.client.capabilities?.signatureHelpProvider||!i.signatureActivateOnTyping)return;const a=e.client.capabilities.signatureHelpProvider.triggerCharacters||["(",","];let u;const l=o.changes;let c=!1,f=-1;l.iterChanges((d,g,m,y,b)=>{if(c)return;const w=b.toString();if(w){for(const S of a)if(w.includes(S)){c=!0,f=y,u=S;break}}}),c&&f>=0&&e.showSignatureHelpTooltip(o.view,f,u)})),i.completionEnabled&&s.push(rY({...n.completionConfig,override:[async o=>{if(e==null)return null;const{state:a,pos:u}=o,l=QZ(o,e.client.capabilities?.completionProvider?.triggerCharacters??[],n.completionMatchBefore);return l==null?null:await e.requestCompletion(o,Fa(a.doc,u),l)},...n.completionConfig?.override||[]]})),s.push(Re.domEventHandlers({click:(o,a)=>{if(i.definitionEnabled&&t.goToDefinition==="ctrlcmd"&&(o.ctrlKey||o.metaKey)){const u=a.posAtCoords({x:o.clientX,y:o.clientY});u&&e&&(e.requestDefinition(a,Fa(a.state.doc,u)).catch(l=>ki(a,`Go to definition failed: ${l instanceof Error?l.message:"Unknown error"}`)),o.preventDefault())}}})),s}function QZ(n,e,t){const{state:r,pos:i,explicit:s}=n,o=r.doc.lineAt(i);let a=Jo.CompletionTriggerKind.Invoked,u;const l=o.text[i-o.from-1]||"",c=e?.includes(l);return!s&&c&&(a=Jo.CompletionTriggerKind.TriggerCharacter,u=l),a===Jo.CompletionTriggerKind.Invoked&&!n.matchBefore(t||/(\w+|\w+\.|\/|,)$/)?null:{triggerKind:a,triggerCharacter:u}}/**
|
|
173
|
-
* @license
|
|
174
|
-
* Copyright 2019 Google LLC
|
|
175
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
176
|
-
*/const RP=Symbol("Comlink.proxy"),eQ=Symbol("Comlink.endpoint"),tQ=Symbol("Comlink.releaseProxy"),Rb=Symbol("Comlink.finalizer"),dm=Symbol("Comlink.thrown"),AP=n=>typeof n=="object"&&n!==null||typeof n=="function",nQ={canHandle:n=>AP(n)&&n[RP],serialize(n){const{port1:e,port2:t}=new MessageChannel;return DP(n,e),[t,[t]]},deserialize(n){return n.start(),rx(n)}},rQ={canHandle:n=>AP(n)&&dm in n,serialize({value:n}){let e;return n instanceof Error?e={isError:!0,value:{message:n.message,name:n.name,stack:n.stack}}:e={isError:!1,value:n},[e,[]]},deserialize(n){throw n.isError?Object.assign(new Error(n.value.message),n.value):n.value}},ap=new Map([["proxy",nQ],["throw",rQ]]);function iQ(n,e){for(const t of n)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function DP(n,e=globalThis,t=["*"]){e.addEventListener("message",function r(i){if(!i||!i.data)return;if(!iQ(t,i.origin)){console.warn(`Invalid origin '${i.origin}' for comlink proxy`);return}const{id:s,type:o,path:a}=Object.assign({path:[]},i.data),u=(i.data.argumentList||[]).map(Hu);let l;try{const c=a.slice(0,-1).reduce((d,g)=>d[g],n),f=a.reduce((d,g)=>d[g],n);switch(o){case"GET":l=f;break;case"SET":c[a.slice(-1)[0]]=Hu(i.data.value),l=!0;break;case"APPLY":l=f.apply(c,u);break;case"CONSTRUCT":{const d=new f(...u);l=Z1(d)}break;case"ENDPOINT":{const{port1:d,port2:g}=new MessageChannel;DP(n,g),l=PP(d,[d])}break;case"RELEASE":l=void 0;break;default:return}}catch(c){l={value:c,[dm]:0}}Promise.resolve(l).catch(c=>({value:c,[dm]:0})).then(c=>{const[f,d]=f1(c);e.postMessage(Object.assign(Object.assign({},f),{id:s}),d),o==="RELEASE"&&(e.removeEventListener("message",r),TP(e),Rb in n&&typeof n[Rb]=="function"&&n[Rb]())}).catch(c=>{const[f,d]=f1({value:new TypeError("Unserializable return value"),[dm]:0});e.postMessage(Object.assign(Object.assign({},f),{id:s}),d)})}),e.start&&e.start()}function sQ(n){return n.constructor.name==="MessagePort"}function TP(n){sQ(n)&&n.close()}function rx(n,e){const t=new Map;return n.addEventListener("message",function(i){const{data:s}=i;if(!s||!s.id)return;const o=t.get(s.id);if(o)try{o(s)}finally{t.delete(s.id)}}),g2(n,t,[],e)}function rg(n){if(n)throw new Error("Proxy has been released and is not useable")}function MP(n){return rc(n,new Map,{type:"RELEASE"}).then(()=>{TP(n)})}const l1=new WeakMap,c1="FinalizationRegistry"in globalThis&&new FinalizationRegistry(n=>{const e=(l1.get(n)||0)-1;l1.set(n,e),e===0&&MP(n)});function oQ(n,e){const t=(l1.get(e)||0)+1;l1.set(e,t),c1&&c1.register(n,e,n)}function aQ(n){c1&&c1.unregister(n)}function g2(n,e,t=[],r=function(){}){let i=!1;const s=new Proxy(r,{get(o,a){if(rg(i),a===tQ)return()=>{aQ(s),MP(n),e.clear(),i=!0};if(a==="then"){if(t.length===0)return{then:()=>s};const u=rc(n,e,{type:"GET",path:t.map(l=>l.toString())}).then(Hu);return u.then.bind(u)}return g2(n,e,[...t,a])},set(o,a,u){rg(i);const[l,c]=f1(u);return rc(n,e,{type:"SET",path:[...t,a].map(f=>f.toString()),value:l},c).then(Hu)},apply(o,a,u){rg(i);const l=t[t.length-1];if(l===eQ)return rc(n,e,{type:"ENDPOINT"}).then(Hu);if(l==="bind")return g2(n,e,t.slice(0,-1));const[c,f]=NA(u);return rc(n,e,{type:"APPLY",path:t.map(d=>d.toString()),argumentList:c},f).then(Hu)},construct(o,a){rg(i);const[u,l]=NA(a);return rc(n,e,{type:"CONSTRUCT",path:t.map(c=>c.toString()),argumentList:u},l).then(Hu)}});return oQ(s,n),s}function uQ(n){return Array.prototype.concat.apply([],n)}function NA(n){const e=n.map(f1);return[e.map(t=>t[0]),uQ(e.map(t=>t[1]))]}const OP=new WeakMap;function PP(n,e){return OP.set(n,e),n}function Z1(n){return Object.assign(n,{[RP]:!0})}function f1(n){for(const[e,t]of ap)if(t.canHandle(n)){const[r,i]=t.serialize(n);return[{type:"HANDLER",name:e,value:r},i]}return[{type:"RAW",value:n},OP.get(n)||[]]}function Hu(n){switch(n.type){case"HANDLER":return ap.get(n.name).deserialize(n.value);case"RAW":return n.value}}function rc(n,e,t,r){return new Promise(i=>{const s=lQ();e.set(s,i),n.start&&n.start(),n.postMessage(Object.assign({id:s},t),r)})}function lQ(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var cQ=Kc();const BA=n=>n.request.id===void 0||n.request.id===null,fQ=n=>n instanceof Array?n.filter(e=>BA(e.request)).map(e=>e.request):BA(n)?[n]:[];class hQ extends cQ.Transport{constructor(e){super(),this.port=e,this.postMessageID=`post-message-transport-${Math.random()}`}postMessageID;messageHandler=e=>{console.debug("LSP <<-",e.data),!e.data.result&&e.data.method!=="textDocument/publishDiagnostics"?console.debug(e.data):this.transportRequestManager.resolveResponse(JSON.stringify(e.data))};connect(){return new Promise(async e=>{this.port.addEventListener("message",this.messageHandler),e()})}async sendData(e){console.debug("LSP ->>",e);const t=this.transportRequestManager.addRequest(e,null),r=fQ(e);return this.port&&(this.port.postMessage(e.request),this.transportRequestManager.settlePendingRequest(r)),t}close(){}}const qA={};function dQ(n){let e=qA[n];if(e)return e;e=qA[n]=[];for(let t=0;t<128;t++){const r=String.fromCharCode(t);e.push(r)}for(let t=0;t<n.length;t++){const r=n.charCodeAt(t);e[r]="%"+("0"+r.toString(16).toUpperCase()).slice(-2)}return e}function Ic(n,e){typeof e!="string"&&(e=Ic.defaultChars);const t=dQ(e);return n.replace(/(%[a-f0-9]{2})+/gi,function(r){let i="";for(let s=0,o=r.length;s<o;s+=3){const a=parseInt(r.slice(s+1,s+3),16);if(a<128){i+=t[a];continue}if((a&224)===192&&s+3<o){const u=parseInt(r.slice(s+4,s+6),16);if((u&192)===128){const l=a<<6&1984|u&63;l<128?i+="��":i+=String.fromCharCode(l),s+=3;continue}}if((a&240)===224&&s+6<o){const u=parseInt(r.slice(s+4,s+6),16),l=parseInt(r.slice(s+7,s+9),16);if((u&192)===128&&(l&192)===128){const c=a<<12&61440|u<<6&4032|l&63;c<2048||c>=55296&&c<=57343?i+="���":i+=String.fromCharCode(c),s+=6;continue}}if((a&248)===240&&s+9<o){const u=parseInt(r.slice(s+4,s+6),16),l=parseInt(r.slice(s+7,s+9),16),c=parseInt(r.slice(s+10,s+12),16);if((u&192)===128&&(l&192)===128&&(c&192)===128){let f=a<<18&1835008|u<<12&258048|l<<6&4032|c&63;f<65536||f>1114111?i+="����":(f-=65536,i+=String.fromCharCode(55296+(f>>10),56320+(f&1023))),s+=9;continue}}i+="�"}return i})}Ic.defaultChars=";/?:@&=+$,#";Ic.componentChars="";const jA={};function pQ(n){let e=jA[n];if(e)return e;e=jA[n]=[];for(let t=0;t<128;t++){const r=String.fromCharCode(t);/^[0-9a-z]$/i.test(r)?e.push(r):e.push("%"+("0"+t.toString(16).toUpperCase()).slice(-2))}for(let t=0;t<n.length;t++)e[n.charCodeAt(t)]=n[t];return e}function up(n,e,t){typeof e!="string"&&(t=e,e=up.defaultChars),typeof t>"u"&&(t=!0);const r=pQ(e);let i="";for(let s=0,o=n.length;s<o;s++){const a=n.charCodeAt(s);if(t&&a===37&&s+2<o&&/^[0-9a-f]{2}$/i.test(n.slice(s+1,s+3))){i+=n.slice(s,s+3),s+=2;continue}if(a<128){i+=r[a];continue}if(a>=55296&&a<=57343){if(a>=55296&&a<=56319&&s+1<o){const u=n.charCodeAt(s+1);if(u>=56320&&u<=57343){i+=encodeURIComponent(n[s]+n[s+1]),s++;continue}}i+="%EF%BF%BD";continue}i+=encodeURIComponent(n[s])}return i}up.defaultChars=";/?:@&=+$,-_.!~*'()#";up.componentChars="-_.!~*'()";function ix(n){let e="";return e+=n.protocol||"",e+=n.slashes?"//":"",e+=n.auth?n.auth+"@":"",n.hostname&&n.hostname.indexOf(":")!==-1?e+="["+n.hostname+"]":e+=n.hostname||"",e+=n.port?":"+n.port:"",e+=n.pathname||"",e+=n.search||"",e+=n.hash||"",e}function h1(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}const gQ=/^([a-z0-9.+-]+:)/i,mQ=/:[0-9]*$/,vQ=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,yQ=["<",">",'"',"`"," ","\r",`
|
|
177
|
-
`," "],bQ=["{","}","|","\\","^","`"].concat(yQ),wQ=["'"].concat(bQ),$A=["%","/","?",";","#"].concat(wQ),WA=["/","?","#"],_Q=255,zA=/^[+a-z0-9A-Z_-]{0,63}$/,kQ=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,UA={javascript:!0,"javascript:":!0},HA={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function sx(n,e){if(n&&n instanceof h1)return n;const t=new h1;return t.parse(n,e),t}h1.prototype.parse=function(n,e){let t,r,i,s=n;if(s=s.trim(),!e&&n.split("#").length===1){const l=vQ.exec(s);if(l)return this.pathname=l[1],l[2]&&(this.search=l[2]),this}let o=gQ.exec(s);if(o&&(o=o[0],t=o.toLowerCase(),this.protocol=o,s=s.substr(o.length)),(e||o||s.match(/^\/\/[^@\/]+@[^@\/]+/))&&(i=s.substr(0,2)==="//",i&&!(o&&UA[o])&&(s=s.substr(2),this.slashes=!0)),!UA[o]&&(i||o&&!HA[o])){let l=-1;for(let m=0;m<WA.length;m++)r=s.indexOf(WA[m]),r!==-1&&(l===-1||r<l)&&(l=r);let c,f;l===-1?f=s.lastIndexOf("@"):f=s.lastIndexOf("@",l),f!==-1&&(c=s.slice(0,f),s=s.slice(f+1),this.auth=c),l=-1;for(let m=0;m<$A.length;m++)r=s.indexOf($A[m]),r!==-1&&(l===-1||r<l)&&(l=r);l===-1&&(l=s.length),s[l-1]===":"&&l--;const d=s.slice(0,l);s=s.slice(l),this.parseHost(d),this.hostname=this.hostname||"";const g=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!g){const m=this.hostname.split(/\./);for(let y=0,b=m.length;y<b;y++){const w=m[y];if(w&&!w.match(zA)){let S="";for(let k=0,x=w.length;k<x;k++)w.charCodeAt(k)>127?S+="x":S+=w[k];if(!S.match(zA)){const k=m.slice(0,y),x=m.slice(y+1),C=w.match(kQ);C&&(k.push(C[1]),x.unshift(C[2])),x.length&&(s=x.join(".")+s),this.hostname=k.join(".");break}}}}this.hostname.length>_Q&&(this.hostname=""),g&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}const a=s.indexOf("#");a!==-1&&(this.hash=s.substr(a),s=s.slice(0,a));const u=s.indexOf("?");return u!==-1&&(this.search=s.substr(u),s=s.slice(0,u)),s&&(this.pathname=s),HA[t]&&this.hostname&&!this.pathname&&(this.pathname=""),this};h1.prototype.parseHost=function(n){let e=mQ.exec(n);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),n=n.substr(0,n.length-e.length)),n&&(this.hostname=n)};const xQ=Object.freeze(Object.defineProperty({__proto__:null,decode:Ic,encode:up,format:ix,parse:sx},Symbol.toStringTag,{value:"Module"})),IP=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,LP=/[\0-\x1F\x7F-\x9F]/,SQ=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/,ox=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/,FP=/[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/,NP=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/,CQ=Object.freeze(Object.defineProperty({__proto__:null,Any:IP,Cc:LP,Cf:SQ,P:ox,S:FP,Z:NP},Symbol.toStringTag,{value:"Module"})),EQ=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(n=>n.charCodeAt(0))),RQ=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(n=>n.charCodeAt(0)));var Ab;const AQ=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]),DQ=(Ab=String.fromCodePoint)!==null&&Ab!==void 0?Ab:function(n){let e="";return n>65535&&(n-=65536,e+=String.fromCharCode(n>>>10&1023|55296),n=56320|n&1023),e+=String.fromCharCode(n),e};function TQ(n){var e;return n>=55296&&n<=57343||n>1114111?65533:(e=AQ.get(n))!==null&&e!==void 0?e:n}var Wn;(function(n){n[n.NUM=35]="NUM",n[n.SEMI=59]="SEMI",n[n.EQUALS=61]="EQUALS",n[n.ZERO=48]="ZERO",n[n.NINE=57]="NINE",n[n.LOWER_A=97]="LOWER_A",n[n.LOWER_F=102]="LOWER_F",n[n.LOWER_X=120]="LOWER_X",n[n.LOWER_Z=122]="LOWER_Z",n[n.UPPER_A=65]="UPPER_A",n[n.UPPER_F=70]="UPPER_F",n[n.UPPER_Z=90]="UPPER_Z"})(Wn||(Wn={}));const MQ=32;var za;(function(n){n[n.VALUE_LENGTH=49152]="VALUE_LENGTH",n[n.BRANCH_LENGTH=16256]="BRANCH_LENGTH",n[n.JUMP_TABLE=127]="JUMP_TABLE"})(za||(za={}));function m2(n){return n>=Wn.ZERO&&n<=Wn.NINE}function OQ(n){return n>=Wn.UPPER_A&&n<=Wn.UPPER_F||n>=Wn.LOWER_A&&n<=Wn.LOWER_F}function PQ(n){return n>=Wn.UPPER_A&&n<=Wn.UPPER_Z||n>=Wn.LOWER_A&&n<=Wn.LOWER_Z||m2(n)}function IQ(n){return n===Wn.EQUALS||PQ(n)}var jn;(function(n){n[n.EntityStart=0]="EntityStart",n[n.NumericStart=1]="NumericStart",n[n.NumericDecimal=2]="NumericDecimal",n[n.NumericHex=3]="NumericHex",n[n.NamedEntity=4]="NamedEntity"})(jn||(jn={}));var Na;(function(n){n[n.Legacy=0]="Legacy",n[n.Strict=1]="Strict",n[n.Attribute=2]="Attribute"})(Na||(Na={}));class LQ{constructor(e,t,r){this.decodeTree=e,this.emitCodePoint=t,this.errors=r,this.state=jn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=Na.Strict}startEntity(e){this.decodeMode=e,this.state=jn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case jn.EntityStart:return e.charCodeAt(t)===Wn.NUM?(this.state=jn.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=jn.NamedEntity,this.stateNamedEntity(e,t));case jn.NumericStart:return this.stateNumericStart(e,t);case jn.NumericDecimal:return this.stateNumericDecimal(e,t);case jn.NumericHex:return this.stateNumericHex(e,t);case jn.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|MQ)===Wn.LOWER_X?(this.state=jn.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=jn.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,r,i){if(t!==r){const s=r-t;this.result=this.result*Math.pow(i,s)+parseInt(e.substr(t,s),i),this.consumed+=s}}stateNumericHex(e,t){const r=t;for(;t<e.length;){const i=e.charCodeAt(t);if(m2(i)||OQ(i))t+=1;else return this.addToNumericResult(e,r,t,16),this.emitNumericEntity(i,3)}return this.addToNumericResult(e,r,t,16),-1}stateNumericDecimal(e,t){const r=t;for(;t<e.length;){const i=e.charCodeAt(t);if(m2(i))t+=1;else return this.addToNumericResult(e,r,t,10),this.emitNumericEntity(i,2)}return this.addToNumericResult(e,r,t,10),-1}emitNumericEntity(e,t){var r;if(this.consumed<=t)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===Wn.SEMI)this.consumed+=1;else if(this.decodeMode===Na.Strict)return 0;return this.emitCodePoint(TQ(this.result),this.consumed),this.errors&&(e!==Wn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){const{decodeTree:r}=this;let i=r[this.treeIndex],s=(i&za.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){const o=e.charCodeAt(t);if(this.treeIndex=FQ(r,i,this.treeIndex+Math.max(1,s),o),this.treeIndex<0)return this.result===0||this.decodeMode===Na.Attribute&&(s===0||IQ(o))?0:this.emitNotTerminatedNamedEntity();if(i=r[this.treeIndex],s=(i&za.VALUE_LENGTH)>>14,s!==0){if(o===Wn.SEMI)return this.emitNamedEntityData(this.treeIndex,s,this.consumed+this.excess);this.decodeMode!==Na.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:t,decodeTree:r}=this,i=(r[t]&za.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,i,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,r){const{decodeTree:i}=this;return this.emitCodePoint(t===1?i[e]&~za.VALUE_LENGTH:i[e+1],r),t===3&&this.emitCodePoint(i[e+2],r),r}end(){var e;switch(this.state){case jn.NamedEntity:return this.result!==0&&(this.decodeMode!==Na.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case jn.NumericDecimal:return this.emitNumericEntity(0,2);case jn.NumericHex:return this.emitNumericEntity(0,3);case jn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case jn.EntityStart:return 0}}}function BP(n){let e="";const t=new LQ(n,r=>e+=DQ(r));return function(i,s){let o=0,a=0;for(;(a=i.indexOf("&",a))>=0;){e+=i.slice(o,a),t.startEntity(s);const l=t.write(i,a+1);if(l<0){o=a+t.end();break}o=a+l,a=l===0?o+1:o}const u=e+i.slice(o);return e="",u}}function FQ(n,e,t,r){const i=(e&za.BRANCH_LENGTH)>>7,s=e&za.JUMP_TABLE;if(i===0)return s!==0&&r===s?t:-1;if(s){const u=r-s;return u<0||u>=i?-1:n[t+u]-1}let o=t,a=o+i-1;for(;o<=a;){const u=o+a>>>1,l=n[u];if(l<r)o=u+1;else if(l>r)a=u-1;else return n[u+i]}return-1}const NQ=BP(EQ);BP(RQ);function qP(n,e=Na.Legacy){return NQ(n,e)}function BQ(n){return Object.prototype.toString.call(n)}function ax(n){return BQ(n)==="[object String]"}const qQ=Object.prototype.hasOwnProperty;function jQ(n,e){return qQ.call(n,e)}function Q1(n){return Array.prototype.slice.call(arguments,1).forEach(function(t){if(t){if(typeof t!="object")throw new TypeError(t+"must be object");Object.keys(t).forEach(function(r){n[r]=t[r]})}}),n}function jP(n,e,t){return[].concat(n.slice(0,e),t,n.slice(e+1))}function ux(n){return!(n>=55296&&n<=57343||n>=64976&&n<=65007||(n&65535)===65535||(n&65535)===65534||n>=0&&n<=8||n===11||n>=14&&n<=31||n>=127&&n<=159||n>1114111)}function d1(n){if(n>65535){n-=65536;const e=55296+(n>>10),t=56320+(n&1023);return String.fromCharCode(e,t)}return String.fromCharCode(n)}const $P=/\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g,$Q=/&([a-z#][a-z0-9]{1,31});/gi,WQ=new RegExp($P.source+"|"+$Q.source,"gi"),zQ=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;function UQ(n,e){if(e.charCodeAt(0)===35&&zQ.test(e)){const r=e[1].toLowerCase()==="x"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return ux(r)?d1(r):n}const t=qP(n);return t!==n?t:n}function HQ(n){return n.indexOf("\\")<0?n:n.replace($P,"$1")}function Lc(n){return n.indexOf("\\")<0&&n.indexOf("&")<0?n:n.replace(WQ,function(e,t,r){return t||UQ(e,r)})}const VQ=/[&<>"]/,GQ=/[&<>"]/g,KQ={"&":"&","<":"<",">":">",'"':"""};function JQ(n){return KQ[n]}function ru(n){return VQ.test(n)?n.replace(GQ,JQ):n}const YQ=/[.?*+^$[\]\\(){}|-]/g;function XQ(n){return n.replace(YQ,"\\$&")}function Gt(n){switch(n){case 9:case 32:return!0}return!1}function Ld(n){if(n>=8192&&n<=8202)return!0;switch(n){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}function Fd(n){return ox.test(n)||FP.test(n)}function Nd(n){switch(n){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function ev(n){return n=n.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(n=n.replace(/ẞ/g,"ß")),n.toLowerCase().toUpperCase()}const ZQ={mdurl:xQ,ucmicro:CQ},QQ=Object.freeze(Object.defineProperty({__proto__:null,arrayReplaceAt:jP,assign:Q1,escapeHtml:ru,escapeRE:XQ,fromCodePoint:d1,has:jQ,isMdAsciiPunct:Nd,isPunctChar:Fd,isSpace:Gt,isString:ax,isValidEntityCode:ux,isWhiteSpace:Ld,lib:ZQ,normalizeReference:ev,unescapeAll:Lc,unescapeMd:HQ},Symbol.toStringTag,{value:"Module"}));function eee(n,e,t){let r,i,s,o;const a=n.posMax,u=n.pos;for(n.pos=e+1,r=1;n.pos<a;){if(s=n.src.charCodeAt(n.pos),s===93&&(r--,r===0)){i=!0;break}if(o=n.pos,n.md.inline.skipToken(n),s===91){if(o===n.pos-1)r++;else if(t)return n.pos=u,-1}}let l=-1;return i&&(l=n.pos),n.pos=u,l}function tee(n,e,t){let r,i=e;const s={ok:!1,pos:0,str:""};if(n.charCodeAt(i)===60){for(i++;i<t;){if(r=n.charCodeAt(i),r===10||r===60)return s;if(r===62)return s.pos=i+1,s.str=Lc(n.slice(e+1,i)),s.ok=!0,s;if(r===92&&i+1<t){i+=2;continue}i++}return s}let o=0;for(;i<t&&(r=n.charCodeAt(i),!(r===32||r<32||r===127));){if(r===92&&i+1<t){if(n.charCodeAt(i+1)===32)break;i+=2;continue}if(r===40&&(o++,o>32))return s;if(r===41){if(o===0)break;o--}i++}return e===i||o!==0||(s.str=Lc(n.slice(e,i)),s.pos=i,s.ok=!0),s}function nee(n,e,t,r){let i,s=e;const o={ok:!1,can_continue:!1,pos:0,str:"",marker:0};if(r)o.str=r.str,o.marker=r.marker;else{if(s>=t)return o;let a=n.charCodeAt(s);if(a!==34&&a!==39&&a!==40)return o;e++,s++,a===40&&(a=41),o.marker=a}for(;s<t;){if(i=n.charCodeAt(s),i===o.marker)return o.pos=s+1,o.str+=Lc(n.slice(e,s)),o.ok=!0,o;if(i===40&&o.marker===41)return o;i===92&&s+1<t&&s++,s++}return o.can_continue=!0,o.str+=Lc(n.slice(e,s)),o}const ree=Object.freeze(Object.defineProperty({__proto__:null,parseLinkDestination:tee,parseLinkLabel:eee,parseLinkTitle:nee},Symbol.toStringTag,{value:"Module"})),wo={};wo.code_inline=function(n,e,t,r,i){const s=n[e];return"<code"+i.renderAttrs(s)+">"+ru(s.content)+"</code>"};wo.code_block=function(n,e,t,r,i){const s=n[e];return"<pre"+i.renderAttrs(s)+"><code>"+ru(n[e].content)+`</code></pre>
|
|
178
|
-
`};wo.fence=function(n,e,t,r,i){const s=n[e],o=s.info?Lc(s.info).trim():"";let a="",u="";if(o){const c=o.split(/(\s+)/g);a=c[0],u=c.slice(2).join("")}let l;if(t.highlight?l=t.highlight(s.content,a,u)||ru(s.content):l=ru(s.content),l.indexOf("<pre")===0)return l+`
|
|
179
|
-
`;if(o){const c=s.attrIndex("class"),f=s.attrs?s.attrs.slice():[];c<0?f.push(["class",t.langPrefix+a]):(f[c]=f[c].slice(),f[c][1]+=" "+t.langPrefix+a);const d={attrs:f};return`<pre><code${i.renderAttrs(d)}>${l}</code></pre>
|
|
180
|
-
`}return`<pre><code${i.renderAttrs(s)}>${l}</code></pre>
|
|
181
|
-
`};wo.image=function(n,e,t,r,i){const s=n[e];return s.attrs[s.attrIndex("alt")][1]=i.renderInlineAsText(s.children,t,r),i.renderToken(n,e,t)};wo.hardbreak=function(n,e,t){return t.xhtmlOut?`<br />
|
|
182
|
-
`:`<br>
|
|
183
|
-
`};wo.softbreak=function(n,e,t){return t.breaks?t.xhtmlOut?`<br />
|
|
184
|
-
`:`<br>
|
|
185
|
-
`:`
|
|
186
|
-
`};wo.text=function(n,e){return ru(n[e].content)};wo.html_block=function(n,e){return n[e].content};wo.html_inline=function(n,e){return n[e].content};function Xc(){this.rules=Q1({},wo)}Xc.prototype.renderAttrs=function(e){let t,r,i;if(!e.attrs)return"";for(i="",t=0,r=e.attrs.length;t<r;t++)i+=" "+ru(e.attrs[t][0])+'="'+ru(e.attrs[t][1])+'"';return i};Xc.prototype.renderToken=function(e,t,r){const i=e[t];let s="";if(i.hidden)return"";i.block&&i.nesting!==-1&&t&&e[t-1].hidden&&(s+=`
|
|
187
|
-
`),s+=(i.nesting===-1?"</":"<")+i.tag,s+=this.renderAttrs(i),i.nesting===0&&r.xhtmlOut&&(s+=" /");let o=!1;if(i.block&&(o=!0,i.nesting===1&&t+1<e.length)){const a=e[t+1];(a.type==="inline"||a.hidden||a.nesting===-1&&a.tag===i.tag)&&(o=!1)}return s+=o?`>
|
|
188
|
-
`:">",s};Xc.prototype.renderInline=function(n,e,t){let r="";const i=this.rules;for(let s=0,o=n.length;s<o;s++){const a=n[s].type;typeof i[a]<"u"?r+=i[a](n,s,e,t,this):r+=this.renderToken(n,s,e)}return r};Xc.prototype.renderInlineAsText=function(n,e,t){let r="";for(let i=0,s=n.length;i<s;i++)switch(n[i].type){case"text":r+=n[i].content;break;case"image":r+=this.renderInlineAsText(n[i].children,e,t);break;case"html_inline":case"html_block":r+=n[i].content;break;case"softbreak":case"hardbreak":r+=`
|
|
189
|
-
`;break}return r};Xc.prototype.render=function(n,e,t){let r="";const i=this.rules;for(let s=0,o=n.length;s<o;s++){const a=n[s].type;a==="inline"?r+=this.renderInline(n[s].children,e,t):typeof i[a]<"u"?r+=i[a](n,s,e,t,this):r+=this.renderToken(n,s,e,t)}return r};function li(){this.__rules__=[],this.__cache__=null}li.prototype.__find__=function(n){for(let e=0;e<this.__rules__.length;e++)if(this.__rules__[e].name===n)return e;return-1};li.prototype.__compile__=function(){const n=this,e=[""];n.__rules__.forEach(function(t){t.enabled&&t.alt.forEach(function(r){e.indexOf(r)<0&&e.push(r)})}),n.__cache__={},e.forEach(function(t){n.__cache__[t]=[],n.__rules__.forEach(function(r){r.enabled&&(t&&r.alt.indexOf(t)<0||n.__cache__[t].push(r.fn))})})};li.prototype.at=function(n,e,t){const r=this.__find__(n),i=t||{};if(r===-1)throw new Error("Parser rule not found: "+n);this.__rules__[r].fn=e,this.__rules__[r].alt=i.alt||[],this.__cache__=null};li.prototype.before=function(n,e,t,r){const i=this.__find__(n),s=r||{};if(i===-1)throw new Error("Parser rule not found: "+n);this.__rules__.splice(i,0,{name:e,enabled:!0,fn:t,alt:s.alt||[]}),this.__cache__=null};li.prototype.after=function(n,e,t,r){const i=this.__find__(n),s=r||{};if(i===-1)throw new Error("Parser rule not found: "+n);this.__rules__.splice(i+1,0,{name:e,enabled:!0,fn:t,alt:s.alt||[]}),this.__cache__=null};li.prototype.push=function(n,e,t){const r=t||{};this.__rules__.push({name:n,enabled:!0,fn:e,alt:r.alt||[]}),this.__cache__=null};li.prototype.enable=function(n,e){Array.isArray(n)||(n=[n]);const t=[];return n.forEach(function(r){const i=this.__find__(r);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!0,t.push(r)},this),this.__cache__=null,t};li.prototype.enableOnly=function(n,e){Array.isArray(n)||(n=[n]),this.__rules__.forEach(function(t){t.enabled=!1}),this.enable(n,e)};li.prototype.disable=function(n,e){Array.isArray(n)||(n=[n]);const t=[];return n.forEach(function(r){const i=this.__find__(r);if(i<0){if(e)return;throw new Error("Rules manager: invalid rule name "+r)}this.__rules__[i].enabled=!1,t.push(r)},this),this.__cache__=null,t};li.prototype.getRules=function(n){return this.__cache__===null&&this.__compile__(),this.__cache__[n]||[]};function Ds(n,e,t){this.type=n,this.tag=e,this.attrs=null,this.map=null,this.nesting=t,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}Ds.prototype.attrIndex=function(e){if(!this.attrs)return-1;const t=this.attrs;for(let r=0,i=t.length;r<i;r++)if(t[r][0]===e)return r;return-1};Ds.prototype.attrPush=function(e){this.attrs?this.attrs.push(e):this.attrs=[e]};Ds.prototype.attrSet=function(e,t){const r=this.attrIndex(e),i=[e,t];r<0?this.attrPush(i):this.attrs[r]=i};Ds.prototype.attrGet=function(e){const t=this.attrIndex(e);let r=null;return t>=0&&(r=this.attrs[t][1]),r};Ds.prototype.attrJoin=function(e,t){const r=this.attrIndex(e);r<0?this.attrPush([e,t]):this.attrs[r][1]=this.attrs[r][1]+" "+t};function WP(n,e,t){this.src=n,this.env=t,this.tokens=[],this.inlineMode=!1,this.md=e}WP.prototype.Token=Ds;const iee=/\r\n?|\n/g,see=/\0/g;function oee(n){let e;e=n.src.replace(iee,`
|
|
190
|
-
`),e=e.replace(see,"�"),n.src=e}function aee(n){let e;n.inlineMode?(e=new n.Token("inline","",0),e.content=n.src,e.map=[0,1],e.children=[],n.tokens.push(e)):n.md.block.parse(n.src,n.md,n.env,n.tokens)}function uee(n){const e=n.tokens;for(let t=0,r=e.length;t<r;t++){const i=e[t];i.type==="inline"&&n.md.inline.parse(i.content,n.md,n.env,i.children)}}function lee(n){return/^<a[>\s]/i.test(n)}function cee(n){return/^<\/a\s*>/i.test(n)}function fee(n){const e=n.tokens;if(n.md.options.linkify)for(let t=0,r=e.length;t<r;t++){if(e[t].type!=="inline"||!n.md.linkify.pretest(e[t].content))continue;let i=e[t].children,s=0;for(let o=i.length-1;o>=0;o--){const a=i[o];if(a.type==="link_close"){for(o--;i[o].level!==a.level&&i[o].type!=="link_open";)o--;continue}if(a.type==="html_inline"&&(lee(a.content)&&s>0&&s--,cee(a.content)&&s++),!(s>0)&&a.type==="text"&&n.md.linkify.test(a.content)){const u=a.content;let l=n.md.linkify.match(u);const c=[];let f=a.level,d=0;l.length>0&&l[0].index===0&&o>0&&i[o-1].type==="text_special"&&(l=l.slice(1));for(let g=0;g<l.length;g++){const m=l[g].url,y=n.md.normalizeLink(m);if(!n.md.validateLink(y))continue;let b=l[g].text;l[g].schema?l[g].schema==="mailto:"&&!/^mailto:/i.test(b)?b=n.md.normalizeLinkText("mailto:"+b).replace(/^mailto:/,""):b=n.md.normalizeLinkText(b):b=n.md.normalizeLinkText("http://"+b).replace(/^http:\/\//,"");const w=l[g].index;if(w>d){const C=new n.Token("text","",0);C.content=u.slice(d,w),C.level=f,c.push(C)}const S=new n.Token("link_open","a",1);S.attrs=[["href",y]],S.level=f++,S.markup="linkify",S.info="auto",c.push(S);const k=new n.Token("text","",0);k.content=b,k.level=f,c.push(k);const x=new n.Token("link_close","a",-1);x.level=--f,x.markup="linkify",x.info="auto",c.push(x),d=l[g].lastIndex}if(d<u.length){const g=new n.Token("text","",0);g.content=u.slice(d),g.level=f,c.push(g)}e[t].children=i=jP(i,o,c)}}}}const zP=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,hee=/\((c|tm|r)\)/i,dee=/\((c|tm|r)\)/ig,pee={c:"©",r:"®",tm:"™"};function gee(n,e){return pee[e.toLowerCase()]}function mee(n){let e=0;for(let t=n.length-1;t>=0;t--){const r=n[t];r.type==="text"&&!e&&(r.content=r.content.replace(dee,gee)),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function vee(n){let e=0;for(let t=n.length-1;t>=0;t--){const r=n[t];r.type==="text"&&!e&&zP.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),r.type==="link_open"&&r.info==="auto"&&e--,r.type==="link_close"&&r.info==="auto"&&e++}}function yee(n){let e;if(n.md.options.typographer)for(e=n.tokens.length-1;e>=0;e--)n.tokens[e].type==="inline"&&(hee.test(n.tokens[e].content)&&mee(n.tokens[e].children),zP.test(n.tokens[e].content)&&vee(n.tokens[e].children))}const bee=/['"]/,VA=/['"]/g,GA="’";function ig(n,e,t){return n.slice(0,e)+t+n.slice(e+1)}function wee(n,e){let t;const r=[];for(let i=0;i<n.length;i++){const s=n[i],o=n[i].level;for(t=r.length-1;t>=0&&!(r[t].level<=o);t--);if(r.length=t+1,s.type!=="text")continue;let a=s.content,u=0,l=a.length;e:for(;u<l;){VA.lastIndex=u;const c=VA.exec(a);if(!c)break;let f=!0,d=!0;u=c.index+1;const g=c[0]==="'";let m=32;if(c.index-1>=0)m=a.charCodeAt(c.index-1);else for(t=i-1;t>=0&&!(n[t].type==="softbreak"||n[t].type==="hardbreak");t--)if(n[t].content){m=n[t].content.charCodeAt(n[t].content.length-1);break}let y=32;if(u<l)y=a.charCodeAt(u);else for(t=i+1;t<n.length&&!(n[t].type==="softbreak"||n[t].type==="hardbreak");t++)if(n[t].content){y=n[t].content.charCodeAt(0);break}const b=Nd(m)||Fd(String.fromCharCode(m)),w=Nd(y)||Fd(String.fromCharCode(y)),S=Ld(m),k=Ld(y);if(k?f=!1:w&&(S||b||(f=!1)),S?d=!1:b&&(k||w||(d=!1)),y===34&&c[0]==='"'&&m>=48&&m<=57&&(d=f=!1),f&&d&&(f=b,d=w),!f&&!d){g&&(s.content=ig(s.content,c.index,GA));continue}if(d)for(t=r.length-1;t>=0;t--){let x=r[t];if(r[t].level<o)break;if(x.single===g&&r[t].level===o){x=r[t];let C,R;g?(C=e.md.options.quotes[2],R=e.md.options.quotes[3]):(C=e.md.options.quotes[0],R=e.md.options.quotes[1]),s.content=ig(s.content,c.index,R),n[x.token].content=ig(n[x.token].content,x.pos,C),u+=R.length-1,x.token===i&&(u+=C.length-1),a=s.content,l=a.length,r.length=t;continue e}}f?r.push({token:i,pos:c.index,single:g,level:o}):d&&g&&(s.content=ig(s.content,c.index,GA))}}}function _ee(n){if(n.md.options.typographer)for(let e=n.tokens.length-1;e>=0;e--)n.tokens[e].type!=="inline"||!bee.test(n.tokens[e].content)||wee(n.tokens[e].children,n)}function kee(n){let e,t;const r=n.tokens,i=r.length;for(let s=0;s<i;s++){if(r[s].type!=="inline")continue;const o=r[s].children,a=o.length;for(e=0;e<a;e++)o[e].type==="text_special"&&(o[e].type="text");for(e=t=0;e<a;e++)o[e].type==="text"&&e+1<a&&o[e+1].type==="text"?o[e+1].content=o[e].content+o[e+1].content:(e!==t&&(o[t]=o[e]),t++);e!==t&&(o.length=t)}}const Db=[["normalize",oee],["block",aee],["inline",uee],["linkify",fee],["replacements",yee],["smartquotes",_ee],["text_join",kee]];function lx(){this.ruler=new li;for(let n=0;n<Db.length;n++)this.ruler.push(Db[n][0],Db[n][1])}lx.prototype.process=function(n){const e=this.ruler.getRules("");for(let t=0,r=e.length;t<r;t++)e[t](n)};lx.prototype.State=WP;function _o(n,e,t,r){this.src=n,this.md=e,this.env=t,this.tokens=r,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0;const i=this.src;for(let s=0,o=0,a=0,u=0,l=i.length,c=!1;o<l;o++){const f=i.charCodeAt(o);if(!c)if(Gt(f)){a++,f===9?u+=4-u%4:u++;continue}else c=!0;(f===10||o===l-1)&&(f!==10&&o++,this.bMarks.push(s),this.eMarks.push(o),this.tShift.push(a),this.sCount.push(u),this.bsCount.push(0),c=!1,a=0,u=0,s=o+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}_o.prototype.push=function(n,e,t){const r=new Ds(n,e,t);return r.block=!0,t<0&&this.level--,r.level=this.level,t>0&&this.level++,this.tokens.push(r),r};_o.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]};_o.prototype.skipEmptyLines=function(e){for(let t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e};_o.prototype.skipSpaces=function(e){for(let t=this.src.length;e<t;e++){const r=this.src.charCodeAt(e);if(!Gt(r))break}return e};_o.prototype.skipSpacesBack=function(e,t){if(e<=t)return e;for(;e>t;)if(!Gt(this.src.charCodeAt(--e)))return e+1;return e};_o.prototype.skipChars=function(e,t){for(let r=this.src.length;e<r&&this.src.charCodeAt(e)===t;e++);return e};_o.prototype.skipCharsBack=function(e,t,r){if(e<=r)return e;for(;e>r;)if(t!==this.src.charCodeAt(--e))return e+1;return e};_o.prototype.getLines=function(e,t,r,i){if(e>=t)return"";const s=new Array(t-e);for(let o=0,a=e;a<t;a++,o++){let u=0;const l=this.bMarks[a];let c=l,f;for(a+1<t||i?f=this.eMarks[a]+1:f=this.eMarks[a];c<f&&u<r;){const d=this.src.charCodeAt(c);if(Gt(d))d===9?u+=4-(u+this.bsCount[a])%4:u++;else if(c-l<this.tShift[a])u++;else break;c++}u>r?s[o]=new Array(u-r+1).join(" ")+this.src.slice(c,f):s[o]=this.src.slice(c,f)}return s.join("")};_o.prototype.Token=Ds;const xee=65536;function Tb(n,e){const t=n.bMarks[e]+n.tShift[e],r=n.eMarks[e];return n.src.slice(t,r)}function KA(n){const e=[],t=n.length;let r=0,i=n.charCodeAt(r),s=!1,o=0,a="";for(;r<t;)i===124&&(s?(a+=n.substring(o,r-1),o=r):(e.push(a+n.substring(o,r)),a="",o=r+1)),s=i===92,r++,i=n.charCodeAt(r);return e.push(a+n.substring(o)),e}function See(n,e,t,r){if(e+2>t)return!1;let i=e+1;if(n.sCount[i]<n.blkIndent||n.sCount[i]-n.blkIndent>=4)return!1;let s=n.bMarks[i]+n.tShift[i];if(s>=n.eMarks[i])return!1;const o=n.src.charCodeAt(s++);if(o!==124&&o!==45&&o!==58||s>=n.eMarks[i])return!1;const a=n.src.charCodeAt(s++);if(a!==124&&a!==45&&a!==58&&!Gt(a)||o===45&&Gt(a))return!1;for(;s<n.eMarks[i];){const x=n.src.charCodeAt(s);if(x!==124&&x!==45&&x!==58&&!Gt(x))return!1;s++}let u=Tb(n,e+1),l=u.split("|");const c=[];for(let x=0;x<l.length;x++){const C=l[x].trim();if(!C){if(x===0||x===l.length-1)continue;return!1}if(!/^:?-+:?$/.test(C))return!1;C.charCodeAt(C.length-1)===58?c.push(C.charCodeAt(0)===58?"center":"right"):C.charCodeAt(0)===58?c.push("left"):c.push("")}if(u=Tb(n,e).trim(),u.indexOf("|")===-1||n.sCount[e]-n.blkIndent>=4)return!1;l=KA(u),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop();const f=l.length;if(f===0||f!==c.length)return!1;if(r)return!0;const d=n.parentType;n.parentType="table";const g=n.md.block.ruler.getRules("blockquote"),m=n.push("table_open","table",1),y=[e,0];m.map=y;const b=n.push("thead_open","thead",1);b.map=[e,e+1];const w=n.push("tr_open","tr",1);w.map=[e,e+1];for(let x=0;x<l.length;x++){const C=n.push("th_open","th",1);c[x]&&(C.attrs=[["style","text-align:"+c[x]]]);const R=n.push("inline","",0);R.content=l[x].trim(),R.children=[],n.push("th_close","th",-1)}n.push("tr_close","tr",-1),n.push("thead_close","thead",-1);let S,k=0;for(i=e+2;i<t&&!(n.sCount[i]<n.blkIndent);i++){let x=!1;for(let R=0,P=g.length;R<P;R++)if(g[R](n,i,t,!0)){x=!0;break}if(x||(u=Tb(n,i).trim(),!u)||n.sCount[i]-n.blkIndent>=4||(l=KA(u),l.length&&l[0]===""&&l.shift(),l.length&&l[l.length-1]===""&&l.pop(),k+=f-l.length,k>xee))break;if(i===e+2){const R=n.push("tbody_open","tbody",1);R.map=S=[e+2,0]}const C=n.push("tr_open","tr",1);C.map=[i,i+1];for(let R=0;R<f;R++){const P=n.push("td_open","td",1);c[R]&&(P.attrs=[["style","text-align:"+c[R]]]);const q=n.push("inline","",0);q.content=l[R]?l[R].trim():"",q.children=[],n.push("td_close","td",-1)}n.push("tr_close","tr",-1)}return S&&(n.push("tbody_close","tbody",-1),S[1]=i),n.push("table_close","table",-1),y[1]=i,n.parentType=d,n.line=i,!0}function Cee(n,e,t){if(n.sCount[e]-n.blkIndent<4)return!1;let r=e+1,i=r;for(;r<t;){if(n.isEmpty(r)){r++;continue}if(n.sCount[r]-n.blkIndent>=4){r++,i=r;continue}break}n.line=i;const s=n.push("code_block","code",0);return s.content=n.getLines(e,i,4+n.blkIndent,!1)+`
|
|
191
|
-
`,s.map=[e,n.line],!0}function Eee(n,e,t,r){let i=n.bMarks[e]+n.tShift[e],s=n.eMarks[e];if(n.sCount[e]-n.blkIndent>=4||i+3>s)return!1;const o=n.src.charCodeAt(i);if(o!==126&&o!==96)return!1;let a=i;i=n.skipChars(i,o);let u=i-a;if(u<3)return!1;const l=n.src.slice(a,i),c=n.src.slice(i,s);if(o===96&&c.indexOf(String.fromCharCode(o))>=0)return!1;if(r)return!0;let f=e,d=!1;for(;f++,!(f>=t||(i=a=n.bMarks[f]+n.tShift[f],s=n.eMarks[f],i<s&&n.sCount[f]<n.blkIndent));)if(n.src.charCodeAt(i)===o&&!(n.sCount[f]-n.blkIndent>=4)&&(i=n.skipChars(i,o),!(i-a<u)&&(i=n.skipSpaces(i),!(i<s)))){d=!0;break}u=n.sCount[e],n.line=f+(d?1:0);const g=n.push("fence","code",0);return g.info=c,g.content=n.getLines(e+1,f,u,!0),g.markup=l,g.map=[e,n.line],!0}function Ree(n,e,t,r){let i=n.bMarks[e]+n.tShift[e],s=n.eMarks[e];const o=n.lineMax;if(n.sCount[e]-n.blkIndent>=4||n.src.charCodeAt(i)!==62)return!1;if(r)return!0;const a=[],u=[],l=[],c=[],f=n.md.block.ruler.getRules("blockquote"),d=n.parentType;n.parentType="blockquote";let g=!1,m;for(m=e;m<t;m++){const k=n.sCount[m]<n.blkIndent;if(i=n.bMarks[m]+n.tShift[m],s=n.eMarks[m],i>=s)break;if(n.src.charCodeAt(i++)===62&&!k){let C=n.sCount[m]+1,R,P;n.src.charCodeAt(i)===32?(i++,C++,P=!1,R=!0):n.src.charCodeAt(i)===9?(R=!0,(n.bsCount[m]+C)%4===3?(i++,C++,P=!1):P=!0):R=!1;let q=C;for(a.push(n.bMarks[m]),n.bMarks[m]=i;i<s;){const B=n.src.charCodeAt(i);if(Gt(B))B===9?q+=4-(q+n.bsCount[m]+(P?1:0))%4:q++;else break;i++}g=i>=s,u.push(n.bsCount[m]),n.bsCount[m]=n.sCount[m]+1+(R?1:0),l.push(n.sCount[m]),n.sCount[m]=q-C,c.push(n.tShift[m]),n.tShift[m]=i-n.bMarks[m];continue}if(g)break;let x=!1;for(let C=0,R=f.length;C<R;C++)if(f[C](n,m,t,!0)){x=!0;break}if(x){n.lineMax=m,n.blkIndent!==0&&(a.push(n.bMarks[m]),u.push(n.bsCount[m]),c.push(n.tShift[m]),l.push(n.sCount[m]),n.sCount[m]-=n.blkIndent);break}a.push(n.bMarks[m]),u.push(n.bsCount[m]),c.push(n.tShift[m]),l.push(n.sCount[m]),n.sCount[m]=-1}const y=n.blkIndent;n.blkIndent=0;const b=n.push("blockquote_open","blockquote",1);b.markup=">";const w=[e,0];b.map=w,n.md.block.tokenize(n,e,m);const S=n.push("blockquote_close","blockquote",-1);S.markup=">",n.lineMax=o,n.parentType=d,w[1]=n.line;for(let k=0;k<c.length;k++)n.bMarks[k+e]=a[k],n.tShift[k+e]=c[k],n.sCount[k+e]=l[k],n.bsCount[k+e]=u[k];return n.blkIndent=y,!0}function Aee(n,e,t,r){const i=n.eMarks[e];if(n.sCount[e]-n.blkIndent>=4)return!1;let s=n.bMarks[e]+n.tShift[e];const o=n.src.charCodeAt(s++);if(o!==42&&o!==45&&o!==95)return!1;let a=1;for(;s<i;){const l=n.src.charCodeAt(s++);if(l!==o&&!Gt(l))return!1;l===o&&a++}if(a<3)return!1;if(r)return!0;n.line=e+1;const u=n.push("hr","hr",0);return u.map=[e,n.line],u.markup=Array(a+1).join(String.fromCharCode(o)),!0}function JA(n,e){const t=n.eMarks[e];let r=n.bMarks[e]+n.tShift[e];const i=n.src.charCodeAt(r++);if(i!==42&&i!==45&&i!==43)return-1;if(r<t){const s=n.src.charCodeAt(r);if(!Gt(s))return-1}return r}function YA(n,e){const t=n.bMarks[e]+n.tShift[e],r=n.eMarks[e];let i=t;if(i+1>=r)return-1;let s=n.src.charCodeAt(i++);if(s<48||s>57)return-1;for(;;){if(i>=r)return-1;if(s=n.src.charCodeAt(i++),s>=48&&s<=57){if(i-t>=10)return-1;continue}if(s===41||s===46)break;return-1}return i<r&&(s=n.src.charCodeAt(i),!Gt(s))?-1:i}function Dee(n,e){const t=n.level+2;for(let r=e+2,i=n.tokens.length-2;r<i;r++)n.tokens[r].level===t&&n.tokens[r].type==="paragraph_open"&&(n.tokens[r+2].hidden=!0,n.tokens[r].hidden=!0,r+=2)}function Tee(n,e,t,r){let i,s,o,a,u=e,l=!0;if(n.sCount[u]-n.blkIndent>=4||n.listIndent>=0&&n.sCount[u]-n.listIndent>=4&&n.sCount[u]<n.blkIndent)return!1;let c=!1;r&&n.parentType==="paragraph"&&n.sCount[u]>=n.blkIndent&&(c=!0);let f,d,g;if((g=YA(n,u))>=0){if(f=!0,o=n.bMarks[u]+n.tShift[u],d=Number(n.src.slice(o,g-1)),c&&d!==1)return!1}else if((g=JA(n,u))>=0)f=!1;else return!1;if(c&&n.skipSpaces(g)>=n.eMarks[u])return!1;if(r)return!0;const m=n.src.charCodeAt(g-1),y=n.tokens.length;f?(a=n.push("ordered_list_open","ol",1),d!==1&&(a.attrs=[["start",d]])):a=n.push("bullet_list_open","ul",1);const b=[u,0];a.map=b,a.markup=String.fromCharCode(m);let w=!1;const S=n.md.block.ruler.getRules("list"),k=n.parentType;for(n.parentType="list";u<t;){s=g,i=n.eMarks[u];const x=n.sCount[u]+g-(n.bMarks[u]+n.tShift[u]);let C=x;for(;s<i;){const N=n.src.charCodeAt(s);if(N===9)C+=4-(C+n.bsCount[u])%4;else if(N===32)C++;else break;s++}const R=s;let P;R>=i?P=1:P=C-x,P>4&&(P=1);const q=x+P;a=n.push("list_item_open","li",1),a.markup=String.fromCharCode(m);const B=[u,0];a.map=B,f&&(a.info=n.src.slice(o,g-1));const G=n.tight,V=n.tShift[u],F=n.sCount[u],A=n.listIndent;if(n.listIndent=n.blkIndent,n.blkIndent=q,n.tight=!0,n.tShift[u]=R-n.bMarks[u],n.sCount[u]=C,R>=i&&n.isEmpty(u+1)?n.line=Math.min(n.line+2,t):n.md.block.tokenize(n,u,t,!0),(!n.tight||w)&&(l=!1),w=n.line-u>1&&n.isEmpty(n.line-1),n.blkIndent=n.listIndent,n.listIndent=A,n.tShift[u]=V,n.sCount[u]=F,n.tight=G,a=n.push("list_item_close","li",-1),a.markup=String.fromCharCode(m),u=n.line,B[1]=u,u>=t||n.sCount[u]<n.blkIndent||n.sCount[u]-n.blkIndent>=4)break;let Y=!1;for(let N=0,ee=S.length;N<ee;N++)if(S[N](n,u,t,!0)){Y=!0;break}if(Y)break;if(f){if(g=YA(n,u),g<0)break;o=n.bMarks[u]+n.tShift[u]}else if(g=JA(n,u),g<0)break;if(m!==n.src.charCodeAt(g-1))break}return f?a=n.push("ordered_list_close","ol",-1):a=n.push("bullet_list_close","ul",-1),a.markup=String.fromCharCode(m),b[1]=u,n.line=u,n.parentType=k,l&&Dee(n,y),!0}function Mee(n,e,t,r){let i=n.bMarks[e]+n.tShift[e],s=n.eMarks[e],o=e+1;if(n.sCount[e]-n.blkIndent>=4||n.src.charCodeAt(i)!==91)return!1;function a(S){const k=n.lineMax;if(S>=k||n.isEmpty(S))return null;let x=!1;if(n.sCount[S]-n.blkIndent>3&&(x=!0),n.sCount[S]<0&&(x=!0),!x){const P=n.md.block.ruler.getRules("reference"),q=n.parentType;n.parentType="reference";let B=!1;for(let G=0,V=P.length;G<V;G++)if(P[G](n,S,k,!0)){B=!0;break}if(n.parentType=q,B)return null}const C=n.bMarks[S]+n.tShift[S],R=n.eMarks[S];return n.src.slice(C,R+1)}let u=n.src.slice(i,s+1);s=u.length;let l=-1;for(i=1;i<s;i++){const S=u.charCodeAt(i);if(S===91)return!1;if(S===93){l=i;break}else if(S===10){const k=a(o);k!==null&&(u+=k,s=u.length,o++)}else if(S===92&&(i++,i<s&&u.charCodeAt(i)===10)){const k=a(o);k!==null&&(u+=k,s=u.length,o++)}}if(l<0||u.charCodeAt(l+1)!==58)return!1;for(i=l+2;i<s;i++){const S=u.charCodeAt(i);if(S===10){const k=a(o);k!==null&&(u+=k,s=u.length,o++)}else if(!Gt(S))break}const c=n.md.helpers.parseLinkDestination(u,i,s);if(!c.ok)return!1;const f=n.md.normalizeLink(c.str);if(!n.md.validateLink(f))return!1;i=c.pos;const d=i,g=o,m=i;for(;i<s;i++){const S=u.charCodeAt(i);if(S===10){const k=a(o);k!==null&&(u+=k,s=u.length,o++)}else if(!Gt(S))break}let y=n.md.helpers.parseLinkTitle(u,i,s);for(;y.can_continue;){const S=a(o);if(S===null)break;u+=S,i=s,s=u.length,o++,y=n.md.helpers.parseLinkTitle(u,i,s,y)}let b;for(i<s&&m!==i&&y.ok?(b=y.str,i=y.pos):(b="",i=d,o=g);i<s;){const S=u.charCodeAt(i);if(!Gt(S))break;i++}if(i<s&&u.charCodeAt(i)!==10&&b)for(b="",i=d,o=g;i<s;){const S=u.charCodeAt(i);if(!Gt(S))break;i++}if(i<s&&u.charCodeAt(i)!==10)return!1;const w=ev(u.slice(1,l));return w?(r||(typeof n.env.references>"u"&&(n.env.references={}),typeof n.env.references[w]>"u"&&(n.env.references[w]={title:b,href:f}),n.line=o),!0):!1}const Oee=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Pee="[a-zA-Z_:][a-zA-Z0-9:._-]*",Iee="[^\"'=<>`\\x00-\\x20]+",Lee="'[^']*'",Fee='"[^"]*"',Nee="(?:"+Iee+"|"+Lee+"|"+Fee+")",Bee="(?:\\s+"+Pee+"(?:\\s*=\\s*"+Nee+")?)",UP="<[A-Za-z][A-Za-z0-9\\-]*"+Bee+"*\\s*\\/?>",HP="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",qee="<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->",jee="<[?][\\s\\S]*?[?]>",$ee="<![A-Za-z][^>]*>",Wee="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",zee=new RegExp("^(?:"+UP+"|"+HP+"|"+qee+"|"+jee+"|"+$ee+"|"+Wee+")"),Uee=new RegExp("^(?:"+UP+"|"+HP+")"),Yl=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+Oee.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(Uee.source+"\\s*$"),/^$/,!1]];function Hee(n,e,t,r){let i=n.bMarks[e]+n.tShift[e],s=n.eMarks[e];if(n.sCount[e]-n.blkIndent>=4||!n.md.options.html||n.src.charCodeAt(i)!==60)return!1;let o=n.src.slice(i,s),a=0;for(;a<Yl.length&&!Yl[a][0].test(o);a++);if(a===Yl.length)return!1;if(r)return Yl[a][2];let u=e+1;if(!Yl[a][1].test(o)){for(;u<t&&!(n.sCount[u]<n.blkIndent);u++)if(i=n.bMarks[u]+n.tShift[u],s=n.eMarks[u],o=n.src.slice(i,s),Yl[a][1].test(o)){o.length!==0&&u++;break}}n.line=u;const l=n.push("html_block","",0);return l.map=[e,u],l.content=n.getLines(e,u,n.blkIndent,!0),!0}function Vee(n,e,t,r){let i=n.bMarks[e]+n.tShift[e],s=n.eMarks[e];if(n.sCount[e]-n.blkIndent>=4)return!1;let o=n.src.charCodeAt(i);if(o!==35||i>=s)return!1;let a=1;for(o=n.src.charCodeAt(++i);o===35&&i<s&&a<=6;)a++,o=n.src.charCodeAt(++i);if(a>6||i<s&&!Gt(o))return!1;if(r)return!0;s=n.skipSpacesBack(s,i);const u=n.skipCharsBack(s,35,i);u>i&&Gt(n.src.charCodeAt(u-1))&&(s=u),n.line=e+1;const l=n.push("heading_open","h"+String(a),1);l.markup="########".slice(0,a),l.map=[e,n.line];const c=n.push("inline","",0);c.content=n.src.slice(i,s).trim(),c.map=[e,n.line],c.children=[];const f=n.push("heading_close","h"+String(a),-1);return f.markup="########".slice(0,a),!0}function Gee(n,e,t){const r=n.md.block.ruler.getRules("paragraph");if(n.sCount[e]-n.blkIndent>=4)return!1;const i=n.parentType;n.parentType="paragraph";let s=0,o,a=e+1;for(;a<t&&!n.isEmpty(a);a++){if(n.sCount[a]-n.blkIndent>3)continue;if(n.sCount[a]>=n.blkIndent){let g=n.bMarks[a]+n.tShift[a];const m=n.eMarks[a];if(g<m&&(o=n.src.charCodeAt(g),(o===45||o===61)&&(g=n.skipChars(g,o),g=n.skipSpaces(g),g>=m))){s=o===61?1:2;break}}if(n.sCount[a]<0)continue;let d=!1;for(let g=0,m=r.length;g<m;g++)if(r[g](n,a,t,!0)){d=!0;break}if(d)break}if(!s)return!1;const u=n.getLines(e,a,n.blkIndent,!1).trim();n.line=a+1;const l=n.push("heading_open","h"+String(s),1);l.markup=String.fromCharCode(o),l.map=[e,n.line];const c=n.push("inline","",0);c.content=u,c.map=[e,n.line-1],c.children=[];const f=n.push("heading_close","h"+String(s),-1);return f.markup=String.fromCharCode(o),n.parentType=i,!0}function Kee(n,e,t){const r=n.md.block.ruler.getRules("paragraph"),i=n.parentType;let s=e+1;for(n.parentType="paragraph";s<t&&!n.isEmpty(s);s++){if(n.sCount[s]-n.blkIndent>3||n.sCount[s]<0)continue;let l=!1;for(let c=0,f=r.length;c<f;c++)if(r[c](n,s,t,!0)){l=!0;break}if(l)break}const o=n.getLines(e,s,n.blkIndent,!1).trim();n.line=s;const a=n.push("paragraph_open","p",1);a.map=[e,n.line];const u=n.push("inline","",0);return u.content=o,u.map=[e,n.line],u.children=[],n.push("paragraph_close","p",-1),n.parentType=i,!0}const sg=[["table",See,["paragraph","reference"]],["code",Cee],["fence",Eee,["paragraph","reference","blockquote","list"]],["blockquote",Ree,["paragraph","reference","blockquote","list"]],["hr",Aee,["paragraph","reference","blockquote","list"]],["list",Tee,["paragraph","reference","blockquote"]],["reference",Mee],["html_block",Hee,["paragraph","reference","blockquote"]],["heading",Vee,["paragraph","reference","blockquote"]],["lheading",Gee],["paragraph",Kee]];function tv(){this.ruler=new li;for(let n=0;n<sg.length;n++)this.ruler.push(sg[n][0],sg[n][1],{alt:(sg[n][2]||[]).slice()})}tv.prototype.tokenize=function(n,e,t){const r=this.ruler.getRules(""),i=r.length,s=n.md.options.maxNesting;let o=e,a=!1;for(;o<t&&(n.line=o=n.skipEmptyLines(o),!(o>=t||n.sCount[o]<n.blkIndent));){if(n.level>=s){n.line=t;break}const u=n.line;let l=!1;for(let c=0;c<i;c++)if(l=r[c](n,o,t,!1),l){if(u>=n.line)throw new Error("block rule didn't increment state.line");break}if(!l)throw new Error("none of the block rules matched");n.tight=!a,n.isEmpty(n.line-1)&&(a=!0),o=n.line,o<t&&n.isEmpty(o)&&(a=!0,o++,n.line=o)}};tv.prototype.parse=function(n,e,t,r){if(!n)return;const i=new this.State(n,e,t,r);this.tokenize(i,i.line,i.lineMax)};tv.prototype.State=_o;function lp(n,e,t,r){this.src=n,this.env=t,this.md=e,this.tokens=r,this.tokens_meta=Array(r.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1,this.linkLevel=0}lp.prototype.pushPending=function(){const n=new Ds("text","",0);return n.content=this.pending,n.level=this.pendingLevel,this.tokens.push(n),this.pending="",n};lp.prototype.push=function(n,e,t){this.pending&&this.pushPending();const r=new Ds(n,e,t);let i=null;return t<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),r.level=this.level,t>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],i={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(r),this.tokens_meta.push(i),r};lp.prototype.scanDelims=function(n,e){const t=this.posMax,r=this.src.charCodeAt(n),i=n>0?this.src.charCodeAt(n-1):32;let s=n;for(;s<t&&this.src.charCodeAt(s)===r;)s++;const o=s-n,a=s<t?this.src.charCodeAt(s):32,u=Nd(i)||Fd(String.fromCharCode(i)),l=Nd(a)||Fd(String.fromCharCode(a)),c=Ld(i),f=Ld(a),d=!f&&(!l||c||u),g=!c&&(!u||f||l);return{can_open:d&&(e||!g||u),can_close:g&&(e||!d||l),length:o}};lp.prototype.Token=Ds;function Jee(n){switch(n){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}function Yee(n,e){let t=n.pos;for(;t<n.posMax&&!Jee(n.src.charCodeAt(t));)t++;return t===n.pos?!1:(e||(n.pending+=n.src.slice(n.pos,t)),n.pos=t,!0)}const Xee=/(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;function Zee(n,e){if(!n.md.options.linkify||n.linkLevel>0)return!1;const t=n.pos,r=n.posMax;if(t+3>r||n.src.charCodeAt(t)!==58||n.src.charCodeAt(t+1)!==47||n.src.charCodeAt(t+2)!==47)return!1;const i=n.pending.match(Xee);if(!i)return!1;const s=i[1],o=n.md.linkify.matchAtStart(n.src.slice(t-s.length));if(!o)return!1;let a=o.url;if(a.length<=s.length)return!1;a=a.replace(/\*+$/,"");const u=n.md.normalizeLink(a);if(!n.md.validateLink(u))return!1;if(!e){n.pending=n.pending.slice(0,-s.length);const l=n.push("link_open","a",1);l.attrs=[["href",u]],l.markup="linkify",l.info="auto";const c=n.push("text","",0);c.content=n.md.normalizeLinkText(a);const f=n.push("link_close","a",-1);f.markup="linkify",f.info="auto"}return n.pos+=a.length-s.length,!0}function Qee(n,e){let t=n.pos;if(n.src.charCodeAt(t)!==10)return!1;const r=n.pending.length-1,i=n.posMax;if(!e)if(r>=0&&n.pending.charCodeAt(r)===32)if(r>=1&&n.pending.charCodeAt(r-1)===32){let s=r-1;for(;s>=1&&n.pending.charCodeAt(s-1)===32;)s--;n.pending=n.pending.slice(0,s),n.push("hardbreak","br",0)}else n.pending=n.pending.slice(0,-1),n.push("softbreak","br",0);else n.push("softbreak","br",0);for(t++;t<i&&Gt(n.src.charCodeAt(t));)t++;return n.pos=t,!0}const cx=[];for(let n=0;n<256;n++)cx.push(0);"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(n){cx[n.charCodeAt(0)]=1});function ete(n,e){let t=n.pos;const r=n.posMax;if(n.src.charCodeAt(t)!==92||(t++,t>=r))return!1;let i=n.src.charCodeAt(t);if(i===10){for(e||n.push("hardbreak","br",0),t++;t<r&&(i=n.src.charCodeAt(t),!!Gt(i));)t++;return n.pos=t,!0}let s=n.src[t];if(i>=55296&&i<=56319&&t+1<r){const a=n.src.charCodeAt(t+1);a>=56320&&a<=57343&&(s+=n.src[t+1],t++)}const o="\\"+s;if(!e){const a=n.push("text_special","",0);i<256&&cx[i]!==0?a.content=s:a.content=o,a.markup=o,a.info="escape"}return n.pos=t+1,!0}function tte(n,e){let t=n.pos;if(n.src.charCodeAt(t)!==96)return!1;const i=t;t++;const s=n.posMax;for(;t<s&&n.src.charCodeAt(t)===96;)t++;const o=n.src.slice(i,t),a=o.length;if(n.backticksScanned&&(n.backticks[a]||0)<=i)return e||(n.pending+=o),n.pos+=a,!0;let u=t,l;for(;(l=n.src.indexOf("`",u))!==-1;){for(u=l+1;u<s&&n.src.charCodeAt(u)===96;)u++;const c=u-l;if(c===a){if(!e){const f=n.push("code_inline","code",0);f.markup=o,f.content=n.src.slice(t,l).replace(/\n/g," ").replace(/^ (.+) $/,"$1")}return n.pos=u,!0}n.backticks[c]=l}return n.backticksScanned=!0,e||(n.pending+=o),n.pos+=a,!0}function nte(n,e){const t=n.pos,r=n.src.charCodeAt(t);if(e||r!==126)return!1;const i=n.scanDelims(n.pos,!0);let s=i.length;const o=String.fromCharCode(r);if(s<2)return!1;let a;s%2&&(a=n.push("text","",0),a.content=o,s--);for(let u=0;u<s;u+=2)a=n.push("text","",0),a.content=o+o,n.delimiters.push({marker:r,length:0,token:n.tokens.length-1,end:-1,open:i.can_open,close:i.can_close});return n.pos+=i.length,!0}function XA(n,e){let t;const r=[],i=e.length;for(let s=0;s<i;s++){const o=e[s];if(o.marker!==126||o.end===-1)continue;const a=e[o.end];t=n.tokens[o.token],t.type="s_open",t.tag="s",t.nesting=1,t.markup="~~",t.content="",t=n.tokens[a.token],t.type="s_close",t.tag="s",t.nesting=-1,t.markup="~~",t.content="",n.tokens[a.token-1].type==="text"&&n.tokens[a.token-1].content==="~"&&r.push(a.token-1)}for(;r.length;){const s=r.pop();let o=s+1;for(;o<n.tokens.length&&n.tokens[o].type==="s_close";)o++;o--,s!==o&&(t=n.tokens[o],n.tokens[o]=n.tokens[s],n.tokens[s]=t)}}function rte(n){const e=n.tokens_meta,t=n.tokens_meta.length;XA(n,n.delimiters);for(let r=0;r<t;r++)e[r]&&e[r].delimiters&&XA(n,e[r].delimiters)}const VP={tokenize:nte,postProcess:rte};function ite(n,e){const t=n.pos,r=n.src.charCodeAt(t);if(e||r!==95&&r!==42)return!1;const i=n.scanDelims(n.pos,r===42);for(let s=0;s<i.length;s++){const o=n.push("text","",0);o.content=String.fromCharCode(r),n.delimiters.push({marker:r,length:i.length,token:n.tokens.length-1,end:-1,open:i.can_open,close:i.can_close})}return n.pos+=i.length,!0}function ZA(n,e){const t=e.length;for(let r=t-1;r>=0;r--){const i=e[r];if(i.marker!==95&&i.marker!==42||i.end===-1)continue;const s=e[i.end],o=r>0&&e[r-1].end===i.end+1&&e[r-1].marker===i.marker&&e[r-1].token===i.token-1&&e[i.end+1].token===s.token+1,a=String.fromCharCode(i.marker),u=n.tokens[i.token];u.type=o?"strong_open":"em_open",u.tag=o?"strong":"em",u.nesting=1,u.markup=o?a+a:a,u.content="";const l=n.tokens[s.token];l.type=o?"strong_close":"em_close",l.tag=o?"strong":"em",l.nesting=-1,l.markup=o?a+a:a,l.content="",o&&(n.tokens[e[r-1].token].content="",n.tokens[e[i.end+1].token].content="",r--)}}function ste(n){const e=n.tokens_meta,t=n.tokens_meta.length;ZA(n,n.delimiters);for(let r=0;r<t;r++)e[r]&&e[r].delimiters&&ZA(n,e[r].delimiters)}const GP={tokenize:ite,postProcess:ste};function ote(n,e){let t,r,i,s,o="",a="",u=n.pos,l=!0;if(n.src.charCodeAt(n.pos)!==91)return!1;const c=n.pos,f=n.posMax,d=n.pos+1,g=n.md.helpers.parseLinkLabel(n,n.pos,!0);if(g<0)return!1;let m=g+1;if(m<f&&n.src.charCodeAt(m)===40){for(l=!1,m++;m<f&&(t=n.src.charCodeAt(m),!(!Gt(t)&&t!==10));m++);if(m>=f)return!1;if(u=m,i=n.md.helpers.parseLinkDestination(n.src,m,n.posMax),i.ok){for(o=n.md.normalizeLink(i.str),n.md.validateLink(o)?m=i.pos:o="",u=m;m<f&&(t=n.src.charCodeAt(m),!(!Gt(t)&&t!==10));m++);if(i=n.md.helpers.parseLinkTitle(n.src,m,n.posMax),m<f&&u!==m&&i.ok)for(a=i.str,m=i.pos;m<f&&(t=n.src.charCodeAt(m),!(!Gt(t)&&t!==10));m++);}(m>=f||n.src.charCodeAt(m)!==41)&&(l=!0),m++}if(l){if(typeof n.env.references>"u")return!1;if(m<f&&n.src.charCodeAt(m)===91?(u=m+1,m=n.md.helpers.parseLinkLabel(n,m),m>=0?r=n.src.slice(u,m++):m=g+1):m=g+1,r||(r=n.src.slice(d,g)),s=n.env.references[ev(r)],!s)return n.pos=c,!1;o=s.href,a=s.title}if(!e){n.pos=d,n.posMax=g;const y=n.push("link_open","a",1),b=[["href",o]];y.attrs=b,a&&b.push(["title",a]),n.linkLevel++,n.md.inline.tokenize(n),n.linkLevel--,n.push("link_close","a",-1)}return n.pos=m,n.posMax=f,!0}function ate(n,e){let t,r,i,s,o,a,u,l,c="";const f=n.pos,d=n.posMax;if(n.src.charCodeAt(n.pos)!==33||n.src.charCodeAt(n.pos+1)!==91)return!1;const g=n.pos+2,m=n.md.helpers.parseLinkLabel(n,n.pos+1,!1);if(m<0)return!1;if(s=m+1,s<d&&n.src.charCodeAt(s)===40){for(s++;s<d&&(t=n.src.charCodeAt(s),!(!Gt(t)&&t!==10));s++);if(s>=d)return!1;for(l=s,a=n.md.helpers.parseLinkDestination(n.src,s,n.posMax),a.ok&&(c=n.md.normalizeLink(a.str),n.md.validateLink(c)?s=a.pos:c=""),l=s;s<d&&(t=n.src.charCodeAt(s),!(!Gt(t)&&t!==10));s++);if(a=n.md.helpers.parseLinkTitle(n.src,s,n.posMax),s<d&&l!==s&&a.ok)for(u=a.str,s=a.pos;s<d&&(t=n.src.charCodeAt(s),!(!Gt(t)&&t!==10));s++);else u="";if(s>=d||n.src.charCodeAt(s)!==41)return n.pos=f,!1;s++}else{if(typeof n.env.references>"u")return!1;if(s<d&&n.src.charCodeAt(s)===91?(l=s+1,s=n.md.helpers.parseLinkLabel(n,s),s>=0?i=n.src.slice(l,s++):s=m+1):s=m+1,i||(i=n.src.slice(g,m)),o=n.env.references[ev(i)],!o)return n.pos=f,!1;c=o.href,u=o.title}if(!e){r=n.src.slice(g,m);const y=[];n.md.inline.parse(r,n.md,n.env,y);const b=n.push("image","img",0),w=[["src",c],["alt",""]];b.attrs=w,b.children=y,b.content=r,u&&w.push(["title",u])}return n.pos=s,n.posMax=d,!0}const ute=/^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,lte=/^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;function cte(n,e){let t=n.pos;if(n.src.charCodeAt(t)!==60)return!1;const r=n.pos,i=n.posMax;for(;;){if(++t>=i)return!1;const o=n.src.charCodeAt(t);if(o===60)return!1;if(o===62)break}const s=n.src.slice(r+1,t);if(lte.test(s)){const o=n.md.normalizeLink(s);if(!n.md.validateLink(o))return!1;if(!e){const a=n.push("link_open","a",1);a.attrs=[["href",o]],a.markup="autolink",a.info="auto";const u=n.push("text","",0);u.content=n.md.normalizeLinkText(s);const l=n.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return n.pos+=s.length+2,!0}if(ute.test(s)){const o=n.md.normalizeLink("mailto:"+s);if(!n.md.validateLink(o))return!1;if(!e){const a=n.push("link_open","a",1);a.attrs=[["href",o]],a.markup="autolink",a.info="auto";const u=n.push("text","",0);u.content=n.md.normalizeLinkText(s);const l=n.push("link_close","a",-1);l.markup="autolink",l.info="auto"}return n.pos+=s.length+2,!0}return!1}function fte(n){return/^<a[>\s]/i.test(n)}function hte(n){return/^<\/a\s*>/i.test(n)}function dte(n){const e=n|32;return e>=97&&e<=122}function pte(n,e){if(!n.md.options.html)return!1;const t=n.posMax,r=n.pos;if(n.src.charCodeAt(r)!==60||r+2>=t)return!1;const i=n.src.charCodeAt(r+1);if(i!==33&&i!==63&&i!==47&&!dte(i))return!1;const s=n.src.slice(r).match(zee);if(!s)return!1;if(!e){const o=n.push("html_inline","",0);o.content=s[0],fte(o.content)&&n.linkLevel++,hte(o.content)&&n.linkLevel--}return n.pos+=s[0].length,!0}const gte=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,mte=/^&([a-z][a-z0-9]{1,31});/i;function vte(n,e){const t=n.pos,r=n.posMax;if(n.src.charCodeAt(t)!==38||t+1>=r)return!1;if(n.src.charCodeAt(t+1)===35){const s=n.src.slice(t).match(gte);if(s){if(!e){const o=s[1][0].toLowerCase()==="x"?parseInt(s[1].slice(1),16):parseInt(s[1],10),a=n.push("text_special","",0);a.content=ux(o)?d1(o):d1(65533),a.markup=s[0],a.info="entity"}return n.pos+=s[0].length,!0}}else{const s=n.src.slice(t).match(mte);if(s){const o=qP(s[0]);if(o!==s[0]){if(!e){const a=n.push("text_special","",0);a.content=o,a.markup=s[0],a.info="entity"}return n.pos+=s[0].length,!0}}}return!1}function QA(n){const e={},t=n.length;if(!t)return;let r=0,i=-2;const s=[];for(let o=0;o<t;o++){const a=n[o];if(s.push(0),(n[r].marker!==a.marker||i!==a.token-1)&&(r=o),i=a.token,a.length=a.length||0,!a.close)continue;e.hasOwnProperty(a.marker)||(e[a.marker]=[-1,-1,-1,-1,-1,-1]);const u=e[a.marker][(a.open?3:0)+a.length%3];let l=r-s[r]-1,c=l;for(;l>u;l-=s[l]+1){const f=n[l];if(f.marker===a.marker&&f.open&&f.end<0){let d=!1;if((f.close||a.open)&&(f.length+a.length)%3===0&&(f.length%3!==0||a.length%3!==0)&&(d=!0),!d){const g=l>0&&!n[l-1].open?s[l-1]+1:0;s[o]=o-l+g,s[l]=g,a.open=!1,f.end=o,f.close=!1,c=-1,i=-2;break}}}c!==-1&&(e[a.marker][(a.open?3:0)+(a.length||0)%3]=c)}}function yte(n){const e=n.tokens_meta,t=n.tokens_meta.length;QA(n.delimiters);for(let r=0;r<t;r++)e[r]&&e[r].delimiters&&QA(e[r].delimiters)}function bte(n){let e,t,r=0;const i=n.tokens,s=n.tokens.length;for(e=t=0;e<s;e++)i[e].nesting<0&&r--,i[e].level=r,i[e].nesting>0&&r++,i[e].type==="text"&&e+1<s&&i[e+1].type==="text"?i[e+1].content=i[e].content+i[e+1].content:(e!==t&&(i[t]=i[e]),t++);e!==t&&(i.length=t)}const Mb=[["text",Yee],["linkify",Zee],["newline",Qee],["escape",ete],["backticks",tte],["strikethrough",VP.tokenize],["emphasis",GP.tokenize],["link",ote],["image",ate],["autolink",cte],["html_inline",pte],["entity",vte]],Ob=[["balance_pairs",yte],["strikethrough",VP.postProcess],["emphasis",GP.postProcess],["fragments_join",bte]];function cp(){this.ruler=new li;for(let n=0;n<Mb.length;n++)this.ruler.push(Mb[n][0],Mb[n][1]);this.ruler2=new li;for(let n=0;n<Ob.length;n++)this.ruler2.push(Ob[n][0],Ob[n][1])}cp.prototype.skipToken=function(n){const e=n.pos,t=this.ruler.getRules(""),r=t.length,i=n.md.options.maxNesting,s=n.cache;if(typeof s[e]<"u"){n.pos=s[e];return}let o=!1;if(n.level<i){for(let a=0;a<r;a++)if(n.level++,o=t[a](n,!0),n.level--,o){if(e>=n.pos)throw new Error("inline rule didn't increment state.pos");break}}else n.pos=n.posMax;o||n.pos++,s[e]=n.pos};cp.prototype.tokenize=function(n){const e=this.ruler.getRules(""),t=e.length,r=n.posMax,i=n.md.options.maxNesting;for(;n.pos<r;){const s=n.pos;let o=!1;if(n.level<i){for(let a=0;a<t;a++)if(o=e[a](n,!1),o){if(s>=n.pos)throw new Error("inline rule didn't increment state.pos");break}}if(o){if(n.pos>=r)break;continue}n.pending+=n.src[n.pos++]}n.pending&&n.pushPending()};cp.prototype.parse=function(n,e,t,r){const i=new this.State(n,e,t,r);this.tokenize(i);const s=this.ruler2.getRules(""),o=s.length;for(let a=0;a<o;a++)s[a](i)};cp.prototype.State=lp;function wte(n){const e={};n=n||{},e.src_Any=IP.source,e.src_Cc=LP.source,e.src_Z=NP.source,e.src_P=ox.source,e.src_ZPCc=[e.src_Z,e.src_P,e.src_Cc].join("|"),e.src_ZCc=[e.src_Z,e.src_Cc].join("|");const t="[><|]";return e.src_pseudo_letter="(?:(?!"+t+"|"+e.src_ZPCc+")"+e.src_Any+")",e.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",e.src_auth="(?:(?:(?!"+e.src_ZCc+"|[@/\\[\\]()]).)+@)?",e.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",e.src_host_terminator="(?=$|"+t+"|"+e.src_ZPCc+")(?!"+(n["---"]?"-(?!--)|":"-|")+"_|:\\d|\\.-|\\.(?!$|"+e.src_ZPCc+"))",e.src_path="(?:[/?#](?:(?!"+e.src_ZCc+"|"+t+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+e.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+e.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+e.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+e.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+e.src_ZCc+"|[']).)+\\'|\\'(?="+e.src_pseudo_letter+"|[-])|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+e.src_ZCc+"|[.]|$)|"+(n["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+e.src_ZCc+"|$)|;(?!"+e.src_ZCc+"|$)|\\!+(?!"+e.src_ZCc+"|[!]|$)|\\?(?!"+e.src_ZCc+"|[?]|$))+|\\/)?",e.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',e.src_xn="xn--[a-z0-9\\-]{1,59}",e.src_domain_root="(?:"+e.src_xn+"|"+e.src_pseudo_letter+"{1,63})",e.src_domain="(?:"+e.src_xn+"|(?:"+e.src_pseudo_letter+")|(?:"+e.src_pseudo_letter+"(?:-|"+e.src_pseudo_letter+"){0,61}"+e.src_pseudo_letter+"))",e.src_host="(?:(?:(?:(?:"+e.src_domain+")\\.)*"+e.src_domain+"))",e.tpl_host_fuzzy="(?:"+e.src_ip4+"|(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%)))",e.tpl_host_no_ip_fuzzy="(?:(?:(?:"+e.src_domain+")\\.)+(?:%TLDS%))",e.src_host_strict=e.src_host+e.src_host_terminator,e.tpl_host_fuzzy_strict=e.tpl_host_fuzzy+e.src_host_terminator,e.src_host_port_strict=e.src_host+e.src_port+e.src_host_terminator,e.tpl_host_port_fuzzy_strict=e.tpl_host_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_port_no_ip_fuzzy_strict=e.tpl_host_no_ip_fuzzy+e.src_port+e.src_host_terminator,e.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+e.src_ZPCc+"|>|$))",e.tpl_email_fuzzy="(^|"+t+'|"|\\(|'+e.src_ZCc+")("+e.src_email_name+"@"+e.tpl_host_fuzzy_strict+")",e.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_fuzzy_strict+e.src_path+")",e.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+e.src_ZPCc+"))((?![$+<=>^`||])"+e.tpl_host_port_no_ip_fuzzy_strict+e.src_path+")",e}function v2(n){return Array.prototype.slice.call(arguments,1).forEach(function(t){t&&Object.keys(t).forEach(function(r){n[r]=t[r]})}),n}function nv(n){return Object.prototype.toString.call(n)}function _te(n){return nv(n)==="[object String]"}function kte(n){return nv(n)==="[object Object]"}function xte(n){return nv(n)==="[object RegExp]"}function eD(n){return nv(n)==="[object Function]"}function Ste(n){return n.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}const KP={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function Cte(n){return Object.keys(n||{}).reduce(function(e,t){return e||KP.hasOwnProperty(t)},!1)}const Ete={"http:":{validate:function(n,e,t){const r=n.slice(e);return t.re.http||(t.re.http=new RegExp("^\\/\\/"+t.re.src_auth+t.re.src_host_port_strict+t.re.src_path,"i")),t.re.http.test(r)?r.match(t.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(n,e,t){const r=n.slice(e);return t.re.no_http||(t.re.no_http=new RegExp("^"+t.re.src_auth+"(?:localhost|(?:(?:"+t.re.src_domain+")\\.)+"+t.re.src_domain_root+")"+t.re.src_port+t.re.src_host_terminator+t.re.src_path,"i")),t.re.no_http.test(r)?e>=3&&n[e-3]===":"||e>=3&&n[e-3]==="/"?0:r.match(t.re.no_http)[0].length:0}},"mailto:":{validate:function(n,e,t){const r=n.slice(e);return t.re.mailto||(t.re.mailto=new RegExp("^"+t.re.src_email_name+"@"+t.re.src_host_strict,"i")),t.re.mailto.test(r)?r.match(t.re.mailto)[0].length:0}}},Rte="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",Ate="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Dte(n){n.__index__=-1,n.__text_cache__=""}function Tte(n){return function(e,t){const r=e.slice(t);return n.test(r)?r.match(n)[0].length:0}}function tD(){return function(n,e){e.normalize(n)}}function p1(n){const e=n.re=wte(n.__opts__),t=n.__tlds__.slice();n.onCompile(),n.__tlds_replaced__||t.push(Rte),t.push(e.src_xn),e.src_tlds=t.join("|");function r(a){return a.replace("%TLDS%",e.src_tlds)}e.email_fuzzy=RegExp(r(e.tpl_email_fuzzy),"i"),e.link_fuzzy=RegExp(r(e.tpl_link_fuzzy),"i"),e.link_no_ip_fuzzy=RegExp(r(e.tpl_link_no_ip_fuzzy),"i"),e.host_fuzzy_test=RegExp(r(e.tpl_host_fuzzy_test),"i");const i=[];n.__compiled__={};function s(a,u){throw new Error('(LinkifyIt) Invalid schema "'+a+'": '+u)}Object.keys(n.__schemas__).forEach(function(a){const u=n.__schemas__[a];if(u===null)return;const l={validate:null,link:null};if(n.__compiled__[a]=l,kte(u)){xte(u.validate)?l.validate=Tte(u.validate):eD(u.validate)?l.validate=u.validate:s(a,u),eD(u.normalize)?l.normalize=u.normalize:u.normalize?s(a,u):l.normalize=tD();return}if(_te(u)){i.push(a);return}s(a,u)}),i.forEach(function(a){n.__compiled__[n.__schemas__[a]]&&(n.__compiled__[a].validate=n.__compiled__[n.__schemas__[a]].validate,n.__compiled__[a].normalize=n.__compiled__[n.__schemas__[a]].normalize)}),n.__compiled__[""]={validate:null,normalize:tD()};const o=Object.keys(n.__compiled__).filter(function(a){return a.length>0&&n.__compiled__[a]}).map(Ste).join("|");n.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+o+")","i"),n.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+e.src_ZPCc+"))("+o+")","ig"),n.re.schema_at_start=RegExp("^"+n.re.schema_search.source,"i"),n.re.pretest=RegExp("("+n.re.schema_test.source+")|("+n.re.host_fuzzy_test.source+")|@","i"),Dte(n)}function Mte(n,e){const t=n.__index__,r=n.__last_index__,i=n.__text_cache__.slice(t,r);this.schema=n.__schema__.toLowerCase(),this.index=t+e,this.lastIndex=r+e,this.raw=i,this.text=i,this.url=i}function y2(n,e){const t=new Mte(n,e);return n.__compiled__[t.schema].normalize(t,n),t}function Ai(n,e){if(!(this instanceof Ai))return new Ai(n,e);e||Cte(n)&&(e=n,n={}),this.__opts__=v2({},KP,e),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=v2({},Ete,n),this.__compiled__={},this.__tlds__=Ate,this.__tlds_replaced__=!1,this.re={},p1(this)}Ai.prototype.add=function(e,t){return this.__schemas__[e]=t,p1(this),this};Ai.prototype.set=function(e){return this.__opts__=v2(this.__opts__,e),this};Ai.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;let t,r,i,s,o,a,u,l,c;if(this.re.schema_test.test(e)){for(u=this.re.schema_search,u.lastIndex=0;(t=u.exec(e))!==null;)if(s=this.testSchemaAt(e,t[2],u.lastIndex),s){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+s;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(l=e.search(this.re.host_fuzzy_test),l>=0&&(this.__index__<0||l<this.__index__)&&(r=e.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(o=r.index+r[1].length,(this.__index__<0||o<this.__index__)&&(this.__schema__="",this.__index__=o,this.__last_index__=r.index+r[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&(c=e.indexOf("@"),c>=0&&(i=e.match(this.re.email_fuzzy))!==null&&(o=i.index+i[1].length,a=i.index+i[0].length,(this.__index__<0||o<this.__index__||o===this.__index__&&a>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=a))),this.__index__>=0};Ai.prototype.pretest=function(e){return this.re.pretest.test(e)};Ai.prototype.testSchemaAt=function(e,t,r){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,r,this):0};Ai.prototype.match=function(e){const t=[];let r=0;this.__index__>=0&&this.__text_cache__===e&&(t.push(y2(this,r)),r=this.__last_index__);let i=r?e.slice(r):e;for(;this.test(i);)t.push(y2(this,r)),i=i.slice(this.__last_index__),r+=this.__last_index__;return t.length?t:null};Ai.prototype.matchAtStart=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return null;const t=this.re.schema_at_start.exec(e);if(!t)return null;const r=this.testSchemaAt(e,t[2],t[0].length);return r?(this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+r,y2(this,0)):null};Ai.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter(function(r,i,s){return r!==s[i-1]}).reverse(),p1(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,p1(this),this)};Ai.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),e.schema==="mailto:"&&!/^mailto:/i.test(e.url)&&(e.url="mailto:"+e.url)};Ai.prototype.onCompile=function(){};const mc=2147483647,ao=36,fx=1,Bd=26,Ote=38,Pte=700,JP=72,YP=128,XP="-",Ite=/^xn--/,Lte=/[^\0-\x7F]/,Fte=/[\x2E\u3002\uFF0E\uFF61]/g,Nte={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Pb=ao-fx,uo=Math.floor,Ib=String.fromCharCode;function Ia(n){throw new RangeError(Nte[n])}function Bte(n,e){const t=[];let r=n.length;for(;r--;)t[r]=e(n[r]);return t}function ZP(n,e){const t=n.split("@");let r="";t.length>1&&(r=t[0]+"@",n=t[1]),n=n.replace(Fte,".");const i=n.split("."),s=Bte(i,e).join(".");return r+s}function QP(n){const e=[];let t=0;const r=n.length;for(;t<r;){const i=n.charCodeAt(t++);if(i>=55296&&i<=56319&&t<r){const s=n.charCodeAt(t++);(s&64512)==56320?e.push(((i&1023)<<10)+(s&1023)+65536):(e.push(i),t--)}else e.push(i)}return e}const qte=n=>String.fromCodePoint(...n),jte=function(n){return n>=48&&n<58?26+(n-48):n>=65&&n<91?n-65:n>=97&&n<123?n-97:ao},nD=function(n,e){return n+22+75*(n<26)-((e!=0)<<5)},eI=function(n,e,t){let r=0;for(n=t?uo(n/Pte):n>>1,n+=uo(n/e);n>Pb*Bd>>1;r+=ao)n=uo(n/Pb);return uo(r+(Pb+1)*n/(n+Ote))},tI=function(n){const e=[],t=n.length;let r=0,i=YP,s=JP,o=n.lastIndexOf(XP);o<0&&(o=0);for(let a=0;a<o;++a)n.charCodeAt(a)>=128&&Ia("not-basic"),e.push(n.charCodeAt(a));for(let a=o>0?o+1:0;a<t;){const u=r;for(let c=1,f=ao;;f+=ao){a>=t&&Ia("invalid-input");const d=jte(n.charCodeAt(a++));d>=ao&&Ia("invalid-input"),d>uo((mc-r)/c)&&Ia("overflow"),r+=d*c;const g=f<=s?fx:f>=s+Bd?Bd:f-s;if(d<g)break;const m=ao-g;c>uo(mc/m)&&Ia("overflow"),c*=m}const l=e.length+1;s=eI(r-u,l,u==0),uo(r/l)>mc-i&&Ia("overflow"),i+=uo(r/l),r%=l,e.splice(r++,0,i)}return String.fromCodePoint(...e)},nI=function(n){const e=[];n=QP(n);const t=n.length;let r=YP,i=0,s=JP;for(const u of n)u<128&&e.push(Ib(u));const o=e.length;let a=o;for(o&&e.push(XP);a<t;){let u=mc;for(const c of n)c>=r&&c<u&&(u=c);const l=a+1;u-r>uo((mc-i)/l)&&Ia("overflow"),i+=(u-r)*l,r=u;for(const c of n)if(c<r&&++i>mc&&Ia("overflow"),c===r){let f=i;for(let d=ao;;d+=ao){const g=d<=s?fx:d>=s+Bd?Bd:d-s;if(f<g)break;const m=f-g,y=ao-g;e.push(Ib(nD(g+m%y,0))),f=uo(m/y)}e.push(Ib(nD(f,0))),s=eI(i,l,a===o),i=0,++a}++i,++r}return e.join("")},$te=function(n){return ZP(n,function(e){return Ite.test(e)?tI(e.slice(4).toLowerCase()):e})},Wte=function(n){return ZP(n,function(e){return Lte.test(e)?"xn--"+nI(e):e})},rI={version:"2.3.1",ucs2:{decode:QP,encode:qte},decode:tI,encode:nI,toASCII:Wte,toUnicode:$te},zte={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}},Ute={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","fragments_join"]}}},Hte={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline","text_join"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","fragments_join"]}}},Vte={default:zte,zero:Ute,commonmark:Hte},Gte=/^(vbscript|javascript|file|data):/,Kte=/^data:image\/(gif|png|jpeg|webp);/;function Jte(n){const e=n.trim().toLowerCase();return Gte.test(e)?Kte.test(e):!0}const iI=["http:","https:","mailto:"];function Yte(n){const e=sx(n,!0);if(e.hostname&&(!e.protocol||iI.indexOf(e.protocol)>=0))try{e.hostname=rI.toASCII(e.hostname)}catch{}return up(ix(e))}function Xte(n){const e=sx(n,!0);if(e.hostname&&(!e.protocol||iI.indexOf(e.protocol)>=0))try{e.hostname=rI.toUnicode(e.hostname)}catch{}return Ic(ix(e),Ic.defaultChars+"%")}function ns(n,e){if(!(this instanceof ns))return new ns(n,e);e||ax(n)||(e=n||{},n="default"),this.inline=new cp,this.block=new tv,this.core=new lx,this.renderer=new Xc,this.linkify=new Ai,this.validateLink=Jte,this.normalizeLink=Yte,this.normalizeLinkText=Xte,this.utils=QQ,this.helpers=Q1({},ree),this.options={},this.configure(n),e&&this.set(e)}ns.prototype.set=function(n){return Q1(this.options,n),this};ns.prototype.configure=function(n){const e=this;if(ax(n)){const t=n;if(n=Vte[t],!n)throw new Error('Wrong `markdown-it` preset "'+t+'", check name')}if(!n)throw new Error("Wrong `markdown-it` preset, can't be empty");return n.options&&e.set(n.options),n.components&&Object.keys(n.components).forEach(function(t){n.components[t].rules&&e[t].ruler.enableOnly(n.components[t].rules),n.components[t].rules2&&e[t].ruler2.enableOnly(n.components[t].rules2)}),this};ns.prototype.enable=function(n,e){let t=[];Array.isArray(n)||(n=[n]),["core","block","inline"].forEach(function(i){t=t.concat(this[i].ruler.enable(n,!0))},this),t=t.concat(this.inline.ruler2.enable(n,!0));const r=n.filter(function(i){return t.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this};ns.prototype.disable=function(n,e){let t=[];Array.isArray(n)||(n=[n]),["core","block","inline"].forEach(function(i){t=t.concat(this[i].ruler.disable(n,!0))},this),t=t.concat(this.inline.ruler2.disable(n,!0));const r=n.filter(function(i){return t.indexOf(i)<0});if(r.length&&!e)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this};ns.prototype.use=function(n){const e=[this].concat(Array.prototype.slice.call(arguments,1));return n.apply(n,e),this};ns.prototype.parse=function(n,e){if(typeof n!="string")throw new Error("Input data should be a String");const t=new this.core.State(n,this,e);return this.core.process(t),t.tokens};ns.prototype.render=function(n,e){return e=e||{},this.renderer.render(this.parse(n,e),this.options,e)};ns.prototype.parseInline=function(n,e){const t=new this.core.State(n,this,e);return t.inlineMode=!0,this.core.process(t),t.tokens};ns.prototype.renderInline=function(n,e){return e=e||{},this.renderer.render(this.parseInline(n,e),this.options,e)};const rD=new Map,iD=new Map,sD=new Map;var b2;(n=>{async function e(r,i){let s,o;switch(console.debug("language",{language:r}),r){case"javascript":case"typescript":if(s=iD.get("javascript"),o=sD.get("javascript"),console.debug("got worker",{worker:o,factory:s}),!s){o=new SharedWorker(new URL("/assets/javascript.worker-ClsyHOLi.js",import.meta.url),{type:"module"}),o.port.start(),sD.set("javascript",o);const{createLanguageServer:a}=rx(o.port);s=a,iD.set("javascript",s)}break}return await s?.(Z1({fs:i})),{worker:o}}n.worker=e;async function t({fs:r,language:i,path:s,view:o}){let a=rD.get(i),u;const l=`file:///${s}`;if(!a){const{worker:c}=await n.worker(i,r);if(!c)return null;console.debug("got worker",{worker:c}),a=new JZ({transport:new hQ(c.port),rootUri:"file:///",workspaceFolders:[{name:"workspace",uri:"file:///"}]})}return rD.set(i,a),u={client:a,extension:[]},u.extension=ZZ({client:u.client,documentUri:l,languageId:i,allowHTMLContent:!0,markdownRenderer(c){const f=g1.get(o.state),d=b8[1].find(y=>y.value instanceof Uc)?.value,g=f.language?.parser;return ns({highlight:y=>lne(y,g,d)}).render(c)}}),u}n.client=t})(b2||(b2={}));const oD="/node_modules/typescript/lib",aD="/tsconfig.json",uD={es5:["es5","decorators","decorators.legacy"],es2015:["es5","decorators","decorators.legacy","es2015","es2015.core","es2015.collection","es2015.iterable","es2015.generator","es2015.promise","es2015.proxy","es2015.reflect","es2015.symbol","es2015.symbol.wellknown"],es2016:["es5","decorators","decorators.legacy","es2015","es2015.core","es2015.collection","es2015.iterable","es2015.generator","es2015.promise","es2015.proxy","es2015.reflect","es2015.symbol","es2015.symbol.wellknown","es2016","es2016.array.include","es2016.intl"],es2017:["es5","decorators","decorators.legacy","es2015","es2015.core","es2015.collection","es2015.iterable","es2015.generator","es2015.promise","es2015.proxy","es2015.reflect","es2015.symbol","es2015.symbol.wellknown","es2016","es2016.array.include","es2016.intl","es2017","es2017.arraybuffer","es2017.date","es2017.intl","es2017.object","es2017.sharedmemory","es2017.string","es2017.typedarrays"],es2018:["es5","decorators","decorators.legacy","es2015","es2015.core","es2015.collection","es2015.iterable","es2015.generator","es2015.promise","es2015.proxy","es2015.reflect","es2015.symbol","es2015.symbol.wellknown","es2016","es2016.array.include","es2016.intl","es2017","es2017.arraybuffer","es2017.date","es2017.intl","es2017.object","es2017.sharedmemory","es2017.string","es2017.typedarrays","es2018","es2018.asynciterable","es2018.asyncgenerator","es2018.promise","es2018.regexp","es2018.intl"],es2019:["es5","decorators","decorators.legacy","es2015","es2015.core","es2015.collection","es2015.iterable","es2015.generator","es2015.promise","es2015.proxy","es2015.reflect","es2015.symbol","es2015.symbol.wellknown","es2016","es2016.array.include","es2016.intl","es2017","es2017.arraybuffer","es2017.date","es2017.intl","es2017.object","es2017.sharedmemory","es2017.string","es2017.typedarrays","es2018","es2018.asynciterable","es2018.asyncgenerator","es2018.promise","es2018.regexp","es2018.intl","es2019","es2019.array","es2019.object","es2019.string","es2019.symbol","es2019.intl"],es2020:["es5","decorators","decorators.legacy","es2015","es2015.core","es2015.collection","es2015.iterable","es2015.generator","es2015.promise","es2015.proxy","es2015.reflect","es2015.symbol","es2015.symbol.wellknown","es2016","es2016.array.include","es2016.intl","es2017","es2017.arraybuffer","es2017.date","es2017.intl","es2017.object","es2017.sharedmemory","es2017.string","es2017.typedarrays","es2018","es2018.asynciterable","es2018.asyncgenerator","es2018.promise","es2018.regexp","es2018.intl","es2019","es2019.array","es2019.object","es2019.string","es2019.symbol","es2019.intl","es2020","es2020.bigint","es2020.date","es2020.number","es2020.promise","es2020.sharedmemory","es2020.string","es2020.symbol.wellknown","es2020.intl"]};function Zte(n="es2020"){return uD[n.toLowerCase()]||uD.es2020}let lD=!1;async function Qte(n,e,t={}){if(lD)return;lD=!0;const r=t.target||"ES2020";if(!await n.exists(aD)){const s={compilerOptions:{target:r,module:"ESNext",moduleResolution:"bundler",strict:!0,skipLibCheck:!0,...t.compilerOptions}};await n.writeFile(aD,JSON.stringify(s,null,2))}const i=Zte(r);await n.mkdir(oD,{recursive:!0}),await Promise.all(i.map(async s=>{const o=`${oD}/lib.${s}.d.ts`;if(!await n.exists(o))try{const a=await e(s);await n.writeFile(o,a)}catch(a){console.error(`Failed to load TypeScript lib: ${s}`,a)}}))}function og(n){return"type"in n}function ene(n){return"score"in n}const _s=He.define(),Vh=Rn.define({create(){return[]},update(n,e){for(let t of e.effects)if(t.is(_s))return t.value;return n}}),cD=(n,e)=>(n%e+e)%e;function Hs(n,e){queueMicrotask(()=>{try{n.dispatch(e)}catch(t){console.error(t)}})}function tne(n){const e=n.toLowerCase();return Object.keys(Ym).some(t=>t.toLowerCase()===e||Ym[t].toLowerCase()===e)}function nne(n){const e=n.toLowerCase();return{javascript:"🟨",js:"🟨",typescript:"🔷",ts:"🔷",jsx:"⚛️",tsx:"⚛️",python:"🐍",py:"🐍",ruby:"💎",rb:"💎",php:"🐘",java:"☕",cpp:"⚙️",c:"⚙️",csharp:"🔷",cs:"🔷",go:"🐹",swift:"🦉",kotlin:"🟣",kt:"🟣",rust:"🦀",rs:"🦀",scala:"🔴",vb:"🔵",haskell:"🎭",hs:"🎭",lua:"🌙",perl:"🐪",pl:"🐪",bash:"🐚",shell:"🐚",sh:"🐚",zsh:"🐚",mysql:"🗃️",sql:"🗃️",html:"🌐",css:"🎨",scss:"🎨",less:"🎨",json:"📋",yaml:"⚙️",yml:"⚙️",xml:"📄",toml:"⚙️",ini:"⚙️",conf:"⚙️",log:"📄",env:"🔧",markdown:"📝",md:"📝",dockerfile:"🐳",makefile:"🔨",dockerignore:"🐳",gitignore:"📝"}[e]||"📄"}function fD(n,e,t){const r=[],i=e.state.field(Ua),s=i.path&&!i.loading,o=tne(n),a=t.length>0&&t[0].id===n;if(n.trim()){if(!a){const u={id:o?"Create new file":`Create new file "${n}"`,type:"create-file",icon:o?nne(n):"📄",query:n,requiresInput:o};r.push(u)}if(s&&!o&&!a){const u={id:`Rename to "${n}"`,type:"rename-file",icon:"✏️",query:n};r.push(u)}}return r}const rne=n=>{let{filepath:e,language:t,index:r}=n.state.facet(Xu);const i=document.createElement("div");i.className="cm-toolbar-panel";const s=document.createElement("div");s.className="cm-toolbar-state-icon",s.textContent="📄";const o=document.createElement("div");o.className="cm-toolbar-state-icon-container",o.appendChild(s),i.appendChild(o);const a=document.createElement("div");a.className="cm-toolbar-input-container",i.appendChild(a);const u=document.createElement("input");u.type="text",u.value=e||t||"",u.className="cm-toolbar-input",a.appendChild(u);const l=document.createElement("ul");l.className="cm-search-results",i.appendChild(l);let c=0,f={active:!1,type:"create-file",originalQuery:""};function d(){const B=n.dom.querySelector(".cm-gutters");if(B){const G=B.getBoundingClientRect().width;i.style.setProperty("--cm-gutter-width",`${G}px`);const V=B.querySelector(".cm-lineNumbers");if(V){const F=V.getBoundingClientRect().width;i.style.setProperty("--cm-gutter-lineno-width",`${F}px`)}}}let g=null;function m(){const B=n.dom.querySelector(".cm-gutters");B&&window.ResizeObserver&&(g=new ResizeObserver(()=>{d()}),g.observe(B))}d(),m();const y=(B,G)=>{const V=document.createElement("li");V.className=`cm-search-result ${og(B)?"cm-command-result":"cm-file-result"}`;const F=document.createElement("div");F.className="cm-search-result-icon-container";const A=document.createElement("div");A.className="cm-search-result-icon",A.textContent=og(B)?B.icon:"📄",F.appendChild(A),V.appendChild(F);const Y=document.createElement("div");return Y.className="cm-search-result-label",Y.textContent=B.id,V.appendChild(Y),G===c&&V.classList.add("selected"),V.addEventListener("mousedown",N=>{N.preventDefault()}),V.addEventListener("click",()=>w(B)),V};function b(){const B=n.state.field(Vh),G=[],V=B.filter(og),F=B.filter(ene);let A=0;V.forEach(Y=>{G.push(y(Y,A)),A++}),F.forEach(Y=>{G.push(y(Y,A)),A++}),l.replaceChildren(...G)}function w(B){og(B)?C(B):R(B)}function S(){f.active?s.textContent=f.type==="create-file"?"📄":"✏️":s.textContent="📄"}function k(B,G,V){f={active:!0,type:B,originalQuery:G,languageExtension:V},S(),u.value="",u.placeholder=V?`filename.${V}`:"filename",u.focus(),Hs(n,{effects:_s.of([])})}function x(){f={active:!1,type:"create-file",originalQuery:""},S(),u.placeholder=""}function C(B){if(B.type==="create-file")if(B.requiresInput)k("create-file",B.query,B.query);else{const G=B.query.includes(".")?B.query:`${B.query}.txt`;u.value=G,Hs(n,{effects:[_s.of([]),Vu.of({path:G})]})}else if(B.type==="rename-file"){const G=n.state.field(Ua);if(G.path){const V=B.query.includes(".")?B.query:`${B.query}.txt`;u.value=V,console.log(`Rename ${G.path} to ${V}`),Hs(n,{effects:[_s.of([]),Vu.of({path:V})]})}}}function R(B){u.value=B.id,Hs(n,{effects:[_s.of([]),Vu.of({path:B.id})]})}function P(B){if(!(!f.active||!B.trim())){if(f.type==="create-file"){const G=f.languageExtension&&!B.includes(".")?`${B}.${f.languageExtension}`:B;u.value=G,Hs(n,{effects:[_s.of([]),Vu.of({path:G})]})}else if(f.type==="rename-file"){const G=n.state.field(Ua);if(G.path){const V=B.includes(".")?B:`${B}.txt`;u.value=V,console.log(`Rename ${G.path} to ${V}`),Hs(n,{effects:[_s.of([]),Vu.of({path:V})]})}}x()}}function q(B){i.contains(B.target)||Hs(n,{effects:_s.of([])})}return u.addEventListener("click",()=>{if(!f.active){const B=u.value;let G=[];if(B.trim()){const V=(r?.search(B)||[]).slice(0,100),F=fD(B,n,V);G=V.concat(F)}Hs(n,{effects:_s.of(G)}),document.addEventListener("click",q)}}),u.addEventListener("input",B=>{const G=B.target.value;if(c=0,f.active)return;let V=[];if(G.trim()){const F=(r?.search(G)||[]).slice(0,1e3),A=fD(G,n,F);V.push(...A),V.push(...F)}Hs(n,{effects:_s.of(V)})}),u.addEventListener("keydown",B=>{if(f.active){B.key==="Enter"?(B.preventDefault(),P(u.value)):B.key==="Escape"&&(B.preventDefault(),x(),u.value=f.originalQuery);return}const G=n.state.field(Vh);B.key==="ArrowDown"?(B.preventDefault(),G.length&&(c=cD(c+1,G.length),b())):B.key==="ArrowUp"?(B.preventDefault(),G.length&&(c=cD(c-1,G.length),b())):B.key==="Enter"&&G.length&&c>=0?(B.preventDefault(),w(G[c])):B.key==="Escape"&&(B.preventDefault(),Hs(n,{effects:_s.of([])}),u.blur())}),{dom:i,top:!0,update(B){const G=B.startState.field(Vh),V=B.state.field(Vh);G!==V&&(b(),V.length===0&&document.removeEventListener("click",q))},destroy(){document.removeEventListener("click",q),g&&(g.disconnect(),g=null)}}};var Lb,hD;function ine(){if(hD)return Lb;hD=1;function n(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}function e(i,s){for(var o="",a=0,u=-1,l=0,c,f=0;f<=i.length;++f){if(f<i.length)c=i.charCodeAt(f);else{if(c===47)break;c=47}if(c===47){if(!(u===f-1||l===1))if(u!==f-1&&l===2){if(o.length<2||a!==2||o.charCodeAt(o.length-1)!==46||o.charCodeAt(o.length-2)!==46){if(o.length>2){var d=o.lastIndexOf("/");if(d!==o.length-1){d===-1?(o="",a=0):(o=o.slice(0,d),a=o.length-1-o.lastIndexOf("/")),u=f,l=0;continue}}else if(o.length===2||o.length===1){o="",a=0,u=f,l=0;continue}}s&&(o.length>0?o+="/..":o="..",a=2)}else o.length>0?o+="/"+i.slice(u+1,f):o=i.slice(u+1,f),a=f-u-1;u=f,l=0}else c===46&&l!==-1?++l:l=-1}return o}function t(i,s){var o=s.dir||s.root,a=s.base||(s.name||"")+(s.ext||"");return o?o===s.root?o+a:o+i+a:a}var r={resolve:function(){for(var s="",o=!1,a,u=arguments.length-1;u>=-1&&!o;u--){var l;u>=0?l=arguments[u]:(a===void 0&&(a=process.cwd()),l=a),n(l),l.length!==0&&(s=l+"/"+s,o=l.charCodeAt(0)===47)}return s=e(s,!o),o?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(n(s),s.length===0)return".";var o=s.charCodeAt(0)===47,a=s.charCodeAt(s.length-1)===47;return s=e(s,!o),s.length===0&&!o&&(s="."),s.length>0&&a&&(s+="/"),o?"/"+s:s},isAbsolute:function(s){return n(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,o=0;o<arguments.length;++o){var a=arguments[o];n(a),a.length>0&&(s===void 0?s=a:s+="/"+a)}return s===void 0?".":r.normalize(s)},relative:function(s,o){if(n(s),n(o),s===o||(s=r.resolve(s),o=r.resolve(o),s===o))return"";for(var a=1;a<s.length&&s.charCodeAt(a)===47;++a);for(var u=s.length,l=u-a,c=1;c<o.length&&o.charCodeAt(c)===47;++c);for(var f=o.length,d=f-c,g=l<d?l:d,m=-1,y=0;y<=g;++y){if(y===g){if(d>g){if(o.charCodeAt(c+y)===47)return o.slice(c+y+1);if(y===0)return o.slice(c+y)}else l>g&&(s.charCodeAt(a+y)===47?m=y:y===0&&(m=0));break}var b=s.charCodeAt(a+y),w=o.charCodeAt(c+y);if(b!==w)break;b===47&&(m=y)}var S="";for(y=a+m+1;y<=u;++y)(y===u||s.charCodeAt(y)===47)&&(S.length===0?S+="..":S+="/..");return S.length>0?S+o.slice(c+m):(c+=m,o.charCodeAt(c)===47&&++c,o.slice(c))},_makeLong:function(s){return s},dirname:function(s){if(n(s),s.length===0)return".";for(var o=s.charCodeAt(0),a=o===47,u=-1,l=!0,c=s.length-1;c>=1;--c)if(o=s.charCodeAt(c),o===47){if(!l){u=c;break}}else l=!1;return u===-1?a?"/":".":a&&u===1?"//":s.slice(0,u)},basename:function(s,o){if(o!==void 0&&typeof o!="string")throw new TypeError('"ext" argument must be a string');n(s);var a=0,u=-1,l=!0,c;if(o!==void 0&&o.length>0&&o.length<=s.length){if(o.length===s.length&&o===s)return"";var f=o.length-1,d=-1;for(c=s.length-1;c>=0;--c){var g=s.charCodeAt(c);if(g===47){if(!l){a=c+1;break}}else d===-1&&(l=!1,d=c+1),f>=0&&(g===o.charCodeAt(f)?--f===-1&&(u=c):(f=-1,u=d))}return a===u?u=d:u===-1&&(u=s.length),s.slice(a,u)}else{for(c=s.length-1;c>=0;--c)if(s.charCodeAt(c)===47){if(!l){a=c+1;break}}else u===-1&&(l=!1,u=c+1);return u===-1?"":s.slice(a,u)}},extname:function(s){n(s);for(var o=-1,a=0,u=-1,l=!0,c=0,f=s.length-1;f>=0;--f){var d=s.charCodeAt(f);if(d===47){if(!l){a=f+1;break}continue}u===-1&&(l=!1,u=f+1),d===46?o===-1?o=f:c!==1&&(c=1):o!==-1&&(c=-1)}return o===-1||u===-1||c===0||c===1&&o===u-1&&o===a+1?"":s.slice(o,u)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return t("/",s)},parse:function(s){n(s);var o={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return o;var a=s.charCodeAt(0),u=a===47,l;u?(o.root="/",l=1):l=0;for(var c=-1,f=0,d=-1,g=!0,m=s.length-1,y=0;m>=l;--m){if(a=s.charCodeAt(m),a===47){if(!g){f=m+1;break}continue}d===-1&&(g=!1,d=m+1),a===46?c===-1?c=m:y!==1&&(y=1):c!==-1&&(y=-1)}return c===-1||d===-1||y===0||y===1&&c===d-1&&c===f+1?d!==-1&&(f===0&&u?o.base=o.name=s.slice(1,d):o.base=o.name=s.slice(f,d)):(f===0&&u?(o.name=s.slice(1,c),o.base=s.slice(1,d)):(o.name=s.slice(f,c),o.base=s.slice(f,d)),o.ext=s.slice(c,d)),f>0?o.dir=s.slice(0,f-1):u&&(o.dir="/"),o},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,Lb=r,Lb}var sne=ine();const Xu=Ae.define({combine:n=>n[0]}),one=new ca,g1=new ca,sI=new ca,oI=new ca,aI=new ca,Vu=He.define(),uI=He.define(),ane=He.define(),Ua=Rn.define({create(n){const e=n.facet(Xu);return e.filepath?{path:e.filepath,content:"",language:null,loading:!0}:{path:null,content:e.content||"",language:e.language||null,loading:!1}},update(n,e){for(let t of e.effects){if(t.is(Vu))return{path:t.value.path,content:"",language:null,loading:!0};if(t.is(uI))return{path:t.value.path,content:t.value.content,language:t.value.language,loading:!1}}return n}});function ag(n,e){queueMicrotask(()=>{try{n.dispatch(e)}catch(t){console.error(t)}})}const une=[{key:"ArrowUp",run:n=>{const e=n.state.selection.main,t=n.state.doc.lineAt(e.head),r=n.dom.querySelector(".cm-toolbar-input");return t.number===1&&r?(r.focus(),!0):!1}}],lne=(n,e,t)=>{let r=document.createElement("pre");function i(o,a){let u=document.createTextNode(o);if(a){let l=document.createElement("span");l.appendChild(u),l.className=a,u=l}r.appendChild(u)}function s(){r.appendChild(document.createTextNode(`
|
|
192
|
-
`))}return NH(n,e.parse(n),t,i,s),r.getHTML()},cne=({content:n,fs:e,cwd:t,filepath:r,language:i,toolbar:s=!0,index:o})=>[one.of(Xu.of({content:n,fs:e,filepath:r,cwd:t,language:i,toolbar:s,index:o})),Ua,g1.of([]),sI.of([]),oI.of(zc.of(" ")),aI.of(dt.readOnly.of(!1)),UU({position:"fixed"}),Sc.of(s?rne:null),mH,fne,Wc.of(une.concat([KG])),b8,Vh],fne=gn.define(n=>{po.mount(document,NV);let{fs:e}=n.state.facet(Xu);const t=gH.debounce(async()=>{const l=n.state.field(Ua);if(l.path){const c=sne.dirname(l.path);c&&await e.mkdir(c,{recursive:!0}).catch(console.error),await e.writeFile(l.path,n.state.doc.toString()).catch(console.error)}},500);let r=null;async function i(l){if(!l)return;const c=await vR(Ym[l]);ag(n,{effects:[g1.reconfigure(c||[])]})}async function s(l){if(l&&r!==l){r=l;try{const c=l.split(".").pop()?.toLowerCase(),f=(c?Ym[c]??null:u)||"markdown";let d=f?await vR(f):null;ag(n,{effects:[g1.reconfigure(d||[])]});const m=await e.exists(l)?await e.readFile(l):"",{index:y}=n.state.facet(Xu);y&&y.add(l);const b=cJ(m)||" ",w=["ts","tsx","js","jsx"],{typescript:S}=n.state.facet(Xu);S?.resolveLib&&c&&w.includes(c)&&await Qte(e,S.resolveLib,S);let k=f?await b2.client({view:n,language:f,path:l,fs:e}):null;ag(n,{changes:{from:0,to:n.state.doc.length,insert:m},effects:[oI.reconfigure(zc.of(b)),uI.of({path:l,content:m,language:f}),sI.reconfigure([CP.of(`file:///${l}`),EP.of(f||""),...k?[k]:[]])]})}catch(c){console.error("Failed to open file",c)}finally{r=null}}}const{path:o,loading:a,language:u}=n.state.field(Ua);return!o&&u&&i(u),o&&a&&s(o),{update(l){for(let g of l.transactions.flatMap(m=>m.effects))if(g.is(Vu)&&queueMicrotask(()=>s(g.value.path)),g.is(ane)){const m=g.value.dark;l.view.dom.setAttribute("data-theme",m?"dark":"light")}const c=l.startState.field(Ua),f=l.state.field(Ua);c.loading!==f.loading&&ag(n,{effects:aI.reconfigure(dt.readOnly.of(f.loading))}),l.docChanged&&t();const d=l.state.facet(Xu).fs;e!==d&&(e=d)}}}),hne=[uH(),fH(),AU(),GV(),fV(),vU(),kU(),dt.allowMultipleSelections.of(!0),XH(),l8(gV,{fallback:!0}),kV(),VJ(),jU(),zU(),IU(),cY(),Wc.of([...YJ,...GG,...DY,...nG,...aV,...U4,...jY])];function dne({parent:n,fs:e,filepath:t,language:r,content:i="",cwd:s="/",toolbar:o=!0,index:a,dark:u}){const l=dt.create({doc:i,extensions:[hne,cne({content:i,fs:e,filepath:t,cwd:s,language:r,toolbar:o,index:a})]});return new Re({state:l,parent:n})}const dD=ap.get("proxy"),pne={canHandle(n){return n&&typeof n=="object"&&typeof n.next=="function"&&(typeof n[Symbol.iterator]=="function"||typeof n[Symbol.asyncIterator]=="function")},serialize(n){return dD.serialize(Z1(n))},async*deserialize(n){const e=dD.deserialize(n);for(;;){const{value:t,done:r}=await e.next();if(r)break;yield t}}},gne={canHandle:n=>n&&typeof n=="object"&&n.signal instanceof AbortSignal,serialize:n=>{const{signal:e,...t}=n,{port1:r,port2:i}=new MessageChannel;return e.addEventListener("abort",()=>{r.postMessage({}),r.close()},{once:!0}),[{port:i,...t},[i]]},deserialize:n=>{const{port:e,...t}=n,r=new AbortController;return e.onmessage=()=>{r.abort(),e.close()},{signal:r.signal,...t}}};var Nu={},Bu={},qu={},Ah={},ug={},pD;function mne(){if(pD)return ug;pD=1,Object.defineProperty(ug,"__esModule",{value:!0}),ug.binarySearch=n;function n(e,t){let r=0,i=e.length-1,s;for(;r<=i;){const u=Math.floor((r+i)/2),l=e[u];if(l<t)r=u+1;else if(l>t)i=u-1;else{r=u,i=u,s=u;break}}const o=Math.max(Math.min(r,i,e.length-1),0),a=Math.min(Math.max(r,i,0),e.length-1);return{low:o,high:a,match:s}}return ug}var lg={},gD;function lI(){if(gD)return lg;gD=1,Object.defineProperty(lg,"__esModule",{value:!0}),lg.translateOffset=e;let n=!1;function e(t,r,i,s,o=s){if(!r.every((c,f)=>f===0||r[f-1]<=c)){for(let c=0;c<r.length;c++){const f=r[c],d=s[c];if(t>=f&&t<=f+d){const g=o[c],m=i[c];let y=Math.min(t-f,g);return m+y}}n||(n=!0,console.warn("fromOffsets should be sorted in ascending order"))}let u=0,l=r.length-1;for(;u<=l;){const c=Math.floor((u+l)/2),f=r[c],d=s[c];if(t>=f&&t<=f+d){const g=o[c],m=i[c];let y=Math.min(t-f,g);return m+y}else t<f?l=c-1:u=c+1}}return lg}var mD;function vne(){if(mD)return Ah;mD=1,Object.defineProperty(Ah,"__esModule",{value:!0}),Ah.SourceMap=void 0;const n=mne(),e=lI();class t{constructor(s){this.mappings=s}toSourceRange(s,o,a,u){return this.findMatchingStartEnd(s,o,a,"generatedOffsets",u)}toGeneratedRange(s,o,a,u){return this.findMatchingStartEnd(s,o,a,"sourceOffsets",u)}toSourceLocation(s,o){return this.findMatchingOffsets(s,"generatedOffsets",o)}toGeneratedLocation(s,o){return this.findMatchingOffsets(s,"sourceOffsets",o)}*findMatchingOffsets(s,o,a){const u=this.getMemoBasedOnRange(o);if(u.offsets.length===0)return;const{low:l,high:c}=(0,n.binarySearch)(u.offsets,s),f=new Set,d=o=="sourceOffsets"?"generatedOffsets":"sourceOffsets";for(let g=l;g<=c;g++)for(const m of u.mappings[g]){if(f.has(m)||(f.add(m),a&&!a(m.data)))continue;const y=(0,e.translateOffset)(s,m[o],m[d],r(m,o),r(m,d));y!==void 0&&(yield[y,m])}}*findMatchingStartEnd(s,o,a,u,l){const c=u=="sourceOffsets"?"generatedOffsets":"sourceOffsets",f=[];let d=!1;for(const[g,m]of this.findMatchingOffsets(s,u)){if(l&&!l(m.data))continue;f.push([g,m]);const y=(0,e.translateOffset)(o,m[u],m[c],r(m,u),r(m,c));y!==void 0&&(d=!0,yield[g,y,m,m])}if(!d&&a){for(const[g,m]of f)for(const[y,b]of this.findMatchingOffsets(o,u))if(!(l&&!l(b.data)||y<g)){yield[g,y,m,b];break}}}getMemoBasedOnRange(s){return s==="sourceOffsets"?this.sourceCodeOffsetsMemo??=this.createMemo("sourceOffsets"):this.generatedCodeOffsetsMemo??=this.createMemo("generatedOffsets")}createMemo(s){const o=new Set;for(const l of this.mappings)for(let c=0;c<l[s].length;c++)o.add(l[s][c]),o.add(l[s][c]+r(l,s)[c]);const a=[...o].sort((l,c)=>l-c),u=a.map(()=>new Set);for(const l of this.mappings)for(let c=0;c<l[s].length;c++){const f=(0,n.binarySearch)(a,l[s][c]).match,d=(0,n.binarySearch)(a,l[s][c]+r(l,s)[c]).match;for(let g=f;g<=d;g++)u[g].add(l)}return{offsets:a,mappings:u}}}Ah.SourceMap=t;function r(i,s){return s=="sourceOffsets"?i.lengths:i.generatedLengths??i.lengths}return Ah}var vD;function w2(){return vD||(vD=1,function(n){var e=qu&&qu.__createBinding||(Object.create?function(r,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(r,o,a)}:function(r,i,s,o){o===void 0&&(o=s),r[o]=i[s]}),t=qu&&qu.__exportStar||function(r,i){for(var s in r)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,r,s)};Object.defineProperty(n,"__esModule",{value:!0}),t(vne(),n),t(lI(),n)}(qu)),qu}var vt={},yD;function yne(){if(yD)return vt;yD=1,Object.defineProperty(vt,"__esModule",{value:!0}),vt.isHoverEnabled=n,vt.isInlayHintsEnabled=e,vt.isCodeLensEnabled=t,vt.isMonikerEnabled=r,vt.isInlineValueEnabled=i,vt.isSemanticTokensEnabled=s,vt.isCallHierarchyEnabled=o,vt.isTypeHierarchyEnabled=a,vt.isRenameEnabled=u,vt.isDefinitionEnabled=l,vt.isTypeDefinitionEnabled=c,vt.isReferencesEnabled=f,vt.isImplementationEnabled=d,vt.isHighlightEnabled=g,vt.isSymbolsEnabled=m,vt.isFoldingRangesEnabled=y,vt.isSelectionRangesEnabled=b,vt.isLinkedEditingEnabled=w,vt.isColorEnabled=S,vt.isDocumentLinkEnabled=k,vt.isDiagnosticsEnabled=x,vt.isCodeActionsEnabled=C,vt.isFormattingEnabled=R,vt.isCompletionEnabled=P,vt.isAutoInsertEnabled=q,vt.isSignatureHelpEnabled=B,vt.shouldReportDiagnostics=G,vt.resolveRenameNewName=V,vt.resolveRenameEditText=F,vt.findOverlapCodeRange=A;function n(N){return!!N.semantic}function e(N){return!!N.semantic}function t(N){return!!N.semantic}function r(N){return!!N.semantic}function i(N){return!!N.semantic}function s(N){return typeof N.semantic=="object"?N.semantic.shouldHighlight?.()??!0:!!N.semantic}function o(N){return!!N.navigation}function a(N){return!!N.navigation}function u(N){return typeof N.navigation=="object"?N.navigation.shouldRename?.()??!0:!!N.navigation}function l(N){return!!N.navigation}function c(N){return!!N.navigation}function f(N){return!!N.navigation}function d(N){return!!N.navigation}function g(N){return!!N.navigation}function m(N){return!!N.structure}function y(N){return!!N.structure}function b(N){return!!N.structure}function w(N){return!!N.structure}function S(N){return!!N.structure}function k(N){return!!N.structure}function x(N){return!!N.verification}function C(N){return!!N.verification}function R(N){return!!N.format}function P(N){return!!N.completion}function q(N){return!!N.completion}function B(N){return!!N.completion}function G(N,ee,oe){return typeof N.verification=="object"?N.verification.shouldReport?.(ee,oe)??!0:!!N.verification}function V(N,ee){return typeof ee.navigation=="object"?ee.navigation.resolveRenameNewName?.(N)??N:N}function F(N,ee){return typeof ee.navigation=="object"?ee.navigation.resolveRenameEditText?.(N)??N:N}function A(N,ee,oe,be){let ve,De;for(const[we,Ie]of oe.toGeneratedLocation(N))if(be(Ie.data)){ve=we;break}for(const[we,Ie]of oe.toGeneratedLocation(ee))if(be(Ie.data)){De=we;break}if(ve===void 0||De===void 0){for(const we of oe.mappings)if(be(we.data)){const Ie=we.sourceOffsets[0],Rt=we.sourceOffsets[we.sourceOffsets.length-1]+we.lengths[we.lengths.length-1],wt=Y(N,ee,Ie,Rt);if(wt){const tt=wt.start-Ie+we.generatedOffsets[0],Jt=(we.generatedLengths??we.lengths)[we.generatedOffsets.length-1],In=Math.min(wt.end-we.sourceOffsets[we.sourceOffsets.length-1],Jt),nn=we.generatedOffsets[we.generatedOffsets.length-1]+In;ve=ve===void 0?tt:Math.min(ve,tt),De=De===void 0?nn:Math.max(De,nn)}}}if(ve!==void 0&&De!==void 0)return{start:ve,end:De}}function Y(N,ee,oe,be){const ve=Math.max(N,oe),De=Math.min(ee,be);if(!(ve>De))return{start:ve,end:De}}return vt}var Dh={},bD;function wD(){if(bD)return Dh;bD=1,Object.defineProperty(Dh,"__esModule",{value:!0}),Dh.LinkedCodeMap=void 0;const n=w2();class e extends n.SourceMap{*getLinkedOffsets(r){for(const i of this.toGeneratedLocation(r))yield i[0];for(const i of this.toSourceLocation(r))yield i[0]}}return Dh.LinkedCodeMap=e,Dh}var Fb={},_D;function bne(){return _D||(_D=1,Object.defineProperty(Fb,"__esModule",{value:!0})),Fb}var Th={},kD;function wne(){if(kD)return Th;kD=1,Object.defineProperty(Th,"__esModule",{value:!0}),Th.FileMap=void 0;class n extends Map{constructor(t){super(),this.caseSensitive=t,this.originalFileNames=new Map}keys(){return this.originalFileNames.values()}get(t){return super.get(this.normalizeId(t))}has(t){return super.has(this.normalizeId(t))}set(t,r){return this.originalFileNames.set(this.normalizeId(t),t),super.set(this.normalizeId(t),r)}delete(t){return this.originalFileNames.delete(this.normalizeId(t)),super.delete(this.normalizeId(t))}clear(){return this.originalFileNames.clear(),super.clear()}normalizeId(t){return this.caseSensitive?t:t.toLowerCase()}}return Th.FileMap=n,Th}var xD;function Lt(){return xD||(xD=1,function(n){var e=Bu&&Bu.__createBinding||(Object.create?function(l,c,f,d){d===void 0&&(d=f);var g=Object.getOwnPropertyDescriptor(c,f);(!g||("get"in g?!c.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return c[f]}}),Object.defineProperty(l,d,g)}:function(l,c,f,d){d===void 0&&(d=f),l[d]=c[f]}),t=Bu&&Bu.__exportStar||function(l,c){for(var f in l)f!=="default"&&!Object.prototype.hasOwnProperty.call(c,f)&&e(c,l,f)};Object.defineProperty(n,"__esModule",{value:!0}),n.defaultMapperFactory=n.SourceMap=void 0,n.createLanguage=a,n.forEachEmbeddedCode=u;var r=w2();Object.defineProperty(n,"SourceMap",{enumerable:!0,get:function(){return r.SourceMap}}),t(yne(),n),t(wD(),n),t(bne(),n),t(wne(),n);const i=w2(),s=wD(),o=l=>new i.SourceMap(l);n.defaultMapperFactory=o;function a(l,c,f,d){const g=new WeakMap,m=new WeakMap,y=new WeakMap,b={mapperFactory:n.defaultMapperFactory,plugins:l,scripts:{fromVirtualCode(k){return g.get(k)},get(k,x=!0,C=!1){f(k,x,C);const R=c.get(k);return R?.isAssociationDirty&&this.set(k,R.snapshot,R.languageId),c.get(k)},set(k,x,C,R=l){if(!C){for(const q of l)if(C=q.getLanguageId?.(k),C)break}if(!C){console.warn(`languageId not found for ${k}`);return}let P=!1;for(const q of l)if(q.isAssociatedFileOnly?.(k,C)){P=!0;break}if(c.has(k)){const q=c.get(k);if(q.languageId!==C||q.associatedOnly!==P)return this.delete(k),w(q),this.set(k,x,C);if(P)q.snapshot!==x&&(q.snapshot=x,w(q));else if(q.isAssociationDirty||q.snapshot!==x){q.snapshot!==x&&(q.snapshot=x,w(q));const B=S(q);if(q.generated){const{updateVirtualCode:G,createVirtualCode:V}=q.generated.languagePlugin,F=G?G(k,q.generated.root,x,B):V?.(k,C,x,B);if(F){q.generated.root=F,q.generated.embeddedCodes.clear();for(const A of u(q.generated.root))g.set(A,q),q.generated.embeddedCodes.set(A.id,A);return q}else{this.delete(k);return}}}else return q}else{const q={id:k,languageId:C,snapshot:x,associatedIds:new Set,targetIds:new Set,associatedOnly:P};if(c.set(k,q),P)return q;for(const B of R){const G=B.createVirtualCode?.(k,C,x,S(q));if(G){q.generated={root:G,languagePlugin:B,embeddedCodes:new Map};for(const V of u(G))g.set(V,q),q.generated.embeddedCodes.set(V.id,V);break}}return q}},delete(k){const x=c.get(k);x&&(x.generated?.languagePlugin.disposeVirtualCode?.(k,x.generated.root),c.delete(k),w(x))}},maps:{get(k,x){let C=m.get(k.snapshot);if(C||m.set(k.snapshot,C=new WeakMap),!C.has(x.snapshot)){const R=k.associatedScriptMappings?.get(x.id)??k.mappings;C.set(x.snapshot,b.mapperFactory(R))}return C.get(x.snapshot)},*forEach(k){const x=g.get(k);if(yield[x,this.get(k,x)],k.associatedScriptMappings)for(const[C]of k.associatedScriptMappings){const R=c.get(C);R&&(yield[R,this.get(k,R)])}}},linkedCodeMaps:{get(k){const x=g.get(k);let C=y.get(k.snapshot);return C?.[0]!==x.snapshot&&y.set(k.snapshot,C=[x.snapshot,k.linkedCodeMappings?new s.LinkedCodeMap(k.linkedCodeMappings):void 0]),C[1]}}};return b;function w(k){k.targetIds.forEach(x=>{const C=c.get(x);C&&(C.isAssociationDirty=!0,d?.(C.id))})}function S(k){for(const x of k.associatedIds)c.get(x)?.targetIds.delete(k.id);return k.associatedIds.clear(),k.isAssociationDirty=!1,{getAssociatedScript(x){f(x,!0,!0);const C=c.get(x);return C&&(C.targetIds.add(k.id),k.associatedIds.add(C.id)),C}}}}function*u(l){if(yield l,l.embeddedCodes)for(const c of l.embeddedCodes)yield*u(c)}}(Bu)),Bu}var Nb={};class qd{constructor(e,t,r,i){this._uri=e,this._languageId=t,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const t=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(t,r)}return this._content}update(e,t){for(const r of e)if(qd.isIncremental(r)){const i=fI(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(o,this._content.length);const a=Math.max(i.start.line,0),u=Math.max(i.end.line,0);let l=this._lineOffsets;const c=SD(r.text,!1,s);if(u-a===c.length)for(let d=0,g=c.length;d<g;d++)l[d+a+1]=c[d];else c.length<1e4?l.splice(a+1,u-a,...c):this._lineOffsets=l=l.slice(0,a+1).concat(c,l.slice(u+1));const f=r.text.length-(o-s);if(f!==0)for(let d=a+1+c.length,g=l.length;d<g;d++)l[d]=l[d]+f}else if(qd.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=t}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=SD(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);const t=this.getLineOffsets();let r=0,i=t.length;if(i===0)return{line:0,character:e};for(;r<i;){const o=Math.floor((r+i)/2);t[o]>e?i=o:r=o+1}const s=r-1;return e=this.ensureBeforeEOL(e,t[s]),{line:s,character:e-t[s]}}offsetAt(e){const t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;const r=t[e.line];if(e.character<=0)return r;const i=e.line+1<t.length?t[e.line+1]:this._content.length,s=Math.min(r+e.character,i);return this.ensureBeforeEOL(s,r)}ensureBeforeEOL(e,t){for(;e>t&&cI(this._content.charCodeAt(e-1));)e--;return e}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){const t=e;return t!=null&&typeof t.text=="string"&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength=="number")}static isFull(e){const t=e;return t!=null&&typeof t.text=="string"&&t.range===void 0&&t.rangeLength===void 0}}var _2;(function(n){function e(i,s,o,a){return new qd(i,s,o,a)}n.create=e;function t(i,s,o){if(i instanceof qd)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}n.update=t;function r(i,s){const o=i.getText(),a=k2(s.map(_ne),(c,f)=>{const d=c.range.start.line-f.range.start.line;return d===0?c.range.start.character-f.range.start.character:d});let u=0;const l=[];for(const c of a){const f=i.offsetAt(c.range.start);if(f<u)throw new Error("Overlapping edit");f>u&&l.push(o.substring(u,f)),c.newText.length&&l.push(c.newText),u=i.offsetAt(c.range.end)}return l.push(o.substr(u)),l.join("")}n.applyEdits=r})(_2||(_2={}));function k2(n,e){if(n.length<=1)return n;const t=n.length/2|0,r=n.slice(0,t),i=n.slice(t);k2(r,e),k2(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?n[a++]=r[s++]:n[a++]=i[o++];for(;s<r.length;)n[a++]=r[s++];for(;o<i.length;)n[a++]=i[o++];return n}function SD(n,e,t=0){const r=e?[t]:[];for(let i=0;i<n.length;i++){const s=n.charCodeAt(i);cI(s)&&(s===13&&i+1<n.length&&n.charCodeAt(i+1)===10&&i++,r.push(t+i+1))}return r}function cI(n){return n===13||n===10}function fI(n){const e=n.start,t=n.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:n}function _ne(n){const e=fI(n.range);return e!==n.range?{newText:n.newText,range:e}:n}const kne=Object.freeze(Object.defineProperty({__proto__:null,get TextDocument(){return _2}},Symbol.toStringTag,{value:"Module"})),hI=q1(kne);var pm={exports:{}},xne=pm.exports,CD;function zr(){return CD||(CD=1,function(n,e){(function(t,r){n.exports=r()})(xne,()=>(()=>{var t={975:o=>{function a(c){if(typeof c!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(c))}function u(c,f){for(var d,g="",m=0,y=-1,b=0,w=0;w<=c.length;++w){if(w<c.length)d=c.charCodeAt(w);else{if(d===47)break;d=47}if(d===47){if(!(y===w-1||b===1))if(y!==w-1&&b===2){if(g.length<2||m!==2||g.charCodeAt(g.length-1)!==46||g.charCodeAt(g.length-2)!==46){if(g.length>2){var S=g.lastIndexOf("/");if(S!==g.length-1){S===-1?(g="",m=0):m=(g=g.slice(0,S)).length-1-g.lastIndexOf("/"),y=w,b=0;continue}}else if(g.length===2||g.length===1){g="",m=0,y=w,b=0;continue}}f&&(g.length>0?g+="/..":g="..",m=2)}else g.length>0?g+="/"+c.slice(y+1,w):g=c.slice(y+1,w),m=w-y-1;y=w,b=0}else d===46&&b!==-1?++b:b=-1}return g}var l={resolve:function(){for(var c,f="",d=!1,g=arguments.length-1;g>=-1&&!d;g--){var m;g>=0?m=arguments[g]:(c===void 0&&(c=process.cwd()),m=c),a(m),m.length!==0&&(f=m+"/"+f,d=m.charCodeAt(0)===47)}return f=u(f,!d),d?f.length>0?"/"+f:"/":f.length>0?f:"."},normalize:function(c){if(a(c),c.length===0)return".";var f=c.charCodeAt(0)===47,d=c.charCodeAt(c.length-1)===47;return(c=u(c,!f)).length!==0||f||(c="."),c.length>0&&d&&(c+="/"),f?"/"+c:c},isAbsolute:function(c){return a(c),c.length>0&&c.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var c,f=0;f<arguments.length;++f){var d=arguments[f];a(d),d.length>0&&(c===void 0?c=d:c+="/"+d)}return c===void 0?".":l.normalize(c)},relative:function(c,f){if(a(c),a(f),c===f||(c=l.resolve(c))===(f=l.resolve(f)))return"";for(var d=1;d<c.length&&c.charCodeAt(d)===47;++d);for(var g=c.length,m=g-d,y=1;y<f.length&&f.charCodeAt(y)===47;++y);for(var b=f.length-y,w=m<b?m:b,S=-1,k=0;k<=w;++k){if(k===w){if(b>w){if(f.charCodeAt(y+k)===47)return f.slice(y+k+1);if(k===0)return f.slice(y+k)}else m>w&&(c.charCodeAt(d+k)===47?S=k:k===0&&(S=0));break}var x=c.charCodeAt(d+k);if(x!==f.charCodeAt(y+k))break;x===47&&(S=k)}var C="";for(k=d+S+1;k<=g;++k)k!==g&&c.charCodeAt(k)!==47||(C.length===0?C+="..":C+="/..");return C.length>0?C+f.slice(y+S):(y+=S,f.charCodeAt(y)===47&&++y,f.slice(y))},_makeLong:function(c){return c},dirname:function(c){if(a(c),c.length===0)return".";for(var f=c.charCodeAt(0),d=f===47,g=-1,m=!0,y=c.length-1;y>=1;--y)if((f=c.charCodeAt(y))===47){if(!m){g=y;break}}else m=!1;return g===-1?d?"/":".":d&&g===1?"//":c.slice(0,g)},basename:function(c,f){if(f!==void 0&&typeof f!="string")throw new TypeError('"ext" argument must be a string');a(c);var d,g=0,m=-1,y=!0;if(f!==void 0&&f.length>0&&f.length<=c.length){if(f.length===c.length&&f===c)return"";var b=f.length-1,w=-1;for(d=c.length-1;d>=0;--d){var S=c.charCodeAt(d);if(S===47){if(!y){g=d+1;break}}else w===-1&&(y=!1,w=d+1),b>=0&&(S===f.charCodeAt(b)?--b==-1&&(m=d):(b=-1,m=w))}return g===m?m=w:m===-1&&(m=c.length),c.slice(g,m)}for(d=c.length-1;d>=0;--d)if(c.charCodeAt(d)===47){if(!y){g=d+1;break}}else m===-1&&(y=!1,m=d+1);return m===-1?"":c.slice(g,m)},extname:function(c){a(c);for(var f=-1,d=0,g=-1,m=!0,y=0,b=c.length-1;b>=0;--b){var w=c.charCodeAt(b);if(w!==47)g===-1&&(m=!1,g=b+1),w===46?f===-1?f=b:y!==1&&(y=1):f!==-1&&(y=-1);else if(!m){d=b+1;break}}return f===-1||g===-1||y===0||y===1&&f===g-1&&f===d+1?"":c.slice(f,g)},format:function(c){if(c===null||typeof c!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof c);return function(f,d){var g=d.dir||d.root,m=d.base||(d.name||"")+(d.ext||"");return g?g===d.root?g+m:g+"/"+m:m}(0,c)},parse:function(c){a(c);var f={root:"",dir:"",base:"",ext:"",name:""};if(c.length===0)return f;var d,g=c.charCodeAt(0),m=g===47;m?(f.root="/",d=1):d=0;for(var y=-1,b=0,w=-1,S=!0,k=c.length-1,x=0;k>=d;--k)if((g=c.charCodeAt(k))!==47)w===-1&&(S=!1,w=k+1),g===46?y===-1?y=k:x!==1&&(x=1):y!==-1&&(x=-1);else if(!S){b=k+1;break}return y===-1||w===-1||x===0||x===1&&y===w-1&&y===b+1?w!==-1&&(f.base=f.name=b===0&&m?c.slice(1,w):c.slice(b,w)):(b===0&&m?(f.name=c.slice(1,y),f.base=c.slice(1,w)):(f.name=c.slice(b,y),f.base=c.slice(b,w)),f.ext=c.slice(y,w)),b>0?f.dir=c.slice(0,b-1):m&&(f.dir="/"),f},sep:"/",delimiter:":",win32:null,posix:null};l.posix=l,o.exports=l},70:(o,a)=>{if(Object.defineProperty(a,"__esModule",{value:!0}),a.isWindows=void 0,typeof process=="object")a.isWindows=process.platform==="win32";else if(typeof navigator=="object"){let u=navigator.userAgent;a.isWindows=u.indexOf("Windows")>=0}},231:(o,a,u)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.uriToFsPath=a.URI=void 0;const l=u(70),c=/^\w[\w\d+.-]*$/,f=/^\//,d=/^\/\//;function g(F,A){if(!F.scheme&&A)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${F.authority}", path: "${F.path}", query: "${F.query}", fragment: "${F.fragment}"}`);if(F.scheme&&!c.test(F.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(F.path){if(F.authority){if(!f.test(F.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(d.test(F.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const m="",y="/",b=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class w{static isUri(A){return A instanceof w||!!A&&typeof A.authority=="string"&&typeof A.fragment=="string"&&typeof A.path=="string"&&typeof A.query=="string"&&typeof A.scheme=="string"&&typeof A.fsPath=="string"&&typeof A.with=="function"&&typeof A.toString=="function"}scheme;authority;path;query;fragment;constructor(A,Y,N,ee,oe,be=!1){typeof A=="object"?(this.scheme=A.scheme||m,this.authority=A.authority||m,this.path=A.path||m,this.query=A.query||m,this.fragment=A.fragment||m):(this.scheme=function(ve,De){return ve||De?ve:"file"}(A,be),this.authority=Y||m,this.path=function(ve,De){switch(ve){case"https":case"http":case"file":De?De[0]!==y&&(De=y+De):De=y}return De}(this.scheme,N||m),this.query=ee||m,this.fragment=oe||m,g(this,be))}get fsPath(){return P(this,!1)}with(A){if(!A)return this;let{scheme:Y,authority:N,path:ee,query:oe,fragment:be}=A;return Y===void 0?Y=this.scheme:Y===null&&(Y=m),N===void 0?N=this.authority:N===null&&(N=m),ee===void 0?ee=this.path:ee===null&&(ee=m),oe===void 0?oe=this.query:oe===null&&(oe=m),be===void 0?be=this.fragment:be===null&&(be=m),Y===this.scheme&&N===this.authority&&ee===this.path&&oe===this.query&&be===this.fragment?this:new k(Y,N,ee,oe,be)}static parse(A,Y=!1){const N=b.exec(A);return N?new k(N[2]||m,V(N[4]||m),V(N[5]||m),V(N[7]||m),V(N[9]||m),Y):new k(m,m,m,m,m)}static file(A){let Y=m;if(l.isWindows&&(A=A.replace(/\\/g,y)),A[0]===y&&A[1]===y){const N=A.indexOf(y,2);N===-1?(Y=A.substring(2),A=y):(Y=A.substring(2,N),A=A.substring(N)||y)}return new k("file",Y,A,m,m)}static from(A){const Y=new k(A.scheme,A.authority,A.path,A.query,A.fragment);return g(Y,!0),Y}toString(A=!1){return q(this,A)}toJSON(){return this}static revive(A){if(A){if(A instanceof w)return A;{const Y=new k(A);return Y._formatted=A.external,Y._fsPath=A._sep===S?A.fsPath:null,Y}}return A}}a.URI=w;const S=l.isWindows?1:void 0;class k extends w{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=P(this,!1)),this._fsPath}toString(A=!1){return A?q(this,!0):(this._formatted||(this._formatted=q(this,!1)),this._formatted)}toJSON(){const A={$mid:1};return this._fsPath&&(A.fsPath=this._fsPath,A._sep=S),this._formatted&&(A.external=this._formatted),this.path&&(A.path=this.path),this.scheme&&(A.scheme=this.scheme),this.authority&&(A.authority=this.authority),this.query&&(A.query=this.query),this.fragment&&(A.fragment=this.fragment),A}}const x={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function C(F,A,Y){let N,ee=-1;for(let oe=0;oe<F.length;oe++){const be=F.charCodeAt(oe);if(be>=97&&be<=122||be>=65&&be<=90||be>=48&&be<=57||be===45||be===46||be===95||be===126||A&&be===47||Y&&be===91||Y&&be===93||Y&&be===58)ee!==-1&&(N+=encodeURIComponent(F.substring(ee,oe)),ee=-1),N!==void 0&&(N+=F.charAt(oe));else{N===void 0&&(N=F.substr(0,oe));const ve=x[be];ve!==void 0?(ee!==-1&&(N+=encodeURIComponent(F.substring(ee,oe)),ee=-1),N+=ve):ee===-1&&(ee=oe)}}return ee!==-1&&(N+=encodeURIComponent(F.substring(ee))),N!==void 0?N:F}function R(F){let A;for(let Y=0;Y<F.length;Y++){const N=F.charCodeAt(Y);N===35||N===63?(A===void 0&&(A=F.substr(0,Y)),A+=x[N]):A!==void 0&&(A+=F[Y])}return A!==void 0?A:F}function P(F,A){let Y;return Y=F.authority&&F.path.length>1&&F.scheme==="file"?`//${F.authority}${F.path}`:F.path.charCodeAt(0)===47&&(F.path.charCodeAt(1)>=65&&F.path.charCodeAt(1)<=90||F.path.charCodeAt(1)>=97&&F.path.charCodeAt(1)<=122)&&F.path.charCodeAt(2)===58?A?F.path.substr(1):F.path[1].toLowerCase()+F.path.substr(2):F.path,l.isWindows&&(Y=Y.replace(/\//g,"\\")),Y}function q(F,A){const Y=A?R:C;let N="",{scheme:ee,authority:oe,path:be,query:ve,fragment:De}=F;if(ee&&(N+=ee,N+=":"),(oe||ee==="file")&&(N+=y,N+=y),oe){let we=oe.indexOf("@");if(we!==-1){const Ie=oe.substr(0,we);oe=oe.substr(we+1),we=Ie.lastIndexOf(":"),we===-1?N+=Y(Ie,!1,!1):(N+=Y(Ie.substr(0,we),!1,!1),N+=":",N+=Y(Ie.substr(we+1),!1,!0)),N+="@"}oe=oe.toLowerCase(),we=oe.lastIndexOf(":"),we===-1?N+=Y(oe,!1,!0):(N+=Y(oe.substr(0,we),!1,!0),N+=oe.substr(we))}if(be){if(be.length>=3&&be.charCodeAt(0)===47&&be.charCodeAt(2)===58){const we=be.charCodeAt(1);we>=65&&we<=90&&(be=`/${String.fromCharCode(we+32)}:${be.substr(3)}`)}else if(be.length>=2&&be.charCodeAt(1)===58){const we=be.charCodeAt(0);we>=65&&we<=90&&(be=`${String.fromCharCode(we+32)}:${be.substr(2)}`)}N+=Y(be,!0,!1)}return ve&&(N+="?",N+=Y(ve,!1,!1)),De&&(N+="#",N+=A?De:C(De,!1,!1)),N}function B(F){try{return decodeURIComponent(F)}catch{return F.length>3?F.substr(0,3)+B(F.substr(3)):F}}a.uriToFsPath=P;const G=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function V(F){return F.match(G)?F.replace(G,A=>B(A)):F}},552:function(o,a,u){var l=this&&this.__createBinding||(Object.create?function(b,w,S,k){k===void 0&&(k=S);var x=Object.getOwnPropertyDescriptor(w,S);x&&!("get"in x?!w.__esModule:x.writable||x.configurable)||(x={enumerable:!0,get:function(){return w[S]}}),Object.defineProperty(b,k,x)}:function(b,w,S,k){k===void 0&&(k=S),b[k]=w[S]}),c=this&&this.__setModuleDefault||(Object.create?function(b,w){Object.defineProperty(b,"default",{enumerable:!0,value:w})}:function(b,w){b.default=w}),f=this&&this.__importStar||function(b){if(b&&b.__esModule)return b;var w={};if(b!=null)for(var S in b)S!=="default"&&Object.prototype.hasOwnProperty.call(b,S)&&l(w,b,S);return c(w,b),w};Object.defineProperty(a,"__esModule",{value:!0}),a.Utils=void 0;const d=f(u(975)),g=d.posix||d,m="/";var y;(function(b){b.joinPath=function(w,...S){return w.with({path:g.join(w.path,...S)})},b.resolvePath=function(w,...S){let k=w.path,x=!1;k[0]!==m&&(k=m+k,x=!0);let C=g.resolve(k,...S);return x&&C[0]===m&&!w.authority&&(C=C.substring(1)),w.with({path:C})},b.dirname=function(w){if(w.path.length===0||w.path===m)return w;let S=g.dirname(w.path);return S.length===1&&S.charCodeAt(0)===46&&(S=""),w.with({path:S})},b.basename=function(w){return g.basename(w.path)},b.extname=function(w){return g.extname(w.path)}})(y||(a.Utils=y={}))}},r={};function i(o){var a=r[o];if(a!==void 0)return a.exports;var u=r[o]={exports:{}};return t[o].call(u.exports,u,u.exports,i),u.exports}var s={};return(()=>{var o=s;Object.defineProperty(o,"__esModule",{value:!0}),o.Utils=o.URI=void 0;const a=i(231);Object.defineProperty(o,"URI",{enumerable:!0,get:function(){return a.URI}});const u=i(552);Object.defineProperty(o,"Utils",{enumerable:!0,get:function(){return u.Utils}})})(),s})())}(pm)),pm.exports}var cg={},Mh={},ED;function at(){return ED||(ED=1,Object.defineProperty(Mh,"__esModule",{value:!0}),Mh.NoneCancellationToken=void 0,Mh.NoneCancellationToken={isCancellationRequested:!1,onCancellationRequested:()=>({dispose:()=>{}})}),Mh}var Zr={},RD;function Et(){if(RD)return Zr;RD=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.documentFeatureWorker=n,Zr.languageFeatureWorker=e,Zr.safeCall=t,Zr.forEachEmbeddedDocument=r,Zr.getSourceRange=i,Zr.getGeneratedRange=s,Zr.getSourceRanges=o,Zr.getGeneratedRanges=a,Zr.getSourcePositions=u,Zr.getGeneratedPositions=l,Zr.getLinkedCodePositions=c;function n(f,d,g,m,y,b){return e(f,d,()=>{},function*(w){g(w)&&(yield)},m,y,b)}async function e(f,d,g,m,y,b,w){let S;const k=f.decodeEmbeddedDocumentUri(d);if(k?S=f.language.scripts.get(k[0]):S=f.language.scripts.get(d),!S)return;let x=[];if(k){const R=S.generated?.embeddedCodes.get(k[1]);if(R){const P=[f.documents.get(S.id,S.languageId,S.snapshot),f.documents.get(d,R.languageId,R.snapshot),f.language.maps.get(R,S)];await C(P,!1)}}else if(S.generated)for(const R of r(f,S,S.generated.root))x.length&&!w||await C(R,!0);else{const R=f.documents.get(d,S.languageId,S.snapshot),P=g();for(const[q,B]of Object.entries(f.plugins)){if(f.disabledServicePlugins.has(B[1]))continue;const G=await t(()=>y(B,R,P,void 0),`Language service plugin "${B[0].name}" (${q}) failed to provide document feature for ${R.uri}.`);if(!G)continue;const V=b(G,void 0);if(V&&(x.push(V),!w))break}}if(w&&x.length>0)return w(x);if(x.length>0)return x[0];async function C(R,P){for(const q of m(R))if(!(x.length&&!w))for(const[B,G]of Object.entries(f.plugins)){if(f.disabledServicePlugins.has(G[1])||x.length&&!w)continue;const V=await t(()=>y(G,R[1],q,R),`Language service plugin "${G[0].name}" (${B}) failed to provide document feature for ${R[1].uri}.`);if(V)if(P){const F=b(V,R);F&&x.push(F)}else x.push(V)}}}async function t(f,d){try{return await f()}catch(g){console.warn(d,g)}}function*r(f,d,g){if(g.embeddedCodes)for(const y of g.embeddedCodes)yield*r(f,d,y);const m=f.encodeEmbeddedDocumentUri(d.id,g.id);f.disabledEmbeddedDocumentUris.get(m)||(yield[f.documents.get(d.id,d.languageId,d.snapshot),f.documents.get(m,g.languageId,g.snapshot),f.language.maps.get(g,d)])}function i(f,d,g){for(const m of o(f,d,g))return m}function s(f,d,g){for(const m of a(f,d,g))return m}function*o([f,d,g],m,y){for(const[b,w]of g.toSourceRange(d.offsetAt(m.start),d.offsetAt(m.end),!0,y))yield{start:f.positionAt(b),end:f.positionAt(w)}}function*a([f,d,g],m,y){for(const[b,w]of g.toGeneratedRange(f.offsetAt(m.start),f.offsetAt(m.end),!0,y))yield{start:d.positionAt(b),end:d.positionAt(w)}}function*u([f,d,g],m,y=()=>!0){for(const b of g.toSourceLocation(d.offsetAt(m),y))yield f.positionAt(b[0])}function*l([f,d,g],m,y=()=>!0){for(const b of g.toGeneratedLocation(f.offsetAt(m),y))yield d.positionAt(b[0])}function*c(f,d,g){for(const m of d.getLinkedOffsets(f.offsetAt(g)))yield f.positionAt(m)}return Zr}var AD;function Sne(){if(AD)return cg;AD=1,Object.defineProperty(cg,"__esModule",{value:!0}),cg.register=r;const n=Lt(),e=at(),t=Et();function r(i){return(s,o,a,u=e.NoneCancellationToken)=>(0,t.languageFeatureWorker)(i,s,()=>({selection:o,change:a}),function*(l){for(const c of(0,t.getGeneratedPositions)(l,o,n.isAutoInsertEnabled))for(const f of l[2].toGeneratedLocation(a.rangeOffset)){yield{selection:c,change:{text:a.text,rangeOffset:f[0],rangeLength:a.rangeLength}};break}},(l,c,f)=>{if(!u.isCancellationRequested)return l[1].provideAutoInsertSnippet?.(c,f.selection,f.change,u)},l=>l)}return cg}var fg={},_i={},DD;function da(){if(DD)return _i;DD=1,Object.defineProperty(_i,"__esModule",{value:!0}),_i.createLocationSet=n,_i.withCodeAction=e,_i.withTextEdits=t,_i.withDocumentChanges=r,_i.withDiagnostics=i,_i.withLocations=s,_i.withLocationLinks=o,_i.withCallHierarchyIncomingCalls=a,_i.withCallHierarchyOutgoingCalls=u,_i.withRanges=l;function n(){const f=new Set;return{add:d,has:g};function d(y){return g(y)?!1:(f.add(m(y)),!0)}function g(y){return f.has(m(y))}function m(y){return[y.uri,y.range.start.line,y.range.start.character,y.range.end.line,y.range.end.character].join(":")}}function e(f){return c(f,d=>[d.title].join(":"))}function t(f){return c(f,d=>[d.range.start.line,d.range.start.character,d.range.end.line,d.range.end.character,d.newText].join(":"))}function r(f){return c(f,d=>JSON.stringify(d))}function i(f){return c(f,d=>[d.range.start.line,d.range.start.character,d.range.end.line,d.range.end.character,d.source,d.code,d.severity,d.message].join(":"))}function s(f){return c(f,d=>[d.uri,d.range.start.line,d.range.start.character,d.range.end.line,d.range.end.character].join(":"))}function o(f){return c(f,d=>[d.targetUri,d.targetSelectionRange.start.line,d.targetSelectionRange.start.character,d.targetSelectionRange.end.line,d.targetSelectionRange.end.character].join(":"))}function a(f){return c(f,d=>[d.from.uri,d.from.range.start.line,d.from.range.start.character,d.from.range.end.line,d.from.range.end.character].join(":"))}function u(f){return c(f,d=>[d.to.uri,d.to.range.start.line,d.to.range.start.character,d.to.range.end.line,d.to.range.end.character].join(":"))}function l(f){return c(f,d=>[d.start.line,d.start.character,d.end.line,d.end.character].join(":"))}function c(f,d){const g=new Map;for(const m of f.reverse())g.set(d(m),m);return[...g.values()]}return _i}var TD;function Cne(){if(TD)return fg;TD=1,Object.defineProperty(fg,"__esModule",{value:!0}),fg.register=s;const n=Lt(),e=zr(),t=at(),r=da(),i=Et();function s(o){return{getCallHierarchyItems(u,l,c=t.NoneCancellationToken){return(0,i.languageFeatureWorker)(o,u,()=>l,f=>(0,i.getGeneratedPositions)(f,l,n.isCallHierarchyEnabled),async(f,d,g,m)=>{if(c.isCancellationRequested)return;const y=await f[1].provideCallHierarchyItems?.(d,g,c);return y?.forEach(b=>{b.data={uri:u.toString(),original:{data:b.data},pluginIndex:o.plugins.indexOf(f),embeddedDocumentUri:m?.[1].uri}}),y},(f,d)=>d?f.map(g=>a(g,[])?.[0]).filter(g=>!!g):f,f=>r.withLocations(f.flat()))},getTypeHierarchyItems(u,l,c=t.NoneCancellationToken){return(0,i.languageFeatureWorker)(o,u,()=>l,f=>(0,i.getGeneratedPositions)(f,l,n.isTypeHierarchyEnabled),async(f,d,g,m)=>{if(c.isCancellationRequested)return;const y=await f[1].provideTypeHierarchyItems?.(d,g,c);return y?.forEach(b=>{b.data={uri:u.toString(),original:{data:b.data},pluginIndex:o.plugins.indexOf(f),embeddedDocumentUri:m?.[1].uri}}),y},(f,d)=>d?f.map(g=>a(g,[])?.[0]).filter(g=>!!g):f,f=>r.withLocations(f.flat()))},async getCallHierarchyIncomingCalls(u,l){const c=u.data;let f=[];if(c){const d=o.plugins[c.pluginIndex];if(!d[1].provideCallHierarchyIncomingCalls)return f;if(Object.assign(u,c.original),c.embeddedDocumentUri){if(!!o.decodeEmbeddedDocumentUri(e.URI.parse(c.embeddedDocumentUri))){const m=await d[1].provideCallHierarchyIncomingCalls(u,l);for(const y of m){const b=a(y.from,y.fromRanges);b&&f.push({from:b[0],fromRanges:b[1]})}}}else{const g=await d[1].provideCallHierarchyIncomingCalls(u,l);for(const m of g){const y=a(m.from,m.fromRanges);y&&f.push({from:y[0],fromRanges:y[1]})}}}return r.withCallHierarchyIncomingCalls(f)},async getCallHierarchyOutgoingCalls(u,l){const c=u.data;let f=[];if(c){const d=o.plugins[c.pluginIndex];if(!d[1].provideCallHierarchyOutgoingCalls)return f;if(Object.assign(u,c.original),c.embeddedDocumentUri){if(!!o.decodeEmbeddedDocumentUri(e.URI.parse(c.embeddedDocumentUri))){const m=await d[1].provideCallHierarchyOutgoingCalls(u,l);for(const y of m){const b=a(y.to,y.fromRanges);b&&f.push({to:b[0],fromRanges:b[1]})}}}else{const g=await d[1].provideCallHierarchyOutgoingCalls(u,l);for(const m of g){const y=a(m.to,m.fromRanges);y&&f.push({to:y[0],fromRanges:y[1]})}}}return r.withCallHierarchyOutgoingCalls(f)},async getTypeHierarchySupertypes(u,l){const c=u.data;if(c){const f=o.plugins[c.pluginIndex];if(!f[1].provideTypeHierarchySupertypes)return[];if(Object.assign(u,c.original),c.embeddedDocumentUri){if(!!o.decodeEmbeddedDocumentUri(e.URI.parse(c.embeddedDocumentUri)))return(await f[1].provideTypeHierarchySupertypes(u,l)).map(m=>a(m,[])?.[0]).filter(m=>!!m)}else return(await f[1].provideTypeHierarchySupertypes(u,l)).map(g=>a(g,[])?.[0]).filter(g=>!!g)}},async getTypeHierarchySubtypes(u,l){const c=u.data;if(c){const f=o.plugins[c.pluginIndex];if(!f[1].provideTypeHierarchySubtypes)return[];if(Object.assign(u,c.original),c.embeddedDocumentUri){if(!!o.decodeEmbeddedDocumentUri(e.URI.parse(c.embeddedDocumentUri)))return(await f[1].provideTypeHierarchySubtypes(u,l)).map(m=>a(m,[])?.[0]).filter(m=>!!m)}else return(await f[1].provideTypeHierarchySubtypes(u,l)).map(g=>a(g,[])?.[0]).filter(g=>!!g)}}};function a(u,l){const c=o.decodeEmbeddedDocumentUri(e.URI.parse(u.uri)),f=c&&o.language.scripts.get(c[0]),d=c&&f?.generated?.embeddedCodes.get(c[1]);if(!f||!d)return[u,l];const g=o.documents.get(o.encodeEmbeddedDocumentUri(f.id,d.id),d.languageId,d.snapshot);for(const[m,y]of o.language.maps.forEach(d)){const b=o.documents.get(m.id,m.languageId,m.snapshot),w=[b,g,y];let S=(0,i.getSourceRange)(w,u.range);S||(S={start:b.positionAt(0),end:b.positionAt(b.getText().length)});const k=(0,i.getSourceRange)(w,u.selectionRange);if(!k)continue;const x=l.map(R=>(0,i.getSourceRange)(w,R)).filter(R=>!!R);return[{...u,name:u.name===g.uri.substring(g.uri.lastIndexOf("/")+1)?b.uri.substring(b.uri.lastIndexOf("/")+1):u.name,uri:b.uri,range:{start:S.start,end:S.end},selectionRange:{start:k.start,end:k.end}},x]}}}return fg}var hg={},Nn={},MD;function xr(){if(MD)return Nn;MD=1,Object.defineProperty(Nn,"__esModule",{value:!0}),Nn.transformDocumentLinkTarget=r,Nn.transformMarkdown=i,Nn.transformCompletionItem=s,Nn.transformCompletionList=o,Nn.transformDocumentSymbol=a,Nn.transformFoldingRanges=u,Nn.transformHover=l,Nn.transformLocation=c,Nn.transformLocations=f,Nn.transformSelectionRange=d,Nn.transformSelectionRanges=g,Nn.transformTextEdit=m,Nn.transformWorkspaceSymbol=b,Nn.transformWorkspaceEdit=w,Nn.pushEditToDocumentChanges=S;const n=Lt(),e=zr(),t=Et();function r(k,x){let C=e.URI.parse(k);const R=x.decodeEmbeddedDocumentUri(C);if(!R)return C;const P=C.fragment.match(/^L(\d+)(,(\d+))?(-L(\d+)(,(\d+))?)?$/),q=x.language.scripts.get(R[0]),B=q?.generated?.embeddedCodes.get(R[1]);if(C=R[0],P&&q&&B){const G=x.documents.get(x.encodeEmbeddedDocumentUri(q.id,B.id),B.languageId,B.snapshot);for(const[V,F]of x.language.maps.forEach(B)){if(!F.mappings.some(oe=>(0,n.isDocumentLinkEnabled)(oe.data)))continue;const Y=[x.documents.get(V.id,V.languageId,V.snapshot),G,F],N=Number(P[1])-1,ee=Number(P[3]??1)-1;if(P[5]!==void 0){const oe=Number(P[5])-1,be=Number(P[7]??1)-1,ve=(0,t.getSourceRange)(Y,{start:{line:N,character:ee},end:{line:oe,character:be}});if(ve){C=C.with({fragment:"L"+(ve.start.line+1)+","+(ve.start.character+1)+"-L"+(ve.end.line+1)+","+(ve.end.character+1)});break}}else{let oe=!1;for(const be of(0,t.getSourcePositions)(Y,{line:N,character:ee})){oe=!0,C=C.with({fragment:"L"+(be.line+1)+","+(be.character+1)});break}if(oe)break}}}return C}function i(k,x){return k.replace(/(?!\()volar-embedded-content:\/\/\w+\/[^)]+/g,C=>{const R=C.split("|");return R[0]=r(R[0],x).toString(),R.join("|")})}function s(k,x,C,R){return{...k,additionalTextEdits:k.additionalTextEdits?.map(P=>m(P,x,C)).filter(P=>!!P),textEdit:k.textEdit?m(k.textEdit,x,C):void 0,documentation:k.documentation?typeof k.documentation=="string"?i(k.documentation,R):k.documentation.kind==="markdown"?{kind:"markdown",value:i(k.documentation.value,R)}:k.documentation:void 0}}function o(k,x,C,R){return{isIncomplete:k.isIncomplete,itemDefaults:k.itemDefaults?{...k.itemDefaults,editRange:k.itemDefaults.editRange?"replace"in k.itemDefaults.editRange?{insert:x(k.itemDefaults.editRange.insert),replace:x(k.itemDefaults.editRange.replace)}:x(k.itemDefaults.editRange):void 0}:void 0,items:k.items.map(P=>s(P,x,C,R))}}function a(k,x){const C=x(k.range);if(!C)return;const R=x(k.selectionRange);if(R)return{...k,range:C,selectionRange:R,children:k.children?.map(P=>a(P,x)).filter(P=>!!P)}}function u(k,x){const C=[];for(const R of k){const P=x({start:{line:R.startLine,character:R.startCharacter??0},end:{line:R.endLine,character:R.endCharacter??0}});P&&(R.startLine=P.start.line,R.endLine=P.end.line,R.startCharacter!==void 0&&(R.startCharacter=P.start.character),R.endCharacter!==void 0&&(R.endCharacter=P.end.character),C.push(R))}return C}function l(k,x){if(!k?.range)return k;const C=x(k.range);if(C)return{...k,range:C}}function c(k,x){const C=x(k.range);if(C)return{...k,range:C}}function f(k,x){return k.map(C=>c(C,x)).filter(C=>!!C)}function d(k,x){const C=x(k.range);if(!C)return;const R=k.parent?d(k.parent,x):void 0;return{range:C,parent:R}}function g(k,x){return k.map(C=>d(C,x)).filter(C=>!!C)}function m(k,x,C){if("range"in k){let R=x(k.range);if(R)return{...k,range:R};const P=y(x,k.range,k.newText,C);if(P)return{...k,range:P.range,newText:P.newText}}else if("replace"in k&&"insert"in k){const R=x(k.insert),P=R?x(k.replace):void 0;if(R&&P)return{...k,insert:R,replace:P};const q=y(x,k.insert,k.newText,C),B=q?y(x,k.replace,k.newText,C):void 0;if(q&&B&&q.newText===B.newText)return{...k,insert:q.range,replace:B.range,newText:q.newText}}}function y(k,x,C,R){if(x.start.line===x.end.line&&x.end.character>x.start.character){let P=x.start.character;for(;C.length&&x.end.character>P;){const q={line:x.start.line,character:x.start.character+1};if(R.getText({start:x.start,end:q})===C[0]){C=C.slice(1),P++;const B=k({start:q,end:x.end});if(B)return{newText:C,range:B}}else break}}}function b(k,x){if(!("range"in k.location))return k;const C=x(k.location);if(C)return{...k,location:C}}function w(k,x,C,R={}){const P={};let q=!1;for(const B in k.changeAnnotations){P.changeAnnotations??={};const G=k.changeAnnotations[B],V=x.decodeEmbeddedDocumentUri(e.URI.parse(B)),F=V&&x.language.scripts.get(V[0]),A=V&&F?.generated?.embeddedCodes.get(V[1]);if(F&&A)for(const[Y]of x.language.maps.forEach(A)){const N=Y.id.toString();P.changeAnnotations[N]=G;break}else P.changeAnnotations[B]=G}for(const B in k.changes){P.changes??={};const G=x.decodeEmbeddedDocumentUri(e.URI.parse(B)),V=G&&x.language.scripts.get(G[0]),F=G&&V?.generated?.embeddedCodes.get(G[1]);if(V&&F){const A=x.documents.get(x.encodeEmbeddedDocumentUri(V.id,F.id),F.languageId,F.snapshot);for(const[Y,N]of x.language.maps.forEach(F)){const ee=x.documents.get(Y.id,Y.languageId,Y.snapshot),oe=[ee,A,N],be=k.changes[B];for(const ve of be)if(C==="rename"||C==="fileName"||C==="codeAction"){let De;const we=(0,t.getSourceRange)(oe,ve.range,Ie=>(De=Ie,(0,n.isRenameEnabled)(Ie)));we&&(P.changes[ee.uri]??=[],P.changes[ee.uri].push({newText:(0,n.resolveRenameEditText)(ve.newText,De),range:we}),q=!0)}else{const De=(0,t.getSourceRange)(oe,ve.range);De&&(P.changes[ee.uri]??=[],P.changes[ee.uri].push({newText:ve.newText,range:De}),q=!0)}}}else P.changes[B]=k.changes[B],q=!0}if(k.documentChanges)for(const B of k.documentChanges){P.documentChanges??=[];let G;if("textDocument"in B){const V=x.decodeEmbeddedDocumentUri(e.URI.parse(B.textDocument.uri)),F=V&&x.language.scripts.get(V[0]),A=V&&F?.generated?.embeddedCodes.get(V[1]);if(F&&A){const Y=x.documents.get(x.encodeEmbeddedDocumentUri(F.id,A.id),A.languageId,A.snapshot);for(const[N,ee]of x.language.maps.forEach(A)){const oe=x.documents.get(N.id,N.languageId,N.snapshot),be=[oe,Y,ee];G={textDocument:{uri:oe.uri,version:R[oe.uri]??null},edits:[]};for(const ve of B.edits)if(C==="rename"||C==="fileName"||C==="codeAction"){let De;const we=(0,t.getSourceRange)(be,ve.range,Ie=>(De=Ie,(0,n.isRenameEnabled)(Ie)));we&&G.edits.push({annotationId:"annotationId"in ve?ve.annotationId:void 0,newText:(0,n.resolveRenameEditText)(ve.newText,De),range:we})}else{const De=(0,t.getSourceRange)(be,ve.range);De&&G.edits.push({annotationId:"annotationId"in ve?ve.annotationId:void 0,newText:ve.newText,range:De})}G.edits.length||(G=void 0)}}else G=B}else if(B.kind==="create")G=B;else if(B.kind==="rename"){const V=x.decodeEmbeddedDocumentUri(e.URI.parse(B.oldUri)),F=V&&x.language.scripts.get(V[0]),A=V&&F?.generated?.embeddedCodes.get(V[1]);if(A)for(const[Y]of x.language.maps.forEach(A))G={kind:"rename",oldUri:Y.id.toString(),newUri:B.newUri,options:B.options,annotationId:B.annotationId};else G=B}else if(B.kind==="delete"){const V=x.decodeEmbeddedDocumentUri(e.URI.parse(B.uri)),F=V&&x.language.scripts.get(V[0]),A=V&&F?.generated?.embeddedCodes.get(V[1]);if(A)for(const[Y]of x.language.maps.forEach(A))G={kind:"delete",uri:Y.id.toString(),options:B.options,annotationId:B.annotationId};else G=B}G&&(S(P.documentChanges,G),q=!0)}if(q)return P}function S(k,x){const C=k.find(R=>"textDocument"in R&&"textDocument"in x&&R.textDocument.uri===x.textDocument.uri);C?C.edits.push(...x.edits):k.push(x)}return Nn}var OD;function Ene(){if(OD)return hg;OD=1,Object.defineProperty(hg,"__esModule",{value:!0}),hg.register=s;const n=Lt(),e=at(),t=da(),r=Et(),i=xr();function s(o){return async(a,u,l,c=e.NoneCancellationToken)=>{if(!o.language.scripts.get(a))return;const d=new WeakSet;return await(0,r.languageFeatureWorker)(o,a,()=>({range:u,codeActionContext:l}),function*(g){const m={diagnostics:(0,i.transformLocations)(l.diagnostics,b=>(0,r.getGeneratedRange)(g,b)),only:l.only},y=(0,n.findOverlapCodeRange)(g[0].offsetAt(u.start),g[0].offsetAt(u.end),g[2],n.isCodeActionsEnabled);y&&(yield{range:{start:g[1].positionAt(y.start),end:g[1].positionAt(y.end)},codeActionContext:m})},async(g,m,{range:y,codeActionContext:b})=>{if(c.isCancellationRequested)return;const w=o.plugins.indexOf(g),S=b.diagnostics.filter(x=>{const C=x.data;return C&&C.version!==m.version?!1:C?.pluginIndex===w}).map(x=>{const C=x.data;return{...x,...C.original}}),k=await g[1].provideCodeActions?.(m,y,{...b,diagnostics:S},c);if(k?.forEach(x=>{g[1].resolveCodeAction?x.data={uri:a.toString(),version:m.version,original:{data:x.data,edit:x.edit},pluginIndex:o.plugins.indexOf(g)}:delete x.data}),k&&g[1].transformCodeAction)for(let x=0;x<k.length;x++){const C=g[1].transformCodeAction(k[x]);C&&(k[x]=C,d.add(C))}return k},g=>g.map(m=>{if(d.has(m))return m;if(m.edit){const y=(0,i.transformWorkspaceEdit)(m.edit,o,"codeAction");if(!y)return;m.edit=y}return m}).filter(m=>!!m),g=>t.withCodeAction(g.flat()))}}return hg}var dg={},PD;function Rne(){if(PD)return dg;PD=1,Object.defineProperty(dg,"__esModule",{value:!0}),dg.register=r;const n=Lt(),e=at(),t=Et();function r(i){return async(s,o=e.NoneCancellationToken)=>await(0,t.documentFeatureWorker)(i,s,a=>a[2].mappings.some(u=>(0,n.isCodeLensEnabled)(u.data)),async(a,u)=>{if(o.isCancellationRequested)return;let l=await a[1].provideCodeLenses?.(u,o);const c=i.plugins.indexOf(a);l?.forEach(g=>{a[1].resolveCodeLens?g.data={kind:"normal",uri:s.toString(),original:{data:g.data},pluginIndex:c}:delete g.data});const d=(await a[1].provideReferencesCodeLensRanges?.(u,o))?.map(g=>({range:g,data:{kind:"references",sourceFileUri:s.toString(),workerFileUri:u.uri,workerFileRange:g,pluginIndex:c}}));return l=[...l??[],...d??[]],l},(a,u)=>u?a.map(l=>{const c=(0,t.getSourceRange)(u,l.range,n.isCodeLensEnabled);if(c)return{...l,range:c}}).filter(l=>!!l):a,a=>a.flat())??[]}return dg}var pg={},ID;function Ane(){if(ID)return pg;ID=1,Object.defineProperty(pg,"__esModule",{value:!0}),pg.register=r;const n=Lt(),e=at(),t=Et();function r(i){return(s,o,a,u=e.NoneCancellationToken)=>(0,t.languageFeatureWorker)(i,s,()=>a,function*(l){for(const c of(0,t.getGeneratedRanges)(l,a,n.isColorEnabled))yield c},(l,c,f)=>{if(!u.isCancellationRequested)return l[1].provideColorPresentations?.(c,o,f,u)},(l,c)=>c?l.map(f=>{if(f.textEdit){const d=(0,t.getSourceRange)(c,f.textEdit.range);if(!d)return;f.textEdit.range=d}if(f.additionalTextEdits)for(const d of f.additionalTextEdits){const g=(0,t.getSourceRange)(c,d.range);if(!g)return;d.range=g}return f}).filter(f=>!!f):l)}return pg}var gg={},LD;function Dne(){if(LD)return gg;LD=1,Object.defineProperty(gg,"__esModule",{value:!0}),gg.register=s;const n=Lt(),e=zr(),t=at(),r=Et(),i=xr();function s(o){let a;return async(u,l,c={triggerKind:1},f=t.NoneCancellationToken)=>{let d,g;const m=o.decodeEmbeddedDocumentUri(u);if(m?d=o.language.scripts.get(m[0])?.generated?.embeddedCodes.get(m[1]):(g=o.language.scripts.get(u),d=g),!d)return{isIncomplete:!1,items:[]};if(c?.triggerKind===3&&a?.uri.toString()===u.toString())for(const w of a.results){if(!w.list?.isIncomplete)continue;const S=o.plugins.findIndex(k=>k[1]===w.plugin);if(w.embeddedDocumentUri){const k=o.decodeEmbeddedDocumentUri(w.embeddedDocumentUri),x=k&&o.language.scripts.get(k[0]),C=k&&x?.generated?.embeddedCodes.get(k[1]);if(!x||!C)continue;const R=o.documents.get(o.encodeEmbeddedDocumentUri(x.id,C.id),C.languageId,C.snapshot);for(const[P,q]of o.language.maps.forEach(C)){const G=[o.documents.get(P.id,P.languageId,P.snapshot),R,q];for(const V of(0,r.getGeneratedPositions)(G,l,F=>(0,n.isCompletionEnabled)(F)))if(w.plugin.provideCompletionItems&&(w.list=await w.plugin.provideCompletionItems(R,V,c,f),!!w.list)){for(const F of w.list.items)w.plugin.resolveCompletionItem?F.data={uri:u.toString(),original:{additionalTextEdits:F.additionalTextEdits,textEdit:F.textEdit,data:F.data},pluginIndex:S,embeddedDocumentUri:R.uri}:delete F.data;w.list=(0,i.transformCompletionList)(w.list,F=>(0,r.getSourceRange)(G,F),R,o)}}}else{if(!w.plugin.provideCompletionItems)continue;const k=o.documents.get(u,d.languageId,d.snapshot);if(w.list=await w.plugin.provideCompletionItems(k,l,c,f),!w.list)continue;for(const x of w.list.items)w.plugin.resolveCompletionItem?x.data={uri:u.toString(),original:{additionalTextEdits:x.additionalTextEdits,textEdit:x.textEdit,data:x.data},pluginIndex:S,embeddedDocumentUri:void 0}:delete x.data}}else{a={uri:u,results:[]};let w=!0,S;const k=[...o.plugins].filter(C=>!o.disabledServicePlugins.has(C[1])).sort((C,R)=>y(C[1],R[1])),x=async(C,R,P,q)=>{for(const B of k){if(f.isCancellationRequested)break;if(!B[1].provideCompletionItems||B[1].isAdditionalCompletion&&!w||c?.triggerCharacter&&!B[0].capabilities.completionProvider?.triggerCharacters?.includes(c.triggerCharacter))continue;const G=q&&typeof q.completion=="object"&&q.completion.isAdditional||B[1].isAdditionalCompletion;if(S&&(!G||S!==C.uri)||B[1].isAdditionalCompletion&&a?.results.some(A=>A.plugin===B[1]))continue;let V=await B[1].provideCompletionItems(C,R,c,f);if(!V||!V.items.length)continue;typeof q?.completion=="object"&&q.completion.onlyImport&&(V.items=V.items.filter(A=>!!A.labelDetails)),G||(S=C.uri);const F=o.plugins.indexOf(B);for(const A of V.items)B[1].resolveCompletionItem?A.data={uri:u.toString(),original:{additionalTextEdits:A.additionalTextEdits,textEdit:A.textEdit,data:A.data},pluginIndex:F,embeddedDocumentUri:P?C.uri:void 0}:delete A.data;P&&(V=(0,i.transformCompletionList)(V,A=>(0,r.getSourceRange)(P,A,n.isCompletionEnabled),C,o)),a?.results.push({embeddedDocumentUri:P?e.URI.parse(C.uri):void 0,plugin:B[1],list:V})}w=!1};if(g?.generated)for(const C of(0,r.forEachEmbeddedDocument)(o,g,g.generated.root)){let R;for(const P of(0,r.getGeneratedPositions)(C,l,q=>(R=q,(0,n.isCompletionEnabled)(q))))await x(C[1],P,C,R)}else{const C=o.documents.get(u,d.languageId,d.snapshot);await x(C,l)}}return b(a.results.map(w=>w.list));function y(w,S){return(S.isAdditionalCompletion?-1:1)-(w.isAdditionalCompletion?-1:1)}function b(w){return{isIncomplete:w.some(S=>S?.isIncomplete),itemDefaults:w.find(S=>S?.itemDefaults)?.itemDefaults,items:w.map(S=>S?.items??[]).flat()}}}}return gg}var mg={},FD;function Tne(){if(FD)return mg;FD=1,Object.defineProperty(mg,"__esModule",{value:!0}),mg.register=i;const n=zr(),e=at(),t=da(),r=Et();function i(o,a,u){return(l,c,f=e.NoneCancellationToken)=>(0,r.languageFeatureWorker)(o,l,()=>c,d=>(0,r.getGeneratedPositions)(d,c,u),async(d,g,m)=>{if(f.isCancellationRequested)return;const y=t.createLocationSet(),b=[];return await w(g,m,void 0),b;async function w(S,k,x){const C=d[1][a];if(!C||y.has({uri:S.uri,range:{start:k,end:k}}))return;y.add({uri:S.uri,range:{start:k,end:k}});const R=await C?.(S,k,f)??[];for(const P of R){let q=!1;y.add({uri:P.targetUri,range:{start:P.targetRange.start,end:P.targetRange.start}});const B=o.decodeEmbeddedDocumentUri(n.URI.parse(P.targetUri)),G=B&&o.language.scripts.get(B[0]),V=B&&G?.generated?.embeddedCodes.get(B[1]),F=V&&G?o.language.linkedCodeMaps.get(V):void 0;if(G&&V&&F){const A=o.documents.get(o.encodeEmbeddedDocumentUri(G.id,V.id),V.languageId,V.snapshot);for(const Y of(0,r.getLinkedCodePositions)(A,F,P.targetSelectionRange.start))y.has({uri:A.uri,range:{start:Y,end:Y}})||(q=!0,await w(A,Y,x??P))}q||(x?b.push({...P,originSelectionRange:x.originSelectionRange}):b.push(P))}}},(d,g)=>d.map(m=>{if(m.originSelectionRange&&g){const k=s(g,m.originSelectionRange,c);if(!k)return;m.originSelectionRange=k}let y=!1;const b=o.decodeEmbeddedDocumentUri(n.URI.parse(m.targetUri)),w=b&&o.language.scripts.get(b[0]),S=b&&w?.generated?.embeddedCodes.get(b[1]);if(w&&S){const k=o.documents.get(o.encodeEmbeddedDocumentUri(w.id,S.id),S.languageId,S.snapshot);for(const[x,C]of o.language.maps.forEach(S)){const R=o.documents.get(x.id,x.languageId,x.snapshot),P=[R,k,C],q=(0,r.getSourceRange)(P,m.targetSelectionRange);if(!q)continue;y=!0;let B=(0,r.getSourceRange)(P,m.targetRange);m.targetUri=R.uri,m.targetRange=B??q,m.targetSelectionRange=q}if(a==="provideDefinition"&&!y){for(const[x]of o.language.maps.forEach(S))if(x.id.toString()!==l.toString())return{...m,targetUri:x.id.toString(),targetRange:{start:{line:0,character:0},end:{line:0,character:0}},targetSelectionRange:{start:{line:0,character:0},end:{line:0,character:0}}};return}}return m}).filter(m=>!!m),d=>t.withLocationLinks(d.flat()))}function s(o,a,u){let l;for(const c of(0,r.getSourceRanges)(o,a))if(l||(l=c),(c.start.line<u.line||c.start.line===u.line&&c.start.character<=u.character)&&(c.end.line>u.line||c.end.line===u.line&&c.end.character>=u.character))return c;return l}return mg}var Da={},ju={},ND;function fp(){if(ND)return ju;ND=1,Object.defineProperty(ju,"__esModule",{value:!0}),ju.isInsideRange=n,ju.isEqualRange=e,ju.stringToSnapshot=t,ju.sleep=r;function n(i,s){return!(s.start.line<i.start.line||s.end.line>i.end.line||s.start.line===i.start.line&&s.start.character<i.start.character||s.end.line===i.end.line&&s.end.character>i.end.character)}function e(i,s){return i.start.line===s.start.line&&i.start.character===s.start.character&&i.end.line===s.end.line&&i.end.character===s.end.character}function t(i){return{getText:(s,o)=>i.substring(s,o),getLength:()=>i.length,getChangeRange:()=>{}}}function r(i){return new Promise(s=>setTimeout(s,i))}return ju}var vg={},BD;function hx(){if(BD)return vg;BD=1,Object.defineProperty(vg,"__esModule",{value:!0}),vg.createUriMap=n;function n(e=!1){const t=new Map,r=new Map,i=new Map;return{get size(){return t.size},get[Symbol.toStringTag](){return"UriMap"},[Symbol.iterator](){return this.entries()},clear(){return r.clear(),i.clear(),t.clear()},values(){return t.values()},*keys(){for(const o of t.keys())yield i.get(o)},*entries(){for(const[o,a]of t.entries())yield[i.get(o),a]},forEach(o,a){for(const[u,l]of this.entries())o.call(a,l,u,this)},delete(o){return t.delete(s(o))},get(o){return t.get(s(o))},has(o){return t.has(s(o))},set(o,a){return t.set(s(o),a),this}};function s(o){const a=o.toString();if(!r.has(a)){let u=o.toString();e||(u=u.toLowerCase()),r.set(a,u),i.set(u,o)}return r.get(a)}}return vg}var qD;function dx(){if(qD)return Da;qD=1,Object.defineProperty(Da,"__esModule",{value:!0}),Da.errorMarkups=void 0,Da.register=a,Da.transformDiagnostic=u,Da.updateRange=l;const n=Lt(),e=zr(),t=at(),r=fp(),i=da(),s=Et(),o=hx();Da.errorMarkups=(0,o.createUriMap)();function a(f){const d=(0,o.createUriMap)(),g={semantic:new Map,syntactic:new Map};return f.env.onDidChangeConfiguration?.(()=>{d.clear(),g.semantic.clear(),g.syntactic.clear()}),async(m,y,b=t.NoneCancellationToken)=>{let w;const S=f.decodeEmbeddedDocumentUri(m);if(S?w=f.language.scripts.get(S[0])?.generated?.embeddedCodes.get(S[1]):w=f.language.scripts.get(m),!w)return[];const k=f.documents.get(m,w.languageId,w.snapshot),x=d.get(m)??d.set(m,{semantic:{errors:[]},syntactic:{errors:[]}}).get(m);let C=!1,R=!1,P=0;for(const V of Object.values(x)){const F=V.snapshot,A=V.document,Y=F?w.snapshot.getChangeRange(F):void 0;if(V.snapshot=w.snapshot,V.document=k,!C&&A&&Y){const N={range:{start:A.positionAt(Y.span.start),end:A.positionAt(Y.span.start+Y.span.length)},newEnd:k.positionAt(Y.span.start+Y.newLength)};for(const ee of V.errors)if(!l(ee.range,N)){C=!0;break}}}return await G("syntactic",g.syntactic,x.syntactic),q(),await G("semantic",g.semantic,x.semantic),B();function q(){R&&!C&&(y?.(B()),R=!1)}function B(){return Object.values(x).flatMap(({errors:V})=>V)}async function G(V,F,A){const Y=await(0,s.documentFeatureWorker)(f,m,N=>N[2].mappings.some(ee=>(0,n.isDiagnosticsEnabled)(ee.data)),async(N,ee)=>{const oe=N[0].capabilities.diagnosticProvider?.interFileDependencies;if(V==="semantic"!==oe||(Date.now()-P>=10&&(await(0,r.sleep)(10),P=Date.now()),b.isCancellationRequested))return;const be=f.plugins.indexOf(N),ve=F.get(be)??F.set(be,new Map).get(be),De=ve.get(ee.uri);if(!oe&&De&&De.documentVersion===ee.version)return De.errors;const we=await N[1].provideDiagnostics?.(ee,b)||[];return we.forEach(Ie=>{Ie.data={uri:m.toString(),version:ee.version,pluginIndex:be,isFormat:!1,original:{data:Ie.data},documentUri:ee.uri}}),R=!0,ve.set(ee.uri,{documentVersion:ee.version,errors:we}),we},(N,ee)=>N.map(oe=>u(f,oe,ee)).filter(oe=>!!oe),N=>i.withDiagnostics(N.flat()));Y&&(A.errors=Y,A.snapshot=w?.snapshot)}}}function u(f,d,g){let m={...d};if(g){const y=(0,s.getSourceRange)(g,d.range,b=>(0,n.shouldReportDiagnostics)(b,d.source,d.code));if(!y)return;m.range=y}if(m.relatedInformation){const y=[];for(const b of m.relatedInformation){const w=f.decodeEmbeddedDocumentUri(e.URI.parse(b.location.uri)),S=w&&f.language.scripts.get(w[0]),k=w&&S?.generated?.embeddedCodes.get(w[1]);if(S&&k){const x=f.documents.get(f.encodeEmbeddedDocumentUri(S.id,k.id),k.languageId,k.snapshot);for(const[C,R]of f.language.maps.forEach(k)){const P=f.documents.get(C.id,C.languageId,C.snapshot),q=[P,x,R],B=(0,s.getSourceRange)(q,b.location.range,G=>(0,n.shouldReportDiagnostics)(G,void 0,void 0));B&&y.push({location:{uri:P.uri,range:B},message:b.message})}}else y.push(b)}m.relatedInformation=y}return m}function l(f,d){if(c(f.start,d,!1)&&c(f.end,d,!0))return f.end.line===f.start.line&&f.end.character<=f.start.character&&f.end.character++,f}function c(f,d,g){if(d.range.end.line>f.line){if(d.newEnd.line>f.line)return!0;if(d.newEnd.line===f.line)return f.character=Math.min(f.character,d.newEnd.character),!0;if(d.newEnd.line<f.line)return f.line=d.newEnd.line,f.character=d.newEnd.character,!0}else if(d.range.end.line===f.line){const m=d.newEnd.character-d.range.end.character;if(f.character>=d.range.end.character){if(d.newEnd.line!==d.range.end.line)f.line=d.newEnd.line,f.character=d.newEnd.character+f.character-d.range.end.character;else if(g?d.range.end.character<f.character:d.range.end.character<=f.character)f.character+=m;else{const y=d.range.end.character-f.character;-m>y&&(f.character+=m+y)}return!0}else{if(d.newEnd.line===d.range.end.line){const y=d.range.end.character-f.character;-m>y&&(f.character+=m+y)}else d.newEnd.line<d.range.end.line&&(f.line=d.newEnd.line,f.character=d.newEnd.character);return!0}}else if(d.range.end.line<f.line)return f.line+=d.newEnd.line-d.range.end.line,!0;return!1}return Da}var yg={},jD;function Mne(){if(jD)return yg;jD=1,Object.defineProperty(yg,"__esModule",{value:!0}),yg.register=r;const n=Lt(),e=at(),t=Et();function r(i){return(s,o=e.NoneCancellationToken)=>(0,t.documentFeatureWorker)(i,s,a=>a[2].mappings.some(u=>(0,n.isColorEnabled)(u.data)),(a,u)=>{if(!o.isCancellationRequested)return a[1].provideDocumentColors?.(u,o)},(a,u)=>u?a.map(l=>{const c=(0,t.getSourceRange)(u,l.range,n.isColorEnabled);if(c)return{range:c,color:l.color}}).filter(l=>!!l):a,a=>a.flat())}return yg}var bg={},$D;function One(){if($D)return bg;$D=1,Object.defineProperty(bg,"__esModule",{value:!0}),bg.register=r;const n=at(),e=Et(),t=xr();function r(i){return(s,o,a,u=n.NoneCancellationToken)=>(0,e.languageFeatureWorker)(i,s,()=>o,function*(l){for(const c of(0,e.getGeneratedPositions)(l,o))yield c},(l,c,f)=>{if(!u.isCancellationRequested)return l[1].provideDocumentDropEdits?.(c,f,a,u)},l=>(l.additionalEdit&&(l.additionalEdit=(0,t.transformWorkspaceEdit)(l.additionalEdit,i,void 0)),l))}return bg}var wg={},WD;function Pne(){if(WD)return wg;WD=1,Object.defineProperty(wg,"__esModule",{value:!0}),wg.register=o;const n=Lt(),e=hI,t=zr(),r=at(),i=fp(),s=Et();function o(l){return async(c,f,d,g,m=r.NoneCancellationToken)=>{const y=l.language.scripts.get(c);if(!y)return;let b=l.documents.get(c,y.languageId,y.snapshot);if(d??={start:b.positionAt(0),end:b.positionAt(b.getText().length)},!y.generated)return g?(await x(b,b,y,void 0,0,g.position,g.ch))?.edits:(await x(b,b,y,void 0,0,d,void 0))?.edits;const w=new Map,S=b.offsetAt(d.start),k=b.offsetAt(d.end);for(const C of(0,n.forEachEmbeddedCode)(y.generated.root)){const R=l.language.maps.get(C,y);if(R){const P=(0,n.findOverlapCodeRange)(S,k,R,n.isFormattingEnabled);if(P){P.start===R.mappings[0].generatedOffsets[0]&&(P.start=0);const q=R.mappings[R.mappings.length-1];P.end===q.generatedOffsets[q.generatedOffsets.length-1]+(q.generatedLengths??q.lengths)[q.lengths.length-1]&&(P.end=C.snapshot.getLength()),w.set(C.id,P)}}}try{const C=b;let R=y.snapshot,P=l.language.scripts.set(t.URI.parse(y.id.toString()+".tmp"),y.snapshot,y.languageId,[y.generated.languagePlugin])?.generated?.root;if(!P)return;let q=[];for(let V=0;(q=a(l,y.id,P,V)).length>0;V++){let F=[];for(const A of q){if(!A.mappings.some(be=>(0,n.isFormattingEnabled)(be.data)))continue;const Y=w.get(A.id);if(!Y||[...(0,n.forEachEmbeddedCode)(A)].some(be=>{if(be===A)return!1;const ve=w.get(be.id);return ve&&ve.end-ve.start>=Y.end-Y.start}))continue;const ee=[l.documents.get(c,y.languageId,R),l.documents.get(l.encodeEmbeddedDocumentUri(c,A.id),A.languageId,A.snapshot),l.language.mapperFactory(A.mappings)];let oe;if(g)for(const be of(0,s.getGeneratedPositions)(ee,g.position)){oe=await x(ee[0],ee[1],y,A,V,be,g.ch);break}else Y&&(oe=await x(ee[0],ee[1],y,A,V,{start:ee[1].positionAt(Y.start),end:ee[1].positionAt(Y.end)}));if(oe)for(const be of oe.edits){const ve=(0,s.getSourceRange)(ee,be.range);ve&&F.push({newText:be.newText,range:ve})}}if(F.length>0){const A=e.TextDocument.applyEdits(b,F);if(b=e.TextDocument.create(b.uri,b.languageId,b.version+1,A),R=(0,i.stringToSnapshot)(A),P=l.language.scripts.set(t.URI.parse(y.id.toString()+".tmp"),R,y.languageId,[y.generated.languagePlugin])?.generated?.root,!P)break}}return b.getText()===C.getText()?void 0:[{range:{start:C.positionAt(0),end:C.positionAt(C.getText().length)},newText:b.getText()}]}finally{l.language.scripts.delete(t.URI.parse(y.id.toString()+".tmp"))}async function x(C,R,P,q,B,G,V){if(l.disabledEmbeddedDocumentUris.get(t.URI.parse(R.uri)))return;let F;if(G??={start:R.positionAt(0),end:R.positionAt(R.getText().length)},q){if(F={level:B,initialIndentLevel:0},q.mappings.length){const Y=q.mappings[0].sourceOffsets[0],N=C.positionAt(Y);F.initialIndentLevel=u(C.getText(),C.offsetAt({line:N.line,character:0}),f)}for(const A of l.plugins)l.disabledServicePlugins.has(A[1])||(F=await A[1].resolveEmbeddedCodeFormattingOptions?.(P,q,F,m)??F)}for(const A of l.plugins){if(l.disabledServicePlugins.has(A[1]))continue;if(m.isCancellationRequested)break;let Y;try{V!==void 0&&G&&"line"in G&&"character"in G?A[0].capabilities.documentOnTypeFormattingProvider?.triggerCharacters?.includes(V)&&(Y=await A[1].provideOnTypeFormattingEdits?.(R,G,V,f,F,m)):V===void 0&&G&&"start"in G&&"end"in G&&(Y=await A[1].provideDocumentFormattingEdits?.(R,G,f,F,m))}catch(N){console.warn(N)}if(Y)return{plugin:A,edits:Y}}}}}function a(l,c,f,d){const g=[[f]];for(;;){if(g.length>d)return g[d];const m=[];for(const y of g[g.length-1])if(y.embeddedCodes)for(const b of y.embeddedCodes)l.disabledEmbeddedDocumentUris.get(l.encodeEmbeddedDocumentUri(c,b.id))||m.push(b);g.push(m)}}function u(l,c,f){let d=0;const g=f.tabSize||4;for(;c<l.length;){const m=l.charAt(c);if(m===" ")d++;else if(m===" ")d+=g;else break;c++}return Math.floor(d/g)}return wg}var _g={},zD;function Ine(){if(zD)return _g;zD=1,Object.defineProperty(_g,"__esModule",{value:!0}),_g.register=s;const n=Lt(),e=zr(),t=at(),r=da(),i=Et();function s(o){return(a,u,l=t.NoneCancellationToken)=>(0,i.languageFeatureWorker)(o,a,()=>u,c=>(0,i.getGeneratedPositions)(c,u,n.isHighlightEnabled),async(c,f,d)=>{if(l.isCancellationRequested)return;const g=r.createLocationSet(),m=[];return await y(f,d),m;async function y(b,w){if(!c[1].provideDocumentHighlights||g.has({uri:b.uri,range:{start:w,end:w}}))return;g.add({uri:b.uri,range:{start:w,end:w}});const S=await c[1].provideDocumentHighlights(b,w,l)??[];for(const k of S){let x=!1;g.add({uri:b.uri,range:{start:k.range.start,end:k.range.start}});const C=o.decodeEmbeddedDocumentUri(e.URI.parse(b.uri)),R=C&&o.language.scripts.get(C[0]),P=C&&R?.generated?.embeddedCodes.get(C[1]),q=P&&R?o.language.linkedCodeMaps.get(P):void 0;if(R&&P&&q){const B=o.documents.get(o.encodeEmbeddedDocumentUri(R.id,P.id),P.languageId,P.snapshot);for(const G of(0,i.getLinkedCodePositions)(B,q,k.range.start))g.has({uri:B.uri,range:{start:G,end:G}})||(x=!0,await y(B,G))}x||m.push(k)}}},(c,f)=>c.map(d=>{if(!f)return d;const g=(0,i.getSourceRange)(f,d.range,n.isHighlightEnabled);if(g)return{...d,range:g}}).filter(d=>!!d),c=>c.flat())}return _g}var kg={},UD;function Lne(){if(UD)return kg;UD=1,Object.defineProperty(kg,"__esModule",{value:!0}),kg.register=i;const n=Lt(),e=at(),t=Et(),r=xr();function i(s){return async(o,a=e.NoneCancellationToken)=>await(0,t.documentFeatureWorker)(s,o,u=>u[2].mappings.some(l=>(0,n.isDocumentLinkEnabled)(l.data)),async(u,l)=>{if(a.isCancellationRequested)return;const c=await u[1].provideDocumentLinks?.(l,a);for(const f of c??[])u[1].resolveDocumentLink?f.data={uri:o.toString(),original:{data:f.data},pluginIndex:s.plugins.indexOf(u)}:delete f.data;return c},(u,l)=>l?u.map(c=>{const f=(0,t.getSourceRange)(l,c.range,n.isDocumentLinkEnabled);if(f)return c={...c,range:f},c.target&&(c.target=(0,r.transformDocumentLinkTarget)(c.target,s).toString()),c}).filter(c=>!!c):u,u=>u.flat())??[]}return kg}var xg={},Oh={},HD;function Fne(){if(HD)return Oh;HD=1,Object.defineProperty(Oh,"__esModule",{value:!0}),Oh.SemanticTokensBuilder=void 0;let n=class{constructor(){this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(t,r,i,s,o){let a=t,u=r;this._dataLen>0&&(a-=this._prevLine,a===0&&(u-=this._prevChar)),this._data[this._dataLen++]=a,this._data[this._dataLen++]=u,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._data[this._dataLen++]=o,this._prevLine=t,this._prevChar=r}get id(){return this._id.toString()}build(){return{resultId:this.id,data:this._data}}};return Oh.SemanticTokensBuilder=n,Oh}var VD;function Nne(){if(VD)return xg;VD=1,Object.defineProperty(xg,"__esModule",{value:!0}),xg.register=i;const n=Lt(),e=Fne(),t=at(),r=Et();function i(o){return async(a,u,l,c,f=t.NoneCancellationToken)=>{const d=o.language.scripts.get(a);if(!d)return;const g=o.documents.get(a,d.languageId,d.snapshot);u||(u={start:{line:0,character:0},end:{line:g.lineCount-1,character:g.getText().length}});const m=await(0,r.languageFeatureWorker)(o,a,()=>u,function*(y){const b=(0,n.findOverlapCodeRange)(y[0].offsetAt(u.start),y[0].offsetAt(u.end),y[2],n.isSemanticTokensEnabled);b&&(yield{start:y[1].positionAt(b.start),end:y[1].positionAt(b.end)})},(y,b,w)=>{if(!f?.isCancellationRequested)return y[1].provideDocumentSemanticTokens?.(b,w,l,f)},(y,b)=>b?y.map(w=>{const S=(0,r.getSourceRange)(b,{start:{line:w[0],character:w[1]},end:{line:w[0],character:w[1]+w[2]}},n.isSemanticTokensEnabled);if(S)return[S.start.line,S.start.character,S.end.character-S.start.character,w[3],w[4]]}).filter(w=>!!w):y,y=>y.flat());if(m)return s(m)}}function s(o){const a=new e.SemanticTokensBuilder,u=o.sort((l,c)=>l[0]-c[0]===0?l[1]-c[1]:l[0]-c[0]);for(const l of u)a.push(...l);return a.build()}return xg}var Sg={},GD;function Bne(){if(GD)return Sg;GD=1,Object.defineProperty(Sg,"__esModule",{value:!0}),Sg.register=s;const n=Lt(),e=at(),t=fp(),r=Et(),i=xr();function s(a){return(u,l=e.NoneCancellationToken)=>(0,r.documentFeatureWorker)(a,u,c=>c[2].mappings.some(f=>(0,n.isSymbolsEnabled)(f.data)),(c,f)=>{if(!l.isCancellationRequested)return c[1].provideDocumentSymbols?.(f,l)},(c,f)=>f?c.map(d=>(0,i.transformDocumentSymbol)(d,g=>(0,r.getSourceRange)(f,g,n.isSymbolsEnabled))).filter(d=>!!d):c,c=>{for(let f=0;f<c.length;f++)for(let d=0;d<c.length;d++)f!==d&&(c[f]=c[f].filter(g=>{for(const m of o(c[d]))if((0,t.isInsideRange)(m.range,g.range))return m.children??=[],m.children.push(g),!1;return!0}));return c.flat()})}function*o(a){for(const u of a)u.children&&(yield*o(u.children)),yield u}return Sg}var Cg={},KD;function qne(){if(KD)return Cg;KD=1,Object.defineProperty(Cg,"__esModule",{value:!0}),Cg.register=s;const n=Lt(),e=zr(),t=at(),r=da(),i=Et();function s(o){return(a,u=t.NoneCancellationToken)=>(0,i.documentFeatureWorker)(o,a,()=>!0,async(l,c)=>{if(!u.isCancellationRequested)return await l[1].provideFileReferences?.(c,u)??[]},l=>l.map(c=>{const f=o.decodeEmbeddedDocumentUri(e.URI.parse(c.uri)),d=f&&o.language.scripts.get(f[0]),g=f&&d?.generated?.embeddedCodes.get(f[1]);if(!d||!g)return c;const m=o.documents.get(o.encodeEmbeddedDocumentUri(d.id,g.id),g.languageId,g.snapshot);for(const[y,b]of o.language.maps.forEach(g)){const w=o.documents.get(y.id,y.languageId,y.snapshot),S=[w,m,b],k=(0,i.getSourceRange)(S,c.range,n.isReferencesEnabled);if(k)return c.uri=w.uri,c.range=k,c}}).filter(c=>!!c),l=>r.withLocations(l.flat()))}return Cg}var Eg={},JD;function jne(){if(JD)return Eg;JD=1,Object.defineProperty(Eg,"__esModule",{value:!0}),Eg.register=r;const n=at(),e=da(),t=xr();function r(i){return async(s,o,a=n.NoneCancellationToken)=>{for(const u of i.plugins){if(i.disabledServicePlugins.has(u[1]))continue;if(a.isCancellationRequested)break;if(!u[1].provideFileRenameEdits)continue;const l=await u[1].provideFileRenameEdits(s,o,a);if(l){const c=(0,t.transformWorkspaceEdit)(l,i,"fileName");return c?.documentChanges&&(c.documentChanges=e.withDocumentChanges(c.documentChanges)),c}}}}return Eg}var Rg={},YD;function $ne(){if(YD)return Rg;YD=1,Object.defineProperty(Rg,"__esModule",{value:!0}),Rg.register=i;const n=Lt(),e=at(),t=Et(),r=xr();function i(s){return(o,a=e.NoneCancellationToken)=>(0,t.documentFeatureWorker)(s,o,u=>u[2].mappings.some(l=>(0,n.isFoldingRangesEnabled)(l.data)),(u,l)=>{if(!a.isCancellationRequested)return u[1].provideFoldingRanges?.(l,a)},(u,l)=>l?(0,r.transformFoldingRanges)(u,c=>(0,t.getSourceRange)(l,c,n.isFoldingRangesEnabled)):u,u=>u.flat())}return Rg}var Ag={},XD;function Wne(){if(XD)return Ag;XD=1,Object.defineProperty(Ag,"__esModule",{value:!0}),Ag.register=o;const n=Lt(),e=at(),t=fp(),r=Et(),i=xr(),s=dx();function o(a){return async(l,c,f=e.NoneCancellationToken)=>{let d=await(0,r.languageFeatureWorker)(a,l,()=>c,m=>(0,r.getGeneratedPositions)(m,c,n.isHoverEnabled),(m,y,b)=>{if(!f.isCancellationRequested)return m[1].provideHover?.(y,b,f)},(m,y)=>(!y||!m.range||(m.range=(0,r.getSourceRange)(y,m.range,n.isHoverEnabled)),m),m=>({contents:{kind:"markdown",value:m.map(u).flat().join(`
|
|
193
|
-
|
|
194
|
-
---
|
|
195
|
-
|
|
196
|
-
`)},range:m.find(y=>y.range&&(0,t.isInsideRange)(y.range,{start:c,end:c}))?.range??m[0].range}));const g=s.errorMarkups.get(l);if(g)for(const m of g)(0,t.isInsideRange)(m.error.range,{start:c,end:c})&&(d??={contents:{kind:"markdown",value:""}},d.range=m.error.range,(typeof d.contents!="object"||typeof d.contents!="string")&&(d.contents={kind:"markdown",value:d.contents}),d.contents.value&&(d.contents.value+=`
|
|
197
|
-
|
|
198
|
-
---
|
|
199
|
-
|
|
200
|
-
`),d.contents.value+=m.markup.value);return d};function u(l){return typeof l.contents=="string"?[(0,i.transformMarkdown)(l.contents,a)]:Array.isArray(l.contents)?l.contents.map(c=>typeof c=="string"?(0,i.transformMarkdown)(c,a):c.language==="md"?`\`\`\`${c.language}
|
|
201
|
-
${(0,i.transformMarkdown)(c.value,a)}
|
|
202
|
-
\`\`\``:`\`\`\`${c.language}
|
|
203
|
-
${c.value}
|
|
204
|
-
\`\`\``):"kind"in l.contents?l.contents.kind==="markdown"?[(0,i.transformMarkdown)(l.contents.value,a)]:[l.contents.value]:l.contents.language==="md"?[`\`\`\`${l.contents.language}
|
|
205
|
-
${(0,i.transformMarkdown)(l.contents.value,a)}
|
|
206
|
-
\`\`\``]:[`\`\`\`${l.contents.language}
|
|
207
|
-
${l.contents.value}
|
|
208
|
-
\`\`\``]}}return Ag}var Dg={},ZD;function zne(){if(ZD)return Dg;ZD=1,Object.defineProperty(Dg,"__esModule",{value:!0}),Dg.register=i;const n=Lt(),e=at(),t=Et(),r=xr();function i(s){return async(o,a,u=e.NoneCancellationToken)=>{if(s.language.scripts.get(o))return(0,t.languageFeatureWorker)(s,o,()=>a,function*(c){const f=(0,n.findOverlapCodeRange)(c[0].offsetAt(a.start),c[0].offsetAt(a.end),c[2],n.isInlayHintsEnabled);f&&(yield{start:c[1].positionAt(f.start),end:c[1].positionAt(f.end)})},async(c,f,d)=>{if(u.isCancellationRequested)return;const g=await c[1].provideInlayHints?.(f,d,u);return g?.forEach(m=>{c[1].resolveInlayHint?m.data={uri:o.toString(),original:{data:m.data},pluginIndex:s.plugins.indexOf(c)}:delete m.data}),g},(c,f)=>f?c.map(d=>{const g=d.textEdits?.map(m=>(0,r.transformTextEdit)(m,y=>(0,t.getSourceRange)(f,y),f[1])).filter(m=>!!m);for(const m of(0,t.getSourcePositions)(f,d.position,n.isInlayHintsEnabled))return{...d,position:m,textEdits:g}}).filter(d=>!!d):c,c=>c.flat())}}return Dg}var Tg={},QD;function Une(){if(QD)return Tg;QD=1,Object.defineProperty(Tg,"__esModule",{value:!0}),Tg.register=r;const n=Lt(),e=at(),t=Et();function r(i){return(s,o,a=e.NoneCancellationToken)=>(0,t.languageFeatureWorker)(i,s,()=>o,u=>(0,t.getGeneratedPositions)(u,o,n.isMonikerEnabled),(u,l,c)=>{if(!a.isCancellationRequested)return u[1].provideMoniker?.(l,c,a)},u=>u,u=>u.flat())}return Tg}var Mg={},eT;function Hne(){if(eT)return Mg;eT=1,Object.defineProperty(Mg,"__esModule",{value:!0}),Mg.register=r;const n=Lt(),e=at(),t=Et();function r(i){return(s,o,a,u=e.NoneCancellationToken)=>(0,t.languageFeatureWorker)(i,s,()=>o,l=>(0,t.getGeneratedRanges)(l,o,n.isInlineValueEnabled),(l,c,f)=>{if(!u.isCancellationRequested)return l[1].provideInlineValues?.(c,f,a,u)},(l,c)=>c?l.map(f=>{const d=(0,t.getSourceRange)(c,f.range,n.isInlineValueEnabled);if(d)return f.range=d,f}).filter(f=>!!f):l,l=>l.flat())}return Mg}var Og={},tT;function Vne(){if(tT)return Og;tT=1,Object.defineProperty(Og,"__esModule",{value:!0}),Og.register=r;const n=Lt(),e=at(),t=Et();function r(i){return(s,o,a=e.NoneCancellationToken)=>(0,t.languageFeatureWorker)(i,s,()=>o,function*(u){for(const l of(0,t.getGeneratedPositions)(u,o,n.isLinkedEditingEnabled))yield l},(u,l,c)=>{if(!a.isCancellationRequested)return u[1].provideLinkedEditingRanges?.(l,c,a)},(u,l)=>l?{wordPattern:u.wordPattern,ranges:u.ranges.map(c=>(0,t.getSourceRange)(l,c,n.isLinkedEditingEnabled)).filter(c=>!!c)}:u)}return Og}var Pg={},nT;function dI(){if(nT)return Pg;nT=1,Object.defineProperty(Pg,"__esModule",{value:!0}),Pg.register=s;const n=Lt(),e=zr(),t=at(),r=da(),i=Et();function s(o){return(a,u,l,c=t.NoneCancellationToken)=>(0,i.languageFeatureWorker)(o,a,()=>u,f=>(0,i.getGeneratedPositions)(f,u,n.isReferencesEnabled),async(f,d,g)=>{if(c.isCancellationRequested)return;const m=r.createLocationSet(),y=[];return await b(d,g),y;async function b(w,S){if(!f[1].provideReferences||m.has({uri:w.uri,range:{start:S,end:S}}))return;m.add({uri:w.uri,range:{start:S,end:S}});const k=await f[1].provideReferences(w,S,l,c)??[];for(const x of k){let C=!1;m.add({uri:x.uri,range:{start:x.range.start,end:x.range.start}});const R=o.decodeEmbeddedDocumentUri(e.URI.parse(x.uri)),P=R&&o.language.scripts.get(R[0]),q=R&&P?.generated?.embeddedCodes.get(R[1]),B=q&&P?o.language.linkedCodeMaps.get(q):void 0;if(P&&q&&B){const G=o.documents.get(o.encodeEmbeddedDocumentUri(P.id,q.id),q.languageId,q.snapshot);for(const V of(0,i.getLinkedCodePositions)(G,B,x.range.start))m.has({uri:G.uri,range:{start:V,end:V}})||(C=!0,await b(G,V))}C||y.push(x)}}},f=>{const d=[];for(const g of f){const m=o.decodeEmbeddedDocumentUri(e.URI.parse(g.uri)),y=m&&o.language.scripts.get(m[0]),b=m&&y?.generated?.embeddedCodes.get(m[1]);if(y&&b){const w=o.documents.get(o.encodeEmbeddedDocumentUri(y.id,b.id),b.languageId,b.snapshot);for(const[S,k]of o.language.maps.forEach(b)){const x=o.documents.get(S.id,S.languageId,S.snapshot),C=[x,w,k],R=(0,i.getSourceRange)(C,g.range,n.isReferencesEnabled);R&&d.push({uri:x.uri,range:R})}}else d.push(g)}return d},f=>r.withLocations(f.flat()))}return Pg}var Ph={},rT;function pI(){if(rT)return Ph;rT=1,Object.defineProperty(Ph,"__esModule",{value:!0}),Ph.register=o,Ph.mergeWorkspaceEdits=a;const n=Lt(),e=zr(),t=at(),r=da(),i=Et(),s=xr();function o(u){return(l,c,f,d=t.NoneCancellationToken)=>(0,i.languageFeatureWorker)(u,l,()=>({position:c,newName:f}),function*(g){let m;for(const y of(0,i.getGeneratedPositions)(g,c,b=>(m=b,(0,n.isRenameEnabled)(b))))yield{position:y,newName:(0,n.resolveRenameNewName)(f,m)}},async(g,m,y)=>{if(d.isCancellationRequested)return;const b=r.createLocationSet();let w;return await S(m,y.position,y.newName),w;async function S(k,x,C){if(!g[1].provideRenameEdits||b.has({uri:k.uri,range:{start:x,end:x}}))return;b.add({uri:k.uri,range:{start:x,end:x}});const R=await g[1].provideRenameEdits(k,x,C,d);if(R){if(w||(w={}),R.changes)for(const P in R.changes){const q=R.changes[P];for(const B of q){let G=!1;b.add({uri:P,range:{start:B.range.start,end:B.range.start}});const V=u.decodeEmbeddedDocumentUri(e.URI.parse(P)),F=V&&u.language.scripts.get(V[0]),A=V&&F?.generated?.embeddedCodes.get(V[1]),Y=A&&F?u.language.linkedCodeMaps.get(A):void 0;if(F&&A&&Y){const N=u.documents.get(u.encodeEmbeddedDocumentUri(F.id,A.id),A.languageId,A.snapshot);for(const ee of(0,i.getLinkedCodePositions)(N,Y,B.range.start))b.has({uri:N.uri,range:{start:ee,end:ee}})||(G=!0,await S(N,ee,C))}G||(w.changes||(w.changes={}),w.changes[P]||(w.changes[P]=[]),w.changes[P].push(B))}}if(R.changeAnnotations)for(const P in R.changeAnnotations)w.changeAnnotations||(w.changeAnnotations={}),w.changeAnnotations[P]=R.changeAnnotations[P];R.documentChanges&&(w.documentChanges||(w.documentChanges=[]),w.documentChanges=w.documentChanges.concat(R.documentChanges))}}},g=>(0,s.transformWorkspaceEdit)(g,u,"rename"),g=>{const m=g[0],y=g.slice(1);if(a(m,...y),m.changes)for(const b in m.changes)m.changes[b]=r.withTextEdits(m.changes[b]);return g[0]})}function a(u,...l){for(const c of l){for(const f in c.changeAnnotations)u.changeAnnotations||(u.changeAnnotations={}),u.changeAnnotations[f]=c.changeAnnotations[f];for(const f in c.changes){u.changes||(u.changes={}),u.changes[f]||(u.changes[f]=[]);const d=c.changes[f];u.changes[f]=u.changes[f].concat(d)}if(c.documentChanges){u.documentChanges||(u.documentChanges=[]);for(const f of c.documentChanges)(0,s.pushEditToDocumentChanges)(u.documentChanges,f)}}}return Ph}var Ig={},iT;function Gne(){if(iT)return Ig;iT=1,Object.defineProperty(Ig,"__esModule",{value:!0}),Ig.register=r;const n=Lt(),e=at(),t=Et();function r(i){return(s,o,a=e.NoneCancellationToken)=>(0,t.languageFeatureWorker)(i,s,()=>o,u=>(0,t.getGeneratedPositions)(u,o,n.isRenameEnabled),(u,l,c)=>{if(!a.isCancellationRequested)return u[1].provideRenameRange?.(l,c,a)},(u,l)=>l&&"start"in u&&"end"in u?(0,t.getSourceRange)(l,u):u,u=>{for(const l of u)if("start"in l&&"end"in l)return l;return u[0]})}return Ig}var Lg={},sT;function Kne(){if(sT)return Lg;sT=1,Object.defineProperty(Lg,"__esModule",{value:!0}),Lg.register=s;const n=Lt(),e=at(),t=fp(),r=Et(),i=xr();function s(o){return(a,u,l=e.NoneCancellationToken)=>(0,r.languageFeatureWorker)(o,a,()=>u,function*(c){const f=u.map(d=>{for(const g of(0,r.getGeneratedPositions)(c,d,n.isSelectionRangesEnabled))return g}).filter(d=>!!d);f.length&&(yield f)},async(c,f,d)=>{if(l.isCancellationRequested)return;const g=await c[1].provideSelectionRanges?.(f,d,l);if(g&&g.length!==d.length){console.error("Selection ranges count should be equal to positions count:",c[0].name,g.length,d.length);return}return g},(c,f)=>f?(0,i.transformSelectionRanges)(c,d=>(0,r.getSourceRange)(f,d,n.isSelectionRangesEnabled)):c,c=>{const f=[];for(let d=0;d<u.length;d++){let g=[];for(const m of c)g.push(m[d]);g=g.sort((m,y)=>(0,t.isInsideRange)(m.range,y.range)?1:(0,t.isInsideRange)(y.range,m.range)?-1:0);for(let m=1;m<g.length;m++){let y=g[m-1];const b=g[m];for(;y.parent&&(0,t.isInsideRange)(b.range,y.parent.range)&&!(0,t.isEqualRange)(b.range,y.parent.range);)y=y.parent;y&&(y.parent=b)}f.push(g[0])}return f})}return Lg}var Fg={},oT;function Jne(){if(oT)return Fg;oT=1,Object.defineProperty(Fg,"__esModule",{value:!0}),Fg.register=r;const n=Lt(),e=at(),t=Et();function r(i){return(s,o,a={triggerKind:1,isRetrigger:!1},u=e.NoneCancellationToken)=>(0,t.languageFeatureWorker)(i,s,()=>o,l=>(0,t.getGeneratedPositions)(l,o,n.isSignatureHelpEnabled),(l,c,f)=>{if(!u.isCancellationRequested&&!(a?.triggerKind===2&&a.triggerCharacter&&!(a.isRetrigger?l[0].capabilities.signatureHelpProvider?.retriggerCharacters:l[0].capabilities.signatureHelpProvider?.triggerCharacters)?.includes(a.triggerCharacter)))return l[1].provideSignatureHelp?.(c,f,a,u)},l=>l)}return Fg}var Ng={},aT;function Yne(){if(aT)return Ng;aT=1,Object.defineProperty(Ng,"__esModule",{value:!0}),Ng.register=r;const n=zr(),e=at(),t=dx();function r(i){return async(s=e.NoneCancellationToken)=>{const o=[];for(const a of i.plugins){if(i.disabledServicePlugins.has(a[1]))continue;if(s.isCancellationRequested)break;if(!a[1].provideWorkspaceDiagnostics)continue;const u=await a[1].provideWorkspaceDiagnostics(s);if(!u)continue;const l=u.map(c=>{const f=i.decodeEmbeddedDocumentUri(n.URI.parse(c.uri)),d=f&&i.language.scripts.get(f[0]),g=f&&d?.generated?.embeddedCodes.get(f[1]);if(g&&d){if(c.kind==="unchanged")return{...c,uri:d.id.toString()};{const m=i.language.maps.get(g,d),y=[i.documents.get(d.id,d.languageId,d.snapshot),i.documents.get(i.encodeEmbeddedDocumentUri(d.id,g.id),g.languageId,g.snapshot),m];return{...c,items:c.items.map(b=>(0,t.transformDiagnostic)(i,b,y)).filter(b=>!!b)}}}else return c.kind==="unchanged"?c:{...c,items:c.items.map(m=>(0,t.transformDiagnostic)(i,m,void 0)).filter(m=>!!m)}});o.push(...l)}return o}}return Ng}var Bg={},uT;function Xne(){if(uT)return Bg;uT=1,Object.defineProperty(Bg,"__esModule",{value:!0}),Bg.register=i;const n=zr(),e=at(),t=Et(),r=xr();function i(s){return async(o,a=e.NoneCancellationToken)=>{const u=[];for(const l of s.plugins){if(s.disabledServicePlugins.has(l[1]))continue;if(a.isCancellationRequested)break;if(!l[1].provideWorkspaceSymbols)continue;const c=await l[1].provideWorkspaceSymbols(o,a);if(!c)continue;const f=c.map(d=>(0,r.transformWorkspaceSymbol)(d,g=>{const m=s.decodeEmbeddedDocumentUri(n.URI.parse(g.uri)),y=m&&s.language.scripts.get(m[0]),b=m&&y?.generated?.embeddedCodes.get(m[1]);if(y&&b){const w=s.documents.get(s.encodeEmbeddedDocumentUri(y.id,b.id),b.languageId,b.snapshot);for(const[S,k]of s.language.maps.forEach(b)){const x=s.documents.get(S.id,S.languageId,S.snapshot),C=[x,w,k],R=(0,t.getSourceRange)(C,g.range);if(R)return{uri:x.uri,range:R}}}else return g})).filter(d=>!!d);f?.forEach(d=>{l[1].resolveWorkspaceSymbol?d.data={original:{data:d.data},pluginIndex:s.plugins.indexOf(l)}:delete d.data}),u.push(f)}return u.flat()}}return Bg}var qg={},lT;function Zne(){if(lT)return qg;lT=1,Object.defineProperty(qg,"__esModule",{value:!0}),qg.register=t;const n=at(),e=xr();function t(r){return async(i,s=n.NoneCancellationToken)=>{const o=i.data;if(o){const a=r.plugins[o.pluginIndex];if(!a[1].resolveCodeAction)return delete i.data,i;Object.assign(i,o.original),i=await a[1].resolveCodeAction(i,s),i=a[1].transformCodeAction?.(i)??(i.edit?{...i,edit:(0,e.transformWorkspaceEdit)(i.edit,r,"codeAction",{[o.uri]:o.version})}:i)}return delete i.data,i}}return qg}var jg={},cT;function Qne(){if(cT)return jg;cT=1,Object.defineProperty(jg,"__esModule",{value:!0}),jg.register=r;const n=zr(),e=at(),t=dI();function r(i){const s=t.register(i);return async(o,a=e.NoneCancellationToken)=>{const u=o.data;if(u?.kind==="normal"){const l=i.plugins[u.pluginIndex];if(!l[1].resolveCodeLens)return delete o.data,o;Object.assign(o,u.original),o=await l[1].resolveCodeLens(o,a)}else if(u?.kind==="references"){const l=await s(n.URI.parse(u.sourceFileUri),o.range.start,{includeDeclaration:!1},a)??[];o.command=i.commands.showReferences.create(u.sourceFileUri,o.range.start,l)}return delete o.data,o}}return jg}var $g={},fT;function ere(){if(fT)return $g;fT=1,Object.defineProperty($g,"__esModule",{value:!0}),$g.register=i;const n=zr(),e=at(),t=Et(),r=xr();function i(s){return async(o,a=e.NoneCancellationToken)=>{const u=o.data;if(u){const l=s.plugins[u.pluginIndex];if(!l[1].resolveCompletionItem)return delete o.data,o;if(o=Object.assign(o,u.original),u.embeddedDocumentUri){const c=s.decodeEmbeddedDocumentUri(n.URI.parse(u.embeddedDocumentUri)),f=c&&s.language.scripts.get(c[0]),d=c&&f?.generated?.embeddedCodes.get(c[1]);if(f&&d){const g=s.documents.get(s.encodeEmbeddedDocumentUri(f.id,d.id),d.languageId,d.snapshot);for(const[m,y]of s.language.maps.forEach(d)){const w=[s.documents.get(m.id,m.languageId,m.snapshot),g,y];o=await l[1].resolveCompletionItem(o,a),o=l[1].transformCompletionItem?.(o)??(0,r.transformCompletionItem)(o,S=>(0,t.getSourceRange)(w,S),g,s)}}}else o=await l[1].resolveCompletionItem(o,a)}return o.detail!==o.detail+".ts"&&(o.detail=o.detail),delete o.data,o}}return $g}var Wg={},hT;function tre(){if(hT)return Wg;hT=1,Object.defineProperty(Wg,"__esModule",{value:!0}),Wg.register=t;const n=at(),e=xr();function t(r){return async(i,s=n.NoneCancellationToken)=>{const o=i.data;if(o){const a=r.plugins[o.pluginIndex];if(!a[1].resolveDocumentLink)return delete i.data,i;Object.assign(i,o.original),i=await a[1].resolveDocumentLink(i,s),i.target&&(i.target=(0,e.transformDocumentLinkTarget)(i.target,r).toString())}return delete i.data,i}}return Wg}var zg={},dT;function nre(){if(dT)return zg;dT=1,Object.defineProperty(zg,"__esModule",{value:!0}),zg.register=e;const n=at();function e(t){return async(r,i=n.NoneCancellationToken)=>{const s=r.data;if(s){const o=t.plugins[s.pluginIndex];if(!o[1].resolveInlayHint)return delete r.data,r;Object.assign(r,s.original),r=await o[1].resolveInlayHint(r,i)}return delete r.data,r}}return zg}var Ug={},pT;function rre(){if(pT)return Ug;pT=1,Object.defineProperty(Ug,"__esModule",{value:!0}),Ug.register=e;const n=at();function e(t){return async(r,i=n.NoneCancellationToken)=>{const s=r.data;if(s){const o=t.plugins[s.pluginIndex];if(!o[1].resolveWorkspaceSymbol)return delete r.data,r;Object.assign(r,s.original),r=await o[1].resolveWorkspaceSymbol(r,i)}return delete r.data,r}}return Ug}var gT;function ire(){return gT||(gT=1,function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.embeddedContentScheme=void 0,n.createLanguageService=Jt,n.decodeEmbeddedDocumentUri=In,n.encodeEmbeddedDocumentUri=nn;const e=Lt(),t=hI,r=zr(),i=Sne(),s=Cne(),o=Ene(),a=Rne(),u=Ane(),l=Dne(),c=Tne(),f=dx(),d=Mne(),g=One(),m=Pne(),y=Ine(),b=Lne(),w=Nne(),S=Bne(),k=qne(),x=jne(),C=$ne(),R=Wne(),P=zne(),q=Une(),B=Hne(),G=Vne(),V=dI(),F=pI(),A=Gne(),Y=Kne(),N=Jne(),ee=Yne(),oe=Xne(),be=Zne(),ve=Qne(),De=ere(),we=tre(),Ie=nre(),Rt=rre(),wt=at(),tt=hx();n.embeddedContentScheme="volar-embedded-content";function Jt(Pt,Se,Je,An){const Le=(0,tt.createUriMap)(),$t=new WeakMap,xn={language:Pt,project:An,getLanguageService:()=>Yt,documents:{get(st,Ln,At){$t.has(At)||$t.set(At,(0,tt.createUriMap)());const ut=$t.get(At);if(!ut.has(st)){const or=Le.get(st)??0;Le.set(st,or+1),ut.set(st,t.TextDocument.create(st.toString(),Ln,or,At.getText(0,At.getLength())))}return ut.get(st)}},env:Je,inject:(st,...Ln)=>{for(const At of xn.plugins){if(xn.disabledServicePlugins.has(At[1]))continue;const ut=At[1].provide?.[st];if(ut)return ut(...Ln)}},plugins:[],commands:{rename:{create(st,Ln){return{title:"",command:"editor.action.rename",arguments:[st,Ln]}},is(st){return st.command==="editor.action.rename"}},showReferences:{create(st,Ln,At){return{title:At.length===1?"1 reference":`${At.length} references`,command:"editor.action.showReferences",arguments:[st,Ln,At]}},is(st){return st.command==="editor.action.showReferences"}},setSelection:{create(st){return{title:"",command:"setSelection",arguments:[{selection:{selectionStartLineNumber:st.line+1,positionLineNumber:st.line+1,selectionStartColumn:st.character+1,positionColumn:st.character+1}}]}},is(st){return st.command==="setSelection"}}},disabledEmbeddedDocumentUris:(0,tt.createUriMap)(),disabledServicePlugins:new WeakSet,decodeEmbeddedDocumentUri:In,encodeEmbeddedDocumentUri:nn};for(const st of Se)xn.plugins.push([st,st.create(xn)]);const Yt=mn(Se,xn);return Yt}function In(Pt){if(Pt.scheme===n.embeddedContentScheme){const Se=decodeURIComponent(Pt.authority),Je=decodeURIComponent(Pt.path.substring(1));return[r.URI.parse(Je),Se]}}function nn(Pt,Se){return Se!==Se.toLowerCase()&&console.error(`embeddedContentId must be lowercase: ${Se}`),r.URI.from({scheme:n.embeddedContentScheme,authority:encodeURIComponent(Se),path:"/"+encodeURIComponent(Pt.toString())})}function mn(Pt,Se){const Je=Pt.map(Le=>Le.capabilities.semanticTokensProvider?.legend?.tokenModifiers??[]).flat(),An=Pt.map(Le=>Le.capabilities.semanticTokensProvider?.legend?.tokenTypes??[]).flat();return{semanticTokenLegend:{tokenModifiers:[...new Set(Je)],tokenTypes:[...new Set(An)]},commands:Pt.map(Le=>Le.capabilities.executeCommandProvider?.commands??[]).flat(),triggerCharacters:Pt.map(Le=>Le.capabilities.completionProvider?.triggerCharacters??[]).flat(),autoFormatTriggerCharacters:Pt.map(Le=>Le.capabilities.documentOnTypeFormattingProvider?.triggerCharacters??[]).flat(),signatureHelpTriggerCharacters:Pt.map(Le=>Le.capabilities.signatureHelpProvider?.triggerCharacters??[]).flat(),signatureHelpRetriggerCharacters:Pt.map(Le=>Le.capabilities.signatureHelpProvider?.retriggerCharacters??[]).flat(),executeCommand(Le,$t,xn=wt.NoneCancellationToken){for(const Yt of Se.plugins)if(!Se.disabledServicePlugins.has(Yt[1])&&!(!Yt[1].executeCommand||!Yt[0].capabilities.executeCommandProvider?.commands.includes(Le)))return Yt[1].executeCommand(Le,$t,xn)},getDocumentFormattingEdits:m.register(Se),getFoldingRanges:C.register(Se),getSelectionRanges:Y.register(Se),getLinkedEditingRanges:G.register(Se),getDocumentSymbols:S.register(Se),getDocumentColors:d.register(Se),getColorPresentations:u.register(Se),getDiagnostics:f.register(Se),getWorkspaceDiagnostics:ee.register(Se),getReferences:V.register(Se),getFileReferences:k.register(Se),getDeclaration:c.register(Se,"provideDeclaration",e.isDefinitionEnabled),getDefinition:c.register(Se,"provideDefinition",e.isDefinitionEnabled),getTypeDefinition:c.register(Se,"provideTypeDefinition",e.isTypeDefinitionEnabled),getImplementations:c.register(Se,"provideImplementation",e.isImplementationEnabled),getRenameRange:A.register(Se),getRenameEdits:F.register(Se),getFileRenameEdits:x.register(Se),getSemanticTokens:w.register(Se),getHover:R.register(Se),getCompletionItems:l.register(Se),getCodeActions:o.register(Se),getSignatureHelp:N.register(Se),getCodeLenses:a.register(Se),getDocumentHighlights:y.register(Se),getDocumentLinks:b.register(Se),getWorkspaceSymbols:oe.register(Se),getAutoInsertSnippet:i.register(Se),getDocumentDropEdits:g.register(Se),getInlayHints:P.register(Se),getMoniker:q.register(Se),getInlineValue:B.register(Se),resolveCodeAction:be.register(Se),resolveCompletionItem:De.register(Se),resolveCodeLens:ve.register(Se),resolveDocumentLink:we.register(Se),resolveInlayHint:Ie.register(Se),resolveWorkspaceSymbol:Rt.register(Se),...s.register(Se),dispose:()=>Se.plugins.forEach(Le=>Le[1].dispose?.()),context:Se}}}(Nb)),Nb}var Ih={},mT;function sre(){if(mT)return Ih;mT=1,Object.defineProperty(Ih,"__esModule",{value:!0}),Ih.FileType=void 0;var n;return function(e){e[e.Unknown=0]="Unknown",e[e.File=1]="File",e[e.Directory=2]="Directory",e[e.SymbolicLink=64]="SymbolicLink"}(n||(Ih.FileType=n={})),Ih}var vT;function ore(){return vT||(vT=1,function(n){var e=Nu&&Nu.__createBinding||(Object.create?function(i,s,o,a){a===void 0&&(a=o);var u=Object.getOwnPropertyDescriptor(s,o);(!u||("get"in u?!s.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return s[o]}}),Object.defineProperty(i,a,u)}:function(i,s,o,a){a===void 0&&(a=o),i[a]=s[o]}),t=Nu&&Nu.__exportStar||function(i,s){for(var o in i)o!=="default"&&!Object.prototype.hasOwnProperty.call(s,o)&&e(s,i,o)};Object.defineProperty(n,"__esModule",{value:!0}),n.mergeWorkspaceEdits=void 0,t(Lt(),n),t(ire(),n);var r=pI();Object.defineProperty(n,"mergeWorkspaceEdits",{enumerable:!0,get:function(){return r.mergeWorkspaceEdits}}),t(sre(),n),t(xr(),n),t(hx(),n)}(Nu)),Nu}var dr=ore();ap.set("asyncGenerator",pne);ap.set("watchOptions",gne);var m1;(n=>{n.fromJswasiFs=async t=>{const r=c=>{switch(c){case 3:return dr.FileType.Directory;case 7:return dr.FileType.SymbolicLink;default:return dr.FileType.File}},i=c=>c&&c.startsWith("/")?c:`/${c??""}`,s=fe,o=ro,a=CT,u=uc,l=Xs;return{async readFile(c){const f=i(c),{desc:d,err:g}=await t.open(f);if(g!==s)throw new Error(`readFile open failed (${g}) for ${f}`);const{content:m,err:y}=await d.read_str();if(y!==s)throw new Error(`readFile read_str failed (${y}) for ${f}`);return d.close(),m},async writeFile(c,f){const d=i(c),{desc:g,err:m}=await t.open(d,0,u|a);if(m!==s)throw new Error(`writeFile open failed (${m}) for ${d}`);const b=new TextEncoder().encode(f),{err:w}=await g.pwrite(b.buffer,0n);if(g.close(),w!==s)throw new Error(`writeFile pwrite failed (${w}) for ${d}`)},async*watch(c,{signal:f}){return t.watch(c,{signal:f})},async mkdir(c,f){const d=i(c);if(f?.recursive){const g=d.split("/").filter(Boolean);let m="/";for(const y of g){if(m=m==="/"?`/${y}`:`${m}/${y}`,console.log("creating",{cur:m,abs:d}),await this.exists(m))continue;const w=await t.createDir(m);if(w!==s&&w!==o)throw new Error(`mkdir recursive failed (${w}) at ${m}`)}}else{const g=await t.createDir(d);if(g!==s)throw new Error(`mkdir failed (${g}) for ${d}`)}},async readDir(c){const f=i(c),{desc:d,err:g}=await t.open(f,0,l);if(g!==s)throw new Error(`readDir open failed (${g}) for ${f}`);const{err:m,dirents:y}=await d.readdir(!0);if(m!==s)throw new Error(`readDir readdir failed (${m}) for ${f}`);return y.map(b=>[b.name,r(b.d_type)])},async exists(c){const f=i(c),{desc:d,err:g}=await t.open(f);if(g!==s)return!1;const m=await d.getFilestat();return d.close(),m.err===s},async stat(c){const f=i(c),{desc:d,err:g}=await t.open(f);if(g!==s)return null;const m=await d.getFilestat();if(d.close(),m.err!==s)return null;const y=m.filestat,b=w=>new Date(Number(w/1000000n));return{name:f,atime:b(y.atim),mtime:b(y.mtim),ctime:b(y.ctim),size:Number(y.size),type:r(y.filetype)}}}},n.fromMemfs=t=>({async readFile(r){return t.promises.readFile(r,{encoding:"utf-8"})},async writeFile(r,i){await t.promises.writeFile(r,i)},async*watch(r,{signal:i}){for await(const s of await t.promises.watch(r,{signal:i,encoding:"utf-8",recursive:!0}))yield s},async mkdir(r,i){await t.promises.mkdir(r,i)},async readDir(r){return(await t.readdirSync(r,{withFileTypes:!0,encoding:"utf-8"})).map(s=>{let o=dr.FileType.File;switch(s.mode&61440){case 16384:o=dr.FileType.Directory;break;case 40960:o=dr.FileType.SymbolicLink;break}return[s.name,o]})},async exists(r){return t.existsSync(r)},async stat(r){try{const i=await t.promises.stat(r);let s=dr.FileType.File;switch(i.mode&61440){case 16384:s=dr.FileType.Directory;break;case 40960:s=dr.FileType.SymbolicLink;break}return{name:r,atime:i.atime,mtime:i.mtime,ctime:i.ctime,size:i.size,type:s}}catch{return null}}}),n.fromNodelike=t=>({async readFile(r){return t.readFile(r,{encoding:"utf-8"})},async writeFile(r,i){await t.writeFile(r,i)},async*watch(r,{signal:i}){for await(const s of await t.watch(r,{signal:i,encoding:"utf-8",recursive:!0}))yield s},async mkdir(r,i){await t.mkdir(r,i)},async readDir(r){return(await t.readdir(r,{withFileTypes:!0,encoding:"utf-8"})).map(s=>{let o=dr.FileType.File;switch(s.stats.mode&61440){case 16384:o=dr.FileType.Directory;break;case 40960:o=dr.FileType.SymbolicLink;break}return[s.path,o]})},async exists(r){try{return await t.access(r),!0}catch{return!1}},async stat(r){try{const i=await t.stat(r);let s=dr.FileType.File;switch(i.mode&61440){case 16384:s=dr.FileType.Directory;break;case 40960:s=dr.FileType.SymbolicLink;break}return{name:r,atime:i.atime,mtime:i.mtime,ctime:i.ctime,size:i.size,type:s}}catch{return null}}}),n.worker=async t=>{const r=new SharedWorker(new URL("/assets/fs.worker-DfanUHpQ.js",import.meta.url),{type:"module"});r.port.start();const i=rx(r.port);let s;return t?typeof t=="string"?{fs:s}=await i.mountFromUrl({url:t,mountPoint:"/"}):{fs:s}=await i.mount(PP({buffer:t,mountPoint:"/"},[t])):{fs:s}=await i.mount({mountPoint:"/"}),console.debug("Filesystem worker mounted"),Z1(n.fromMemfs(s))};async function*e(t,r){const i=await t.readDir(r);for(const[s,o]of i){const a=`${r==="/"?"":r}/${s}`;o===dr.FileType.Directory?yield*e(t,a):yield a}}n.walk=e})(m1||(m1={}));const are="ENTRIES",gI="KEYS",mI="VALUES",Xn="";class Bb{constructor(e,t){const r=e._tree,i=Array.from(r.keys());this.set=e,this._type=t,this._path=i.length>0?[{node:r,keys:i}]:[]}next(){const e=this.dive();return this.backtrack(),e}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:e,keys:t}=Xl(this._path);if(Xl(t)===Xn)return{done:!1,value:this.result()};const r=e.get(Xl(t));return this._path.push({node:r,keys:Array.from(r.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const e=Xl(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>Xl(e)).filter(e=>e!==Xn).join("")}value(){return Xl(this._path).node.get(Xn)}result(){switch(this._type){case mI:return this.value();case gI:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const Xl=n=>n[n.length-1],ure=(n,e,t)=>{const r=new Map;if(e===void 0)return r;const i=e.length+1,s=i+t,o=new Uint8Array(s*i).fill(t+1);for(let a=0;a<i;++a)o[a]=a;for(let a=1;a<s;++a)o[a*i]=a;return vI(n,e,t,r,o,1,i,""),r},vI=(n,e,t,r,i,s,o,a)=>{const u=s*o;e:for(const l of n.keys())if(l===Xn){const c=i[u-1];c<=t&&r.set(a,[n.get(l),c])}else{let c=s;for(let f=0;f<l.length;++f,++c){const d=l[f],g=o*c,m=g-o;let y=i[g];const b=Math.max(0,c-t-1),w=Math.min(o-1,c+t);for(let S=b;S<w;++S){const k=d!==e[S],x=i[m+S]+ +k,C=i[m+S+1]+1,R=i[g+S]+1,P=i[g+S+1]=Math.min(x,C,R);P<y&&(y=P)}if(y>t)continue e}vI(n.get(l),e,t,r,i,c,o,a+l)}};class Ha{constructor(e=new Map,t=""){this._size=void 0,this._tree=e,this._prefix=t}atPrefix(e){if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");const[t,r]=v1(this._tree,e.slice(this._prefix.length));if(t===void 0){const[i,s]=px(r);for(const o of i.keys())if(o!==Xn&&o.startsWith(s)){const a=new Map;return a.set(o.slice(s.length),i.get(o)),new Ha(a,e)}}return new Ha(t,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,lre(this._tree,e)}entries(){return new Bb(this,are)}forEach(e){for(const[t,r]of this)e(t,r,this)}fuzzyGet(e,t){return ure(this._tree,e,t)}get(e){const t=x2(this._tree,e);return t!==void 0?t.get(Xn):void 0}has(e){const t=x2(this._tree,e);return t!==void 0&&t.has(Xn)}keys(){return new Bb(this,gI)}set(e,t){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,qb(this._tree,e).set(Xn,t),this}get size(){if(this._size)return this._size;this._size=0;const e=this.entries();for(;!e.next().done;)this._size+=1;return this._size}update(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;const r=qb(this._tree,e);return r.set(Xn,t(r.get(Xn))),this}fetch(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;const r=qb(this._tree,e);let i=r.get(Xn);return i===void 0&&r.set(Xn,i=t()),i}values(){return new Bb(this,mI)}[Symbol.iterator](){return this.entries()}static from(e){const t=new Ha;for(const[r,i]of e)t.set(r,i);return t}static fromObject(e){return Ha.from(Object.entries(e))}}const v1=(n,e,t=[])=>{if(e.length===0||n==null)return[n,t];for(const r of n.keys())if(r!==Xn&&e.startsWith(r))return t.push([n,r]),v1(n.get(r),e.slice(r.length),t);return t.push([n,e]),v1(void 0,"",t)},x2=(n,e)=>{if(e.length===0||n==null)return n;for(const t of n.keys())if(t!==Xn&&e.startsWith(t))return x2(n.get(t),e.slice(t.length))},qb=(n,e)=>{const t=e.length;e:for(let r=0;n&&r<t;){for(const s of n.keys())if(s!==Xn&&e[r]===s[0]){const o=Math.min(t-r,s.length);let a=1;for(;a<o&&e[r+a]===s[a];)++a;const u=n.get(s);if(a===s.length)n=u;else{const l=new Map;l.set(s.slice(a),u),n.set(e.slice(r,r+a),l),n.delete(s),n=l}r+=a;continue e}const i=new Map;return n.set(e.slice(r),i),i}return n},lre=(n,e)=>{const[t,r]=v1(n,e);if(t!==void 0){if(t.delete(Xn),t.size===0)yI(r);else if(t.size===1){const[i,s]=t.entries().next().value;bI(r,i,s)}}},yI=n=>{if(n.length===0)return;const[e,t]=px(n);if(e.delete(t),e.size===0)yI(n.slice(0,-1));else if(e.size===1){const[r,i]=e.entries().next().value;r!==Xn&&bI(n.slice(0,-1),r,i)}},bI=(n,e,t)=>{if(n.length===0)return;const[r,i]=px(n);r.set(i+e,t),r.delete(i)},px=n=>n[n.length-1],gx="or",wI="and",cre="and_not";class el{constructor(e){if(e?.fields==null)throw new Error('MiniSearch: option "fields" must be provided');const t=e.autoVacuum==null||e.autoVacuum===!0?Wb:e.autoVacuum;this._options={...$b,...e,autoVacuum:t,searchOptions:{...yT,...e.searchOptions||{}},autoSuggestOptions:{...gre,...e.autoSuggestOptions||{}}},this._index=new Ha,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=C2,this.addFields(this._options.fields)}add(e){const{extractField:t,tokenize:r,processTerm:i,fields:s,idField:o}=this._options,a=t(e,o);if(a==null)throw new Error(`MiniSearch: document does not have ID field "${o}"`);if(this._idToShortId.has(a))throw new Error(`MiniSearch: duplicate ID ${a}`);const u=this.addDocumentId(a);this.saveStoredFields(u,e);for(const l of s){const c=t(e,l);if(c==null)continue;const f=r(c.toString(),l),d=this._fieldIds[l],g=new Set(f).size;this.addFieldLength(u,d,this._documentCount-1,g);for(const m of f){const y=i(m,l);if(Array.isArray(y))for(const b of y)this.addTerm(d,u,b);else y&&this.addTerm(d,u,y)}}}addAll(e){for(const t of e)this.add(t)}addAllAsync(e,t={}){const{chunkSize:r=10}=t,i={chunk:[],promise:Promise.resolve()},{chunk:s,promise:o}=e.reduce(({chunk:a,promise:u},l,c)=>(a.push(l),(c+1)%r===0?{chunk:[],promise:u.then(()=>new Promise(f=>setTimeout(f,0))).then(()=>this.addAll(a))}:{chunk:a,promise:u}),i);return o.then(()=>this.addAll(s))}remove(e){const{tokenize:t,processTerm:r,extractField:i,fields:s,idField:o}=this._options,a=i(e,o);if(a==null)throw new Error(`MiniSearch: document does not have ID field "${o}"`);const u=this._idToShortId.get(a);if(u==null)throw new Error(`MiniSearch: cannot remove document with ID ${a}: it is not in the index`);for(const l of s){const c=i(e,l);if(c==null)continue;const f=t(c.toString(),l),d=this._fieldIds[l],g=new Set(f).size;this.removeFieldLength(u,d,this._documentCount,g);for(const m of f){const y=r(m,l);if(Array.isArray(y))for(const b of y)this.removeTerm(d,u,b);else y&&this.removeTerm(d,u,y)}}this._storedFields.delete(u),this._documentIds.delete(u),this._idToShortId.delete(a),this._fieldLength.delete(u),this._documentCount-=1}removeAll(e){if(e)for(const t of e)this.remove(t);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new Ha,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}}discard(e){const t=this._idToShortId.get(e);if(t==null)throw new Error(`MiniSearch: cannot discard document with ID ${e}: it is not in the index`);this._idToShortId.delete(e),this._documentIds.delete(t),this._storedFields.delete(t),(this._fieldLength.get(t)||[]).forEach((r,i)=>{this.removeFieldLength(t,i,this._documentCount,r)}),this._fieldLength.delete(t),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:e,minDirtCount:t,batchSize:r,batchWait:i}=this._options.autoVacuum;this.conditionalVacuum({batchSize:r,batchWait:i},{minDirtCount:t,minDirtFactor:e})}discardAll(e){const t=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const r of e)this.discard(r)}finally{this._options.autoVacuum=t}this.maybeAutoVacuum()}replace(e){const{idField:t,extractField:r}=this._options,i=r(e,t);this.discard(i),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,t){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const r=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=C2,this.performVacuuming(e,r)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}async performVacuuming(e,t){const r=this._dirtCount;if(this.vacuumConditionsMet(t)){const i=e.batchSize||S2.batchSize,s=e.batchWait||S2.batchWait;let o=1;for(const[a,u]of this._index){for(const[l,c]of u)for(const[f]of c)this._documentIds.has(f)||(c.size<=1?u.delete(l):c.delete(f));this._index.get(a).size===0&&this._index.delete(a),o%i===0&&await new Promise(l=>setTimeout(l,s)),o+=1}this._dirtCount-=r}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:t,minDirtFactor:r}=e;return t=t||Wb.minDirtCount,r=r||Wb.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=r}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(e){return this._idToShortId.has(e)}getStoredFields(e){const t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)}search(e,t={}){const{searchOptions:r}=this._options,i={...r,...t},s=this.executeQuery(e,t),o=[];for(const[a,{score:u,terms:l,match:c}]of s){const f=l.length||1,d={id:this._documentIds.get(a),score:u*f,terms:Object.keys(c),queryTerms:l,match:c};Object.assign(d,this._storedFields.get(a)),(i.filter==null||i.filter(d))&&o.push(d)}return e===el.wildcard&&i.boostDocument==null||o.sort(wT),o}autoSuggest(e,t={}){t={...this._options.autoSuggestOptions,...t};const r=new Map;for(const{score:s,terms:o}of this.search(e,t)){const a=o.join(" "),u=r.get(a);u!=null?(u.score+=s,u.count+=1):r.set(a,{score:s,terms:o,count:1})}const i=[];for(const[s,{score:o,terms:a,count:u}]of r)i.push({suggestion:s,terms:a,score:o/u});return i.sort(wT),i}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJS(JSON.parse(e),t)}static async loadJSONAsync(e,t){if(t==null)throw new Error("MiniSearch: loadJSON should be given the same options used when serializing the index");return this.loadJSAsync(JSON.parse(e),t)}static getDefault(e){if($b.hasOwnProperty(e))return jb($b,e);throw new Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,t){const{index:r,documentIds:i,fieldLength:s,storedFields:o,serializationVersion:a}=e,u=this.instantiateMiniSearch(e,t);u._documentIds=Hg(i),u._fieldLength=Hg(s),u._storedFields=Hg(o);for(const[l,c]of u._documentIds)u._idToShortId.set(c,l);for(const[l,c]of r){const f=new Map;for(const d of Object.keys(c)){let g=c[d];a===1&&(g=g.ds),f.set(parseInt(d,10),Hg(g))}u._index.set(l,f)}return u}static async loadJSAsync(e,t){const{index:r,documentIds:i,fieldLength:s,storedFields:o,serializationVersion:a}=e,u=this.instantiateMiniSearch(e,t);u._documentIds=await Vg(i),u._fieldLength=await Vg(s),u._storedFields=await Vg(o);for(const[c,f]of u._documentIds)u._idToShortId.set(f,c);let l=0;for(const[c,f]of r){const d=new Map;for(const g of Object.keys(f)){let m=f[g];a===1&&(m=m.ds),d.set(parseInt(g,10),await Vg(m))}++l%1e3===0&&await _I(0),u._index.set(c,d)}return u}static instantiateMiniSearch(e,t){const{documentCount:r,nextId:i,fieldIds:s,averageFieldLength:o,dirtCount:a,serializationVersion:u}=e;if(u!==1&&u!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const l=new el(t);return l._documentCount=r,l._nextId=i,l._idToShortId=new Map,l._fieldIds=s,l._avgFieldLength=o,l._dirtCount=a||0,l._index=new Ha,l}executeQuery(e,t={}){if(e===el.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){const d={...t,...e,queries:void 0},g=e.queries.map(m=>this.executeQuery(m,d));return this.combineResults(g,d.combineWith)}const{tokenize:r,processTerm:i,searchOptions:s}=this._options,o={tokenize:r,processTerm:i,...s,...t},{tokenize:a,processTerm:u}=o,f=a(e).flatMap(d=>u(d)).filter(d=>!!d).map(pre(o)).map(d=>this.executeQuerySpec(d,o));return this.combineResults(f,o.combineWith)}executeQuerySpec(e,t){const r={...this._options.searchOptions,...t},i=(r.fields||this._options.fields).reduce((y,b)=>({...y,[b]:jb(r.boost,b)||1}),{}),{boostDocument:s,weights:o,maxFuzzy:a,bm25:u}=r,{fuzzy:l,prefix:c}={...yT.weights,...o},f=this._index.get(e.term),d=this.termResults(e.term,e.term,1,e.termBoost,f,i,s,u);let g,m;if(e.prefix&&(g=this._index.atPrefix(e.term)),e.fuzzy){const y=e.fuzzy===!0?.2:e.fuzzy,b=y<1?Math.min(a,Math.round(e.term.length*y)):y;b&&(m=this._index.fuzzyGet(e.term,b))}if(g)for(const[y,b]of g){const w=y.length-e.term.length;if(!w)continue;m?.delete(y);const S=c*y.length/(y.length+.3*w);this.termResults(e.term,y,S,e.termBoost,b,i,s,u,d)}if(m)for(const y of m.keys()){const[b,w]=m.get(y);if(!w)continue;const S=l*y.length/(y.length+w);this.termResults(e.term,y,S,e.termBoost,b,i,s,u,d)}return d}executeWildcardQuery(e){const t=new Map,r={...this._options.searchOptions,...e};for(const[i,s]of this._documentIds){const o=r.boostDocument?r.boostDocument(s,"",this._storedFields.get(i)):1;t.set(i,{score:o,terms:[],match:{}})}return t}combineResults(e,t=gx){if(e.length===0)return new Map;const r=t.toLowerCase(),i=fre[r];if(!i)throw new Error(`Invalid combination operator: ${t}`);return e.reduce(i)||new Map}toJSON(){const e=[];for(const[t,r]of this._index){const i={};for(const[s,o]of r)i[s]=Object.fromEntries(o);e.push([t,i])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:e,serializationVersion:2}}termResults(e,t,r,i,s,o,a,u,l=new Map){if(s==null)return l;for(const c of Object.keys(o)){const f=o[c],d=this._fieldIds[c],g=s.get(d);if(g==null)continue;let m=g.size;const y=this._avgFieldLength[d];for(const b of g.keys()){if(!this._documentIds.has(b)){this.removeTerm(d,b,t),m-=1;continue}const w=a?a(this._documentIds.get(b),t,this._storedFields.get(b)):1;if(!w)continue;const S=g.get(b),k=this._fieldLength.get(b)[d],x=dre(S,m,this._documentCount,k,y,u),C=r*i*f*w*x,R=l.get(b);if(R){R.score+=C,mre(R.terms,e);const P=jb(R.match,t);P?P.push(c):R.match[t]=[c]}else l.set(b,{score:C,terms:[e],match:{[t]:[c]}})}}return l}addTerm(e,t,r){const i=this._index.fetch(r,_T);let s=i.get(e);if(s==null)s=new Map,s.set(t,1),i.set(e,s);else{const o=s.get(t);s.set(t,(o||0)+1)}}removeTerm(e,t,r){if(!this._index.has(r)){this.warnDocumentChanged(t,e,r);return}const i=this._index.fetch(r,_T),s=i.get(e);s==null||s.get(t)==null?this.warnDocumentChanged(t,e,r):s.get(t)<=1?s.size<=1?i.delete(e):s.delete(t):s.set(t,s.get(t)-1),this._index.get(r).size===0&&this._index.delete(r)}warnDocumentChanged(e,t,r){for(const i of Object.keys(this._fieldIds))if(this._fieldIds[i]===t){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${r}" was not present in field "${i}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(e){const t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t}addFields(e){for(let t=0;t<e.length;t++)this._fieldIds[e[t]]=t}addFieldLength(e,t,r,i){let s=this._fieldLength.get(e);s==null&&this._fieldLength.set(e,s=[]),s[t]=i;const a=(this._avgFieldLength[t]||0)*r+i;this._avgFieldLength[t]=a/(r+1)}removeFieldLength(e,t,r,i){if(r===1){this._avgFieldLength[t]=0;return}const s=this._avgFieldLength[t]*r-i;this._avgFieldLength[t]=s/(r-1)}saveStoredFields(e,t){const{storeFields:r,extractField:i}=this._options;if(r==null||r.length===0)return;let s=this._storedFields.get(e);s==null&&this._storedFields.set(e,s={});for(const o of r){const a=i(t,o);a!==void 0&&(s[o]=a)}}}el.wildcard=Symbol("*");const jb=(n,e)=>Object.prototype.hasOwnProperty.call(n,e)?n[e]:void 0,fre={[gx]:(n,e)=>{for(const t of e.keys()){const r=n.get(t);if(r==null)n.set(t,e.get(t));else{const{score:i,terms:s,match:o}=e.get(t);r.score=r.score+i,r.match=Object.assign(r.match,o),bT(r.terms,s)}}return n},[wI]:(n,e)=>{const t=new Map;for(const r of e.keys()){const i=n.get(r);if(i==null)continue;const{score:s,terms:o,match:a}=e.get(r);bT(i.terms,o),t.set(r,{score:i.score+s,terms:i.terms,match:Object.assign(i.match,a)})}return t},[cre]:(n,e)=>{for(const t of e.keys())n.delete(t);return n}},hre={k:1.2,b:.7,d:.5},dre=(n,e,t,r,i,s)=>{const{k:o,b:a,d:u}=s;return Math.log(1+(t-e+.5)/(e+.5))*(u+n*(o+1)/(n+o*(1-a+a*r/i)))},pre=n=>(e,t,r)=>{const i=typeof n.fuzzy=="function"?n.fuzzy(e,t,r):n.fuzzy||!1,s=typeof n.prefix=="function"?n.prefix(e,t,r):n.prefix===!0,o=typeof n.boostTerm=="function"?n.boostTerm(e,t,r):1;return{term:e,fuzzy:i,prefix:s,termBoost:o}},$b={idField:"id",extractField:(n,e)=>n[e],tokenize:n=>n.split(vre),processTerm:n=>n.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(n,e)=>{typeof console?.[n]=="function"&&console[n](e)},autoVacuum:!0},yT={combineWith:gx,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:hre},gre={combineWith:wI,prefix:(n,e,t)=>e===t.length-1},S2={batchSize:1e3,batchWait:10},C2={minDirtFactor:.1,minDirtCount:20},Wb={...S2,...C2},mre=(n,e)=>{n.includes(e)||n.push(e)},bT=(n,e)=>{for(const t of e)n.includes(t)||n.push(t)},wT=({score:n},{score:e})=>e-n,_T=()=>new Map,Hg=n=>{const e=new Map;for(const t of Object.keys(n))e.set(parseInt(t,10),n[t]);return e},Vg=async n=>{const e=new Map;let t=0;for(const r of Object.keys(n))e.set(parseInt(r,10),n[r]),++t%1e3===0&&await _I(0);return e},_I=n=>new Promise(e=>setTimeout(e,n)),vre=/[\n\r\p{Z}\p{P}]+/u,yre=["path","basename","dirname","extension"],bre=n=>!n.endsWith(".crswap");class ac{constructor(e){this.index=e}add(e){this.index.has(e)||this.index.add({path:e})}search(...e){const t=this.index.search(...e),r=this.highlight(t);return t.map((i,s)=>({...i,highlights:r[s]}))}highlight(e){return[]}async save(e,t){try{const r=t.substring(0,t.lastIndexOf("/"));r&&await e.mkdir(r,{recursive:!0}),await e.writeFile(t,JSON.stringify(this.index))}catch(r){console.error("Failed to save search index:",r)}finally{return this}}static from(e,t){const r=el.loadJSON(e,{fields:t,idField:"path"});return new ac(r)}static async get(e,t,r=yre){const i=await e.exists(t)?await e.readFile(t):null;return i?ac.from(i,r):ac.build(e,{fields:r,idField:"path"}).then(s=>s.save(e,t))}static async build(e,{filter:t=bre,...r}){const i=new el({...r});for await(const s of m1.walk(e,"/"))t(s)&&(i.has(s.slice(1))||i.add({path:s.slice(1)}));return new ac(i)}}async function wre(){const n=new hW,e={fsType:"fsa",opts:{name:"fsa1",keepMetadata:"true",create:"true"}};return await n.addMount(void 0,"",void 0,"/",e.fsType,0n,e.opts),await m1.fromJswasiFs(n)}const kI=await wre(),_re=document.getElementById("editor"),kre=".codeblock/index.json",xre=await ac.get(kI,kre,["path","basename","dirname","extension"]);dne({parent:_re,fs:kI,language:"ts",toolbar:!0,index:xre,cwd:"/"});export{dt as A,Ju as B,P4 as C,vH as D,Re as E,XO as F,Cc as G,Mre as H,cn as I,jH as J,Dre as L,mk as N,HO as P,Vt as T,Qw as a,Pre as b,Ore as c,Vre as d,hJ as e,QH as f,ir as g,jr as h,ZO as i,it as j,Tre as k,Ere as l,Gre as m,xV as n,me as o,Ui as p,Rre as q,ZH as r,LH as s,se as t,ou as u,Wc as v,Gi as w,JO as x,$c as y,zc as z};
|