install.fairie/dotfiles/.vim/plugged/coc.nvim/build/index.js

324 lines
1.6 MiB
JavaScript
Raw Normal View History

"use strict";var Qie=Object.create;var wy=Object.defineProperty;var Vie=Object.getOwnPropertyDescriptor;var ene=Object.getOwnPropertyNames;var tne=Object.getPrototypeOf,ine=Object.prototype.hasOwnProperty;var k=(n,e)=>()=>(n&&(e=n(n=0)),e);var y=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),Go=(n,e)=>{for(var t in e)wy(n,t,{get:e[t],enumerable:!0})},sj=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ene(e))!ine.call(n,r)&&r!==t&&wy(n,r,{get:()=>e[r],enumerable:!(i=Vie(e,r))||i.enumerable});return n};var S=(n,e,t)=>(t=n!=null?Qie(tne(n)):{},sj(e||!n||!n.__esModule?wy(t,"default",{value:n,enumerable:!0}):t,n)),Co=n=>sj(wy({},"__esModule",{value:!0}),n);var lj=y((Gke,aj)=>{var nc=1e3,rc=nc*60,oc=rc*60,dl=oc*24,nne=dl*7,rne=dl*365.25;aj.exports=function(n,e){e=e||{};var t=typeof n;if(t==="string"&&n.length>0)return one(n);if(t==="number"&&isFinite(n))return e.long?ane(n):sne(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function one(n){if(n=String(n),!(n.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(n);if(!!e){var t=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return t*rne;case"weeks":case"week":case"w":return t*nne;case"days":case"day":case"d":return t*dl;case"hours":case"hour":case"hrs":case"hr":case"h":return t*oc;case"minutes":case"minute":case"mins":case"min":case"m":return t*rc;case"seconds":case"second":case"secs":case"sec":case"s":return t*nc;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function sne(n){var e=Math.abs(n);return e>=dl?Math.round(n/dl)+"d":e>=oc?Math.round(n/oc)+"h":e>=rc?Math.round(n/rc)+"m":e>=nc?Math.round(n/nc)+"s":n+"ms"}function ane(n){var e=Math.abs(n);return e>=dl?xy(n,e,dl,"day"):e>=oc?xy(n,e,oc,"hour"):e>=rc?xy(n,e,rc,"minute"):e>=nc?xy(n,e,nc,"second"):n+" ms"}function xy(n,e,t,i){var r=e>=t*1.5;return Math.round(n/t)+" "+i+(r?"s":"")}});var XD=y((zke,uj)=>{function lne(n){t.debug=t,t.default=t,t.coerce=l,t.disable=o,t.enable=r,t.enabled=s,t.humanize=lj(),t.destroy=u,Object.keys(n).forEach(c=>{t[c]=n[c]}),t.names=[],t.skips=[],t.formatters={};function e(c){let h=0;for(let d=0;d<c.length;d++)h=(h<<5)-h+c.charCodeAt(d),h|=0;return t.colors[Math.abs(h)%t.colors.length]}t.selectColor=e;function t(c){let h,d=null,g,p;function f(...m){if(!f.enabled)return;let b=f,w=Number(new Date),x=w-(h||w);b.diff=x,b.prev=h,b.curr=w,h=w,m[0]=t.coerce(m[0]),typeof m[0]!="string"&&m.unshift("%O");let T=0;m[0]=m[0].replace(/%([a-zA-Z%])/g,(F,N)=>{if(F==="%%")return"%";T++;let J=t.formatters[N];if(typeof J=="function"){let H=m[T];F=J.call(b,H),m.splice(T,1),T--}return F}),t.formatArgs.call(b,m),(b.log||t.log).apply(b,m)}return f.namespace=c,f.useColors=t.useColors(),f.color=t.selectColor(c),f.extend=i,f.destroy=t.destroy,Object.defineProperty(f,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(g!==t.namespaces&&(g=t.namespaces,p=t.enabled(c)),p),set:m=>{d=m}}),typeof t.init=="function"&&t.init(f),f}function i(c,h){let d=t(this.namespace+(typeof h>"u"?":":h)+c);return d.log=this.log,d}function r(c){t.save(c),t.namespaces=c,t.names=[],t.skips=[];let h,d=(typeof c=="string"?c:"").split(/[\s,]+/),g=d.length;for(h=0;h<g;h++)!d[h]||(c=d[h].replace(/\*/g,".*?"),c[0]==="-"?t.skips.push(new RegExp("^"+c.slice(1)+"$")):t.names.push(new RegExp("^"+c+"$")))}function o(){let c=[...t.names.map(a),...t.skips.map(a).map(h=>"-"+h)].join(",");return t.enable(""),c}function s(c){if(c[c.length-1]==="*")return!0;let h,d;for(h=0,d=t.skips.length;h<d;h++)if(t.skips[h].test(c))return!1;for(h=0,d=t.names.length;h<d;h++)if(t.names[h].test(c))return!0;return!1}function a(c){return c.toString().substring(2,c.toString().length-2).replace(/\.\*\?$/,"*")}function l(c){return c instanceof Error?c.stack||c.message:c}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed i
`).join(`
`+o),n.push(r+"m+"+Dy.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=wne()+e+" "+n[0]}function wne(){return Li.inspectOpts.hideDate?"":new Date().toISOString()+" "}function xne(...n){return process.stderr.write(Sy.format(...n)+`
`)}function Cne(n){n?process.env.DEBUG=n:delete process.env.DEBUG}function Sne(){return process.env.DEBUG}function Dne(n){n.inspectOpts={};let e=Object.keys(Li.inspectOpts);for(let t=0;t<e.length;t++)n.inspectOpts[e[t]]=Li.inspectOpts[e[t]]}Dy.exports=XD()(Li);var{formatters:mj}=Dy.exports;mj.o=function(n){return this.inspectOpts.colors=this.useColors,Sy.inspect(n,this.inspectOpts).split(`
`).map(e=>e.trim()).join(" ")};mj.O=function(n){return this.inspectOpts.colors=this.useColors,Sy.inspect(n,this.inspectOpts)}});var Yt=y((Vke,KD)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?KD.exports=cj():KD.exports=bj()});var vj=y((ePe,yj)=>{"use strict";yj.exports=Tne;function sc(n){return n instanceof Buffer?Buffer.from(n):new n.constructor(n.buffer.slice(),n.byteOffset,n.length)}function Tne(n){if(n=n||{},n.circles)return kne(n);return n.proto?i:t;function e(r,o){for(var s=Object.keys(r),a=new Array(s.length),l=0;l<s.length;l++){var u=s[l],c=r[u];typeof c!="object"||c===null?a[u]=c:c instanceof Date?a[u]=new Date(c):ArrayBuffer.isView(c)?a[u]=sc(c):a[u]=o(c)}return a}function t(r){if(typeof r!="object"||r===null)return r;if(r instanceof Date)return new Date(r);if(Array.isArray(r))return e(r,t);if(r instanceof Map)return new Map(e(Array.from(r),t));if(r instanceof Set)return new Set(e(Array.from(r),t));var o={};for(var s in r)if(Object.hasOwnProperty.call(r,s)!==!1){var a=r[s];typeof a!="object"||a===null?o[s]=a:a instanceof Date?o[s]=new Date(a):a instanceof Map?o[s]=new Map(e(Array.from(a),t)):a instanceof Set?o[s]=new Set(e(Array.from(a),t)):ArrayBuffer.isView(a)?o[s]=sc(a):o[s]=t(a)}return o}function i(r){if(typeof r!="object"||r===null)return r;if(r instanceof Date)return new Date(r);if(Array.isArray(r))return e(r,i);if(r instanceof Map)return new Map(e(Array.from(r),i));if(r instanceof Set)return new Set(e(Array.from(r),i));var o={};for(var s in r){var a=r[s];typeof a!="object"||a===null?o[s]=a:a instanceof Date?o[s]=new Date(a):a instanceof Map?o[s]=new Map(e(Array.from(a),i)):a instanceof Set?o[s]=new Set(e(Array.from(a),i)):ArrayBuffer.isView(a)?o[s]=sc(a):o[s]=i(a)}return o}}function kne(n){var e=[],t=[];return n.proto?o:r;function i(s,a){for(var l=Object.keys(s),u=new Array(l.length),c=0;c<l.length;c++){var h=l[c],d=s[h];if(typeof d!="object"||d===null)u[h]=d;else if(d instanceof Date)u[h]=new Date(d);else if(ArrayBuffer.isView(d))u[h]=sc(d);else{var g=e.indexOf(d);g!==-1?u[h]=t[g]:u[h]=a(d)}}return u}function r(s){if(typeof s!="object"||s===null)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return i(s,r);if(s instanceof Map)return new Map(i(Array.from(s),r));if(s instanceof Set)return new Set(i(Array.from(s),r));var a={};e.push(s),t.push(a);for(var l in s)if(Object.hasOwnProperty.call(s,l)!==!1){var u=s[l];if(typeof u!="object"||u===null)a[l]=u;else if(u instanceof Date)a[l]=new Date(u);else if(u instanceof Map)a[l]=new Map(i(Array.from(u),r));else if(u instanceof Set)a[l]=new Set(i(Array.from(u),r));else if(ArrayBuffer.isView(u))a[l]=sc(u);else{var c=e.indexOf(u);c!==-1?a[l]=t[c]:a[l]=r(u)}}return e.pop(),t.pop(),a}function o(s){if(typeof s!="object"||s===null)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return i(s,o);if(s instanceof Map)return new Map(i(Array.from(s),o));if(s instanceof Set)return new Set(i(Array.from(s),o));var a={};e.push(s),t.push(a);for(var l in s){var u=s[l];if(typeof u!="object"||u===null)a[l]=u;else if(u instanceof Date)a[l]=new Date(u);else if(u instanceof Map)a[l]=new Map(i(Array.from(u),o));else if(u instanceof Set)a[l]=new Set(i(Array.from(u),o));else if(ArrayBuffer.isView(u))a[l]=sc(u);else{var c=e.indexOf(u);c!==-1?a[l]=t[c]:a[l]=o(u)}}return e.pop(),t.pop(),a}}});var pl=y((tPe,Sj)=>{var Pne=require("util"),gl=Yt()("log4js:configuration"),Ty=[],ky=[],wj=n=>!n,xj=n=>n&&typeof n=="object"&&!Array.isArray(n),Ene=n=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(n),Rne=n=>n&&typeof n=="number"&&Number.isInteger(n),_ne=n=>{ky.push(n),gl(`Added listener, now ${ky.length} listeners`)},Lne=n=>{Ty.push(n),gl(`Added pre-processing listener, now ${Ty.length} listeners`)},Cj=(n,e,t)=>{(Array.isArray(e)?e:[e]).forEach(r=>{if(r)throw new Error(`Problem with log4js configuration: (${Pne.inspect(n,{depth:5})}) - ${t}`)})},Ine=n=>{gl("New configuration to be validated: ",n),Cj(n,wj(xj(n)),"must be an object."),gl(`Calling pre-processing listeners (${Ty.length})`),Ty.forEach(e=>e(n)),gl("Configuration pre-processing f
`)}}function Kne(n,e){let t=e.colouredLayout;return n.layout&&(t=e.layout(n.layout.type,n.layout)),zne(t,n.timezoneOffset)}aM.configure=Kne});var cM=y((hPe,uM)=>{function Qne(n,e){return t=>{process.stderr.write(`${n(t,e)}
`)}}function Vne(n,e){let t=e.colouredLayout;return n.layout&&(t=e.layout(n.layout.type,n.layout)),Qne(t,n.timezoneOffset)}uM.exports.configure=Vne});var dM=y((dPe,hM)=>{function ere(n,e,t,i){let r=i.getLevel(n),o=i.getLevel(e,i.FATAL);return s=>{let a=s.level;a.isGreaterThanOrEqualTo(r)&&a.isLessThanOrEqualTo(o)&&t(s)}}function tre(n,e,t,i){let r=t(n.appender);return ere(n.level,n.maxLevel,r,i)}hM.exports.configure=tre});var fM=y((gPe,pM)=>{var gM=Yt()("log4js:categoryFilter");function ire(n,e){return typeof n=="string"&&(n=[n]),t=>{gM(`Checking ${t.categoryName} against ${n}`),n.indexOf(t.categoryName)===-1&&(gM("Not excluded, sending to appender"),e(t))}}function nre(n,e,t){let i=t(n.appender);return ire(n.exclude,i)}pM.exports.configure=nre});var yM=y((pPe,bM)=>{var mM=Yt()("log4js:noLogFilter");function rre(n){return n.filter(t=>t!=null&&t!=="")}function ore(n,e){return t=>{mM(`Checking data: ${t.data} against filters: ${n}`),typeof n=="string"&&(n=[n]),n=rre(n);let i=new RegExp(n.join("|"),"i");(n.length===0||t.data.findIndex(r=>i.test(r))<0)&&(mM("Not excluded, sending to appender"),e(t))}}function sre(n,e,t){let i=t(n.appender);return ore(n.exclude,i)}bM.exports.configure=sre});var Dn=y(nT=>{"use strict";nT.fromCallback=function(n){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")n.apply(this,e);else return new Promise((t,i)=>{n.call(this,...e,(r,o)=>r!=null?i(r):t(o))})},"name",{value:n.name})};nT.fromPromise=function(n){return Object.defineProperty(function(...e){let t=e[e.length-1];if(typeof t!="function")return n.apply(this,e);n.apply(this,e.slice(0,-1)).then(i=>t(null,i),t)},"name",{value:n.name})}});var wM=y((mPe,vM)=>{var Us=require("constants"),are=process.cwd,Iy=null,lre=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Iy||(Iy=are.call(process)),Iy};try{process.cwd()}catch{}typeof process.chdir=="function"&&(rT=process.chdir,process.chdir=function(n){Iy=null,rT.call(process,n)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,rT));var rT;vM.exports=ure;function ure(n){Us.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(n),n.lutimes||t(n),n.chown=o(n.chown),n.fchown=o(n.fchown),n.lchown=o(n.lchown),n.chmod=i(n.chmod),n.fchmod=i(n.fchmod),n.lchmod=i(n.lchmod),n.chownSync=s(n.chownSync),n.fchownSync=s(n.fchownSync),n.lchownSync=s(n.lchownSync),n.chmodSync=r(n.chmodSync),n.fchmodSync=r(n.fchmodSync),n.lchmodSync=r(n.lchmodSync),n.stat=a(n.stat),n.fstat=a(n.fstat),n.lstat=a(n.lstat),n.statSync=l(n.statSync),n.fstatSync=l(n.fstatSync),n.lstatSync=l(n.lstatSync),n.lchmod||(n.lchmod=function(c,h,d){d&&process.nextTick(d)},n.lchmodSync=function(){}),n.lchown||(n.lchown=function(c,h,d,g){g&&process.nextTick(g)},n.lchownSync=function(){}),lre==="win32"&&(n.rename=function(c){return function(h,d,g){var p=Date.now(),f=0;c(h,d,function m(b){if(b&&(b.code==="EACCES"||b.code==="EPERM")&&Date.now()-p<6e4){setTimeout(function(){n.stat(d,function(w,x){w&&w.code==="ENOENT"?c(h,d,m):g(b)})},f),f<100&&(f+=10);return}g&&g(b)})}}(n.rename)),n.read=function(c){function h(d,g,p,f,m,b){var w;if(b&&typeof b=="function"){var x=0;w=function(T,R,F){if(T&&T.code==="EAGAIN"&&x<10)return x++,c.call(n,d,g,p,f,m,w);b.apply(this,arguments)}}return c.call(n,d,g,p,f,m,w)}return Object.setPrototypeOf&&Object.setPrototypeOf(h,c),h}(n.read),n.readSync=function(c){return function(h,d,g,p,f){for(var m=0;;)try{return c.call(n,h,d,g,p,f)}catch(b){if(b.code==="EAGAIN"&&m<10){m++;continue}throw b}}}(n.readSync);function e(c){c.lchmod=function(h,d,g){c.open(h,Us.O_WRONLY|Us.O_SYMLINK,d,function(p,f){if(p){g&&g(p);return}c.fchmod(f,d,function(m){c.close(f,function(b){g&&g(m||b)})})})},c.lchmodSync=function(h,d){var g=c.openSync(h,Us.O_WRONLY|Us.O_SYMLINK,d),p=!0,f;try{f=c.fchmodSync(g,d),p=!1}finally{if(p)try{c.closeSync(g)}catch{}else c.closeSync(g)}return f}}function t(c){Us.hasOwnProperty("O_SYMLINK")?(c.lutimes=function(h,d,g,p){c.open(h,Us.O_SYMLINK,function(f,m){if(f){p&&p(f);return}c.futimes(m,d,g,function(b){c.close(m,function(w){p&&p(b||w)})
GFS4: `),console.error(n)});Ii[Hr]||(kM=global[Hr]||[],PM(Ii,kM),Ii.close=function(n){function e(t,i){return n.call(Ii,t,function(r){r||Xs(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(e,jy,{value:n}),e}(Ii.close),Ii.closeSync=function(n){function e(t){n.apply(Ii,arguments),Xs()}return Object.defineProperty(e,jy,{value:n}),e}(Ii.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Wd(Ii[Hr]),require("assert").equal(Ii[Hr].length,0)}));var kM;global[Hr]||PM(global,Ii[Hr]);sT.exports=oT(fre(Ii));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!Ii.__patched&&(sT.exports=oT(Ii),Ii.__patched=!0);function oT(n){gre(n),n.gracefulify=oT,n.createReadStream=R,n.createWriteStream=F;var e=n.readFile;n.readFile=t;function t(H,M,L){return typeof M=="function"&&(L=M,M=null),O(H,M,L);function O(Z,ne,be){return e(Z,ne,function(He){He&&(He.code==="EMFILE"||He.code==="ENFILE")?uc([O,[Z,ne,be]]):(typeof be=="function"&&be.apply(this,arguments),Xs())})}}var i=n.writeFile;n.writeFile=r;function r(H,M,L,O){return typeof L=="function"&&(O=L,L=null),Z(H,M,L,O);function Z(ne,be,He,$){return i(ne,be,He,function(B){B&&(B.code==="EMFILE"||B.code==="ENFILE")?uc([Z,[ne,be,He,$]]):(typeof $=="function"&&$.apply(this,arguments),Xs())})}}var o=n.appendFile;o&&(n.appendFile=s);function s(H,M,L,O){return typeof L=="function"&&(O=L,L=null),Z(H,M,L,O);function Z(ne,be,He,$){return o(ne,be,He,function(B){B&&(B.code==="EMFILE"||B.code==="ENFILE")?uc([Z,[ne,be,He,$]]):(typeof $=="function"&&$.apply(this,arguments),Xs())})}}var a=n.copyFile;a&&(n.copyFile=l);function l(H,M,L,O){return typeof L=="function"&&(O=L,L=0),a(H,M,L,function(Z){Z&&(Z.code==="EMFILE"||Z.code==="ENFILE")?uc([a,[H,M,L,O]]):(typeof O=="function"&&O.apply(this,arguments),Xs())})}var u=n.readdir;n.readdir=c;function c(H,M,L){var O=[H];return typeof M!="function"?O.push(M):L=M,O.push(Z),h(O);function Z(ne,be){be&&be.sort&&be.sort(),ne&&(ne.code==="EMFILE"||ne.code==="ENFILE")?uc([h,[O]]):(typeof L=="function"&&L.apply(this,arguments),Xs())}}function h(H){return u.apply(n,H)}if(process.version.substr(0,4)==="v0.8"){var d=pre(n);b=d.ReadStream,x=d.WriteStream}var g=n.ReadStream;g&&(b.prototype=Object.create(g.prototype),b.prototype.open=w);var p=n.WriteStream;p&&(x.prototype=Object.create(p.prototype),x.prototype.open=T),Object.defineProperty(n,"ReadStream",{get:function(){return b},set:function(H){b=H},enumerable:!0,configurable:!0}),Object.defineProperty(n,"WriteStream",{get:function(){return x},set:function(H){x=H},enumerable:!0,configurable:!0});var f=b;Object.defineProperty(n,"FileReadStream",{get:function(){return f},set:function(H){f=H},enumerable:!0,configurable:!0});var m=x;Object.defineProperty(n,"FileWriteStream",{get:function(){return m},set:function(H){m=H},enumerable:!0,configurable:!0});function b(H,M){return this instanceof b?(g.apply(this,arguments),this):b.apply(Object.create(b.prototype),arguments)}function w(){var H=this;J(H.path,H.flags,H.mode,function(M,L){M?(H.autoClose&&H.destroy(),H.emit("error",M)):(H.fd=L,H.emit("open",L),H.read())})}function x(H,M){return this instanceof x?(p.apply(this,arguments),this):x.apply(Object.create(x.prototype),arguments)}function T(){var H=this;J(H.path,H.flags,H.mode,function(M,L){M?(H.destroy(),H.emit("error",M)):(H.fd=L,H.emit("open",L))})}function R(H,M){return new n.ReadStream(H,M)}function F(H,M){return new n.WriteStream(H,M)}var N=n.open;n.open=J;function J(H,M,L,O){return typeof L=="function"&&(O=L,L=null),Z(H,M,L,O);function Z(ne,be,He,$){return N(ne,be,He,function(B,G){B&&(B.code==="EMFILE"||B.code==="ENFILE")?uc([Z,[ne,be,He,$]]):(typeof $=="function"&&$.apply(this,arguments),Xs())})}}return n}function uc(n){Wd("ENQUEUE",n[0].name,n[1]),Ii[Hr].push(n)}function Xs(){var n=Ii[Hr].shift();n&&(Wd("RETRY",n[0].name,n[1]),n[0].apply(null,n[1]))}});var yl=y(Gs=>{"use strict";var EM=Dn().fromCallback,Un=on(),bre=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","
see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:i,destStat:r}=Jd.checkPathsSync(n,e,"copy",t);return Jd.checkParentPathsSync(n,i,e,"copy"),Lre(r,n,e,t)}function Lre(n,e,t,i){if(i.filter&&!i.filter(e,t))return;let r=Zd.dirname(t);return Zi.existsSync(r)||Ere(r),qM(n,e,t,i)}function Ire(n,e,t,i){if(!(i.filter&&!i.filter(e,t)))return qM(n,e,t,i)}function qM(n,e,t,i){let o=(i.dereference?Zi.statSync:Zi.lstatSync)(e);if(o.isDirectory())return Hre(o,n,e,t,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return Fre(o,n,e,t,i);if(o.isSymbolicLink())return Wre(n,e,t,i);throw o.isSocket()?new Error(`Cannot copy a socket file: ${e}`):o.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function Fre(n,e,t,i,r){return e?jre(n,t,i,r):BM(n,t,i,r)}function jre(n,e,t,i){if(i.overwrite)return Zi.unlinkSync(t),BM(n,e,t,i);if(i.errorOnExist)throw new Error(`'${t}' already exists`)}function BM(n,e,t,i){return Zi.copyFileSync(e,t),i.preserveTimestamps&&Mre(n.mode,e,t),dT(t,n.mode)}function Mre(n,e,t){return Ore(n)&&Are(t,n),Nre(e,t)}function Ore(n){return(n&128)===0}function Are(n,e){return dT(n,e|128)}function dT(n,e){return Zi.chmodSync(n,e)}function Nre(n,e){let t=Zi.statSync(n);return Rre(e,t.atime,t.mtime)}function Hre(n,e,t,i,r){return e?WM(t,i,r):qre(n.mode,t,i,r)}function qre(n,e,t,i){return Zi.mkdirSync(t),WM(e,t,i),dT(t,n)}function WM(n,e,t){Zi.readdirSync(n).forEach(i=>Bre(i,n,e,t))}function Bre(n,e,t,i){let r=Zd.join(e,n),o=Zd.join(t,n),{destStat:s}=Jd.checkPathsSync(r,o,"copy",i);return Ire(s,r,o,i)}function Wre(n,e,t,i){let r=Zi.readlinkSync(e);if(i.dereference&&(r=Zd.resolve(process.cwd(),r)),n){let o;try{o=Zi.readlinkSync(t)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return Zi.symlinkSync(r,t);throw s}if(i.dereference&&(o=Zd.resolve(process.cwd(),o)),Jd.isSrcSubdir(r,o))throw new Error(`Cannot copy '${r}' to a subdirectory of itself, '${o}'.`);if(Zi.statSync(t).isDirectory()&&Jd.isSrcSubdir(o,r))throw new Error(`Cannot overwrite '${o}' with '${r}'.`);return Yre(r,t)}else return Zi.symlinkSync(r,t)}function Yre(n,e){return Zi.unlinkSync(e),Zi.symlinkSync(n,e)}YM.exports=_re});var gT=y((PPe,JM)=>{"use strict";JM.exports={copySync:ZM()}});var zs=y((EPe,UM)=>{"use strict";var Zre=Dn().fromPromise,$M=yl();function Jre(n){return $M.access(n).then(()=>!0).catch(()=>!1)}UM.exports={pathExists:Zre(Jre),pathExistsSync:$M.existsSync}});var tO=y((RPe,eO)=>{"use strict";var Tn=on(),$d=require("path"),$re=qr().mkdirs,Ure=zs().pathExists,Xre=cT().utimesMillis,Ud=vl();function Gre(n,e,t,i){typeof t=="function"&&!i?(i=t,t={}):typeof t=="function"&&(t={filter:t}),i=i||function(){},t=t||{},t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
see https://github.com/jprichardson/node-fs-extra/issues/269`),Ud.checkPaths(n,e,"copy",t,(r,o)=>{if(r)return i(r);let{srcStat:s,destStat:a}=o;Ud.checkParentPaths(n,s,e,"copy",l=>l?i(l):t.filter?zM(XM,a,n,e,t,i):XM(a,n,e,t,i))})}function XM(n,e,t,i,r){let o=$d.dirname(t);Ure(o,(s,a)=>{if(s)return r(s);if(a)return Oy(n,e,t,i,r);$re(o,l=>l?r(l):Oy(n,e,t,i,r))})}function zM(n,e,t,i,r,o){Promise.resolve(r.filter(t,i)).then(s=>s?n(e,t,i,r,o):o(),s=>o(s))}function zre(n,e,t,i,r){return i.filter?zM(Oy,n,e,t,i,r):Oy(n,e,t,i,r)}function Oy(n,e,t,i,r){(i.dereference?Tn.stat:Tn.lstat)(e,(s,a)=>s?r(s):a.isDirectory()?noe(a,n,e,t,i,r):a.isFile()||a.isCharacterDevice()||a.isBlockDevice()?Kre(a,n,e,t,i,r):a.isSymbolicLink()?soe(n,e,t,i,r):a.isSocket()?r(new Error(`Cannot copy a socket file: ${e}`)):a.isFIFO()?r(new Error(`Cannot copy a FIFO pipe: ${e}`)):r(new Error(`Unknown file: ${e}`)))}function Kre(n,e,t,i,r,o){return e?Qre(n,t,i,r,o):KM(n,t,i,r,o)}function Qre(n,e,t,i,r){if(i.overwrite)Tn.unlink(t,o=>o?r(o):KM(n,e,t,i,r));else return i.errorOnExist?r(new Error(`'${t}' already exists`)):r()}function KM(n,e,t,i,r){Tn.copyFile(e,t,o=>o?r(o):i.preserveTimestamps?Vre(n.mode,e,t,r):Ay(t,n.mode,r))}function Vre(n,e,t,i){return eoe(n)?toe(t,n,r=>r?i(r):GM(n,e,t,i)):GM(n,e,t,i)}function eoe(n){return(n&128)===0}function toe(n,e,t){return Ay(n,e|128,t)}function GM(n,e,t,i){ioe(e,t,r=>r?i(r):Ay(t,n,i))}function Ay(n,e,t){return Tn.chmod(n,e,t)}function ioe(n,e,t){Tn.stat(n,(i,r)=>i?t(i):Xre(e,r.atime,r.mtime,t))}function noe(n,e,t,i,r,o){return e?QM(t,i,r,o):roe(n.mode,t,i,r,o)}function roe(n,e,t,i,r){Tn.mkdir(t,o=>{if(o)return r(o);QM(e,t,i,s=>s?r(s):Ay(t,n,r))})}function QM(n,e,t,i){Tn.readdir(n,(r,o)=>r?i(r):VM(o,n,e,t,i))}function VM(n,e,t,i,r){let o=n.pop();return o?ooe(n,o,e,t,i,r):r()}function ooe(n,e,t,i,r,o){let s=$d.join(t,e),a=$d.join(i,e);Ud.checkPaths(s,a,"copy",r,(l,u)=>{if(l)return o(l);let{destStat:c}=u;zre(c,s,a,r,h=>h?o(h):VM(n,t,i,r,o))})}function soe(n,e,t,i,r){Tn.readlink(e,(o,s)=>{if(o)return r(o);if(i.dereference&&(s=$d.resolve(process.cwd(),s)),n)Tn.readlink(t,(a,l)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?Tn.symlink(s,t,r):r(a):(i.dereference&&(l=$d.resolve(process.cwd(),l)),Ud.isSrcSubdir(s,l)?r(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${l}'.`)):n.isDirectory()&&Ud.isSrcSubdir(l,s)?r(new Error(`Cannot overwrite '${l}' with '${s}'.`)):aoe(s,t,r)));else return Tn.symlink(s,t,r)})}function aoe(n,e,t){Tn.unlink(e,i=>i?t(i):Tn.symlink(n,e,t))}eO.exports=Gre});var pT=y((_Pe,iO)=>{"use strict";var loe=Dn().fromCallback;iO.exports={copy:loe(tO())}});var hO=y((LPe,cO)=>{"use strict";var nO=on(),aO=require("path"),pt=require("assert"),Xd=process.platform==="win32";function lO(n){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(t=>{n[t]=n[t]||nO[t],t=t+"Sync",n[t]=n[t]||nO[t]}),n.maxBusyTries=n.maxBusyTries||3}function fT(n,e,t){let i=0;typeof e=="function"&&(t=e,e={}),pt(n,"rimraf: missing path"),pt.strictEqual(typeof n,"string","rimraf: path should be a string"),pt.strictEqual(typeof t,"function","rimraf: callback function required"),pt(e,"rimraf: invalid options argument provided"),pt.strictEqual(typeof e,"object","rimraf: options should be object"),lO(e),rO(n,e,function r(o){if(o){if((o.code==="EBUSY"||o.code==="ENOTEMPTY"||o.code==="EPERM")&&i<e.maxBusyTries){i++;let s=i*100;return setTimeout(()=>rO(n,e,r),s)}o.code==="ENOENT"&&(o=null)}t(o)})}function rO(n,e,t){pt(n),pt(e),pt(typeof t=="function"),e.lstat(n,(i,r)=>{if(i&&i.code==="ENOENT")return t(null);if(i&&i.code==="EPERM"&&Xd)return oO(n,e,i,t);if(r&&r.isDirectory())return Ny(n,e,i,t);e.unlink(n,o=>{if(o){if(o.code==="ENOENT")return t(null);if(o.code==="EPERM")return Xd?oO(n,e,o,t):Ny(n,e,o,t);if(o.code==="EISDIR")return Ny(n,e,o,t)}return t(o)})})}function oO(n,e,t,i){pt(n),pt(e),pt(typeof i=="function"),e.chmod(n,438,r=>{r?i(r.code==="ENOENT"?null:t):e.stat(n,(o,s)=>{o?i(o.code==="ENOENT"?null:t):s.isDirectory()?Ny(n,e,t,i):e.unlink(n,i)})})}function sO(n,e,t){let i;pt(n),pt(e);try{e.chmodSync(n,438)}catch(r){if(r.code==="ENOENT")
`,finalEOL:t=!0,replacer:i=null,spaces:r}={}){let o=t?e:"";return JSON.stringify(n,i,r).replace(/\n/g,e)+o}function Noe(n){return Buffer.isBuffer(n)&&(n=n.toString("utf8")),n.replace(/^\uFEFF/,"")}$O.exports={stringify:Aoe,stripBom:Noe}});var zO=y((BPe,GO)=>{var dc;try{dc=on()}catch{dc=require("fs")}var Jy=Dn(),{stringify:UO,stripBom:XO}=Zy();async function Hoe(n,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||dc,i="throws"in e?e.throws:!0,r=await Jy.fromCallback(t.readFile)(n,e);r=XO(r);let o;try{o=JSON.parse(r,e?e.reviver:null)}catch(s){if(i)throw s.message=`${n}: ${s.message}`,s;return null}return o}var qoe=Jy.fromPromise(Hoe);function Boe(n,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||dc,i="throws"in e?e.throws:!0;try{let r=t.readFileSync(n,e);return r=XO(r),JSON.parse(r,e.reviver)}catch(r){if(i)throw r.message=`${n}: ${r.message}`,r;return null}}async function Woe(n,e,t={}){let i=t.fs||dc,r=UO(e,t);await Jy.fromCallback(i.writeFile)(n,r,t)}var Yoe=Jy.fromPromise(Woe);function Zoe(n,e,t={}){let i=t.fs||dc,r=UO(e,t);return i.writeFileSync(n,r,t)}var Joe={readFile:qoe,readFileSync:Boe,writeFile:Yoe,writeFileSync:Zoe};GO.exports=Joe});var QO=y((WPe,KO)=>{"use strict";var $y=zO();KO.exports={readJson:$y.readFile,readJsonSync:$y.readFileSync,writeJson:$y.writeFile,writeJsonSync:$y.writeFileSync}});var Uy=y((YPe,t1)=>{"use strict";var $oe=Dn().fromCallback,Kd=on(),VO=require("path"),e1=qr(),Uoe=zs().pathExists;function Xoe(n,e,t,i){typeof t=="function"&&(i=t,t="utf8");let r=VO.dirname(n);Uoe(r,(o,s)=>{if(o)return i(o);if(s)return Kd.writeFile(n,e,t,i);e1.mkdirs(r,a=>{if(a)return i(a);Kd.writeFile(n,e,t,i)})})}function Goe(n,...e){let t=VO.dirname(n);if(Kd.existsSync(t))return Kd.writeFileSync(n,...e);e1.mkdirsSync(t),Kd.writeFileSync(n,...e)}t1.exports={outputFile:$oe(Xoe),outputFileSync:Goe}});var n1=y((ZPe,i1)=>{"use strict";var{stringify:zoe}=Zy(),{outputFile:Koe}=Uy();async function Qoe(n,e,t={}){let i=zoe(e,t);await Koe(n,i,t)}i1.exports=Qoe});var o1=y((JPe,r1)=>{"use strict";var{stringify:Voe}=Zy(),{outputFileSync:ese}=Uy();function tse(n,e,t){let i=Voe(e,t);ese(n,i,t)}r1.exports=tse});var a1=y(($Pe,s1)=>{"use strict";var ise=Dn().fromPromise,sn=QO();sn.outputJson=ise(n1());sn.outputJsonSync=o1();sn.outputJSON=sn.outputJson;sn.outputJSONSync=sn.outputJsonSync;sn.writeJSON=sn.writeJson;sn.writeJSONSync=sn.writeJsonSync;sn.readJSON=sn.readJson;sn.readJSONSync=sn.readJsonSync;s1.exports=sn});var d1=y((UPe,h1)=>{"use strict";var u1=on(),bT=require("path"),nse=gT().copySync,c1=Gd().removeSync,rse=qr().mkdirpSync,l1=vl();function ose(n,e,t){t=t||{};let i=t.overwrite||t.clobber||!1,{srcStat:r,isChangingCase:o=!1}=l1.checkPathsSync(n,e,"move",t);return l1.checkParentPathsSync(n,r,e,"move"),sse(e)||rse(bT.dirname(e)),ase(n,e,i,o)}function sse(n){let e=bT.dirname(n);return bT.parse(e).root===e}function ase(n,e,t,i){if(i)return mT(n,e,t);if(t)return c1(e),mT(n,e,t);if(u1.existsSync(e))throw new Error("dest already exists.");return mT(n,e,t)}function mT(n,e,t){try{u1.renameSync(n,e)}catch(i){if(i.code!=="EXDEV")throw i;return lse(n,e,t)}}function lse(n,e,t){return nse(n,e,{overwrite:t,errorOnExist:!0}),c1(n)}h1.exports=ose});var p1=y((XPe,g1)=>{"use strict";g1.exports={moveSync:d1()}});var v1=y((GPe,y1)=>{"use strict";var use=on(),vT=require("path"),cse=pT().copy,b1=Gd().remove,hse=qr().mkdirp,dse=zs().pathExists,f1=vl();function gse(n,e,t,i){typeof t=="function"&&(i=t,t={});let r=t.overwrite||t.clobber||!1;f1.checkPaths(n,e,"move",t,(o,s)=>{if(o)return i(o);let{srcStat:a,isChangingCase:l=!1}=s;f1.checkParentPaths(n,a,e,"move",u=>{if(u)return i(u);if(pse(e))return m1(n,e,r,l,i);hse(vT.dirname(e),c=>c?i(c):m1(n,e,r,l,i))})})}function pse(n){let e=vT.dirname(n);return vT.parse(e).root===e}function m1(n,e,t,i,r){if(i)return yT(n,e,t,r);if(t)return b1(e,o=>o?r(o):yT(n,e,t,r));dse(e,(o,s)=>o?r(o):s?r(new Error("dest already exists.")):yT(n,e,t,r))}function yT(n,e,t,i){use.rename(n,e,r=>r?r.code!=="EXDEV"?i(r):fse(n,e,t,i):i())}function fse(n,e,t,i){cse(n,e,{overwrite:t,errorOnExist:!0},o=>o?i(o):b1(n,i))}y1.exports=
`;function $1(n,e){if(Do.existsSync(n))return;let t=Do.openSync(n,e.flags,e.mode);Do.closeSync(t)}var TT=class{constructor(e,t,i,r){zo("In RollingFileStream");function o(){if(!e||!t||t<=0)throw new Error("You must specify a filename and file size")}o(),this.filename=e,this.size=t,this.backups=i,this.options=r,this.currentSize=0;function s(a){let l=0;try{l=Do.statSync(a).size}catch{$1(a,r)}return l}this.currentSize=s(this.filename)}shouldRoll(){return zo("should roll with current size %d, and max size %d",this.currentSize,this.size),this.currentSize>=this.size}roll(e){let t=this,i=new RegExp(`^${gc.basename(e)}`);function r(u){return i.test(u)}function o(u){return parseInt(u.substring(`${gc.basename(e)}.`.length),10)||0}function s(u,c){return o(u)>o(c)?1:o(u)<o(c)?-1:0}function a(u){let c=o(u);if(zo(`Index of ${u} is ${c}`),t.backups===0)Do.truncateSync(e,0);else if(c<t.backups){try{Do.unlinkSync(`${e}.${c+1}`)}catch{}zo(`Renaming ${u} -> ${e}.${c+1}`),Do.renameSync(gc.join(gc.dirname(e),u),`${e}.${c+1}`)}}function l(){zo("Renaming the old files"),Do.readdirSync(gc.dirname(e)).filter(r).sort(s).reverse().forEach(a)}zo("Rolling, rolling, rolling"),l()}write(e,t){let i=this;function r(){zo("writing the chunk to the file"),i.currentSize+=e.length,Do.appendFileSync(i.filename,e)}zo("in write"),this.shouldRoll()&&(this.currentSize=0,this.roll(this.filename)),r()}};function $se(n,e,t,i,r,o){zo("fileSync appender created"),n=gc.normalize(n),i=!i&&i!==0?5:i;function s(l,u,c){let h;return u?h=new TT(l,u,c,o):h=(d=>($1(d,o),{write(g){Do.appendFileSync(d,g)}}))(l),h}let a=s(n,t,i);return l=>{a.write(e(l,r)+Jse)}}function Use(n,e){let t=e.basicLayout;n.layout&&(t=e.layout(n.layout.type,n.layout));let i={flags:n.flags||"a",encoding:n.encoding||"utf8",mode:n.mode||384};return $se(n.filename,t,n.maxLogSize,n.backups,n.timezoneOffset,i)}U1.exports.configure=Use});var z1=y((u0e,G1)=>{var To=Yt()("log4js:tcp"),Xse=require("net");function Gse(n,e){let t=!1,i=[],r,o=3,s="__LOG4JS__";function a(h){To("Writing log event to socket"),t=r.write(`${e(h)}${s}`,"utf8")}function l(){let h;for(To("emptying buffer");h=i.shift();)a(h)}function u(){To(`appender creating socket to ${n.host||"localhost"}:${n.port||5e3}`),s=`${n.endMsg||"__LOG4JS__"}`,r=Xse.createConnection(n.port||5e3,n.host||"localhost"),r.on("connect",()=>{To("socket connected"),l(),t=!0}),r.on("drain",()=>{To("drain event received, emptying buffer"),t=!0,l()}),r.on("timeout",r.end.bind(r)),r.on("error",h=>{To("connection error",h),t=!1,l()}),r.on("close",u)}u();function c(h){t?a(h):(To("buffering log event because it cannot write at the moment"),i.push(h))}return c.shutdown=function(h){To("shutdown called"),i.length&&o?(To("buffer has items, waiting 100ms to empty"),o-=1,setTimeout(()=>{c.shutdown(h)},100)):(r.removeAllListeners("close"),r.end(h))},c}function zse(n,e){To(`configure with config = ${n}`);let t=function(i){return i.serialise()};return n.layout&&(t=e.layout(n.layout.type,n.layout)),Gse(n,t)}G1.exports.configure=zse});var ET=y((c0e,PT)=>{var Kse=require("path"),xl=Yt()("log4js:appenders"),pr=pl(),K1=Ly(),Qse=bl(),Vse=VD(),eae=rM(),Wr=new Map;Wr.set("console",sM());Wr.set("stdout",lM());Wr.set("stderr",cM());Wr.set("logLevelFilter",dM());Wr.set("categoryFilter",fM());Wr.set("noLogFilter",yM());Wr.set("file",Y1());Wr.set("dateFile",J1());Wr.set("fileSync",X1());Wr.set("tcp",z1());var Vd=new Map,kT=(n,e)=>{xl("Loading module from ",n);try{return require(n)}catch(t){pr.throwExceptionIf(e,t.code!=="MODULE_NOT_FOUND",`appender "${n}" could not be loaded (error was: ${t})`);return}},tae=(n,e)=>Wr.get(n)||kT(`./${n}`,e)||kT(n,e)||""||kT(Kse.join(process.cwd(),n),e),ev=new Set,Q1=(n,e)=>{if(Vd.has(n))return Vd.get(n);if(!e.appenders[n])return!1;if(ev.has(n))throw new Error(`Dependency loop detected for appender ${n}.`);ev.add(n),xl(`Creating appender ${n}`);let t=iae(n,e);return ev.delete(n),Vd.set(n,t),t},iae=(n,e)=>{let t=e.appenders[n],i=t.type.configure?t.type:tae(t.type,e);return pr.throwExceptionIf(e,pr.not(i),`appender "${n}" is not valid (type "${t.type}" could not be found)
`).slice(e),i=dae.exec(t[0]);return i&&i.length===6?{functionName:i[1],fileName:i[2],lineNumber:parseInt(i[3],10),columnNumber:parseInt(i[4],10),callStack:t.join(`
`)}:null}var eg=class{constructor(e){if(!e)throw new Error("No category provided.");this.category=e,this.context={},this.parseCallStack=gae,oA(`Logger created (${this.category}, ${this.level})`)}get level(){return Ko.getLevel(iv.getLevelForCategory(this.category),Ko.TRACE)}set level(e){iv.setLevelForCategory(this.category,Ko.getLevel(e,this.level))}get useCallStack(){return iv.getEnableCallStackForCategory(this.category)}set useCallStack(e){iv.setEnableCallStackForCategory(this.category,e===!0)}log(e,...t){let i=Ko.getLevel(e);i||(this._log(Ko.WARN,"log4js:logger.log: invalid value for log-level as first parameter given: ",e),i=Ko.INFO),this.isLevelEnabled(i)&&this._log(i,t)}isLevelEnabled(e){return this.level.isLessThanOrEqualTo(e)}_log(e,t){oA(`sending log data (${e}) to appenders`);let i=new uae(this.category,e,t,this.context,this.useCallStack&&this.parseCallStack(new Error));cae.send(i)}addContext(e,t){this.context[e]=t}removeContext(e){delete this.context[e]}clearContext(){this.context={}}setParseCallStackFunction(e){this.parseCallStack=e}};function sA(n){let e=Ko.getLevel(n),i=e.toString().toLowerCase().replace(/_([a-z])/g,o=>o[1].toUpperCase()),r=i[0].toUpperCase()+i.slice(1);eg.prototype[`is${r}Enabled`]=function(){return this.isLevelEnabled(e)},eg.prototype[i]=function(...o){this.log(e,...o)}}Ko.levels.forEach(sA);hae.addListener(()=>{Ko.levels.forEach(sA)});aA.exports=eg});var hA=y((g0e,cA)=>{var pc=bl(),pae=':remote-addr - - ":method :url HTTP/:http-version" :status :content-length ":referrer" ":user-agent"';function fae(n){return n.originalUrl||n.url}function mae(n,e,t){let i=o=>{let s=o.concat();for(let a=0;a<s.length;++a)for(let l=a+1;l<s.length;++l)s[a].token==s[l].token&&s.splice(l--,1);return s},r=[];return r.push({token:":url",replacement:fae(n)}),r.push({token:":protocol",replacement:n.protocol}),r.push({token:":hostname",replacement:n.hostname}),r.push({token:":method",replacement:n.method}),r.push({token:":status",replacement:e.__statusCode||e.statusCode}),r.push({token:":response-time",replacement:e.responseTime}),r.push({token:":date",replacement:new Date().toUTCString()}),r.push({token:":referrer",replacement:n.headers.referer||n.headers.referrer||""}),r.push({token:":http-version",replacement:`${n.httpVersionMajor}.${n.httpVersionMinor}`}),r.push({token:":remote-addr",replacement:n.headers["x-forwarded-for"]||n.ip||n._remoteAddress||n.socket&&(n.socket.remoteAddress||n.socket.socket&&n.socket.socket.remoteAddress)}),r.push({token:":user-agent",replacement:n.headers["user-agent"]}),r.push({token:":content-length",replacement:e.getHeader("content-length")||e.__headers&&e.__headers["Content-Length"]||"-"}),r.push({token:/:req\[([^\]]+)]/g,replacement(o,s){return n.headers[s.toLowerCase()]}}),r.push({token:/:res\[([^\]]+)]/g,replacement(o,s){return e.getHeader(s.toLowerCase())||e.__headers&&e.__headers[s]}}),i(t.concat(r))}function uA(n,e){for(let t=0;t<e.length;t++)n=n.replace(e[t].token,e[t].replacement);return n}function bae(n){let e=null;if(n instanceof RegExp&&(e=n),typeof n=="string"&&(e=new RegExp(n)),Array.isArray(n)){let t=n.map(i=>i.source?i.source:i);e=new RegExp(t.join("|"))}return e}function yae(n,e,t){let i=e;if(t){let r=t.find(o=>{let s=!1;return o.from&&o.to?s=n>=o.from&&n<=o.to:s=o.codes.indexOf(n)!==-1,s});r&&(i=pc.getLevel(r.level,i))}return i}cA.exports=function(e,t){typeof t=="string"||typeof t=="function"?t={format:t}:t=t||{};let i=e,r=pc.getLevel(t.level,pc.INFO),o=t.format||pae,s=bae(t.nolog);return(a,l,u)=>{if(a._logging||s&&s.test(a.originalUrl))return u();if(i.isLevelEnabled(r)||t.level==="auto"){let c=new Date,{writeHead:h}=l;a._logging=!0,l.writeHead=(d,g)=>{l.writeHead=h,l.writeHead(d,g),l.__statusCode=d,l.__headers=g||{}},l.on("finish",()=>{l.responseTime=new Date-c,l.statusCode&&t.level==="auto"&&(r=pc.INFO,l.statusCode>=300&&(r=pc.WARN),l.statusCode>=400&&(r=pc.ERROR)),r=yae(l.statusCode,r,t.statusRules);let d=mae(a,l,t.tokens||[]);if(t.context&&i.addContext("res",l),typeof o=="function"){let g=o(a,l,p=>uA(p,d));g&&i.log(r,g)}else i.log(r,uA(o,d));t.context&&i.remove
`+i.split(/\r?\n/).slice(3).join(`
`),e.endsWith("get_var")||this.client.logError(`request error on "${e}"`,t,s[1],i),o(l)}else r(a)})})}getArgsByPrefix(e){return this.prefix!=="nvim_"&&e[0]!=this?[Zue?this.data:this,...e]:e}getVar(e){return this.request(`${this.prefix}get_var`,[e]).then(t=>t,t=>null)}setVar(e,t,i=!1){if(i){this.notify(`${this.prefix}set_var`,[e,t]);return}return this.request(`${this.prefix}set_var`,[e,t])}deleteVar(e){this.notify(`${this.prefix}del_var`,[e])}getOption(e){return this.request(`${this.prefix}get_option`,[e])}setOption(e,t,i){if(i){this.notify(`${this.prefix}set_option`,[e,t]);return}return this.request(`${this.prefix}set_option`,[e,t])}notify(e,t=[]){this.transport.notify(e,this.getArgsByPrefix(t))}};wv.BaseApi=ck});var dg=y(xv=>{"use strict";Object.defineProperty(xv,"__esModule",{value:!0});xv.Buffer=void 0;var Jue=hg(),hk=class extends Jue.BaseApi{constructor(){super(...arguments),this.prefix="nvim_buf_"}async attach(e=!1,t={}){return await this.request(`${this.prefix}attach`,[e,t])}async detach(){return await this.request(`${this.prefix}detach`,[])}get id(){return this.data}get length(){return this.request(`${this.prefix}line_count`,[])}get lines(){return this.getLines()}get changedtick(){return this.request(`${this.prefix}get_changedtick`,[])}get commands(){return this.getCommands()}getCommands(e={}){return this.request(`${this.prefix}get_commands`,[e])}getLines({start:e,end:t,strictIndexing:i}={start:0,end:-1,strictIndexing:!0}){let r=typeof i>"u"?!0:i;return this.request(`${this.prefix}get_lines`,[e,t,r])}setLines(e,t,i=!1){let{start:r,end:o,strictIndexing:s}=t??{};r=r??0,o=o??r+1;let a=s??!0;return this[i?"notify":"request"](`${this.prefix}set_lines`,[r,o,a,typeof e=="string"?[e]:e])}setVirtualText(e,t,i,r={}){return this.client.call("coc#vtext#add",[this.id,e,t,i,r],!0),Promise.resolve(e)}deleteExtMark(e,t){this.client.isVim||this.notify(`${this.prefix}del_extmark`,[e,t])}async getExtMarkById(e,t,i={}){return this.client.isVim?Promise.resolve([]):this.request(`${this.prefix}get_extmark_by_id`,[e,t,i])}async getExtMarks(e,t,i,r={}){return this.client.isVim?Promise.resolve([]):this.request(`${this.prefix}get_extmarks`,[e,t,i,r])}setExtMark(e,t,i,r={}){this.client.isVim||this.notify(`${this.prefix}set_extmark`,[e,t,i,r])}insert(e,t){return this.setLines(e,{start:t,end:t,strictIndexing:!0})}replace(e,t){let i=typeof e=="string"?[e]:e;return this.setLines(i,{start:t,end:t+i.length,strictIndexing:!1})}remove(e,t,i=!1){return this.setLines([],{start:e,end:t,strictIndexing:i})}append(e){return this.setLines(e,{start:-1,end:-1,strictIndexing:!1})}get name(){return this.request(`${this.prefix}get_name`,[])}setName(e){return this.request(`${this.prefix}set_name`,[e])}get valid(){return this.request(`${this.prefix}is_valid`,[])}mark(e){return this.request(`${this.prefix}get_mark`,[e])}getKeymap(e){return this.request(`${this.prefix}get_keymap`,[e])}setKeymap(e,t,i,r={}){this.client.call("coc#compat#buf_add_keymap",[this.id,e,t,i,r],!0)}get loaded(){return this.request(`${this.prefix}is_loaded`,[])}getOffset(e){return this.request(`${this.prefix}get_offset`,[e])}addHighlight({hlGroup:e,line:t,colStart:i,colEnd:r,srcId:o}){if(!e)throw new Error("hlGroup should not empty");let s=typeof r<"u"?r:-1,a=typeof i<"u"?i:-0,l=typeof o<"u"?o:-1,u=l==0?"request":"notify",c=this[u](`${this.prefix}add_highlight`,[l,e,t,a,s]);return u==="request"?c:Promise.resolve(null)}clearHighlight(e={}){let t={srcId:-1,lineStart:0,lineEnd:-1},{srcId:i,lineStart:r,lineEnd:o}=Object.assign({},t,e);return this.notify(`${this.prefix}clear_highlight`,[i,r,o])}highlightRanges(e,t,i){this.client.call("coc#highlight#ranges",[this.id,e,t,i],!0)}clearNamespace(e,t=0,i=-1){this.client.call("coc#highlight#clear_highlight",[this.id,e,t,i],!0)}placeSign(e){let t={lnum:e.lnum};typeof e.priority=="number"&&(t.priority=e.priority),this.client.call("sign_place",[e.id||0,e.group||"",e.name,this.id,t],!0)}unplaceSign(e){let t={buffer:this.id};e.id!=null&&(t.id=e.id),this.client.call("sign_unplace",[e.group||"",t],!0)}async getSigns(e){return(await this.client.call("sign_getp
`}debug(e,...t){oH!="debug"||this.stream==null||this.stream.write(this.getText("debug",e,t))}info(e,...t){this.stream!=null&&this.stream.write(this.getText("info",e,t))}warn(e,...t){this.stream!=null&&this.stream.write(this.getText("warn",e,t))}error(e,...t){this.stream!=null&&this.stream.write(this.getText("error",e,t))}trace(e,...t){oH!="trace"||this.stream==null||this.stream.write(this.getText("trace",e,t))}};function ice(n){return new vk(n)}aa.createLogger=ice});var Sk=y(Ck=>{"use strict";Object.defineProperty(Ck,"__esModule",{value:!0});var nce=require("events"),rce=Pc(),aH=process.env.NODE_CLIENT_LOG_LEVEL=="debug",fg=(0,rce.createLogger)("transport"),xk=class extends nce.EventEmitter{constructor(e){super(),this.logger=e,this.pauseLevel=0,this.paused=new Map}debug(e,...t){!aH||fg.debug(e,...t)}info(e,...t){fg.info(e,...t)}debugMessage(e){if(!aH)return;let t=e[0];t==0?fg.debug("receive request:",e.slice(1)):t==1||(t==2?fg.debug("receive notification:",e.slice(1)):fg.debug("unknown message:",e))}pauseNotification(){this.pauseLevel=this.pauseLevel+1,this.paused.set(this.pauseLevel,[])}cancelNotification(){let{pauseLevel:e}=this;e>0&&(this.paused.delete(e),this.pauseLevel=e-1)}resumeNotification(e=!1){let{pauseLevel:t}=this;if(t==0)return e?null:Promise.resolve([[],null]);let i=Error().stack;this.pauseLevel=t-1;let r=this.paused.get(t);return this.paused.delete(t),r&&r.length?new Promise((o,s)=>{if(!e)return this.request("nvim_call_atomic",[r],(a,l)=>{if(a){let u=new Error(`call_atomic error: ${a[1]}`);return u.stack=i,s(u)}if(Array.isArray(l)&&l[1]!=null){let[u,c,h]=l[1],[d,g]=r[u],p=new Error(`call_atomic request error on "${d}": ${h}`);return p.stack=i,this.logger.error(`call_atomic request error ${c} on "${d}"`,g,h,i),s(p)}o(l)});this.notify("nvim_call_atomic",[r]),o(void 0)}):e?null:Promise.resolve([[],void 0])}};Ck.default=xk});var uH=y(br=>{"use strict";var oce=br&&br.__createBinding||(Object.create?function(n,e,t,i){i===void 0&&(i=t);var r=Object.getOwnPropertyDescriptor(e,t);(!r||("get"in r?!e.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(n,i,r)}:function(n,e,t,i){i===void 0&&(i=t),n[i]=e[t]}),sce=br&&br.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),ace=br&&br.__importStar||function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var t in n)t!=="default"&&Object.prototype.hasOwnProperty.call(n,t)&&oce(e,n,t);return sce(e,n),e},lH=br&&br.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(br,"__esModule",{value:!0});br.NvimTransport=void 0;var ts=ace(iH()),lce=lH(nH()),uce=rH(),cce=lH(Sk()),Dk=class extends cce.default{constructor(e){super(e),this.pending=new Map,this.nextRequestId=1,this.attached=!1;let t=this.setupCodec();this.encodeStream=ts.createEncodeStream({codec:t}),this.decodeStream=ts.createDecodeStream({codec:t}),this.decodeStream.on("data",i=>{this.parseMessage(i)}),this.decodeStream.on("end",()=>{this.detach(),this.emit("detach")})}parseMessage(e){let t=e[0];if(this.debugMessage(e),t===0)this.emit("request",e[2].toString(),e[3],this.createResponse(e[1]));else if(t===1){let i=e[1],r=this.pending.get(i);if(r){this.pending.delete(i);let o=e[2];o&&o.length!=2&&(o=[0,o instanceof Error?o.message:o]),r(o,e[3])}}else t===2?this.emit("notification",e[1].toString(),e[2]):console.error(`Invalid message type ${t}`)}setupCodec(){let e=ts.createCodec();return uce.Metadata.forEach(({constructor:t},i)=>{e.addExtPacker(i,t,r=>ts.encode(r.data)),e.addExtUnpacker(i,r=>new t({transport:this,client:this.client,data:ts.decode(r)}))}),this.codec=e,this.codec}attach(e,t,i){this.encodeStream=this.encodeStream.pipe(e);let r=new lce.default;t.pipe(r).pipe(this.decodeStream),this.writer=e,this.reader=t,this.client=i,this.attached=!0}detach(){!this.attached||(this.attached=!1,this.encodeStream.unpipe(this.writer),this.reader.unpipe(this.decodeStream))}request(e,t,i){if(!this.attached)return;let r=this.nextRequestId;this.nextRequ
`)}catch{Ec.error("Send error:",e)}}redraw(e){this.send(["redraw",e?"force":""])}command(e){this.send(["ex",e])}expr(e){this.send(["expr",e])}call(e,t,i){if(!i){this.send(["call",e,t]);return}this.send(["call",e,t,i])}dispose(){this.removeAllListeners()}};mg.default=Tk});var dH=y(Pk=>{"use strict";Object.defineProperty(Pk,"__esModule",{value:!0});var pce=Pc(),iEe=(0,pce.createLogger)("request"),fce=process.env.COC_NVIM=="1"?"coc#api#call":"nvim#api#call",kk=class{constructor(e,t,i){this.connection=e,this.cb=t,this.id=i}request(e,t=[]){this.method=e,this.connection.call(fce,[e.slice(5),t],this.id)}callback(e,t,i){let{method:r,cb:o}=this;if(t)return o([0,t.toString()]);switch(r){case"nvim_list_wins":case"nvim_tabpage_list_wins":return o(null,i.map(s=>e.createWindow(s)));case"nvim_tabpage_get_win":case"nvim_get_current_win":case"nvim_open_win":return o(null,e.createWindow(i));case"nvim_list_bufs":return o(null,i.map(s=>e.createBuffer(s)));case"nvim_win_get_buf":case"nvim_create_buf":case"nvim_get_current_buf":return o(null,e.createBuffer(i));case"nvim_list_tabpages":return o(null,i.map(s=>e.createTabpage(s)));case"nvim_get_current_tabpage":return o(null,e.createTabpage(i));default:return o(null,i)}}};Pk.default=kk});var gH=y(Rc=>{"use strict";var Rk=Rc&&Rc.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Rc,"__esModule",{value:!0});Rc.VimTransport=void 0;var mce=Rk(Sk()),bce=Rk(hH()),yce=Rk(dH()),Ek=class extends mce.default{constructor(e){super(e),this.pending=new Map,this.nextRequestId=-1,this.attached=!1,this.errText="",this.outText="",this.notifyMethod=process.env.COC_NVIM=="1"?"coc#api#notify":"nvim#api#notify"}attach(e,t,i){let r=this.connection=new bce.default(t,e);this.attached=!0,this.client=i,r.on("request",(o,s)=>{let[a,l]=s;this.emit("request",a,l,this.createResponse(o))}),r.on("notification",o=>{let[s,a]=o;this.emit("notification",s.toString(),a)}),r.on("response",(o,s)=>{let a=this.pending.get(o);if(a){this.pending.delete(o);let l=null,u=null;Array.isArray(s)?(l=s[0],u=s[1]):l=s,a.callback(this.client,l,u)}})}send(e){this.connection.send(e)}detach(){!this.attached||(this.attached=!1,this.connection.dispose())}request(e,t,i){if(!this.attached)return i([0,"transport disconnected"]);let r=this.nextRequestId;this.nextRequestId=this.nextRequestId-1;let o=Date.now();this.debug("request to vim:",r,e,t);let s=setTimeout(()=>{this.debug("request to vim cost more than 1s",e,t)},1e3),a=new yce.default(this.connection,(l,u)=>{clearTimeout(s),this.debug("response from vim cost:",r,`${Date.now()-o}ms`),i(l,u)},r);this.pending.set(r,a),a.request(e,t)}notify(e,t){if(!this.attached)return;if(this.pauseLevel!=0){let r=this.paused.get(this.pauseLevel);if(r){r.push([e,t]);return}}let i=e.slice(5);if(i=="err_write"){this.errText=this.errText+t[0].toString();return}if(i=="out_write"){let r=t[0].toString()||"";if(!r.includes(`
`))this.outText=this.outText+r;else{let o=this.outText+t[0].toString();this.outText="",this.connection.call(this.notifyMethod,[i,[o]])}return}if(i=="err_writeln"){let r=this.errText+t[0].toString();this.errText="",this.connection.call(this.notifyMethod,[i,[r]]);return}this.connection.call(this.notifyMethod,[i,t])}createResponse(e){let t=!1,{connection:i}=this,r=Date.now(),o=setTimeout(()=>{this.debug("request to client cost more than 1s",e)},1e3);return{send:(s,a)=>{if(clearTimeout(o),t||!this.attached)return;t=!0;let l=null;a&&(l=typeof s=="string"?s:s.toString()),this.debug("response of client cost:",e,`${Date.now()-r}ms`),i.response(e,[l,a?null:s])}}}};Rc.VimTransport=Ek});var pH=y(Dv=>{"use strict";Object.defineProperty(Dv,"__esModule",{value:!0});Dv.Neovim=void 0;var vce=hg(),wce=dg(),xce=pg(),Cce=gg(),Sce=process.env.VIM_NODE_RPC=="1",_k=class extends vce.BaseApi{constructor(){super(...arguments),this.prefix="nvim_",this.Buffer=wce.Buffer,this.Window=Cce.Window,this.Tabpage=xce.Tabpage}getArgs(e){return e?Array.isArray(e)?e:[e]:[]}get apiInfo(){return this.request(`${this.prefix}get_api_info`)}get buffers(){return this.request(`${this.prefix}list_bufs`)}get buffer(){return this.request(`${this.prefix}get_current_buf`)}async setBuffer(e){await this.request(`${this.prefix}set_current_buf`,[e])}get chans(){return this.request(`${this.prefix}list_chans`)}getChanInfo(e){return this.request(`${this.prefix}get_chan_info`,[e])}createNamespace(e=""){return process.env.COC_NVIM=="1"?(e=e.startsWith("coc-")?e.slice(4):e,this.request(`${this.prefix}call_function`,["coc#highlight#create_namespace",[e]])):this.request(`${this.prefix}create_namespace`,[e])}get namespaces(){return this.request(`${this.prefix}get_namespaces`,[])}get commands(){return this.getCommands()}getCommands(e={}){return this.request(`${this.prefix}get_commands`,[e])}get tabpages(){return this.request(`${this.prefix}list_tabpages`)}get tabpage(){return this.request(`${this.prefix}get_current_tabpage`)}async setTabpage(e){await this.request(`${this.prefix}set_current_tabpage`,[e])}get windows(){return this.getWindows()}get window(){return this.request(`${this.prefix}get_current_win`)}getWindows(){return this.request(`${this.prefix}list_wins`)}async setWindow(e){await this.request(`${this.prefix}set_current_win`,[e])}get runtimePaths(){return this.request(`${this.prefix}list_runtime_paths`)}setDirectory(e){return this.request(`${this.prefix}set_current_dir`,[e])}get line(){return this.getLine()}createNewBuffer(e=!1,t=!1){return this.request(`${this.prefix}create_buf`,[e,t])}openFloatWindow(e,t,i){return this.request(`${this.prefix}open_win`,[e,t,i])}getLine(){return this.request(`${this.prefix}get_current_line`)}setLine(e){return this.request(`${this.prefix}set_current_line`,[e])}getKeymap(e){return this.request(`${this.prefix}get_keymap`,[e])}get mode(){return this.request(`${this.prefix}get_mode`)}get colorMap(){return this.request(`${this.prefix}get_color_map`)}getColorByName(e){return this.request(`${this.prefix}get_color_by_name`,[e])}getHighlight(e,t=!0){let i=typeof e=="string"?"by_name":"by_id";return this.request(`${this.prefix}get_hl_${i}`,[e,t])}getHighlightByName(e,t=!0){return this.request(`${this.prefix}get_hl_by_name`,[e,t])}getHighlightById(e,t=!0){return this.request(`${this.prefix}get_hl_by_id`,[e,t])}deleteCurrentLine(){return this.request(`${this.prefix}del_current_line`)}eval(e){return this.request(`${this.prefix}eval`,[e])}lua(e,t=[]){return this.request(`${this.prefix}exec_lua`,[e,t])}executeLua(e,t=[]){let i=this.getArgs(t);return this.lua(e,i)}callDictFunction(e,t,i=[]){let r=this.getArgs(i);return this.request(`${this.prefix}call_dict_function`,[e,t,r])}call(e,t=[],i){let r=this.getArgs(t);return i?(this.notify(`${this.prefix}call_function`,[e,r]),null):this.request(`${this.prefix}call_function`,[e,r])}callTimer(e,t=[],i){let r=this.getArgs(t);return i?(this.notify(`${this.prefix}call_function`,["coc#util#timer",[e,r]]),null):Sce?(this.notify(`${this.prefix}call_function`,["coc#util#timer",[e,r]]),new Promise(o=>{setTimeout(()=>{o(nul
`)}errWrite(e){this.notify(`${this.prefix}err_write`,[e])}errWriteLine(e){this.notify(`${this.prefix}err_writeln`,[e])}get uis(){return this.request(`${this.prefix}list_uis`)}uiAttach(e,t,i){return this.request(`${this.prefix}ui_attach`,[e,t,i])}uiDetach(){return this.request(`${this.prefix}ui_detach`,[])}uiTryResize(e,t){return this.request(`${this.prefix}ui_try_resize`,[e,t])}uiSetOption(e,t){return this.request(`${this.prefix}ui_set_option`,[e,t])}subscribe(e){return this.request(`${this.prefix}subscribe`,[e])}unsubscribe(e){return this.request(`${this.prefix}unsubscribe`,[e])}setClientInfo(e,t,i,r,o){this.notify(`${this.prefix}set_client_info`,[e,t,i,r,o])}async quit(){this.command("qa!",!0),this.transport&&this.transport.detach()}};Dv.Neovim=_k});var Pv=y(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.NeovimClient=_c.AsyncResponse=void 0;var Dce=uH(),Tce=gH(),kce=pH(),Pce=dg(),Ece=gg(),Rce=pg(),_ce=Pc(),fH=(0,_ce.createLogger)("client"),Tv=process.env.VIM_NODE_RPC=="1",kv=class{constructor(e,t){this.requestId=e,this.cb=t,this.finished=!1}finish(e,t){if(!this.finished){if(this.finished=!0,e){this.cb(new Error(e));return}this.cb(null,t)}}};_c.AsyncResponse=kv;var Lk=class extends kce.Neovim{constructor(e){super({}),this.logger=e,this.requestId=1,this.responses=new Map,this.attachedBuffers=new Map,this.isVim=Tv,Object.defineProperty(this,"client",{value:this});let t=Tv?new Tce.VimTransport(e):new Dce.NvimTransport(e);this.setTransport(t),this.transportAttached=!1,this.handleRequest=this.handleRequest.bind(this),this.handleNotification=this.handleNotification.bind(this)}echoError(e){let t=process.env.COC_NVIM=="1"?"[coc.nvim] ":"";e instanceof Error?(this.errWriteLine(t+e.message+" use :CocOpenLog for details"),this.logError(e.message||"Unknown error",e.stack)):(this.errWriteLine(t+e),this.logError(e.toString(),Error().stack))}logError(e,...t){!this.logger||this.logger.error(e,...t)}createBuffer(e){return new Pce.Buffer({transport:this.transport,data:e,client:this})}createWindow(e){return new Ece.Window({transport:this.transport,data:e,client:this})}createTabpage(e){return new Rce.Tabpage({transport:this.transport,data:e,client:this})}send(e){this.transport.send(e)}redrawVim(e){!Tv||this.transport.notify("nvim_command",["redraw"+(e?"!":"")])}attach({reader:e,writer:t},i=!0){this.transport.attach(t,e,this),this.transportAttached=!0,this.setupTransport(i)}detach(){this.transport.detach(),this.transportAttached=!1}get isApiReady(){return this.transportAttached&&typeof this._channelId<"u"}get channelId(){return this._isReady.then(()=>this._channelId)}isAttached(e){return this.attachedBuffers.has(e)}handleRequest(e,t,i){this.emit("request",e,t,i)}sendAsyncRequest(e,t){let i=this.requestId;return this.requestId=i+1,this.notify("nvim_call_function",["coc#rpc#async_request",[i,e,t||[]]]),new Promise((r,o)=>{let s=new kv(i,(a,l)=>{if(a)return o(a);r(l)});this.responses.set(i,s)})}emitNotification(e,t){if(e.endsWith("_event")){if(e.startsWith("nvim_buf_")){let i=e.replace(/nvim_buf_(.*)_event/,"$1"),{id:r}=t[0];if(!this.attachedBuffers.has(r))return;(this.attachedBuffers.get(r).get(i)||[]).forEach(a=>a(...t)),i==="detach"&&this.attachedBuffers.delete(r);return}if(e.startsWith("nvim_async_request")){let[i,r,o]=t;this.handleRequest(r,o,{send:(s,a)=>{this.notify("nvim_call_function",["coc#rpc#async_response",[i,s,a]])}});return}if(e.startsWith("nvim_async_response")){let[i,r,o]=t,s=this.responses.get(i);if(!s){console.error(`Response not found for request ${i}`);return}this.responses.delete(i),s.finish(r,o);return}if(e==="nvim_error_event"){this.logger.error("Error event from nvim:",t[0],t[1]);return}this.logger.debug(`Unhandled event: ${e}`,t)}else this.emit("notification",e,t)}handleNotification(e,t){this.emitNotification(e,t)}setupTransport(e=!0){if(!this.transportAttached)throw new Error("Not attached to input/output");this.transport.on("request",this.handleRequest),this.transport.on("notification",this.handleNotification),this.transport.on("detach",()=>{this.emit("disconnect"),this.transport.removeAllLi
`,Ok=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(e){let t=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(t),this._totalLength+=t.byteLength}tryReadHeaders(){if(this._chunks.length===0)return;let e=0,t=0,i=0,r=0;e:for(;t<this._chunks.length;){let l=this._chunks[t];i=0;t:for(;i<l.length;){switch(l[i]){case Wce:switch(e){case 0:e=1;break;case 2:e=3;break;default:e=0}break;case Yce:switch(e){case 1:e=2;break;case 3:e=4,i++;break e;default:e=0}break;default:e=0}i++}r+=l.byteLength,t++}if(e!==4)return;let o=this._read(r+i),s=new Map,a=this.toString(o,"ascii").split(Zce);if(a.length<2)return s;for(let l=0;l<a.length-2;l++){let u=a[l],c=u.indexOf(":");if(c===-1)throw new Error("Message header must separate key and value using :");let h=u.substr(0,c),d=u.substr(c+1).trim();s.set(h,d)}return s}tryReadBody(e){if(!(this._totalLength<e))return this._read(e)}get numberOfBytes(){return this._totalLength}_read(e){if(e===0)return this.emptyBuffer();if(e>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let o=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(o)}if(this._chunks[0].byteLength>e){let o=this._chunks[0],s=this.asNative(o,e);return this._chunks[0]=o.slice(e),this._totalLength-=e,s}let t=this.allocNative(e),i=0,r=0;for(;e>0;){let o=this._chunks[r];if(o.byteLength>e){let s=o.slice(0,e);t.set(s,i),i+=e,this._chunks[r]=o.slice(e),this._totalLength-=e,e-=e}else t.set(o,i),i+=o.byteLength,this._chunks.shift(),this._totalLength-=o.byteLength,e-=o.byteLength}return t}};Rv.AbstractMessageBuffer=Ok});var CH=y(qk=>{"use strict";Object.defineProperty(qk,"__esModule",{value:!0});var Jce=is(),wH=require("util"),Ll=Mk(),$ce=vH(),Lc=class extends $ce.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return Lc.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new wH.TextDecoder(t).decode(e)}asNative(e,t){return t===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,t):Buffer.from(e,0,t)}allocNative(e){return Buffer.allocUnsafe(e)}};Lc.emptyBuffer=Buffer.allocUnsafe(0);var Ak=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Ll.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Ll.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Ll.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),Ll.Disposable.create(()=>this.stream.off("data",e))}},Nk=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),Ll.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),Ll.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),Ll.Disposable.create(()=>this.stream.off("end",e))}write(e,t){return new Promise((i,r)=>{let o=s=>{s==null?i():r(s)};typeof e=="string"?this.stream.write(e,t,o):this.stream.write(e,o)})}end(){this.stream.end()}},xH=Object.freeze({messageBuffer:Object.freeze({create:n=>new Lc(n)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(n,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(n,void 0,0),e.charset))}catch(t){return Promise.reject(t)}}}),decoder:Object.freeze({name:"application/json",decode:(n,e)=>{try{return n instanceof Buffer?Promise.resolve(JSON.parse(n.toString(e.charset))):Promise.resolve(JSON.parse(new wH.TextDecoder(e.charset).decode(n)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:n=>new Ak(n),asWritableStream:n=>new Nk(n)}),console,timer:Object.freeze({setTimeout(n,e,...t){let i=setTimeout(n,e,...t);return{dispose:()=>clearTimeout(i)}},setImmediate(n,...e){let t=setImmediate(n,...e);return{dispose:()=>clearImmediate(t)}},setInterval(n,e,...t){let i=setInterval(n,e,...t);return{dispose:()=>clearInterval(i)}}})});function Hk(){ret
`,lhe;(function(n){function e(t){let i=t;return i&&wg.func(i.dispose)&&wg.func(i.onClose)&&wg.func(i.onError)&&wg.func(i.write)}n.is=e})(lhe=os.MessageWriter||(os.MessageWriter={}));var jv=class{constructor(){this.errorEmitter=new _H.Emitter,this.closeEmitter=new _H.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e,t,i){this.errorEmitter.fire([this.asError(e),t,i])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${wg.string(e.message)?e.message:"unknown"}`)}};os.AbstractMessageWriter=jv;var CP;(function(n){function e(t){return t===void 0||typeof t=="string"?{charset:t??"utf-8",contentTypeEncoder:(0,RH.default)().applicationJson.encoder}:{charset:t.charset??"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:t.contentTypeEncoder??(0,RH.default)().applicationJson.encoder}}n.fromOptions=e})(CP||(CP={}));var SP=class extends jv{constructor(e,t){super(),this.writable=e,this.options=CP.fromOptions(t),this.errorCount=0,this.writeSemaphore=new she.Semaphore(1),this.writable.onError(i=>this.fireError(i)),this.writable.onClose(()=>this.fireClose())}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(i=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(i):i).then(i=>{let r=[];return r.push(ahe,i.byteLength.toString(),LH),r.push(LH),this.doWrite(e,r,i)},i=>{throw this.fireError(i),i}))}async doWrite(e,t,i){try{return await this.writable.write(t.join(""),"ascii"),this.writable.write(i)}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}end(){this.writable.end()}};os.WriteableStreamMessageWriter=SP});var NH=y(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.createMessageConnection=we.ConnectionOptions=we.CancellationStrategy=we.CancellationSenderStrategy=we.CancellationReceiverStrategy=we.ConnectionStrategy=we.ConnectionError=we.ConnectionErrors=we.LogTraceNotification=we.SetTraceNotification=we.TraceFormat=we.TraceValues=we.Trace=we.NullLogger=we.ProgressType=we.ProgressToken=void 0;var FH=is(),ci=Ic(),Te=uP(),jH=hP(),xg=jc(),DP=mP(),Sg;(function(n){n.type=new Te.NotificationType("$/cancelRequest")})(Sg||(Sg={}));var MH;(function(n){function e(t){return typeof t=="string"||typeof t=="number"}n.is=e})(MH=we.ProgressToken||(we.ProgressToken={}));var Cg;(function(n){n.type=new Te.NotificationType("$/progress")})(Cg||(Cg={}));var TP=class{constructor(){}};we.ProgressType=TP;var kP;(function(n){function e(t){return ci.func(t)}n.is=e})(kP||(kP={}));we.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var lt;(function(n){n[n.Off=0]="Off",n[n.Messages=1]="Messages",n[n.Compact=2]="Compact",n[n.Verbose=3]="Verbose"})(lt=we.Trace||(we.Trace={}));var uhe;(function(n){n.Off="off",n.Messages="messages",n.Compact="compact",n.Verbose="verbose"})(uhe=we.TraceValues||(we.TraceValues={}));(function(n){function e(i){if(!ci.string(i))return n.Off;switch(i=i.toLowerCase(),i){case"off":return n.Off;case"messages":return n.Messages;case"compact":return n.Compact;case"verbose":return n.Verbose;default:return n.Off}}n.fromString=e;function t(i){switch(i){case n.Off:return"off";case n.Messages:return"messages";case n.Compact:return"compact";case n.Verbose:return"verbose";default:return"off"}}n.toString=t})(lt=we.Trace||(we.Trace={}));var Zr;(function(n){n.Text="text",n.JSON="json"})(Zr=we.TraceFormat||(we.TraceFormat={}));(function(n){function e(t){return ci.string(t)?(t=t.toLowerCase(),t==="json"?n.JSON:n.Text):n.Text}n.fromString=e})(Zr=we.TraceFormat||(we.TraceFormat={}));var OH;(function(n){n.type=new Te.NotificationType("$/setTrace")})(OH=we.SetTraceNotification||(we.SetTraceNotification={}));var PP;(function(n){n.type=new Te.NotificationType("$/logTrace")})(PP=we.LogTraceNotification||(we.LogTraceNotification={}));var Mv;(function(n){n[n.Cl
${JSON.stringify(E.error,void 0,4)}`):r.error("Received response message without id. No further error information provided.");else{let z=E.id,te=m.get(z);if(vy(E,te),te!==void 0){m.delete(z);try{if(E.error){let he=E.error;te.reject(new Te.ResponseError(he.code,he.message,he.data))}else if(E.result!==void 0)te.resolve(E.result);else throw new Error("Should never happen.")}catch(he){he.message?r.error(`Response handler '${te.method}' failed with message: ${he.message}`):r.error(`Response handler '${te.method}' failed unexpectedly.`)}}}}function Ae(E){if(V())return;let z,te;if(E.method===Sg.type.method){let he=E.params.id;b.delete(he),jd(E);return}else{let he=d.get(E.method);he&&(te=he.handler,z=he.type)}if(te||h)try{if(jd(E),te)if(E.params===void 0)z!==void 0&&z.numberOfParams!==0&&z.parameterStructures!==Te.ParameterStructures.byName&&r.error(`Notification ${E.method} defines ${z.numberOfParams} params but received none.`),te();else if(Array.isArray(E.params)){let he=E.params;E.method===Cg.type.method&&he.length===2&&MH.is(he[0])?te({token:he[0],value:he[1]}):(z!==void 0&&(z.parameterStructures===Te.ParameterStructures.byName&&r.error(`Notification ${E.method} defines parameters by name but received parameters by position`),z.numberOfParams!==E.params.length&&r.error(`Notification ${E.method} defines ${z.numberOfParams} params but received ${he.length} arguments`)),te(...he))}else z!==void 0&&z.parameterStructures===Te.ParameterStructures.byPosition&&r.error(`Notification ${E.method} defines parameters by position but received parameters by name`),te(E.params);else h&&h(E.method,E.params)}catch(he){he.message?r.error(`Notification handler '${E.method}' failed with message: ${he.message}`):r.error(`Notification handler '${E.method}' failed unexpectedly.`)}else H.fire(E)}function Ne(E){if(!E){r.error("Received empty message.");return}r.error(`Received message which is neither a response nor a notification message:
${JSON.stringify(E,null,4)}`);let z=E;if(ci.string(z.id)||ci.number(z.id)){let te=z.id,he=m.get(te);he&&he.reject(new Error("The received response has neither a result nor an error property."))}}function Ie(E){if(E!=null)switch(x){case lt.Verbose:return JSON.stringify(E,null,4);case lt.Compact:return JSON.stringify(E);default:return}}function li(E){if(!(x===lt.Off||!R))if(T===Zr.Text){let z;(x===lt.Verbose||x===lt.Compact)&&E.params&&(z=`Params: ${Ie(E.params)}
`),R.log(`Sending request '${E.method} - (${E.id})'.`,z)}else tc("send-request",E)}function Nr(E){if(!(x===lt.Off||!R))if(T===Zr.Text){let z;(x===lt.Verbose||x===lt.Compact)&&(E.params?z=`Params: ${Ie(E.params)}
`:z=`No parameters provided.
`),R.log(`Sending notification '${E.method}'.`,z)}else tc("send-notification",E)}function Cn(E,z,te){if(!(x===lt.Off||!R))if(T===Zr.Text){let he;(x===lt.Verbose||x===lt.Compact)&&(E.error&&E.error.data?he=`Error data: ${Ie(E.error.data)}
`:E.result?he=`Result: ${Ie(E.result)}
`:E.error===void 0&&(he=`No result returned.
`)),R.log(`Sending response '${z} - (${E.id})'. Processing request took ${Date.now()-te}ms`,he)}else tc("send-response",E)}function Jn(E){if(!(x===lt.Off||!R))if(T===Zr.Text){let z;(x===lt.Verbose||x===lt.Compact)&&E.params&&(z=`Params: ${Ie(E.params)}
`),R.log(`Received request '${E.method} - (${E.id})'.`,z)}else tc("receive-request",E)}function jd(E){if(!(x===lt.Off||!R||E.method===PP.type.method))if(T===Zr.Text){let z;(x===lt.Verbose||x===lt.Compact)&&(E.params?z=`Params: ${Ie(E.params)}
`:z=`No parameters provided.
`),R.log(`Received notification '${E.method}'.`,z)}else tc("receive-notification",E)}function vy(E,z){if(!(x===lt.Off||!R))if(T===Zr.Text){let te;if((x===lt.Verbose||x===lt.Compact)&&(E.error&&E.error.data?te=`Error data: ${Ie(E.error.data)}
`:E.result?te=`Result: ${Ie(E.result)}
`:E.error===void 0&&(te=`No result returned.
`)),z){let he=E.error?` Request failed: ${E.error.message} (${E.error.code}).`:"";R.log(`Received response '${z.method} - (${E.id})' in ${Date.now()-z.timerStart}ms.${he}`,te)}else R.log(`Received response ${E.id} without active response promise.`,te)}else tc("receive-response",E)}function tc(E,z){if(!R||x===lt.Off)return;let te={isLSPMessage:!0,type:E,message:z,timestamp:Date.now()};R.log(te)}function Md(){if(G())throw new la(Mv.Closed,"Connection is closed.");if(V())throw new la(Mv.Disposed,"Connection is disposed.")}function zie(){if(B())throw new la(Mv.AlreadyListening,"Connection is already listening")}function Kie(){if(!B())throw new Error("Call listen() first.")}function Od(E){return E===void 0?null:E}function nj(E){if(E!==null)return E}function rj(E){return E!=null&&!Array.isArray(E)&&typeof E=="object"}function UD(E,z){switch(E){case Te.ParameterStructures.auto:return rj(z)?nj(z):[Od(z)];case Te.ParameterStructures.byName:if(!rj(z))throw new Error("Received parameters by name but param is not an object literal.");return nj(z);case Te.ParameterStructures.byPosition:return[Od(z)];default:throw new Error(`Unknown parameter structure ${E.toString()}`)}}function oj(E,z){let te,he=E.numberOfParams;switch(he){case 0:te=void 0;break;case 1:te=UD(E.parameterStructures,z[0]);break;default:te=[];for(let Tt=0;Tt<z.length&&Tt<he;Tt++)te.push(Od(z[Tt]));if(z.length<he)for(let Tt=z.length;Tt<he;Tt++)te.push(null);break}return te}let ic={sendNotification:(E,...z)=>{Md();let te,he;if(ci.string(E)){te=E;let kt=z[0],vt=0,mi=Te.ParameterStructures.auto;Te.ParameterStructures.is(kt)&&(vt=1,mi=kt);let Ue=z.length,jt=Ue-vt;switch(jt){case 0:he=void 0;break;case 1:he=UD(mi,z[vt]);break;default:if(mi===Te.ParameterStructures.byName)throw new Error(`Received ${jt} parameters for 'by Name' notification parameter structure.`);he=z.slice(vt,Ue).map(it=>Od(it));break}}else{let kt=z;te=E.method,he=oj(E,kt)}let Tt={jsonrpc:l,method:te,params:he};return Nr(Tt),e.write(Tt).catch(()=>r.error("Sending notification failed."))},onNotification:(E,z)=>{Md();let te;return ci.func(E)?h=E:z&&(ci.string(E)?(te=E,d.set(E,{type:void 0,handler:z})):(te=E.method,d.set(E.method,{type:E,handler:z}))),{dispose:()=>{te!==void 0?d.delete(te):h=void 0}}},onProgress:(E,z,te)=>{if(g.has(z))throw new Error(`Progress handler for token ${z} already registered`);return g.set(z,te),{dispose:()=>{g.delete(z)}}},sendProgress:(E,z,te)=>ic.sendNotification(Cg.type,{token:z,value:te}),onUnhandledProgress:M.event,sendRequest:(E,...z)=>{Md(),Kie();let te,he,Tt;if(ci.string(E)){te=E;let Ue=z[0],jt=z[z.length-1],it=0,ui=Te.ParameterStructures.auto;Te.ParameterStructures.is(Ue)&&(it=1,ui=Ue);let Sn=z.length;DP.CancellationToken.is(jt)&&(Sn=Sn-1,Tt=jt);let hl=Sn-it;switch(hl){case 0:he=void 0;break;case 1:he=UD(ui,z[it]);break;default:if(ui===Te.ParameterStructures.byName)throw new Error(`Received ${hl} parameters for 'by Name' request parameter structure.`);he=z.slice(it,Sn).map(Zs=>Od(Zs));break}}else{let Ue=z;te=E.method,he=oj(E,Ue);let jt=E.numberOfParams;Tt=DP.CancellationToken.is(Ue[jt])?Ue[jt]:void 0}let kt=o++,vt;return Tt&&(vt=Tt.onCancellationRequested(()=>{let Ue=O.sender.sendCancellation(ic,kt);return Ue===void 0?(r.log(`Received no promise from cancellation strategy when cancelling id ${kt}`),Promise.resolve()):Ue.catch(()=>{r.log(`Sending cancellation messages for id ${kt} failed`)})})),new Promise((Ue,jt)=>{let it={jsonrpc:l,id:kt,method:te,params:he},ui=Zs=>{Ue(Zs),O.sender.cleanup(kt),vt==null||vt.dispose()},Sn=Zs=>{jt(Zs),O.sender.cleanup(kt),vt==null||vt.dispose()},hl={method:te,timerStart:Date.now(),resolve:ui,reject:Sn};li(it);try{e.write(it).catch(()=>r.error("Sending request failed."))}catch(Zs){hl.reject(new Te.ResponseError(Te.ErrorCodes.MessageWriteError,Zs.message?Zs.message:"Unknown reason")),hl=null}hl&&m.set(kt,hl)})},onRequest:(E,z)=>{Md();let te=null;return kP.is(E)?(te=void 0,u=E):ci.string(E)?(te=null,z!==void 0&&(te=E,c.set(E,{handler:z,type:void 0}))):z!==void 0&&(te=E.method,c.set(E.method,{type:E,handler:z})),{dispose:()=>{te!==null&&(te!==void
`,`\r
`,"\r"];(function(n){function e(o,s,a,l){return new Rhe(o,s,a,l)}n.create=e;function t(o){var s=o;return!!(A.defined(s)&&A.string(s.uri)&&(A.undefined(s.languageId)||A.string(s.languageId))&&A.uinteger(s.lineCount)&&A.func(s.getText)&&A.func(s.positionAt)&&A.func(s.offsetAt))}n.is=t;function i(o,s){for(var a=o.getText(),l=r(s,function(p,f){var m=p.range.start.line-f.range.start.line;return m===0?p.range.start.character-f.range.start.character:m}),u=a.length,c=l.length-1;c>=0;c--){var h=l[c],d=o.offsetAt(h.range.start),g=o.offsetAt(h.range.end);if(g<=u)a=a.substring(0,d)+h.newText+a.substring(g,a.length);else throw new Error("Overlapping edit");u=d}return a}n.applyEdits=i;function r(o,s){if(o.length<=1)return o;var a=o.length/2|0,l=o.slice(0,a),u=o.slice(a);r(l,s),r(u,s);for(var c=0,h=0,d=0;c<l.length&&h<u.length;){var g=s(l[c],u[h]);g<=0?o[d++]=l[c++]:o[d++]=u[h++]}for(;c<l.length;)o[d++]=l[c++];for(;h<u.length;)o[d++]=u[h++];return o}})(R0||(R0={}));Rhe=function(){function n(e,t,i,r){this._uri=e,this._languageId=t,this._version=i,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(n.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),n.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),i=this.offsetAt(e.end);return this._content.substring(t,i)}return this._content},n.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},n.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var e=[],t=this._content,i=!0,r=0;r<t.length;r++){i&&(e.push(r),i=!1);var o=t.charAt(r);i=o==="\r"||o===`
`,o==="\r"&&r+1<t.length&&t.charAt(r+1)===`
`&&r++}i&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},n.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),i=0,r=t.length;if(r===0)return Mt.create(0,e);for(;i<r;){var o=Math.floor((i+r)/2);t[o]>e?r=o:i=o+1}var s=i-1;return Mt.create(s,e-t[s])},n.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var i=t[e.line],r=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(i+e.character,r),i)},Object.defineProperty(n.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),n}();(function(n){var e=Object.prototype.toString;function t(g){return typeof g<"u"}n.defined=t;function i(g){return typeof g>"u"}n.undefined=i;function r(g){return g===!0||g===!1}n.boolean=r;function o(g){return e.call(g)==="[object String]"}n.string=o;function s(g){return e.call(g)==="[object Number]"}n.number=s;function a(g,p,f){return e.call(g)==="[object Number]"&&p<=g&&g<=f}n.numberRange=a;function l(g){return e.call(g)==="[object Number]"&&-2147483648<=g&&g<=2147483647}n.integer=l;function u(g){return e.call(g)==="[object Number]"&&0<=g&&g<=2147483647}n.uinteger=u;function c(g){return e.call(g)==="[object Function]"}n.func=c;function h(g){return g!==null&&typeof g=="object"}n.objectLiteral=h;function d(g,p){return Array.isArray(g)&&g.every(p)}n.typedArray=d})(A||(A={}))});var Ot=y(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.ProtocolNotificationType=cn.ProtocolNotificationType0=cn.ProtocolRequestType=cn.ProtocolRequestType0=cn.RegistrationType=cn.MessageDirection=void 0;var Nc=Al(),_he;(function(n){n.clientToServer="clientToServer",n.serverToClient="serverToClient",n.both="both"})(_he=cn.MessageDirection||(cn.MessageDirection={}));var _0=class{constructor(e){this.method=e}};cn.RegistrationType=_0;var L0=class extends Nc.RequestType0{constructor(e){super(e)}};cn.ProtocolRequestType0=L0;var I0=class extends Nc.RequestType{constructor(e){super(e,Nc.ParameterStructures.byName)}};cn.ProtocolRequestType=I0;var F0=class extends Nc.NotificationType0{constructor(e){super(e)}};cn.ProtocolNotificationType0=F0;var j0=class extends Nc.NotificationType{constructor(e){super(e,Nc.ParameterStructures.byName)}};cn.ProtocolNotificationType=j0});var Xv=y(Vt=>{"use strict";Object.defineProperty(Vt,"__esModule",{value:!0});Vt.objectLiteral=Vt.typedArray=Vt.stringArray=Vt.array=Vt.func=Vt.error=Vt.number=Vt.string=Vt.boolean=void 0;function Lhe(n){return n===!0||n===!1}Vt.boolean=Lhe;function JH(n){return typeof n=="string"||n instanceof String}Vt.string=JH;function Ihe(n){return typeof n=="number"||n instanceof Number}Vt.number=Ihe;function Fhe(n){return n instanceof Error}Vt.error=Fhe;function jhe(n){return typeof n=="function"}Vt.func=jhe;function $H(n){return Array.isArray(n)}Vt.array=$H;function Mhe(n){return $H(n)&&n.every(e=>JH(e))}Vt.stringArray=Mhe;function Ohe(n,e){return Array.isArray(n)&&n.every(e)}Vt.typedArray=Ohe;function Ahe(n){return n!==null&&typeof n=="object"}Vt.objectLiteral=Ahe});var XH=y(_g=>{"use strict";Object.defineProperty(_g,"__esModule",{value:!0});_g.ImplementationRequest=void 0;var UH=Ot(),Nhe;(function(n){n.method="textDocument/implementation",n.messageDirection=UH.MessageDirection.clientToServer,n.type=new UH.ProtocolRequestType(n.method)})(Nhe=_g.ImplementationRequest||(_g.ImplementationRequest={}))});var zH=y(Lg=>{"use strict";Object.defineProperty(Lg,"__esModule",{value:!0});Lg.TypeDefinitionRequest=void 0;var GH=Ot(),Hhe;(function(n){n.method="textDocument/typeDefinition",n.messageDirection=GH.MessageDirection.clientToServer,n.type=new GH.ProtocolRequestType(n.method)})(Hhe=Lg.TypeDefinitionRequest||(Lg.TypeDefinitionRequest={}))});var KH=y(da=>{"use strict";Object.defineProperty(da,"__esModule",{value:!0});da.DidChangeWorkspaceFoldersNotification=da.WorkspaceFoldersRequest=void 0;var Gv=Ot(),qhe;(function(n){n.method="workspace/workspaceFolders",n.messageDirection=Gv.MessageDir
${a}
${u}`));return}i(l)})})}function Xc(n,e,t=!1){let i=(0,lB.default)(e,100);try{let r=uB.default.watch(n,{persistent:!0,recursive:!1,encoding:"utf8"},()=>{i()});return t&&setTimeout(e,10),Bl.Disposable.create(()=>{i.clear(),r.close()})}catch{return Bl.Disposable.create(()=>{i.clear()})}}function gB(n){try{return process.kill(n,0)==!0}catch(e){return e.code==="EPERM"}}function U0(n){return n=="n"||n=="o"||n=="x"||n=="v"?"<C-U>":n=="i"?"<C-o>":n=="s"?"<Esc>":""}function lw(n,e){let t,i=r=>{t&&clearTimeout(t),t=setTimeout(()=>{n()},r??e)};return Object.defineProperty(i,"clear",{get:()=>()=>{t&&clearTimeout(t)}}),i}function Yg(n,e,t=3){if(n.length==0)return Promise.resolve();let i=0,r=n.length,o=n.slice();return new Promise(s=>{let a=l=>{let u=()=>{if(i=i+1,i==r)s();else if(o.length){let c=o.shift();a(c)}};e(l).then(u,u)};for(let l=0;l<Math.min(t,o.length);l++){let u=o.shift();a(u)}})}var aB,lB,uB,$0,Bl,cB,cRe,Uc,re=k(()=>{"use strict";aB=require("child_process"),lB=S(Pn()),uB=S(require("fs")),$0=S(require("path")),Bl=S(W());Pe();cB=S(Bg());wi();$c();cRe=q()("util-index"),Uc="coc-settings.json"});function pB(n){return n instanceof ii?!0:n instanceof Error&&n.name===X0&&n.message===X0}function G0(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}function z0(n){return new Error(`File ${n} already exists`)}function uw(n){return new Error(`File ${n} not exists`)}function fB(n){return new Error(`${n} should not be called in an asynchronize manner`)}function cw(n){return new Error(`Change of ${n} not supported`)}var X0,ii,xr=k(()=>{"use strict";X0="Canceled",ii=class extends Error{constructor(){super(X0),this.name=this.message}}});function mB(n){let e={};return Object.entries(n).forEach(([t,i])=>{i!==void 0&&(e[t]=i)}),e}function bB(n){let e={};for(let t of Object.keys(n))Object.defineProperty(e,t,{value:n[t],writable:!1,enumerable:!0});return e}function Rn(n){if(!n||typeof n!="object"||n instanceof RegExp)return n;let e=Array.isArray(n)?[]:{};return Object.keys(n).forEach(t=>{n[t]&&typeof n[t]=="object"?e[t]=Rn(n[t]):e[t]=n[t]}),e}function Qr(n,e){return yB.call(n,e)}function hw(n){if(!n||typeof n!="object")return n;let e=[n];for(;e.length>0;){let t=e.shift();Object.freeze(t);for(let i in t)if(yB.call(t,i)){let r=t[i];typeof r=="object"&&!Object.isFrozen(r)&&e.push(r)}}return n}function K0(n,e,t=!0){return hi(n)?(hi(e)&&Object.keys(e).forEach(i=>{i in n?t&&(hi(n[i])&&hi(e[i])?K0(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function ye(n,e){if(n===e)return!0;if(n==null||e===null||e===void 0||typeof n!=typeof e||typeof n!="object"||Array.isArray(n)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(n)){if(n.length!==e.length)return!1;for(t=0;t<n.length;t++)if(!ye(n[t],e[t]))return!1}else{let r=[];for(i in n)r.push(i);r.sort();let o=[];for(i in e)o.push(i);if(o.sort(),!ye(r,o))return!1;for(t=0;t<r.length;t++)if(!ye(n[r[t]],e[r[t]]))return!1}return!0}var yB,et=k(()=>{"use strict";wi();yB=Object.prototype.hasOwnProperty});function vB(n){return n>=97&&n<=122?1:n>=65&&n<=90?2:0}function xB(n,e){let t=e==0?0:vB(n[e-1]);for(let i=e;i<n.length;i++){let r=vB(n[i]);if(r>0&&r!=t)return[i,n[i]];t=r}}function CB(n,e){let t=[];for(let i=0;i<n.length;i++)n[i]==e&&t.push(i);return t}function Q(n){return Buffer.byteLength(n)}function _n(n){return(n==null?void 0:n.length)>0?n[0].toUpperCase()+n.slice(1):""}function _t(n,e){return Buffer.byteLength(n.slice(0,e),"utf8")}function Gi(n,e){if(e==0)return 0;let t=0,i=0;for(let r of n){let o=r.codePointAt(0);if(o>=wB?(t+=2,i+=4):(t+=1,i+=Dpe(o)),i>=e)break}return t}function Dpe(n){return n<Cpe?1:n<Spe?2:n<wB?3:4}function tt(n,e,t){return Buffer.from(n,"utf8").slice(e,t).toString("utf8")}function SB(n){let e=n.charCodeAt(0);return e>128?!1:!!(e==95||e>=48&&e<=57||Q0(e))}function Q0(n){return n>=65&&n<=90||n>=97&&n<=122}function DB(n,e){return e&&n.endsWith(`
`)?n.slice(0,-1).split(`
`):n.split(`
`)}function TB(n){for(let e=0,t=n.length;e<t;e++){let i=n.charCodeAt(e);if(i>=65&&i<=90)return!0}return!1}function Tpe(n,e){if(n===e)return!0;let t=e.charCodeAt(0);return t>=65&&t<=90&&t+32===n.charCodeAt(0)}function kB(n,e){if(n.length>e.length)return-1;if(n.length===0)return 0;if(!TB(n))return e.toLowerCase().indexOf(n);let t=n.length,i=0;for(let r=0;r<e.length;r++){let o=e[r];if(Tpe(n[i],o)){if(i++,i===t)return r-i+1}else i>0&&(r=r-i,i=0)}return-1}var Cpe,Spe,wB,_e=k(()=>{"use strict";Cpe=128,Spe=2048,wB=65536});function Ppe(n){var e;return!!(n instanceof ii||n instanceof Error&&((e=n.message)==null?void 0:e.includes("transport disconnected")))}var Gc,PB,kpe,V0,P,fe=k(()=>{"use strict";Gc=S(W());re();xr();wi();et();_e();PB=q()("events"),kpe=["BufWritePre"],V0=class{constructor(){this.handlers=new Map;this._recentInserts=[];this._lastChange=0;this._insertMode=!1;this._pumAlignTop=!1;this._pumVisible=!1;this._completing=!1;this._requesting=!1;this.timeout=1e3}set requesting(e){this._requesting=e}get requesting(){return this._requesting}set completing(e){this._completing=e,this._pumVisible=e}get completing(){return this._completing}get cursor(){return this._cursor??{bufnr:this._bufnr,col:1,lnum:1,insert:!1}}get bufnr(){return this._bufnr}get pumvisible(){return this._pumVisible}get pumAlignTop(){return this._pumAlignTop}get insertMode(){return this._insertMode}get lastChangeTs(){return this._lastChange}race(e,t){let i=[];return new Promise(r=>{if(typeof t=="number"){let o=setTimeout(()=>{U(i),r(void 0)},t);i.push(Gc.Disposable.create(()=>{clearTimeout(o)}))}else Gc.CancellationToken.is(t)&&t.onCancellationRequested(()=>{U(i),r(void 0)},null,i);e.forEach(o=>{this.on(o,(...s)=>{U(i),r({name:o,args:s})},null,i)})})}async fire(e,t){let i=this.handlers.get(e);if(e=="InsertEnter")this._insertMode=!0;else if(e=="InsertLeave")this._insertMode=!1,this._pumVisible=!1,this._recentInserts=[];else if(e=="CursorHoldI"||e=="CursorMovedI")this._bufnr=t[0],this._insertMode||(this._insertMode=!0,this.fire("InsertEnter",[t[0]]));else if(e=="CursorHold"||e=="CursorMoved")this._bufnr=t[0],this._insertMode&&(this._insertMode=!1,this.fire("InsertLeave",[t[0]]));else if(e=="MenuPopupChanged")this._pumVisible=!0,this._pumAlignTop=t[1]>t[0].row;else if(e=="InsertCharPre")this._recentInserts.push([t[1],t[0]]);else if(e=="TextChanged")this._lastChange=Date.now();else if(e=="BufEnter")this._bufnr=t[0];else if(e=="TextChangedI"||e=="TextChangedP"){let r=this._recentInserts.filter(a=>a[0]==t[0]);this._bufnr=t[0],this._recentInserts=[],this._lastChange=Date.now();let o=t[1],s=tt(o.line??"",0,o.col-1);if(o.pre=s,this._cursor=Object.freeze({bufnr:t[0],lnum:o.lnum,col:o.col,insert:!0}),r.length&&s.length){let a=s.slice(-1);r.findIndex(l=>l[1]==a)!==-1&&(o.insertChar=a,process.nextTick(()=>{this.fire("TextInsert",[...t,a])}))}}if(e=="CursorMoved"||e=="CursorMovedI"){t.push(this._recentInserts.length>0);let r={bufnr:t[0],lnum:t[1][0],col:t[1][1],insert:e=="CursorMovedI"};if(this._cursor&&ye(this._cursor,r))return;this._cursor=Object.freeze(r)}if(i!=null&&i.length){let r=i.slice(),o=kpe.includes(e);t.forEach(s=>{hi(s)&&bB(s)}),await Promise.allSettled(r.map(s=>(async()=>{let l;o&&(l=setTimeout(()=>{console.error(`Slow "${e}" handler detected`,s.stack),PB.error(`Slow "${e}" handler detected`,s.stack)},this.timeout));try{await s(t)}catch(u){Ppe(u)||PB.error(`Error on event: ${e}`,u instanceof Error?u.stack:u)}clearTimeout(l)})()))}}on(e,t,i,r){if(Array.isArray(e)){let o=r||[];for(let s of e)this.on(s,t,i,o);return Gc.Disposable.create(()=>{U(o)})}else{let o=this.handlers.get(e)||[],s=l=>new Promise((u,c)=>{try{Promise.resolve(t.apply(i??null,l)).then(()=>{u(void 0)},h=>{c(h)})}catch(h){c(h)}});Error.captureStackTrace(s),o.push(s),this.handlers.set(e,o);let a=Gc.Disposable.create(()=>{let l=o.indexOf(s);l!==-1&&o.splice(l,1)});return Array.isArray(r)&&r.push(a),a}}};P=new V0});function dw(n){return Array.isArray(n)?n:n==null?[]:[n]}function Je(n){return!Array.isArray(n)||n.length===0}function Epe(n,e){return n<e[0]?1:n>e[1]?-1:0}function eE(n,e){let t=0,i=e.le
%s`,R,R,w,i);var F=w.type==="*"?cE:w.type==="?"?uE:"\\"+w.type;r=!0,i=i.slice(0,w.reStart)+F+"\\("+R}p(),o&&(i+="\\\\");var N=!1;switch(i.charAt(0)){case".":case"[":case"(":N=!0}for(var J=a.length-1;J>-1;J--){var H=a[J],M=i.slice(0,H.reStart),L=i.slice(H.reStart,H.reEnd-8),O=i.slice(H.reEnd-8,H.reEnd),Z=i.slice(H.reEnd);O+=Z;var ne=M.split("(").length-1,be=Z;for(f=0;f<ne;f++)be=be.replace(/\)[+*?]?/,"");Z=be;var He="";Z===""&&e!==pw&&(He="$");var $=M+L+Z+He+O;i=$}if(i!==""&&r&&(i="(?=.)"+i),N&&(i=d+i),e===pw)return[i,r];if(!r)return tfe(n);var B=t.nocase?"i":"";try{var G=new RegExp("^"+i+"$",B)}catch{return new RegExp("$.")}return G._glob=n,G._src=i,G}Cr.makeRe=function(n,e){return new xi(n,e||{}).makeRe()};xi.prototype.makeRe=Vpe;function Vpe(){if(this.regexp||this.regexp===!1)return this.regexp;var n=this.set;if(!n.length)return this.regexp=!1,this.regexp;var e=this.options,t=e.noglobstar?cE:e.dot?$pe:Upe,i=e.nocase?"i":"",r=n.map(function(o){return o.map(function(s){return s===hE?t:typeof s=="string"?ife(s):s._src}).join("\\/")}).join("|");r="^(?:"+r+")$",this.negate&&(r="^(?!"+r+").*$");try{this.regexp=new RegExp(r,i)}catch{this.regexp=!1}return this.regexp}Cr.match=function(n,e,t){t=t||{};var i=new xi(e,t);return n=n.filter(function(r){return i.match(r)}),i.options.nonull&&!n.length&&n.push(e),n};xi.prototype.match=efe;function efe(n,e){if(this.debug("match",n,this.pattern),this.comment)return!1;if(this.empty)return n==="";if(n==="/"&&e)return!0;var t=this.options;$g.sep!=="/"&&(n=n.split($g.sep).join("/")),n=n.split(VB),this.debug(this.pattern,"split",n);var i=this.set;this.debug(this.pattern,"set",i);var r,o;for(o=n.length-1;o>=0&&(r=n[o],!r);o--);for(o=0;o<i.length;o++){var s=i[o],a=n;t.matchBase&&s.length===1&&(a=[r]);var l=this.matchOne(a,s,e);if(l)return t.flipNegate?!0:!this.negate}return t.flipNegate?!1:this.negate}xi.prototype.matchOne=function(n,e,t){var i=this.options;this.debug("matchOne",{this:this,file:n,pattern:e}),this.debug("matchOne",n.length,e.length);for(var r=0,o=0,s=n.length,a=e.length;r<s&&o<a;r++,o++){this.debug("matchOne loop");var l=e[o],u=n[r];if(this.debug(e,l,u),l===!1)return!1;if(l===hE){this.debug("GLOBSTAR",[e,l,u]);var c=r,h=o+1;if(h===a){for(this.debug("** at the end");r<s;r++)if(n[r]==="."||n[r]===".."||!i.dot&&n[r].charAt(0)===".")return!1;return!0}for(;c<s;){var d=n[c];if(this.debug(`
globstar while`,n,c,e,h,d),this.matchOne(n.slice(c),e.slice(h),t))return this.debug("globstar found match!",c,s,d),!0;if(d==="."||d===".."||!i.dot&&d.charAt(0)==="."){this.debug("dot detected!",n,c,e,h);break}this.debug("globstar swallow a segment, and continue"),c++}return!!(t&&(this.debug(`
>>> no match, partial?`,n,c,e,h),c===s))}var g;if(typeof l=="string"?(i.nocase?g=u.toLowerCase()===l.toLowerCase():g=u===l,this.debug("string match",l,u,g)):(g=u.match(l),this.debug("pattern match",l,u,g)),!g)return!1}if(r===s&&o===a)return!0;if(r===s)return t;if(o===a){var p=r===s-1&&n[r]==="";return p}throw new Error("wtf?")};function tfe(n){return n.replace(/\\(.)/g,"$1")}function ife(n){return n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var iW=y((ERe,dE)=>{typeof Object.create=="function"?dE.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:dE.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}});var nW=y((RRe,pE)=>{try{if(gE=require("util"),typeof gE.inherits!="function")throw"";pE.exports=gE.inherits}catch{pE.exports=iW()}var gE});var bw=y((_Re,mw)=>{"use strict";function rW(n){return n.charAt(0)==="/"}function oW(n){var e=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,t=e.exec(n),i=t[1]||"",r=Boolean(i&&i.charAt(1)!==":");return Boolean(t[2]||r)}mw.exports=process.platform==="win32"?oW:rW;mw.exports.posix=rW;mw.exports.win32=oW});var mE=y(wa=>{wa.setopts=lfe;wa.ownProp=sW;wa.makeAbs=Ug;wa.finish=ufe;wa.mark=cfe;wa.isIgnored=lW;wa.childrenIgnored=hfe;function sW(n,e){return Object.prototype.hasOwnProperty.call(n,e)}var nfe=require("fs"),Qc=require("path"),rfe=fw(),aW=bw(),fE=rfe.Minimatch;function ofe(n,e){return n.localeCompare(e,"en")}function sfe(n,e){n.ignore=e.ignore||[],Array.isArray(n.ignore)||(n.ignore=[n.ignore]),n.ignore.length&&(n.ignore=n.ignore.map(afe))}function afe(n){var e=null;if(n.slice(-3)==="/**"){var t=n.replace(/(\/\*\*)+$/,"");e=new fE(t,{dot:!0})}return{matcher:new fE(n,{dot:!0}),gmatcher:e}}function lfe(n,e,t){if(t||(t={}),t.matchBase&&e.indexOf("/")===-1){if(t.noglobstar)throw new Error("base matching requires globstar");e="**/"+e}n.silent=!!t.silent,n.pattern=e,n.strict=t.strict!==!1,n.realpath=!!t.realpath,n.realpathCache=t.realpathCache||Object.create(null),n.follow=!!t.follow,n.dot=!!t.dot,n.mark=!!t.mark,n.nodir=!!t.nodir,n.nodir&&(n.mark=!0),n.sync=!!t.sync,n.nounique=!!t.nounique,n.nonull=!!t.nonull,n.nosort=!!t.nosort,n.nocase=!!t.nocase,n.stat=!!t.stat,n.noprocess=!!t.noprocess,n.absolute=!!t.absolute,n.fs=t.fs||nfe,n.maxLength=t.maxLength||1/0,n.cache=t.cache||Object.create(null),n.statCache=t.statCache||Object.create(null),n.symlinks=t.symlinks||Object.create(null),sfe(n,t),n.changedCwd=!1;var i=process.cwd();sW(t,"cwd")?(n.cwd=Qc.resolve(t.cwd),n.changedCwd=n.cwd!==i):n.cwd=i,n.root=t.root||Qc.resolve(n.cwd,"/"),n.root=Qc.resolve(n.root),process.platform==="win32"&&(n.root=n.root.replace(/\\/g,"/")),n.cwdAbs=aW(n.cwd)?n.cwd:Ug(n,n.cwd),process.platform==="win32"&&(n.cwdAbs=n.cwdAbs.replace(/\\/g,"/")),n.nomount=!!t.nomount,t.nonegate=!0,t.nocomment=!0,n.minimatch=new fE(e,t),n.options=n.minimatch.options}function ufe(n){for(var e=n.nounique,t=e?[]:Object.create(null),i=0,r=n.matches.length;i<r;i++){var o=n.matches[i];if(!o||Object.keys(o).length===0){if(n.nonull){var s=n.minimatch.globSet[i];e?t.push(s):t[s]=!0}}else{var a=Object.keys(o);e?t.push.apply(t,a):a.forEach(function(l){t[l]=!0})}}if(e||(t=Object.keys(t)),n.nosort||(t=t.sort(ofe)),n.mark){for(var i=0;i<t.length;i++)t[i]=n._mark(t[i]);n.nodir&&(t=t.filter(function(l){var u=!/\/$/.test(l),c=n.cache[l]||n.cache[Ug(n,l)];return u&&c&&(u=c!=="DIR"&&!Array.isArray(c)),u}))}n.ignore.length&&(t=t.filter(function(l){return!lW(n,l)})),n.found=t}function cfe(n,e){var t=Ug(n,e),i=n.cache[t],r=e;if(i){var o=i==="DIR"||Array.isArray(i),s=e.slice(-1)==="/";if(o&&!s?r+="/":!o&&s&&(r=r.slice(0,-1)),r!==e){var a=Ug(n,r);n.statCache[a]=n.statCache[t],n.cache[a]=n.cache[t]}}return r}function Ug(n,e){var t=e;return e.charAt(0)==="/"?t=Qc.join(n.root,e):aW(e)||e===""?t=e:n.changedCwd?t=Qc.resolve(n.cwd,e):t=Qc.resolve(e),process.platform==="win32"&&(t=t.replace(/\\/g,"/")),t}function lW(n,e){return n.ignore.length?n.ignore.some(function(t){return
See: https://github.com/isaacs/node-glob/issues/167`);return new di(n,e).found}function di(n,e){if(!n)throw new Error("must provide pattern");if(typeof e=="function"||arguments.length===3)throw new TypeError(`callback provided to sync glob
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof di))return new di(n,e);if(gfe(this,n,e),this.noprocess)return this;var t=this.minimatch.set.length;this.matches=new Array(t);for(var i=0;i<t;i++)this._process(this.minimatch.set[i],i,!1);this._finish()}di.prototype._finish=function(){if(cW(this instanceof di),this.realpath){var n=this;this.matches.forEach(function(e,t){var i=n.matches[t]=Object.create(null);for(var r in e)try{r=n._makeAbs(r);var o=dfe.realpathSync(r,n.realpathCache);i[o]=!0}catch(s){if(s.syscall==="stat")i[n._makeAbs(r)]=!0;else throw s}})}Zl.finish(this)};di.prototype._process=function(n,e,t){cW(this instanceof di);for(var i=0;typeof n[i]=="string";)i++;var r;switch(i){case n.length:this._processSimple(n.join("/"),e);return;case 0:r=null;break;default:r=n.slice(0,i).join("/");break}var o=n.slice(i),s;r===null?s=".":((yw(r)||yw(n.join("/")))&&(!r||!yw(r))&&(r="/"+r),s=r);var a=this._makeAbs(s);if(!pfe(this,s)){var l=o[0]===uW.GLOBSTAR;l?this._processGlobStar(r,s,a,o,e,t):this._processReaddir(r,s,a,o,e,t)}};di.prototype._processReaddir=function(n,e,t,i,r,o){var s=this._readdir(t,o);if(!!s){for(var a=i[0],l=!!this.minimatch.negate,u=a._glob,c=this.dot||u.charAt(0)===".",h=[],d=0;d<s.length;d++){var g=s[d];if(g.charAt(0)!=="."||c){var p;l&&!n?p=!g.match(a):p=g.match(a),p&&h.push(g)}}var f=h.length;if(f!==0){if(i.length===1&&!this.mark&&!this.stat){this.matches[r]||(this.matches[r]=Object.create(null));for(var d=0;d<f;d++){var g=h[d];n&&(n.slice(-1)!=="/"?g=n+"/"+g:g=n+g),g.charAt(0)==="/"&&!this.nomount&&(g=bE.join(this.root,g)),this._emitMatch(r,g)}return}i.shift();for(var d=0;d<f;d++){var g=h[d],m;n?m=[n,g]:m=[g],this._process(m.concat(i),r,o)}}}};di.prototype._emitMatch=function(n,e){if(!ffe(this,e)){var t=this._makeAbs(e);if(this.mark&&(e=this._mark(e)),this.absolute&&(e=t),!this.matches[n][e]){if(this.nodir){var i=this.cache[t];if(i==="DIR"||Array.isArray(i))return}this.matches[n][e]=!0,this.stat&&this._stat(e)}}};di.prototype._readdirInGlobStar=function(n){if(this.follow)return this._readdir(n,!1);var e,t,i;try{t=this.fs.lstatSync(n)}catch(o){if(o.code==="ENOENT")return null}var r=t&&t.isSymbolicLink();return this.symlinks[n]=r,!r&&t&&!t.isDirectory()?this.cache[n]="FILE":e=this._readdir(n,!1),e};di.prototype._readdir=function(n,e){var t;if(e&&!yE(this.symlinks,n))return this._readdirInGlobStar(n);if(yE(this.cache,n)){var i=this.cache[n];if(!i||i==="FILE")return null;if(Array.isArray(i))return i}try{return this._readdirEntries(n,this.fs.readdirSync(n))}catch(r){return this._readdirError(n,r),null}};di.prototype._readdirEntries=function(n,e){if(!this.mark&&!this.stat)for(var t=0;t<e.length;t++){var i=e[t];n==="/"?i=n+i:i=n+"/"+i,this.cache[i]=!0}return this.cache[n]=e,e};di.prototype._readdirError=function(n,e){switch(e.code){case"ENOTSUP":case"ENOTDIR":var t=this._makeAbs(n);if(this.cache[t]="FILE",t===this.cwdAbs){var i=new Error(e.code+" invalid cwd "+this.cwd);throw i.path=this.cwd,i.code=e.code,i}break;case"ENOENT":case"ELOOP":case"ENAMETOOLONG":case"UNKNOWN":this.cache[this._makeAbs(n)]=!1;break;default:if(this.cache[this._makeAbs(n)]=!1,this.strict)throw e;this.silent||console.error("glob error",e);break}};di.prototype._processGlobStar=function(n,e,t,i,r,o){var s=this._readdir(t,o);if(!!s){var a=i.slice(1),l=n?[n]:[],u=l.concat(a);this._process(u,r,!1);var c=s.length,h=this.symlinks[t];if(!(h&&o))for(var d=0;d<c;d++){var g=s[d];if(!(g.charAt(0)==="."&&!this.dot)){var p=l.concat(s[d],a);this._process(p,r,!0);var f=l.concat(s[d],i);this._process(f,r,!0)}}}};di.prototype._processSimple=function(n,e){var t=this._stat(n);if(this.matches[e]||(this.matches[e]=Object.create(null)),!!t){if(n&&yw(n)&&!this.nomount){var i=/[\/\\]$/.test(n);n.charAt(0)==="/"?n=bE.join(this.root,n):(n=bE.resolve(this.root,n),i&&(n+="/"))}process.platform==="win32"&&(n=n.replace(/\\/g,"/")),this._emitMatch(e,n)}};di.prototype._stat=function(n){var e=this._makeAbs(n),t=n.slice(-1)==="/";if(n.length>this.maxLength)return!1;if(!this.stat&&yE(this.cache,e)){var s=this.cache[e];if(Array.isArray(s)&&(s="DIR
globstar while`,e,h,t,d,g),this.matchOne(e.slice(h),t.slice(d),i))return this.debug("globstar found match!",h,a,g),!0;if(g==="."||g===".."||!r.dot&&g.charAt(0)==="."){this.debug("dot detected!",e,h,t,d);break}this.debug("globstar swallow a segment, and continue"),h++}return!!(i&&(this.debug(`
>>> no match, partial?`,e,h,t,d),h===a))}var p;if(typeof u=="string"?(p=c===u,this.debug("string match",u,c,p)):(p=c.match(u),this.debug("pattern match",u,c,p)),!p)return!1}if(o===a&&s===l)return!0;if(o===a)return i;if(s===l)return o===a-1&&e[o]==="";throw new Error("wtf?")}braceExpand(){return OW(this.pattern,this.options)}parse(e,t){Cw(e);let i=this.options;if(e==="**")if(i.noglobstar)e="*";else return Vr;if(e==="")return"";let r="",o=!!i.nocase,s=!1,a=[],l=[],u,c=!1,h=-1,d=-1,g,p,f,m=e.charAt(0)==="."?"":i.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",b=()=>{if(u){switch(u){case"*":r+=RE,o=!0;break;case"?":r+=LE,o=!0;break;default:r+="\\"+u;break}this.debug("clearStateChar %j %j",u,r),u=!1}};for(let T=0,R;T<e.length&&(R=e.charAt(T));T++){if(this.debug("%s %s %s %j",e,T,r,R),s){if(R==="/")return!1;FW[R]&&(r+="\\"),r+=R,s=!1;continue}switch(R){case"/":return!1;case"\\":b(),s=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",e,T,r,R),c){this.debug(" in class"),R==="!"&&T===d+1&&(R="^"),r+=R;continue}this.debug("call clearStateChar %j",u),b(),u=R,i.noext&&b();continue;case"(":if(c){r+="(";continue}if(!u){r+="\\(";continue}a.push({type:u,start:T-1,reStart:r.length,open:IW[u].open,close:IW[u].close}),r+=u==="!"?"(?:(?!(?:":"(?:",this.debug("plType %j %j",u,r),u=!1;continue;case")":if(c||!a.length){r+="\\)";continue}b(),o=!0,p=a.pop(),r+=p.close,p.type==="!"&&l.push(p),p.reEnd=r.length;continue;case"|":if(c||!a.length){r+="\\|";continue}b(),r+="|";continue;case"[":if(b(),c){r+="\\"+R;continue}c=!0,d=T,h=r.length,r+=R;continue;case"]":if(T===d+1||!c){r+="\\"+R;continue}g=e.substring(d+1,T);try{RegExp("["+g+"]")}catch{f=this.parse(g,xw),r=r.substr(0,h)+"\\["+f[0]+"\\]",o=o||f[1],c=!1;continue}o=!0,c=!1,r+=R;continue;default:b(),FW[R]&&!(R==="^"&&c)&&(r+="\\"),r+=R;break}}for(c&&(g=e.substr(d+1),f=this.parse(g,xw),r=r.substr(0,h)+"\\["+f[0],o=o||f[1]),p=a.pop();p;p=a.pop()){let T;T=r.slice(p.reStart+p.open.length),this.debug("setting tail",r,p),T=T.replace(/((?:\\{2}){0,64})(\\?)\|/g,(F,N,J)=>(J||(J="\\"),N+N+J+"|")),this.debug(`tail=%j
%s`,T,T,p,r);let R=p.type==="*"?RE:p.type==="?"?LE:"\\"+p.type;o=!0,r=r.slice(0,p.reStart)+R+"\\("+T}b(),s&&(r+="\\\\");let w=Wfe[r.charAt(0)];for(let T=l.length-1;T>-1;T--){let R=l[T],F=r.slice(0,R.reStart),N=r.slice(R.reStart,R.reEnd-8),J=r.slice(R.reEnd),H=r.slice(R.reEnd-8,R.reEnd)+J,M=F.split("(").length-1,L=J;for(let Z=0;Z<M;Z++)L=L.replace(/\)[+*?]?/,"");J=L;let O=J===""&&t!==xw?"$":"";r=F+N+J+O+H}if(r!==""&&o&&(r="(?=.)"+r),w&&(r=m+r),t===xw)return[r,o];if(!o)return Zfe(e);let x=i.nocase?"i":"";try{return Object.assign(new RegExp("^"+r+"$",x),{_glob:e,_src:r})}catch{return new RegExp("$.")}}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let t=this.options,i=t.noglobstar?RE:t.dot?qfe:Bfe,r=t.nocase?"i":"",o=e.map(s=>(s=s.map(a=>typeof a=="string"?Jfe(a):a===Vr?Vr:a._src).reduce((a,l)=>(a[a.length-1]===Vr&&l===Vr||a.push(l),a),[]),s.forEach((a,l)=>{a!==Vr||s[l-1]===Vr||(l===0?s.length>1?s[l+1]="(?:\\/|"+i+"\\/)?"+s[l+1]:s[l]=i:l===s.length-1?s[l-1]+="(?:\\/|"+i+")?":(s[l-1]+="(?:\\/|\\/"+i+"\\/)"+s[l+1],s[l+1]=Vr))}),s.filter(a=>a!==Vr).join("/"))).join("|");o="^(?:"+o+")$",this.negate&&(o="^(?!"+o+").*$");try{this.regexp=new RegExp(o,r)}catch{this.regexp=!1}return this.regexp}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;let i=this.options;_E.sep!=="/"&&(e=e.split(_E.sep).join("/")),e=e.split(jW),this.debug(this.pattern,"split",e);let r=this.set;this.debug(this.pattern,"set",r);let o;for(let s=e.length-1;s>=0&&(o=e[s],!o);s--);for(let s=0;s<r.length;s++){let a=r[s],l=e;if(i.matchBase&&a.length===1&&(l=[o]),this.matchOne(l,a,t))return i.flipNegate?!0:!this.negate}return i.flipNegate?!1:this.negate}static defaults(e){return Qn.defaults(e).Minimatch}};Qn.Minimatch=Vc});var Kg,Ul,Sw,Dw,Qg,Tw,dn=k(()=>{"use strict";Kg=(i=>(i[i.Buffer=0]="Buffer",i[i.LanguageServer=1]="LanguageServer",i[i.Global=2]="Global",i))(Kg||{}),Ul=(i=>(i[i.Native=0]="Native",i[i.Remote=1]="Remote",i[i.Service=2]="Service",i))(Ul||{}),Sw=(i=>(i[i.More=0]="More",i[i.Warning=1]="Warning",i[i.Error=2]="Error",i))(Sw||{}),Dw=(s=>(s[s.Initial=0]="Initial",s[s.Starting=1]="Starting",s[s.StartFailed=2]="StartFailed",s[s.Running=3]="Running",s[s.Stopping=4]="Stopping",s[s.Stopped=5]="Stopped",s))(Dw||{}),Qg=(r=>(r[r.Unknown=0]="Unknown",r[r.File=1]="File",r[r.Directory=2]="Directory",r[r.SymbolicLink=64]="SymbolicLink",r))(Qg||{}),Tw=(i=>(i[i.Global=1]="Global",i[i.Workspace=2]="Workspace",i[i.WorkspaceFolder=3]="WorkspaceFolder",i))(Tw||{})});function ep(n,e){e===void 0&&(e=!1);var t=n.length,i=0,r="",o=0,s=16,a=0,l=0,u=0,c=0,h=0;function d(x,T){for(var R=0,F=0;R<x||!T;){var N=n.charCodeAt(i);if(N>=48&&N<=57)F=F*16+N-48;else if(N>=65&&N<=70)F=F*16+N-65+10;else if(N>=97&&N<=102)F=F*16+N-97+10;else break;i++,R++}return R<x&&(F=-1),F}function g(x){i=x,r="",o=0,s=16,h=0}function p(){var x=i;if(n.charCodeAt(i)===48)i++;else for(i++;i<n.length&&eh(n.charCodeAt(i));)i++;if(i<n.length&&n.charCodeAt(i)===46)if(i++,i<n.length&&eh(n.charCodeAt(i)))for(i++;i<n.length&&eh(n.charCodeAt(i));)i++;else return h=3,n.substring(x,i);var T=i;if(i<n.length&&(n.charCodeAt(i)===69||n.charCodeAt(i)===101))if(i++,(i<n.length&&n.charCodeAt(i)===43||n.charCodeAt(i)===45)&&i++,i<n.length&&eh(n.charCodeAt(i))){for(i++;i<n.length&&eh(n.charCodeAt(i));)i++;T=i}else h=3;return n.substring(x,T)}function f(){for(var x="",T=i;;){if(i>=t){x+=n.substring(T,i),h=2;break}var R=n.charCodeAt(i);if(R===34){x+=n.substring(T,i),i++;break}if(R===92){if(x+=n.substring(T,i),i++,i>=t){h=2;break}var F=n.charCodeAt(i++);switch(F){case 34:x+='"';break;case 92:x+="\\";break;case 47:x+="/";break;case 98:x+="\b";break;case 102:x+="\f";break;case 110:x+=`
`;break;case 114:x+="\r";break;case 116:x+=" ";break;case 117:var N=d(4,!0);N>=0?x+=String.fromCharCode(N):h=4;break;default:h=5}T=i;continue}if(R>=0&&R<=31)if(Vg(R)){x+=n.substring(T,i),h=2;break}else h=6;i++}return x}function m(){if(r="",h=0,o=i,l=a,c=u,i>=t)return o=t,s=17;var x=n.charCodeAt(i);if(FE(x)){do i++,r+=String.fromCharCode(x),x=n.charCodeAt(i);while(FE(x));return s=15}if(Vg(x))return i++,r+=String.fromCharCode(x),x===13&&n.charCodeAt(i)===10&&(i++,r+=`
`),a++,u=i,s=14;switch(x){case 123:return i++,s=1;case 125:return i++,s=2;case 91:return i++,s=3;case 93:return i++,s=4;case 58:return i++,s=6;case 44:return i++,s=5;case 34:return i++,r=f(),s=10;case 47:var T=i-1;if(n.charCodeAt(i+1)===47){for(i+=2;i<t&&!Vg(n.charCodeAt(i));)i++;return r=n.substring(T,i),s=12}if(n.charCodeAt(i+1)===42){i+=2;for(var R=t-1,F=!1;i<R;){var N=n.charCodeAt(i);if(N===42&&n.charCodeAt(i+1)===47){i+=2,F=!0;break}i++,Vg(N)&&(N===13&&n.charCodeAt(i)===10&&i++,a++,u=i)}return F||(i++,h=1),r=n.substring(T,i),s=13}return r+=String.fromCharCode(x),i++,s=16;case 45:if(r+=String.fromCharCode(x),i++,i===t||!eh(n.charCodeAt(i)))return s=16;case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return r+=p(),s=11;default:for(;i<t&&b(x);)i++,x=n.charCodeAt(i);if(o!==i){switch(r=n.substring(o,i),r){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return r+=String.fromCharCode(x),i++,s=16}}function b(x){if(FE(x)||Vg(x))return!1;switch(x){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function w(){var x;do x=m();while(x>=12&&x<=15);return x}return{setPosition:g,getPosition:function(){return i},scan:e?w:m,getToken:function(){return s},getTokenValue:function(){return r},getTokenOffset:function(){return o},getTokenLength:function(){return i-o},getTokenStartLine:function(){return l},getTokenStartCharacter:function(){return o-c},getTokenError:function(){return h}}}function FE(n){return n===32||n===9||n===11||n===12||n===160||n===5760||n>=8192&&n<=8203||n===8239||n===8287||n===12288||n===65279}function Vg(n){return n===10||n===13||n===8232||n===8233}function eh(n){return n>=48&&n<=57}var kw=k(()=>{"use strict"});function ME(n,e,t){var i,r,o,s,a;if(e){for(s=e.offset,a=s+e.length,o=s;o>0&&!tp(n,o-1);)o--;for(var l=a;l<n.length&&!tp(n,l);)l++;r=n.substring(o,l),i=Ufe(r,t)}else r=n,i=0,o=0,s=0,a=n.length;var u=Xfe(t,n),c=!1,h=0,d;t.insertSpaces?d=jE(" ",t.tabSize||4):d=" ";var g=ep(r,!1),p=!1;function f(){return u+jE(d,i+h)}function m(){var O=g.scan();for(c=!1;O===15||O===14;)c=c||O===14,O=g.scan();return p=O===16||g.getTokenError()!==0,O}var b=[];function w(O,Z,ne){!p&&(!e||Z<a&&ne>s)&&n.substring(Z,ne)!==O&&b.push({offset:Z,length:ne-Z,content:O})}var x=m();if(x!==17){var T=g.getTokenOffset()+o,R=jE(d,i);w(R,o,T)}for(;x!==17;){for(var F=g.getTokenOffset()+g.getTokenLength()+o,N=m(),J="",H=!1;!c&&(N===12||N===13);){var M=g.getTokenOffset()+o;w(" ",F,M),F=g.getTokenOffset()+g.getTokenLength()+o,H=N===12,J=H?f():"",N=m()}if(N===2)x!==1&&(h--,J=f());else if(N===4)x!==3&&(h--,J=f());else{switch(x){case 3:case 1:h++,J=f();break;case 5:case 12:J=f();break;case 13:c?J=f():H||(J=" ");break;case 6:H||(J=" ");break;case 10:if(N===6){H||(J="");break}case 7:case 8:case 9:case 11:case 2:case 4:N===12||N===13?H||(J=" "):N!==5&&N!==17&&(p=!0);break;case 16:p=!0;break}c&&(N===12||N===13)&&(J=f())}N===17&&(J=t.insertFinalNewline?u:"");var L=g.getTokenOffset()+o;w(J,F,L),x=N}return b}function jE(n,e){for(var t="",i=0;i<e;i++)t+=n;return t}function Ufe(n,e){for(var t=0,i=0,r=e.tabSize||4;t<n.length;){var o=n.charAt(t);if(o===" ")i++;else if(o===" ")i+=r;else break;t++}return Math.floor(i/r)}function Xfe(n,e){for(var t=0;t<e.length;t++){var i=e.charAt(t);if(i==="\r")return t+1<e.length&&e.charAt(t+1)===`
`?`\r
`:"\r";if(i===`
`)return`
`}return n&&n.eol||`
`}function tp(n,e){return`\r
`.indexOf(n.charAt(e))!==-1}var OE=k(()=>{"use strict";kw()});function AW(n,e,t){e===void 0&&(e=[]),t===void 0&&(t=ip.DEFAULT);var i=null,r=[],o=[];function s(l){Array.isArray(r)?r.push(l):i!==null&&(r[i]=l)}var a={onObjectBegin:function(){var l={};s(l),o.push(r),r=l,i=null},onObjectProperty:function(l){i=l},onObjectEnd:function(){r=o.pop()},onArrayBegin:function(){var l=[];s(l),o.push(r),r=l,i=null},onArrayEnd:function(){r=o.pop()},onLiteralValue:s,onError:function(l,u,c){e.push({error:l,offset:u,length:c})}};return Ew(n,a,t),r[0]}function AE(n,e,t){e===void 0&&(e=[]),t===void 0&&(t=ip.DEFAULT);var i={type:"array",offset:-1,length:-1,children:[],parent:void 0};function r(l){i.type==="property"&&(i.length=l-i.offset,i=i.parent)}function o(l){return i.children.push(l),l}var s={onObjectBegin:function(l){i=o({type:"object",offset:l,length:-1,parent:i,children:[]})},onObjectProperty:function(l,u,c){i=o({type:"property",offset:u,length:-1,parent:i,children:[]}),i.children.push({type:"string",value:l,offset:u,length:c,parent:i})},onObjectEnd:function(l,u){r(l+u),i.length=l+u-i.offset,i=i.parent,r(l+u)},onArrayBegin:function(l,u){i=o({type:"array",offset:l,length:-1,parent:i,children:[]})},onArrayEnd:function(l,u){i.length=l+u-i.offset,i=i.parent,r(l+u)},onLiteralValue:function(l,u,c){o({type:zfe(l),offset:u,length:c,parent:i,value:l}),r(u+c)},onSeparator:function(l,u,c){i.type==="property"&&(l===":"?i.colonOffset=u:l===","&&r(u))},onError:function(l,u,c){e.push({error:l,offset:u,length:c})}};Ew(n,s,t);var a=i.children[0];return a&&delete a.parent,a}function Pw(n,e){if(!!n){for(var t=n,i=0,r=e;i<r.length;i++){var o=r[i];if(typeof o=="string"){if(t.type!=="object"||!Array.isArray(t.children))return;for(var s=!1,a=0,l=t.children;a<l.length;a++){var u=l[a];if(Array.isArray(u.children)&&u.children[0].value===o){t=u.children[1],s=!0;break}}if(!s)return}else{var c=o;if(t.type!=="array"||c<0||!Array.isArray(t.children)||c>=t.children.length)return;t=t.children[c]}}return t}}function Ew(n,e,t){t===void 0&&(t=ip.DEFAULT);var i=ep(n,!1);function r(H){return H?function(){return H(i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter())}:function(){return!0}}function o(H){return H?function(M){return H(M,i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter())}:function(){return!0}}var s=r(e.onObjectBegin),a=o(e.onObjectProperty),l=r(e.onObjectEnd),u=r(e.onArrayBegin),c=r(e.onArrayEnd),h=o(e.onLiteralValue),d=o(e.onSeparator),g=r(e.onComment),p=o(e.onError),f=t&&t.disallowComments,m=t&&t.allowTrailingComma;function b(){for(;;){var H=i.scan();switch(i.getTokenError()){case 4:w(14);break;case 5:w(15);break;case 3:w(13);break;case 1:f||w(11);break;case 2:w(12);break;case 6:w(16);break}switch(H){case 12:case 13:f?w(10):g();break;case 16:w(1);break;case 15:case 14:break;default:return H}}}function w(H,M,L){if(M===void 0&&(M=[]),L===void 0&&(L=[]),p(H),M.length+L.length>0)for(var O=i.getToken();O!==17;){if(M.indexOf(O)!==-1){b();break}else if(L.indexOf(O)!==-1)break;O=b()}}function x(H){var M=i.getTokenValue();return H?h(M):a(M),b(),!0}function T(){switch(i.getToken()){case 11:var H=i.getTokenValue(),M=Number(H);isNaN(M)&&(w(2),M=0),h(M);break;case 7:h(null);break;case 8:h(!0);break;case 9:h(!1);break;default:return!1}return b(),!0}function R(){return i.getToken()!==10?(w(3,[],[2,5]),!1):(x(!1),i.getToken()===6?(d(":"),b(),J()||w(4,[],[2,5])):w(5,[],[2,5]),!0)}function F(){s(),b();for(var H=!1;i.getToken()!==2&&i.getToken()!==17;){if(i.getToken()===5){if(H||w(4,[],[]),d(","),b(),i.getToken()===2&&m)break}else H&&w(6,[],[]);R()||w(4,[],[2,5]),H=!0}return l(),i.getToken()!==2?w(7,[2],[]):b(),!0}function N(){u(),b();for(var H=!1;i.getToken()!==4&&i.getToken()!==17;){if(i.getToken()===5){if(H||w(4,[],[]),d(","),b(),i.getToken()===4&&m)break}else H&&w(6,[],[]);J()||w(4,[],[4,5]),H=!0}return c(),i.getToken()!==4?w(8,[4],[]):b(),!0}function J(){switch(i.getToken()){case 3:return N();case 1:return F();case 10:return x(!0);default:return T()}}return b(),i.getToken()===17?t.allowEmptyContent?!0
`)}_append(e){let{nvim:t}=this;if(!t){eme.info(`[${this.name} ${new Date().toLocaleTimeString()}] ${e}`);return}let i=this.lines.length-1,r=e.split(/\r?\n/),o=this.lines[i]+r[0];this.lines[i]=o;let s=r.slice(1);this.lines=this.lines.concat(s),this.created&&(t.pauseNotification(),t.call("setbufline",[this.bufname,"$",o],!0),s.length&&t.call("appendbufline",[this.bufname,"$",s],!0),t.resumeNotification(!1,!0))}append(e){!this.validate()||this._append(e)}appendLine(e){!this.validate()||this._append(e+`
`)}clear(e){let{nvim:t}=this;!this.validate()||!t||(this.lines=e?this.lines.slice(-e):[],this.created&&(t.pauseNotification(),t.call("deletebufline",[this.bufname,1,"$"],!0),this.lines.length&&t.call("appendbufline",[this.bufname,"$",this.lines],!0),t.resumeNotification(!0,!0)))}hide(){this.created=!1,this.nvim&&this.nvim.command(`exe 'silent! bd! '.fnameescape('${this.bufname}')`,!0)}get bufname(){return`output:///${this.name}`}show(e,t="vs"){let{nvim:i}=this;!i||(i.pauseNotification(),i.command(`exe '${t} '.fnameescape('${this.bufname}')`,!0),e&&i.command("wincmd p",!0),i.resumeNotification(!0,!0),this.created=!0)}validate(){return!this._disposed}dispose(){this.onDispose&&this.onDispose(),this._disposed=!0,this.hide(),this.lines=[]}}});var f_e,JE,hs,jw=k(()=>{"use strict";fe();rY();f_e=q()("core-channels"),JE=class{constructor(){this.outputChannels=new Map;this.bufnrs=new Map;this.disposable=P.on("BufUnload",e=>{let t=this.bufnrs.get(e);if(t){let i=this.outputChannels.get(t);i&&(i.created=!1)}})}getProvider(e){return{onDidChange:null,provideTextDocumentContent:async i=>{let r=this.get(i.path.slice(1));if(!r)return"";e.pauseNotification(),e.call("bufnr",["%"],!0),e.command("setlocal nospell nofoldenable nowrap noswapfile",!0),e.command("setlocal buftype=nofile bufhidden=hide",!0),e.command("setfiletype log",!0);let o=await e.resumeNotification();return this.bufnrs.set(o[0][0],r.name),r.created=!0,r.content}}}get names(){return Array.from(this.outputChannels.keys())}get(e){return this.outputChannels.get(e)}create(e,t){if(this.outputChannels.has(e))return this.outputChannels.get(e);let i=new sp(e,t,()=>{this.outputChannels.delete(e)});return this.outputChannels.set(e,i),i}show(e,t,i){let r=this.outputChannels.get(e);!r||r.show(i,t)}dispose(){this.disposable.dispose();for(let e of this.outputChannels.values())e.dispose();this.outputChannels.clear()}},hs=new JE});var b_e,ap,oY=k(()=>{"use strict";b_e=q()("model-terminal"),ap=class{constructor(e,t,i,r,o){this.cmd=e;this.args=t;this.nvim=i;this._name=r;this.strictEnv=o;this.pid=0}async start(e,t){let{nvim:i}=this,r=[this.cmd,...this.args],[o,s]=await i.call("coc#terminal#start",[r,e,t||{},!!this.strictEnv]);this.bufnr=o,this.pid=s}onExit(e){this.exitStatus={code:e===-1?void 0:e}}get name(){return this._name||this.cmd}get processId(){return Promise.resolve(this.pid)}sendText(e,t=!0){!this.bufnr||this.nvim.call("coc#terminal#send",[this.bufnr,e,t],!0)}async show(e){let{bufnr:t,nvim:i}=this;if(!t)return!1;let[r,o,s]=await i.eval(`[bufloaded(${t}),bufwinid(${t}),win_getid()]`);return r?(s==o||(i.pauseNotification(),o==-1?(i.command(`below ${t}sb`,!0),i.command("resize 8",!0),i.call("coc#util#do_autocmd",["CocTerminalOpen"],!0)):i.call("win_gotoid",[o],!0),i.command("normal! G",!0),e&&i.command("wincmd p",!0),await i.resumeNotification()),!0):!1}async hide(){let{bufnr:e,nvim:t}=this;!e||await t.eval(`coc#window#close(bufwinid(${e}))`)}dispose(){this.exitStatus||(this.exitStatus={code:void 0});let{bufnr:e,nvim:t}=this;!e||(this.bufnr=void 0,t.call("coc#terminal#close",[e],!0))}}});var $E,tme,lp,sY=k(()=>{"use strict";oY();$E=S(W());re();fe();tme=q()("core-terminals"),lp=class{constructor(){this._terminals=new Map;this.disposables=[];this._onDidOpenTerminal=new $E.Emitter;this._onDidCloseTerminal=new $E.Emitter;this.onDidCloseTerminal=this._onDidCloseTerminal.event;this.onDidOpenTerminal=this._onDidOpenTerminal.event;P.on("BufUnload",e=>{if(this._terminals.has(e)){tme.debug("terminal detach",e);let t=this._terminals.get(e);this._onDidCloseTerminal.fire(t),this._terminals.delete(e)}},null,this.disposables),P.on("TermExit",(e,t)=>{let i=this._terminals.get(e);i&&(i.onExit(t),i.dispose())},null,this.disposables)}get terminals(){return Array.from(this._terminals.values())}async createTerminal(e,t){let i=t.cwd,r=t.shellPath,o=t.shellArgs;r||(r=await e.getOption("shell")),i||(i=await e.call("getcwd"));let s=new ap(r,o||[],e,t.name,t.strictEnv);return await s.start(i,t.env),this._terminals.set(s.bufnr,s),this._onDidOpenTerminal.fire(s),s}reset(){for(let e of this._terminals.values())e.dis
`).map(r=>{let o=r.match(/^\s+/);if(o===null)return r;let[s]=o;return s.length>=i.length?r.slice(i.length):r}).join(`
`)}function yme(n){return n.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function dY(n){let e="",t,i,r=n.length;for(t=0;t<r;t++)i=n.charCodeAt(t),Math.random()>.5&&(i="x"+i.toString(16)),e+="&#"+i+";";return e}function ke(n,e,t){if(typeof n>"u"||n===null)throw new Error("marked(): input parameter is undefined or null");if(typeof n!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected");if(typeof e=="function"&&(t=e,e=null),e=no({},ke.defaults,e||{}),fY(e),t){let i=e.highlight,r;try{r=to.lex(n,e)}catch(a){return t(a)}let o=function(a){let l;if(!a)try{e.walkTokens&&ke.walkTokens(r,e.walkTokens),l=io.parse(r,e)}catch(u){a=u}return e.highlight=i,a?t(a):t(null,l)};if(!i||i.length<3||(delete e.highlight,!r.length))return o();let s=0;ke.walkTokens(r,function(a){a.type==="code"&&(s++,setTimeout(()=>{i(a.text,a.lang,function(l,u){if(l)return o(l);u!=null&&u!==a.text&&(a.text=u,a.escaped=!0),s--,s===0&&o()})},0))}),s===0&&o();return}try{let i=to.lex(n,e);return e.walkTokens&&ke.walkTokens(i,e.walkTokens),io.parse(i,e)}catch(i){if(i.message+=`
Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An error occurred:</p><pre>"+Si(i.message+"",!0)+"</pre>";throw i}}var oh,nme,rme,ome,sme,ame,aY,lme,ume,cme,hme,Mw,dme,gme,pme,Aw,up,ve,se,to,cp,Nw,Hw,io,k_e,P_e,E_e,R_e,__e,L_e,I_e,mY=k(()=>{oh=gY();nme=/[&<>"']/,rme=/[&<>"']/g,ome=/[<>"']|&(?!#?\w+;)/,sme=/[<>"']|&(?!#?\w+;)/g,ame={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},aY=n=>ame[n];lme=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;ume=/(^|[^\[])\^/g;cme=/[^\w:]/g,hme=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;Mw={},dme=/^[^:]+:\/*[^/]*$/,gme=/^([^:]+:)[\s\S]*$/,pme=/^([^:]+:\/*[^/]*)[\s\S]*$/;Aw={exec:function(){}};up=class{constructor(e){this.options=e||oh}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let i=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:Ow(i,`
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let i=t[0],r=bme(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim():t[2],text:r}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let i=t[2].trim();if(/#$/.test(i)){let o=Ow(i,"#");(this.options.pedantic||!o||/ $/.test(o))&&(i=o.trim())}let r={type:"heading",raw:t[0],depth:t[1].length,text:i,tokens:[]};return this.lexer.inline(r.text,r.tokens),r}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let i=t[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(i,[]),text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i,r,o,s,a,l,u,c,h,d,g,p,f=t[1].trim(),m=f.length>1,b={type:"list",raw:"",ordered:m,start:m?+f.slice(0,-1):"",loose:!1,items:[]};f=m?`\\d{1,9}\\${f.slice(-1)}`:`\\${f}`,this.options.pedantic&&(f=m?f:"[*+-]");let w=new RegExp(`^( {0,3}${f})((?: [^\\n]*)?(?:\\n|$))`);for(;e&&(p=!1,!(!(t=w.exec(e))||this.rules.block.hr.test(e)));){if(i=t[0],e=e.substring(i.length),c=t[2].split(`
`,1)[0],h=e.split(`
`,1)[0],this.options.pedantic?(s=2,g=c.trimLeft()):(s=t[2].search(/[^ ]/),s=s>4?1:s,g=c.slice(s),s+=t[1].length),l=!1,!c&&/^ *$/.test(h)&&(i+=h+`
`,e=e.substring(h.length+1),p=!0),!p){let T=new RegExp(`^ {0,${Math.min(3,s-1)}}(?:[*+-]|\\d{1,9}[.)])`);for(;e&&(d=e.split(`
`,1)[0],c=d,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!T.test(c));){if(c.search(/[^ ]/)>=s||!c.trim())g+=`
`+c.slice(s);else if(!l)g+=`
`+c;else break;!l&&!c.trim()&&(l=!0),i+=d+`
`,e=e.substring(d.length+1)}}b.loose||(u?b.loose=!0:/\n *\n *$/.test(i)&&(u=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(g),r&&(o=r[0]!=="[ ] ",g=g.replace(/^\[[ xX]\] +/,""))),b.items.push({type:"list_item",raw:i,task:!!r,checked:o,loose:!1,text:g}),b.raw+=i}b.items[b.items.length-1].raw=i.trimRight(),b.items[b.items.length-1].text=g.trimRight(),b.raw=b.raw.trimRight();let x=b.items.length;for(a=0;a<x;a++){this.lexer.state.top=!1,b.items[a].tokens=this.lexer.blockTokens(b.items[a].text,[]);let T=b.items[a].tokens.filter(F=>F.type==="space"),R=T.every(F=>{let N=F.raw.split(""),J=0;for(let H of N)if(H===`
`&&(J+=1),J>1)return!0;return!1});!b.loose&&T.length&&R&&(b.loose=!0,b.items[a].loose=!0)}return b}}html(e){let t=this.rules.block.html.exec(e);if(t){let i={type:"html",raw:t[0],pre:!this.options.sanitizer&&(t[1]==="pre"||t[1]==="script"||t[1]==="style"),text:t[0]};return this.options.sanitize&&(i.type="paragraph",i.text=this.options.sanitizer?this.options.sanitizer(t[0]):Si(t[0]),i.tokens=[],this.lexer.inline(i.text,i.tokens)),i}}def(e){let t=this.rules.block.def.exec(e);if(t){t[3]&&(t[3]=t[3].substring(1,t[3].length-1));let i=t[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:i,raw:t[0],href:t[2],title:t[3]}}}table(e){let t=this.rules.block.table.exec(e);if(t){let i={type:"table",header:uY(t[1]).map(r=>({text:r})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(`
`):[]};if(i.header.length===i.align.length){i.raw=t[0];let r=i.align.length,o,s,a,l;for(o=0;o<r;o++)/^ *-+: *$/.test(i.align[o])?i.align[o]="right":/^ *:-+: *$/.test(i.align[o])?i.align[o]="center":/^ *:-+ *$/.test(i.align[o])?i.align[o]="left":i.align[o]=null;for(r=i.rows.length,o=0;o<r;o++)i.rows[o]=uY(i.rows[o],i.header.length).map(u=>({text:u}));for(r=i.header.length,s=0;s<r;s++)i.header[s].tokens=[],this.lexer.inlineTokens(i.header[s].text,i.header[s].tokens);for(r=i.rows.length,s=0;s<r;s++)for(l=i.rows[s],a=0;a<l.length;a++)l[a].tokens=[],this.lexer.inlineTokens(l[a].text,l[a].tokens);return i}}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t){let i={type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:[]};return this.lexer.inline(i.text,i.tokens),i}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let i={type:"paragraph",raw:t[0],text:t[1].charAt(t[1].length-1)===`
`?t[1].slice(0,-1):t[1],tokens:[]};return this.lexer.inline(i.text,i.tokens),i}}text(e){let t=this.rules.block.text.exec(e);if(t){let i={type:"text",raw:t[0],text:t[0],tokens:[]};return this.lexer.inline(i.text,i.tokens),i}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Si(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):Si(t[0]):t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let i=t[2].trim();if(!this.options.pedantic&&/^</.test(i)){if(!/>$/.test(i))return;let s=Ow(i.slice(0,-1),"\\");if((i.length-s.length)%2===0)return}else{let s=mme(t[2],"()");if(s>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let r=t[2],o="";if(this.options.pedantic){let s=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);s&&(r=s[1],o=s[3])}else o=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^</.test(r)&&(this.options.pedantic&&!/>$/.test(i)?r=r.slice(1):r=r.slice(1,-1)),hY(t,{href:r&&r.replace(this.rules.inline._escapes,"$1"),title:o&&o.replace(this.rules.inline._escapes,"$1")},t[0],this.lexer)}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let r=(i[2]||i[1]).replace(/\s+/g," ");if(r=t[r.toLowerCase()],!r||!r.href){let o=i[0].charAt(0);return{type:"text",raw:o,text:o}}return hY(i,r,i[0],this.lexer)}}emStrong(e,t,i=""){let r=this.rules.inline.emStrong.lDelim.exec(e);if(!r||r[3]&&i.match(/[\p{L}\p{N}]/u))return;let o=r[1]||r[2]||"";if(!o||o&&(i===""||this.rules.inline.punctuation.exec(i))){let s=r[0].length-1,a,l,u=s,c=0,h=r[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(h.lastIndex=0,t=t.slice(-1*e.length+s);(r=h.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(l=a.length,r[3]||r[4]){u+=l;continue}else if((r[5]||r[6])&&s%3&&!((s+l)%3)){c+=l;continue}if(u-=l,u>0)continue;if(l=Math.min(l,l+u+c),Math.min(s,l)%2){let g=e.slice(1,s+r.index+l);return{type:"em",raw:e.slice(0,s+r.index+l+1),text:g,tokens:this.lexer.inlineTokens(g,[])}}let d=e.slice(2,s+r.index+l-1);return{type:"strong",raw:e.slice(0,s+r.index+l+1),text:d,tokens:this.lexer.inlineTokens(d,[])}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let i=t[2].replace(/\n/g," "),r=/[^ ]/.test(i),o=/^ /.test(i)&&/ $/.test(i);return r&&o&&(i=i.substring(1,i.length-1)),i=Si(i,!0),{type:"codespan",raw:t[0],text:i}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let 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,t){let i=this.rules.inline.autolink.exec(e);if(i){let r,o;return i[2]==="@"?(r=Si(this.options.mangle?t(i[1]):i[1]),o="mailto:"+r):(r=Si(i[1]),o=r),{type:"link",raw:i[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}url(e,t){let i;if(i=this.rules.inline.url.exec(e)){let r,o;if(i[2]==="@")r=Si(this.options.mangle?t(i[0]):i[0]),o="mailto:"+r;else{let s;do s=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(s!==i[0]);r=Si(i[0]),i[1]==="www."?o="http://"+r:o=r}return{type:"link",raw:i[0],text:r,href:o,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e,t){let i=this.rules.inline.text.exec(e);if(i){let r;return this.lexer.state.inRawBlock?r=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):Si(i[0]):i[0]:r=Si(this.options.smartypants?t(i[0]):i[0]),{type:"text",raw:i[0],text:r}}}},ve={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fenc
]`).replace("lheading",ve.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});se={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Aw,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Aw,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};se._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";se.punctuation=mt(se.punctuation).replace(/punctuation/g,se._punctuation).getRegex();se.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;se.escapedEmSt=/\\\*|\\_/g;se._comment=mt(ve._comment).replace("(?:-->|$)","-->").getRegex();se.emStrong.lDelim=mt(se.emStrong.lDelim).replace(/punct/g,se._punctuation).getRegex();se.emStrong.rDelimAst=mt(se.emStrong.rDelimAst,"g").replace(/punct/g,se._punctuation).getRegex();se.emStrong.rDelimUnd=mt(se.emStrong.rDelimUnd,"g").replace(/punct/g,se._punctuation).getRegex();se._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;se._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;se._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])?)+(?![-_])/;se.autolink=mt(se.autolink).replace("scheme",se._scheme).replace("email",se._email).getRegex();se._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;se.tag=mt(se.tag).replace("comment",se._comment).replace("attribute",se._attribute).getRegex();se._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;se._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;se._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;se.link=mt(se.link).replace("label",se._label).replace("href",se._href).replace("title",se._title).getRegex();se.reflink=mt(se.reflink).replace("label",se._label).replace("ref",ve._label).getRegex();se.nolink=mt(se.nolink).replace("ref",ve._label).getRegex();se.reflinkSearch=mt(se.reflinkSearch,"g").replace("reflink",se.reflink).replace("nolink",se.nolink).getRegex();se.normal=no({},se);se.pedantic=no({},se.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:mt(/^!?\[(label)\]\((.*?)\)/).replace("label",se._label).getRegex(),reflink:mt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",se._label).getRegex()});se.gfm=no({},se.normal,{escape:mt(se.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\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.!#$%&'*+\/=?_`{\|}~-]+@)))/});se.gfm.url=mt(se.gfm.url,"i").replace("email",se.gfm._extended_email).getRegex();se.breaks=no({},se.gfm,{br:mt(se.br).
`).replace(/\t/g," "),this.blockTokens(e,this.tokens);let t;for(;t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){this.options.pedantic&&(e=e.replace(/^ +$/gm,""));let i,r,o,s;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(a=>(i=a.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length),i.raw.length===1&&t.length>0?t[t.length-1].raw+=`
`:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length),r=t[t.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=`
`+i.raw,r.text+=`
`+i.text,this.inlineQueue[this.inlineQueue.length-1].src=r.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),r=t[t.length-1],r&&(r.type==="paragraph"||r.type==="text")?(r.raw+=`
`+i.raw,r.text+=`
`+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=r.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}if(o=e,this.options.extensions&&this.options.extensions.startBlock){let a=1/0,l=e.slice(1),u;this.options.extensions.startBlock.forEach(function(c){u=c.call({lexer:this},l),typeof u=="number"&&u>=0&&(a=Math.min(a,u))}),a<1/0&&a>=0&&(o=e.substring(0,a+1))}if(this.state.top&&(i=this.tokenizer.paragraph(o))){r=t[t.length-1],s&&r.type==="paragraph"?(r.raw+=`
`+i.raw,r.text+=`
`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(i),s=o.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length),r=t[t.length-1],r&&r.type==="text"?(r.raw+=`
`+i.raw,r.text+=`
`+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(i);continue}if(e){let a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let i,r,o,s=e,a,l,u;if(this.tokens.links){let c=Object.keys(this.tokens.links);if(c.length>0)for(;(a=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)c.includes(a[0].slice(a[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,a.index)+"["+cY("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(a=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,a.index)+"["+cY("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(a=this.tokenizer.rules.inline.escapedEmSt.exec(s))!=null;)s=s.slice(0,a.index)+"++"+s.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(l||(u=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(c=>(i=c.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.escape(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.tag(e)){e=e.substring(i.raw.length),r=t[t.length-1],r&&i.type==="text"&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):t.push(i);continue}if(i=this.tokenizer.link(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(i.raw.length),r=t[t.length-1],r&&i.type==="text"&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):t.push(i);continue}if(i=this.tokenizer.emStrong(e,s,u)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.codespan(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.br(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.del(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.autolink(e,dY)){e=e.substring(i.raw.length),t.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(e,dY))){e=e.substring(i.raw.length),t.push(i);continue}if(o=e,this.options.extensions&&this.options.extensions.startInline){let c=1/0,h=e.slice(1),d;this.options.extensions.startInline.forEach(function(g){d=g.call({lexer:this},h),typeof d=="number"&&d>=0&&(c=Math.min(c,d))}),c<1/0&&c>=0&&(o=e.substring(0,c+1))}if(i=this.tokenizer.inlineText(o,yme)){e=e.substring(i.raw.length),i.raw.slice(-1)!=="_"&&(u=i.raw.slice(-1)),l=!0,r=t[t.length-1],r&&r.type==="text"?(r.raw+=i.raw,r.text+=i.text):t.push(i);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return t}},cp=class{constructor(e){this.options=e||oh}code(e,t,i){let r=(t||"").match(/\S*/)[0];if(this.options.highlight){let o=this.options.highlight(e,r);o!=null&&o!==e&&(i=!0,e=o)}return e=e.replace(/\n$/,"")+`
`,r?'<pre><code class="'+this.options.langPrefix+Si(r,!0)+'">'+(i?e:Si(e,!0))+`</code></pre>
`:"<pre><code>"+(i?e:Si(e,!0))+`</code></pre>
`}blockquote(e){return`<blockquote>
`+e+`</blockquote>
`}html(e){return e}heading(e,t,i,r){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+r.slug(i)+'">'+e+"</h"+t+`>
`:"<h"+t+">"+e+"</h"+t+`>
`}hr(){return this.options.xhtml?`<hr/>
`:`<hr>
`}list(e,t,i){let r=t?"ol":"ul",o=t&&i!==1?' start="'+i+'"':"";return"<"+r+o+`>
`+e+"</"+r+`>
`}listitem(e){return"<li>"+e+`</li>
`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return"<p>"+e+`</p>
`}table(e,t){return t&&(t="<tbody>"+t+"</tbody>"),`<table>
<thead>
`+e+`</thead>
`+t+`</table>
`}tablerow(e){return`<tr>
`+e+`</tr>
`}tablecell(e,t){let i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"</"+i+`>
`}strong(e){return"<strong>"+e+"</strong>"}em(e){return"<em>"+e+"</em>"}codespan(e){return"<code>"+e+"</code>"}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return"<del>"+e+"</del>"}link(e,t,i){if(e=lY(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let r='<a href="'+Si(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+i+"</a>",r}image(e,t,i){if(e=lY(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let r='<img src="'+e+'" alt="'+i+'"';return t&&(r+=' title="'+t+'"'),r+=this.options.xhtml?"/>":">",r}text(e){return e}},Nw=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,i){return""+i}image(e,t,i){return""+i}br(){return""}},Hw=class{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let i=e,r=0;if(this.seen.hasOwnProperty(i)){r=this.seen[e];do r++,i=e+"-"+r;while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=r,this.seen[i]=0),i}slug(e,t={}){let i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)}},io=class{constructor(e){this.options=e||oh,this.options.renderer=this.options.renderer||new cp,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Nw,this.slugger=new Hw}static parse(e,t){return new io(t).parse(e)}static parseInline(e,t){return new io(t).parseInline(e)}parse(e,t=!0){let i="",r,o,s,a,l,u,c,h,d,g,p,f,m,b,w,x,T,R,F,N=e.length;for(r=0;r<N;r++){if(g=e[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[g.type]&&(F=this.options.extensions.renderers[g.type].call({parser:this},g),F!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(g.type))){i+=F||"";continue}switch(g.type){case"space":continue;case"hr":{i+=this.renderer.hr();continue}case"heading":{i+=this.renderer.heading(this.parseInline(g.tokens),g.depth,pY(this.parseInline(g.tokens,this.textRenderer)),this.slugger);continue}case"code":{i+=this.renderer.code(g.text,g.lang,g.escaped);continue}case"table":{for(h="",c="",a=g.header.length,o=0;o<a;o++)c+=this.renderer.tablecell(this.parseInline(g.header[o].tokens),{header:!0,align:g.align[o]});for(h+=this.renderer.tablerow(c),d="",a=g.rows.length,o=0;o<a;o++){for(u=g.rows[o],c="",l=u.length,s=0;s<l;s++)c+=this.renderer.tablecell(this.parseInline(u[s].tokens),{header:!1,align:g.align[s]});d+=this.renderer.tablerow(c)}i+=this.renderer.table(h,d);continue}case"blockquote":{d=this.parse(g.tokens),i+=this.renderer.blockquote(d);continue}case"list":{for(p=g.ordered,f=g.start,m=g.loose,a=g.items.length,d="",o=0;o<a;o++)w=g.items[o],x=w.checked,T=w.task,b="",w.task&&(R=this.renderer.checkbox(x),m?w.tokens.length>0&&w.tokens[0].type==="paragraph"?(w.tokens[0].text=R+" "+w.tokens[0].text,w.tokens[0].tokens&&w.tokens[0].tokens.length>0&&w.tokens[0].tokens[0].type==="text"&&(w.tokens[0].tokens[0].text=R+" "+w.tokens[0].tokens[0].text)):w.tokens.unshift({type:"text",text:R}):b+=R),b+=this.parse(w.tokens,m),d+=this.renderer.listitem(b,T,x);i+=this.renderer.list(d,p,f);continue}case"html":{i+=this.renderer.html(g.text);continue}case"paragraph":{i+=this.renderer.paragraph(this.parseInline(g.tokens));continue}case"text":{for(d=g.tokens?this.parseInline(g.tokens):g.text;r+1<N&&e[r+1].type==="text";)g=e[++r],d+=`
`+(g.tokens?this.parseInline(g.tokens):g.text);i+=t?this.renderer.paragraph(d):d;continue}default:{let J='Token with "'+g.type+'" type was not found.';if(this.options.silent){console.error(J);return}else throw new Error(J)}}}return i}parseInline(e,t){t=t||this.renderer;let i="",r,o,s,a=e.length;for(r=0;r<a;r++){if(o=e[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[o.type]&&(s=this.options.extensions.renderers[o.type].call({parser:this},o),s!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type))){i+=s||"";continue}switch(o.type){case"escape":{i+=t.text(o.text);break}case"html":{i+=t.html(o.text);break}case"link":{i+=t.link(o.href,o.title,this.parseInline(o.tokens,t));break}case"image":{i+=t.image(o.href,o.title,o.text);break}case"strong":{i+=t.strong(this.parseInline(o.tokens,t));break}case"em":{i+=t.em(this.parseInline(o.tokens,t));break}case"codespan":{i+=t.codespan(o.text);break}case"br":{i+=t.br();break}case"del":{i+=t.del(this.parseInline(o.tokens,t));break}case"text":{i+=t.text(o.text);break}default:{let l='Token with "'+o.type+'" type was not found.';if(this.options.silent){console.error(l);return}else throw new Error(l)}}}return i}};ke.options=ke.setOptions=function(n){return no(ke.defaults,n),ime(ke.defaults),ke};ke.getDefaults=gY;ke.defaults=oh;ke.use=function(...n){let e=no({},...n),t=ke.defaults.extensions||{renderers:{},childTokens:{}},i;n.forEach(r=>{if(r.extensions&&(i=!0,r.extensions.forEach(o=>{if(!o.name)throw new Error("extension name required");if(o.renderer){let s=t.renderers?t.renderers[o.name]:null;s?t.renderers[o.name]=function(...a){let l=o.renderer.apply(this,a);return l===!1&&(l=s.apply(this,a)),l}:t.renderers[o.name]=o.renderer}if(o.tokenizer){if(!o.level||o.level!=="block"&&o.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");t[o.level]?t[o.level].unshift(o.tokenizer):t[o.level]=[o.tokenizer],o.start&&(o.level==="block"?t.startBlock?t.startBlock.push(o.start):t.startBlock=[o.start]:o.level==="inline"&&(t.startInline?t.startInline.push(o.start):t.startInline=[o.start]))}o.childTokens&&(t.childTokens[o.name]=o.childTokens)})),r.renderer){let o=ke.defaults.renderer||new cp;for(let s in r.renderer){let a=o[s];o[s]=(...l)=>{let u=r.renderer[s].apply(o,l);return u===!1&&(u=a.apply(o,l)),u}}e.renderer=o}if(r.tokenizer){let o=ke.defaults.tokenizer||new up;for(let s in r.tokenizer){let a=o[s];o[s]=(...l)=>{let u=r.tokenizer[s].apply(o,l);return u===!1&&(u=a.apply(o,l)),u}}e.tokenizer=o}if(r.walkTokens){let o=ke.defaults.walkTokens;e.walkTokens=function(s){r.walkTokens.call(this,s),o&&o.call(this,s)}}i&&(e.extensions=t),ke.setOptions(e)})};ke.walkTokens=function(n,e){for(let t of n)switch(e.call(ke,t),t.type){case"table":{for(let i of t.header)ke.walkTokens(i.tokens,e);for(let i of t.rows)for(let r of i)ke.walkTokens(r.tokens,e);break}case"list":{ke.walkTokens(t.items,e);break}default:ke.defaults.extensions&&ke.defaults.extensions.childTokens&&ke.defaults.extensions.childTokens[t.type]?ke.defaults.extensions.childTokens[t.type].forEach(function(i){ke.walkTokens(t[i],e)}):t.tokens&&ke.walkTokens(t.tokens,e)}};ke.parseInline=function(n,e){if(typeof n>"u"||n===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof n!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected");e=no({},ke.defaults,e||{}),fY(e);try{let t=to.lexInline(n,e);return e.walkTokens&&ke.walkTokens(t,e.walkTokens),io.parseInline(t,e)}catch(t){if(t.message+=`
Please report this to https://github.com/markedjs/marked.`,e.silent)return"<p>An error occurred:</p><pre>"+Si(t.message+"",!0)+"</pre>";throw t}};ke.Parser=io;ke.parser=io.parse;ke.Renderer=cp;ke.TextRenderer=Nw;ke.Lexer=to;ke.lexer=to.lex;ke.Tokenizer=up;ke.Slugger=Hw;ke.parse=ke;k_e=ke.options,P_e=ke.setOptions,E_e=ke.use,R_e=ke.walkTokens,__e=ke.parseInline,L_e=io.parse,I_e=to.lex});var wY=y((j_e,vY)=>{var yY={};vY.exports=yY;var bY={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],grey:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBG:[40,49],redBG:[41,49],greenBG:[42,49],yellowBG:[43,49],blueBG:[44,49],magentaBG:[45,49],cyanBG:[46,49],whiteBG:[47,49]};Object.keys(bY).forEach(function(n){var e=bY[n],t=yY[n]=[];t.open="\x1B["+e[0]+"m",t.close="\x1B["+e[1]+"m"})});var CY=y((M_e,xY)=>{var hp=process.argv;xY.exports=function(){return hp.indexOf("--no-color")!==-1||hp.indexOf("--color=false")!==-1?!1:hp.indexOf("--color")!==-1||hp.indexOf("--color=true")!==-1||hp.indexOf("--color=always")!==-1?!0:process.stdout&&!process.stdout.isTTY?!1:process.platform==="win32"||"COLORTERM"in process.env?!0:process.env.TERM==="dumb"?!1:!!/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)}()});var DY=y((O_e,SY)=>{SY.exports=function(e,t){var i="";e=e||"Run the trap, drop the bass",e=e.split("");var r={a:["@","\u0104","\u023A","\u0245","\u0394","\u039B","\u0414"],b:["\xDF","\u0181","\u0243","\u026E","\u03B2","\u0E3F"],c:["\xA9","\u023B","\u03FE"],d:["\xD0","\u018A","\u0500","\u0501","\u0502","\u0503"],e:["\xCB","\u0115","\u018E","\u0258","\u03A3","\u03BE","\u04BC","\u0A6C"],f:["\u04FA"],g:["\u0262"],h:["\u0126","\u0195","\u04A2","\u04BA","\u04C7","\u050A"],i:["\u0F0F"],j:["\u0134"],k:["\u0138","\u04A0","\u04C3","\u051E"],l:["\u0139"],m:["\u028D","\u04CD","\u04CE","\u0520","\u0521","\u0D69"],n:["\xD1","\u014B","\u019D","\u0376","\u03A0","\u048A"],o:["\xD8","\xF5","\xF8","\u01FE","\u0298","\u047A","\u05DD","\u06DD","\u0E4F"],p:["\u01F7","\u048E"],q:["\u09CD"],r:["\xAE","\u01A6","\u0210","\u024C","\u0280","\u042F"],s:["\xA7","\u03DE","\u03DF","\u03E8"],t:["\u0141","\u0166","\u0373"],u:["\u01B1","\u054D"],v:["\u05D8"],w:["\u0428","\u0460","\u047C","\u0D70"],x:["\u04B2","\u04FE","\u04FC","\u04FD"],y:["\xA5","\u04B0","\u04CB"],z:["\u01B5","\u0240"]};return e.forEach(function(o){o=o.toLowerCase();var s=r[o]||[" "],a=Math.floor(Math.random()*s.length);typeof r[o]<"u"?i+=r[o][a]:i+=o}),i}});var kY=y((A_e,TY)=>{TY.exports=function(e,t){e=e||" he is here ";var i={up:["\u030D","\u030E","\u0304","\u0305","\u033F","\u0311","\u0306","\u0310","\u0352","\u0357","\u0351","\u0307","\u0308","\u030A","\u0342","\u0313","\u0308","\u034A","\u034B","\u034C","\u0303","\u0302","\u030C","\u0350","\u0300","\u0301","\u030B","\u030F","\u0312","\u0313","\u0314","\u033D","\u0309","\u0363","\u0364","\u0365","\u0366","\u0367","\u0368","\u0369","\u036A","\u036B","\u036C","\u036D","\u036E","\u036F","\u033E","\u035B","\u0346","\u031A"],down:["\u0316","\u0317","\u0318","\u0319","\u031C","\u031D","\u031E","\u031F","\u0320","\u0324","\u0325","\u0326","\u0329","\u032A","\u032B","\u032C","\u032D","\u032E","\u032F","\u0330","\u0331","\u0332","\u0333","\u0339","\u033A","\u033B","\u033C","\u0345","\u0347","\u0348","\u0349","\u034D","\u034E","\u0353","\u0354","\u0355","\u0356","\u0359","\u035A","\u0323"],mid:["\u0315","\u031B","\u0300","\u0301","\u0358","\u0321","\u0322","\u0327","\u0328","\u0334","\u0335","\u0336","\u035C","\u035D","\u035E","\u035F","\u0360","\u0362","\u0338","\u0337","\u0361"," \u0489"]},r=[].concat(i.up,i.down,i.mid),o={};function s(u){var c=Math.floor(Math.random()*u);return c}function a(u){var c=!1;return r.filter(function(h){c=h===u}),c}function l(u,c){var h="",d,g;c=c||{},c.up=c.up||!0,c.mid=c.mid||!0,c.down=c.down||!0,c.size=c.size||"maxi",u=u.split("");fo
`);return i.reduce(function(r,o){return o.length>r?o.length:r},0)}});var JY=y(($_e,GE)=>{var Rme=WY(),zl=ZY(),XE=zl.repeat,_me=zl.truncate,Lme=zl.pad;function dp(n){this.options=zl.options({chars:{top:"\u2500","top-mid":"\u252C","top-left":"\u250C","top-right":"\u2510",bottom:"\u2500","bottom-mid":"\u2534","bottom-left":"\u2514","bottom-right":"\u2518",left:"\u2502","left-mid":"\u251C",mid:"\u2500","mid-mid":"\u253C",right:"\u2502","right-mid":"\u2524",middle:"\u2502"},truncate:"\u2026",colWidths:[],colAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["grey"],compact:!1},head:[]},n)}dp.prototype.__proto__=Array.prototype;dp.prototype.__defineGetter__("width",function(){var n=this.toString().split(`
`);return n.length?n[0].length:0});dp.prototype.render;dp.prototype.toString=function(){var n="",e=this.options,t=e.style,i=e.head,r=e.chars,o=e.truncate,s=e.colWidths||new Array(this.head.length),a=0;if(!i.length&&!this.length)return"";if(!s.length){var l=this.slice(0);i.length&&(l=l.concat([i])),l.forEach(function(b){if(typeof b=="object"&&b.length)u(b);else{var w=Object.keys(b)[0],x=b[w];s[0]=Math.max(s[0]||0,c(w)||0),typeof x=="object"&&x.length?u(x,1):s[1]=Math.max(s[1]||0,c(x)||0)}})}a=(s.length==1?s[0]:s.reduce(function(b,w){return b+w}))+s.length+1;function u(b,x){var x=x||0;b.forEach(function(T,R){s[R+x]=Math.max(s[R+x]||0,c(T)||0)})}function c(b){return typeof b=="object"&&b.width!=null?b.width:(typeof b=="object"?zl.strlen(b.text):zl.strlen(b))+(t["padding-left"]||0)+(t["padding-right"]||0)}function h(F,w,x,T){var R=0,F=w+XE(F,a-2)+x;return s.forEach(function(N,J){J!=s.length-1&&(R+=N+1,F=F.substr(0,R)+T+F.substr(R+1))}),p(e.style.border,F)}function d(){var b=h(r.top,r["top-left"]||r.top,r["top-right"]||r.top,r["top-mid"]);b&&(n+=b+`
`)}function g(b,w){var x=[],T=0;if(!Array.isArray(b)&&typeof b=="object"){var R=Object.keys(b)[0],F=b[R],N=!0;Array.isArray(F)?(b=F,b.unshift(R)):b=[R,F]}b.forEach(function(M,L){var O=M.toString().split(`
`).reduce(function(ne,be){return ne.push(f(be,L)),ne},[]),Z=O.length;Z>T&&(T=Z),x.push({contents:O,height:Z})});var J=new Array(T);x.forEach(function(M,L){M.contents.forEach(function(ne,be){J[be]||(J[be]=[]),(w||N&&L===0&&e.style.head)&&(ne=p(e.style.head,ne)),J[be].push(ne)});for(var O=M.height,Z=T;O<Z;O++)J[O]||(J[O]=[]),J[O].push(f("",L))});var H="";return J.forEach(function(M,L){H.length>0&&(H+=`
`+p(e.style.border,r.left)),H+=M.join(p(e.style.border,r.middle))+p(e.style.border,r.right)}),p(e.style.border,r.left)+H}function p(b,w){return w?(b.forEach(function(x){w=Rme[x](w)}),w):""}function f(x,w){var x=String(typeof x=="object"&&x.text?x.text:x),T=zl.strlen(x),R=s[w]-(t["padding-left"]||0)-(t["padding-right"]||0),F=e.colAligns[w]||"left";return XE(" ",t["padding-left"]||0)+(T==R?x:T<R?Lme(x,R+(x.length-T)," ",F=="left"?"right":F=="middle"?"both":"left"):o?_me(x,R,o):x)+XE(" ",t["padding-right"]||0)}i.length&&(d(),n+=g(i,t.head)+`
`),this.length&&this.forEach(function(b,w){if(!i.length&&w==0)d();else if(!t.compact||w<!!i.length||b.length==0){var x=h(r.mid,r["left-mid"],r["right-mid"],r["mid-mid"]);x&&(n+=x+`
`)}b.hasOwnProperty("length")&&!b.length||(n+=g(b)+`
`)});var m=h(r.bottom,r["bottom-left"]||r.bottom,r["bottom-right"]||r.bottom,r["bottom-mid"]);return m?n+=m:n=n.slice(0,-1),n};GE.exports=dp;GE.exports.version="0.0.1"});var GY=y((U_e,XY)=>{"use strict";var $Y=(n=0)=>e=>`\x1B[${38+n};5;${e}m`,UY=(n=0)=>(e,t,i)=>`\x1B[${38+n};2;${e};${t};${i}m`;function Ime(){let n=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[t,i]of Object.entries(e)){for(let[r,o]of Object.entries(i))e[r]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},i[r]=e[r],n.set(o[0],o[1]);Object.defineProperty(e,t,{value:i,enumerable:!1})}return Object.defineProperty(e,"codes",{value:n,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi256=$Y(),e.color.ansi16m=UY(),e.bgColor.ansi256=$Y(10),e.bgColor.ansi16m=UY(10),Object.defineProperties(e,{rgbToAnsi256:{value:(t,i,r)=>t===i&&i===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(i/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:t=>{let i=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!i)return[0,0,0];let{colorString:r}=i.groups;r.length===3&&(r=r.split("").map(s=>s+s).join(""));let o=Number.parseInt(r,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>e.rgbToAnsi256(...e.hexToRgb(t)),enumerable:!1}}),e}Object.defineProperty(XY,"exports",{enumerable:!0,get:Ime})});function zY(n){return`${Ni.default.gray.open}${n}${Ni.default.gray.close}`}function zE(n){return`${Ni.default.magenta.open}${n}${Ni.default.magenta.close}`}function KY(n){return`${Ni.default.bold.open}${n}${Ni.default.bold.close}`}function KE(n){return`${Ni.default.underline.open}${n}${Ni.default.underline.close}`}function QY(n){return`${Ni.default.strikethrough.open}${n}${Ni.default.strikethrough.close}`}function VY(n){return`${Ni.default.italic.open}${n}${Ni.default.italic.close}`}function eZ(n){return`${Ni.default.yellow.open}${n}${Ni.default.yellow.close}`}function QE(n){return`${Ni.default.blue.open}${n}${Ni.default.blue.close}`}var Ni,tZ=k(()=>{"use strict";Ni=S(GY())});function ro(n){return n}function Ame(n){return zY(n.replace(/(<([^>]+)>)/ig,""))}function iZ(n,e){return e?n.replace(Ome,/\n/g):n}function Hme(n,e){return e.replace(/(^|\n)(.+)/g,"$1"+n+"$2")}function qme(n,e){return e&&n+e.split(`
`).join(`
`+n)}function Yme(n,e){let t=new RegExp("(\\S(?: | )?)((?:"+e+")+)("+lZ+"(?:.*)+)$","gm");return n.replace(t,`$1
`+e+"$2$3")}function cZ(n){return" ".repeat(n.length)}function Zme(n,e){return uZ(e,n)?e:cZ(iR)+e}function Jme(n,e){let t=Zme.bind(null,e);return n.split(`
`).filter(ro).map(t).join(`
`)}function $me(n,e,t){return uZ(e,n)?{num:t+1,line:e.replace(iR,nZ(t+1))}:{num:t,line:cZ(nZ(t))+e}}function Ume(n,e){let t=$me.bind(null,e),i=0;return n.split(`
`).filter(ro).map(r=>{let o=t(r,i);return i=o.num,o.line}).join(`
`)}function Xme(n,e,t){return n=n.trim(),n=e?Ume(n,t):Jme(n,t),n}function gp(n){return n+`
`}function Gme(n){return n.replace(Mme,":")}function rZ(n,e=null){if(!n)return[];e=e||ro;let t=e(n).split(`
`),i=[];return t.forEach(function(r){if(!r)return;let o=r.replace(jme,"").split(sZ);i.push(o.splice(0,o.length-1))}),i}function hZ(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function zme(n){return n.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'")}var oZ,X_e,sZ,eR,jme,aZ,Mme,Ome,Nme,Bme,Wme,lZ,uZ,iR,nZ,VE,tR,nR,dZ=k(()=>{"use strict";oZ=S(JY());tZ();X_e=q()("markdown-renderer"),sZ="^*||*^",eR="*|*|*|*",jme=new RegExp(hZ(eR),"g"),aZ="*#COLON|*",Mme=new RegExp(hZ(aZ),"g"),Ome="\r";Nme={code:ro,blockquote:ro,html:Ame,heading:zE,firstHeading:zE,hr:ro,listitem:ro,list:Xme,table:ro,paragraph:ro,strong:KY,em:VY,codespan:eZ,del:QY,link:KE,href:KE,text:ro,unescape:!0,emoji:!1,width:80,showSectionPrefix:!1,tab:2,tableOptions:{}};Bme="\\*",Wme="\\d+\\.",lZ="(?:"+[Bme,Wme].join("|")+")";uZ=function(n,e){return n.match("^(?:"+e+")*"+lZ)};iR="* ";nZ=function(n){return n+". "};VE=new Map,tR=class{constructor(e={},t={}){this.options=e;this.highlightOptions=t;this.o=Object.assign({},Nme,e),this.tab=" ",this.tableSettings=this.o.tableOptions,this.unescape=this.o.unescape?zme:ro,this.highlightOptions=t||{},this.transform=this.compose(Gme,this.unescape)}text(e){return this.o.text(e)}code(e,t,i){return"``` "+t+`
`+e+"\n```\n"}blockquote(e){return gp(this.o.blockquote(qme(this.tab,e.trim())))}html(e){return this.o.html(e)}heading(e,t,i){return e=this.transform(e),e=(this.o.showSectionPrefix?new Array(t+1).join("#")+" ":"")+e,gp(t===1?this.o.firstHeading(e):this.o.heading(e))}hr(){return`\u2500\u2500\u2500
`}list(e,t){return e=this.o.list(e,t,this.tab),gp(Yme(Hme(this.tab,e),this.tab))}listitem(e){let t=this.compose(this.o.listitem,this.transform);return e.indexOf(`
`)!==-1&&(e=e.trim()),`
`+iR+t(e)}checkbox(e){return"["+(e?"X":" ")+"] "}paragraph(e){return e=this.compose(this.o.paragraph,this.transform)(e),gp(e)}table(e,t){let i=new oZ.default(Object.assign({},{head:rZ(e)[0]},this.tableSettings));return rZ(t,this.transform).forEach(function(r){i.push(r)}),gp(this.o.table(i.toString()))}tablerow(e){return eR+e+eR+`
`}tablecell(e,t){return e+sZ}strong(e){return this.o.strong(e)}em(e){return e=iZ(e,this.o.reflowText),this.o.em(e)}codespan(e){return e=iZ(e,this.o.reflowText),this.o.codespan(e.replace(/:/g,aZ))}br(){return`
`}del(e){return this.o.del(e)}link(e,t,i){let r;try{r=decodeURIComponent(unescape(e)).replace(/[^\w:]/g,"").toLowerCase()}catch{return""}if(r.startsWith("javascript:"))return"";if(i&&e&&i!=e&&VE.set(i,e),i&&i!=e)return QE(i);let o=this.o.href(e);return this.o.link(o)}image(e,t,i){let r="!["+i;return t&&(r+=" \u2013 "+t),r+"]("+e+")"}compose(...e){return(...t)=>{for(let i=e.length;i-- >0;)t=[e[i].apply(this,t)];return t[0]}}static getLinks(){let e=[];for(let[t,i]of VE.entries())e.push(`${QE(t)}: ${i}`);return VE.clear(),e}},nR=tR});function lh(n,e=!1){let t=pp(n),i=[],r="";for(let o of t){if(!o.text)continue;let{foreground:s,background:a}=o,l=Q(r),u=[l,l+Q(o.text)];if(s&&a){let c=`CocList${_n(s)}${_n(a)}`;i.push({span:u,hlGroup:c})}else if(s){let c;e?s=="yellow"?c="CocMarkdownCode":s=="blue"?c="CocMarkdownLink":s=="magenta"?c="CocMarkdownHeader":c=`CocListFg${_n(s)}`:c=`CocListFg${_n(s)}`,i.push({span:u,hlGroup:c})}else if(a){let c=`CocListBg${_n(a)}`;i.push({span:u,hlGroup:c})}o.bold?i.push({span:u,hlGroup:"CocBold"}):o.italic?i.push({span:u,hlGroup:"CocItalic"}):o.underline?i.push({span:u,hlGroup:"CocUnderline"}):o.strikethrough&&i.push({span:u,hlGroup:"CocStrikeThrough"}),r=r+o.text}return{line:r,highlights:i}}function pp(n){let e=null,t=null,i="",r=[],o=[],s={},a;a=()=>{let l,u;i.length?i=i.substr(0,i.length-1):o.length&&(l=o.length-1,u=o[l].text,u.length===1?o.pop():o[l].text=u.substr(0,u.length-1))};for(let l=0;l<n.length;l++){if(e!=null){e=="\x1B"&&n[l]=="["?(i&&(s.text=i,o.push(s),s={},i=""),i==""&&(n[l+1]=="m"||n[l+1]=="K")&&((s.foreground||s.background)&&(s.text="",o.push(s)),s={}),e=null,t=""):(i+=e+n[l],e=null);continue}else if(t!=null){n[l]==";"?(r.push(t),t=""):n[l]=="m"||n[l]=="K"?(r.push(t),t=null,i="",r.forEach(u=>{gZ[u]?s.foreground=gZ[u]:pZ[u]?s.background=pZ[u]:u==39?delete s.foreground:u==49?delete s.background:fZ[u]?s[fZ[u]]=!0:u==22?s.bold=!1:u==23?s.italic=!1:u==24?s.underline=!1:u==29&&(s.strikethrough=!1)}),r=[]):t+=n[l];continue}n[l]=="\x1B"?e=n[l]:n[l]=="\b"?a():i+=n[l]}return i&&(s.text=i+(e||""),o.push(s)),o}var gZ,pZ,fZ,uh=k(()=>{"use strict";_e();gZ={30:"black",31:"red",32:"green",33:"yellow",34:"blue",35:"magenta",36:"cyan",37:"white",90:"grey"},pZ={40:"black",41:"red",42:"green",43:"yellow",44:"blue",45:"magenta",46:"cyan",47:"white"},fZ={1:"bold",3:"italic",4:"underline",9:"strikethrough"}});var bZ=y((Q_e,mZ)=>{"use strict";mZ.exports=({onlyFirst:n=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,n?void 0:"g")}});var qw=y((V_e,yZ)=>{"use strict";var Kme=bZ();yZ.exports=n=>typeof n=="string"?n.replace(Kme(),""):n});function Ww(n,e={}){let t=[],i=[],r=[],o=0;for(let s of n){let a=t.length,{content:l,filetype:u}=s,c=s.highlights;if(u=="markdown"){let h=ebe(l,e);r.push(...h.codes.map(d=>(d.startLine=d.startLine+a,d.endLine=d.endLine+a,d))),i.push(...h.highlights.map(d=>(d.lnum=d.lnum+a,d))),t.push(...h.lines)}else{let h=l.trim().split(/\r?\n/);Qme.includes(s.filetype)?r.push({hlGroup:`Coc${u}Float`,startLine:a,endLine:a+h.length}):r.push({filetype:s.filetype,startLine:a,endLine:a+h.length}),t.push(...h)}if(Array.isArray(c)&&i.push(...c.map(h=>Object.assign({},h,{lnum:h.lnum+a}))),Array.isArray(s.active)){let h=Vme(l,a,s.active);h.length&&i.push(...h)}o!=n.length-1&&(i.push({lnum:t.length,hlGroup:"CocFloatDividingLine",colStart:0,colEnd:-1}),t.push("\u2500")),o=o+1}return{lines:t,highlights:i,codes:r}}function Vme(n,e,t){let i=[],[r,o]=t,s=n.split(/\r?\n/),a=0,l=!1;for(let u=0;u<s.length;u++){let c=s[u];if(l)if(a+c.length>o){let h=Q(c.slice(0,o-a));i.push({colStart:0,colEnd:h,lnum:u+e,hlGroup:Bw}),l=!1;break}else{let h=Q(c);i.push({colStart:0,colEnd:h,lnum:u+e,hlGroup:Bw})}else if(a+c.length>r){l=!0;let h=Q(c.slice(0,r-a));if(a+c.length>o){let d=Q(c.slice(0,o-a));l=!1,i.push({colStart:h,colEnd:d,lnum:u+e,hlGroup:Bw});break}else{let d=Q(c);i.push({colStart:h,colEnd:d,lnum:u+e,hlGroup:Bw})}}a=a+c.length+1}return
`).replace(/\s*$/,""),c.length&&(u=u+`
`+c.join(`
`));let h=u.split(/\n/);for(let d=0;d<h.length;d++){let g=h[d];if(!g.length){t[t.length-1]&&(t.push(g),o++);continue}if(e.excludeImages&&g.indexOf("![")!==-1&&(g=g.replace(/\s*!\[.*?\]\(.*?\)/g,""),!(0,vZ.default)(g).trim().length))continue;if(/\s*```\s*([A-Za-z0-9_,]+)?$/.test(g)){if(s)s=!1,r.push({filetype:a,startLine:l,endLine:o});else{let f=h[d-1];f&&/^\s*```\s*/.test(f)&&(t.push(""),o++),s=!0,a=g.replace(/^\s*```\s*/,""),a=="js"&&(a="javascript"),a=="ts"&&(a="typescript"),a=="bash"&&(a="sh"),l=o}continue}if(s){t.push(g),o++;continue}let p=lh(g,!0);if(g==="\u2500\u2500\u2500")i.push({hlGroup:"CocFloatDividingLine",lnum:o,colStart:0,colEnd:-1});else if(p.highlights)for(let f of p.highlights){let{hlGroup:m,span:b}=f;i.push({hlGroup:m,lnum:o,colStart:b[0],colEnd:b[1]})}t.push(p.line),o++}return{lines:t,highlights:i,codes:r}}var vZ,Qme,rLe,Bw,rR=k(()=>{"use strict";mY();dZ();uh();_e();vZ=S(qw()),Qme=["Error","Warning","Info","Hint"],rLe=q()("markdown-index"),Bw="CocFloatActive"});var Di,ds=k(()=>{"use strict";Di=class{constructor(){this.tasks=[];this.count=1}sched(){this.count>0&&this.tasks.length>0&&(this.count--,this.tasks.shift()())}get busy(){return this.count==0}acquire(){return new Promise(e=>{let t=()=>{let i=!1;e(()=>{i||(i=!0,this.count++,this.sched())})};this.tasks.push(t),process.nextTick(this.sched.bind(this))})}use(e){return this.acquire().then(t=>e().then(i=>(t(),i)).catch(i=>{throw t(),i}))}}});var wZ,xZ,tbe,gLe,Kl,oR=k(()=>{"use strict";wZ=S(Pn()),xZ=S(W());fe();rR();re();ds();et();tbe=process.env.VIM_NODE_RPC=="1",gLe=q()("model-float"),Kl=class{constructor(e){this.nvim=e;this.winid=0;this._bufnr=0;this.mutex=new Di;this.disposables=[];this.onCursorMoved=(0,wZ.default)(this._onCursorMoved.bind(this),100)}bindEvents(e,t){let i=["InsertLeave","InsertEnter","BufEnter"];for(let r of i)P.on(r,o=>{o!=this._bufnr&&this.close()},null,this.disposables);P.on("MenuPopupChanged",()=>{P.pumAlignTop==t&&this.close()},null,this.disposables),this.disposables.push(xZ.Disposable.create(()=>{this.onCursorMoved.clear()})),P.on("CursorMoved",this.onCursorMoved.bind(this,e),this,this.disposables),P.on("CursorMovedI",this.onCursorMoved.bind(this,e),this,this.disposables)}unbind(){this.disposables.length&&(U(this.disposables),this.disposables=[])}_onCursorMoved(e,t,i){if(t!=this._bufnr&&!(t==this.targetBufnr&&ye(i,this.cursor))&&(e||t!=this.targetBufnr||!P.insertMode)){this.close();return}}async create(e,t=!1,i=0){await this.show(e,{offsetX:i})}async show(e,t={}){if(e.length==0||e.every(o=>o.content.length==0)){this.close();return}let i=Date.now(),r=await this.mutex.acquire();try{await this.createPopup(e,t,i),r()}catch(o){this.nvim.echoError(o),r()}}async createPopup(e,t,i){e=e.filter(f=>f.content.trim().length>0);let{lines:r,codes:o,highlights:s}=Ww(e),a={codes:o,highlights:s,pumAlignTop:P.pumAlignTop,preferTop:typeof t.preferTop=="boolean"?t.preferTop:!1,offsetX:t.offsetX||0,title:t.title||"",close:t.close?1:0,rounded:t.rounded?1:0,modes:t.modes||["n","i","ic","s"]};tbe||(typeof t.winblend=="number"&&(a.winblend=t.winblend),t.focusable!=null&&(a.focusable=t.focusable?1:0),t.shadow&&(a.shadow=1)),t.maxHeight&&(a.maxHeight=t.maxHeight),t.maxWidth&&(a.maxWidth=t.maxWidth),t.border===!0?a.border=[1,1,1,1]:Array.isArray(t.border)&&!t.border.every(f=>f==0)&&(a.border=t.border.slice(0,4),a.rounded=t.rounded?1:0),t.highlight&&(a.highlight=t.highlight),t.borderhighlight&&(a.borderhighlight=t.borderhighlight),t.cursorline&&(a.cursorline=1);let l=t.autoHide!==!1;l&&(a.autohide=1),this.unbind();let u=await this.nvim.call("coc#dialog#create_cursor_float",[this.winid,this._bufnr,r,a]);if(this.nvim.redrawVim(),!u||u.length==0||this.closeTs>i){let f=u&&u.length>0?u[2]:this.winid;f&&(this.winid=0,this.nvim.call("coc#float#close",[f],!0),this.nvim.redrawVim());return}let[c,h,d,g,p]=u;this.winid=d,this._bufnr=g,this.targetBufnr=c,this.cursor=h,this.bindEvents(l,p==1)}close(){let{winid:e,nvim:t}=this;this.closeTs=Date.now(),this.unbind(),e&&(this.winid=0,t.call("coc#float#close",[e],!0),t.redrawVim())}checkRetrigger(e){return!!(this.winid&&this
`)],!0)}async function PZ(n,e){if(e==="currline"){let i=await n.call("line",["."]);return ch.Range.create(i-1,0,i,0)}if(e==="cursor"){let[i,r]=await n.eval("coc#cursor#position()");return ch.Range.create(i,r,i,r)}let t=await n.call("coc#cursor#get_selection",[nbe.includes(e)?1:0]);return!t||t[0]==-1?null:ch.Range.create(t[0],t[1],t[2],t[3])}async function EZ(n,e,t){let{start:i,end:r}=e,[o,s]=await n.eval(`[getline(${i.line+1}),getline(${r.line+1})]`),a=o.length>0?Q(o.slice(0,i.character)):0,l,u,c=r.character==0;if(c){u=r.line==0?0:r.line-1;let h=await n.call("getline",[u+1]);l=Q(h)}else u=r.line,l=s.length>0?Q(s.slice(0,r.character)):0;n.pauseNotification(),n.command(`noa call cursor(${i.line+1},${a+1})`,!0),n.command("normal! v",!0),n.command(`noa call cursor(${u+1},${l})`,!0),c&&n.command("normal! $",!0),await n.resumeNotification(t)}var ch,ibe,nbe,fp=k(()=>{"use strict";ch=S(W());_e();oR();ibe=process.env.VIM_NODE_RPC=="1",nbe=["char","line","block"]});var RZ,CLe,mp,_Z=k(()=>{"use strict";RZ=S(W());fe();re();CLe=q()("model-dialog"),mp=class{constructor(e,t){this.nvim=e;this.config=t;this.disposables=[];this._onDidClose=new RZ.Emitter;this.onDidClose=this._onDidClose.event;P.on("BufWinLeave",i=>{i==this.bufnr&&(this.dispose(),t.callback&&t.callback(-1))},null,this.disposables),P.on("FloatBtnClick",(i,r)=>{if(i==this.bufnr){this.dispose();let o=t==null?void 0:t.buttons.filter(s=>s.disabled!=!0);t.callback&&t.callback(o[r].index)}},null,this.disposables)}get lines(){return[...this.config.content.split(/\r?\n/)]}async show(e){let{nvim:t}=this,{title:i,close:r,highlights:o,buttons:s}=this.config,a=this.config.borderhighlight||e.floatBorderHighlight,l=this.config.highlight||e.floatHighlight,u={maxwidth:e.maxWidth||80};i&&(u.title=i),(r||typeof r>"u")&&(u.close=1),e.maxHeight&&(u.maxHeight=e.maxHeight),e.maxWidth&&(u.maxWidth=e.maxWidth),l&&(u.highlight=l),o&&(u.highlights=o),a&&(u.borderhighlight=[a]),s&&(u.buttons=s.filter(h=>!h.disabled).map(h=>h.text)),e.rounded&&(u.rounded=1),Array.isArray(u.buttons)&&(u.getchar=1);let c=await t.call("coc#dialog#create_dialog",[this.lines,u]);if(!c)throw new Error("Unable to open dialog window.");this.bufnr=c[1],t.command("redraw",!0)}get winid(){return this.bufnr?this.nvim.call("bufwinid",[this.bufnr]):Promise.resolve(null)}dispose(){this._onDidClose.fire(),this.bufnr=void 0,U(this.disposables),this.disposables=[]}}});var Hi,Ta=k(()=>{"use strict";uh();_e();Hi=class{constructor(){this.lines=[];this._highlights=[]}addLine(e,t){if(e.includes(`
`)){for(let i of e.split(/\r?\n/))this.addLine(i,t);return}if(t&&this._highlights.push({lnum:this.lines.length,colStart:e.match(/^\s*/)[0].length,colEnd:Q(e),hlGroup:t}),e.includes("\x1B")){let i=lh(e);for(let r of i.highlights){let{span:o,hlGroup:s}=r;o[0]!=o[1]&&this._highlights.push({lnum:this.lines.length,colStart:o[0],colEnd:o[1],hlGroup:s})}this.lines.push(i.line)}else this.lines.push(e)}addLines(e){this.lines.push(...e)}addTexts(e){let t=this.lines.length,i="";for(let r of e){let o=Q(i);r.hlGroup&&this._highlights.push({lnum:t,colStart:o,colEnd:o+Q(r.text),hlGroup:r.hlGroup}),i+=r.text}this.lines.push(i)}addText(e,t){let{lines:i}=this,r=i[i.length-1]||"";if(e.includes(`
`)){let o=e.split(`
`);this.addText(o[0],t);for(let s of o.slice(1))this.addLine(s,t);return}if(t){let o=Q(r);this._highlights.push({lnum:i.length?i.length-1:0,colStart:o,colEnd:o+Q(e),hlGroup:t})}i.length?i[i.length-1]=`${r}${e}`:i.push(e)}get length(){return this.lines.length}getline(e){return this.lines[e]||""}get highlights(){return this._highlights}get content(){return this.lines.join(`
`)}render(e,t=0,i=-1){e.setLines(this.lines,{start:t,end:i,strictIndexing:!1},!0);for(let r of this._highlights)e.addHighlight({hlGroup:r.hlGroup,colStart:r.colStart,colEnd:r.colEnd==null?-1:r.colEnd,line:t+r.lnum,srcId:-1})}}});var aR,ILe,ka,lR=k(()=>{"use strict";aR=S(W());fe();re();et();ILe=q()("model-input"),ka=class{constructor(e,t){this.nvim=e;this.disposables=[];this.accepted=!1;this._dimension=[0,0,0,0];this._onDidFinish=new aR.Emitter;this._onDidChange=new aR.Emitter;this.onDidFinish=this._onDidFinish.event;this.onDidChange=this._onDidChange.event;this._input=t,this.disposables.push(this._onDidFinish),this.disposables.push(this._onDidChange);let i;Object.defineProperty(this,"title",{set:s=>{i=s,this._winid&&e.call("coc#dialog#change_title",[this._winid,s],!0)},get:()=>i});let r=!1;Object.defineProperty(this,"loading",{set:s=>{r=s,this._winid&&e.call("coc#dialog#change_loading",[this._winid,s],!0)},get:()=>r});let o;Object.defineProperty(this,"borderhighlight",{set:s=>{o=s,this._winid&&e.call("coc#dialog#change_border_hl",[this._winid,s],!0)},get:()=>o}),P.on("BufWinLeave",s=>{s==this._bufnr&&(this._winid=void 0,this.dispose())},null,this.disposables),P.on("PromptInsert",(s,a)=>{a==this._bufnr&&(this._input=s,this.accepted=!0,this.dispose())},null,this.disposables),P.on("TextChangedI",(s,a)=>{s==this._bufnr&&(this._input=a.line,this._onDidChange.fire(a.line))},null,this.disposables)}get dimension(){let{_dimension:e}=this;return{width:e[0],height:e[1],row:e[2],col:e[3]}}get bufnr(){return this._bufnr}get winid(){return this._winid}get value(){return this._input}async show(e,t){this.title=e,this.borderhighlight=t.borderhighlight??"CocFloating",this.loading=!1;let i=mB(t),r=await this.nvim.call("coc#dialog#create_prompt_win",[e,this._input,i]);if(!r)throw new Error("Unable to open input window");return this._bufnr=r[0],this._winid=r[1],this._dimension=r[2],!0}dispose(){this._onDidFinish.fire(this.accepted?this._input:null),this._winid&&this.nvim.call("coc#float#close",[this._winid],!0),this._winid=void 0,this._bufnr=void 0,U(this.disposables)}}});var uR,gs,Zw=k(()=>{"use strict";uR=process.env.VIM_NODE_RPC=="1",gs=class{constructor(e,t,i,r,o=0){this.nvim=e;this.winid=t;this.bufnr=i;this.linecount=r;this._currIndex=o}get currIndex(){return this._currIndex}get valid(){return this.nvim.call("coc#float#valid",[this.winid]).then(e=>!!e)}close(){this.nvim.call("coc#float#close",[this.winid],!0)}refreshScrollbar(){uR||this.nvim.call("coc#float#nvim_scrollbar",[this.winid],!0)}execute(e){this.nvim.call("coc#compat#execute",[this.winid,e],!0)}async scrollForward(){let{nvim:e,bufnr:t,winid:i}=this,o=await e.createBuffer(t).length,s;if(uR)s=await e.eval(`get(popup_getpos(${i}), 'lastline', 0)`);else{let a=await e.call("getwininfo",[i]);if(!a||!a.length)return;s=a[0].botline}s>=o||s==0||(e.pauseNotification(),this.setCursor(s-1),this.execute("silent! noa setl scrolloff=0"),this.execute(`normal! ${s}Gzt`),this.refreshScrollbar(),e.command("redraw",!0),e.resumeNotification(!1,!0))}async scrollBackward(){let{nvim:e,winid:t}=this,i;if(uR)i=await e.eval(`get(popup_getpos(${t}), 'firstline', 0)`);else{let r=await e.call("getwininfo",[t]);if(!r||!r.length)return;i=r[0].topline}i!=1&&(e.pauseNotification(),this.setCursor(i-1),this.execute(`normal! ${i}Gzb`),this.refreshScrollbar(),e.command("redraw",!0),e.resumeNotification(!1,!0))}setCursor(e,t=!1){let{nvim:i,bufnr:r,winid:o,linecount:s}=this;e<0?e=0:e>s-1&&(e=s-1),this._currIndex=e,i.call("coc#dialog#set_cursor",[o,r,e+1],!0),t&&(this.refreshScrollbar(),i.command("redraw",!0))}}});function Jw(n){return n?typeof n.text=="string":!1}var LZ,rbe,bp,IZ=k(()=>{"use strict";LZ=S(W());fe();re();_e();Zw();rbe=q()("model-menu");bp=class{constructor(e,t,i){this.nvim=e;this.config=t;this.currIndex=0;this.contentHeight=0;this.disposables=[];this.keyMappings=new Map;this.shortcutIndexes=new Set;this._disposed=!1;this._onDidClose=new LZ.Emitter;this.onDidClose=this._onDidClose.event;this.total=t.items.length,i&&i.onCancellationRequested(()=>{this._onDidClose.fire(-1),this.dispose()}),this.disposab
augroup coc_dynamic_autocmd
autocmd!
${i.join(`
`)}
augroup end`;if(this.nvim.hasFunction("nvim_exec"))this.nvim.exec(r,!1);else{let o=RR.default.join(process.env.TMPDIR||dJ.default.tmpdir(),`coc.nvim-${process.pid}`);ER.default.mkdirSync(o,{recursive:!0});let s=RR.default.join(o,`coc-${process.pid}.vim`);ER.default.writeFileSync(s,r,"utf8");let a=`source ${s}`;this.env.isCygwin&&us.isWindows&&(a=`execute "source" . substitute(system('cygpath ${s.replace(/\\/g,"/")}'), '\\n', '', 'g')`),this.nvim.command(a)}}dispose(){this.nvim.command("augroup coc_dynamic_autocmd| autocmd!|augroup end",!0),U(this.disposables)}}});var eu,Ip,fJ=k(()=>{"use strict";eu=S(W());Pe();fe();re();Ip=class{constructor(e){this.documents=e;this.disposables=[];this.providers=new Map;this._onDidProviderChange=new eu.Emitter;this.onDidProviderChange=this._onDidProviderChange.event}attach(e){this.nvim=e,P.on("BufReadCmd",this.onBufReadCmd,this,this.disposables)}get schemes(){return Array.from(this.providers.keys())}async onBufReadCmd(e,t){let i=this.providers.get(e);if(!i)return;let r=new eu.CancellationTokenSource,o=await Promise.resolve(i.provideTextDocumentContent(j.parse(t),r.token)),s=await this.nvim.buffer;await s.setLines(o.split(/\r?\n/),{start:0,end:-1,strictIndexing:!1}),process.nextTick(()=>{P.fire("BufCreate",[s.id])})}registerTextDocumentContentProvider(e,t){this.providers.set(e,t),this._onDidProviderChange.fire();let i=[];return t.onDidChange&&t.onDidChange(async r=>{let{buffer:o}=this.documents.getDocument(r.toString()),s=new eu.CancellationTokenSource,a=await Promise.resolve(t.provideTextDocumentContent(r,s.token));await o.setLines(a.split(/\r?\n/),{start:0,end:-1,strictIndexing:!1})},null,i),eu.Disposable.create(()=>{this.providers.delete(e),U(i),this._onDidProviderChange.fire()})}dispose(){U(this.disposables),this._onDidProviderChange.dispose(),this.providers.clear()}}});var yJ=y((rje,rx)=>{"use strict";rx.exports=Lbe;rx.exports.format=mJ;rx.exports.parse=bJ;var Ebe=/\B(?=(\d{3})+(?!\d))/g,Rbe=/(?:\.0*|(\.[^0]+)0+)$/,La={b:1,kb:1<<10,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},_be=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function Lbe(n,e){return typeof n=="string"?bJ(n):typeof n=="number"?mJ(n,e):null}function mJ(n,e){if(!Number.isFinite(n))return null;var t=Math.abs(n),i=e&&e.thousandsSeparator||"",r=e&&e.unitSeparator||"",o=e&&e.decimalPlaces!==void 0?e.decimalPlaces:2,s=Boolean(e&&e.fixedDecimals),a=e&&e.unit||"";(!a||!La[a.toLowerCase()])&&(t>=La.pb?a="PB":t>=La.tb?a="TB":t>=La.gb?a="GB":t>=La.mb?a="MB":t>=La.kb?a="KB":a="B");var l=n/La[a.toLowerCase()],u=l.toFixed(o);return s||(u=u.replace(Rbe,"$1")),i&&(u=u.replace(Ebe,i)),u+r+a}function bJ(n){if(typeof n=="number"&&!isNaN(n))return n;if(typeof n!="string")return null;var e=_be.exec(n),t,i="b";return e?(t=parseFloat(e[1]),i=e[4].toLowerCase()):(t=parseInt(n,10),i="b"),Math.floor(La[i]*t)}});var jp=y((oje,TJ)=>{var Io=-1,oo=1,Fn=0;function Fp(n,e,t,i){if(n===e)return n?[[Fn,n]]:[];if(t!=null){var r=Obe(n,e,t);if(r)return r}var o=LR(n,e),s=n.substring(0,o);n=n.substring(o),e=e.substring(o),o=IR(n,e);var a=n.substring(n.length-o);n=n.substring(0,n.length-o),e=e.substring(0,e.length-o);var l=Ibe(n,e);return s&&l.unshift([Fn,s]),a&&l.push([Fn,a]),wJ(l,i),l}function Ibe(n,e){var t;if(!n)return[[oo,e]];if(!e)return[[Io,n]];var i=n.length>e.length?n:e,r=n.length>e.length?e:n,o=i.indexOf(r);if(o!==-1)return t=[[oo,i.substring(0,o)],[Fn,r],[oo,i.substring(o+r.length)]],n.length>e.length&&(t[0][0]=t[2][0]=Io),t;if(r.length===1)return[[Io,n],[oo,e]];var s=jbe(n,e);if(s){var a=s[0],l=s[1],u=s[2],c=s[3],h=s[4],d=Fp(a,u),g=Fp(l,c);return d.concat([[Fn,h]],g)}return Fbe(n,e)}function Fbe(n,e){for(var t=n.length,i=e.length,r=Math.ceil((t+i)/2),o=r,s=2*r,a=new Array(s),l=new Array(s),u=0;u<s;u++)a[u]=-1,l[u]=-1;a[o+1]=0,l[o+1]=0;for(var c=t-i,h=c%2!==0,d=0,g=0,p=0,f=0,m=0;m<r;m++){for(var b=-m+d;b<=m-g;b+=2){var w=o+b,x;b===-m||b!==m&&a[w-1]<a[w+1]?x=a[w+1]:x=a[w-1]+1;for(var T=x-b;x<t&&T<i&&n.charAt(x)===e.charAt(T);)x++,T++;if(a[w]=x,x>t)g+=2;else if(T>i)d+=2;else if(h){var R=o+c-b;if(R>=0&&R<s&&l[R]!==-1){var F=t-l[R];if(
`)+`
`:"";if(!(d.length===0&&a===r-c))return un.replace(Be.create(a,0,r-c,0),d)}var sx,lje,FR=k(()=>{"use strict";sx=S(jp());Kn();_e();lje=q()("util-diff")});function RJ(n){let{start:e,end:t}=n.range;return n.newText.endsWith(`
`)&&e.line==t.line&&e.character==0&&t.character==0?e.line-1:e.line}function Ia(n){let{newText:e}=n,t=ax(n.range),i=t.end.line-t.start.line;return e.split(/\r?\n/).length-i-1}function ax(n){let 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 jR(n,e){if(n.length<=1)return n;let t=n.length/2|0,i=n.slice(0,t),r=n.slice(t);jR(i,e),jR(r,e);let o=0,s=0,a=0;for(;o<i.length&&s<r.length;)e(i[o],r[s])<=0?n[a++]=i[o++]:n[a++]=r[s++];for(;o<i.length;)n[a++]=i[o++];for(;s<r.length;)n[a++]=r[s++];return n}function MR(n){return jR(n,(e,t)=>{let i=e.range.start.line-t.range.start.line;return i===0?e.range.start.character-t.range.start.character:i})}function _J(n){let{changes:e,documentChanges:t}=n;return!(t&&t.length||e&&Object.keys(e).length)}function LJ(n,e){var i;let t=[];for(let r of n){let o=Mp(r);o&&!t.includes(o)&&((i=e[o])==null?void 0:i.needsConfirmation)&&t.push(o)}return t}function Mp(n){let e;return Sr.TextDocumentEdit.is(n)?Sr.AnnotatedTextEdit.is(n.edits[0])&&(e=n.edits[0].annotationId):e=n.annotationId,e}function IJ(n){if(n.documentChanges)return n.documentChanges;let e=[];if(n.changes)for(let[t,i]of Object.entries(n.changes))e.push({textDocument:{uri:t,version:null},edits:i});return e}function FJ(n,e){let t=[],i=n.end,r=i.line>0&&i.character==0,o;for(let s=0;s<e.length;s++){let a=e[s],{newText:l,range:u}=a,c=(n.lines[u.end.line]??"").length;if(u=eY(a.range,c),o){if(QW(o,u.start)&&Lt(u)&&l.length>0){let d=t[t.length-1];d.newText=l,o=void 0;continue}o=void 0}l.includes("\r")&&(l=l.replace(/\r\n/g,`
`));let h=Me(u.end,i);if(h>0&&(u.end={line:i.line,character:i.character}),n.getText(u)!==l){if(h===0&&r&&!Lt(u)&&l.endsWith(`
`)){l=l.slice(0,-1);let d=n.lines[i.line-1];u.end=Sr.Position.create(i.line-1,d.length)}else l.length==0&&(o=u.start);t.push({range:u,newText:l})}}return MR(t)}function jJ(n,e){if(e.length==1){let{start:s,end:a}=e[0].range,{lines:l}=n,u=l[s.line]??"",c=l[a.line]??"",h=u.substring(0,s.character)+e[0].newText+c.substring(a.character);return a.line>=l.length&&n.eol?h==""?[...l.slice(0,s.line)]:(h.endsWith(`
`)&&(h=h.slice(0,-1)),[...l.slice(0,s.line),...h.split(`
`)]):[...l.slice(0,s.line),...h.split(`
`),...l.slice(a.line+1)]}let t=n.getText(),i=0,r=[];for(let s of e){let a=n.offsetAt(s.range.start);if(a<i)throw new Error("Overlapping edit");a>i&&r.push(t.substring(i,a)),s.newText.length&&r.push(s.newText),i=n.offsetAt(s.range.end)}r.push(t.substring(i));let o=r.join("");if(o!==t)return DB(o,n.eol)}function MJ(n,e){return e.map(t=>{let{start:i,end:r}=t.range,o=n[i.line]??"",s=Q(o.slice(0,i.character)),a=r.line==i.line?o:n[r.line]??"",l=Q(a.slice(0,r.character)),{newText:u}=t;return[u.length>0?u.split(`
`):[],i.line,s,r.line,l]})}function lx(n,e){let{range:t,newText:i}=e;if(Me(t.end,n)<=0){let r=i.split(`
`),o=r.length-(t.end.line-t.start.line)-1,s=n.character;if(t.end.line==n.line){let a=r[r.length-1].length;r.length>1?s=a+s-t.end.character:s=t.start.character+a+s-t.end.character}return{line:o,character:s-n.character}}return{line:0,character:0}}function ux(n,e){let{line:t,character:i}=n,{range:r,newText:o}=e,{end:s}=r,a=o.split(`
`),l=a.length-(s.line-r.start.line)-1,u=r.end.line-n.line;if(u>0)return{line:t,character:i};if(u<0)return{line:t+l,character:i};if(a.length>1){let h=a[a.length-1].length;return{line:t+l,character:h+i-s.character}}let c=r.start.character-r.end.character;return{line:t+l,character:c+o.length+i}}function cx(n,e){let t=Sr.Position.create(n.line,n.character),i=!1;for(let r=e.length-1;r>=0;r--){let o=e[r];if(i){t.line+=Ia(o);continue}Me(o.range.end,t)>0||(o.range.end.line==t.line?t=ux(t,o):(i=!0,t.line+=Ia(o)))}return t}function OR(n,e){let t=0;for(let i of e){let r=ax(i.range);Me(r.end,n)<=0&&(t+=Ia(i))}return t}function OJ(n,e,t){let i=n[0].range.start,r=n[n.length-1].range.end,o=e.length-r.line,s=(e[r.line]??"").length-r.character,a=t.length-o,l=(t[a]??"").length-s,u=Abe(i,Sr.Position.create(a,l),t);return Sr.TextEdit.replace(Sr.Range.create(i,r),u)}function Abe(n,e,t){if(n.line===e.line)return(t[n.line]??"").slice(n.character,e.character);let i=[];for(let r=n.line;r<=e.line;r++){let o=t[r]??"";r===n.line?i.push(o.slice(n.character)):r===e.line?i.push(o.slice(0,e.character)):i.push(o)}return i.join(`
`)}var Sr,so=k(()=>{"use strict";Sr=S(W());xt();_e()});function AR(n){if(/^\d+$/.test(n))return parseInt(n,10);if(n.length>0)return n.charCodeAt(0)}function Hbe(n){let e=[],t=0,i=0,r=n.length;for(;t<r;t++){let o=n[t];if(t+1==r&&i!=r){e.push(n.slice(i,r));continue}if(o==","){let s=t-i;if(s==0)continue;if(s==1){let a=n[t-1];if(a=="^"||a==","){e.push(a==","?",":"^,"),i=t+1,a=="^"&&n[t+1]==","&&(t++,i++);continue}}e.push(n.slice(i,t)),i=t+1}}return e}var NJ,vje,Nbe,AJ,bh,yh,HJ=k(()=>{"use strict";NJ=S(W());re();nt();et();vje=q()("model-chars"),Nbe=[[257,893],[895,902],[904,1369],[1376,1416],[1418,1469],[1471,1471],[1473,1474],[1476,1522],[1525,1547],[1549,1562],[1564,1566],[1568,1641],[1646,1747],[1749,1791],[1806,2403],[2406,2415],[2417,3571],[3573,3662],[3664,3673],[3676,3843],[3859,3897],[3902,3972],[3974,4169],[4176,4346],[4348,4960],[4969,5740],[5743,5759],[5761,5786],[5789,5866],[5870,5940],[5943,6099],[6109,6143],[6155,8191],[10240,10495],[10649,10711],[10716,10747],[10750,11775],[11904,12287],[12321,12335],[12337,12348],[12350,64829],[64832,65071],[65132,65279],[65296,65305],[65313,65338],[65345,65370],[65382,65535]],AJ=65535;bh=class{constructor(e=[],t=!1){this.ranges=e;this.wordChars=t}clone(){return new bh(this.ranges.slice(),this.wordChars)}add(e,t){let i=0,r=0;if(t!=null&&t<e){let o=t;t=e,e=o}t=t??e;for(let o of this.ranges){let[s,a]=o;if(a<e){i++;continue}if(s>t)break;if(r++,s<e&&(e=s),a>t){t=a;break}}this.ranges.splice(i,r,[e,t])}exclude(e,t){if(t!=null&&t<e){let s=t;t=e,e=s}t=t??e;let i=0,r=0,o=[];for(let s of this.ranges){let[a,l]=s;if(l<e){i++;continue}if(a>t)break;if(r++,a<e&&o.push([a,e-1]),l>t){o.push([t+1,l]);break}}r==0&&o.length==0||this.ranges.splice(i,r,...o)}flatten(){return this.ranges.reduce((e,t)=>e.concat(t),[])}includes(e){return e>256&&this.wordChars?eE(e,Nbe):eE(e,this.ranges)}static fromKeywordOption(e){let t=new bh;for(let i of Hbe(e)){let r=i.length>1&&i.startsWith("^"),o=r?"exclude":"add";if(r&&(i=i.slice(1)),i==="@"&&!r)t.wordChars=!0,t[o](65,90),t[o](97,122),t[o](192,255);else if(i=="@-@")t[o]("@".charCodeAt(0));else if(i.length==1||/^\d+$/.test(i))t[o](AR(i));else if(i.includes("-")){let s=i.split("-",2),a=AR(s[0]),l=AR(s[1]);if(a===void 0||l===void 0)continue;t[o](a,l)}}return t}},yh=class{constructor(e){this.ranges=bh.fromKeywordOption(e)}addKeyword(e){this.ranges.add(e.codePointAt(0))}clone(){let e=new yh("");return e.ranges=this.ranges.clone(),e}isKeywordCode(e){return e===32||e>AJ?!1:this.ranges.includes(e)}isKeywordChar(e){let t=e.charCodeAt(0);return this.isKeywordCode(t)}isKeyword(e){for(let t=0,i=e.length;t<i;t++)if(!this.isKeywordChar(e[t]))return!1;return!0}matchLine(e,t=2,i=1024){let r=[],o=e.length;o>i&&(e=e.slice(0,i),o=i);let s=-1,a=0,l=u=>{if(u-s<t)return;let c=e.slice(s,u);r.includes(c)||r.push(c)};for(let u of e){let c=u.codePointAt(0);this.isKeywordCode(c)?s==-1&&(s=a):s!=-1&&(l(a),s=-1),c>AJ?a+=u.length:a++}return s!=-1&&l(o),r}async matchLines(e,t=2,i){let r=new Set,o=Date.now();for(let s of e){if(s.length===0)continue;let a="";Date.now()-o>15&&(await wr(),o=Date.now());for(let l of s){if(i&&i.isCancellationRequested)return;let u=l.codePointAt(0);this.isKeywordCode(u)?a=a+l:a.length>0&&(a.length>=t&&a.length<48&&r.add(a),a="")}a.length>=t&&a.length<48&&r.add(a)}return r}async computeWordRanges(e,t,i){let r=t.start.line,o=t.end.line,s={},a=Date.now();for(let l=r;l<=o;l++){let u=e[l];if(u===void 0)break;let c=l===r?t.start.character:0;if(l===r&&(u=u.slice(c)),l===o&&(u=u.slice(0,t.end.character-c)),Date.now()-a>15){if(i&&i.isCancellationRequested)break;await wr(),a=Date.now()}let h=-1,d=g=>{let p=u.slice(h,g),f=Qr(s,p)?s[p]:[];f.push(NJ.Range.create(l,h+c,l,g+c)),s[p]=f};for(let g=0,p=u.length;g<p;g++)this.isKeywordChar(u[g])?h==-1&&(h=g):h!=-1&&(d(g),h=-1),g===p-1&&h!=-1&&d(p)}return s}}});var NR,hx,qJ=k(()=>{"use strict";NR=S(W()),hx=class{constructor(e,t,i){this._line=e,this._text=t,this._isLastLine=i}get lineNumber(){return this._line}get text(){return this._text}get range(){return NR.Range.create(this._line,0,this._line,this._text.length)}get rangeIncludingLin
`)+(this.eol?`
`:"")),this._content}get length(){if(!this._content){let e=this.lines.reduce((t,i)=>t+i.length+1,0);return this.eol?e:e-1}return this._content.length}get end(){let e=this.lineCount-1;return this.eol?dx.Position.create(e,0):dx.Position.create(e,this.lines[e].length)}get lineCount(){return this.lines.length+(this.eol?1:0)}getText(e){if(e){let{start:t,end:i}=e;return t.line===i.line?t.character===i.character?"":(this.lines[t.line]??"").substring(t.character,i.character):this.content.substring(this.offsetAt(e.start),this.offsetAt(e.end))}return this.content}lineAt(e){let t=dx.Position.is(e)?e.line:e;if(typeof t!="number"||t<0||t>=this.lineCount||Math.floor(t)!==t)throw new Error("Illegal value for `line`");return new hx(t,this.lines[t]??"",t===this.lineCount-1)}positionAt(e){e=Math.max(Math.min(e,this.content.length),0);let t=this.getLineOffsets(),i=0,r=t.length;if(r===0)return{line:0,character:e};for(;i<r;){let s=Math.floor((i+r)/2);t[s]>e?r=s:i=s+1}let o=i-1;return{line:o,character:e-t[o]}}offsetAt(e){let t=this.getLineOffsets();if(e.line>=t.length)return this.content.length;if(e.line<0)return 0;let i=t[e.line],r=e.line+1<t.length?t[e.line+1]:this.content.length;return Math.max(Math.min(i+e.character,r),i)}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=qbe(this.lines,this.eol)),this._lineOffsets}}});function HR(n){P.fire("BufDetach",[n])}function wh(n){P.fire("LinesChanged",[n])}var qR,Dr,Hje,Op,WJ=k(()=>{"use strict";qR=S(Pn()),Dr=S(W());Pe();fe();FR();re();et();xt();_e();so();HJ();BJ();Hje=q()("model-document"),Op=class{constructor(e,t,i,r){this.buffer=e;this.env=t;this.nvim=i;this.isIgnored=!1;this.eol=!0;this._disposed=!1;this._attached=!1;this._notAttachReason="";this._previewwindow=!1;this._winid=-1;this.disposables=[];this.lines=[];this._onDocumentChange=new Dr.Emitter;this.onDocumentChange=this._onDocumentChange.event;this.fireContentChanges=(0,qR.default)(()=>{this._fireContentChanges()},150),this.fetchContent=(0,qR.default)(()=>{this._fetchContent()},100),this.init(r)}get content(){return this.syncLines.join(`
`)+(this.eol?`
`:"")}get attached(){return this._attached}get textDocument(){return this._textDocument}get syncLines(){return this._textDocument.lines}get version(){return this._textDocument.version}get bufnr(){return this.buffer.id}get bufname(){return this._bufname}get filetype(){return this._filetype}get uri(){return this._uri}get isCommandLine(){return this.uri&&this.uri.endsWith("%5BCommand%20Line%5D")}get enabled(){return this.getVar("enabled",!0)}get languageId(){let{_filetype:e}=this;return e.includes(".")?e.match(/(.*?)\./)[1]:e}get changedtick(){return this._changedtick}convertFiletype(e){switch(e){case"javascript.jsx":return"javascriptreact";case"typescript.jsx":case"typescript.tsx":return"typescriptreact";case"tex":return"latex";default:{let t=this.env.filetypeMap;return String(t[e]||e)}}}get schema(){return j.parse(this.uri).scheme}get lineCount(){return this.lines.length}get winid(){return this._winid}get previewwindow(){return this._previewwindow}init(e){let t=this.buftype=e.buftype;this._bufname=e.bufname,this._previewwindow=!!e.previewwindow,this._winid=e.winid,this.variables=e.variables||{},this._changedtick=e.changedtick,this.eol=e.eol==1,this._uri=dB(e.fullpath,this.bufnr,t,this.env.isCygwin),Array.isArray(e.lines)?(this.lines=e.lines,this._noFetch=!0,this._attached=!0,this.attach()):["","acwrite"].includes(t)?this.variables.coc_enabled===0?this._notAttachReason="b:coc_enabled = 0":this._notAttachReason=`buffer size ${e.size} exceed coc.preferences.maxFileSize`:this._notAttachReason=`not a normal buffer, buftype "${t}"`,this._filetype=this.convertFiletype(e.filetype),this.setIskeyword(e.iskeyword,e.lisp),this.createTextDocument(1,this.lines)}get notAttachReason(){return this._notAttachReason}attach(){if(this.env.isVim)return;let e=this.lines;this.buffer.attach(!0).then(t=>{t||HR(this.bufnr)},t=>{HR(this.bufnr)}),this.buffer.listen("lines",(t,i,r,o,s)=>{if(!(t.id!==this.bufnr||!this._attached||i==null)&&i>this._changedtick){if(this._changedtick=i,e=[...e.slice(0,r),...s,...o==-1?[]:e.slice(o)],e.length==0&&(e=[""]),this.lines=e,wh(t.id),P.pumvisible)return;this.fireContentChanges()}},this.disposables),this.buffer.listen("detach",()=>{HR(this.bufnr)},this.disposables)}get dirty(){return this.lines!==this.syncLines}get hasChanged(){return this.dirty?!ye(this.lines,this.syncLines):!1}_fireContentChanges(e){if(this.lines===this.syncLines)return;let t=this._textDocument,i=[];if(!e){let{cursor:s}=P,a;if(s&&s.bufnr==this.bufnr){let l=this.lines[s.lnum-1]??"";a=Dr.Position.create(s.lnum-1,Gi(l,s.col-1))}e=EJ(t.lines,this.lines,a,s?s.insert:!1)}let r;e?(r=t.getText(e.range),i.push({range:e.range,text:e.newText,rangeLength:r.length})):r="";let o=this.createTextDocument(this.version+(e?1:0),this.lines);this._onDocumentChange.fire(Object.freeze({bufnr:this.bufnr,original:r,originalLines:t.lines,textDocument:{version:o.version,uri:this.uri},contentChanges:i}))}async applyEdits(e,t=!1,i=!1){var m;if(Array.isArray(arguments[1])&&(e=arguments[1]),!this._attached||e.length===0)return;this._forceSync();let r=this.textDocument;if(e=FJ(r,e),e.length===0)return;let o=jJ(r,e);if(!o)return;let s=r.lines,a=kJ(s,o,RJ(e[0]));if(a.start===a.end&&a.replacement.length==0)return;let l=a.start===a.end&&a.start===s.length+(this.eol?0:1),u=s.slice(a.start,a.end),c=[];this.nvim.hasFunction("nvim_buf_set_text")&&e.length<200&&a.start!==a.end&&e[e.length-1].range.end.line<s.length+(this.eol?0:1)&&(c=MJ(s,e));let h,d=P.bufnr==this.bufnr,g;if(i&&d&&!l){let b=Dr.Position.is(i)?i:void 0;if(i===!0&&this.bufnr===((m=P.cursor)==null?void 0:m.bufnr)){let{col:w,lnum:x}=P.cursor;b=Dr.Position.create(x-1,Gi(this.lines[x-1],w-1))}if(b){let w=cx(b,e);if(Me(b,w)!==0){let x=o[w.line]??"",T=_t(x,w.character)+1;h=[w.line+1,T]}g=_t(this.lines[b.line],b.character)+1}}this.nvim.pauseNotification(),d&&t&&this.nvim.command("undojoin",!0),l?this.buffer.setLines(a.replacement,{start:-1,end:-1},!0):this.nvim.call("coc#ui#set_lines",[this.bufnr,this._changedtick,u,a.replacement,a.start,a.end,c,h,g],!0),this.nvim.resumeNotification(d,!0);let p=e.length==1?e[0]:OJ(e,s,o);await h
`)+(u.length>0?`
`:""))}async changeLines(e){let t=[],i=this.lines.slice();for(let[r,o]of e)i[r]!=o&&(t.push([r,o]),i[r]=o);!t.length||(this.nvim.call("coc#ui#change_lines",[this.bufnr,t],!0),this.nvim.redrawVim(),this.lines=i,wh(this.bufnr),this._forceSync())}_forceSync(){this.fireContentChanges.clear(),this._fireContentChanges()}forceSync(){}getOffset(e,t){return this.textDocument.offsetAt({line:e-1,character:t})}isWord(e){return this.chars.isKeyword(e)}getStartWord(e){let t=0;for(;t<e.length&&this.chars.isKeywordChar(e[t]);t++);return e.slice(0,t)}getWordRangeAtPosition(e,t,i=!0){let r=this.chars;if(t&&t.length){r=this.chars.clone();for(let u of t)r.addKeyword(u)}let o=this.getline(e.line,i),s=o[e.character];if(s==null||!r.isKeywordChar(s))return null;let a=e.character,l=e.character+1;for(;a>=0;){let u=o[a-1];if(!u||!r.isKeywordChar(u))break;a=a-1}for(;l<=o.length;){let u=o[l];if(!u||!r.isKeywordChar(u))break;l=l+1}return Dr.Range.create(e.line,a,e.line,l)}createTextDocument(e,t){let{uri:i,languageId:r,eol:o}=this;return this._textDocument=new vh(i,r,e,t,this.bufnr,o)}async _fetchContent(e){if(!this.env.isVim||!this._attached)return;let{nvim:t,bufnr:i,changedtick:r}=this,o=await t.call("coc#util#get_buf_lines",[i,r]);this._noFetch=!0,o?(this._changedtick=o.changedtick,this.lines=o.lines,wh(this.bufnr),e?this._forceSync():this.fireContentChanges()):e&&this._forceSync()}changeLine(e,t,i){if(this.lines[e-1]===void 0)return;let o=this.lines.slice();o[e-1]=t,this.lines=o,wh(this.bufnr),this._changedtick=i}async patchChange(e){if(!!this._attached)if(this.env.isVim)if(e){let t=await this.nvim.call("coc#util#get_changeinfo",[]);if(t.bufnr!==this.bufnr)return;if(t.changedtick<this._changedtick){this._forceSync();return}let{lnum:i,line:r,changedtick:o}=t,s=this.getline(i-1);if(this._changedtick=o,s==r)this._forceSync();else{let a=this.lines.slice();a[i-1]=r,this.lines=a,wh(this.bufnr),this._forceSync()}}else this.fetchContent.clear(),await this._fetchContent(!0);else this._changedtick=await this.buffer.getVar("changedtick"),this._forceSync()}getSymbolRanges(e){let{version:t,filetype:i,uri:r}=this,o=new vh(r,i,t,this.lines,this.bufnr,this.eol),s=[],a=o.getText(),l="";for(let u=0,c=a.length;u<c;u++){let h=a[u];if(h=="-"&&l.length==0)continue;let d=this.chars.isKeywordChar(h);d&&(l=l+h),l.length>0&&!d&&l==e&&s.push(Dr.Range.create(o.positionAt(u-l.length),o.positionAt(u))),d||(l="")}return s}fixStartcol(e,t){let i=this.getline(e.line);if(!i)return null;let{character:r}=e,o=i.slice(0,r),s=Q(o),{chars:a}=this;for(let l=o.length-1;l>=0;l--){let u=o[l];if(u==" "||!a.isKeywordChar(u)&&!t.includes(u))break;s=s-Q(u)}return s}addHighlights(e,t,i,r={}){let{start:o,end:s}=i;if(!Lt(i))for(let a=o.line;a<=s.line;a++){let l=this.getline(a,!1),u=a==o.line?_t(l,o.character):0,c=a==s.line?_t(l,s.character):global.Buffer.byteLength(l);u>=c||e.push(Object.assign({hlGroup:t,lnum:a,colStart:u,colEnd:c},r))}}getline(e,t=!0){return t?this.lines[e]||"":this.syncLines[e]||""}getLines(e,t){return this.lines.slice(e??0,t??this.lines.length)}getDocumentContent(){let e=this.lines.join(`
`);return this.eol?e+`
`:e}getVar(e,t){let i=this.variables[`coc_${e}`];return i===void 0?t:i}getPosition(e,t){let i=this.getline(e-1);if(!i||t==0)return{line:e-1,character:0};let r=tt(i,0,t-1);return{line:e-1,character:r.length}}getEndOffset(e,t,i){let r=0,o=this.lines.length;for(let s=e-1;s<o;s++){let a=this.lines[s],l=a.length;if(s==e-1&&l!=0){let u=global.Buffer.from(a,"utf8");u.byteLength<=t-1||(r=r+u.slice(t-1,u.length).toString("utf8").length,i||(r=r-1))}else r=r+l;if(!this.eol&&s==o-1)break;r=r+1}return r}setFiletype(e){this._filetype=this.convertFiletype(e);let t=this._textDocument.lines;this._textDocument=new vh(this.uri,this.languageId,1,t,this.bufnr,this.eol)}setIskeyword(e,t){let i=this.chars=new yh(e),r=this.getVar("additional_keywords",[]);if(t&&i.addKeyword("-"),r&&Array.isArray(r))for(let o of r)i.addKeyword(o)}detach(){this._disposed||(U(this.disposables),this._disposed=!0,this._attached=!1,this.lines=[],this.fetchContent.clear(),this.fireContentChanges.clear(),this._onDocumentChange.dispose())}async synchronize(){if(!this.attached)return;let{changedtick:e}=this;await this.patchChange(),e!=this.changedtick&&await Nt(50)}onTextChange(e,t){if(e==="TextChanged"||e==="TextChangedI"&&!t.insertChar||!this._noFetch){this._noFetch=!1,this.fetchContent();return}let{line:i,changedtick:r,lnum:o}=t;r!==this.changedtick&&(this.changeLine(o,i,r),e!=="TextChangedP"&&this._forceSync())}}});var YJ,BR,WR,ms,jn,Ap,Np,ZJ=k(()=>{"use strict";YJ=S(yJ()),BR=S(require("fs")),WR=S(require("os")),ms=S(require("path")),jn=S(W());Pe();fe();WJ();re();$e();_e();Ap=q()("core-documents"),Np=class{constructor(e,t){this.configurations=e;this.workspaceFolder=t;this._initialized=!1;this._attached=!1;this._currentResolve=!1;this.disposables=[];this.creating=new Map;this.buffers=new Map;this.winids=new Set;this.resolves=[];this._onDidOpenTextDocument=new jn.Emitter;this._onDidCloseDocument=new jn.Emitter;this._onDidChangeDocument=new jn.Emitter;this._onDidSaveDocument=new jn.Emitter;this._onWillSaveDocument=new jn.Emitter;this.onDidOpenTextDocument=this._onDidOpenTextDocument.event;this.onDidCloseDocument=this._onDidCloseDocument.event;this.onDidChangeDocument=this._onDidChangeDocument.event;this.onDidSaveTextDocument=this._onDidSaveDocument.event;this.onWillSaveTextDocument=this._onWillSaveDocument.event;this._cwd=process.cwd(),this.config={willSaveHandlerTimeout:500,maxFileSize:2097152}}async attach(e,t){if(this._attached)return;this.nvim=e,this._env=t,this._attached=!0,this.getConfiguration(),this.configurations.onDidChange(this.getConfiguration,this,this.disposables);let{bufnrs:i,winid:r,bufnr:o,winids:s}=await this.nvim.call("coc#util#all_state");this.winids=new Set(s),this._bufnr=o,await Promise.all(i.map(l=>this.createDocument(l))),P.on("BufDetach",this.onBufDetach,this,this.disposables),P.on("VimLeavePre",()=>{this.resolveCurrent(void 0)},null,this.disposables),P.on("WinEnter",l=>{this.winids.add(l)},null,this.disposables),P.on("WinClosed",l=>{this.winids.delete(l)},null,this.disposables),P.on("BufWinEnter",(l,u)=>{this.winids.add(u)},null,this.disposables),P.on("DirChanged",l=>{this._cwd=l},null,this.disposables),P.on("CursorHold",async()=>{let{bufnrs:l,winids:u}=await this.nvim.call("coc#util#all_state"),c=[];for(let h of this.buffers.keys())l.includes(h)||c.push(async()=>{await P.fire("BufUnload",[h])});for(let h of this.winids)u.includes(h)||c.push(async()=>{await P.fire("WinClosed",[h])});this.winids=new Set(u),await Promise.allSettled(c.map(h=>h()))},null,this.disposables);let a=l=>{this._bufnr=l,this.createDocument(l)};P.on("CursorMoved",a,null,this.disposables),P.on("CursorMovedI",a,null,this.disposables),P.on("BufUnload",this.onBufUnload,this,this.disposables),P.on("BufEnter",this.onBufEnter,this,this.disposables),P.on("BufCreate",this.onBufCreate,this,this.disposables),P.on("TermOpen",this.onBufCreate,this,this.disposables),P.on("BufWritePost",this.onBufWritePost,this,this.disposables),P.on("BufWritePre",this.onBufWritePre,this,this.disposables),P.on("FileType",this.onFileTypeChange,this,this.disposables),P.fire("BufEnter",[o]),P.fire("BufWinEn
`)+`
`}reset(){this.creating.clear();for(let e of this.buffers.keys())this.onBufUnload(e);this.buffers.clear(),this._root=process.cwd()}dispose(){for(let e of this.buffers.keys())this.onBufUnload(e);this._attached=!1,this.buffers.clear(),U(this.disposables)}}});var Hp,JJ,qp,$J=k(()=>{"use strict";Hp=S(W());fe();xe();JJ=q()("core-editors"),qp=class{constructor(e){this.documents=e;this.disposables=[];this.editors=new Map;this._onDidChangeActiveTextEditor=new Hp.Emitter;this._onDidChangeVisibleTextEditors=new Hp.Emitter;this.onDidChangeActiveTextEditor=this._onDidChangeActiveTextEditor.event;this.onDidChangeVisibleTextEditors=this._onDidChangeVisibleTextEditors.event}get activeTextEditor(){return this.editors.get(this.winid)}get visibleTextEditors(){return Array.from(this.editors.values())}onChange(e){let t=`${e.winid}-${e.document.bufnr}-${e.document.uri}`;t!=this.previousId&&(this.previousId=t,this._onDidChangeActiveTextEditor.fire(e))}async attach(e){this.nvim=e;let{documents:t}=this,i=t.getDocument(t.bufnr);i&&i.winid>0&&(this.winid=i.winid,await this.createTextEditor(this.winid)),P.on("WinEnter",r=>{this.winid=r;let o=this.editors.get(r);o&&this.onChange(o)},null,this.disposables),P.on("CursorHold",async()=>{let[r,o,s]=await e.eval("[win_getid(),&buftype,coc#window#is_float(win_getid())]"),a=!1;!s&&["","acwrite"].includes(o)&&!this.editors.has(r)&&await this.createTextEditor(r)&&(a=!0),a&&this._onDidChangeVisibleTextEditors.fire(this.visibleTextEditors)},null,this.disposables),P.on("WinClosed",r=>{this.editors.has(r)&&(this.editors.delete(r),this._onDidChangeVisibleTextEditors.fire(this.visibleTextEditors))},null,this.disposables),P.on("BufWinEnter",async(r,o)=>{this.winid=o,await this.createTextEditor(o,!0)},null,this.disposables)}async createTextEditor(e,t=!1){let{documents:i,nvim:r}=this,o=await r.call("coc#util#get_editoroption",[e]);if(!o)return!1;let s=!1;if(t)for(let l of this.editors.keys())o.winids.includes(l)||(s=!0,this.editors.delete(l));let a=i.getDocument(o.bufnr);if(a){let l=this.fromOptions(o,a);return this.editors.set(e,l),e==this.winid&&this.onChange(l),this._onDidChangeVisibleTextEditors.fire(this.visibleTextEditors),JJ.debug("editor created winid & bufnr & tabnr: ",e,o.bufnr,o.tabpagenr),!0}else s&&this._onDidChangeVisibleTextEditors.fire(this.visibleTextEditors);return JJ.error(`document not found for window: ${e}`),!1}fromOptions(e,t){let{visibleRanges:i}=e,r=D.getTabId(e.tabpagenr);return{get tabpagenr(){return D.getTabNumber(r)},winid:e.winid,winnr:e.winnr,document:t,visibleRanges:i.map(o=>Hp.Range.create(o[0]-1,0,o[1],0)),options:{tabSize:e.tabSize,insertSpaces:!!e.insertSpaces}}}}});function Wbe(n,e){if(typeof n.lnum!="number")return;let t=n.lnum;if(e){let i=MR(e.edits);t=cx(Mt.create(t-1,0),i).line+1}return t}function Ybe(n,e){var i;let t=new Map;for(let r of n){let o=Mp(r)??null,s=o?(i=e[o])==null?void 0:i.label:null,a=t.get(s);a?a.push(r):t.set(s,[r])}return t}var gx,px,dMe,Bbe,Bp,UJ=k(()=>{"use strict";gx=S(jp()),px=S(require("path"));Kn();Pe();fe();re();$e();so();Ta();dMe=q()("model-editInspect"),Bbe=0,Bp=class{constructor(e,t){this.nvim=e;this.keymaps=t;this.disposables=[];this.items=[];this.renameMap=new Map;P.on("BufUnload",i=>{i==this.bufnr&&this.dispose()},null,this.disposables)}addFile(e,t,i){this.items.push({index:t.length,filepath:e,lnum:i})}async show(e){let{nvim:t}=this,i=Bbe++;t.pauseNotification(),t.command(`tabe +setl\\ buftype=nofile CocWorkspaceEdit${i}`,!0),t.command("setl bufhidden=wipe nolist",!0),t.command("setl nobuflisted wrap undolevels=-1 filetype=cocedits noswapfile",!0),await t.resumeNotification(!0);let r=await t.buffer,o=await t.call("getcwd");this.bufnr=r.id;let s=c=>{let h=j.parse(c).fsPath;return Ye(o,h,!0)?px.default.relative(o,h):h},a=c=>px.default.isAbsolute(c)?c:px.default.join(o,c),l=new Hi,u=Ybe(e.edit.documentChanges??[],e.edit.changeAnnotations??{});for(let[c,h]of u.entries()){c&&(l.addLine(c,"MoreMsg"),l.addLine(""));for(let d of h)if(ua.is(d)){let g=e.changes[d.textDocument.uri],p=s(d.textDocument.uri);l.addTexts([{text:"Change",hlGroup:"Title"},{text:"
`),t.newLines.join(`
`));for(let s=0;s<o.length;s++){let a=o[s];if(a[0]==gx.default.EQUAL){let l=a[1];if(!l.includes(`
`))e.addText(l);else{let u=l.split(`
`);e.addText(u[0]);let c=r+u.length-1;e.addLine(""),e.addTexts([{text:"Change",hlGroup:"Title"},{text:" "},{text:i,hlGroup:"Directory"},{text:`:${c}`,hlGroup:"LineNr"}]),this.addFile(i,e,c),e.addLine("");let h=u[u.length-1];h.length>0&&e.addText(h)}r+=l.split(`
`).length-1}else a[0]==gx.default.DELETE?(r+=a[1].split(`
`).length-1,e.addText(a[1],"DiffDelete")):e.addText(a[1],"DiffAdd")}}dispose(){U(this.disposables)}}});function Jbe(n,e,t){let i=er.default.join(n,e);if(typeof t!="string"){let r=t.baseUri.fsPath;if(!Ye(r,i))return!1;let o=er.default.relative(r,i);return(0,YR.default)(o,t.pattern,{dot:!0})}return(0,YR.default)(e,t,{dot:!0})}function fx(n){return j.parse(n).fsPath}var XJ,Ht,GJ,YR,zJ,er,KJ,It,Zbe,Wp,QJ=k(()=>{"use strict";XJ=S(require("crypto")),Ht=S(require("fs")),GJ=S(vw()),YR=S(Lo()),zJ=S(require("os")),er=S(require("path")),KJ=require("util"),It=S(W());Pe();fe();UJ();xr();$e();_e();so();fp();Zbe=q()("core-files"),Wp=class{constructor(e,t,i,r){this.documents=e;this.configurations=t;this.workspaceFolderControl=i;this.keymaps=r;this.operationTimeout=500;this._onDidCreateFiles=new It.Emitter;this._onDidRenameFiles=new It.Emitter;this._onDidDeleteFiles=new It.Emitter;this._onWillCreateFiles=new It.Emitter;this._onWillRenameFiles=new It.Emitter;this._onWillDeleteFiles=new It.Emitter;this.onDidCreateFiles=this._onDidCreateFiles.event;this.onDidRenameFiles=this._onDidRenameFiles.event;this.onDidDeleteFiles=this._onDidDeleteFiles.event;this.onWillCreateFiles=this._onWillCreateFiles.event;this.onWillRenameFiles=this._onWillRenameFiles.event;this.onWillDeleteFiles=this._onWillDeleteFiles.event}attach(e,t,i){this.nvim=e,this.env=t,this.window=i}async openTextDocument(e){e=typeof e=="string"?j.file(e):e;let t=this.documents.getDocument(e.toString());if(t)return await this.jumpTo(e.toString(),null,"drop"),t;let i=e.scheme;if(i=="file"){if(!Ht.default.existsSync(e.fsPath))throw uw(e.fsPath);Ht.default.accessSync(e.fsPath,Ht.default.constants.R_OK)}return i=="untitled"?(await this.nvim.call("coc#util#open_file",["tab drop",e.path]),await this.documents.document):await this.loadResource(e.toString())}async jumpTo(e,t,i){let r=this.configurations.getConfiguration("coc.preferences"),o=i||r.get("jumpCommand","edit"),{nvim:s}=this,a=this.documents.getDocument(e),l=a?a.bufnr:-1;if(l!=-1&&o=="edit"){if(s.pauseNotification(),s.command("silent! normal! m'",!0),s.command(`buffer ${l}`,!0),s.command("if &filetype ==# '' | filetype detect | endif",!0),t){let u=a.getline(t.line),c=Q(u.slice(0,t.character))+1;s.call("cursor",[t.line+1,c],!0)}await s.resumeNotification(!0)}else{let{fsPath:u,scheme:c}=j.parse(e),h=t==null?null:[t.line,t.character];if(c=="file"){let d=In(u);await this.nvim.call("coc#util#jump",[o,d,h])}else await this.nvim.call("coc#util#jump",[o,e,h])}}async openResource(e){let{nvim:t}=this,i=j.parse(e);if(/^https?/.test(i.scheme)){await t.call("coc#ui#open_url",e);return}let r=await t.getOption("wildignore");await t.setOption("wildignore",""),await this.jumpTo(e),await t.setOption("wildignore",r)}async loadResource(e,t){let i=this.documents.getDocument(e);if(i)return i;t||(t=this.configurations.getConfiguration("workspace").get("openResourceCommand","tab drop"));let r=j.parse(e),o=r.scheme==="file"?r.fsPath:e,s;if(t){let a=await this.nvim.call("win_getid");s=await this.nvim.call("coc#util#open_file",[t,o]),await this.nvim.call("win_gotoid",[a])}else s=(await this.nvim.call("coc#ui#open_files",[[o]]))[0];return await this.documents.createDocument(s)}async loadResources(e){let{documents:t}=this,i=e.map(o=>{let s=j.parse(o);return s.scheme=="file"?s.fsPath:o}),r=await this.nvim.call("coc#ui#open_files",[i]);return await Promise.all(r.map(o=>t.createDocument(o)))}async createFile(e,t={},i){let{nvim:r}=this,o=Ht.default.existsSync(e);if(o&&!t.overwrite&&!t.ignoreIfExists)throw z0(e);if(!o||t.overwrite){let s=new It.CancellationTokenSource;await this.fireWaitUntilEvent(this._onWillCreateFiles,{files:[j.file(e)],token:s.token},i),s.cancel();let a=er.default.dirname(e);if(!Ht.default.existsSync(a)){let c,h=a;for(;![".","/",er.default.parse(a).root].includes(h);){if(Ht.default.existsSync(er.default.dirname(h))){c=h;break}h=er.default.dirname(h)}Ht.default.mkdirSync(a,{recursive:!0}),i&&i.push(()=>{Ht.default.rmSync(c,{force:!0,recursive:!0})})}Ht.default.writeFileSync(e,"","utf8"),i&&i.push(async()=>{Ht.default.rmSync(e,{force:!0,recursive:
`)?w.slice(0,-1).split(`
`):w.split(`
`)},r.push(async()=>{let T=this.documents.getDocument(p);!T||!T.attached||T.version!==b||(await T.applyEdits([m]),d.version=T.version)})}}else It.CreateFile.is(h)?await this.createFile(fx(h.uri),h.options,r):It.DeleteFile.is(h)?await this.deleteFile(fx(h.uri),h.options,r):It.RenameFile.is(h)&&await this.renameFile(fx(h.oldUri),fx(h.newUri),h.options,r);if(r.length===0)return!0;t||(this.editState={edit:{documentChanges:i,changeAnnotations:e.changeAnnotations},changes:u,recovers:r,applied:!0}),this.nvim.redrawVim()}catch(s){return Zbe.error("Error on applyEdits:",e,s),await this.undoChanges(r),t||this.window.showErrorMessage(`Error on applyEdits: ${s}`),!1}return t||o||this.window.showInformationMessage("Use ':wa' to save changes or ':CocCommand workspace.inspectEdit' to inspect."),!0}async undoChanges(e){for(;e.length>0;){let t=e.pop();await Promise.resolve(t())}}async inspectEdit(){if(!this.editState){this.window.showWarningMessage("No workspace edit to inspect");return}await new Bp(this.nvim,this.keymaps).show(this.editState)}async undoWorkspaceEdit(){let{editState:e}=this;if(!e||!e.applied){this.window.showWarningMessage("No workspace edit to undo");return}e.applied=!1,await this.undoChanges(e.recovers)}async redoWorkspaceEdit(){let{editState:e}=this;if(!e||e.applied){this.window.showWarningMessage("No workspace edit to redo");return}this.editState=void 0,await this.applyEdit(e.edit)}validateChanges(e){let{documents:t}=this;for(let i of e)if(It.TextDocumentEdit.is(i)){let{uri:r,version:o}=i.textDocument,s=t.getDocument(r);if(typeof o=="number"&&o>0){if(!s)throw new Error(`File ${r} not loaded`);if(s.version!=o)throw new Error(`${r} changed before apply edit`)}else if(!s&&!op(r))throw cw(j.parse(r).scheme)}else if(It.CreateFile.is(i)||It.DeleteFile.is(i)){if(!op(i.uri))throw cw(j.parse(i.uri).scheme)}else if(It.RenameFile.is(i)&&(!op(i.oldUri)||!op(i.newUri)))throw cw(j.parse(i.oldUri).scheme)}async findFiles(e,t,i,r){let o=this.workspaceFolderControl.workspaceFolders;if((r==null?void 0:r.isCancellationRequested)||!o.length||i===0)return[];i=i??1/0;let s=o.map(u=>j.parse(u.uri).fsPath);if(typeof e!="string"){let u=e.baseUri.fsPath;s=s.filter(c=>Ye(u,c,!0))}let a=typeof e=="string"?e:e.pattern,l=[];for(let u of s){if(l.length>=i)break;let c=await(0,KJ.promisify)(GJ.default)(a,{dot:!0,cwd:u,nodir:!0,absolute:!1});if(r!=null&&r.isCancellationRequested)return[];for(let h of c)if(!(t&&Jbe(u,h,t))&&(l.push(j.file(er.default.join(u,h))),l.length===i))break}return l}async fireWaitUntilEvent(e,t,i){let r=!0,o=[];e.fire({...t,waitUntil:s=>{if(!r)throw fB("waitUntil");let a=new Promise(u=>{setTimeout(u,this.operationTimeout)}),l=Promise.race([s,a]).then(u=>{if(u&&It.WorkspaceEdit.is(u))return this.applyEdit(u,!0)});o.push(l)}}),r=!1,await Promise.all(o)}}});var t$=y((RMe,e$)=>{var ZR=4294967296,VJ=[];for(xh=0;xh<256;xh++)VJ[xh]=(xh>15?"":"0")+xh.toString(16);var xh,Yp=e$.exports=function(n,e){n instanceof Buffer?(this.buffer=n,this.offset=e||0):Object.prototype.toString.call(n)=="[object Uint8Array]"?(this.buffer=new Buffer(n),this.offset=e||0):(this.buffer=this.buffer||new Buffer(8),this.offset=0,this.setValue.apply(this,arguments))};Yp.MAX_INT=Math.pow(2,53);Yp.MIN_INT=-Math.pow(2,53);Yp.prototype={constructor:Yp,_2scomp:function(){for(var n=this.buffer,e=this.offset,t=1,i=e+7;i>=e;i--){var r=(n[i]^255)+t;n[i]=r&255,t=r>>8}},setValue:function(n,e){var t=!1;if(arguments.length==1)if(typeof n=="number"){if(t=n<0,n=Math.abs(n),e=n%ZR,n=n/ZR,n>ZR)throw new RangeError(n+" is outside Int64 range");n=n|0}else if(typeof n=="string")n=(n+"").replace(/^0x/,""),e=n.substr(-8),n=n.length>8?n.substr(0,n.length-8):"",n=parseInt(n,16),e=parseInt(e,16);else throw new Error(n+" must be a Number or String");for(var i=this.buffer,r=this.offset,o=7;o>=0;o--)i[r+o]=e&255,e=o==4?n:e>>>8;t&&this._2scomp()},toNumber:function(n){for(var e=this.buffer,t=this.offset,i=e[t]&128,r=0,o=1,s=7,a=1;s>=0;s--,a*=256){var l=e[t+s];i&&(l=(l^255)+o,o=l>>8,l=l&255),r+=l*a}return!n&&r>=Yp.MAX_INT?i?-1/0:1/0:i?-r:r},valueOf:function(){return this.toNumber(!1)},toStrin
`)),e[e.length-1]==""&&(e=e.slice(0,-1)),Ai(e)}catch{return[]}}loadSync(){if(!au.default.existsSync(this.file))return[];try{let e=au.default.readFileSync(this.file,"utf8");return e=e.trim(),e.length?e.trim().split(`
`):[]}catch{return[]}}async add(e){let t;try{t=au.default.readFileSync(this.file),t[0]===239&&t[1]===187&&t[2]===191&&(t=t.slice(3)),t=Buffer.concat([Buffer.from(e,"utf8"),new Uint8Array([10]),t])}catch{t=Buffer.concat([Buffer.from(e,"utf8"),new Uint8Array([10])])}await(0,T_.promisify)(au.default.writeFile)(this.file,t)}async remove(e){let t=await this.load(),i=t.length;t=t.filter(r=>r!=e),t.length!=i&&await rp(this.file,t.join(`
`))}async clean(){try{await(0,T_.promisify)(au.default.unlink)(this.file)}catch{}}}});var Hx,ff,AX=k(()=>{"use strict";Hx=S(W());fe();re();ff=class{constructor(e,t){this.nvim=e;this.id=t;this.disposables=[];this._onExit=new Hx.Emitter;this._onStderr=new Hx.Emitter;this._onStdout=new Hx.Emitter;this.onExit=this._onExit.event;this.onStdout=this._onStdout.event;this.onStderr=this._onStderr.event;P.on("TaskExit",(i,r)=>{i==this.id&&this._onExit.fire(r)},null,this.disposables),P.on("TaskStderr",(i,r)=>{i==this.id&&this._onStderr.fire(r)},null,this.disposables),P.on("TaskStdout",(i,r)=>{i==this.id&&this._onStdout.fire(r)},null,this.disposables)}async start(e){let{nvim:t}=this;return await t.call("coc#task#start",[this.id,e])}async stop(){let{nvim:e}=this;await e.call("coc#task#stop",[this.id])}get running(){let{nvim:e}=this;return e.call("coc#task#running",[this.id])}dispose(){let{nvim:e}=this;e.call("coc#task#stop",[this.id],!0),this._onStdout.dispose(),this._onStderr.dispose(),this._onExit.dispose(),U(this.disposables)}}});var qX,Lh,NX,HX,fwe,k_,v,ie=k(()=>{"use strict";qX=S(require("os")),Lh=S(require("path"));Pe();wR();uJ();hJ();pJ();jw();fJ();ZJ();$J();QJ();C$();EX();RX();fp();_X();LX();fe();IX();FX();S_();Nx();dR();AX();re();NX=32,HX=q()("workspace"),fwe=["showMessage","runTerminalCommand","openTerminal","showQuickpick","menuPick","openLocalConfig","showPrompt","createStatusBarItem","createOutputChannel","showOutputChannel","requestInput","echoLines","getCursorPosition","moveTo","getOffset","getSelectedRange","selectRange","createTerminal"],k_=class{constructor(){this.version=Kw;let e=Lh.default.normalize(process.env.COC_VIMCONFIG)??Lh.default.join(qX.default.homedir(),".vim"),t=Lh.default.join(e,Uc);this.configurations=new Ep(t,new _p(this)),this.workspaceFolderControl=new df(this.configurations);let i=this.documentsManager=new Np(this.configurations,this.workspaceFolderControl);this.contentProvider=new Ip(i),this.watchers=new uf,this.autocmds=new Lp(this.contentProvider,this.watchers),this.keymaps=new lf(i),this.files=new Wp(i,this.configurations,this.workspaceFolderControl,this.keymaps),this.editors=new qp(i),this.onDidRuntimePathChange=this.watchers.onDidRuntimePathChange,this.onDidChangeWorkspaceFolders=this.workspaceFolderControl.onDidChangeWorkspaceFolders,this.onDidChangeConfiguration=this.configurations.onDidChange,this.onDidOpenTextDocument=i.onDidOpenTextDocument,this.onDidChangeTextDocument=i.onDidChangeDocument,this.onDidCloseTextDocument=i.onDidCloseDocument,this.onDidSaveTextDocument=i.onDidSaveTextDocument,this.onWillSaveTextDocument=i.onWillSaveTextDocument,this.onDidCreateFiles=this.files.onDidCreateFiles,this.onDidRenameFiles=this.files.onDidRenameFiles,this.onDidDeleteFiles=this.files.onDidDeleteFiles,this.onWillCreateFiles=this.files.onWillCreateFiles,this.onWillRenameFiles=this.files.onWillRenameFiles,this.onWillDeleteFiles=this.files.onWillDeleteFiles;let r=this.getWatchmanPath();this.fileSystemWatchers=new Sh(this.workspaceFolderControl,r)}async init(e){let{nvim:t}=this;for(let s of fwe)Object.defineProperty(this,s,{get:()=>(...a)=>{let l=`
`+Error().stack.split(`
`).slice(2,4).join(`
`);return HX.warn(`workspace.${s} is deprecated, please use window.${s} instead.`,l),e[s].apply(e,a)}});for(let s of["onDidOpenTerminal","onDidCloseTerminal"])Object.defineProperty(this,s,{get:()=>{let a=`
`+Error().stack.split(`
`).slice(2,4).join(`
`);return HX.warn(`workspace.${s} is deprecated, please use window.${s} instead.`,a),e[s]}});let i=[],r;i.push(t.call("coc#util#vim_info").then(s=>{r=this._env=s})),i.push(OX().then(s=>{this.fuzzyExports=s})),i.push(Ea.create().then(s=>{this.strWdith=s})),await Promise.all(i),this.strWdith.setAmbw(!r.ambiguousIsNarrow),e.init(r),this.checkVersion(NX),this.workspaceFolderControl.setWorkspaceFolders(this._env.workspaceFolders),this.configurations.updateMemoryConfig(this._env.config),this.files.attach(t,r,e),this.contentProvider.attach(t),this.keymaps.attach(t),this.autocmds.attach(t,r),this.watchers.attach(t,r),await this.attach(),await this.editors.attach(t);let o=hs.create("watchman",t);this.fileSystemWatchers.attach(o)}checkVersion(e){this._env.apiversion!=e&&this.nvim.echoError(`API version ${this._env.apiversion} is not ${NX}, please build coc.nvim by 'yarn install' after pull source code.`)}getDisplayWidth(e,t=!1){return this.strWdith.getWidth(e,t)}get cwd(){return this.documentsManager.cwd}get env(){return this._env}get root(){return this.documentsManager.root||this.cwd}get rootPath(){return this.root}get bufnr(){return this.documentsManager.bufnr}get insertMode(){return P.insertMode}get floatSupported(){return!0}get uri(){return this.documentsManager.uri}get workspaceFolder(){return this.workspaceFolders[0]}get textDocuments(){return this.documentsManager.textDocuments}get documents(){return this.documentsManager.documents}get document(){return this.documentsManager.document}get workspaceFolders(){return this.workspaceFolderControl.workspaceFolders}checkPatterns(e,t){return this.workspaceFolderControl.checkPatterns(t??this.workspaceFolderControl.workspaceFolders,e)}get folderPaths(){return this.workspaceFolders.map(e=>j.parse(e.uri).fsPath)}get channelNames(){return hs.names}get pluginRoot(){return Lh.default.dirname(__dirname)}get isVim(){return this._env.isVim}get isNvim(){return!this._env.isVim}get completeOpt(){return""}get filetypes(){return this.documentsManager.filetypes}get languageIds(){return this.documentsManager.languageIds}createNameSpace(e){return DX(e)}has(e){return SX(this.env,e)}registerAutocmd(e){return this.autocmds.registerAutocmd(e)}watchOption(e,t,i){this.watchers.watchOption(e,t,i)}watchGlobal(e,t,i){this.watchers.watchGlobal(e,t||function(){},i)}match(e,t){return v_(e,t.uri,t.languageId)}createFileSystemWatcher(e,t,i,r){return this.fileSystemWatchers.createFileSystemWatcher(e,t,i,r)}createFuzzyMatch(){return new Ax(this.fuzzyExports)}getWatchmanPath(){return TX(this.configurations)}getConfiguration(e,t){return this.configurations.getConfiguration(e,t)}getDocument(e){return this.documentsManager.getDocument(e)}isAttached(e){let t=this.documentsManager.getDocument(e);return t!=null&&t.attached}getAttachedDocument(e){let t=this.getDocument(e);if(!t)throw new Error(`Buffer ${e} not created.`);if(!t.attached)throw new Error(`Buffer ${e} not attached, ${t.notAttachReason}`);return t}getQuickfixItem(e,t,i="",r){return this.documentsManager.getQuickfixItem(e,t,i,r)}createMru(e){return new xs(e)}async getQuickfixList(e){return this.documentsManager.getQuickfixList(e)}async showLocations(e){await this.documentsManager.showLocations(e)}getLine(e,t){return this.documentsManager.getLine(e,t)}getWorkspaceFolder(e){return this.workspaceFolderControl.getWorkspaceFolder(j.parse(e))}readFile(e){return this.documentsManager.readFile(e)}async getCurrentState(){let e=await this.document,t=await hh(this.nvim);return{document:e.textDocument,position:t}}async getFormatOptions(e){return this.documentsManager.getFormatOptions(e)}resolveModule(e){return PX(e)}async runCommand(e,t,i){return t=t||this.cwd,_o(e,{cwd:t},i)}expand(e){return this.documentsManager.expand(e)}async callAsync(e,t){return this.isNvim?await this.nvim.call(e,t):await this.nvim.callAsync("coc#util#with_callback",[e,t])}registerTextDocumentContentProvider(e,t){return this.contentProvider.registerTextDocumentContentProvider(e,t)}registerKeymap(e,t,i,r={}){return this.keymaps.registerKeymap(e,t,i,r)}registerExprKeymap(e,t,i,r=!1){return this.keymaps.
`)==-1&&(c+=" ",h(u,"CocTreeDescription"),c+=u),{line:c,highlights:s}}async appendTreeNode(e,t,i,r,o){let s=1,a=await this.getTreeItem(e),l=this.getRenderedLine(a,i,t);if(o.push(...l.highlights),r.push({level:t,line:l.line,node:e}),a.collapsibleState==2){let u=t+1,c=await Promise.resolve(this.provider.getChildren(e))||[];for(let h of c){let d=await this.appendTreeNode(h,u,i+s,r,o);s=s+d}}return s}updateUI(e,t,i=0,r=-1,o=!1){if(!this.bufnr)return;let{nvim:s,winid:a}=this,l=s.createBuffer(this.bufnr);if(s.pauseNotification(),l.setOption("modifiable",!0,!0),l.setLines(e,{start:i,end:r,strictIndexing:!1},!0),this.autoWidth&&this.nvim.call("coc#window#adjust_width",[a],!0),t.length){let u=r==-1?-1:i+e.length;s.call("coc#highlight#update_highlights",[this.bufnr,P_,t,i,u],!0)}l.setOption("modifiable",!1,!0),o||this.redraw(),s.resumeNotification(!1,!0)}async reveal(e,t={}){var l;if((l=this.filter)!=null&&l.activated)return;let i=this.getItemLnum(e)!=null,{select:r,focus:o,expand:s}=t,a=e;if(typeof this.provider.getParent!="function")throw new Error("missing getParent function from provider for reveal.");if(!i)for(;a;){let u=await Promise.resolve(this.provider.getParent(a));if(u){let c=await this.getTreeItem(u);c.collapsibleState=2,a=u}else break}if(s){let u=await this.getTreeItem(e);if(u.collapsibleState==0)return;if(u.collapsibleState=2,typeof s=="number"&&s>1){let c=Math.min(s,2),h=await Promise.resolve(this.provider.getChildren(e));for(;(h==null?void 0:h.length)>0;){let d=[];for(let g of h){let p=await this.getTreeItem(g);if(p.collapsibleState!=0&&(p.collapsibleState=2,c>1)){let f=await Promise.resolve(this.provider.getChildren(g));d.push(...f)}}h=d,c=c-1}}}(!i||s)&&await this.render(),r!==!1&&this.selectItem(e),o&&this.focusItem(e)}updateHeadLines(e=!1){let{titleCount:t,messageCount:i}=this.lineState,r=e?-1:t+i,o=[],s=[];try{if(this.message&&(s.push({hlGroup:"MoreMsg",colStart:0,colEnd:Q(this.message),lnum:0}),o.push(this.message),o.push("")),this.title){if(s.push({hlGroup:"CocTreeTitle",colStart:0,colEnd:Q(this.title),lnum:o.length}),this.description){let a=Q(this.title)+1;s.push({hlGroup:"Comment",colStart:a,colEnd:a+Q(this.description),lnum:o.length})}o.push(this.title+(this.description?" "+this.description:""))}this.lineState.messageCount=this.message?2:0,this.lineState.titleCount=this.title?1:0,this.updateUI(o,s,0,r),e||this.refreshSigns()}catch(a){this.nvim.echoError(a)}}refreshSigns(){let{selection:e,nvim:t,bufnr:i}=this;if(!e.length||!i||!v.env.sign)return;let r=t.createBuffer(i);t.pauseNotification(),r.unplaceSign({group:"CocTree"});for(let o of e){let s=this.getItemLnum(o);s!=null&&r.placeSign({id:E_+s,lnum:s+1,name:"CocTreeSelected",group:"CocTree"})}t.resumeNotification(!1,!0)}async render(){if(!this.bufnr)return;let e=await this.mutex.acquire();try{let t=[],i=[],{startLnum:r}=this,o=await Promise.resolve(this.provider.getChildren()),s=0,a=r,l=[];if(!(o!=null&&o.length))this.message="No results";else{this.message=="No results"&&(this.message="");for(let c of o)a+=await this.appendTreeNode(c,s,a,l,i)}t.push(...l.map(c=>c.line)),this.renderedItems=l;let u=this.startLnum-r;u&&i.forEach(c=>c.lnum=c.lnum+u),this.updateUI(t,i,this.startLnum,-1),this._onDidRefrash.fire(),this.retryTimers=0,e()}catch(t){this.renderedItems=[],this.nodesMap.clear(),this.lineState={titleCount:0,messageCount:1},e();let i=`${t}`.replace(/\r?\n/g," ");if(this.updateUI([i],[{hlGroup:"WarningMsg",colStart:0,colEnd:Q(i),lnum:0}]),this.retryTimers==5)return;this.timer=setTimeout(()=>{this.retryTimers=this.retryTimers+1,this.render()},500)}}async show(e="belowright 30vs"){if(this._creating)return!1;this._creating=!0;let{nvim:t}=this,i=this.winid,[r,o,s,a]=await t.eval(`[bufnr("%"),win_getid(),tabpagenr(),bufloaded(${this.bufnr||-1})]`);this._targetBufnr=r,this._targetWinId=o,this._targetTabId=D.getTabId(s),a||(this.bufnr=void 0);let l=this.bufnr==null,u=await t.call("coc#window#find",["cocViewId",this.viewId]);if(this.bufnr&&u!==-1&&await t.call("winbufnr",[u])==this.bufnr){this._creating=!1;return}if(t.pauseNotification(),this.bufnr)u!=-1?(t.call
`,r=Buffer.byteLength(i),o=Math.floor(Math.log(r)/Math.log(10))+1;return r+o>=Math.pow(10,o)&&(o+=1),o+r+i}};Vf.parse=(n,e,t)=>new Vf(pxe(fxe(n),e),t);var pxe=(n,e)=>e?Object.keys(n).reduce((t,i)=>(t[i]=n[i],t),e):n,fxe=n=>n.replace(/\n$/,"").split(`
`).reduce(mxe,Object.create(null)),mxe=(n,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return n;e=e.substr((t+" ").length);let i=e.split("="),r=i.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!r)return n;let o=i.join("=");return n[r]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(r)?new Date(o*1e3):/^[0-9]+$/.test(o)?+o:o,n};rG.exports=Vf});var Wh=y((oqe,oG)=>{oG.exports=n=>{let e=n.length-1,t=-1;for(;e>-1&&n.charAt(e)==="/";)t=e,e--;return t===-1?n:n.slice(0,t)}});var Kx=y((sqe,sG)=>{"use strict";sG.exports=n=>class extends n{warn(e,t,i={}){this.file&&(i.file=this.file),this.cwd&&(i.cwd=this.cwd),i.code=t instanceof Error&&t.code||e,i.tarCode=e,!this.strict&&i.recoverable!==!1?(t instanceof Error&&(i=Object.assign(t,i),t=t.message),this.emit("warn",i.tarCode,t,i)):t instanceof Error?this.emit("error",Object.assign(t,i)):this.emit("error",Object.assign(new Error(`${e}: ${t}`),i))}}});var aL=y((lqe,aG)=>{"use strict";var Qx=["|","<",">","?",":"],sL=Qx.map(n=>String.fromCharCode(61440+n.charCodeAt(0))),bxe=new Map(Qx.map((n,e)=>[n,sL[e]])),yxe=new Map(sL.map((n,e)=>[n,Qx[e]]));aG.exports={encode:n=>Qx.reduce((e,t)=>e.split(t).join(bxe.get(t)),n),decode:n=>sL.reduce((e,t)=>e.split(t).join(yxe.get(t)),n)}});var lL=y((uqe,uG)=>{var{isAbsolute:vxe,parse:lG}=require("path").win32;uG.exports=n=>{let e="",t=lG(n);for(;vxe(n)||t.root;){let i=n.charAt(0)==="/"&&n.slice(0,4)!=="//?/"?"/":t.root;n=n.substr(i.length),e+=i,t=lG(n)}return[e,n]}});var hG=y((cqe,cG)=>{"use strict";cG.exports=(n,e,t)=>(n&=4095,t&&(n=(n|384)&-19),e&&(n&256&&(n|=64),n&32&&(n|=8),n&4&&(n|=1)),n)});var yL=y((gqe,TG)=>{"use strict";var yG=Oh(),vG=zx(),wG=Bh(),Mo=require("fs"),dG=require("path"),jo=Hh(),wxe=Wh(),xG=(n,e)=>e?(n=jo(n).replace(/^\.(\/|$)/,""),wxe(e)+"/"+n):jo(n),xxe=16*1024*1024,gG=Symbol("process"),pG=Symbol("file"),fG=Symbol("directory"),cL=Symbol("symlink"),mG=Symbol("hardlink"),em=Symbol("header"),Vx=Symbol("read"),hL=Symbol("lstat"),eC=Symbol("onlstat"),dL=Symbol("onread"),gL=Symbol("onreadlink"),pL=Symbol("openfile"),fL=Symbol("onopenfile"),qa=Symbol("close"),tC=Symbol("mode"),mL=Symbol("awaitDrain"),uL=Symbol("ondrain"),Oo=Symbol("prefix"),bG=Symbol("hadError"),CG=Kx(),Cxe=aL(),SG=lL(),DG=hG(),iC=CG(class extends yG{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=jo(e),this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||xxe,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=jo(t.cwd||process.cwd()),this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,this.prefix=t.prefix?jo(t.prefix):null,this.fd=null,this.blockLen=null,this.blockRemain=null,this.buf=null,this.offset=null,this.length=null,this.pos=null,this.remain=null,typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let i=!1;if(!this.preservePaths){let[r,o]=SG(this.path);r&&(this.path=o,i=r)}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=Cxe.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=jo(t.absolute||dG.resolve(this.cwd,e)),this.path===""&&(this.path="./"),i&&this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:this,path:i+this.path}),this.statCache.has(this.absolute)?this[eC](this.statCache.get(this.absolute)):this[hL]()}emit(e,...t){return e==="error"&&(this[bG]=!0),super.emit(e,...t)}[hL](){Mo.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[eC](t)})}[eC](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=Dxe(e),this.emit("stat",e),this[gG]()}[gG](){switch(this.type){case"File":return this[pG]();case"Directory":return this[fG]();case"SymbolicLink":return this[cL]();default:return this.end()}}[tC](e){return DG(e,this.type==="Directory",this.portable)}[Oo](e){return xG(e,this.prefix)}[em](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new wG({path:this[Oo](this.path),linkpat
`).some(e=>e.indexOf("(https.js:")!==-1||e.indexOf("node:https:")!==-1)}function qC(n,e){return new qC.Agent(n,e)}(function(n){class e extends QSe.EventEmitter{constructor(i,r){super();let o=r;typeof i=="function"?this.callback=i:i&&(o=i),this.timeout=null,o&&typeof o.timeout=="number"&&(this.timeout=o.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:xI()?443:80}set defaultPort(i){this.explicitDefaultPort=i}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:xI()?"https:":"http:"}set protocol(i){this.explicitProtocol=i}callback(i,r,o){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(i,r){let o=Object.assign({},r);typeof o.secureEndpoint!="boolean"&&(o.secureEndpoint=xI()),o.host==null&&(o.host="localhost"),o.port==null&&(o.port=o.secureEndpoint?443:80),o.protocol==null&&(o.protocol=o.secureEndpoint?"https:":"http:"),o.host&&o.path&&delete o.path,delete o.agent,delete o.hostname,delete o._defaultAgent,delete o.defaultPort,delete o.createConnection,i._last=!0,i.shouldKeepAlive=!1;let s=!1,a=null,l=o.timeout||this.timeout,u=g=>{i._hadError||(i.emit("error",g),i._hadError=!0)},c=()=>{a=null,s=!0;let g=new Error(`A "socket" was not created for HTTP request before ${l}ms`);g.code="ETIMEOUT",u(g)},h=g=>{s||(a!==null&&(clearTimeout(a),a=null),u(g))},d=g=>{if(s)return;if(a!=null&&(clearTimeout(a),a=null),tDe(g)){vm("Callback returned another Agent instance %o",g.constructor.name),g.addRequest(i,o);return}if(g){g.once("free",()=>{this.freeSocket(g,o)}),i.onSocket(g);return}let p=new Error(`no Duplex stream was returned to agent-base for \`${i.method} ${i.path}\``);u(p)};if(typeof this.callback!="function"){u(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(vm("Converting legacy callback function to promise"),this.promisifiedCallback=eDe.default(this.callback)):this.promisifiedCallback=this.callback),typeof l=="number"&&l>0&&(a=setTimeout(c,l)),"port"in o&&typeof o.port!="number"&&(o.port=Number(o.port));try{vm("Resolving socket for %o request: %o",o.protocol,`${i.method} ${i.path}`),Promise.resolve(this.promisifiedCallback(i,o)).then(d,h)}catch(g){Promise.reject(g).catch(h)}}freeSocket(i,r){vm("Freeing socket %o %o",i.constructor.name,r),i.destroy()}destroy(){vm("Destroying agent %o",this.constructor.name)}}n.Agent=e,n.prototype=n.Agent.prototype})(qC||(qC={}));fK.exports=qC});var mK=y(Du=>{"use strict";var iDe=Du&&Du.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(h){s(h)}}function l(c){try{u(i.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})},wm=Du&&Du.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Du,"__esModule",{value:!0});var nDe=wm(require("net")),rDe=wm(require("tls")),DI=wm(require("url")),oDe=wm(Yt()),sDe=wm(dK()),aDe=SI(),Ka=(0,oDe.default)("http-proxy-agent");function lDe(n){return typeof n=="string"?/^https:?$/i.test(n):!1}var TI=class extends aDe.Agent{constructor(e){let t;if(typeof e=="string"?t=DI.default.parse(e):t=e,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");Ka("Creating new HttpProxyAgent instance: %o",t),super(t);let i=Object.assign({},t);this.secureProxy=t.secureProxy||lDe(i.protocol),i.host=i.hostname||i.host,typeof i.port=="string"&&(i.port=parseInt(i.port,10)),!i.port&&i.host&&(i.port=this.secureProxy?443:80),i.host&&i.path&&(delete i.path,delete i.pathname),this.proxy=i}callback(e,t){return iDe(this,void 0,void 0,function*(){let{proxy:i,secureProxy:r}=this,o=DI.default.parse(e.path);o.protocol||(o.protocol="http:"),o.hostname||(o.hostname=t.hostname||t.host||null),o.port==null&&typeof t.port&&(o.port=String(t.port)
\r
`)+4,e.output[0]=e._header+a.substring(l),Ka("Output buffer: %o",e.output)):e.outputData&&e.outputData.length>0&&(Ka("Patching connection write() output buffer with updated header"),a=e.outputData[0].data,l=a.indexOf(`\r
\r
`)+4,e.outputData[0].data=e._header+a.substring(l),Ka("Output buffer: %o",e.outputData[0].data))}return yield(0,sDe.default)(s,"connect"),s})}};Du.default=TI});var yK=y((EI,bK)=>{"use strict";var uDe=EI&&EI.__importDefault||function(n){return n&&n.__esModule?n:{default:n}},kI=uDe(mK());function PI(n){return new kI.default(n)}(function(n){n.HttpProxyAgent=kI.default,n.prototype=kI.default.prototype})(PI||(PI={}));bK.exports=PI});var vK=y(Cm=>{"use strict";var cDe=Cm&&Cm.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Cm,"__esModule",{value:!0});var hDe=cDe(Yt()),xm=hDe.default("https-proxy-agent:parse-proxy-response");function dDe(n){return new Promise((e,t)=>{let i=0,r=[];function o(){let h=n.read();h?c(h):n.once("readable",o)}function s(){n.removeListener("end",l),n.removeListener("error",u),n.removeListener("close",a),n.removeListener("readable",o)}function a(h){xm("onclose had error %o",h)}function l(){xm("onend")}function u(h){s(),xm("onerror %o",h),t(h)}function c(h){r.push(h),i+=h.length;let d=Buffer.concat(r,i);if(d.indexOf(`\r
\r
`)===-1){xm("have not received end of HTTP headers yet..."),o();return}let p=d.toString("ascii",0,d.indexOf(`\r
`)),f=+p.split(" ")[1];xm("got proxy server response: %o",p),e({statusCode:f,buffered:d})}n.on("error",u),n.on("close",a),n.on("end",l),o()})}Cm.default=dDe});var CK=y(Tu=>{"use strict";var gDe=Tu&&Tu.__awaiter||function(n,e,t,i){function r(o){return o instanceof t?o:new t(function(s){s(o)})}return new(t||(t=Promise))(function(o,s){function a(c){try{u(i.next(c))}catch(h){s(h)}}function l(c){try{u(i.throw(c))}catch(h){s(h)}}function u(c){c.done?o(c.value):r(c.value).then(a,l)}u((i=i.apply(n,e||[])).next())})},od=Tu&&Tu.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Tu,"__esModule",{value:!0});var wK=od(require("net")),xK=od(require("tls")),pDe=od(require("url")),fDe=od(require("assert")),mDe=od(Yt()),bDe=SI(),yDe=od(vK()),Sm=mDe.default("https-proxy-agent:agent"),RI=class extends bDe.Agent{constructor(e){let t;if(typeof e=="string"?t=pDe.default.parse(e):t=e,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");Sm("creating new HttpsProxyAgent instance: %o",t),super(t);let i=Object.assign({},t);this.secureProxy=t.secureProxy||xDe(i.protocol),i.host=i.hostname||i.host,typeof i.port=="string"&&(i.port=parseInt(i.port,10)),!i.port&&i.host&&(i.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in i)&&(i.ALPNProtocols=["http 1.1"]),i.host&&i.path&&(delete i.path,delete i.pathname),this.proxy=i}callback(e,t){return gDe(this,void 0,void 0,function*(){let{proxy:i,secureProxy:r}=this,o;r?(Sm("Creating `tls.Socket`: %o",i),o=xK.default.connect(i)):(Sm("Creating `net.Socket`: %o",i),o=wK.default.connect(i));let s=Object.assign({},i.headers),l=`CONNECT ${`${t.host}:${t.port}`} HTTP/1.1\r
`;i.auth&&(s["Proxy-Authorization"]=`Basic ${Buffer.from(i.auth).toString("base64")}`);let{host:u,port:c,secureEndpoint:h}=t;wDe(c,h)||(u+=`:${c}`),s.Host=u,s.Connection="close";for(let m of Object.keys(s))l+=`${m}: ${s[m]}\r
`;let d=yDe.default(o);o.write(`${l}\r
`);let{statusCode:g,buffered:p}=yield d;if(g===200){if(e.once("socket",vDe),t.secureEndpoint){let m=t.servername||t.host;if(!m)throw new Error('Could not determine "servername"');return Sm("Upgrading socket connection to TLS"),xK.default.connect(Object.assign(Object.assign({},CDe(t,"host","hostname","path","port")),{socket:o,servername:m}))}return o}o.destroy();let f=new wK.default.Socket;return f.readable=!0,e.once("socket",m=>{Sm("replaying proxy buffer for failed request"),fDe.default(m.listenerCount("data")>0),m.push(p),m.push(null)}),f})}};Tu.default=RI;function vDe(n){n.resume()}function wDe(n,e){return Boolean(!e&&n===80||e&&n===443)}function xDe(n){return typeof n=="string"?/^https:?$/i.test(n):!1}function CDe(n,...e){let t={},i;for(i in n)e.includes(i)||(t[i]=n[i]);return t}});var DK=y((II,SK)=>{"use strict";var SDe=II&&II.__importDefault||function(n){return n&&n.__esModule?n:{default:n}},_I=SDe(CK());function LI(n){return new _I.default(n)}(function(n){n.HttpsProxyAgent=_I.default,n.prototype=_I.default.prototype})(LI||(LI={}));SK.exports=LI});function FI(n){return n||""}function jI(n){return n.protocol==="https:"?WC.https:WC.http}function DDe(n){return typeof n=="string"||Buffer.isBuffer(n)?n:JSON.stringify(n)}function MI(n){if(n instanceof BC.URL)return n;let e=new BC.URL(n);if(!["https:","http:"].includes(e.protocol))throw new Error(`Not valid protocol with ${n}, should be http: or https:`);return e}function TDe(n){return n===null?"null":n===void 0?"undefined":typeof n=="string"?"string":Buffer.isBuffer(n)?"buffer":Array.isArray(n)||hi(n)?"object":"unknown"}function kDe(n,e=process.env){let t=e.NO_PROXY??e.no_proxy;if(t==="*")return null;if(t){let r=n.hostname.replace(/^\.*/,".").toLowerCase(),o=n.port||n.protocol.startsWith("https")?"443":"80",s=t.split(",");for(let a=0,l=s.length;a<l;a++){let u=s[a].trim().toLowerCase();if(u.includes(":")){let c=u.split(":",2),h=c[0].replace(/^\.*/,"."),d=c[1];if(o===d&&r.endsWith(h))return null}else if(u=u.replace(/^\.*/,"."),r.endsWith(u))return null}}let i;return n.protocol==="http:"?i=e.HTTP_PROXY||e.http_proxy||null:i=e.HTTPS_PROXY||e.https_proxy||e.HTTP_PROXY||e.http_proxy||null,i}function PDe(n,e){let t=e.proxy||kDe(n);if(t){let i;try{if(i=new BC.URL(t),!/^https?:$/.test(i.protocol))return null}catch{return null}let r={host:i.hostname,port:i.port?Number(i.port):i.protocol==="https:"?443:80,auth:i.username?`${i.username}:${FI(i.password)}`:void 0,rejectUnauthorized:typeof e.proxyStrictSSL=="boolean"?e.proxyStrictSSL:!0};return _K.info(`Using proxy ${t} from ${e.proxy?"configuration":"system environment"} for ${n.hostname}:`),n.protocol==="http:"?(0,PK.default)(r):(0,EK.default)(r)}return null}function OI(n,e){let t=v.getConfiguration("http",null),i=TDe(e.data),r={proxy:t.get("proxy",""),proxyStrictSSL:t.get("proxyStrictSSL",!0),proxyAuthorization:t.get("proxyAuthorization",null),proxyCA:t.get("proxyCA",null)};e.query&&!n.search&&(n.search=`?${(0,RK.stringify)(e.query)}`);let o=PDe(n,r),s={method:e.method??"GET",hostname:n.hostname,port:n.port?parseInt(n.port,10):n.protocol==="https:"?443:80,path:n.pathname+n.search,agent:o,rejectUnauthorized:r.proxyStrictSSL,maxRedirects:3,headers:{"User-Agent":"Mozilla/5.0 (X11; Linux x86_64)","Accept-Encoding":"gzip, deflate",...e.headers??{}}};return i=="object"?s.headers["Content-Type"]="application/json":i=="string"&&(s.headers["Content-Type"]="text/plain"),r.proxyAuthorization&&(s.headers["Proxy-Authorization"]=r.proxyAuthorization),r.proxyCA&&(s.ca=kK.default.readFileSync(r.proxyCA)),e.user&&(s.auth=e.user+":"+FI(e.password)),n.username&&(s.auth=n.username+":"+FI(n.password)),e.timeout&&(s.timeout=e.timeout),e.buffer&&(s.buffer=!0),s}function EDe(n,e,t,i){let r=jI(n);return new Promise((o,s)=>{if(i){let u=i.onCancellationRequested(()=>{u.dispose(),l.destroy(new ii)})}let a,l=r.request(t,u=>{let c=u;if(u.statusCode>=200&&u.statusCode<300||u.statusCode===1223){let h=u.headers,d=[],g=h["content-type"]||"";c=(0,TK.default)(u),c.on("data",p=>{d.push(p)}),c.on("end",()=>{clearTimeout(a);let p=Buffer.concat(d);if(!t.buffer&&(g.start
`+Error().stack.split(`
`).slice(2,4).join(`
`);if(zS.warn(`${c} in the client options is deprecated. use disabledFeatures instead.`,h),e[c]===!0){let d=c.slice(7);a.push(d[0].toLowerCase()+d.slice(1))}}let l=e.separateDiagnostics;return e.separateDiagnostics===void 0&&(l=v.getConfiguration("diagnostic",e.workspaceFolder).get("separateRelatedInformationAsDiagnostics")),{disabledFeatures:a,disableMarkdown:r,disableSnippetCompletion:i,separateDiagnostics:l,diagnosticPullOptions:s,rootPatterns:e.rootPatterns??[],requireRootPattern:e.requireRootPattern,disableDynamicRegister:e.disableDynamicRegister,formatterPriority:e.formatterPriority??0,ignoredRootPaths:e.ignoredRootPaths??[],documentSelector:e.documentSelector??[],synchronize:e.synchronize??{},diagnosticCollectionName:e.diagnosticCollectionName,outputChannelName:e.outputChannelName??this._id,revealOutputChannelOn:e.revealOutputChannelOn??4,stdioEncoding:e.stdioEncoding??"utf8",initializationOptions:e.initializationOptions,initializationFailedHandler:e.initializationFailedHandler,progressOnInitialization:e.progressOnInitialization===!0,errorHandler:e.errorHandler??this.createDefaultErrorHandler((u=e.connectionOptions)==null?void 0:u.maxRestartCount),middleware:e.middleware??{},workspaceFolder:e.workspaceFolder,connectionOptions:e.connectionOptions,markdown:t}}get supportedMarkupKind(){return this.clientOptions.disableMarkdown?[K.MarkupKind.PlainText]:[K.MarkupKind.Markdown,K.MarkupKind.PlainText]}get state(){return this.getPublicState()}get $state(){return this._state}set $state(e){let t=this.getPublicState();this._state=e;let i=this.getPublicState();i!==t&&this._stateChangeEmitter.fire({oldState:t,newState:i})}get id(){return this._id}get name(){return this._name}get middleware(){return this._clientOptions.middleware}getPublicState(){return this.$state===3?2:this.$state===1?3:1}get initializeResult(){return this._initializeResult}async sendRequest(e,...t){this.checkState();try{return await(await this.$start()).sendRequest(e,...t)}catch(i){throw this.error(`Sending request ${ti(e)?e:e.method} failed.`,i),i}}onRequest(e,t){let i=typeof e=="string"?e:e.method;this._requestHandlers.set(i,t);let r=this.activeConnection(),o;return r!==void 0?(this._requestDisposables.set(i,r.onRequest(e,t)),o={dispose:()=>{let s=this._requestDisposables.get(i);s!==void 0&&(s.dispose(),this._requestDisposables.delete(i))}}):(this._pendingRequestHandlers.set(i,t),o={dispose:()=>{this._pendingRequestHandlers.delete(i);let s=this._requestDisposables.get(i);s!==void 0&&(s.dispose(),this._requestDisposables.delete(i))}}),{dispose:()=>{this._requestHandlers.delete(i),o.dispose()}}}async sendNotification(e,t){this.checkState();try{return await(await this.$start()).sendNotification(e,t)}catch(i){throw this.error(`Sending notification ${ti(e)?e:e.method} failed.`,i),i}}onNotification(e,t){let i=typeof e=="string"?e:e.method;this._notificationHandlers.set(i,t);let r=this.activeConnection(),o;return r!==void 0?(this._notificationDisposables.set(i,r.onNotification(e,t)),o={dispose:()=>{let s=this._notificationDisposables.get(i);s!==void 0&&(s.dispose(),this._notificationDisposables.delete(i))}}):(this._pendingNotificationHandlers.set(i,t),o={dispose:()=>{this._pendingNotificationHandlers.delete(i);let s=this._notificationDisposables.get(i);s!==void 0&&(s.dispose(),this._notificationDisposables.delete(i))}}),{dispose:()=>{this._notificationHandlers.delete(i),o.dispose()}}}onProgress(e,t,i){this._progressHandlers.set(t,{type:e,handler:i});let r=this.activeConnection(),o,s=this._clientOptions.middleware.handleWorkDoneProgress,a=K.WorkDoneProgress.is(e)&&s!==void 0?l=>{s(t,l,()=>i(l))}:i;return r!==void 0?(this._progressDisposables.set(t,r.onProgress(e,t,a)),o={dispose:()=>{let l=this._progressDisposables.get(t);l!==void 0&&(l.dispose(),this._progressDisposables.delete(t))}}):(this._pendingProgressHandlers.set(t,{type:e,handler:i}),o={dispose:()=>{this._pendingProgressHandlers.delete(t);let l=this._progressDisposables.get(t);l!==void 0&&(l.dispose(),this._progressDisposables.delete(t))}}),{dispose:()=>{this._progressHandlers.delete(t),o.dispose()}}}asyn
Code: ${t.code} ${t.data?`
`+t.data.toString():""}`}return e instanceof Error?ti(e.stack)?e.stack:e.message:ti(e)?e:e.toString()}info(e,t,i=!0){this.outputChannel.appendLine(`[Info - ${new Date().toLocaleTimeString()}] ${e}`),t!=null&&this.outputChannel.appendLine(this.data2String(t)),i&&this._clientOptions.revealOutputChannelOn<=1&&this.showNotificationMessage(K.MessageType.Info,e)}warn(e,t,i=!0){this.outputChannel.appendLine(`[Warn - ${new Date().toLocaleTimeString()}] ${e}`),t!=null&&this.outputChannel.appendLine(this.data2String(t)),i&&this._clientOptions.revealOutputChannelOn<=2&&this.showNotificationMessage(K.MessageType.Warning,e)}error(e,t,i=!0){this.outputChannel.appendLine(`[Error - ${new Date().toLocaleTimeString()}] ${e}`),t!=null&&this.outputChannel.appendLine(this.data2String(t)),(i==="force"||i&&this._clientOptions.revealOutputChannelOn<=3)&&this.showNotificationMessage(K.MessageType.Error,e)}showNotificationMessage(e,t){t=t??"A request has failed. See the output for more information.",(e===K.MessageType.Error?D.showErrorMessage.bind(D):e===K.MessageType.Warning?D.showWarningMessage.bind(D):D.showInformationMessage.bind(D))(t)}logTrace(e,t){this.outputChannel.appendLine(`[Trace - ${new Date().toLocaleTimeString()}] ${e}`),t&&this.outputChannel.appendLine(this.data2String(t))}needsStart(){return this.$state===0||this.$state===4||this.$state===5}needsStop(){return this.$state===1||this.$state===3}activeConnection(){return this.$state===3&&this._connection!==void 0?this._connection:void 0}get hasPendingResponse(){var e;return(e=this._connection)==null?void 0:e.hasPendingResponse()}onReady(){return this._onStart?this._onStart:new Promise(e=>{let t=this.onDidChangeState(i=>{i.newState===2&&(t.dispose(),e())})})}get started(){return this.$state!=0}isRunning(){return this.$state===3}async _start(){if(this._disposed==="disposing"||this._disposed==="disposed")throw new Error("Client got disposed and can't be restarted.");if(this.$state===4)throw new Error("Client is currently stopping. Can only restart a full stopped client");if(this._onStart!==void 0)return this._onStart;this._rootPath=this.resolveRootPath();let[e,t,i]=this.createOnStartPromise();if(this._onStart=e,this._diagnostics===void 0){let r=this._clientOptions,o=r.diagnosticCollectionName?r.diagnosticCollectionName:this._id;r.disabledFeatures.includes("diagnostics")||(this._diagnostics=_.createDiagnosticCollection(o))}for(let[r,o]of this._notificationHandlers)this._pendingNotificationHandlers.has(r)||this._pendingNotificationHandlers.set(r,o);for(let[r,o]of this._requestHandlers)this._pendingRequestHandlers.has(r)||this._pendingRequestHandlers.set(r,o);for(let[r,o]of this._progressHandlers)this._pendingProgressHandlers.has(r)||this._pendingProgressHandlers.set(r,o);this.$state=1;try{let r=await this.createConnection();this.handleConnectionEvents(r),r.listen(),await this.initialize(r),t()}catch(r){this.$state=2,this.error(`${this._name} client: couldn't create connection to server.`,r,"force"),i(r)}return this._onStart}start(){let e=this._start();return e.dispose=()=>{this.needsStop()&&this.stop()},e}async $start(){if(this.$state===2)throw new Error("Previous start failed. Can't restart server.");await this._start();let e=this.activeConnection();if(e===void 0)throw new Error("Starting server failed");return e}handleConnectionEvents(e){e.onNotification(K.LogMessageNotification.type,t=>{switch(t.type){case K.MessageType.Error:this.error(t.message);break;case K.MessageType.Warning:this.warn(t.message);break;case K.MessageType.Info:this.info(t.message);break;default:this.outputChannel.appendLine(t.message)}}),e.onNotification(K.ShowMessageNotification.type,t=>{switch(t.type){case K.MessageType.Error:D.showErrorMessage(t.message);break;case K.MessageType.Warning:D.showWarningMessage(t.message);break;case K.MessageType.Info:D.showInformationMessage(t.message);break;default:D.showInformationMessage(t.message)}}),e.onNotification(K.TelemetryEventNotification.type,t=>{}),e.onRequest(K.ShowMessageRequest.type,t=>{let i;switch(t.type){case K.MessageType.Error:i=D.showErrorMessage.bind(D);bre
Related diagnostics:
`;for(let l of s.relatedInformation){let u=aF.default.basename(j.parse(l.location.uri).fsPath),c=l.location.range.start.line;a=`${a}
${u}(line ${c+1}): ${l.message}`;let h=o.get(l.location.uri)||[];h.push(K.Diagnostic.create(l.location.range,l.message,K.DiagnosticSeverity.Hint,s.code,s.source)),o.set(l.location.uri,h)}s.message=a}this._diagnostics.set(Array.from(o))}}else this._diagnostics.set(e,t)}handleApplyWorkspaceEdit(e){let t=e.edit,i=new Map;v.textDocuments.forEach(o=>i.set(o.uri.toString(),o));let r=!1;if(t.documentChanges){for(let o of t.documentChanges)if(K.TextDocumentEdit.is(o)&&o.textDocument.version&&o.textDocument.version>=0){let s=i.get(o.textDocument.uri);if(s&&s.version!==o.textDocument.version){r=!0;break}}}return r?Promise.resolve({applied:!1}):v.applyEdit(e.edit).then(o=>({applied:o}))}getLocale(){let e=process.env.LANG;return e?e.split(".")[0]:"en"}handleFailedRequest(e,t,i,r){if(t&&t.isCancellationRequested)return r;if(i instanceof K.ResponseError){if(i.code===K.ErrorCodes.PendingResponseRejected||i.code===K.ErrorCodes.ConnectionInactive)return r;if(i.code===K.LSPErrorCodes.RequestCancelled||i.code===K.LSPErrorCodes.ServerCancelled)throw i.data!=null?new ku(i.data):new ii;if(i.code===K.LSPErrorCodes.ContentModified){if(KS.RequestsToCancelOnContentModified.has(e.method))throw new ii;return r}}throw this.error(`Request ${e.method} failed.`,i),i}logFailedRequest(){}},Am=KS;Am.RequestsToCancelOnContentModified=new Set([K.InlayHintRequest.method,K.SemanticTokensRequest.method,K.SemanticTokensRangeRequest.method,K.SemanticTokensDeltaRequest.method]);JDe={createAll:n=>[]}});function GDe(n,e){if(hd.default.isAbsolute(n))return n;let t=zDe();if(t!==void 0){let i=hd.default.join(t,n);if(eD.default.existsSync(i))return i}if(e!==void 0){let i=hd.default.join(e,n);if(eD.default.existsSync(i))return i}return n}function zDe(){let n=v.workspaceFolders;return!n||n.length===0?void 0:n[0].uri}function KDe(n){let e=n&&n.cwd;return e&&!hd.default.isAbsolute(e)&&(e=hd.default.join(v.cwd,e)),e||(e=v.cwd),new Promise(t=>{eD.default.lstat(e,(i,r)=>{t(!i&&r.isDirectory()?e:void 0)})})}function QDe(n){return n?n.some(e=>UDe.some(t=>e.startsWith(t))||XDe.some(t=>e===t)):!1}var Nm,eD,hd,si,$De,UDe,XDe,cF,nD,tD,hF,dF,gF,dd,iD,pF=k(()=>{"use strict";Nm=S(require("child_process")),eD=S(require("fs")),hd=S(require("path")),si=S(ZK());re();wi();$K();ie();uF();uF();$De=q()("language-client-index"),UDe=["--debug=","--debug-brk=","--inspect=","--inspect-brk="],XDe=["--debug","--debug-brk","--inspect","--inspect-brk"];(e=>{function n(t){return ti(t.command)}e.is=n})(cF||(cF={}));nD=(r=>(r[r.stdio=0]="stdio",r[r.ipc=1]="ipc",r[r.pipe=2]="pipe",r[r.socket=3]="socket",r))(nD||{});(e=>{function n(t){let i=t;return i&&i.kind===3&&rw(i.port)}e.isSocket=n})(tD||(tD={}));(e=>{function n(t){return ti(t.module)}e.is=n})(hF||(hF={}));(e=>{function n(t){let i=t;return i&&i.writer!==void 0&&i.reader!==void 0}e.is=n})(dF||(dF={}));(e=>{function n(t){let i=t;return i&&i.process!==void 0&&typeof i.detached=="boolean"}e.is=n})(gF||(gF={}));dd=class extends Am{constructor(t,i,r,o,s){let a,l,u,c,h;ti(i)?(a=t,l=i,u=r,c=o,h=!!s):(a=t.toLowerCase(),l=t,u=i,c=r,h=o);super(a,l,c);this._serverOptions=u,this._forceDebug=!!h,this._isInDebugMode=!!h}stop(t=2e3){return super.stop(t).then(()=>{if(this._serverProcess){let i=this._serverProcess;this._serverProcess=void 0,(this._isDetached===void 0||!this._isDetached)&&this.checkProcessDied(i),this._isDetached=void 0}})}get serviceState(){return this._state}checkProcessDied(t){!t||t.pid===void 0||setTimeout(()=>{try{process.kill(t.pid,0),JK(t)}catch{}},2e3)}handleConnectionClosed(){this._serverProcess=void 0,super.handleConnectionClosed()}get isInDebugMode(){return this._isInDebugMode}async restart(){await this.stop(),this.isInDebugMode?(await new Promise(t=>setTimeout(t,1e3)),await this._start()):await this._start()}createMessageTransports(t){function i(u,c){if(!u&&!c)return;let h=Object.create(null);return Object.keys(process.env).forEach(d=>h[d]=process.env[d]),u&&Object.keys(u).forEach(d=>h[d]=u[d]),h}function r(u){if(u.stdin===null||u.stdout===null||u.stderr===null)throw new Error("Process created without stdio streams")}let o=this._serverOpt
`)),!1):!0}function iTe(n){switch(n){case"info":return 1;case"warn":return 2;case"error":return 3;case"never":return 4;default:return 4}}function zQ(n,e){let t=[],i=["file","untitled"].concat(e||[]);return n?(n.forEach(r=>{t.push(...i.map(o=>({language:r,scheme:o})))}),t):i.map(r=>({scheme:r}))}function nTe(n){let{transport:e,transportPort:t}=n;return!e||e=="ipc"?1:e=="stdio"?0:e=="pipe"?2:{kind:3,port:t}}function rTe(n){return{cwd:n.cwd,execArgv:n.execArgv??[],env:n.env??void 0}}function oTe(n){return{cwd:n.cwd,detached:!!n.detached,shell:!!n.shell,env:n.env??void 0}}function JQ(n){switch(n){case 2:return 3;case 3:return 1;case 1:return 5;default:return}}function $Q(n){switch(n){case 2:return"running";case 3:return"starting";case 1:return"stopped";default:return"unknown"}}function sTe(n){switch(n){case 0:return"init";case 3:return"running";case 1:return"starting";case 2:return"startFailed";case 4:return"stopping";case 5:return"stopped";default:return"unknown"}}var UQ,XQ,GQ,Mu,ju,fF,yn,Hm=k(()=>{"use strict";UQ=S(require("fs")),XQ=S(require("net")),GQ=S(require("path")),Mu=S(W());Pe();pF();dn();re();xe();ie();ju=q()("services"),fF=class{constructor(){this.registered=new Map;this.disposables=[];this.pendingNotifications=new Map}init(){v.onDidOpenTextDocument(i=>{this.start(i)},null,this.disposables);let e=i=>{for(let r of i)this.registerClientsFromFolder(r)};v.onDidChangeWorkspaceFolders(i=>{e(i.added)},null,this.disposables);let t=v.getConfiguration(void 0,null).get("languageserver",{});this.registerClientsByConfig(t),e(v.workspaceFolders),this.registLanguageClient=this.registerLanguageClient}registerClientsFromFolder(e){let t=j.parse(e.uri),r=v.getConfiguration(void 0,t).inspect("languageserver").workspaceFolderValue;r&&this.registerClientsByConfig(r,t)}regist(e){return this.register(e)}register(e){let{id:t}=e;if(!this.registered.get(t))return this.registered.set(t,e),ju.info(`registered service "${t}"`),this.shouldStart(e)&&e.start(),e.onServiceReady(()=>{ju.info(`service ${t} started`)},null,this.disposables),Mu.Disposable.create(()=>{!this.registered.has(t)||(e.dispose(),this.registered.delete(t))})}getService(e){let t=this.registered.get(e);return t||(t=this.registered.get(`languageserver.${e}`)),t}shouldStart(e){if(e.state!=0)return!1;let t=e.selector;for(let i of v.documents)if(v.match(t,i.textDocument))return!0;return!1}async start(e){let t=[];for(let i of this.registered.values())i.state==0&&v.match(i.selector,e)>0&&t.push(i);await Promise.allSettled(t.map(i=>i.start()))}stop(e){let t=this.registered.get(e);if(t)return Promise.resolve(t.stop())}async toggle(e){let t=this.registered.get(e);if(!t)throw new Error(`Service ${e} not found`);let{state:i}=t;i==3?await Promise.resolve(t.stop()):i==0||i==2?await t.start():i==5&&await t.restart()}getServiceStats(){let e=[];for(let[t,i]of this.registered)e.push({id:t,languageIds:VDe(i.selector),state:sTe(i.state)});return e}registerClientsByConfig(e,t){for(let i of Object.keys(e)){let r=e[i];!tTe(i,r)||this.registerLanguageClient(i,r,t)}}async getLanguageClient(e){let t=this.getService(e);if(t||await Nt(100),t=this.getService(e),!t||!t.client)throw new Error(`Language server ${e} not found`);return t.client}async sendNotification(e,t,i){let r=await this.getLanguageClient(e);await Promise.resolve(r.sendNotification(t,i))}async sendRequest(e,t,i,r){let o=await this.getLanguageClient(e);return r=r??Mu.CancellationToken.None,await Promise.resolve(o.sendRequest(t,i,r))}async registerNotification(e,t){let i=this.getService(e);i&&i.client&&i.client.onNotification(t,async o=>{this.sendNotificationVim(e,t,o)});let r=this.pendingNotifications.get(e)??[];r.push({id:e,method:t}),this.pendingNotifications.set(e,r)}getRegisteredNotifications(e){return e=e.startsWith("languageserver")?e.slice(15):e,this.pendingNotifications.get(e)??[]}sendNotificationVim(e,t,i){v.nvim.call("coc#do_notify",[e,t,i],!0)}registLanguageClient(e,t,i){return typeof e=="string"?this.registerLanguageClient(e,t,i):this.registerLanguageClient(e)}registerLanguageClient(e,t,i){let r=typeof e=="string"?`languageserve
`)&&(t=e.label=t.replace(/\r?\n/g," ")),t.includes(uTe)){let{line:r,highlights:o}=lh(t);e.label=r,Array.isArray(e.ansiHighlights)||(e.ansiHighlights=o)}return e.converted=!0,e}dispose(){this.stop()}}});var wF,c4,dTe,gTe,Jm,h4=k(()=>{"use strict";wF=S(Pn()),c4=S(W());Wo();Ta();re();xe();ie();yF();r4();u4();dTe=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],gTe=q()("list-session"),Jm=class{constructor(e,t,i,r,o=[],s,a){this.nvim=e;this.prompt=t;this.list=i;this.listOptions=r;this.listArgs=o;this.config=s;this.loadingFrame="";this.hidden=!1;this.disposables=[];this.args=[];this.ui=new Ym(e,i.name,r,s),this.history=new Nu(t,i.name,a,v.cwd),this.worker=new Zm(e,i,t,r,{interactiveDebounceTime:s.get("interactiveDebounceTime",100),extendedSearchMode:s.get("extendedSearchMode",!0)}),this.interactiveDebounceTime=s.get("interactiveDebounceTime",100);let l=(0,wF.default)(async()=>{let[g,p,f]=await e.eval('[coc#list#has_preview(),win_getid(),line(".")]');if(g&&p==this.winid){let m=this.ui.lnumToIndex(f);await this.doPreview(m)}},50);this.disposables.push({dispose:()=>{l.clear()}}),this.ui.onDidChangeLine(l,null,this.disposables),this.ui.onDidChangeLine(this.resolveItem,this,this.disposables),this.ui.onDidLineChange(this.resolveItem,this,this.disposables);let u=(0,wF.default)(async()=>{this.updateStatus();let{autoPreview:g}=this.listOptions;if(!g){let[p,f]=await e.eval("[coc#list#has_preview(),mode()]");if(!p||f!="n")return}await this.doAction("preview")},50);this.disposables.push({dispose:()=>{u.clear()}}),this.ui.onDidLineChange(u,null,this.disposables),this.ui.onDidOpen(async()=>{typeof this.list.doHighlight=="function"&&this.list.doHighlight(),v.isVim&&this.prompt.drawPrompt(),this.listOptions.first&&await this.doAction()},null,this.disposables),this.ui.onDidClose(this.hide,this,this.disposables),this.ui.onDidDoubleClick(this.doAction,this,this.disposables),this.worker.onDidChangeItems(g=>{this.hidden||this.ui.onDidChangeItems(g)},null,this.disposables);let c=0,h,d;this.disposables.push(c4.Disposable.create(()=>{h&&clearTimeout(h),d&&clearInterval(d)})),this.worker.onDidChangeLoading(g=>{this.hidden||(h&&clearTimeout(h),g?(c=Date.now(),d&&clearInterval(d),d=setInterval(()=>{let p=Math.floor((Date.now()-c)%1e3/100);this.loadingFrame=dTe[p],this.updateStatus()},100)):h=setTimeout(()=>{this.loadingFrame="",d&&clearInterval(d),d=null,this.updateStatus()},Math.max(0,200-(Date.now()-c))))},null,this.disposables)}async start(e){this.args=e,this.cwd=v.cwd,this.hidden=!1;let{listArgs:t}=this,i=await this.nvim.eval('[win_getid(),bufnr("%"),winheight("%")]');this.listArgs=t,this.history.filter(),this.window=this.nvim.createWindow(i[0]),this.buffer=this.nvim.createBuffer(i[1]),this.savedHeight=i[2],await this.worker.loadItems(this.context)}async reloadItems(){!this.ui.winid||await this.worker.loadItems(this.context,!0)}async call(e){var o,s;await this.nvim.call("coc#prompt#stop_prompt",["list"]);let t=await this.ui.getItems(),i={name:this.name,args:this.listArgs,input:this.prompt.input,winid:(o=this.window)==null?void 0:o.id,bufnr:(s=this.buffer)==null?void 0:s.id,targets:t},r=await this.nvim.call(e,[i]);return this.prompt.start(),r}async chooseAction(){let{nvim:e,defaultAction:t}=this,{actions:i}=this.list,r=i.map(h=>h.name),o=r.indexOf(t.name);o!=-1&&(r.splice(o,1),r.unshift(t.name));let s=new Set,a=[],l=[],u=v.env.dialog&&this.config.get("menuAction",!1);for(let h of r){let d=0;for(let g of h){if(!s.has(g)){s.add(g),a.push(`${h.slice(0,d)}&${h.slice(d)}`);break}d++}d==h.length&&l.push(h)}l.length&&!u&&(r=r.filter(h=>!l.includes(h)));let c;u?(e.call("coc#prompt#stop_prompt",["list"],!0),c=await D.showMenuPicker(r,{title:"Choose action",shortcuts:!0}),c=c+1,v.isVim&&await Nt(10),this.prompt.start()):(await e.call("coc#prompt#stop_prompt",["list"]),c=await e.call("confirm",["Choose action:",a.join(`
`)]),await Nt(10),this.prompt.start()),c&&await this.doAction(r[c-1])}async doAction(e){let{list:t}=this,i;if(e!=null){if(i=t.actions.find(o=>o.name==e),!i){D.showErrorMessage(`Action ${e} not found`);return}}else i=this.defaultAction;let r;if(e=="preview"){let o=await this.ui.item;r=o?[o]:[]}else r=await this.ui.getItems();r.length&&await this.doItemAction(r,i)}async doPreview(e){let t=this.ui.getItem(e),i=this.list.actions.find(r=>r.name=="preview");!t||!i||await this.doItemAction([t],i)}async first(){await this.doDefaultAction(0)}async last(){await this.doDefaultAction(this.ui.length-1)}async previous(){await this.doDefaultAction(this.ui.index-1)}async next(){await this.doDefaultAction(this.ui.index+1)}async doDefaultAction(e){let{ui:t}=this,i=t.getItem(e);!i||(await this.ui.setIndex(e),await this.doItemAction([i],this.defaultAction),await t.echoMessage(i))}get name(){return this.list.name}get winid(){return this.ui.winid}get length(){return this.ui.length}get defaultAction(){let{defaultAction:e,actions:t,name:i}=this.list,r=v.getConfiguration(`list.source.${i}`),o;if(r.defaultAction&&(o=t.find(s=>s.name==r.defaultAction)),o||(o=t.find(s=>s.name==e)),o||(o=t[0]),!o)throw new Error(`default action "${e}" not found`);return o}async hide(e=!1){if(this.hidden)return;let{nvim:t,timer:i,window:r}=this,{winid:o,tabnr:s}=this.ui;i&&clearTimeout(i),this.worker.stop(),this.history.add(),this.ui.reset(),this.hidden=!0;let{isVim:a}=v;if(a&&await t.call("feedkeys",["\x1B","int"]),t.pauseNotification(),a||t.call("coc#prompt#stop_prompt",["list"],!0),s&&t.call("coc#list#close_preview",[s],!0),r&&t.call("win_gotoid",[r.id],!0),o&&t.call("coc#window#close",[o],!0),r&&this.savedHeight&&this.listOptions.position!=="tab"&&t.call("coc#window#set_height",[r.id,this.savedHeight],!0),e)return t.resumeNotification(!0,!0);await t.resumeNotification(!0)}toggleMode(){let e=this.prompt.mode=="normal"?"insert":"normal";this.prompt.mode=e,this.listOptions.mode=e,this.updateStatus()}stop(){this.worker.stop()}async resolveItem(){let e=this.ui.index,t=this.ui.getItem(e);if(!t||t.resolved)return;let{list:i}=this;if(typeof i.resolveItem=="function"){let r=t.label,o=await Promise.resolve(i.resolveItem(t));if(o&&e==this.ui.index){if(Object.assign(t,o,{resolved:!0}),r==o.label)return;this.ui.updateItem(t,e)}}}async showHelp(){await this.hide();let{list:e,nvim:t}=this;if(!e)return;t.pauseNotification(),t.command("tabe +setl\\ previewwindow [LIST HELP]",!0),t.command("setl nobuflisted noswapfile buftype=nofile bufhidden=wipe",!0),await t.resumeNotification();let i=e.options&&e.options.length,r=await t.buffer,o=new Hi;if(o.addLine("NAME","Label"),o.addLine(` ${e.name} - ${e.description||""}
`),o.addLine("SYNOPSIS","Label"),o.addLine(` :CocList [LIST OPTIONS] ${e.name}${i?" [ARGUMENTS]":""}
`),e.detail){o.addLine("DESCRIPTION","Label");let a=e.detail.split(`
`).map(l=>" "+l);o.addLine(a.join(`
`)+`
`)}if(i){o.addLine("ARGUMENTS","Label"),o.addLine("");for(let a of e.options)o.addLine(a.name,"Special"),o.addLine(` ${a.description}`),o.addLine("");o.addLine("")}let s=v.getConfiguration(`list.source.${e.name}`);if(Object.keys(s).length){o.addLine("CONFIGURATIONS","Label"),o.addLine("");let a={};je.all.forEach(l=>{let{packageJSON:u}=l,{contributes:c}=u;if(!c)return;let{configuration:h}=c;if(h){let{properties:d}=h;if(d)for(let g of Object.keys(d))a[g]=d[g]}});for(let l of Object.keys(s)){let u=s[l],c=`list.source.${e.name}.${l}`,h=a[c]&&a[c].description?a[c].description:l;o.addLine(` "${c}"`,"MoreMsg"),o.addText(` - ${h}, current value: `),o.addText(JSON.stringify(u),"Special")}o.addLine("")}o.addLine("ACTIONS","Label"),o.addLine(` ${e.actions.map(a=>a.name).join(", ")}`),o.addLine(""),o.addLine("see ':h coc-list-options' for available list options.","Comment"),t.pauseNotification(),o.render(r,0,-1),t.command("setl nomod",!0),t.command("setl nomodifiable",!0),t.command("normal! gg",!0),t.command("nnoremap <buffer> q :bd!<CR>",!0),await t.resumeNotification()}async switchMatcher(){let{matcher:e,interactive:t}=this.listOptions;if(t)return;let i=["fuzzy","strict","regex"],r=i.indexOf(e)+1;r>=i.length&&(r=0),this.listOptions.matcher=i[r],this.prompt.matcher=i[r],await this.worker.drawItems()}updateStatus(){let{ui:e,list:t,nvim:i}=this;if(!e.bufnr)return;let r=i.createBuffer(e.bufnr),o={mode:this.prompt.mode.toUpperCase(),args:this.args.join(" "),name:t.name,cwd:this.cwd,loading:this.loadingFrame,total:this.worker.length};r.setVar("list_status",o,!0),i.command("redraws",!0)}get context(){let{winid:e}=this.ui;return{options:this.listOptions,args:this.listArgs,input:this.prompt.input,cwd:v.cwd,window:this.window,buffer:this.buffer,listWindow:e?this.nvim.createWindow(e):void 0}}onMouseEvent(e){switch(e){case"<LeftMouse>":return this.ui.onMouse("mouseDown");case"<LeftDrag>":return this.ui.onMouse("mouseDrag");case"<LeftRelease>":return this.ui.onMouse("mouseUp");case"<2-LeftMouse>":return this.ui.onMouse("doubleClick")}}async doNumberSelect(e){if(!this.listOptions.numberSelect)return!1;let t=e.charCodeAt(0);if(t>=48&&t<=57){let i=Number(e);if(i==0&&(i=10),this.ui.length>=i)return this.nvim.pauseNotification(),this.ui.setCursor(i),await this.nvim.resumeNotification(),await this.doAction(),!0}return!1}jumpBack(){let{window:e,nvim:t}=this;e&&(t.pauseNotification(),t.call("coc#prompt#stop_prompt",["list"],!0),this.nvim.call("win_gotoid",[e.id],!0),t.resumeNotification(!1,!0))}async resume(){this.winid&&await this.hide();let e=await this.nvim.eval('[win_getid(),bufnr("%"),winheight("%")]');this.hidden=!1,this.window=this.nvim.createWindow(e[0]),this.buffer=this.nvim.createBuffer(e[1]),this.savedHeight=e[2],this.prompt.start(),await this.ui.resume(),this.listOptions.autoPreview&&await this.doAction("preview")}async doItemAction(e,t){let{noQuit:i,position:r}=this.listOptions,{nvim:o}=this,s=t.persist===!0||t.name=="preview";r==="tab"&&t.tabPersist&&(s=!0);let a=this.winid&&(s||i);try{if(a?s||(o.pauseNotification(),o.call("coc#prompt#stop_prompt",["list"],!0),o.call("win_gotoid",[this.context.window.id],!0),await o.resumeNotification()):await this.hide(),t.multiple)await Promise.resolve(t.execute(e,this.context));else if(t.parallel)await Promise.all(e.map(l=>Promise.resolve(t.execute(l,this.context))));else for(let l of e)await Promise.resolve(t.execute(l,this.context));a&&this.ui.restoreWindow(),t.reload&&a?await this.reloadItems():a&&this.nvim.command("redraw",!0)}catch(l){gTe.error(`Error on action ${t.name}`,l),this.nvim.echoError(l)}}onInputChange(){var e;this.timer&&clearTimeout(this.timer),(e=this.ui)==null||e.cancel(),this.history.filter(),this.listOptions.input=this.prompt.input,this.listOptions.interactive?(this.worker.stop(),this.timer=setTimeout(async()=>{await this.worker.loadItems(this.context)},this.interactiveDebounceTime)):this.worker.drawItems()}dispose(){this.hide(!0),U(this.disposables),this.worker.dispose(),this.ui.dispose()}}});var d4,g4,p4,pTe,$m,f4=k(()=>{"use strict";d4=require("child_process"),g4=require("e
`,"\v","\f","\r","","","","","","","","","","","","","","\x1B","","","",""," ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","\x7F","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""," ","!","C/","PS","$?","Y=","|","SS",'"',"(c)","a","<<","!","","(r)","-","deg","+-","2","3","'","u","P","*",",","1","o",">>","1/4","1/2","3/4","?","A","A","A","A","A","A","AE","C","E","E","E","E","I","I","I","I","D","N","O","O","O","O","O","x","O","U","U","U","U","U","Th","ss","a","a","a","a","a","a","ae","c","e","e","e","e","i","i","i","i","d","n","o","o","o","o","o","/","o","u","u","u","u","y","th","y"]});var J4=y((b7e,Z4)=>{Z4.exports=["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","IJ","","J","j","K","k","k","L","l","L","l","L","l","L","l","L","l","N","n","N","n","N","n","'n","ng","NG","O","o","O","o","O","o","OE","oe","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","s","b","B","B","b","6","6","O","C","c","D","D","D","d","d","3","@","E","F","f","G","G","hv","I","I","K","k","l","l","W","N","n","O","O","o","OI","oi","P","p","YR","2","2","SH","sh","t","T","t","T","U","u","Y","V","Y","y","Z","z","ZH","ZH","zh","zh","2","5","5","ts","w","|","||","|=","!","DZ","Dz","dz","LJ","Lj","lj","NJ","Nj","nj","A","a","I","i","O","o","U","u","U","u","U","u","U","u","U","u","@","A","a","A","a","AE","ae","G","g","G","g","K","k","O","o","O","o","ZH","zh","j","DZ","D","dz","G","g","HV","W","N","n","A","a","AE","ae","O","o"]});var U4=y((y7e,$4)=>{$4.exports=["A","a","A","a","E","e","E","e","I","i","I","i","O","o","O","o","R","r","R","r","U","u","U","u","S","s","T","t","Y","y","H","h","[?]","[?]","OU","ou","Z","z","A","a","E","e","O","o","O","o","O","o","O","o","Y","y","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","a","a","a","b","o","c","d","d","e","@","@","e","e","e","e","j","g","g","g","g","u","Y","h","h","i","i","I","l","l","l","lZ","W","W","m","n","n","n","o","OE","O","F","R","R","R","R","r","r","R","R","R","s","S","j","S","S","t","t","U","U","v","^","W","Y","Y","z","z","Z","Z","?","?","?","C","@","B","E","G","H","j","k","L","q","?","?","dz","dZ","dz","ts","tS","tC","fN","ls","lz","WW","]]","[?]","[?]","k","h","j","r","r","r","r","w","y","'",'"',"`","'","`","`","'","?","?","<",">","^","V","^","V","'","-","/","\\",",","_","\\","/",":",".","`","'","^","V","+","-","V",".","@",",","~",'"',"R","X","G","l","s","x","?","","","","","","","","V","=",'"',"[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]"]});var G4=y((v7e,X4)=>{X4.exports=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","","","","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","'",",","[?]","[?]","[?]","[?]","","[?]","[?]","[?]","?","[?]","[?]","[?]","[?]","[?]","","","A",";","E","E","I","[?]","O","[?]","U","O","I","A","B","G","D","E","Z","E","Th","I","K","L","M","N","Ks","O","P","R","[?]","S","T","U","Ph","Kh","Ps","O","I","U","a","e","e","i","u","a","b","g","d","e","z","e","th","i","k","l","m","n","x","o","p","r","s","s","t","u","ph","kh"
`,`
`,"","","","",""," ","%0","%00","'","''","'''","`","``","```","^","<",">","*","!!","!?","-","_","-","^","***","--","/","-[","]-","[?]","?!","!?","7","PP","(]","[)","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","","","","","","","0","","","","4","5","6","7","8","9","+","-","=","(",")","n","0","1","2","3","4","5","6","7","8","9","+","-","=","(",")","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","ECU","CL","Cr","FF","L","mil","N","Pts","Rs","W","NS","D","EU","K","T","Dr","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","","","","","","","","","","","","","","","","","","","","","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]"]});var Y6=y((Y7e,W6)=>{W6.exports=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]"," 1/3 "," 2/3 "," 1/5 "," 2/5 "," 3/5 "," 4/5 "," 1/6 "," 5/6 "," 1/8 "," 3/8 "," 5/8 "," 7/8 "," 1/","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","L","C","D","M","i","ii","iii","iv","v","vi","vii","viii","ix","x","xi","xii","l","c","d","m","(D","D)","((|))",")","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","-","|","-","|","-","|","\\","/","\\","/","-","-","~","~","-","|","-","|","-","-","-","|","-","|","|","-","-","-","-","-","-","|","|","|","|","|","|","|","^","V","\\","=","V","^","-","-","|","|","-","-","|","|","=","|","=","=","|","=","|","=","=","=","=","=","=","|","=","|","=","|","\\","/","\\","/","=","=","~","~","|","|","-","|","-","|","-","-","-","|","-","|","|","|","|","|","|","|","-","\\","\\","|","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]"]});var J6=y((Z7e,Z6)=>{Z6.exports=["[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]"]});var U6=y((J7e,$6)=>{$6.exports=["[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]
`)}function Ree(n){let{range:e,context:t,line:i}=n,r=["import re, os, vim, string, random",`path = vim.eval('expand("%:p")') or ""`,"fn = os.path.basename(path)"];t?(r.push("snip = ContextSnippet()"),r.push(`context = ${t}`)):r.push("context = True");let o=`(${e.start.line},${Buffer.byteLength(i.slice(0,e.start.character))})`,s=`(${e.start.line},${Buffer.byteLength(i.slice(0,e.end.character))})`,a=i.match(/^\s*/)[0];return r.push(`snip = SnippetUtil("${sb(a)}", ${o}, ${s}, context)`),r}async function md(n,e){try{await n.command(`pyx ${PTe(e.join(`
`))}`)}catch(t){let i=new Error(t instanceof Error?t.message:t.toString());throw i.stack=`Error on execute python code:
${e.join(`
`)}
`+(t instanceof Error?t.stack:t),i}}function ab(n){let e=Object.keys(n),t=e.length?Math.max.apply(null,e.map(r=>Number(r))):0,i=new Array(t).fill('""');for(let[r,o]of Object.entries(n))i[r]=`"${sb(o)}"`;return`t = (${i.join(",")},)`}function PTe(n,e=!1){if(!kTe&&e===!1)return n;let t=["import traceback, vim","vim.vars['errmsg'] = ''","try:"];return t.push(...n.split(`
`).map(i=>" "+i)),t.push("except Exception as e:"),t.push(" vim.vars['errmsg'] = traceback.format_exc()"),t.join(`
`)}function sb(n){return n.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\t/g,"\\t").replace(/\n/g,"\\n")}function _ee(n){if(n.indexOf("\\z")!==-1)throw new Error("pattern \\z not supported");if(n.indexOf("(?s)")!==-1)throw new Error("pattern (?s) not supported");if(n.indexOf("(?x)")!==-1)throw new Error("pattern (?x) not supported");if(n.indexOf(`
`)!==-1)throw new Error("pattern \\n not supported");if(RTe.test(n))throw new Error("pattern (?id/name)yes-pattern|no-pattern not supported");return n.replace(FTe,(e,t)=>e=="\\A"?"^":e.startsWith("(?#")?"":e.startsWith("(?P<")?"(?"+e.slice(3):e.startsWith("(?P=")?`\\k<${t}>`:"")}var kee,Pee,Ntt,kTe,ETe,RTe,_Te,LTe,ITe,FTe,SF=k(()=>{"use strict";kee=require("child_process"),Pee=require("util"),Ntt=q()("snippets-eval"),kTe=process.env.VIM_NODE_RPC=="1";ETe=/\\A/,RTe=/\(\?\(\w+\).+\|/,_Te=/\(\?#.*?\)/,LTe=/\(\?P<\w+>.*?\)/,ITe=/\(\?P=(\w+)\)/,FTe=new RegExp(`${_Te.source}|${ETe.source}|${LTe.source}|${ITe.source}`,"g")});function Iee(n,e){let t=[...n];for(;t.length>0;){let i=t.shift();if(!e(i))break;t.unshift(...i.children)}}function ATe(n,e=[]){let t="",i=n.length,r=0,o=!1,s=!1;for(;r<i;){let a=n[r];if(a.charCodeAt(0)===92&&!e.includes(r)){let l=n[r+1];if(OTe.includes(l)){r++;continue}if(l=="u"||l=="l"){let u=n[r+2];u&&(t=t+(l=="u"?u.toUpperCase():u.toLowerCase())),r=r+3;continue}if(l=="U"||l=="L"){l=="U"?o=!0:s=!0,r=r+2;continue}if(l=="E"){o=!1,s=!1,r=r+2;continue}if(l=="n"){t+=`
`,r=r+2;continue}if(l=="t"){t+=" ",r=r+2;continue}}o?a=a.toUpperCase():s&&(a=a.toLowerCase()),t+=a,r++}return t}var Fee,jTe,Lee,MTe,fo,vD,$o,yt,Jo,wD,ct,bd,lb,yd,ur,mo,vd,As,OTe,xD=k(()=>{"use strict";Fee=S(bD());nt();Tee();_e();SF();jTe=q()("snippets-parser"),Lee=["VISUAL","YANK","UUID"],MTe=["d","g","i","m","s","u","y"],fo=class{static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}constructor(){this.text("")}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};let e=this.pos,t=0,i=this.value.charCodeAt(e),r;if(r=fo._table[i],typeof r=="number")return this.pos+=1,{type:r,pos:e,len:1};if(fo.isDigitCharacter(i)){r=8;do t+=1,i=this.value.charCodeAt(e+t);while(fo.isDigitCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}if(fo.isVariableCharacter(i)){r=9;do i=this.value.charCodeAt(e+ ++t);while(fo.isVariableCharacter(i)||fo.isDigitCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}r=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof fo._table[i]>"u"&&!fo.isDigitCharacter(i)&&!fo.isVariableCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}},vD=fo;vD._table={[36]:0,[58]:1,[44]:2,[123]:3,[125]:4,[92]:5,[47]:6,[124]:7,[43]:11,[45]:12,[63]:13,[40]:15,[41]:16,[96]:17,[33]:18};$o=class{constructor(){this._children=[]}appendChild(e){return e instanceof yt&&this._children[this._children.length-1]instanceof yt?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}setOnlyChild(e){e.parent=this,this._children=[e]}replaceChildren(e){for(let t of e)t.parent=this;this._children=e}get children(){return this._children}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof vd)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}},yt=class extends $o{constructor(t){super();this.value=t}static escape(t){return t.replace(/\$|}|\\/g,"\\$&")}toString(){return this.value}toTextmateString(){return yt.escape(this.value)}len(){return this.value.length}clone(){return new yt(this.value)}},Jo=class extends $o{constructor(t,i,r){super();this.code=t;this.kind=i;this._value="";this._related=[];if(i==="python"){let{_related:o}=this,s,a=/\bt\[(\d+)\]/g;for(;s=a.exec(t),s!=null;){let l=parseInt(s[1],10);o.includes(l)||o.push(l)}}typeof r=="string"&&(this._value=r)}get related(){return this._related}update(t){if(this.kind!=="python")return;let i=new Set;this.code=this.code.replace(/\bt\[(\d+)\]/g,(r,o)=>{let s=Number(o),a=t.has(s)?t.get(s):s;return i.add(a),`t[${a}]`}),this._related=Array.from(i)}get index(){if(this.parent instanceof ct)return this.parent.index}async resolve(t){if(!this.code.length)return;let i=await Eee(t,this.kind,this.code,this._value??"");i!=null&&(this._value=i)}len(){return this._value.length}toString(){return this._value}get value(){return this._value}toTextmateString(){let t="";return this.kind=="python"?t="!p ":this.kind=="shell"?t="":this.kind=="vim"&&(t="!v "),"`"+t+this.code+"`"}clone(){return new Jo(this.code,this.kind,this.value)}},wD=class extends $o{},ct=class extends wD{constructor(t){super();this.index=t;this.primary=!1}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof bd?this._children[0]:void 0}toTextmateString(){let t="";return this.transform&&(t=this.transform.toTextmateString()),this.children.length===0&&!this.transform?`$${this.index}`:this.children.length===0?`\${${this.index}${t}}`:this.choice?`\${${this.index}|${this.choice.toTextmateString()}|${t}}`:`\${${this.index}:${this.children.map(i=>i.toTextmateString()).join("")}${t}}`}clone(){let t=new ct(this.index);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(i=>i.clone()),t}},bd=class extends $o{constructor(){super(...arguments);this.options=[]}appendChild(t){return t instanceof yt&&(t.parent=this,this.options.push(t)),this}toString(){return this.options[0].value}toTextmat
`)){let r="";this.snippet.walk(u=>{if(u==this)return!1;if(u instanceof yt){let c=u.toString().split(/\r?\n/);r=c[c.length-1].match(/^\s*/)[0]}return!0});let o=i.split(`
`),s=o.filter(u=>u.length>0).map(u=>u.match(/^\s*/)[0]),a=s.length==0?"":s.reduce((u,c)=>u.length<c.length?u:c);i=o.map((u,c)=>c==0||u.length==0||!u.startsWith(a)?u:r+u.slice(a.length)).join(`
`)}return this.transform&&(i=this.transform.resolve(i||"")),i!==void 0?(this._children=[new yt(i)],!0):!1}toTextmateString(){let t="";return this.transform&&(t=this.transform.toTextmateString()),this.children.length===0?`\${${this.name}${t}}`:`\${${this.name}:${this.children.map(i=>i.toTextmateString()).join("")}${t}}`}clone(){let t=new mo(this.name,this.resolved);return this.transform&&(t.transform=this.transform.clone()),t._children=this.children.map(i=>i.clone()),t}};vd=class extends $o{constructor(t){super();this.ultisnip=t===!0}get hasPython(){return this.ultisnip?this.pyBlocks.length>0:!1}get hasCodeBlock(){if(!this.ultisnip)return!1;let{pyBlocks:t,otherBlocks:i}=this;return t.length>0||i.length>0}get values(){if(this._values)return this._values;let t={},i=0;this.placeholders.forEach(r=>{i=Math.max(r.index,i),r.transform==null&&(r.primary||t[r.index]===void 0)&&(t[r.index]=r.toString())});for(let r=0;r<=i;r++)t[r]===void 0&&(t[r]="");return this._values=t,t}get orderedPyIndexBlocks(){let t=[],i=this.pyBlocks.filter(a=>typeof a.index=="number");if(i.length==0)return t;let r=i.map(a=>a.index),o=[],s=a=>{let{related:l}=a;return l.length==0||l.every(u=>!r.includes(u)||o.includes(u))?(o.push(a.index),t.push(a),!0):!1};for(;i.length>0;){let a=!1;for(let l of i)s(l)&&(a=!0);if(!a)break;i=i.filter(l=>!o.includes(l.index))}return t}async evalCodeBlocks(t,i){let{pyBlocks:r,otherBlocks:o}=this;if(await Promise.all(o.map(s=>{let a=s.value;return s.resolve(t).then(()=>{s.parent instanceof ct&&a!==s.value&&this.onPlaceholderUpdate(s.parent)})})),r.length){let s=ab(this.values);await md(t,[...i,s]);for(let l of r){let u=l.value;await l.resolve(t),u!==l.value&&l.parent instanceof ct&&(this.onPlaceholderUpdate(l.parent),await md(t,[ab(this.values)]))}for(let l of this.orderedPyIndexBlocks)await this.updatePyIndexBlock(t,l);let a=r.filter(l=>l.index===void 0&&l.related.length>0);for(let l of a)await l.resolve(t)}}async updatePythonCodes(t,i){let r;if(i instanceof ct)r=i.index;else for(;i.parent;){if(i instanceof ct){r=i.index;break}i=i.parent}if(r===void 0)return;let o=this.getDependentPyIndexBlocks(r);await md(t,[ab(this.values)]);for(let a of o)await this.updatePyIndexBlock(t,a);let s=this.pyBlocks.filter(a=>a.index===void 0&&a.related.length>0);for(let a of s)await a.resolve(t)}getDependentPyIndexBlocks(t){let i=[],r=[],o=this.pyBlocks.filter(a=>typeof a.index=="number"),s=a=>{let l=o.filter(u=>!r.includes(u.index)&&u.related.includes(a));l.length>0&&(i.push(...l),l.forEach(u=>{s(u.index)}))};return s(t),i}async updatePyIndexBlock(t,i){let r=i.value;await i.resolve(t),r!==i.value&&(i.parent instanceof ct&&this.onPlaceholderUpdate(i.parent),await md(t,[ab(this.values)]))}get placeholderInfo(){if(!this._placeholders){let t=[],i=[],r=[],o=[];this.walk(s=>{if(s instanceof ct)o.push(s);else if(s instanceof mo){let a=s.name.charCodeAt(0);(a<65||a>90)&&t.push(s)}else s instanceof Jo&&(s.kind==="python"?i.push(s):r.push(s));return!0}),this._placeholders={placeholders:o,pyBlocks:i,otherBlocks:r,variables:t}}return this._placeholders}get variables(){return this.placeholderInfo.variables}get placeholders(){return this.placeholderInfo.placeholders}get pyBlocks(){return this.placeholderInfo.pyBlocks}get otherBlocks(){return this.placeholderInfo.otherBlocks}get maxIndexNumber(){let{placeholders:t}=this;return t.reduce((i,r)=>Math.max(i,r.index),0)}get first(){let{placeholders:t,variables:i}=this,[r,o]=_B(t.filter(s=>!s.transform),s=>s.index!==0);if(r.length){let s=Math.min.apply(null,r.map(l=>l.index)),a=r.filter(l=>l.index==s);return a.find(l=>l.primary)??a[0]}return i.length?i[0]:o.find(s=>s.primary)??o[0]}insertSnippet(t,i,r,o){let s=i instanceof ct?i.index:this.maxIndexNumber+1,[a,l]=r,u=o?yD(o):void 0,c=new As(!!o,u).parse(t,!0),h=c.maxIndexNumber+1,d=new Map;for(let m of c.placeholders){let b=m.index;m.isFinalTabstop?m.index=h+s:m.index=m.index+s,d.set(b,m.index)}o&&c.pyBlocks.forEach(m=>{m.update(d)});let g=new Map;this.walk(m=>{if(m instanceof ct&&m.index>s){let b=m.index;m.index=m.index+h,g.set(b,m.index)}return!0}),this.hasPython&&t
`:"";if(r.indexOf(`
`)==-1){let s=new Jo(o+r.trim(),"python");e.appendChild(s)}else{let s=r.split(/\r?\n/);s=s.filter(u=>!/^\s*$/.test(u));let a=s[0]?s[0].match(/^\s*/)[0]:"";a.length&&s.every(u=>u.startsWith(a))&&(s=s.map(u=>u.slice(a.length))),a==" "&&s[0].startsWith(a)&&(s[0]=s[0].slice(1));let l=new Jo(o+s.join(`
`),"python");e.appendChild(l)}return!0}}return this._backTo(t),!1}_parseAnything(e){if(this._token.type!==14){let t=this._scanner.tokenText(this._token);return e.appendChild(new yt(t)),this._accept(void 0),!0}return!1}},OTe=[":","(",")","{","}"]});function DF(n,e){let{range:t,newText:i}=n,r=e.length,o=i.length;if(r===0||o===0)return n;let{start:s,end:a}=t,l=0;for(let d=1;d<=Math.min(o,r)&&i[d-1]===e[d-1];d++)l=d;let u=0,c=Math.min(o-l,r-l);if(c>0)for(let d=1;d<=c&&i[o-d]===e[r-d];d++)u=d;let h=u==0?i.slice(l):i.slice(l,-u);return l>0&&(s=Ki(s,i.slice(0,l))),u>0&&(a=Ki(t.start,e.slice(0,-u))),rn.TextEdit.replace(rn.Range.create(s,a),h)}function jee(n,e,t){let i=rn.Range.create(n,Ki(n,t));return ft(e,i)==0}function Mee(n,e,t){if(t.lines.length<n.line)return!1;let r=!0;for(let o=n.line;o>=0;o--){let s=t.lines[o]??"";if(o===n.line){let a=e.lines[o].slice(0,n.character);if(!s.startsWith(a)){r=!1;break}}else if(s!==e.lines[o]){r=!1;break}}return r}function Oee(n,e,t){let i=e.lines.length;if(t.lines.length<i-n.line)return;let r,o=t.lines.length-i;for(let s=n.line;s<i;s++){let a=t.lines[s+o];if(s==n.line){let l=e.lines[s].slice(n.character);if(l.length&&!a.endsWith(l))break;r=rn.Position.create(s+o,a.length-l.length)}else if(a!==e.lines[s]){r=void 0;break}}return r}function Aee(n,e,t){let i=[],r=[],o=n.split(`
`),s=t.start.line-e.start.line;for(let a=0;a<=s;a++){let l=o[a]??"";a==s?i.push(a==0?l.substring(0,t.start.character-e.start.character):l.substring(0,t.start.character)):i.push(l)}s=e.end.line-t.end.line;for(let a=0;a<=s;a++){let l=o[t.end.line-e.start.line+a]??"";a==0?s==0?r.push(e.end.character==t.end.character?"":l.slice(t.end.character-e.end.character)):r.push(l.substring(t.end.character)):r.push(l)}return[i.join(`
`),r.join(`
`)]}function Nee(n,e,t){let i=n.split(/\r?\n/),r=t.insertSpaces?" ".repeat(t.tabSize):" ",o=t.tabSize||2;return i=i.map((s,a)=>{let l=s.match(/^\s*/)[0],u=l,c=l.startsWith(" ");return c&&t.insertSpaces?u=r.repeat(l.length):!c&&!t.insertSpaces&&(u=r.repeat(l.length/o)),(a==0||s.length==0?"":e)+u+s.slice(l.length)}),i.join(`
`)}function Hee(n){return!!(/^\s/.test(n)||n.indexOf(`
`)!==-1)}var rn,Vtt,ub,TF=k(()=>{"use strict";rn=S(W());ph();xt();so();SF();xD();Vtt=q()("snippets-snipet"),ub=class{constructor(e,t,i,r){this.snippetString=e;this.position=t;this.nvim=i;this.resolver=r}async init(e,t=!1){let i=e?yD(e):void 0,o=new As(!!e,i).parse(this.snippetString,!0);this.tmSnippet=o,await this.resolve(e),this.synchronize(),t||(this.nvim.call("coc#compat#del_var",["coc_selected_text"],!0),this.nvim.call("coc#compat#del_var",["coc_last_placeholder"],!0))}async resolve(e){let{snippet:t}=this.tmSnippet,{resolver:i,nvim:r}=this;if(i&&await t.resolveVariables(i),e&&e.noPython!==!0){let o=[];t.hasPython&&(o=Ree(e)),await t.evalCodeBlocks(r,o)}}getRanges(e){let t=e.marker;if(e.value.length==0)return[];let r=this._placeholders.filter(l=>l.index==e.index).map(l=>l.range),o=this.tmSnippet.enclosingPlaceholders(t),s,a=t.parent;if(t instanceof ct){let l=t.index;s=this.tmSnippet.placeholders.filter(u=>u.index==l&&u.parent==a)}else{let l=t.name;s=this.tmSnippet.variables.filter(u=>u.name==l&&u.parent==a)}return o.forEach(l=>{let u=this._placeholders.filter(c=>c.index==l.index&&c.marker!==l);if(!!u.length)for(let c of s){let h=this.tmSnippet.getTextBefore(c,l);u.forEach(d=>{if(d.transform)r.push(d.range);else{let g=d.range.start;r.push(rn.Range.create(Ki(g,h),Ki(g,h+c.toString())))}})}}),r.filter(l=>!Lt(l))}getSortedPlaceholders(e){let t=e?[e]:[],i=this._placeholders.filter(r=>r!==e&&!r.transform);return i.sort((r,o)=>r.primary!==o.primary?r.primary?-1:1:r.index==0||o.index==0?r.index==0?1:-1:r.index-o.index),t.push(...i),t}get hasPython(){return this.tmSnippet.pyBlocks.length>0}resetStartPosition(e){this.position=e,this.synchronize()}get start(){return Object.assign({},this.position)}get range(){return rn.Range.create(this.position,Ki(this.position,this._text))}get text(){return this._text}get finalCount(){return this._placeholders.filter(e=>e.index==0).length}get placeholders(){return this._placeholders.map(e=>e.marker)}get firstPlaceholder(){let e=0;for(let t of this._placeholders)t.index==0||t.transform||(e==0||t.index<e)&&(e=t.index);return this.getPlaceholder(e)}getPlaceholderByMarker(e){return this._placeholders.find(t=>t.marker===e)}getPlaceholder(e){let t=this._placeholders.filter(r=>r.index==e&&!r.transform);return(t.find(r=>r.primary)||t[0])??t[0]}getPrevPlaceholder(e){if(e<=1)return;let t=this._placeholders.filter(r=>r.index<e&&r.index!=0&&!r.transform),i;for(;e>1;){e=e-1;let r=t.filter(o=>o.index==e);if(r.length){i=r.find(o=>o.primary)||r[0];break}}return i}getNextPlaceholder(e){let t=this._placeholders.filter(s=>!s.transform),i,r=t.map(s=>s.index),o=Math.max.apply(null,r);for(let s=e+1;s<=o+1;s++){let a=s==o+1?0:s,l=t.filter(u=>u.index==a);if(l.length){i=l.find(u=>u.primary)||l[0];break}}return i}getPlaceholderByRange(e){return this._placeholders.find(t=>Xt(e,t.range))}async insertSnippet(e,t,i,r){if(r){let{start:s,end:a}=e.range;this.nvim.setVar("coc_last_placeholder",{current_text:e.value,start:{line:s.line,col:s.character,character:s.character},end:{line:a.line,col:a.character,character:a.character}},!0)}let o=this.tmSnippet.insertSnippet(t,e.marker,i,r);return await this.resolve(r),this.synchronize(),o}getNewText(e,t){let{before:i,after:r}=e;if(!!t.startsWith(i)&&!(t.length<i.length+r.length)&&!!t.endsWith(r))return r.length?t.slice(i.length,-r.length):t.slice(i.length)}async updatePlaceholder(e,t,i,r){let o=this.position,{marker:s,before:a}=e,l=this.tmSnippet.clone();r.onCancellationRequested(()=>{this.tmSnippet=l,this.synchronize()});let u=rn.Range.create(o,Ki(o,a));if(await this.tmSnippet.update(this.nvim,s,i),r.isCancellationRequested)return;this.synchronize();let c=this._placeholders.find(d=>d.marker==s),h=c?c.before:a;return{text:this._text,delta:lx(t,rn.TextEdit.replace(u,h))}}removeText(e,t){let i=this.tmSnippet.deleteText(e,t);return i&&this.synchronize(),i}synchronize(){let e=this.tmSnippet,{line:t,character:i}=this.position,r=Vn.create("untitled:/1","snippet",0,e.toString()),{placeholders:o,variables:s,maxIndexNumber:a}=e,l=new Map,u=a+1;this._placeholders=[...o,...s].map(c=>{let h=e.of
`)){let h=o.getline(t.start.line),d=h.slice(t.end.character);if(d.length){let g=t.end.character,p=d.match(/^\s*/)[0].length,f=fi.Range.create(t.end.line,g,t.end.line,g+p);a.push(fi.TextEdit.replace(f,h.match(/^\s*/)[0]))}}}if(await this.applyEdits(a),this.textDocument=o.textDocument,this.activate(),i&&this.current){let u=this.snippet.getPlaceholderByMarker(this.current);await this.selectPlaceholder(u,!0)}return this._isActive}async applyEdits(e){this._applying=!0,await this.document.applyEdits(e),this._applying=!1}getReplacePlaceholder(e){if(!this.snippet)return;let t=this.findPlaceholder(e);if(!(!t||t.index==0))return t}activate(){this._isActive||(this._isActive=!0,this.nvim.call("coc#snippet#enable",[this.config.preferComplete?1:0],!0))}deactivate(){this.cancel(),this._isActive&&(this.disposable.dispose(),this._isActive=!1,this.current=null,this.nvim.call("coc#snippet#disable",[],!0),this.config.highlight&&this.nvim.call("coc#highlight#clear_highlight",[this.bufnr,kF,0,-1],!0),this._onCancelEvent.fire(void 0),Ns.debug(`session ${this.bufnr} cancelled`))}get isActive(){return this._isActive}get bufnr(){return this.document.bufnr}async nextPlaceholder(){await this.forceSynchronize();let e=this.placeholder;if(!e)return;let t=this.snippet.getNextPlaceholder(e.index);t&&await this.selectPlaceholder(t)}async previousPlaceholder(){await this.forceSynchronize();let e=this.placeholder;if(!e)return;let t=this.snippet.getPrevPlaceholder(e.index);t&&await this.selectPlaceholder(t)}async selectCurrentPlaceholder(e=!0){if(await this.forceSynchronize(),!this.snippet)return;let t=this.snippet.getPlaceholderByMarker(this.current);t&&await this.selectPlaceholder(t,e)}async selectPlaceholder(e,t=!0){let{nvim:i,document:r,config:o}=this;if(!r||!e)return;let{start:s,end:a}=e.range,l=a.character-s.character,u=Q(r.getline(s.line).slice(0,s.character))+1,c=this.current=e.marker;if(c instanceof ct&&c.choice&&c.choice.options.length){let h=c.choice.options.map(d=>d.value);if(o.choicesMenuPicker){await i.call("coc#snippet#cursor",[s.line+1,u+l]);let d=await D.showMenuPicker(h,{title:"Pick word"});if(d<0)return;let g=fi.TextEdit.replace(e.range,h[d]);await r.applyEdits([g],!1,fi.Position.create(a.line,a.character))}else await i.call("coc#snippet#show_choices",[s.line+1,u,l,h]);t&&i.call("coc#util#do_autocmd",["CocJumpPlaceholder"],!0)}else{let h=this.snippet.finalCount;await this.select(e,t),this.highlights(e),e.index==0&&(h==1?(Ns.info("Jump to final placeholder, cancelling snippet session"),this.deactivate()):i.call("coc#snippet#disable",[],!0))}}highlights(e,t=!0){if(!this.config.highlight)return;let i=this.document.buffer;this.nvim.pauseNotification(),i.clearNamespace(kF);let r=this.snippet.getRanges(e);r.length&&i.highlightRanges(kF,"CocSnippetVisual",r),this.nvim.resumeNotification(t,!0)}async select(e,t=!0){let{range:i,value:r}=e,{nvim:o}=this;r.length>0?await o.call("coc#snippet#select",[i.start,i.end,r]):await o.call("coc#snippet#move",[i.start]),t&&o.call("coc#util#do_autocmd",["CocJumpPlaceholder"],!0),o.redrawVim()}async checkPosition(){if(!this.isActive)return;let e=await D.getCursorPosition();this.snippet&&ft(e,this.snippet.range)!=0&&(Ns.info("Cursor insert out of range, cancelling snippet session"),this.deactivate())}findPlaceholder(e){let{placeholder:t}=this;return t&&Xt(e,t.range)?t:this.snippet.getPlaceholderByRange(e)||null}async synchronize(e){await this.mutex.use(()=>{let t=this.textDocument?this.textDocument.version:-1;return e&&(this.document.version!=e.version||e.version-t!==1)&&(e=void 0),this._synchronize(e?e.change:void 0)})}async _synchronize(e){let{document:t,textDocument:i}=this;if(!t.attached||!this._isActive)return;let r=Date.now(),o=t.textDocument;if(o.version==i.version||ye(i.lines,o.lines))return;let{range:s,text:a}=this.snippet;e&&!Xt(e.range,s)&&(e=void 0);let l=Oee(s.end,i,o);if(!l){Ns.info("Content change after snippet, cancel snippet session"),this.deactivate();return}if(!Mee(s.start,i,o)){let b=o.getText(fi.Range.create(fi.Position.create(0,0),l));if(b.endsWith(a)){let w=o.positionAt(b.length-a.length);t
`),filetype:"txt"}]:[];await t.show(a)}},500);this.disposables.push(gte.Disposable.create(()=>{i.clear()})),P.on("CursorMoved",i,this.disposables),P.on("BufUnload",r=>{r===this.bufnr&&this.dispose()},null,this.disposables)}async start(e){this.statMap.clear(),this.names=e;for(let t of e)this.statMap.set(t,0);await this.show()}addMessage(e,t){let i=this.messagesMap.get(e)||[];this.messagesMap.set(e,i.concat(t.trim().split(/\r?\n/))),(t.startsWith("Updated to")||t.startsWith("Installed extension"))&&this.updated.add(e)}startProgress(e){this.statMap.set(e,2)}finishProgress(e,t){this.statMap.set(e,t?3:1)}get remains(){let e=0;for(let t of this.names){let i=this.statMap.get(t);[3,1].includes(i)||(e=e+1)}return e}getLinesAndHighlights(e){let t=[],i=[];for(let r of this.names){let o=this.statMap.get(r),s="*",a,l=e+t.length;switch(o){case 2:{let d=new Date,g=Math.floor(d.getMilliseconds()/100);s=yR[g],a=void 0;break}case 1:s="\u2717",a="ErrorMsg";break;case 3:s="\u2713",a=this.updated.has(r)?"MoreMsg":"Comment";break}let u=this.messagesMap.get(r)||[],c=`- ${s} `,h=Q(c);a&&i.push({hlGroup:a,lnum:l,colStart:h,colEnd:h+Q(r)}),t.push(`${c}${r} ${u.length?u[u.length-1]:""}`)}return{lines:t,highlights:i}}getMessages(e){let t=this.names[e-2];return this.messagesMap.get(t)??[]}get stopped(){return this.interval==null}draw(){let{remains:e,bufnr:t}=this,{nvim:i}=v;if(!t)return;let r=i.createBuffer(t),o=e==0?`${this.isUpdate?"Update":"Install"} finished`:`Installing, ${e} remaining...`,{lines:s,highlights:a}=this.getLinesAndHighlights(2);i.pauseNotification(),r.setLines([o,"",...s],{start:0,end:-1,strictIndexing:!1},!0),r.updateHighlights("coc-extensions",a,{priority:99}),e==0&&this.interval&&(clearInterval(this.interval),this.interval=null),i.resumeNotification(!0,!0)}highlight(){let{nvim:e}=v;e.call("matchadd",["CocListFgCyan","^\\-\\s\\zs\\*"],!0),e.call("matchadd",["CocListFgGreen","^\\-\\s\\zs\u2713"],!0),e.call("matchadd",["CocListFgRed","^\\-\\s\\zs\u2717"],!0)}async show(){let e=P.requesting===!0,{nvim:t}=v;t.pauseNotification(),t.command(e?"enew":"vs +enew",!0),t.call("bufnr",["%"],!0),t.command("setl buftype=nofile bufhidden=wipe noswapfile nobuflisted wrap undolevels=-1",!0),e||t.command("nnoremap <silent><nowait><buffer> q :q<CR>",!0),this.highlight();let i=await t.resumeNotification();this.bufnr=i[0][1],this.interval=setInterval(()=>{this.draw()},100)}dispose(){this.bufnr=void 0,this.messagesMap.clear(),this.statMap.clear(),U(this.disposables),clearInterval(this.interval),this.interval=null}}});var bte={};Go(bte,{Extensions:()=>RD,default:()=>je,toUrl:()=>mte});function mte(n){return nw(n)?n.replace(/\.git(#master|#main)?$/,""):""}var Zu,mb,fte,VTe,_F,eke,ED,RD,je,Wo=k(()=>{"use strict";Zu=S(require("fs")),mb=S(require("path")),fte=S(Bg());Jt();re();nt();jT();wi();xe();ie();BK();hte();RF();pte();VTe=q(),_F=VTe("extensions-index"),eke=process.env.COC_DATA_HOME,ED=mb.default.join(eke,"extensions"),RD=class{constructor(){this.modulesFolder=mb.default.join(ED,"node_modules");this._additionalSchemes={};ote(ED),this.states=new SD(ED),this.manager=new TD(this.states,ED)}async init(){if(process.env.COC_NO_PLUGINS)return;let e=this.globalExtensionStats(),t=await v.nvim.eval('join(globpath(&runtimepath, "", 0, 1), ",")'),i=this.runtimeExtensionStats(t);e=e.concat(i),this.manager.registerExtensions(e),await this.manager.loadFileExtensions(),ue.register({id:"extensions.forceUpdateAll",execute:async()=>{let r=await this.manager.cleanExtensions();_F.info(`Force update extensions: ${r}`),await this.installExtensions(r)}},!1,"remove all global extensions and install them")}activateExtensions(){if(process.env.COC_NO_PLUGINS)return;this.manager.activateExtensions();let e=this.states.filterGlobalExtensions(v.env.globalExtensions);this.installExtensions(e);let t=v.getConfiguration("coc.preferences",null),i=t.get("extensionUpdateCheck","never"),r=t.get("silentAutoupdate",!0);this.states.shouldUpdate(i)&&(this.outputChannel.appendLine("Start auto update..."),this.updateExtensions(r).catch(o=>{this.outputChannel.appendLine(`Error on updateExtensions
`)}`);return}l.name=r,i.push({id:r,isLocal:!1,version:l.version,description:l.description??"",isLocked:t.includes(r),exotic:/^https?:/.test(o),uri:mte(o),root:Zu.default.realpathSync(s),state:this.getExtensionState(r),packageJSON:Object.freeze(l)})}),i}runtimeExtensionStats(e){let t=this.states.lockedExtensions,i=e.split(","),r=[],o=new Set;return i.map(s=>{let a=[],l=xd(s,v.version,a);if(a.length>0)return;let{name:u}=l;!u||this.states.hasExtension(u)||o.has(u)||(this.states.addLocalExtension(u,s),o.add(u),r.push({id:l.name,isLocal:!0,isLocked:t.includes(u),version:l.version,description:l.description??"",exotic:!1,root:s,state:this.getExtensionState(l.name),packageJSON:Object.freeze(l)}))}),r}cleanModulesFolder(){let t=this.states.globalIds.map(r=>r.replace(/\/.*$/,""));if(!Zu.default.existsSync(this.modulesFolder))return;let i=Zu.default.readdirSync(this.modulesFolder);for(let r of i){if(t.includes(r))continue;let o=mb.default.join(this.modulesFolder,r),s=Zu.default.lstatSync(o);s.isSymbolicLink()?Zu.default.unlinkSync(o):s.isDirectory()&&Zu.default.rmSync(o,{recursive:!0,force:!0})}}dispose(){this.manager.dispose()}};je=new RD});var LF,frt,tke,_D,yte=k(()=>{"use strict";LF=S(bD());Pe();$e();tl();frt=q()("sources-keywords"),tke=["_","$"],_D=class{constructor(e){this.doc=e;this.lineWords=[];this._gitIgnored=!1;this.parseWords();let t=j.parse(e.uri);t.scheme==="file"&&$W(t.fsPath).then(i=>{this._gitIgnored=i})}getWords(){let e=[];for(let t of this.lineWords)t.forEach(i=>{e.includes(i)||e.push(i)});return e}parseWords(){let{lineWords:e,doc:t}=this,{chars:i}=t;for(let r of this.doc.textDocument.lines){let o=i.matchLine(r,2);e.push(o)}}get bufnr(){return this.doc.bufnr}get gitIgnored(){return this._gitIgnored}get words(){return new Set}onChange(e){if(e.contentChanges.length==0)return;let{lineWords:t,doc:i}=this,{range:r,text:o}=e.contentChanges[0],{start:s,end:a}=r,l=s.line,c=a.line-l,d=i.textDocument.lines.slice(l,l+o.split(/\n/).length).map(g=>i.chars.matchLine(g,2));t.splice(l,c+1,...d)}*matchWords(e,t,i){let r=t[0],o=oD(t.charCodeAt(0)),s=t.length,a=Fr(t),l=[],{lineWords:u}=this;e>=u.length&&(e=u.length-1);for(let c=0;c<u.length;c++){let h=c<e?e-c-1:c,d=u[h];for(let g of d??[]){let p=g[0];o&&tke.includes(p)&&(p=g[1]),!(i&&!sD(r,o?(0,LF.default)(p):p))&&(l.includes(g)||s>1&&!el(a,o?(0,LF.default)(g):g)||(l.push(g),yield g))}}}dispose(){this.lineWords=void 0}}});var Prt,cr,Cd=k(()=>{"use strict";dn();et();_e();ie();Prt=q()("sources-source"),cr=class{constructor(e){this._disabled=!1;this.nvim=v.nvim,this.name=e.name,this.filepath=e.filepath||"",this.sourceType=e.sourceType||0,this.isSnippet=!!e.isSnippet,this.defaults=e}get priority(){return this.getConfig("priority",1)}get triggerOnly(){let e=this.defaults.triggerOnly;return typeof e=="boolean"?e:!this.triggerCharacters&&!this.triggerPatterns?!1:Array.isArray(this.triggerPatterns)&&this.triggerPatterns.length!=0}get triggerCharacters(){return this.getConfig("triggerCharacters",null)}get optionalFns(){return this.defaults.optionalFns||[]}get triggerPatterns(){let e=this.getConfig("triggerPatterns",null);return!e||e.length==0?null:e.map(t=>typeof t=="string"?new RegExp(t+"$"):t)}get shortcut(){let e=this.getConfig("shortcut","");return e||this.name.slice(0,3)}get enable(){return this._disabled?!1:this.getConfig("enable",!0)}get filetypes(){return this.getConfig("filetypes",null)}get disableSyntaxes(){return this.getConfig("disableSyntaxes",[])}getConfig(e,t){let i=v.getConfiguration(`coc.source.${this.name}`);return t=Qr(this.defaults,e)?this.defaults[e]:t,i.get(e,t)}toggle(){this._disabled=!this._disabled}get firstMatch(){return this.getConfig("firstMatch",!0)}get menu(){return""}fixStartcol(e,t){let{col:i,input:r,line:o,bufnr:s}=e,a=tt(o,0,i),l=v.getDocument(s);if(!l)return i;let{chars:u}=l;for(let c=a.length-1;c>=0;c--){let h=a[c];if(!u.isKeywordChar(h)&&!t.includes(h))break;r=`${h}${r}`,i=i-1}return e.col=i,e.input=r,i}async shouldComplete(e){let{disableSyntaxes:t}=this;if(e.synname&&t&&t.length){let r=(e.synname||"").toLowerCase();if(t.findIndex(o=>r.includes(o.toLower
`)===-1?c:c.replace(/\n.*$/s,"")}function rke(n,e,t){let i=n.match(/^\s*/)[0],r=e.match(/^\s*/)[0];if(i===r)return 0;let o=r.length-i.length;return t.start.character+=o,t.end.character+=o,o}function xte(n){return n?!n.detail&&!n.description:!0}var Ut,vte,bb,Cte=k(()=>{"use strict";Ut=S(W());Jt();fp();Yu();xD();dn();re();nt();tl();wi();_e();ie();vte=q()("source-language"),bb=class{constructor(e,t,i,r,o,s,a){this.name=e;this.shortcut=t;this.provider=i;this.documentSelector=r;this.triggerCharacters=o;this.allCommitCharacters=s;this.priority=a;this.sourceType=2;this._enabled=!0;this.completeItems=[];this.itemDefaults={};this.resolving=new WeakMap}get enable(){return this._enabled}toggle(){this._enabled=!this._enabled}shouldCommit(e,t){let i=this.completeItems[e.index];return i?this.allCommitCharacters.includes(t)?!0:(i.commitCharacters??this.itemDefaults.commitCharacters??[]).includes(t):!1}async doComplete(e,t){let{triggerCharacter:i,input:r,bufnr:o,position:s}=e;this.completeItems=[];let a=this.getTriggerKind(e);this.triggerContext={lnum:s.line,character:s.character,line:e.line};let l={triggerKind:a,option:e};a==Ut.CompletionTriggerKind.TriggerCharacter&&(l.triggerCharacter=i);let u=v.getDocument(o);await wr();let c=await Promise.resolve(this.provider.provideCompletionItems(u.textDocument,s,t,l));if(!c||t.isCancellationRequested)return null;let h=Array.isArray(c)?c:c.items;if(!h||h.length==0)return null;this.itemDefaults=Y0(c)?c.itemDefaults??{}:{},this.completeItems=h;let d=Object.assign({},e),g=ike(e.line,h,this.itemDefaults);if(g>e.col&&r.length>0){g=e.col;let b=Gi(e.line,g);h.forEach(w=>{let{textEdit:x}=w;Ut.TextEdit.is(x)?x.range.start.character=b:Ut.InsertReplaceEdit.is(x)&&(x.replace.start.character=b,x.insert.start.character=b)})}let p,f=Y0(c)?c.isIncomplete==!0:!1;g==null&&r.length>0&&this.triggerCharacters.includes(e.triggerCharacter)&&(h.every(b=>(b.insertText??b.label).startsWith(e.input))||(g=e.col+Q(e.input))),typeof g=="number"&&g<d.col&&(p=g<d.col?tt(e.line,g,d.col):"",d.col=g);let m=h.map((b,w)=>{let x=this.convertVimCompleteItem(b,d,p);return x.index=w,x});return{startcol:g,isIncomplete:f,items:m}}onCompleteResolve(e,t,i){let{index:r}=e,o=this.completeItems[r];if(!o)return Promise.resolve();if(!(typeof this.provider.resolveCompletionItem=="function"))return this.addDocumentation(e,o,t.filetype),Promise.resolve();let a=this.resolving.get(o);return a||(a=new Promise((l,u)=>{let c=i.onCancellationRequested(()=>{this.resolving.delete(o)});Promise.resolve(this.provider.resolveCompletionItem(o,i)).then(h=>{if(c.dispose(),i.isCancellationRequested||!h){this.resolving.delete(o),l();return}Object.assign(o,h),this.addDocumentation(e,o,t.filetype),l()},u)}),this.resolving.set(o,a),a)}addDocumentation(e,t,i){let{detailRendered:r}=e,{documentation:o,detail:s,labelDetails:a}=t,l=[];if(!xte(a)&&!r){let u=(a.detail??"")+(a.description?` ${a.description}`:"");l.push({filetype:"txt",content:u})}else if(s&&!e.detailRendered&&s!=e.abbr){let u=/^[\w-\s.,\t\n]+$/.test(s);l.push({filetype:u?"txt":i,content:s})}o&&(typeof o=="string"?l.push({filetype:"txt",content:o}):o.value&&l.push({filetype:o.kind=="markdown"?"markdown":"txt",content:o.value})),l.length!=0&&(e.documentation=l)}async onCompleteDone(e,t,i){let r=this.completeItems[e.index];if(!r)return;let o=v.getDocument(t.bufnr);await o.patchChange(!0);let s=!Je(r.additionalTextEdits);s&&await ai.editsInsideSnippet(r.additionalTextEdits)&&ai.cancel();let a=o.version,l=!1;i?l=await this.applyTextEdit(o,s,r,t):vte.info("Snippets support is disabled, no textEdit applied."),s&&(await o.applyEdits(r.additionalTextEdits,o.version!=a,!l),l&&await ai.selectCurrentPlaceholder()),r.command&&(ue.has(r.command.command)?await ue.execute(r.command):vte.warn(`Command "${r.command.command}" not registered to coc.nvim`))}isSnippetItem(e){return(e.insertTextFormat??this.itemDefaults.insertTextFormat)===Ut.InsertTextFormat.Snippet}async applyTextEdit(e,t,i,r){var x,T;let{linenr:o,col:s}=r,{character:a,line:l}=this.triggerContext,u=await hh(v.nvim);if(u.line!=o-1)return;let c,{textEdit:h,insert
`),0,i]]);return t[s-1]}async withProgress(e,t){this.checkDialog("withProgress");let i=this.workspace.getConfiguration("notification"),r=Error().stack;if(i.get("statusLineProgress",!0))return await this.createStatusLineProgress(e,t);let o=new vp(this.nvim,{task:t,title:e.title,cancellable:e.cancellable}),s=i.get("minProgressWidth",30),a=new Promise(l=>{o.onDidFinish(l)});return await o.show(Object.assign(this.getNotificationPreference(r,e.source),{minWidth:s})),await a}async createStatusLineProgress(e,t){let{title:i}=e,r=this.createStatusBarItem(0,{progress:!0});r.text=i??"",r.show();let o=0,s=await t({report:a=>{a.increment&&(o+=a.increment),r.text=MZ(i,a.message,o)}},Cb.CancellationToken.None);return r.dispose(),s}createTreeView(e,t){let i=(vf(),Co(ZX)).default;return new i(e,t)}async diffHighlights(e,t,i,r,o){let s=[e,t];Array.isArray(r)&&s.push(r[0],r[1]-1);let a=await this.nvim.call("coc#highlight#get_highlights",s);if(!a||(o==null?void 0:o.isCancellationRequested))return null;i.sort((m,b)=>m.lnum-b.lnum);let l=[],u=this.workspace.has("nvim-0.5.1")||this.workspace.isVim,c=[],h=[],d=0,g=i.length-1,p=0,f=new Map;if(a.forEach(m=>{p=Math.max(p,m[1]);let b=f.get(m[1]);b?b.push(m):f.set(m[1],[m])}),a.length>0){let m=Array.isArray(r)?r[0]:0;for(let b=m;b<=p;b++){let w=f.get(b)??[],x=[];for(let T=d;T<=g;T++){let R=i[T];if(R.lnum==b)d=T+1,x.push(R);else{d=T;break}}if(x.length==0)w.length>0&&(u?c.push(...w.map(T=>T[4])):l.push(b));else if(w.length==0)h.push(...x.map(T=>jD(T)));else if(u){let T=0,R=Math.min(w.length,x.length);for(;T<R&&Wte(x[T],w[T]);)T++;c.push(...w.slice(T).map(F=>F[4])),h.push(...x.slice(T).map(F=>jD(F)))}else(x.length!=w.length||!x.every((T,R)=>Wte(T,w[R])))&&(l.push(b),h.push(...x.map(T=>jD(T))))}}for(let m=d;m<=g;m++)h.push(jD(i[m]));return{remove:l,add:h,removeMarkers:c}}async applyDiffHighlights(e,t,i,r,o=!1){let{nvim:s}=this,{remove:a,add:l,removeMarkers:u}=r;a.length===0&&l.length===0&&u.length===0||(s.pauseNotification(),u.length&&s.call("coc#highlight#del_markers",[e,t,u],!0),a.length&&s.call("coc#highlight#clear",[e,t,a],!0),l.length&&s.call("coc#highlight#set",[e,t,l,i],!0),o?s.resumeNotification(!0,!0):await s.resumeNotification(!0))}async bufferCheck(){let e=await this.workspace.document;if(!e.attached){await this.showDialog({title:"Buffer check result",content:`Document not attached, ${e.notAttachReason}`,highlight:"WarningMsg"});return}let t=new Hi;t.addLine("Provider state","Title"),t.addLine("");let i=(de(),Co(qte)).default;for(let r of dke){let o=i.hasProvider(r,e.textDocument);t.addTexts([{text:"-",hlGroup:"Comment"},{text:" "},o?{text:"\u2713",hlGroup:"CocListFgGreen"}:{text:"\u2717",hlGroup:"CocListFgRed"},{text:" "},{text:r,hlGroup:o?"Normal":"CocFadeOut"}])}await this.showDialog({title:"Buffer check result",content:t.content,highlights:t.highlights})}createNotification(e,t,i,r){return new Promise((o,s)=>{let a={kind:e,content:t,buttons:i.map((u,c)=>({text:u,index:c})),callback:u=>{o(u)}};new Pa(this.nvim,a).show(this.getNotificationPreference(r)).catch(s)})}parseSource(e,t=2){let i=e.split(/\r?\n/).slice(t)[0];if(!i)return;i=i.replace(/^\s*at\s*/,"");let r;if(i.endsWith(")")){let a=i.match(/(\((.*?):\d+:\d+\))$/);a&&(r=a[2])}else{let a=i.match(/(.*?):\d+:\d+$/);a&&(r=a[1])}if(!r)return;let o=(Wo(),Co(bte)).default.manager.getExtensionsInfo(),s=o.find(a=>ni(a.filepath,r));if(s)return s.name.startsWith("single")?Sd.default.basename(s.filepath):s.name;if(s=o.find(a=>Ye(a.directory,r)),s)return s.name;if(Ye(cke,r))return"coc.nvim"}get dialogPreference(){let e=this.workspace.getConfiguration("dialog");return{rounded:e.get("rounded",!0),maxWidth:e.get("maxWidth"),maxHeight:e.get("maxHeight"),floatHighlight:e.get("floatHighlight"),floatBorderHighlight:e.get("floatBorderHighlight"),pickerButtons:e.get("pickerButtons"),pickerButtonShortcut:e.get("pickerButtonShortcut"),confirmKey:e.get("confirmKey"),shortcutHighlight:e.get("shortcutHighlight")}}get inputPreference(){let e=this.workspace.getConfiguration("dialog");return{rounded:e.get("rounded",!0),maxWidth:e.get("maxWidth",80),highlight:e.get
`)[0],a=Sb(e.severity).slice(0,1).toUpperCase();return{bufnr:n,lnum:i.line+1,end_lnum:r.line+1,col:Array.isArray(t)?_t(t[i.line]??"",i.character)+1:i.character+1,end_col:Array.isArray(t)?_t(t[r.line]??"",r.character)+1:r.character+1,text:`[${o}${e.code?" "+e.code:""}] ${s} [${a}]`,type:a}}function OD(n,e){let t=n.severity??1,i=e.severity??1;if(t!=i)return t-i;let r=Me(n.range.start,e.range.start);return r!=0?r:n.source>e.source?1:-1}function Jte(n){let e=n.tags||[];if(e.includes(Ft.DiagnosticTag.Deprecated))return"CocDeprecatedHighlight";if(e.includes(Ft.DiagnosticTag.Unnecessary))return"CocUnusedHighlight";switch(n.severity){case Ft.DiagnosticSeverity.Warning:return"CocWarningHighlight";case Ft.DiagnosticSeverity.Information:return"CocInfoHighlight";case Ft.DiagnosticSeverity.Hint:return"CocHintHighlight";default:return"CocErrorHighlight"}}function $te(n,e){let t=[],{range:i}=e;for(let r of n){let o=r.range;if(!rh(i,o)){if(Me(o.start,i.end)>0){let s=ux(o.start,e),a=ux(o.end,e);s.line>=0&&s.character>=0&&a.line>=0&&a.character>=0&&(r.range=Ft.Range.create(s,a))}t.push(r)}}return t}var Ft,OF=k(()=>{"use strict";Ft=S(W());xt();_e();so()});var Wn,slt,Ute,Xte,Gte,gke,zte,Db,AD,Kte=k(()=>{"use strict";Wn=S(W());fe();nt();xt();xe();ie();OF();slt=q()("diagnostic-buffer"),Ute="CocDiagnostic",Xte="diagnostic",Gte=["CocErrorHighlight","CocWarningHighlight","CocInfoHighlight","CocHintHighlight","CocDeprecatedHighlight","CocUnusedHighlight"],gke=500,zte="ale#other_source#ShowResults",AD=class{constructor(e,t,i){this.nvim=e;this.doc=t;this.floatFactory=i;this.diagnosticsMap=new Map;this.versionsMap=new Map;this._disposed=!1;this._dirties=new Set;this._refreshing=!1;this._onDidRefresh=new Wn.Emitter;this.onDidRefresh=this._onDidRefresh.event;this.loadConfiguration();let r,o=()=>{clearTimeout(r),this._refreshing=!0,r=setTimeout(()=>{this._refreshing=!1,this._autoRefresh&&this._refresh(!0)},gke)};o.clear=()=>{this._refreshing=!1,clearTimeout(r)},this.refreshHighlights=o}get _autoRefresh(){return this.config.enable&&this.config.autoRefresh&&this.dirty&&!this.doc.hasChanged}get config(){return this._config}loadConfiguration(){let e=v.getConfiguration("diagnostic",this.doc),t=this._config&&e.enable!=this._config.enable;this._config={enable:e.get("enable",!0),floatConfig:e.get("floatConfig",{}),messageTarget:e.get("messageTarget","float"),enableHighlightLineNumber:e.get("enableHighlightLineNumber",!0),highlightLimit:e.get("highlightLimit",1e3),highlightPriority:e.get("highlightPriority"),autoRefresh:e.get("autoRefresh",!0),checkCurrentLine:e.get("checkCurrentLine",!1),enableSign:v.env.sign&&e.get("enableSign",!0),locationlistUpdate:e.get("locationlistUpdate",!0),enableMessage:e.get("enableMessage","always"),virtualText:e.get("virtualText",!1),virtualTextAlign:e.get("virtualTextAlign","after"),virtualTextWinCol:v.has("nvim-0.5.1")?e.get("virtualTextWinCol",null):null,virtualTextCurrentLineOnly:e.get("virtualTextCurrentLineOnly"),virtualTextPrefix:e.get("virtualTextPrefix"," "),virtualTextFormat:e.get("virtualTextFormat","%message"),virtualTextLimitInOneLine:e.get("virtualTextLimitInOneLine",999),virtualTextLineSeparator:e.get("virtualTextLineSeparator"," \\ "),virtualTextLines:e.get("virtualTextLines",3),displayByAle:e.get("displayByAle",!1),level:Hs(e.get("level","hint")),locationlistLevel:Hs(e.get("locationlistLevel")),signLevel:Hs(e.get("signLevel")),virtualTextLevel:Hs(e.get("virtualTextLevel")),messageLevel:Hs(e.get("messageLevel")),signPriority:e.get("signPriority",10),refreshOnInsertMode:e.get("refreshOnInsertMode",!1),filetypeMap:e.get("filetypeMap",{}),showUnused:e.get("showUnused",!0),showDeprecated:e.get("showDeprecated",!0),format:e.get("format","[%source%code] [%severity] %message")},this._config.virtualText&&!Db&&this.nvim.createNamespace("coc-diagnostic-virtualText").then(i=>{Db=i}),t&&(this.config.enable?this._refresh(!1):this.clear())}async setState(e){this._config.enable!=e&&(this._config.enable=e,e?await this._refresh(!1):this.clear())}get dirty(){return this._dirties.size>0}get bufnr(){return this.doc.bufnr}get uri(){ret
`)||!Lt(r))));if(Lt(r)&&o.length>0&&(o=o.slice(0,1)),o.length==0)jb.debug("no affected ranges"),this.ranges.forEach(s=>{s.adjustFromEdit({range:r,newText:i})}),this.doHighlights();else if(o.length==1&&Xt(r,o[0].range)){if(jb.debug("affected single range"),i.includes(`
`)){this.cancel();return}await this.applySingleEdit(o[0],{range:r,newText:i})}else if(!i.length||!this.validChange(r,i)){jb.debug("filter affected ranges.");let s=this.ranges.filter(a=>!o.includes(a));s.length>0?(this.ranges=s,s.forEach(a=>{a.adjustFromEdit({range:r,newText:i})}),this.doHighlights()):this.cancel()}else{jb.debug("Check undo & redo");let s=this.ranges[0],a=this.ranges[this.ranges.length-1],l=e.originalLines.slice(s.line,a.line+1),u=this.doc.textDocument.lines.slice(s.line,a.line+1);this.applyComposedEdit(l,u)}}validChange(e,t){if(Ia(Bs.TextEdit.replace(e,t))!=0||!Xt(e,this.range))return!1;let i=this.ranges[0],r=this.ranges[this.ranges.length-1];return!(e.start.line!=i.position.line||e.end.line!=r.position.line)}get range(){let e=this.ranges[0],t=this.ranges[this.ranges.length-1];return Bs.Range.create(e.position,t.range.end)}doHighlights(){let{nvim:e,ranges:t,doc:i}=this,r=i.buffer,o=[];t.forEach(s=>{i.addHighlights(o,"CocCursorRange",s.range,{combine:!1,start_incl:!0,end_incl:!0})}),o.sort((s,a)=>s.lnum!=a.lnum?s.lnum-a.lnum:s.colStart!=a.colStart?s.colStart-a.colStart:0),r.updateHighlights("cursors",o,{priority:4096}),e.redrawVim()}get currentRanges(){return this.ranges.map(e=>e.range)}cancel(){if(!this.activated)return;jb.debug("cursors cancel");let e=this.doc.buffer;this.activated=!1,this.ranges=[],e.clearNamespace("cursors"),e.setVar("coc_cursors_activated",0,!0),this._onDidUpdate.fire(),this._onDidCancel.fire()}dispose(){!this.doc||(this._onDidCancel.dispose(),this._onDidUpdate.dispose(),U(this.disposables),this.ranges=[],this.doc=null)}async applySingleEdit(e,t){let{doc:i,ranges:r}=this;r.filter(u=>u!==e&&u.position.line==e.position.line).forEach(u=>u.adjustFromEdit(t));let s=HD(e,t.range,t.newText),a=Ib(s);r.forEach(u=>u.applyChange(s));let l=r.filter(u=>u!==e).map(u=>u.textEdit);if(this.changing=!0,await i.applyEdits(l,!0,!0),this.changing=!1,a!=0)for(let u of r){let c=Fb(u,this.ranges,e);u.move(c*a)}this.doHighlights()}applyComposedEdit(e,t){let i=(0,Pd.default)(e[0],t[0]),r=this.ranges[0],o=r.position.character,s=r.position.line,a=r.text.length,l=i[0];if(o>0&&(l[0]!=Pd.default.EQUAL||!l[1].startsWith(e[0].slice(0,o))))return this.cancel(),!1;let u=0,c=!1,h=[];for(let b=0;b<i.length;b++){let[w,x]=i[b];if(b==0&&o>0&&(x=x.slice(o)),w==Pd.default.EQUAL){if(u+=x.length,u>a)break}else if(w==Pd.default.DELETE){let T=u;if(u+=x.length,u>a){c=!0;break}h.push({offset:T,remove:x})}else{let T=i[b-1];T&&T[0]==Pd.default.DELETE?h[h.length-1].add=x:h.push({offset:u,add:x})}}if(c||!h.length)return this.cancel(),!1;let d=Vn.create("file:///1","",0,e.join(`
`)),g;if(h.length==1)g={offset:h[0].offset,remove:h[0].remove?h[0].remove.length:0,insert:h[0].add??""};else if(vke(h,a))g={prepend:[h[0].remove?h[0].remove.length:0,h[0].add??""],append:[h[1].remove?h[1].remove.length:0,h[1].add??""]};else{let b=r.text,w="",x="",T=h[0].offset;for(let R of h){if(R.offset>T+w.length){let F=b.slice(T+w.length,R.offset);w+=F,x+=F}R.add&&(x+=R.add),R.remove&&(w+=R.remove)}g={offset:T,remove:w.length,insert:x}}let p=this.ranges.map(b=>{let w=b.position.line-s,{start:x,end:T}=b.range,R=Bs.Range.create(w,x.character,w,T.character);return b.applyChange(g),Bs.TextEdit.replace(R,b.text)});if(Vn.applyEdits(d,p)!==t.join(`
`))return this.cancel(),!1;let m=Ib(g);if(m!=0)for(let b of this.ranges){let w=Fb(b,this.ranges);b.move(w*m)}return this.doHighlights(),!0}};function vke(n,e){return!(n.length!=2||n[0].offset!=0||n[1].offset+(n[1].remove?n[1].remove.length:0)!==e)}var Hct=q()("cursors"),Ob=class{constructor(e){this.nvim=e;this.sessionsMap=new Map;this.disposables=[];this.loadConfiguration(),v.onDidChangeConfiguration(this.loadConfiguration,this,this.disposables),v.onDidCloseTextDocument(t=>{let i=this.getSession(t.bufnr);!i||(this.sessionsMap.delete(t.bufnr),i.cancel())},null,this.disposables)}loadConfiguration(e){if(!e||e.affectsConfiguration("cursors")){let t=v.getConfiguration("cursors",null);this.config=Object.assign(this.config??{},{nextKey:t.get("nextKey","<C-n>"),previousKey:t.get("previousKey","<C-p>"),cancelKey:t.get("cancelKey","<esc>"),wrapscan:t.get("wrapscan",!0)})}}cancel(e){let t=v.getDocument(e);if(!t)return;let i=this.getSession(t.bufnr);i&&i.cancel()}getSession(e){return this.sessionsMap.get(e)}async isActivated(){let e=await this.nvim.call("bufnr",["%"]);return this.sessionsMap.get(e)!=null}async select(e,t,i){let r=v.getAttachedDocument(e),{nvim:o}=this,s=this.createSession(r),a;if(t=="operator"){let l=await o.eval(`[getpos("'["),getpos("']")]`);if(i=="char"){let u=r.getPosition(l[0][1],l[0][2]),c=r.getPosition(l[1][1],l[1][2]+1),h=JF(r,Xu.Range.create(u,c));s.addRanges(h)}else{let u=[];for(let c=l[0][1]-1;c<=l[1][1]-1;c++){let h=r.getline(c);u.push(Xu.Range.create(c,0,c,h.length))}s.addRanges(u)}}else if(t=="word"){let l=await D.getCursorPosition();if(a=r.getWordRangeAtPosition(l),!a){let u=r.getline(l.line);l.character==u.length?a=Xu.Range.create(l.line,Math.max(0,u.length-1),l.line,u.length):a=Xu.Range.create(l.line,l.character,l.line,l.character+1)}s.addRange(a),await o.command(`silent! call repeat#set("\\<Plug>(coc-cursors-${t})", -1)`)}else if(t=="position"){let l=await D.getCursorPosition(),u=r.getline(l.line);l.character>=u.length?a=Xu.Range.create(l.line,u.length-1,l.line,u.length):a=Xu.Range.create(l.line,l.character,l.line,l.character+1),s.addRange(a),await o.command(`silent! call repeat#set("\\<Plug>(coc-cursors-${t})", -1)`)}else if(t=="range"){await o.call("eval",'feedkeys("\\<esc>", "in")');let l=await D.getSelectedRange(i);if(!l)return;let u=i==""?mie(r,l):JF(r,l);for(let c of u)s.addRange(c)}else throw new Error(`select kind "${t}" not supported`)}createSession(e){let{bufnr:t}=e,i=this.getSession(t);return i||(i=new Mb(this.nvim,e,this.config),this.sessionsMap.set(t,i),i.onDidCancel(()=>{i.dispose(),this.sessionsMap.delete(t)}),i)}async addRanges(e){let{nvim:t}=this,i=await t.call("bufnr",["%"]),r=v.getAttachedDocument(i);return this.createSession(r).addRanges(e)}reset(){for(let e of this.sessionsMap.values())e.cancel();this.sessionsMap.clear()}};Bu();fe();Wo();var JD=S(W());fe();de();re();xe();ie();var Ed=S(W());Jt();Bu();de();xe();ie();var Uct=q()("handler-codeActions"),Ab=class{constructor(e,t){this.nvim=e;this.handler=t;t.addDisposable(ue.registerCommand("editor.action.organizeImport",async i=>{await this.organizeImport(i)})),ue.titles.set("editor.action.organizeImport","run organize import code action.")}async codeActionRange(e,t,i){let{doc:r}=await this.handler.getCurrentState();await r.synchronize();let o=r.getline(t-1),s=Ed.Range.create(e-1,0,t-1,o.length),a=await this.getCodeActions(r,s,i?[i]:null);if(a=a.filter(c=>!c.disabled),!a||a.length==0){D.showWarningMessage(`No${i?" "+i:""} code action available`);return}let l=await D.showMenuPicker(a.map(c=>c.title),"Choose action"),u=a[l];u&&await this.applyCodeAction(u)}async organizeImport(e){let{doc:t}=await this.handler.getCurrentState();if(e&&t.bufnr!=e)return;await t.synchronize();let i=await this.getCodeActions(t,void 0,[Ed.CodeActionKind.SourceOrganizeImports]);if(i&&i.length){await this.applyCodeAction(i[0]);return}throw new Error("Organize import action not found.")}async getCodeActions(e,t,i){t=t||Ed.Range.create(0,0,e.lineCount,0);let o={diagnostics:Wt.getDiagnosticsInRange(e.textDocument,t)};i&&Array.isArray(i)&&(o.only=i);let s=await
`,e),i){let r=await t.call("line",".")-1,o=v.getDocument(e);if(!o)return;await o.patchChange();let s=o.getline(r-1),a=o.getline(r),l=s[s.length-1];if(l&&Cie.has(l)){let u=a.trim()[0];if(u&&Cie.get(l)==u){let c=[],h=await v.getFormatOptions(o.uri),d=h.insertSpaces?" ".repeat(h.tabSize):" ",g=a.match(/^\s*/)[0],p=Ws.Position.create(r-1,s.length);if(o.filetype=="vim"){let f=`
`+g+d;c.push({range:Ws.Range.create(r,g.length,r,g.length),newText:" \\ "}),f=f+"\\ ",c.push({range:Ws.Range.create(p,p),newText:f}),await o.applyEdits(c),await D.moveTo(Ws.Position.create(r,f.length-1))}else await t.eval(`feedkeys("\\<Esc>O", 'in')`)}}}}async documentRangeFormat(e,t){this.handler.checkProvier("formatRange",e.textDocument),await e.synchronize();let i;if(t){if(i=await D.getSelectedRange(t),!i)return-1}else{let[s,a,l]=await this.nvim.eval("[v:lnum,v:count,mode()]");if(a==0||l=="i"||l=="R")return-1;i=Ws.Range.create(s-1,0,s-1+a,0)}let r=await v.getFormatOptions(e.uri),o=await this.handler.withRequestToken("Format range",s=>_.provideDocumentRangeFormattingEdits(e.textDocument,i,r,s));return o&&o.length>0?(await e.applyEdits(o,!1,!0),0):-1}};var Gu=S(W());fe();de();re();xe();ie();var rdt=q()("documentHighlight"),$b=class{constructor(e,t){this.nvim=e;this.handler=t;this.disposables=[];this.highlights=new Map;P.on(["CursorMoved","CursorMovedI"],()=>{this.cancel(),this.clearHighlights()},null,this.disposables),this.loadConfiguration(),v.onDidChangeConfiguration(this.loadConfiguration,this,this.disposables),D.onDidChangeActiveTextEditor(()=>{this.loadConfiguration()},null,this.disposables)}loadConfiguration(e){let t=v.getConfiguration("documentHighlight",this.handler.uri);(!e||e.affectsConfiguration("documentHighlight"))&&(this.config=Object.assign(this.config||{},{priority:t.get("priority",-1),timeout:t.get("timeout",300)}))}isEnabled(e,t){let i=v.getDocument(e);return!(!i||!i.attached||t||!_.hasProvider("documentHighlight",i.textDocument))}clearHighlights(){if(this.highlights.size!=0){for(let e of this.highlights.keys())this.nvim.createWindow(e).clearMatchGroup("^CocHighlight");this.highlights.clear()}}async highlight(){let{nvim:e}=this;this.cancel();let[t,i,r,o]=await e.eval(`[bufnr("%"),win_getid(),coc#cursor#position(),get(b:,'coc_cursors_activated',0)]`);if(!this.isEnabled(t,o))return;let s=v.getDocument(t),a=await this.getHighlights(s,Gu.Position.create(r[0],r[1]));if(!a)return;let l={};for(let c of a){if(!c.range)continue;let h=c.kind==Gu.DocumentHighlightKind.Text?"CocHighlightText":c.kind==Gu.DocumentHighlightKind.Read?"CocHighlightRead":"CocHighlightWrite";l[h]=l[h]||[],l[h].push(c.range)}let u=e.createWindow(i);e.pauseNotification(),u.clearMatchGroup("^CocHighlight");for(let c of Object.keys(l))u.highlightRanges(c,l[c],this.config.priority,!0);e.resumeNotification(!0,!0),this.highlights.set(i,a)}async getSymbolsRanges(){let{doc:e,position:t}=await this.handler.getCurrentState();this.handler.checkProvier("documentHighlight",e.textDocument);let i=await this.getHighlights(e,t);return i?i.map(r=>r.range):null}hasHighlights(e){return this.highlights.get(e)!=null}async getHighlights(e,t){let r=e.getline(t.line)[t.character];if(!r||!e.isWord(r))return null;await e.synchronize(),this.cancel();let o=this.tokenSource=new Gu.CancellationTokenSource,s=this.timer=setTimeout(()=>{o.token.isCancellationRequested||o.cancel()},this.config.timeout),a=await _.getDocumentHighLight(e.textDocument,t,o.token);return clearTimeout(s),o.token.isCancellationRequested?null:a}cancel(){this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource.dispose(),this.tokenSource=null)}dispose(){this.timer&&clearTimeout(this.timer),this.cancel(),this.highlights.clear(),U(this.disposables)}};var Sie=S(require("fs")),Or=S(W());Pe();de();re();nt();$e();xe();ie();var fdt=q()("handler-hover"),Xb=class{constructor(e,t){this.nvim=e;this.handler=t;this.disposables=[];this.documentLines=[];this.hasProvider=!1;this.loadConfiguration(),v.onDidChangeConfiguration(this.loadConfiguration,this,this.disposables),this.hoverFactory=D.createFloatFactory({modes:["n"],autoHide:this.config.autoHide}),this.disposables.push(this.hoverFactory),D.onDidChangeActiveTextEditor(()=>{this.loadConfiguration()},null,this.disposables)}registerProvider(){if(this.hasProvider)return;this.hasProvider=!0;let{nvim:e}=this,t={onDidChange:null,provideTextDocumentContent:async()=>(e.pauseNotification(),e.command("setlocal conceallevel=2 nospell nofoldenable wrap",!0),e.command(
`))};this.disposables.push(v.registerTextDocumentContentProvider("coc",t))}loadConfiguration(e){if(!e||e.affectsConfiguration("hover")){let t=v.getConfiguration("hover",this.handler.uri);this.config={floatConfig:t.get("floatConfig",{}),autoHide:t.get("autoHide",!0),target:t.get("target","float"),previewMaxHeight:t.get("previewMaxHeight",12)},this.config.target=="preview"&&this.registerProvider()}}async onHover(e){let{doc:t,position:i,winid:r}=await this.handler.getCurrentState();e=="preview"&&this.registerProvider(),this.handler.checkProvier("hover",t.textDocument),await t.synchronize();let o=await this.handler.withRequestToken("hover",a=>_.getHover(t.textDocument,i,a),!0);if(o==null||!o.length)return!1;let s=o.find(a=>Or.Range.is(a.range));if(s!=null&&s.range){let a=this.nvim.createWindow(r);a.highlightRanges("CocHoverRange",[s.range],99,!0),this.timer=setTimeout(()=>{a.clearMatchGroup("CocHoverRange"),this.nvim.redrawVim()},500)}return await this.previewHover(o,e),!0}async definitionHover(e){let{doc:t,position:i,winid:r}=await this.handler.getCurrentState();e=="preview"&&this.registerProvider(),this.handler.checkProvier("hover",t.textDocument),await t.synchronize();let o=await this.handler.withRequestToken("hover",l=>_.getHover(t.textDocument,i,l),!0);if(Je(o))return!1;let s=await this.handler.withRequestToken("definitionHover",l=>_.getDefinitionLinks(t.textDocument,i,l),!1);await Ske(o,s,t.filetype);let a=o.find(l=>Or.Hover.is(l)&&Or.Range.is(l.range));if(a){let l=this.nvim.createWindow(r);l.highlightRanges("CocHoverRange",[a.range],99,!0),this.timer=setTimeout(()=>{l.clearMatchGroup("CocHoverRange"),this.nvim.redrawVim()},500)}return await this.previewHover(o,e),!0}async previewHover(e,t){let i=[];t=t??this.config.target;let r=t==="preview";for(let s of e){if(Dke(s)){i.push(s);continue}let{contents:a}=s;if(Array.isArray(a))for(let l of a)typeof l=="string"?Ub(i,l,"markdown",r):Ub(i,l.value,l.language,r);else Or.MarkedString.is(a)?typeof a=="string"?Ub(i,a,"markdown",r):Ub(i,a.value,a.language,r):Or.MarkupContent.is(a)&&Ub(i,a.value,Wg(a)?"markdown":"txt",r)}if(t=="float"){await this.hoverFactory.show(i,this.config.floatConfig);return}let o=i.reduce((s,a)=>{let l=a.content.split(/\r?\n/);return s.length>0&&s.push(""),s.push(...l),s},[]);if(t=="echo"){let s=o.join(`
`).trim();await this.nvim.call("coc#ui#echo_hover",[s])}else this.documentLines=o,await this.nvim.command("noswapfile pedit coc://document")}async getHover(){let e=[],{doc:t,position:i}=await this.handler.getCurrentState();this.handler.checkProvier("hover",t.textDocument),await t.synchronize();let r=new Or.CancellationTokenSource,o=await _.getHover(t.textDocument,i,r.token);for(let s of o){let{contents:a}=s;Array.isArray(a)?a.forEach(l=>{e.push(typeof l=="string"?l:l.value)}):Or.MarkupContent.is(a)?e.push(a.value):e.push(typeof a=="string"?a:a.value)}return e=e.filter(s=>s!=null&&s.length>0),e}dispose(){this.timer&&clearTimeout(this.timer),U(this.disposables)}};async function Ske(n,e,t){for(let i of e){if(!(i!=null&&i.targetRange))continue;let{start:r,end:o}=i.targetRange,s=o.line-r.line>=100?r.line+100:o.character==0?o.line-1:o.line,a=await Tke(i.targetUri,r.line,s);if(a.length){let l=a[0].match(/^\s*/)[0];l&&(a=a.map(u=>u.startsWith(l)?u.substring(l.length):u)),n.push({content:a.join(`
`),filetype:t})}}}function Ub(n,e,t,i=!1){let r=e.trim();!r.length||(i&&t!=="markdown"&&(r="``` "+t+`
`+r+"\n```"),n.push({content:r,filetype:t}))}function Dke(n){return n?typeof n.filetype=="string"&&typeof n.content=="string":!1}async function Tke(n,e,t){let i=v.getDocument(n);if(i)return i.getLines(e,t+1);let r=j.parse(n).fsPath;return Sie.default.existsSync(r)?await Sa(r,e,t):[]}var zu=S(W());fe();de();re();xt();xe();ie();var Ddt=q()("handler-links"),kke=/CocAction(Async)?\(["']openLink["']\)/,Gb=class{constructor(e,t){this.nvim=e;this.handler=t;this.disposables=[];this.setConfiguration(),v.onDidChangeConfiguration(this.setConfiguration,this,this.disposables),this.floatFactory=D.createFloatFactory({}),P.on("CursorHold",async()=>{!this._tooltip||!e.hasFunction("nvim_get_keymap")||await this.showTooltip()},null,this.disposables),P.on(["CursorMoved","InsertEnter"],()=>{this.cancel()},null,this.disposables)}setConfiguration(e){if(!e||e.affectsConfiguration("links")){let t=v.getConfiguration("links",null);this._tooltip=t.get("tooltip",!1)}}async showTooltip(){let{nvim:e,floatFactory:t}=this,r=(await e.getKeymap("n")).find(u=>kke.test(u.rhs)),o=r?r.lhs:void 0,s=await this.getCurrentLink();if(!s||!s.target)return;let a="";if(s.tooltip&&(a=s.tooltip+" "),o&&(a+=`Press "${o}" to open link`),!a.length)return;let l={content:a,filetype:"txt"};await t.show([l])}async getLinks(){let{doc:e}=await this.handler.getCurrentState();if(!_.hasProvider("documentLink",e.textDocument))return[];let t=this.tokenSource=new zu.CancellationTokenSource,i=await _.getDocumentLinks(e.textDocument,t.token);return t.token.isCancellationRequested?[]:i}async openLink(e){if(!e.target)throw new Error("Failed to resolve link target");await v.openResource(e.target)}async getCurrentLink(){let e=await this.getLinks(),t=await D.getCursorPosition();if(e&&e.length){for(let a of e)if(ft(t,a.range)==0){if(!a.target){let l=this.tokenSource=this.tokenSource||new zu.CancellationTokenSource;if(a=await _.resolveDocumentLink(a,this.tokenSource.token),!a.target||l.token.isCancellationRequested)continue}return a}}let i=await this.nvim.call("getline",["."]),r=/\w+?:\/\/[^)\]'" ]+/g,o,s;for(;(o=r.exec(i))!==null;){let a=o.index;if(a<=t.character&&a+o[0].length>=t.character){s=zu.DocumentLink.create(zu.Range.create(t.line,a,t.line,a+o[0].length),o[0]);break}}return s}async openCurrentLink(){let e=await this.getCurrentLink();return e?(await this.openLink(e),!0):!1}cancel(){this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource=null)}dispose(){var e;(e=this.floatFactory)==null||e.dispose(),U(this.disposables)}};var Yn=S(W());Pe();de();Hm();et();ie();var Fdt=q()("handler-hover"),zb=class{constructor(e,t){this.nvim=e;this.handler=t}async request(e,t){let{doc:i,position:r}=await this.handler.getCurrentState();return this.handler.checkProvier(e,i.textDocument),await i.synchronize(),await this.handler.withRequestToken(e,o=>t(i.textDocument,r,o),!0)}async definitions(){let{doc:e,position:t}=await this.handler.getCurrentState();this.handler.checkProvier("definition",e.textDocument),await e.synchronize();let i=new Yn.CancellationTokenSource;return _.getDefinition(e.textDocument,t,i.token)}async declarations(){let{doc:e,position:t}=await this.handler.getCurrentState();this.handler.checkProvier("declaration",e.textDocument),await e.synchronize();let i=new Yn.CancellationTokenSource;return _.getDeclaration(e.textDocument,t,i.token)}async typeDefinitions(){let{doc:e,position:t}=await this.handler.getCurrentState();this.handler.checkProvier("typeDefinition",e.textDocument),await e.synchronize();let i=new Yn.CancellationTokenSource;return _.getTypeDefinition(e.textDocument,t,i.token)}async implementations(){let{doc:e,position:t}=await this.handler.getCurrentState();this.handler.checkProvier("implementation",e.textDocument),await e.synchronize();let i=new Yn.CancellationTokenSource;return _.getImplementation(e.textDocument,t,i.token)}async references(e){let{doc:t,position:i}=await this.handler.getCurrentState();this.handler.checkProvier("reference",t.textDocument),await t.synchronize();let r=new Yn.CancellationTokenSource;return _.getReferences(t.textDocument,{includeDeclaration:!e},i
`)))}else{l.push(u);let p=this.getDeleteRange(c);a.push(st.TextEdit.replace(p,""))}}l.length&&(i.ranges=i.ranges.filter((u,c)=>!l.includes(c))),this._fileItems=this._fileItems.filter(u=>u.ranges&&u.ranges.length>0),a.length&&(this.adjustLnums(a),this.changing=!0,await this.document.applyEdits(a),this.changing=!1),this.nvim.pauseNotification(),this.highlightLineNr(),this.buffer.setOption("modified",!1,!0),await this.nvim.resumeNotification(!0)}adjustLnums(e){for(let t of this._fileItems)for(let i of t.ranges){let r=i.lnum-1;i.lnum+=OR(st.Position.create(r,0),e)}}async getFileChanges(){let e=[],t=await this.buffer.lines;t.push(yo);let i=[],r,o;for(let s=0;s<t.length;s++){let a=t[s];if(a.startsWith(yo)){if(r&&(e.push({filepath:r,lines:i.slice(),lnum:o}),r=void 0,i=[]),a.length>1){let l=a.match(/^\u3000(.*)/);l&&(r=this.getAbsolutePath(l[1].replace(/\s+$/,"")),o=s+1,i=[])}}else i.push(a)}return e}async splitOpen(){let{nvim:e}=this,i=await e.createWindow(this.opts.fromWinid).valid,o=(await e.eval("strpart(getline('.'), 0 ,col('.') - 1)")).length,s=await this.searchCurrentRange();if(s){let a=this.getAbsolutePath(s.filepath);e.pauseNotification(),i?(e.call("win_gotoid",[this.opts.fromWinid],!0),this.nvim.call("coc#util#jump",["edit",a,[s.line,o]],!0)):this.nvim.call("coc#util#jump",["belowright vs",a,[s.line,o]],!0),e.command("normal! zz",!0),await e.resumeNotification(!0),i||(this.opts.fromWinid=await e.call("win_getid"))}}async searchCurrentRange(){let{nvim:e}=this,t=await e.eval('getline(1,line("."))'),i=t.length;for(let r=0;r<i;r++)if(t[i-r-1].match(/^\u3000(.+)/)){let a=this.getFileRange(i-r);return Object.assign({line:a.start+(r==0?1:r)-1},a)}}async addFileItems(e){if(this._disposed)return;let{cwd:t}=this.opts,{document:i}=this,r=await this.mutex.acquire();try{await i.synchronize();let o=i.lineCount,s=new Hi,a=[];for(let c of e){let h=[];for(let d of c.ranges){s.addLine(yo),s.addLine(yo);let g=o+s.length;s.addText(`${Ye(t,c.filepath)?Qb.default.relative(t,c.filepath):c.filepath}`);let p=String(d.start+1).length+String(d.end).length+4;this.srcId||s.addText(" ".repeat(p));let f=0-s.length-o;d.highlights&&a.push(...d.highlights.map(T=>Eke(T,f)));let{lines:m,start:b,end:w,highlights:x}=d;m||(m=await this.getLines(c.filepath,b,w)),h.push({lines:m,lnum:g,start:b,highlights:x}),s.addLines(m)}if(h.length){let d={filepath:c.filepath,ranges:h},g=this._fileItems.find(p=>p.filepath==c.filepath);g?g.ranges.push(...d.ranges):this._fileItems.push(d)}}let{nvim:l,buffer:u}=this;if(this.changing=!0,l.pauseNotification(),s.render(u,o),this.highlightLineNr(),u.setOption("modified",!1,!0),u.setOption("undolevels",1e3,!0),o==2&&a.length){let c=a[0].start;l.call("coc#cursor#move_to",[c.line,c.character],!0)}await l.resumeNotification(!0),await i.patchChange(),this.changing=!1,await D.cursors.addRanges(a)}catch(o){this.changing=!1,Pke.error("Error on add file item:",o)}r()}findRange(e,t){let r=this.fileItems.find(o=>ni(this.getAbsolutePath(o.filepath),e)).ranges.find(o=>o.lnum==t);if(!r)throw new Error(`File range not found at lnum: ${t}`);return r}async save(){let{nvim:e}=this,t=this.document,{buffer:i}=t;await t.patchChange();let r=await this.getFileChanges();if(!r)return;r.sort((a,l)=>a.lnum-l.lnum);let o=[];for(let a=0;a<r.length;a++){let l=r[a],u=this.findRange(l.filepath,l.lnum);ye(u.lines,l.lines)||(o.push(Object.assign({start:u.start,end:u.start+u.lines.length},l)),u.lines=l.lines)}if(o.length==0)return await D.showInformationMessage("No change."),await i.setOption("modified",!1),!1;let s={};for(let a of o){let l=j.file(a.filepath).toString(),u=s[l]||[];u.push({range:st.Range.create(a.start,0,a.end,0),newText:a.lines.join(`
`)+`
`}),s[l]=u}this.changing=!0,await v.applyEdit({changes:s}),this.changing=!1;for(let a of this.fileItems){let l=j.file(this.getAbsolutePath(a.filepath)).toString(),u=s[l];u&&u.length>0&&a.ranges.forEach(c=>{c.start+=OR(st.Position.create(c.start,0),u)})}return e.pauseNotification(),i.setOption("modified",!1,!0),this.config.saveToFile&&e.command("silent noa wa",!0),this.highlightLineNr(),await e.resumeNotification(),!0}async getLines(e,t,i){let r=j.file(e).toString(),o=v.getDocument(r);return o?o.getLines(t,i):await Sa(e,t,i-1)}getAbsolutePath(e){return Qb.default.isAbsolute(e)?e:Qb.default.join(this.opts.cwd,e)}highlightLineNr(){let{fileItems:e,nvim:t,srcId:i,bufnr:r}=this,{winid:o,cwd:s}=this.opts,a={};if(i){t.call("nvim_buf_clear_namespace",[r,i,0,-1],!0);for(let l of e)for(let u of l.ranges){let c=u.start+u.lines.length,h=`${u.start+1}:${c}`;a[u.lnum]=[u.start+1,c],t.call("nvim_buf_set_virtual_text",[r,i,u.lnum-1,[[h,"LineNr"]],{}],!0)}}else{this.matchIds.size&&(t.call("coc#highlight#clear_matches",[o,Array.from(this.matchIds)],!0),this.matchIds.clear());let l=2e3;for(let u of e){let c=`${s?Qb.default.relative(s,u.filepath):u.filepath}`,h=Q(c)+1;for(let d of u.ranges){let g=d.start+d.lines.length,p=`:${d.start+1}:${g}`;for(let f=0;f<p.length;f++){let m=p[f];this.matchIds.add(l),a[d.lnum]=[d.start+1,g],t.call("matchaddpos",["Conceal",[[d.lnum,h+f]],99,l,{conceal:m,window:o}],!0),l++}}}}this.buffer.setVar("line_infos",a,!0)}getDeleteRange(e){let{document:t}=this,i=e.lnum-1,r,o=t.lineCount;for(let s=i;s<o;s++){if(s+1==o){r=st.Position.create(o,0);break}let a=t.getline(s);if(a===yo){r=st.Position.create(s+1,0);break}if(s!=i&&a.startsWith(yo)){r=st.Position.create(s,0);break}}return st.Range.create(st.Position.create(i,0),r)}getReplaceRange(e){let{document:t}=this,i=e.lnum,r,o=t.lineCount;for(let s=i;s<o;s++){let a=t.getline(s);if(s+1==o){r=st.Position.create(s,a.length);break}if(t.getline(s+1).startsWith("\u3000")){r=st.Position.create(s,a.length);break}}return st.Range.create(st.Position.create(i,0),r)}get valid(){return this.buffer.valid}get buffer(){return this.nvim.createBuffer(this.bufnr)}get document(){return v.getDocument(this.bufnr)}dispose(){this._disposed=!0,U(this.disposables)}};function Eke(n,e){let{start:t,end:i}=n;return st.Range.create(t.line-e,t.character,i.line-e,i.character)}function Rke(n){let{contentChanges:e,bufnr:t,textDocument:i,original:r,originalLines:o}=n,{range:s,text:a}=e[0],l=[{range:s,text:a}];if(r){let u=r.split(/\r?\n/),c=u[u.length-1];if(c.startsWith(yo)){let g=o[s.start.line].slice(0,s.start.character);if(g==c){r=g+u.slice(0,-1).join(`
`)+`
`;let{start:p,end:f}=s;l[0].range=st.Range.create(p.line,0,f.line,0)}}let h=o[s.start.line-1],d=u.length>1?u[u.length-2]:"";if(c==""&&d.startsWith(yo)&&h==d&&s.start.character==0&&s.end.character==0){r=h+`
`+u.slice(0,-2).join(`
`)+`
`;let{start:g,end:p}=s;l[0].range=st.Range.create(g.line-1,0,p.line-1,0)}}else if(Lt(s)&&s.start.character!=0){let u=a.split(/\r?\n/),c=u[u.length-1],h=o[s.start.line].slice(0,s.start.character);if(c.startsWith(yo)&&h==c){l[0].text=h+u.slice(0,-1).join(`
`)+`
`;let{start:d,end:g}=s;l[0].range=st.Range.create(d.line,0,g.line,0)}}return{contentChanges:l,bufnr:t,textDocument:i,original:r,originalLines:o}}var Die=require("child_process"),Tie=require("events"),KF=S(require("path")),kie=S(require("readline"));Kn();Ta();uh();ds();xe();var _ke=q()("handler-search"),Lke=["--color","ansi","--colors","path:fg:black","--colors","line:fg:green","--colors","match:fg:red","--no-messages","--heading","-n"],Ike="\x1B",zF=class extends Tie.EventEmitter{start(t,i,r){this.process=(0,Die.spawn)(t,i,{cwd:r}),this.process.on("error",h=>{this.emit("error",h.message)});let o=kie.default.createInterface(this.process.stdout),s,a,l=[],u=[],c=!0;o.on("line",h=>{if(h.includes(Ike)){let d=pp(h);if(d.length==0)return;if(d[0].foreground=="black"){a={filepath:KF.default.join(r,d[0].text),ranges:[]};return}if(d[0].foreground=="green"){let p=parseInt(d[0].text,10)-1,f=d[0].text.length+1;c&&(s=p,c=!1);let m="";for(let w of d){if(w.foreground=="red"){let x=p-s,T=m.length-f;u.push(Be.create(x,T,x,T+w.text.length))}m+=w.text}let b=m.slice(f);l.push(b)}}else{let d=h.trim().length==0;a&&(d||h.trim()=="--")&&a.ranges.push({lines:l,highlights:u,start:s}),d&&(this.emit("item",a),a=null),l=[],u=[],c=!0}}),o.on("close",()=>{a&&(l.length&&a.ranges.push({lines:l,highlights:u,start:s}),this.emit("item",a)),l=u=a=null,this.emit("end")})}dispose(){this.process&&this.process.kill()}},ey=class{constructor(e,t="rg"){this.nvim=e;this.cmd=t}run(e,t,i){let{nvim:r,cmd:o}=this,{afterContext:s,beforeContext:a}=i.config,l=["-A",s.toString(),"-B",a.toString()].concat(Lke,e),u=Fke(e);u&&l.pop(),l.push("--",u?KF.default.isAbsolute(u)?u:`./${u.replace(/^\.\//,"")}`:"./"),this.task=new zF,this.task.start(o,l,t);let c=new Di,h=0,d=0,g=Date.now(),p=[],f=async()=>{if(p.length==0)return;let m=p.slice();p=[];let b=await c.acquire();try{await i.addFileItems(m)}catch(w){_ke.error(w)}b()};return new Promise((m,b)=>{let w=setInterval(f,300);this.task.on("item",async x=>{h++,d=d+x.ranges.reduce((T,R)=>T+R.highlights.length,0),p.push(x)}),this.task.on("error",x=>{clearInterval(w),D.showErrorMessage(`Error on command "${o}": ${x}`),this.task=null,b(new Error(x))}),this.task.on("end",async()=>{clearInterval(w);try{await f(),(await c.acquire())(),this.task.removeAllListeners(),this.task=null;let T=i.buffer;if(T){if(r.pauseNotification(),h==0)T.setLines(["No match found"],{start:1,end:2,strictIndexing:!1},!0),T.addHighlight({line:1,srcId:-1,colEnd:-1,colStart:0,hlGroup:"Error"}),T.setOption("modified",!1,!0);else{let R=new Hi;R.addText("Files","MoreMsg"),R.addText(": "),R.addText(`${h} `,"Number"),R.addText("Matches","MoreMsg"),R.addText(": "),R.addText(`${d} `,"Number"),R.addText("Duration","MoreMsg"),R.addText(": "),R.addText(`${Date.now()-g}ms`,"Number"),R.render(T,1,2)}T.setOption("modified",!1,!0),r.resumeNotification(!1,!0)}}catch(x){b(x);return}m()})})}abort(){var e;(e=this.task)==null||e.dispose()}};function Fke(n){if(n.length<2)return;let e=n.length;if(!n[e-1].startsWith("-")&&!n[e-2].startsWith("-"))return n[e-1]}var Dgt=q()("handler-refactor"),jke="__coc_refactor__",Mke=0,ty=class{constructor(e,t){this.nvim=e;this.handler=t;this.buffers=new Map;this.disposables=[];this._onCreate=new _d.Emitter;this.onCreate=this._onCreate.event;this.setConfiguration(),v.onDidChangeConfiguration(this.setConfiguration,this,this.disposables),P.on("BufUnload",i=>{let r=this.buffers.get(i);r&&(r.dispose(),this.buffers.delete(i))},null,this.disposables),v.onDidChangeTextDocument(i=>{let r=this.buffers.get(i.bufnr);r&&r.onChange(i)},null,this.disposables)}async init(){v.isNvim&&this.nvim.hasFunction("nvim_create_namespace")&&(this.srcId=await this.nvim.createNamespace("coc-refactor"))}has(e){return this.buffers.has(e)}setConfiguration(e){if(e&&!e.affectsConfiguration("refactor"))return;let t=v.getConfiguration("refactor",null);this.config=Object.assign(this.config||{},{afterContext:t.get("afterContext",3),beforeContext:t.get("beforeContext",3),openCommand:t.get("openCommand","edit"),saveToFile:t.get("saveToFile",!0),showMenu:t.get("showMenu","<Tab>")})}async doRefacto
Modifiers: ${a.join(", ")}
Highlight group: ${s.hlGroup||""}`,highlights:l}];await this.floatFactory.show(u)}else this.floatFactory.close()}async fetchHighlightGroups(){let e=await this.nvim.call("coc#util#semantic_hlgroups"),t=this.highlightGroups.length;this.highlightGroups.splice(0,t,...e)}async getCurrentItem(){let e=await this.nvim.buffer,t=this.highlighters.getItem(e.id);return t}getItem(e){return this.highlighters.getItem(e)}async highlightCurrent(){let e=await this.getCurrentItem();if(!e||!e.enabled)throw new Error("Unable to perform semantic highlights for current buffer.");await this.fetchHighlightGroups(),await e.forceHighlight()}async showHighlightInfo(){let e=await this.nvim.buffer,{nvim:t}=this,i=this.highlighters.getItem(e.id);if(!i)return t.echoError("Document not attached.");let r=new Hi;t.pauseNotification(),t.command(`vs +setl\\ buftype=nofile __coc_semantic_highlights_${e.id}__`,!0),t.command("setl bufhidden=wipe noswapfile nobuflisted wrap undolevels=-1",!0),t.call("bufnr",["%"],!0);let o=await t.resumeNotification();r.addLine("Semantic highlights info",BD),r.addLine("");try{i.checkState();let a=i.highlights??[];r.addLine("The number of semantic tokens: "),r.addText(String(a.length),"Number"),r.addLine(""),r.addLine("Semantic highlight groups used by current buffer",BD),r.addLine("");let l=Ai(a.filter(h=>h.hlGroup!=null).map(({hlGroup:h})=>h));for(let h of l)r.addTexts([{text:"-",hlGroup:"Comment"},{text:" "},{text:h,hlGroup:h}]);r.addLine(""),r.addLine("Tokens types that current Language Server supported:",BD),r.addLine("");let u=v.getDocument(i.bufnr),c=_.getLegend(u.textDocument)??_.getLegend(u.textDocument,!0);if(c.tokenTypes.length){for(let h of[...new Set(c.tokenTypes)]){let d=Fd+_n(h);r.addTexts([{text:"-",hlGroup:"Comment"},{text:" "},{text:d,hlGroup:d}])}r.addLine("")}else r.addLine("No token types supported","Comment"),r.addLine("");if(r.addLine("Tokens modifiers that current Language Server supported:",BD),r.addLine(""),c.tokenModifiers.length){for(let h of[...new Set(c.tokenModifiers)]){let d=Fd+_n(h);r.addTexts([{text:"-",hlGroup:"Comment"},{text:" "},{text:d,hlGroup:d}])}r.addLine("")}else r.addLine("No token modifiers exist","Comment"),r.addLine("")}catch(a){r.addLine(a instanceof Error?a.message:a.toString(),"Error")}t.pauseNotification();let s=o[0][2];r.render(t.createBuffer(s)),t.resumeNotification(!0,!0)}dispose(){this.floatFactory.dispose(),this.highlighters.dispose(),U(this.disposables)}};var Mie=S(Pn()),ly=S(W());fe();de();re();_e();xe();ie();var fft=q()("handler-signature"),uy=class{constructor(e,t){this.nvim=e;this.handler=t;this.disposables=[];this.loadConfiguration(),this.signatureFactory=D.createFloatFactory(Object.assign({preferTop:this.config.preferAbove,autoHide:!1,modes:["i","ic","s"]},this.config.floatConfig)),this.disposables.push(this.signatureFactory),v.onDidChangeConfiguration(this.loadConfiguration,this,this.disposables),P.on("CursorMovedI",(0,Mie.default)(this.checkCurosr.bind(this),100),null,this.disposables),P.on(["InsertLeave","BufEnter"],()=>{var i;(i=this.tokenSource)==null||i.cancel()},null,this.disposables),P.on("TextChangedI",()=>{this.config.hideOnChange&&this.signatureFactory.close()},null,this.disposables),P.on("TextInsert",async(i,r,o)=>{if(!this.config.enableTrigger)return;let s=v.getDocument(i);!s||!s.attached||!_.shouldTriggerSignatureHelp(s.textDocument,o)||await this._triggerSignatureHelp(s,{line:r.lnum-1,character:r.pre.length},!1)},null,this.disposables),D.onDidChangeActiveTextEditor(()=>{this.loadConfiguration()},null,this.disposables)}checkCurosr(e,t){let i=this.lastPosition,r=this.signatureFactory;if(!i||e!==i.bufnr||r.window==null)return;let o=v.getDocument(e);if(!o||t[0]!=i.lnum||t[1]<i.col){r.close();return}let s=o.getline(i.lnum-1);if(tt(s,i.col-1,t[1]-1).endsWith(")"))return r.close()}loadConfiguration(e){var t;if(!e||e.affectsConfiguration("signature")){let i=(t=D.activeTextEditor)==null?void 0:t.document,r=v.getConfiguration("signature",i);this.config={target:r.get("target","float"),floatConfig:r.get("floatConfig",{}),enableTrigger:r.get("enable",!0),wait:Math
`)||!Lt(r))));if(o.length==1&&Xt(r,o[0].range)){if(i.includes(`
`)){this.cancelEdit();return}Zke.debug("affected single range"),await this.applySingleEdit(o[0],{range:r,newText:i})}else this.cancelEdit()}async applySingleEdit(e,t){let{bufnr:i,ranges:r}=this,o=v.getDocument(i);r.filter(c=>c!==e&&c.position.line==e.position.line).forEach(c=>c.adjustFromEdit(t));let a=HD(e,t.range,t.newText),l=Ib(a);r.forEach(c=>c.applyChange(a));let u=r.filter(c=>c!==e).map(c=>c.textEdit);if(this.changing=!0,await o.applyEdits(u,!0,!0),this.changing=!1,l!=0)for(let c of r){let h=Fb(c,this.ranges,e);c.move(h*l)}this.doHighlights()}doHighlights(){let{window:e,ranges:t,nvim:i}=this;e&&t&&(i.pauseNotification(),e.clearMatchGroup("^CocLinkedEditing"),e.highlightRanges("CocLinkedEditing",t.map(r=>r.range),99,!0),i.resumeNotification(!0,!0))}_checkPosition(e,t){if(P.pumvisible||!v.isAttached(e))return;let i=v.getDocument(e);if(!v.getConfiguration("coc.preferences",i).get("enableLinkedEditing",!1)||!_.hasProvider("linkedEditing",i.textDocument))return;let s=Gi(i.getline(t[0]-1),t[1]-1),a=ZD.Position.create(t[0]-1,s);if(this.ranges){if(this.ranges.some(l=>ft(a,l.range)==0))return;this.cancelEdit()}this.enable(i,a)}async enable(e,t){let i=e.textDocument,o=(this.tokenSource=new ZD.CancellationTokenSource).token,s=await this.nvim.window,a=await _.provideLinkedEdits(i,t,o);if(o.isCancellationRequested||!a||a.ranges.length==0)return;let l=a.ranges.map(u=>new Uu(u.start.line,u.start.character,i.getText(u)));this.wordPattern=a.wordPattern,this.bufnr=e.bufnr,this.window=s,this.ranges=l,this.doHighlights()}cancel(){this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource=null)}};var Yie=S(W());Jt();fe();de();re();xe();ie();var wo=S(W());fe();de();L_();re();xr();xt();_e();ie();var qmt=q()("inlayHint-buffer"),ec,Jke=100;function tj(n){switch(n){case wo.InlayHintKind.Parameter:return"CocInlayHintParameter";case wo.InlayHintKind.Type:return"CocInlayHintType";default:return"CocInlayHint"}}var fy=class{constructor(e,t){this.nvim=e;this.doc=t;this.regions=new ll;this.currentHints=[];this._onDidRefresh=new wo.Emitter;this.onDidRefresh=this._onDidRefresh.event;this.loadConfiguration(),this.render=lw(()=>{this.renderRange()},Jke),this.render()}loadConfiguration(){let e=v.getConfiguration("inlayHint",this.doc),t=this.config&&this.config.enable!=e.enable;if(this.config={enable:e.get("enable"),display:e.get("display",!0),filetypes:e.get("filetypes"),refreshOnInsertMode:e.get("refreshOnInsertMode"),enableParameter:e.get("enableParameter"),typeSeparator:e.get("typeSeparator",""),parameterSeparator:e.get("parameterSeparator",""),subSeparator:e.get("subSeparator"," ")},t){let{enable:i,display:r}=this.config;i?(this.clearCache(),this.clearVirtualText()):r&&this.renderRange()}}onInsertLeave(){this.config.refreshOnInsertMode||this.render()}onInsertEnter(){this.config.refreshOnInsertMode||this.cancel()}get current(){return this.currentHints}get enabled(){return!this.config.display||!this.configEnabled?!1:_.hasProvider("inlayHint",this.doc.textDocument)}get configEnabled(){let{filetypes:e,enable:t}=this.config;return Array.isArray(e)?e.includes("*")||e.includes(this.doc.filetype):t===!0}toggle(){if(!_.hasProvider("inlayHint",this.doc.textDocument))throw new Error("Inlay hint provider not found for current document");if(!this.configEnabled)throw new Error(`Filetype "${this.doc.filetype}" not enabled by inlayHint configuration`);this.config.display?(this.config.display=!1,this.clearCache(),this.clearVirtualText()):(this.config.display=!0,this.renderRange())}clearCache(){this.currentHints=[],this.regions.clear(),this.render.clear()}onTextChange(){this.clearCache(),this.cancel()}onChange(){this.cancel(),this.render()}cancel(){this.render.clear(),this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource=null)}async requestInlayHints(e,t){try{return await _.provideInlayHints(this.doc.textDocument,e,t)}catch(i){!t.isCancellationRequested&&i instanceof ii&&this.render(500)}}async renderRange(){if(this.cancel(),P.insertMode&&!this.config.refreshOnInsertMode||!this.enabled)return;this.tokenSource=new wo.CancellationTokenSource;let e=this.tok
`+n.stack):console.error("UnhandledRejection: "+n),$D.error("unhandledRejection ",e,n)});
/*!
* bytes
* Copyright(c) 2012-2014 TJ Holowaychuk
* Copyright(c) 2015 Jed Watson
* MIT Licensed
*/
/*!
* content-disposition
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*/
/*! (c) 2020 Andrea Giammarchi */
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
/**
* event-lite.js - Light-weight EventEmitter (less than 1KB when gzipped)
*
* @copyright Yusuke Kawasaki
* @license MIT
* @constructor
* @see https://github.com/kawanet/event-lite
* @see http://kawanet.github.io/event-lite/EventLite.html
* @example
* var EventLite = require("event-lite");
*
* function MyClass() {...} // your class
*
* EventLite.mixin(MyClass.prototype); // import event methods
*
* var obj = new MyClass();
* obj.on("foo", function() {...}); // add event listener
* obj.once("bar", function() {...}); // add one-time event listener
* obj.emit("foo"); // dispatch event
* obj.emit("bar"); // dispatch another event
* obj.off("foo"); // remove event listener
*/