1
0
Fork 0
mirror of synced 2024-11-17 22:45:34 -05:00
ultimate-vim/sources_non_forked/coc.nvim/build/index.js

327 lines
1.5 MiB
JavaScript
Raw Normal View History

2022-05-18 13:29:28 -04:00
"use strict";(function () {
var v = process.version
var parts = v.slice(1).split('.')
var major = parseInt(parts[0], 10)
var minor = parseInt(parts[1], 10)
if (major < 12 || (major == 12 && minor < 12)) {
throw new Error('coc.nvim requires node >= v12.12.0, current version: ' + v)
}
})();
2022-05-19 10:14:37 -04:00
var Nte=Object.create;var Yh=Object.defineProperty,Bte=Object.defineProperties,Hte=Object.getOwnPropertyDescriptor,qte=Object.getOwnPropertyDescriptors,Yte=Object.getOwnPropertyNames,sR=Object.getOwnPropertySymbols,Wte=Object.getPrototypeOf,lR=Object.prototype.hasOwnProperty,Zte=Object.prototype.propertyIsEnumerable;var aR=(n,e,t)=>e in n?Yh(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,fe=(n,e)=>{for(var t in e||(e={}))lR.call(e,t)&&aR(n,t,e[t]);if(sR)for(var t of sR(e))Zte.call(e,t)&&aR(n,t,e[t]);return n},Wh=(n,e)=>Bte(n,qte(e)),uR=n=>Yh(n,"__esModule",{value:!0});var _=(n,e)=>()=>(n&&(e=n(n=0)),e);var m=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),vs=(n,e)=>{for(var t in e)Yh(n,t,{get:e[t],enumerable:!0})},cR=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Yte(e))!lR.call(n,r)&&(t||r!=="default")&&Yh(n,r,{get:()=>e[r],enumerable:!(i=Hte(e,r))||i.enumerable});return n},x=(n,e)=>cR(uR(Yh(n!=null?Nte(Wte(n)):{},"default",!e&&n&&n.__esModule?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n),Oa=(n=>(e,t)=>n&&n.get(e)||(t=cR(uR({}),e,1),n&&n.set(e,t),t))(typeof WeakMap!="undefined"?new WeakMap:0);var dR=m((LTe,hR)=>{var du=1e3,gu=du*60,fu=gu*60,Ma=fu*24,Jte=Ma*7,$te=Ma*365.25;hR.exports=function(n,e){e=e||{};var t=typeof n;if(t==="string"&&n.length>0)return Xte(n);if(t==="number"&&isFinite(n))return e.long?Gte(n):Ute(n);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(n))};function Xte(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*$te;case"weeks":case"week":case"w":return t*Jte;case"days":case"day":case"d":return t*Ma;case"hours":case"hour":case"hrs":case"hr":case"h":return t*fu;case"minutes":case"minute":case"mins":case"min":case"m":return t*gu;case"seconds":case"second":case"secs":case"sec":case"s":return t*du;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Ute(n){var e=Math.abs(n);return e>=Ma?Math.round(n/Ma)+"d":e>=fu?Math.round(n/fu)+"h":e>=gu?Math.round(n/gu)+"m":e>=du?Math.round(n/du)+"s":n+"ms"}function Gte(n){var e=Math.abs(n);return e>=Ma?fp(n,e,Ma,"day"):e>=fu?fp(n,e,fu,"hour"):e>=gu?fp(n,e,gu,"minute"):e>=du?fp(n,e,du,"second"):n+" ms"}function fp(n,e,t,i){var r=e>=t*1.5;return Math.round(n/t)+" "+i+(r?"s":"")}});var bC=m((FTe,gR)=>{function Qte(n){t.debug=t,t.default=t,t.coerce=l,t.disable=o,t.enable=r,t.enabled=s,t.humanize=dR(),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,f;function p(...b){if(!p.enabled)return;let y=p,w=Number(new Date),D=w-(h||w);y.diff=D,y.prev=h,y.curr=w,h=w,b[0]=t.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let T=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(I,A)=>{if(I==="%%")return"%";T++;let W=t.formatters[A];if(typeof W=="function"){let B=b[T];I=W.call(y,B),b.splice(T,1),T--}return I}),t.formatArgs.call(y,b),(y.log||t.log).apply(y,b)}return p.namespace=c,p.useColors=t.useColors(),p.color=t.selectColor(c),p.extend=i,p.destroy=t.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(g!==t.namespaces&&(g=t.namespaces,f=t.enabled(c)),f),set:b=>{d=b}}),typeof t.init=="function"&&t.init(p),p}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(",");retur
2022-05-18 13:29:28 -04:00
`).join(`
2022-05-19 10:14:37 -04:00
`+o),n.push(r+"m+"+bp.exports.humanize(this.diff)+"\x1B[0m")}else n[0]=lie()+e+" "+n[0]}function lie(){return gi.inspectOpts.hideDate?"":new Date().toISOString()+" "}function uie(...n){return process.stderr.write(mp.format(...n)+`
`)}function cie(n){n?process.env.DEBUG=n:delete process.env.DEBUG}function hie(){return process.env.DEBUG}function die(n){n.inspectOpts={};let e=Object.keys(gi.inspectOpts);for(let t=0;t<e.length;t++)n.inspectOpts[e[t]]=gi.inspectOpts[e[t]]}bp.exports=bC()(gi);var{formatters:wR}=bp.exports;wR.o=function(n){return this.inspectOpts.colors=this.useColors,mp.inspect(n,this.inspectOpts).split(`
`).map(e=>e.trim()).join(" ")};wR.O=function(n){return this.inspectOpts.colors=this.useColors,mp.inspect(n,this.inspectOpts)}});var It=m((ATe,wC)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?wC.exports=fR():wC.exports=DR()});var xR=m((OTe,CR)=>{"use strict";CR.exports=gie;function pu(n){return n instanceof Buffer?Buffer.from(n):new n.constructor(n.buffer.slice(),n.byteOffset,n.length)}function gie(n){if(n=n||{},n.circles)return fie(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]=pu(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]=pu(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]=pu(a):o[s]=i(a)}return o}}function fie(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]=pu(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]=pu(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]=pu(u);else{var c=e.indexOf(u);c!==-1?a[l]=t[c]:a[l]=o(u)}}return e.pop(),t.pop(),a}}});var Ba=m((MTe,ER)=>{var pie=require("util"),Na=It()("log4js:configuration"),yp=[],vp=[],SR=n=>!n,TR=n=>n&&typeof n=="object"&&!Array.isArray(n),mie=n=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(n),bie=n=>n&&typeof n=="number"&&Number.isInteger(n),yie=n=>{vp.push(n),Na(`Added listener, now ${vp.length} listeners`)},vie=n=>{yp.push(n),Na(`Added pre-processing listener, now ${yp.length} listeners`)},kR=(n,e,t)=>{(Array.isArray(e)?e:[e]).forEach(r=>{if(r)throw new Error(`Problem with log4js configuration: (${pie.inspect(n,{depth:5})}) - ${t}`)})},wie=n=>{Na("New configuration to be validated: ",n),kR(n,SR(TR(n)),"must be an object."),Na(`Calling pre-processing listeners (${yp.length})`),yp.forEach(e=>e(n)),Na("Configuration pre-processing f
`)}}function Bie(n,e){let t=e.colouredLayout;return n.layout&&(t=e.layout(n.layout.type,n.layout)),Nie(t,n.timezoneOffset)}hL.configure=Bie});var fL=m((XTe,gL)=>{function Hie(n,e){return t=>{process.stderr.write(`${n(t,e)}
`)}}function qie(n,e){let t=e.colouredLayout;return n.layout&&(t=e.layout(n.layout.type,n.layout)),Hie(t,n.timezoneOffset)}gL.exports.configure=qie});var mL=m((UTe,pL)=>{function Yie(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 Wie(n,e,t,i){let r=t(n.appender);return Yie(n.level,n.maxLevel,r,i)}pL.exports.configure=Wie});var vL=m((GTe,yL)=>{var bL=It()("log4js:categoryFilter");function Zie(n,e){return typeof n=="string"&&(n=[n]),t=>{bL(`Checking ${t.categoryName} against ${n}`),n.indexOf(t.categoryName)===-1&&(bL("Not excluded, sending to appender"),e(t))}}function Jie(n,e,t){let i=t(n.appender);return Zie(n.exclude,i)}yL.exports.configure=Jie});var CL=m((QTe,DL)=>{var wL=It()("log4js:noLogFilter");function $ie(n){return n.filter(t=>t!=null&&t!=="")}function Xie(n,e){return t=>{wL(`Checking data: ${t.data} against filters: ${n}`),typeof n=="string"&&(n=[n]),n=$ie(n);let i=new RegExp(n.join("|"),"i");(n.length===0||t.data.findIndex(r=>i.test(r))<0)&&(wL("Not excluded, sending to appender"),e(t))}}function Uie(n,e,t){let i=t(n.appender);return Xie(n.exclude,i)}DL.exports.configure=Uie});var gt=m(kC=>{"use strict";kC.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})};kC.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 SL=m((zTe,xL)=>{var Cs=require("constants"),Gie=process.cwd,Tp=null,Qie=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Tp||(Tp=Gie.call(process)),Tp};try{process.cwd()}catch{}typeof process.chdir=="function"&&(EC=process.chdir,process.chdir=function(n){Tp=null,EC.call(process,n)},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,EC));var EC;xL.exports=Kie;function Kie(n){Cs.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(){}),Qie==="win32"&&(n.rename=function(c){return function(h,d,g){var f=Date.now(),p=0;c(h,d,function b(y){if(y&&(y.code==="EACCES"||y.code==="EPERM")&&Date.now()-f<6e4){setTimeout(function(){n.stat(d,function(w,D){w&&w.code==="ENOENT"?c(h,d,b):g(y)})},p),p<100&&(p+=10);return}g&&g(y)})}}(n.rename)),n.read=function(c){function h(d,g,f,p,b,y){var w;if(y&&typeof y=="function"){var D=0;w=function(T,L,I){if(T&&T.code==="EAGAIN"&&D<10)return D++,c.call(n,d,g,f,p,b,w);y.apply(this,arguments)}}return c.call(n,d,g,f,p,b,w)}return Object.setPrototypeOf&&Object.setPrototypeOf(h,c),h}(n.read),n.readSync=function(c){return function(h,d,g,f,p){for(var b=0;;)try{return c.call(n,h,d,g,f,p)}catch(y){if(y.code==="EAGAIN"&&b<10){b++;continue}throw y}}}(n.readSync);function e(c){c.lchmod=function(h,d,g){c.open(h,Cs.O_WRONLY|Cs.O_SYMLINK,d,function(f,p){if(f){g&&g(f);return}c.fchmod(p,d,function(b){c.close(p,function(y){g&&g(b||y)})})})},c.lchmodSync=function(h,d){var g=c.openSync(h,Cs.O_WRONLY|Cs.O_SYMLINK,d),f=!0,p;try{p=c.fchmodSync(g,d),f=!1}finally{if(f)try{c.closeSync(g)}catch{}else c.closeSync(g)}return p}}function t(c){Cs.hasOwnProperty("O_SYMLINK")?(c.lutimes=function(h,d,g,f){c.open(h,Cs.O_SYMLINK,function(p,b){if(p){f&&f(p);return}c.futimes(b,d,g,function(y){c.close(b,function(w){f&&f(y||w)})
GFS4: `),console.error(n)});fi[pr]||(RL=global[pr]||[],LL(fi,RL),fi.close=function(n){function e(t,i){return n.call(fi,t,function(r){r||xs(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(e,Ep,{value:n}),e}(fi.close),fi.closeSync=function(n){function e(t){n.apply(fi,arguments),xs()}return Object.defineProperty(e,Ep,{value:n}),e}(fi.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Qh(fi[pr]),require("assert").equal(fi[pr].length,0)}));var RL;global[pr]||LL(global,fi[pr]);_C.exports=PC(nne(fi));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!fi.__patched&&(_C.exports=PC(fi),fi.__patched=!0);function PC(n){tne(n),n.gracefulify=PC,n.createReadStream=L,n.createWriteStream=I;var e=n.readFile;n.readFile=t;function t(B,N,F){return typeof N=="function"&&(F=N,N=null),M(B,N,F);function M(Z,K,ae){return e(Z,K,function(je){je&&(je.code==="EMFILE"||je.code==="ENFILE")?bu([M,[Z,K,ae]]):(typeof ae=="function"&&ae.apply(this,arguments),xs())})}}var i=n.writeFile;n.writeFile=r;function r(B,N,F,M){return typeof F=="function"&&(M=F,F=null),Z(B,N,F,M);function Z(K,ae,je,_e){return i(K,ae,je,function(et){et&&(et.code==="EMFILE"||et.code==="ENFILE")?bu([Z,[K,ae,je,_e]]):(typeof _e=="function"&&_e.apply(this,arguments),xs())})}}var o=n.appendFile;o&&(n.appendFile=s);function s(B,N,F,M){return typeof F=="function"&&(M=F,F=null),Z(B,N,F,M);function Z(K,ae,je,_e){return o(K,ae,je,function(et){et&&(et.code==="EMFILE"||et.code==="ENFILE")?bu([Z,[K,ae,je,_e]]):(typeof _e=="function"&&_e.apply(this,arguments),xs())})}}var a=n.copyFile;a&&(n.copyFile=l);function l(B,N,F,M){return typeof F=="function"&&(M=F,F=0),a(B,N,F,function(Z){Z&&(Z.code==="EMFILE"||Z.code==="ENFILE")?bu([a,[B,N,F,M]]):(typeof M=="function"&&M.apply(this,arguments),xs())})}var u=n.readdir;n.readdir=c;function c(B,N,F){var M=[B];return typeof N!="function"?M.push(N):F=N,M.push(Z),h(M);function Z(K,ae){ae&&ae.sort&&ae.sort(),K&&(K.code==="EMFILE"||K.code==="ENFILE")?bu([h,[M]]):(typeof F=="function"&&F.apply(this,arguments),xs())}}function h(B){return u.apply(n,B)}if(process.version.substr(0,4)==="v0.8"){var d=ine(n);y=d.ReadStream,D=d.WriteStream}var g=n.ReadStream;g&&(y.prototype=Object.create(g.prototype),y.prototype.open=w);var f=n.WriteStream;f&&(D.prototype=Object.create(f.prototype),D.prototype.open=T),Object.defineProperty(n,"ReadStream",{get:function(){return y},set:function(B){y=B},enumerable:!0,configurable:!0}),Object.defineProperty(n,"WriteStream",{get:function(){return D},set:function(B){D=B},enumerable:!0,configurable:!0});var p=y;Object.defineProperty(n,"FileReadStream",{get:function(){return p},set:function(B){p=B},enumerable:!0,configurable:!0});var b=D;Object.defineProperty(n,"FileWriteStream",{get:function(){return b},set:function(B){b=B},enumerable:!0,configurable:!0});function y(B,N){return this instanceof y?(g.apply(this,arguments),this):y.apply(Object.create(y.prototype),arguments)}function w(){var B=this;W(B.path,B.flags,B.mode,function(N,F){N?(B.autoClose&&B.destroy(),B.emit("error",N)):(B.fd=F,B.emit("open",F),B.read())})}function D(B,N){return this instanceof D?(f.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function T(){var B=this;W(B.path,B.flags,B.mode,function(N,F){N?(B.destroy(),B.emit("error",N)):(B.fd=F,B.emit("open",F))})}function L(B,N){return new n.ReadStream(B,N)}function I(B,N){return new n.WriteStream(B,N)}var A=n.open;n.open=W;function W(B,N,F,M){return typeof F=="function"&&(M=F,F=null),Z(B,N,F,M);function Z(K,ae,je,_e){return A(K,ae,je,function(et,St){et&&(et.code==="EMFILE"||et.code==="ENFILE")?bu([Z,[K,ae,je,_e]]):(typeof _e=="function"&&_e.apply(this,arguments),xs())})}}return n}function bu(n){Qh("ENQUEUE",n[0].name,n[1]),fi[pr].push(n)}function xs(){var n=fi[pr].shift();n&&(Qh("RETRY",n[0].name,n[1]),n[0].apply(null,n[1]))}});var Wa=m(Ss=>{"use strict";var FL=gt().fromCallback,Pn=Qe(),one=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat",
2022-05-18 13:29:28 -04:00
2022-05-19 10:14:37 -04:00
see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:i,destStat:r}=Vh.checkPathsSync(n,e,"copy",t);return Vh.checkParentPathsSync(n,i,e,"copy"),vne(r,n,e,t)}function vne(n,e,t,i){if(i.filter&&!i.filter(e,t))return;let r=zh.dirname(t);return Si.existsSync(r)||mne(r),ZL(n,e,t,i)}function wne(n,e,t,i){if(!(i.filter&&!i.filter(e,t)))return ZL(n,e,t,i)}function ZL(n,e,t,i){let o=(i.dereference?Si.statSync:Si.lstatSync)(e);if(o.isDirectory())return Ene(o,n,e,t,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return Dne(o,n,e,t,i);if(o.isSymbolicLink())return Rne(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 Dne(n,e,t,i,r){return e?Cne(n,t,i,r):JL(n,t,i,r)}function Cne(n,e,t,i){if(i.overwrite)return Si.unlinkSync(t),JL(n,e,t,i);if(i.errorOnExist)throw new Error(`'${t}' already exists`)}function JL(n,e,t,i){return Si.copyFileSync(e,t),i.preserveTimestamps&&xne(n.mode,e,t),AC(t,n.mode)}function xne(n,e,t){return Sne(n)&&Tne(t,n),kne(e,t)}function Sne(n){return(n&128)===0}function Tne(n,e){return AC(n,e|128)}function AC(n,e){return Si.chmodSync(n,e)}function kne(n,e){let t=Si.statSync(n);return bne(e,t.atime,t.mtime)}function Ene(n,e,t,i,r){return e?$L(t,i,r):Pne(n.mode,t,i,r)}function Pne(n,e,t,i){return Si.mkdirSync(t),$L(e,t,i),AC(t,n)}function $L(n,e,t){Si.readdirSync(n).forEach(i=>_ne(i,n,e,t))}function _ne(n,e,t,i){let r=zh.join(e,n),o=zh.join(t,n),{destStat:s}=Vh.checkPathsSync(r,o,"copy",i);return wne(s,r,o,i)}function Rne(n,e,t,i){let r=Si.readlinkSync(e);if(i.dereference&&(r=zh.resolve(process.cwd(),r)),n){let o;try{o=Si.readlinkSync(t)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return Si.symlinkSync(r,t);throw s}if(i.dereference&&(o=zh.resolve(process.cwd(),o)),Vh.isSrcSubdir(r,o))throw new Error(`Cannot copy '${r}' to a subdirectory of itself, '${o}'.`);if(Si.statSync(t).isDirectory()&&Vh.isSrcSubdir(o,r))throw new Error(`Cannot overwrite '${o}' with '${r}'.`);return Lne(r,t)}else return Si.symlinkSync(r,t)}function Lne(n,e){return Si.unlinkSync(e),Si.symlinkSync(n,e)}XL.exports=yne});var OC=m((uke,GL)=>{"use strict";GL.exports={copySync:UL()}});var Ts=m((cke,KL)=>{"use strict";var Fne=gt().fromPromise,QL=Wa();function Ine(n){return QL.access(n).then(()=>!0).catch(()=>!1)}KL.exports={pathExists:Fne(Ine),pathExistsSync:QL.existsSync}});var oF=m((hke,rF)=>{"use strict";var nn=Qe(),ed=require("path"),jne=mr().mkdirs,Ane=Ts().pathExists,One=IC().utimesMillis,td=Za();function Mne(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;
2022-05-18 13:29:28 -04:00
2022-05-19 10:14:37 -04:00
see https://github.com/jprichardson/node-fs-extra/issues/269`),td.checkPaths(n,e,"copy",t,(r,o)=>{if(r)return i(r);let{srcStat:s,destStat:a}=o;td.checkParentPaths(n,s,e,"copy",l=>l?i(l):t.filter?eF(zL,a,n,e,t,i):zL(a,n,e,t,i))})}function zL(n,e,t,i,r){let o=ed.dirname(t);Ane(o,(s,a)=>{if(s)return r(s);if(a)return _p(n,e,t,i,r);jne(o,l=>l?r(l):_p(n,e,t,i,r))})}function eF(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 Nne(n,e,t,i,r){return i.filter?eF(_p,n,e,t,i,r):_p(n,e,t,i,r)}function _p(n,e,t,i,r){(i.dereference?nn.stat:nn.lstat)(e,(s,a)=>s?r(s):a.isDirectory()?Jne(a,n,e,t,i,r):a.isFile()||a.isCharacterDevice()||a.isBlockDevice()?Bne(a,n,e,t,i,r):a.isSymbolicLink()?Une(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 Bne(n,e,t,i,r,o){return e?Hne(n,t,i,r,o):tF(n,t,i,r,o)}function Hne(n,e,t,i,r){if(i.overwrite)nn.unlink(t,o=>o?r(o):tF(n,e,t,i,r));else return i.errorOnExist?r(new Error(`'${t}' already exists`)):r()}function tF(n,e,t,i,r){nn.copyFile(e,t,o=>o?r(o):i.preserveTimestamps?qne(n.mode,e,t,r):Rp(t,n.mode,r))}function qne(n,e,t,i){return Yne(n)?Wne(t,n,r=>r?i(r):VL(n,e,t,i)):VL(n,e,t,i)}function Yne(n){return(n&128)===0}function Wne(n,e,t){return Rp(n,e|128,t)}function VL(n,e,t,i){Zne(e,t,r=>r?i(r):Rp(t,n,i))}function Rp(n,e,t){return nn.chmod(n,e,t)}function Zne(n,e,t){nn.stat(n,(i,r)=>i?t(i):One(e,r.atime,r.mtime,t))}function Jne(n,e,t,i,r,o){return e?iF(t,i,r,o):$ne(n.mode,t,i,r,o)}function $ne(n,e,t,i,r){nn.mkdir(t,o=>{if(o)return r(o);iF(e,t,i,s=>s?r(s):Rp(t,n,r))})}function iF(n,e,t,i){nn.readdir(n,(r,o)=>r?i(r):nF(o,n,e,t,i))}function nF(n,e,t,i,r){let o=n.pop();return o?Xne(n,o,e,t,i,r):r()}function Xne(n,e,t,i,r,o){let s=ed.join(t,e),a=ed.join(i,e);td.checkPaths(s,a,"copy",r,(l,u)=>{if(l)return o(l);let{destStat:c}=u;Nne(c,s,a,r,h=>h?o(h):nF(n,t,i,r,o))})}function Une(n,e,t,i,r){nn.readlink(e,(o,s)=>{if(o)return r(o);if(i.dereference&&(s=ed.resolve(process.cwd(),s)),n)nn.readlink(t,(a,l)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?nn.symlink(s,t,r):r(a):(i.dereference&&(l=ed.resolve(process.cwd(),l)),td.isSrcSubdir(s,l)?r(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${l}'.`)):n.isDirectory()&&td.isSrcSubdir(l,s)?r(new Error(`Cannot overwrite '${l}' with '${s}'.`)):Gne(s,t,r)));else return nn.symlink(s,t,r)})}function Gne(n,e,t){nn.unlink(e,i=>i?t(i):nn.symlink(n,e,t))}rF.exports=Mne});var MC=m((dke,sF)=>{"use strict";var Qne=gt().fromCallback;sF.exports={copy:Qne(oF())}});var pF=m((gke,fF)=>{"use strict";var aF=Qe(),hF=require("path"),st=require("assert"),id=process.platform==="win32";function dF(n){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(t=>{n[t]=n[t]||aF[t],t=t+"Sync",n[t]=n[t]||aF[t]}),n.maxBusyTries=n.maxBusyTries||3}function NC(n,e,t){let i=0;typeof e=="function"&&(t=e,e={}),st(n,"rimraf: missing path"),st.strictEqual(typeof n,"string","rimraf: path should be a string"),st.strictEqual(typeof t,"function","rimraf: callback function required"),st(e,"rimraf: invalid options argument provided"),st.strictEqual(typeof e,"object","rimraf: options should be object"),dF(e),lF(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(()=>lF(n,e,r),s)}o.code==="ENOENT"&&(o=null)}t(o)})}function lF(n,e,t){st(n),st(e),st(typeof t=="function"),e.lstat(n,(i,r)=>{if(i&&i.code==="ENOENT")return t(null);if(i&&i.code==="EPERM"&&id)return uF(n,e,i,t);if(r&&r.isDirectory())return Lp(n,e,i,t);e.unlink(n,o=>{if(o){if(o.code==="ENOENT")return t(null);if(o.code==="EPERM")return id?uF(n,e,o,t):Lp(n,e,o,t);if(o.code==="EISDIR")return Lp(n,e,o,t)}return t(o)})})}function uF(n,e,t,i){st(n),st(e),st(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()?Lp(n,e,t,i):e.unlink(n,i)})})}function cF(n,e,t){let i;st(n),st(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 kre(n){return Buffer.isBuffer(n)&&(n=n.toString("utf8")),n.replace(/^\uFEFF/,"")}QF.exports={stringify:Tre,stripBom:kre}});var BC=m((xke,VF)=>{var Du;try{Du=Qe()}catch{Du=require("fs")}var Mp=gt(),{stringify:KF,stripBom:zF}=wu();async function Ere(n,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||Du,i="throws"in e?e.throws:!0,r=await Mp.fromCallback(t.readFile)(n,e);r=zF(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 Pre=Mp.fromPromise(Ere);function _re(n,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||Du,i="throws"in e?e.throws:!0;try{let r=t.readFileSync(n,e);return r=zF(r),JSON.parse(r,e.reviver)}catch(r){if(i)throw r.message=`${n}: ${r.message}`,r;return null}}async function Rre(n,e,t={}){let i=t.fs||Du,r=KF(e,t);await Mp.fromCallback(i.writeFile)(n,r,t)}var Lre=Mp.fromPromise(Rre);function Fre(n,e,t={}){let i=t.fs||Du,r=KF(e,t);return i.writeFileSync(n,r,t)}var Ire={readFile:Pre,readFileSync:_re,writeFile:Lre,writeFileSync:Fre};VF.exports=Ire});var tI=m((Ske,eI)=>{"use strict";var Np=BC();eI.exports={readJson:Np.readFile,readJsonSync:Np.readFileSync,writeJson:Np.writeFile,writeJsonSync:Np.writeFileSync}});var Bp=m((Tke,rI)=>{"use strict";var jre=gt().fromCallback,od=Qe(),iI=require("path"),nI=mr(),Are=Ts().pathExists;function Ore(n,e,t,i){typeof t=="function"&&(i=t,t="utf8");let r=iI.dirname(n);Are(r,(o,s)=>{if(o)return i(o);if(s)return od.writeFile(n,e,t,i);nI.mkdirs(r,a=>{if(a)return i(a);od.writeFile(n,e,t,i)})})}function Mre(n,...e){let t=iI.dirname(n);if(od.existsSync(t))return od.writeFileSync(n,...e);nI.mkdirsSync(t),od.writeFileSync(n,...e)}rI.exports={outputFile:jre(Ore),outputFileSync:Mre}});var sI=m((kke,oI)=>{"use strict";var{stringify:Nre}=wu(),{outputFile:Bre}=Bp();async function Hre(n,e,t={}){let i=Nre(e,t);await Bre(n,i,t)}oI.exports=Hre});var lI=m((Eke,aI)=>{"use strict";var{stringify:qre}=wu(),{outputFileSync:Yre}=Bp();function Wre(n,e,t){let i=qre(e,t);Yre(n,i,t)}aI.exports=Wre});var cI=m((Pke,uI)=>{"use strict";var Zre=gt().fromPromise,qi=tI();qi.outputJson=Zre(sI());qi.outputJsonSync=lI();qi.outputJSON=qi.outputJson;qi.outputJSONSync=qi.outputJsonSync;qi.writeJSON=qi.writeJson;qi.writeJSONSync=qi.writeJsonSync;qi.readJSON=qi.readJson;qi.readJSONSync=qi.readJsonSync;uI.exports=qi});var pI=m((_ke,fI)=>{"use strict";var dI=Qe(),qC=require("path"),Jre=OC().copySync,gI=nd().removeSync,$re=mr().mkdirpSync,hI=Za();function Xre(n,e,t){t=t||{};let i=t.overwrite||t.clobber||!1,{srcStat:r,isChangingCase:o=!1}=hI.checkPathsSync(n,e,"move",t);return hI.checkParentPathsSync(n,r,e,"move"),Ure(e)||$re(qC.dirname(e)),Gre(n,e,i,o)}function Ure(n){let e=qC.dirname(n);return qC.parse(e).root===e}function Gre(n,e,t,i){if(i)return HC(n,e,t);if(t)return gI(e),HC(n,e,t);if(dI.existsSync(e))throw new Error("dest already exists.");return HC(n,e,t)}function HC(n,e,t){try{dI.renameSync(n,e)}catch(i){if(i.code!=="EXDEV")throw i;return Qre(n,e,t)}}function Qre(n,e,t){return Jre(n,e,{overwrite:t,errorOnExist:!0}),gI(n)}fI.exports=Xre});var bI=m((Rke,mI)=>{"use strict";mI.exports={moveSync:pI()}});var CI=m((Lke,DI)=>{"use strict";var Kre=Qe(),WC=require("path"),zre=MC().copy,wI=nd().remove,Vre=mr().mkdirp,eoe=Ts().pathExists,yI=Za();function toe(n,e,t,i){typeof t=="function"&&(i=t,t={});let r=t.overwrite||t.clobber||!1;yI.checkPaths(n,e,"move",t,(o,s)=>{if(o)return i(o);let{srcStat:a,isChangingCase:l=!1}=s;yI.checkParentPaths(n,a,e,"move",u=>{if(u)return i(u);if(ioe(e))return vI(n,e,r,l,i);Vre(WC.dirname(e),c=>c?i(c):vI(n,e,r,l,i))})})}function ioe(n){let e=WC.dirname(n);return WC.parse(e).root===e}function vI(n,e,t,i,r){if(i)return YC(n,e,t,r);if(t)return wI(e,o=>o?r(o):YC(n,e,t,r));eoe(e,(o,s)=>o?r(o):s?r(new Error("dest already exists.")):YC(n,e,t,r))}function YC(n,e,t,i){Kre.rename(n,e,r=>r?r.code!=="EXDEV"?i(r):noe(n,e,t,i):i())}function noe(n,e,t,i){zre(n,e,{overwrite:t,errorOnExist:!0},o=>o?i(o):wI(n,i))}DI.exports=
`;function zI(n,e){if(Zr.existsSync(n))return;let t=Zr.openSync(n,e.flags,e.mode);Zr.closeSync(t)}var VI=class{constructor(e,t,i,r){ko("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=Zr.statSync(a).size}catch{zI(a,r)}return l}this.currentSize=s(this.filename)}shouldRoll(){return ko("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(`^${Cu.basename(e)}`);function r(u){return i.test(u)}function o(u){return parseInt(u.substring(`${Cu.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(ko(`Index of ${u} is ${c}`),t.backups===0)Zr.truncateSync(e,0);else if(c<t.backups){try{Zr.unlinkSync(`${e}.${c+1}`)}catch{}ko(`Renaming ${u} -> ${e}.${c+1}`),Zr.renameSync(Cu.join(Cu.dirname(e),u),`${e}.${c+1}`)}}function l(){ko("Renaming the old files"),Zr.readdirSync(Cu.dirname(e)).filter(r).sort(s).reverse().forEach(a)}ko("Rolling, rolling, rolling"),l()}write(e,t){let i=this;function r(){ko("writing the chunk to the file"),i.currentSize+=e.length,Zr.appendFileSync(i.filename,e)}ko("in write"),this.shouldRoll()&&(this.currentSize=0,this.roll(this.filename)),r()}};function joe(n,e,t,i,r,o){ko("fileSync appender created"),n=Cu.normalize(n),i=!i&&i!==0?5:i;function s(l,u,c){let h;return u?h=new VI(l,u,c,o):h=(d=>(zI(d,o),{write(g){Zr.appendFileSync(d,g)}}))(l),h}let a=s(n,t,i);return l=>{a.write(e(l,r)+Ioe)}}function Aoe(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 joe(n.filename,t,n.maxLogSize,n.backups,n.timezoneOffset,i)}ej.exports.configure=Aoe});var nj=m((Jke,ij)=>{var Jr=It()("log4js:tcp"),Ooe=require("net");function Moe(n,e){let t=!1,i=[],r,o=3,s="__LOG4JS__";function a(h){Jr("Writing log event to socket"),t=r.write(`${e(h)}${s}`,"utf8")}function l(){let h;for(Jr("emptying buffer");h=i.shift();)a(h)}function u(){Jr(`appender creating socket to ${n.host||"localhost"}:${n.port||5e3}`),s=`${n.endMsg||"__LOG4JS__"}`,r=Ooe.createConnection(n.port||5e3,n.host||"localhost"),r.on("connect",()=>{Jr("socket connected"),l(),t=!0}),r.on("drain",()=>{Jr("drain event received, emptying buffer"),t=!0,l()}),r.on("timeout",r.end.bind(r)),r.on("error",h=>{Jr("connection error",h),t=!1,l()}),r.on("close",u)}u();function c(h){t?a(h):(Jr("buffering log event because it cannot write at the moment"),i.push(h))}return c.shutdown=function(h){Jr("shutdown called"),i.length&&o?(Jr("buffer has items, waiting 100ms to empty"),o-=1,setTimeout(()=>{c.shutdown(h)},100)):(r.removeAllListeners("close"),r.end(h))},c}function Noe(n,e){Jr(`configure with config = ${n}`);let t=function(i){return i.serialise()};return n.layout&&(t=e.layout(n.layout.type,n.layout)),Moe(n,t)}ij.exports.configure=Noe});var UC=m(($ke,XC)=>{var Boe=require("path"),$a=It()("log4js:appenders"),Jn=Ba(),rj=Sp(),Hoe=Ya(),qoe=CC(),Yoe=lL(),yr=new Map;yr.set("console",cL());yr.set("stdout",dL());yr.set("stderr",fL());yr.set("logLevelFilter",mL());yr.set("categoryFilter",vL());yr.set("noLogFilter",CL());yr.set("file",GI());yr.set("dateFile",KI());yr.set("fileSync",tj());yr.set("tcp",nj());var ad=new Map,$C=(n,e)=>{$a("Loading module from ",n);try{return require(n)}catch(t){Jn.throwExceptionIf(e,t.code!=="MODULE_NOT_FOUND",`appender "${n}" could not be loaded (error was: ${t})`);return}},Woe=(n,e)=>yr.get(n)||$C(`./${n}`,e)||$C(n,e)||""||$C(Boe.join(process.cwd(),n),e),$p=new Set,oj=(n,e)=>{if(ad.has(n))return ad.get(n);if(!e.appenders[n])return!1;if($p.has(n))throw new Error(`Dependency loop detected for appender ${n}.`);$p.add(n),$a(`Creating appender ${n}`);let t=Zoe(n,e);return $p.delete(n),ad.set(n,t),t},Zoe=(n,e)=>{let t=e.appenders[n],i=t.type.configure?t.type:Woe(t.type,e);return Jn.throwExceptionIf(e,Jn.not(i),`appender "${n}" is not valid (type "${t.type}" could not be found)
`).slice(e),i=ese.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 Gp=class{constructor(e){if(!e)throw new Error("No category provided.");this.category=e,this.context={},this.parseCallStack=tse,dj(`Logger created (${this.category}, ${this.level})`)}get level(){return Eo.getLevel(Up.getLevelForCategory(this.category),Eo.TRACE)}set level(e){Up.setLevelForCategory(this.category,Eo.getLevel(e,this.level))}get useCallStack(){return Up.getEnableCallStackForCategory(this.category)}set useCallStack(e){Up.setEnableCallStackForCategory(this.category,e===!0)}log(e,...t){let i=Eo.getLevel(e);i||(this._log(Eo.WARN,"log4js:logger.log: invalid value for log-level as first parameter given: ",e),i=Eo.INFO),this.isLevelEnabled(i)&&this._log(i,t)}isLevelEnabled(e){return this.level.isLessThanOrEqualTo(e)}_log(e,t){dj(`sending log data (${e}) to appenders`);let i=new Koe(this.category,e,t,this.context,this.useCallStack&&this.parseCallStack(new Error));zoe.send(i)}addContext(e,t){this.context[e]=t}removeContext(e){delete this.context[e]}clearContext(){this.context={}}setParseCallStackFunction(e){this.parseCallStack=e}};function gj(n){let e=Eo.getLevel(n),i=e.toString().toLowerCase().replace(/_([a-z])/g,o=>o[1].toUpperCase()),r=i[0].toUpperCase()+i.slice(1);Gp.prototype[`is${r}Enabled`]=function(){return this.isLevelEnabled(e)},Gp.prototype[i]=function(...o){this.log(e,...o)}}Eo.levels.forEach(gj);Voe.addListener(()=>{Eo.levels.forEach(gj)});fj.exports=Gp});var yj=m((Gke,bj)=>{var xu=Ya(),ise=':remote-addr - - ":method :url HTTP/:http-version" :status :content-length ":referrer" ":user-agent"';function nse(n){return n.originalUrl||n.url}function rse(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:nse(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 mj(n,e){for(let t=0;t<e.length;t++)n=n.replace(e[t].token,e[t].replacement);return n}function ose(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 sse(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=xu.getLevel(r.level,i))}return i}bj.exports=function(e,t){typeof t=="string"||typeof t=="function"?t={format:t}:t=t||{};let i=e,r=xu.getLevel(t.level,xu.INFO),o=t.format||ise,s=ose(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=xu.INFO,l.statusCode>=300&&(r=xu.WARN),l.statusCode>=400&&(r=xu.ERROR)),r=sse(l.statusCode,r,t.statusRules);let d=rse(a,l,t.tokens||[]);if(t.context&&i.addContext("res",l),typeof o=="function"){let g=o(a,l,f=>mj(f,d));g&&i.log(r,g)}else i.log(r,mj(o,d));t.context&&i.remove
2022-05-18 13:29:28 -04:00
2022-05-19 10:14:37 -04:00
see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:i,destStat:r}=dd.checkPathsSync(n,e,"copy");return dd.checkParentPathsSync(n,i,e,"copy"),Ose(r,n,e,t)}function Ose(n,e,t,i){if(i.filter&&!i.filter(e,t))return;let r=hd.dirname(t);return Ti.existsSync(r)||Ise(r),Wj(n,e,t,i)}function Wj(n,e,t,i){if(!(i.filter&&!i.filter(e,t)))return Mse(n,e,t,i)}function Mse(n,e,t,i){let o=(i.dereference?Ti.statSync:Ti.lstatSync)(e);if(o.isDirectory())return Zse(o,n,e,t,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return Nse(o,n,e,t,i);if(o.isSymbolicLink())return Xse(n,e,t,i)}function Nse(n,e,t,i,r){return e?Bse(n,t,i,r):Zj(n,t,i,r)}function Bse(n,e,t,i){if(i.overwrite)return Ti.unlinkSync(t),Zj(n,e,t,i);if(i.errorOnExist)throw new Error(`'${t}' already exists`)}function Zj(n,e,t,i){return Ti.copyFileSync(e,t),i.preserveTimestamps&&Hse(n.mode,e,t),ox(t,n.mode)}function Hse(n,e,t){return qse(n)&&Yse(t,n),Wse(e,t)}function qse(n){return(n&128)===0}function Yse(n,e){return ox(n,e|128)}function ox(n,e){return Ti.chmodSync(n,e)}function Wse(n,e){let t=Ti.statSync(n);return jse(e,t.atime,t.mtime)}function Zse(n,e,t,i,r){if(!e)return Jse(n.mode,t,i,r);if(e&&!e.isDirectory())throw new Error(`Cannot overwrite non-directory '${i}' with directory '${t}'.`);return Jj(t,i,r)}function Jse(n,e,t,i){return Ti.mkdirSync(t),Jj(e,t,i),ox(t,n)}function Jj(n,e,t){Ti.readdirSync(n).forEach(i=>$se(i,n,e,t))}function $se(n,e,t,i){let r=hd.join(e,n),o=hd.join(t,n),{destStat:s}=dd.checkPathsSync(r,o,"copy");return Wj(s,r,o,i)}function Xse(n,e,t,i){let r=Ti.readlinkSync(e);if(i.dereference&&(r=hd.resolve(process.cwd(),r)),n){let o;try{o=Ti.readlinkSync(t)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return Ti.symlinkSync(r,t);throw s}if(i.dereference&&(o=hd.resolve(process.cwd(),o)),dd.isSrcSubdir(r,o))throw new Error(`Cannot copy '${r}' to a subdirectory of itself, '${o}'.`);if(Ti.statSync(t).isDirectory()&&dd.isSrcSubdir(o,r))throw new Error(`Cannot overwrite '${o}' with '${r}'.`);return Use(r,t)}else return Ti.symlinkSync(r,t)}function Use(n,e){return Ti.unlinkSync(e),Ti.symlinkSync(n,e)}$j.exports=Ase});var sx=m((oEe,Uj)=>{"use strict";Uj.exports={copySync:Xj()}});var Is=m((sEe,Qj)=>{"use strict";var Gse=gt().fromPromise,Gj=ud();function Qse(n){return Gj.access(n).then(()=>!0).catch(()=>!1)}Qj.exports={pathExists:Gse(Qse),pathExistsSync:Gj.existsSync}});var o1=m((aEe,r1)=>{"use strict";var on=Qe(),gd=require("path"),Kse=vr().mkdirs,zse=Is().pathExists,Vse=ix().utimesMillis,fd=cd();function eae(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;
2022-05-18 13:29:28 -04:00
2022-05-19 10:14:37 -04:00
see https://github.com/jprichardson/node-fs-extra/issues/269`),fd.checkPaths(n,e,"copy",(r,o)=>{if(r)return i(r);let{srcStat:s,destStat:a}=o;fd.checkParentPaths(n,s,e,"copy",l=>l?i(l):t.filter?e1(Kj,a,n,e,t,i):Kj(a,n,e,t,i))})}function Kj(n,e,t,i,r){let o=gd.dirname(t);zse(o,(s,a)=>{if(s)return r(s);if(a)return ax(n,e,t,i,r);Kse(o,l=>l?r(l):ax(n,e,t,i,r))})}function e1(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 ax(n,e,t,i,r){return i.filter?e1(zj,n,e,t,i,r):zj(n,e,t,i,r)}function zj(n,e,t,i,r){(i.dereference?on.stat:on.lstat)(e,(s,a)=>{if(s)return r(s);if(a.isDirectory())return aae(a,n,e,t,i,r);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return tae(a,n,e,t,i,r);if(a.isSymbolicLink())return cae(n,e,t,i,r)})}function tae(n,e,t,i,r,o){return e?iae(n,t,i,r,o):t1(n,t,i,r,o)}function iae(n,e,t,i,r){if(i.overwrite)on.unlink(t,o=>o?r(o):t1(n,e,t,i,r));else return i.errorOnExist?r(new Error(`'${t}' already exists`)):r()}function t1(n,e,t,i,r){on.copyFile(e,t,o=>o?r(o):i.preserveTimestamps?nae(n.mode,e,t,r):em(t,n.mode,r))}function nae(n,e,t,i){return rae(n)?oae(t,n,r=>r?i(r):Vj(n,e,t,i)):Vj(n,e,t,i)}function rae(n){return(n&128)===0}function oae(n,e,t){return em(n,e|128,t)}function Vj(n,e,t,i){sae(e,t,r=>r?i(r):em(t,n,i))}function em(n,e,t){return on.chmod(n,e,t)}function sae(n,e,t){on.stat(n,(i,r)=>i?t(i):Vse(e,r.atime,r.mtime,t))}function aae(n,e,t,i,r,o){return e?e&&!e.isDirectory()?o(new Error(`Cannot overwrite non-directory '${i}' with directory '${t}'.`)):i1(t,i,r,o):lae(n.mode,t,i,r,o)}function lae(n,e,t,i,r){on.mkdir(t,o=>{if(o)return r(o);i1(e,t,i,s=>s?r(s):em(t,n,r))})}function i1(n,e,t,i){on.readdir(n,(r,o)=>r?i(r):n1(o,n,e,t,i))}function n1(n,e,t,i,r){let o=n.pop();return o?uae(n,o,e,t,i,r):r()}function uae(n,e,t,i,r,o){let s=gd.join(t,e),a=gd.join(i,e);fd.checkPaths(s,a,"copy",(l,u)=>{if(l)return o(l);let{destStat:c}=u;ax(c,s,a,r,h=>h?o(h):n1(n,t,i,r,o))})}function cae(n,e,t,i,r){on.readlink(e,(o,s)=>{if(o)return r(o);if(i.dereference&&(s=gd.resolve(process.cwd(),s)),n)on.readlink(t,(a,l)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?on.symlink(s,t,r):r(a):(i.dereference&&(l=gd.resolve(process.cwd(),l)),fd.isSrcSubdir(s,l)?r(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${l}'.`)):n.isDirectory()&&fd.isSrcSubdir(l,s)?r(new Error(`Cannot overwrite '${l}' with '${s}'.`)):hae(s,t,r)));else return on.symlink(s,t,r)})}function hae(n,e,t){on.unlink(e,i=>i?t(i):on.symlink(n,e,t))}r1.exports=eae});var lx=m((lEe,s1)=>{"use strict";var dae=gt().fromCallback;s1.exports={copy:dae(o1())}});var p1=m((uEe,f1)=>{"use strict";var a1=Qe(),h1=require("path"),at=require("assert"),pd=process.platform==="win32";function d1(n){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(t=>{n[t]=n[t]||a1[t],t=t+"Sync",n[t]=n[t]||a1[t]}),n.maxBusyTries=n.maxBusyTries||3}function ux(n,e,t){let i=0;typeof e=="function"&&(t=e,e={}),at(n,"rimraf: missing path"),at.strictEqual(typeof n,"string","rimraf: path should be a string"),at.strictEqual(typeof t,"function","rimraf: callback function required"),at(e,"rimraf: invalid options argument provided"),at.strictEqual(typeof e,"object","rimraf: options should be object"),d1(e),l1(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(()=>l1(n,e,r),s)}o.code==="ENOENT"&&(o=null)}t(o)})}function l1(n,e,t){at(n),at(e),at(typeof t=="function"),e.lstat(n,(i,r)=>{if(i&&i.code==="ENOENT")return t(null);if(i&&i.code==="EPERM"&&pd)return u1(n,e,i,t);if(r&&r.isDirectory())return tm(n,e,i,t);e.unlink(n,o=>{if(o){if(o.code==="ENOENT")return t(null);if(o.code==="EPERM")return pd?u1(n,e,o,t):tm(n,e,o,t);if(o.code==="EISDIR")return tm(n,e,o,t)}return t(o)})})}function u1(n,e,t,i){at(n),at(e),at(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()?tm(n,e,t,i):e.unlink(n,i)})})}function c1(n,e,t){let i;at(n),at(e);try{e.chmodSync(n,438)}catch(r){if(r.code==="ENOENT")return;throw t}try{i
2022-05-18 13:29:28 -04:00
`+i.split(/\r?\n/).slice(3).join(`
2022-05-19 10:14:37 -04:00
`),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?[wce?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))}};Sm.BaseApi=oM});var _d=m(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.Buffer=void 0;var Dce=Pd(),sM=class extends Dce.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!=null?t:{};r=r!=null?r:0,o=o!=null?o:r+1;let a=s!=null?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.isVim?Promise.resolve(-1):(this.notify(`${this.prefix}set_virtual_text`,[e,t,i,r]),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|
`}debug(e,...t){cM!="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){cM!="trace"||this.stream==null||this.stream.write(this.getText("trace",e,t))}};function Fce(n){return new dM(n)}Bs.createLogger=Fce});var Gx=m(Ux=>{"use strict";Object.defineProperty(Ux,"__esModule",{value:!0});var Ice=require("events"),jce=Hu(),gM=process.env.NODE_CLIENT_LOG_LEVEL=="debug",Fd=(0,jce.createLogger)("transport"),fM=class extends Ice.EventEmitter{constructor(e){super();this.logger=e,this.pauseLevel=0,this.paused=new Map}debug(e,...t){!gM||Fd.debug(e,...t)}info(e,...t){Fd.info(e,...t)}debugMessage(e){if(!gM)return;let t=e[0];t==0?Fd.debug("receive request:",e.slice(1)):t==1||(t==2?Fd.debug("receive notification:",e.slice(1)):Fd.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],f=new Error(`call_atomic request error on "${d}": ${h}`);return f.stack=i,this.logger.error(`call_atomic request error ${c} on "${d}"`,g,h,i),s(f)}o(l)});this.notify("nvim_call_atomic",[r]),o(void 0)}):e?null:Promise.resolve([[],void 0])}};Ux.default=fM});var bM=m(Un=>{"use strict";var Ace=Un&&Un.__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]}),Oce=Un&&Un.__setModuleDefault||(Object.create?function(n,e){Object.defineProperty(n,"default",{enumerable:!0,value:e})}:function(n,e){n.default=e}),Mce=Un&&Un.__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)&&Ace(e,n,t);return Oce(e,n),e},pM=Un&&Un.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Un,"__esModule",{value:!0});Un.NvimTransport=void 0;var Fo=Mce(iM()),Nce=pM(rM()),Bce=uM(),Hce=pM(Gx()),mM=class extends Hce.default{constructor(e){super(e);this.pending=new Map,this.nextRequestId=1,this.attached=!1;let t=this.setupCodec();this.encodeStream=Fo.createEncodeStream({codec:t}),this.decodeStream=Fo.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=Fo.createCodec();return Bce.Metadata.forEach(({constructor:t},i)=>{e.addExtPacker(i,t,r=>Fo.encode(r.data)),e.addExtUnpacker(i,r=>new t({transport:this,client:this.client,data:Fo.decode(r)}))}),this.codec=e,this.codec}attach(e,t,i){this.encodeStream=this.encodeStream.pipe(e);let r=new Nce.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{qu.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()}};Id.default=vM});var CM=m(Qx=>{"use strict";Object.defineProperty(Qx,"__esModule",{value:!0});var Zce=Hu(),fPe=(0,Zce.createLogger)("request"),Jce=process.env.COC_NVIM=="1"?"coc#api#call":"nvim#api#call",DM=class{constructor(e,t,i){this.connection=e,this.cb=t,this.id=i}request(e,t=[]){this.method=e,this.connection.call(Jce,[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)}}};Qx.default=DM});var SM=m(Yu=>{"use strict";var Kx=Yu&&Yu.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Yu,"__esModule",{value:!0});Yu.VimTransport=void 0;var $ce=Kx(Gx()),Xce=Kx(wM()),Uce=Kx(CM()),xM=class extends $ce.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 Xce.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 Uce.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])}}}};Yu.VimTransport=xM});var kM=m(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.Neovim=void 0;var Gce=Pd(),Qce=_d(),Kce=Ld(),zce=Rd(),Vce=process.env.VIM_NODE_RPC=="1",TM=class extends Gce.BaseApi{constructor(){super(...arguments);this.prefix="nvim_",this.Buffer=Qce.Buffer,this.Window=zce.Window,this.Tabpage=Kce.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):Vce?(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()}};Pm.Neovim=TM});var Rm=m(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});Wu.NeovimClient=Wu.AsyncResponse=void 0;var ehe=bM(),the=SM(),ihe=kM(),nhe=_d(),rhe=Rd(),ohe=Ld(),she=Hu(),EM=(0,she.createLogger)("client"),_m=process.env.VIM_NODE_RPC=="1",zx=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)}}};Wu.AsyncResponse=zx;var PM=class extends ihe.Neovim{constructor(e){super({});this.logger=e,this.requestId=1,this.responses=new Map,this.attachedBuffers=new Map,this.isVim=_m,Object.defineProperty(this,"client",{value:this});let t=_m?new the.VimTransport(e):new ehe.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 nhe.Buffer({transport:this.transport,data:e,client:this})}createWindow(e){return new rhe.Window({transport:this.transport,data:e,client:this})}createTabpage(e){return new ohe.Tabpage({transport:this.transport,data:e,client:this})}send(e){this.transport.send(e)}redrawVim(e){!_m||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 zx(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
`,FM=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 yhe:switch(e){case 0:e=1;break;case 2:e=3;break;default:e=0}break;case vhe: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(whe);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}};Fm.AbstractMessageBuffer=FM});var NM=m(rS=>{"use strict";Object.defineProperty(rS,"__esModule",{value:!0});var Dhe=Io(),jM=require("util"),rl=iS(),Che=IM(),Od=class extends Che.AbstractMessageBuffer{constructor(e="utf-8"){super(e)}emptyBuffer(){return Od.emptyBuffer}fromString(e,t){return Buffer.from(e,t)}toString(e,t){return e instanceof Buffer?e.toString(t):new jM.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)}};Od.emptyBuffer=Buffer.allocUnsafe(0);var AM=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),rl.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),rl.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),rl.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),rl.Disposable.create(()=>this.stream.off("data",e))}},OM=class{constructor(e){this.stream=e}onClose(e){return this.stream.on("close",e),rl.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),rl.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),rl.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()}},MM=Object.freeze({messageBuffer:Object.freeze({create:n=>new Od(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 jM.TextDecoder(e.charset).decode(n)))}catch(t){return Promise.reject(t)}}})}),stream:Object.freeze({asReadableStream:n=>new AM(n),asWritableStream:n=>new OM(n)}),console,timer:Object.freeze({setTimeout(n,e,...t){return setTimeout(n,e,...t)},clearTimeout(n){clearTimeout(n)},setImmediate(n,...e){return setImmediate(n,...e)},clearImmediate(n){clearImmediate(n)}})});function nS(){return MM}(function(n){function e(){Dhe.default.install(MM)}n.install=e})(nS||(nS={}));rS.def
`,Bhe;(function(n){function e(t){let i=t;return i&&Nd.func(i.dispose)&&Nd.func(i.onClose)&&Nd.func(i.onError)&&Nd.func(i.write)}n.is=e})(Bhe=Ao.MessageWriter||(Ao.MessageWriter={}));var fS=class{constructor(){this.errorEmitter=new yN.Emitter,this.closeEmitter=new yN.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: ${Nd.string(e.message)?e.message:"unknown"}`)}};Ao.AbstractMessageWriter=fS;var gS;(function(n){function e(t){var i,r;return t===void 0||typeof t=="string"?{charset:t!=null?t:"utf-8",contentTypeEncoder:bN.default().applicationJson.encoder}:{charset:(i=t.charset)!==null&&i!==void 0?i:"utf-8",contentEncoder:t.contentEncoder,contentTypeEncoder:(r=t.contentTypeEncoder)!==null&&r!==void 0?r:bN.default().applicationJson.encoder}}n.fromOptions=e})(gS||(gS={}));var wN=class extends fS{constructor(e,t){super();this.writable=e,this.options=gS.fromOptions(t),this.errorCount=0,this.writeSemaphore=new Mhe.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(Nhe,i.byteLength.toString(),vN),r.push(vN),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()}};Ao.WriteableStreamMessageWriter=wN});var xN=m(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});Oo.LRUCache=Oo.LinkedMap=Oo.Touch=void 0;var Ji;(function(n){n.None=0,n.First=1,n.AsOld=n.First,n.Last=2,n.AsNew=n.Last})(Ji=Oo.Touch||(Oo.Touch={}));var pS=class{constructor(){this[Symbol.toStringTag]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){var e;return(e=this._head)===null||e===void 0?void 0:e.value}get last(){var e;return(e=this._tail)===null||e===void 0?void 0:e.value}has(e){return this._map.has(e)}get(e,t=Ji.None){let i=this._map.get(e);if(!!i)return t!==Ji.None&&this.touch(i,t),i.value}set(e,t,i=Ji.None){let r=this._map.get(e);if(r)r.value=t,i!==Ji.None&&this.touch(r,i);else{switch(r={key:e,value:t,next:void 0,previous:void 0},i){case Ji.None:this.addItemLast(r);break;case Ji.First:this.addItemFirst(r);break;case Ji.Last:this.addItemLast(r);break;default:this.addItemLast(r);break}this._map.set(e,r),this._size++}return this}delete(e){return!!this.remove(e)}remove(e){let t=this._map.get(e);if(!!t)return this._map.delete(e),this.removeItem(t),this._size--,t.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,t){let i=this._state,r=this._head;for(;r;){if(t?e.bind(t)(r.value,r.key,this):e(r.value,r.key,this),this._state!==i)throw new Error("LinkedMap got modified during iteration.");r=r.next}}keys(){let e=this,t=this._state,i=this._head,r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){let o={value:i.key,done:!1};return i=i.next,o}else return{value:void 0,done:!0}}};return r}values(){let e=this,t=this._state,i=this._head,r={[Symbol.iterator](){return r},next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){let o={value:i.value,done:!1};return i=i.next,o}else return{
${JSON.stringify(P.error,void 0,4)}`):r.error("Received response message without id. No further error information provided.");else{let $=String(P.id),G=b[$];if(kn(P,G),G){delete b[$];try{if(P.error){let ue=P.error;G.reject(new me.ResponseError(ue.code,ue.message,ue.data))}else if(P.result!==void 0)G.resolve(P.result);else throw new Error("Should never happen.")}catch(ue){ue.message?r.error(`Response handler '${G.method}' failed with message: ${ue.message}`):r.error(`Response handler '${G.method}' failed unexpectedly.`)}}}}function Re(P){if(St())return;let $,G;if(P.method===Hd.type.method)G=ue=>{let Ye=ue.id,Lt=y[String(Ye)];Lt&&Lt.cancel()};else{let ue=d[P.method];ue&&(G=ue.handler,$=ue.type)}if(G||h)try{fr(P),G?P.params===void 0?($!==void 0&&$.numberOfParams!==0&&$.parameterStructures!==me.ParameterStructures.byName&&r.error(`Notification ${P.method} defines ${$.numberOfParams} params but recevied none.`),G()):Array.isArray(P.params)?($!==void 0&&($.parameterStructures===me.ParameterStructures.byName&&r.error(`Notification ${P.method} defines parameters by name but received parameters by position`),$.numberOfParams!==P.params.length&&r.error(`Notification ${P.method} defines ${$.numberOfParams} params but received ${P.params.length} argumennts`)),G(...P.params)):($!==void 0&&$.parameterStructures===me.ParameterStructures.byPosition&&r.error(`Notification ${P.method} defines parameters by position but received parameters by name`),G(P.params)):h&&h(P.method,P.params)}catch(ue){ue.message?r.error(`Notification handler '${P.method}' failed with message: ${ue.message}`):r.error(`Notification handler '${P.method}' failed unexpectedly.`)}else W.fire(P)}function Se(P){if(!P){r.error("Received empty message.");return}r.error(`Received message which is neither a response nor a notification message:
${JSON.stringify(P,null,4)}`);let $=P;if(oi.string($.id)||oi.number($.id)){let G=String($.id),ue=b[G];ue&&ue.reject(new Error("The received response has neither a result nor an error property."))}}function Te(P){if(!(w===Wt.Off||!T))if(D===Dr.Text){let $;w===Wt.Verbose&&P.params&&($=`Params: ${JSON.stringify(P.params,null,4)}
2022-05-18 13:29:28 -04:00
2022-05-19 10:14:37 -04:00
`),T.log(`Sending request '${P.method} - (${P.id})'.`,$)}else ms("send-request",P)}function Le(P){if(!(w===Wt.Off||!T))if(D===Dr.Text){let $;w===Wt.Verbose&&(P.params?$=`Params: ${JSON.stringify(P.params,null,4)}
2022-05-18 13:29:28 -04:00
`:$=`No parameters provided.
2022-05-19 10:14:37 -04:00
`),T.log(`Sending notification '${P.method}'.`,$)}else ms("send-notification",P)}function Rt(P,$,G){if(!(w===Wt.Off||!T))if(D===Dr.Text){let ue;w===Wt.Verbose&&(P.error&&P.error.data?ue=`Error data: ${JSON.stringify(P.error.data,null,4)}
2022-05-18 13:29:28 -04:00
2022-05-19 10:14:37 -04:00
`:P.result?ue=`Result: ${JSON.stringify(P.result,null,4)}
2022-05-18 13:29:28 -04:00
2022-05-19 10:14:37 -04:00
`:P.error===void 0&&(ue=`No result returned.
2022-05-18 13:29:28 -04:00
2022-05-19 10:14:37 -04:00
`)),T.log(`Sending response '${$} - (${P.id})'. Processing request took ${Date.now()-G}ms`,ue)}else ms("send-response",P)}function gr(P){if(!(w===Wt.Off||!T))if(D===Dr.Text){let $;w===Wt.Verbose&&P.params&&($=`Params: ${JSON.stringify(P.params,null,4)}
2022-05-18 13:29:28 -04:00
2022-05-19 10:14:37 -04:00
`),T.log(`Received request '${P.method} - (${P.id})'.`,$)}else ms("receive-request",P)}function fr(P){if(!(w===Wt.Off||!T||P.method===yS.type.method))if(D===Dr.Text){let $;w===Wt.Verbose&&(P.params?$=`Params: ${JSON.stringify(P.params,null,4)}
2022-05-18 13:29:28 -04:00
`:$=`No parameters provided.
2022-05-19 10:14:37 -04:00
`),T.log(`Received notification '${P.method}'.`,$)}else ms("receive-notification",P)}function kn(P,$){if(!(w===Wt.Off||!T))if(D===Dr.Text){let G;if(w===Wt.Verbose&&(P.error&&P.error.data?G=`Error data: ${JSON.stringify(P.error.data,null,4)}
2022-05-18 13:29:28 -04:00
2022-05-19 10:14:37 -04:00
`:P.result?G=`Result: ${JSON.stringify(P.result,null,4)}
2022-05-18 13:29:28 -04:00
2022-05-19 10:14:37 -04:00
`:P.error===void 0&&(G=`No result returned.
2022-05-18 13:29:28 -04:00
2022-05-19 10:14:37 -04:00
`)),$){let ue=P.error?` Request failed: ${P.error.message} (${P.error.code}).`:"";T.log(`Received response '${$.method} - (${P.id})' in ${Date.now()-$.timerStart}ms.${ue}`,G)}else T.log(`Received response ${P.id} without active response promise.`,G)}else ms("receive-response",P)}function ms(P,$){if(!T||w===Wt.Off)return;let G={isLSPMessage:!0,type:P,message:$,timestamp:Date.now()};T.log(G)}function bs(){if(et())throw new ll(Om.Closed,"Connection is closed.");if(St())throw new ll(Om.Disposed,"Connection is disposed.")}function Ote(){if(_e())throw new ll(Om.AlreadyListening,"Connection is already listening")}function Mte(){if(!_e())throw new Error("Call listen() first.")}function qh(P){return P===void 0?null:P}function nR(P){if(P!==null)return P}function rR(P){return P!=null&&!Array.isArray(P)&&typeof P=="object"}function mC(P,$){switch(P){case me.ParameterStructures.auto:return rR($)?nR($):[qh($)];case me.ParameterStructures.byName:if(!rR($))throw new Error("Recevied parameters by name but param is not an object literal.");return nR($);case me.ParameterStructures.byPosition:return[qh($)];default:throw new Error(`Unknown parameter structure ${P.toString()}`)}}function oR(P,$){let G,ue=P.numberOfParams;switch(ue){case 0:G=void 0;break;case 1:G=mC(P.parameterStructures,$[0]);break;default:G=[];for(let Ye=0;Ye<$.length&&Ye<ue;Ye++)G.push(qh($[Ye]));if($.length<ue)for(let Ye=$.length;Ye<ue;Ye++)G.push(null);break}return G}let hu={sendNotification:(P,...$)=>{bs();let G,ue;if(oi.string(P)){G=P;let Lt=$[0],Gt=0,ii=me.ParameterStructures.auto;me.ParameterStructures.is(Lt)&&(Gt=1,ii=Lt);let Je=$.length,Ft=Je-Gt;switch(Ft){case 0:ue=void 0;break;case 1:ue=mC(ii,$[Gt]);break;default:if(ii===me.ParameterStructures.byName)throw new Error(`Recevied ${Ft} parameters for 'by Name' notification parameter structure.`);ue=$.slice(Gt,Je).map($e=>qh($e));break}}else{let Lt=$;G=P.method,ue=oR(P,Lt)}let Ye={jsonrpc:l,method:G,params:ue};Le(Ye),e.write(Ye)},onNotification:(P,$)=>{bs();let G;return oi.func(P)?h=P:$&&(oi.string(P)?(G=P,d[P]={type:void 0,handler:$}):(G=P.method,d[P.method]={type:P,handler:$})),{dispose:()=>{G!==void 0?delete d[G]:h=void 0}}},onProgress:(P,$,G)=>{if(g.has($))throw new Error(`Progress handler for token ${$} already registered`);return g.set($,G),{dispose:()=>{g.delete($)}}},sendProgress:(P,$,G)=>{hu.sendNotification(Mm.type,{token:$,value:G})},onUnhandledProgress:B.event,sendRequest:(P,...$)=>{bs(),Mte();let G,ue,Ye;if(oi.string(P)){G=P;let Je=$[0],Ft=$[$.length-1],$e=0,Qt=me.ParameterStructures.auto;me.ParameterStructures.is(Je)&&($e=1,Qt=Je);let tn=$.length;mS.CancellationToken.is(Ft)&&(tn=tn-1,Ye=Ft);let Aa=tn-$e;switch(Aa){case 0:ue=void 0;break;case 1:ue=mC(Qt,$[$e]);break;default:if(Qt===me.ParameterStructures.byName)throw new Error(`Recevied ${Aa} parameters for 'by Name' request parameter structure.`);ue=$.slice($e,tn).map(ys=>qh(ys));break}}else{let Je=$;G=P.method,ue=oR(P,Je);let Ft=P.numberOfParams;Ye=mS.CancellationToken.is(Je[Ft])?Je[Ft]:void 0}let Lt=o++,Gt;return Ye&&(Gt=Ye.onCancellationRequested(()=>{F.sender.sendCancellation(hu,Lt)})),new Promise((Je,Ft)=>{let $e={jsonrpc:l,id:Lt,method:G,params:ue},Qt=ys=>{Je(ys),F.sender.cleanup(Lt),Gt==null||Gt.dispose()},tn=ys=>{Ft(ys),F.sender.cleanup(Lt),Gt==null||Gt.dispose()},Aa={method:G,timerStart:Date.now(),resolve:Qt,reject:tn};Te($e);try{e.write($e)}catch(ys){Aa.reject(new me.ResponseError(me.ErrorCodes.MessageWriteError,ys.message?ys.message:"Unknown reason")),Aa=null}Aa&&(b[String(Lt)]=Aa)})},onRequest:(P,$)=>{bs();let G=null;return bS.is(P)?(G=void 0,u=P):oi.string(P)?(G=null,$!==void 0&&(G=P,c[P]={handler:$,type:void 0})):$!==void 0&&(G=P.method,c[P.method]={type:P,handler:$}),{dispose:()=>{G!==null&&(G!==void 0?delete c[G]:u=void 0)}}},trace:(P,$,G)=>{let ue=!1,Ye=Dr.Text;G!==void 0&&(oi.boolean(G)?ue=G:(ue=G.sendNotification||!1,Ye=G.traceFormat||Dr.Text)),w=P,D=Ye,w===Wt.Off?T=void 0:T=$,ue&&!et()&&!St()&&hu.sendNotification(EN.type,{value:Wt.toString(P)})},onError:I.event,onClose:A.event,onUnhandledNotification:W.event,onDispose:N.event,end:()=>
2022-05-18 13:29:28 -04:00
`,`\r
2022-05-19 10:14:37 -04:00
`,"\r"];(function(n){function e(o,s,a,l){return new ode(o,s,a,l)}n.create=e;function t(o){var s=o;return!!(q.defined(s)&&q.string(s.uri)&&(q.undefined(s.languageId)||q.string(s.languageId))&&q.uinteger(s.lineCount)&&q.func(s.getText)&&q.func(s.positionAt)&&q.func(s.offsetAt))}n.is=t;function i(o,s){for(var a=o.getText(),l=r(s,function(f,p){var b=f.range.start.line-p.range.start.line;return b===0?f.range.start.character-p.range.start.character:b}),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}})(u0||(u0={}));ode=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===`
2022-05-18 13:29:28 -04:00
`,o==="\r"&&r+1<t.length&&t.charAt(r+1)===`
2022-05-19 10:14:37 -04:00
`&&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 mi.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 mi.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,f,p){return e.call(g)==="[object Number]"&&f<=g&&g<=p}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,f){return Array.isArray(g)&&g.every(f)}n.typedArray=d})(q||(q={}))});var si=m(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.ProtocolNotificationType=Qn.ProtocolNotificationType0=Qn.ProtocolRequestType=Qn.ProtocolRequestType0=Qn.RegistrationType=void 0;var ic=Qu(),BN=class{constructor(e){this.method=e}};Qn.RegistrationType=BN;var HN=class extends ic.RequestType0{constructor(e){super(e)}};Qn.ProtocolRequestType0=HN;var qN=class extends ic.RequestType{constructor(e){super(e,ic.ParameterStructures.byName)}};Qn.ProtocolRequestType=qN;var YN=class extends ic.NotificationType0{constructor(e){super(e)}};Qn.ProtocolNotificationType0=YN;var WN=class extends ic.NotificationType{constructor(e){super(e,ic.ParameterStructures.byName)}};Qn.ProtocolNotificationType=WN});var $N=m(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.objectLiteral=Zt.typedArray=Zt.stringArray=Zt.array=Zt.func=Zt.error=Zt.number=Zt.string=Zt.boolean=void 0;function sde(n){return n===!0||n===!1}Zt.boolean=sde;function ZN(n){return typeof n=="string"||n instanceof String}Zt.string=ZN;function ade(n){return typeof n=="number"||n instanceof Number}Zt.number=ade;function lde(n){return n instanceof Error}Zt.error=lde;function ude(n){return typeof n=="function"}Zt.func=ude;function JN(n){return Array.isArray(n)}Zt.array=JN;function cde(n){return JN(n)&&n.every(e=>ZN(e))}Zt.stringArray=cde;function hde(n,e){return Array.isArray(n)&&n.every(e)}Zt.typedArray=hde;function dde(n){return n!==null&&typeof n=="object"}Zt.objectLiteral=dde});var XN=m($d=>{"use strict";Object.defineProperty($d,"__esModule",{value:!0});$d.ImplementationRequest=void 0;var gde=si(),fde;(function(n){n.method="textDocument/implementation",n.type=new gde.ProtocolRequestType(n.method)})(fde=$d.ImplementationRequest||($d.ImplementationRequest={}))});var UN=m(Xd=>{"use strict";Object.defineProperty(Xd,"__esModule",{value:!0});Xd.TypeDefinitionRequest=void 0;var pde=si(),mde;(function(n){n.method="textDocument/typeDefinition",n.type=new pde.ProtocolRequestType(n.method)})(mde=Xd.TypeDefinitionRequest||(Xd.TypeDefinitionRequest={}))});var QN=m(Hs=>{"use strict";Object.defineProperty(Hs,"__esModule",{value:!0});Hs.DidChangeWorkspaceFoldersNotification=Hs.WorkspaceFoldersRequest=void 0;var GN=si(),bde;(function(n){n.type=new GN.ProtocolRequestType0("workspace/workspaceFolders")})(bde=Hs.WorkspaceFoldersRequest||(Hs.WorkspaceFoldersRequest={}));var yde;(function(n){n.type=new GN.ProtocolNotificationType("workspace/didChangeWorkspaceFolders")})(yde=Hs.DidChangeWorkspaceFoldersNotification||(Hs.DidChangeWorkspaceFoldersNotification={}))});var KN=m(Ud=>{"use str
2022-05-18 13:29:28 -04:00
${s}
2022-05-19 10:14:37 -04:00
${l}`));return}i(a)})})}function lc(n,e){let t=(0,zB.default)(e,100);try{let i=VB.default.watch(n,{persistent:!0,recursive:!1,encoding:"utf8"},()=>{t()});return hl.Disposable.create(()=>{t.clear(),i.close()})}catch{return hl.Disposable.create(()=>{t.clear()})}}function nH(n){try{return process.kill(n,0)==!0}catch(e){return e.code==="EPERM"}}function D0(n){return n=="n"||n=="o"||n=="x"||n=="v"?"<C-U>":n=="i"?"<C-o>":n=="s"?"<Esc>":""}function sg(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 KB,zB,VB,eH,w0,hl,tH,m_e,Er,z=_(()=>{"use strict";KB=require("child_process"),zB=x(Pi()),VB=x(require("fs")),eH=x(p0()),w0=x(require("path")),hl=x(H());we();tH=x(ng());ac();m_e=Y()("util-index"),Er="coc-settings.json"});function uc(n){return n&&typeof n.word=="string"&&n.user_data!==""}function Kn(n){return typeof n=="boolean"}function Ee(n){return typeof n=="string"}function zm(n){return typeof n=="number"}function Zs(n){return typeof n=="function"}function kt(n){return n!=null&&typeof n=="object"&&!Array.isArray(n)&&!(n instanceof RegExp)&&!(n instanceof Date)}function rH(n){if(!kt(n))return!1;for(let e in n)if(Kfe.call(n,e))return!1;return!0}function C0(n,e){return Array.isArray(n)&&n.every(e)}var Kfe,In=_(()=>{"use strict";Kfe=Object.prototype.hasOwnProperty});function Pr(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]=Pr(n[t]):e[t]=n[t]}),e}function oH(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(zfe.call(t,i)){let r=t[i];typeof r=="object"&&!Object.isFrozen(r)&&e.push(r)}}return n}function x0(n,e,t=!0){return kt(n)?(kt(e)&&Object.keys(e).forEach(i=>{i in n?t&&(kt(n[i])&&kt(e[i])?x0(n[i],e[i],t):n[i]=e[i]):n[i]=e[i]}),n):e}function Pe(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(!Pe(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(),!Pe(r,o))return!1;for(t=0;t<r.length;t++)if(!Pe(n[r[t]],e[r[t]]))return!1}return!0}var zfe,Bt=_(()=>{"use strict";In();zfe=Object.prototype.hasOwnProperty});function sH(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 cn(n){return(n==null?void 0:n.length)>0?n[0].toUpperCase()+n.slice(1):""}function Ze(n,e){let t=n.slice(0,e);return Buffer.byteLength(t)}function yi(n,e){return Buffer.from(n,"utf8").slice(0,e).toString("utf8").length}function tt(n,e,t){return Buffer.from(n,"utf8").slice(e,t).toString("utf8")}function hc(n){let e=n.charCodeAt(0);return e>128?!1:!!(e==95||e>=48&&e<=57||S0(e))}function S0(n){return n>=65&&n<=90||n>=97&&n<=122}function aH(n,e){return e&&n.endsWith(`
2022-05-18 13:29:28 -04:00
`)?n.slice(0,-1).split(`
`):n.split(`
2022-05-19 10:14:37 -04:00
`)}var Fe=_(()=>{"use strict"});var dc,Vfe,lH,E,ce=_(()=>{"use strict";dc=x(H());z();Bt();Fe();Vfe=Y()("events"),lH=class{constructor(){this.handlers=new Map;this._recentInserts=[];this._lastChange=0;this._insertMode=!1;this._pumAlignTop=!1;this._pumVisible=!1}get cursor(){return this._cursor}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(()=>{J(i),r(void 0)},t);i.push(dc.Disposable.create(()=>{clearTimeout(o)}))}else dc.CancellationToken.is(t)&&t.onCancellationRequested(()=>{J(i),r(void 0)},null,i);e.forEach(o=>{this.on(o,(...s)=>{J(i),r({name:o,args:s})},null,i)})})}async fire(e,t){var r,o;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=="CompleteDone")this._pumVisible=!1;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 s=this._recentInserts.filter(u=>u[0]==t[0]);this._bufnr=t[0],this._recentInserts=[],this._pumVisible=e=="TextChangedP",this._lastChange=Date.now();let a=t[1],l=tt((r=a.line)!=null?r:"",0,a.col-1);if(a.pre=l,this._cursor=Object.freeze({bufnr:t[0],lnum:a.lnum,col:a.col,insert:!0}),s.length&&l.length){let u=l.slice(-1);s.findIndex(c=>c[1]==u)!==-1&&(a.insertChar=u,process.nextTick(()=>{this.fire("TextInsert",[...t,u])}))}}if(e=="CursorMoved"||e=="CursorMovedI"){t.push(this._recentInserts.length>0);let s={bufnr:t[0],lnum:t[1][0],col:t[1][1],insert:e=="CursorMovedI"};if(this._cursor&&Pe(this._cursor,s))return;this._cursor=Object.freeze(s)}if(i)try{t.forEach(s=>{typeof s=="object"&&Object.freeze(s)}),await Promise.all(i.slice().map(s=>s(t)))}catch(s){if(s instanceof Error&&((o=s.message)==null?void 0:o.includes("transport disconnected")))return;Vfe.error(`Error on event: ${e}`,s instanceof Error?s.stack:s)}}on(e,t,i,r){if(Array.isArray(e)){let o=r||[];for(let s of e)this.on(s,t,i,o);return dc.Disposable.create(()=>{J(o)})}else{let o=this.handlers.get(e)||[],s=l=>new Promise((u,c)=>{try{Promise.resolve(t.apply(i!=null?i:null,l)).then(()=>{u(void 0)},h=>{c(h)})}catch(h){c(h)}});o.push(s),this.handlers.set(e,o);let a=dc.Disposable.create(()=>{let l=o.indexOf(s);l!==-1&&o.splice(l,1)});return Array.isArray(r)&&r.push(a),a}}},E=new lH});function pH(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function epe(n){gc=n}function ai(n,e){if(e){if(tpe.test(n))return n.replace(ipe,uH)}else if(npe.test(n))return n.replace(rpe,uH);return n}function mH(n){return n.replace(spe,(e,t)=>(t=t.toLowerCase(),t==="colon"?":":t.charAt(0)==="#"?t.charAt(1)==="x"?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}function ut(n,e){n=n.source||n,e=e||"";let t={replace:(i,r)=>(r=r.source||r,r=r.replace(ape,"$1"),n=n.replace(i,r),t),getRegex:()=>new RegExp(n,e)};return t}function cH(n,e,t){if(n){let i;try{i=decodeURIComponent(mH(t)).replace(lpe,"").toLowerCase()}catch{return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}e&&!upe.test(t)&&(t=gpe(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch{return null}return t}function gpe(n,e){Vm[" "+n]||(cpe.test(n)?Vm[" "+n]=n+"/":Vm[" "+n]=eb(n,"/",!0)
2022-05-18 13:29:28 -04:00
`).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(`
2022-05-19 10:14:37 -04:00
`)}function mpe(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 fH(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 ge(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=_r({},ge.defaults,e||{}),bH(e),t){let i=e.highlight,r;try{r=Qr.lex(n,e)}catch(a){return t(a)}let o=function(a){let l;if(!a)try{e.walkTokens&&ge.walkTokens(r,e.walkTokens),l=Kr.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;ge.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=Qr.lex(n,e);return e.walkTokens&&ge.walkTokens(i,e.walkTokens),Kr.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>"+ai(i.message+"",!0)+"</pre>";throw i}}var gc,tpe,ipe,npe,rpe,ope,uH,spe,ape,lpe,upe,Vm,cpe,hpe,dpe,tb,ib,he,ee,Qr,nb,T0,k0,Kr,S_e,T_e,k_e,E_e,P_e,__e,R_e,yH=_(()=>{gc=pH();tpe=/[&<>"']/,ipe=/[&<>"']/g,npe=/[<>"']|&(?!#?\w+;)/,rpe=/[<>"']|&(?!#?\w+;)/g,ope={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},uH=n=>ope[n];spe=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;ape=/(^|[^\[])\^/g;lpe=/[^\w:]/g,upe=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;Vm={},cpe=/^[^:]+:\/*[^/]*$/,hpe=/^([^:]+:)[\s\S]*$/,dpe=/^([^:]+:\/*[^/]*)[\s\S]*$/;tb={exec:function(){}};ib=class{constructor(e){this.options=e||gc}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:eb(i,`
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let i=t[0],r=ppe(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=eb(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,f,p=t[1].trim(),b=p.length>1,y={type:"list",raw:"",ordered:b,start:b?+p.slice(0,-1):"",loose:!1,items:[]};p=b?`\\d{1,9}\\${p.slice(-1)}`:`\\${p}`,this.options.pedantic&&(p=b?p:"[*+-]");let w=new RegExp(`^( {0,3}${p})((?: [^\\n]*)?(?:\\n|$))`);for(;e&&(f=!1,!(!(t=w.exec(e))||this.rules.block.hr.test(e)));){if(i=t[0],e=e.substring(i.length),c=t[2].split(`
2022-05-18 13:29:28 -04:00
`,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+`
2022-05-19 10:14:37 -04:00
`,e=e.substring(h.length+1),f=!0),!f){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+=`
2022-05-18 13:29:28 -04:00
`+c.slice(s);else if(!l)g+=`
`+c;else break;!l&&!c.trim()&&(l=!0),i+=d+`
2022-05-19 10:14:37 -04:00
`,e=e.substring(d.length+1)}}y.loose||(u?y.loose=!0:/\n *\n *$/.test(i)&&(u=!0)),this.options.gfm&&(r=/^\[[ xX]\] /.exec(g),r&&(o=r[0]!=="[ ] ",g=g.replace(/^\[[ xX]\] +/,""))),y.items.push({type:"list_item",raw:i,task:!!r,checked:o,loose:!1,text:g}),y.raw+=i}y.items[y.items.length-1].raw=i.trimRight(),y.items[y.items.length-1].text=g.trimRight(),y.raw=y.raw.trimRight();let D=y.items.length;for(a=0;a<D;a++){this.lexer.state.top=!1,y.items[a].tokens=this.lexer.blockTokens(y.items[a].text,[]);let T=y.items[a].tokens.filter(I=>I.type==="space"),L=T.every(I=>{let A=I.raw.split(""),W=0;for(let B of A)if(B===`
`&&(W+=1),W>1)return!0;return!1});!y.loose&&T.length&&L&&(y.loose=!0,y.items[a].loose=!0)}return y}}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]):ai(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:hH(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]=hH(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:ai(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]):ai(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=eb(i.slice(0,-1),"\\");if((i.length-s.length)%2===0)return}else{let s=fpe(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)),gH(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 gH(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=ai(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=ai(this.options.mangle?t(i[1]):i[1]),o="mailto:"+r):(r=ai(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=ai(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=ai(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]):ai(i[0]):i[0]:r=ai(this.options.smartypants?t(i[0]):i[0]),{type:"text",raw:i[0],text:r}}}},he={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fenc
]`).replace("lheading",he.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});ee={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:tb,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:tb,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};ee._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";ee.punctuation=ut(ee.punctuation).replace(/punctuation/g,ee._punctuation).getRegex();ee.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g;ee.escapedEmSt=/\\\*|\\_/g;ee._comment=ut(he._comment).replace("(?:-->|$)","-->").getRegex();ee.emStrong.lDelim=ut(ee.emStrong.lDelim).replace(/punct/g,ee._punctuation).getRegex();ee.emStrong.rDelimAst=ut(ee.emStrong.rDelimAst,"g").replace(/punct/g,ee._punctuation).getRegex();ee.emStrong.rDelimUnd=ut(ee.emStrong.rDelimUnd,"g").replace(/punct/g,ee._punctuation).getRegex();ee._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;ee._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;ee._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])?)+(?![-_])/;ee.autolink=ut(ee.autolink).replace("scheme",ee._scheme).replace("email",ee._email).getRegex();ee._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;ee.tag=ut(ee.tag).replace("comment",ee._comment).replace("attribute",ee._attribute).getRegex();ee._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;ee._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/;ee._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;ee.link=ut(ee.link).replace("label",ee._label).replace("href",ee._href).replace("title",ee._title).getRegex();ee.reflink=ut(ee.reflink).replace("label",ee._label).replace("ref",he._label).getRegex();ee.nolink=ut(ee.nolink).replace("ref",he._label).getRegex();ee.reflinkSearch=ut(ee.reflinkSearch,"g").replace("reflink",ee.reflink).replace("nolink",ee.nolink).getRegex();ee.normal=_r({},ee);ee.pedantic=_r({},ee.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:ut(/^!?\[(label)\]\((.*?)\)/).replace("label",ee._label).getRegex(),reflink:ut(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ee._label).getRegex()});ee.gfm=_r({},ee.normal,{escape:ut(ee.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.!#$%&'*+\/=?_`{\|}~-]+@)))/});ee.gfm.url=ut(ee.gfm.url,"i").replace("email",ee.gfm._extended_email).getRegex();ee.breaks=_r({},ee.gfm,{br:ut(ee.br).
2022-05-18 13:29:28 -04:00
`).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+=`
2022-05-19 10:14:37 -04:00
`+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)+"["+dH("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)+"["+dH("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,fH)){e=e.substring(i.raw.length),t.push(i);continue}if(!this.state.inLink&&(i=this.tokenizer.url(e,fH))){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,mpe)){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}},nb=class{constructor(e){this.options=e||gc}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$/,"")+`
2022-05-18 13:29:28 -04:00
`,r?'<pre><code class="'+this.options.langPrefix+ai(r,!0)+'">'+(i?e:ai(e,!0))+`</code></pre>
`:"<pre><code>"+(i?e:ai(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+`>
2022-05-19 10:14:37 -04:00
`}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=cH(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let r='<a href="'+ai(e)+'"';return t&&(r+=' title="'+t+'"'),r+=">"+i+"</a>",r}image(e,t,i){if(e=cH(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}},T0=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""}},k0=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)}},Kr=class{constructor(e){this.options=e||gc,this.options.renderer=this.options.renderer||new nb,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new T0,this.slugger=new k0}static parse(e,t){return new Kr(t).parse(e)}static parseInline(e,t){return new Kr(t).parseInline(e)}parse(e,t=!0){let i="",r,o,s,a,l,u,c,h,d,g,f,p,b,y,w,D,T,L,I,A=e.length;for(r=0;r<A;r++){if(g=e[r],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[g.type]&&(I=this.options.extensions.renderers[g.type].call({parser:this},g),I!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(g.type))){i+=I||"";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,mH(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(f=g.ordered,p=g.start,b=g.loose,a=g.items.length,d="",o=0;o<a;o++)w=g.items[o],D=w.checked,T=w.task,y="",w.task&&(L=this.renderer.checkbox(D),b?w.tokens.length>0&&w.tokens[0].type==="paragraph"?(w.tokens[0].text=L+" "+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=L+" "+w.tokens[0].tokens[0].text)):w.tokens.unshift({type:"text",text:L}):y+=L),y+=this.parse(w.tokens,b),d+=this.renderer.listitem(y,T,D);i+=this.renderer.list(d,f,p);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<A&&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 W='Token with "'+g.type+'" type was not found.';if(this.options.silent){console.error(W);return}else throw new Error(W)}}}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}};ge.options=ge.setOptions=function(n){return _r(ge.defaults,n),epe(ge.defaults),ge};ge.getDefaults=pH;ge.defaults=gc;ge.use=function(...n){let e=_r({},...n),t=ge.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=ge.defaults.renderer||new nb;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=ge.defaults.tokenizer||new ib;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=ge.defaults.walkTokens;e.walkTokens=function(s){r.walkTokens.call(this,s),o&&o.call(this,s)}}i&&(e.extensions=t),ge.setOptions(e)})};ge.walkTokens=function(n,e){for(let t of n)switch(e.call(ge,t),t.type){case"table":{for(let i of t.header)ge.walkTokens(i.tokens,e);for(let i of t.rows)for(let r of i)ge.walkTokens(r.tokens,e);break}case"list":{ge.walkTokens(t.items,e);break}default:ge.defaults.extensions&&ge.defaults.extensions.childTokens&&ge.defaults.extensions.childTokens[t.type]?ge.defaults.extensions.childTokens[t.type].forEach(function(i){ge.walkTokens(t[i],e)}):t.tokens&&ge.walkTokens(t.tokens,e)}};ge.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=_r({},ge.defaults,e||{}),bH(e);try{let t=Qr.lexInline(n,e);return e.walkTokens&&ge.walkTokens(t,e.walkTokens),Kr.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>"+ai(t.message+"",!0)+"</pre>";throw t}};ge.Parser=Kr;ge.parser=Kr.parse;ge.Renderer=nb;ge.TextRenderer=T0;ge.Lexer=Qr;ge.lexer=Qr.lex;ge.Tokenizer=ib;ge.Slugger=k0;ge.parse=ge;S_e=ge.options,T_e=ge.setOptions,k_e=ge.use,E_e=ge.walkTokens,P_e=ge.parseInline,__e=Kr.parse,R_e=Qr.lex});var CH=m((F_e,DH)=>{var wH={};DH.exports=wH;var vH={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(vH).forEach(function(n){var e=vH[n],t=wH[n]=[];t.open="\x1B["+e[0]+"m",t.close="\x1B["+e[1]+"m"})});var SH=m((I_e,xH)=>{var ag=process.argv;xH.exports=function(){return ag.indexOf("--no-color")!==-1||ag.indexOf("--color=false")!==-1?!1:ag.indexOf("--color")!==-1||ag.indexOf("--color=true")!==-1||ag.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 kH=m((j_e,TH)=>{TH.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 PH=m((A_e,EH)=>{EH.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 XH=m((Z_e,_0)=>{var Epe=ZH(),dl=$H(),P0=dl.repeat,Ppe=dl.truncate,_pe=dl.pad;function lg(n){this.options=dl.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)}lg.prototype.__proto__=Array.prototype;lg.prototype.__defineGetter__("width",function(){var n=this.toString().split(`
`);return n.length?n[0].length:0});lg.prototype.render;lg.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(y){if(typeof y=="object"&&y.length)u(y);else{var w=Object.keys(y)[0],D=y[w];s[0]=Math.max(s[0]||0,c(w)||0),typeof D=="object"&&D.length?u(D,1):s[1]=Math.max(s[1]||0,c(D)||0)}})}a=(s.length==1?s[0]:s.reduce(function(y,w){return y+w}))+s.length+1;function u(y,D){var D=D||0;y.forEach(function(T,L){s[L+D]=Math.max(s[L+D]||0,c(T)||0)})}function c(y){return typeof y=="object"&&y.width!=null?y.width:(typeof y=="object"?dl.strlen(y.text):dl.strlen(y))+(t["padding-left"]||0)+(t["padding-right"]||0)}function h(I,w,D,T){var L=0,I=w+P0(I,a-2)+D;return s.forEach(function(A,W){W!=s.length-1&&(L+=A+1,I=I.substr(0,L)+T+I.substr(L+1))}),f(e.style.border,I)}function d(){var y=h(r.top,r["top-left"]||r.top,r["top-right"]||r.top,r["top-mid"]);y&&(n+=y+`
`)}function g(y,w){var D=[],T=0;if(!Array.isArray(y)&&typeof y=="object"){var L=Object.keys(y)[0],I=y[L],A=!0;Array.isArray(I)?(y=I,y.unshift(L)):y=[L,I]}y.forEach(function(N,F){var M=N.toString().split(`
`).reduce(function(K,ae){return K.push(p(ae,F)),K},[]),Z=M.length;Z>T&&(T=Z),D.push({contents:M,height:Z})});var W=new Array(T);D.forEach(function(N,F){N.contents.forEach(function(K,ae){W[ae]||(W[ae]=[]),(w||A&&F===0&&e.style.head)&&(K=f(e.style.head,K)),W[ae].push(K)});for(var M=N.height,Z=T;M<Z;M++)W[M]||(W[M]=[]),W[M].push(p("",F))});var B="";return W.forEach(function(N,F){B.length>0&&(B+=`
`+f(e.style.border,r.left)),B+=N.join(f(e.style.border,r.middle))+f(e.style.border,r.right)}),f(e.style.border,r.left)+B}function f(y,w){return w?(y.forEach(function(D){w=Epe[D](w)}),w):""}function p(D,w){var D=String(typeof D=="object"&&D.text?D.text:D),T=dl.strlen(D),L=s[w]-(t["padding-left"]||0)-(t["padding-right"]||0),I=e.colAligns[w]||"left";return P0(" ",t["padding-left"]||0)+(T==L?D:T<L?_pe(D,L+(D.length-T)," ",I=="left"?"right":I=="middle"?"both":"left"):o?Ppe(D,L,o):D)+P0(" ",t["padding-right"]||0)}i.length&&(d(),n+=g(i,t.head)+`
`),this.length&&this.forEach(function(y,w){if(!i.length&&w==0)d();else if(!t.compact||w<!!i.length||y.length==0){var D=h(r.mid,r["left-mid"],r["right-mid"],r["mid-mid"]);D&&(n+=D+`
2022-05-18 13:29:28 -04:00
`)}y.hasOwnProperty("length")&&!y.length||(n+=g(y)+`
2022-05-19 10:14:37 -04:00
`)});var b=h(r.bottom,r["bottom-left"]||r.bottom,r["bottom-right"]||r.bottom,r["bottom-mid"]);return b?n+=b:n=n.slice(0,-1),n};_0.exports=lg;_0.exports.version="0.0.1"});var KH=m((J_e,QH)=>{"use strict";var UH=(n=0)=>e=>`\x1B[${38+n};5;${e}m`,GH=(n=0)=>(e,t,i)=>`\x1B[${38+n};2;${e};${t};${i}m`;function Rpe(){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=UH(),e.color.ansi16m=GH(),e.bgColor.ansi256=UH(10),e.bgColor.ansi16m=GH(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(QH,"exports",{enumerable:!0,get:Rpe})});function zH(n){return`${vi.default.gray.open}${n}${vi.default.gray.close}`}function R0(n){return`${vi.default.magenta.open}${n}${vi.default.magenta.close}`}function VH(n){return`${vi.default.bold.open}${n}${vi.default.bold.close}`}function L0(n){return`${vi.default.underline.open}${n}${vi.default.underline.close}`}function eq(n){return`${vi.default.strikethrough.open}${n}${vi.default.strikethrough.close}`}function tq(n){return`${vi.default.italic.open}${n}${vi.default.italic.close}`}function iq(n){return`${vi.default.yellow.open}${n}${vi.default.yellow.close}`}function F0(n){return`${vi.default.blue.open}${n}${vi.default.blue.close}`}var vi,nq=_(()=>{"use strict";vi=x(KH())});function Rr(n){return n}function Ape(n){return zH(n.replace(/(<([^>]+)>)/ig,""))}function rq(n,e){return e?n.replace(jpe,/\n/g):n}function Mpe(n,e){return e.replace(/(^|\n)(.+)/g,"$1"+n+"$2")}function Npe(n,e){return e&&n+e.split(`
2022-05-18 13:29:28 -04:00
`).join(`
2022-05-19 10:14:37 -04:00
`+n)}function qpe(n,e){let t=new RegExp("(\\S(?: | )?)((?:"+e+")+)("+cq+"(?:.*)+)$","gm");return n.replace(t,`$1
`+e+"$2$3")}function dq(n){return" ".repeat(n.length)}function Ype(n,e){return hq(e,n)?e:dq(A0)+e}function Wpe(n,e){let t=Ype.bind(null,e);return n.split(`
2022-05-18 13:29:28 -04:00
`).filter(Rr).map(t).join(`
2022-05-19 10:14:37 -04:00
`)}function Zpe(n,e,t){return hq(e,n)?{num:t+1,line:e.replace(A0,oq(t+1))}:{num:t,line:dq(oq(t))+e}}function Jpe(n,e){let t=Zpe.bind(null,e),i=0;return n.split(`
2022-05-18 13:29:28 -04:00
`).filter(Rr).map(r=>{let o=t(r,i);return i=o.num,o.line}).join(`
2022-05-19 10:14:37 -04:00
`)}function $pe(n,e,t){return n=n.trim(),n=e?Jpe(n,t):Wpe(n,t),n}function ug(n){return n+`
2022-05-18 13:29:28 -04:00
2022-05-19 10:14:37 -04:00
`}function Xpe(n){return n.replace(Ipe,":")}function sq(n,e=null){if(!n)return[];e=e||Rr;let t=e(n).split(`
`),i=[];return t.forEach(function(r){if(!r)return;let o=r.replace(Fpe,"").split(lq);i.push(o.splice(0,o.length-1))}),i}function gq(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function Upe(n){return n.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'")}var aq,$_e,lq,j0,Fpe,uq,Ipe,jpe,Ope,Bpe,Hpe,cq,hq,A0,oq,I0,fq,O0,pq=_(()=>{"use strict";aq=x(XH());nq();$_e=Y()("markdown-renderer"),lq="^*||*^",j0="*|*|*|*",Fpe=new RegExp(gq(j0),"g"),uq="*#COLON|*",Ipe=new RegExp(gq(uq),"g"),jpe="\r";Ope={code:Rr,blockquote:Rr,html:Ape,heading:R0,firstHeading:R0,hr:Rr,listitem:Rr,list:$pe,table:Rr,paragraph:Rr,strong:VH,em:tq,codespan:iq,del:eq,link:L0,href:L0,text:Rr,unescape:!0,emoji:!1,width:80,showSectionPrefix:!0,tab:2,tableOptions:{}};Bpe="\\*",Hpe="\\d+\\.",cq="(?:"+[Bpe,Hpe].join("|")+")";hq=function(n,e){return n.match("^(?:"+e+")*"+cq)};A0="* ";oq=function(n){return n+". "};I0=new Map,fq=class{constructor(e={},t={}){this.options=e;this.highlightOptions=t;this.o=Object.assign({},Ope,e),this.tab=" ",this.tableSettings=this.o.tableOptions,this.unescape=this.o.unescape?Upe:Rr,this.highlightOptions=t||{},this.transform=this.compose(Xpe,this.unescape)}text(e){return this.o.text(e)}code(e,t,i){return"``` "+t+`
`+e+"\n```\n"}blockquote(e){return ug(this.o.blockquote(Npe(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,ug(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),ug(qpe(Mpe(this.tab,e),this.tab))}listitem(e){let t=this.compose(this.o.listitem,this.transform);return e.indexOf(`
2022-05-18 13:29:28 -04:00
`)!==-1&&(e=e.trim()),`
2022-05-19 10:14:37 -04:00
`+A0+t(e)}checkbox(e){return"["+(e?"X":" ")+"] "}paragraph(e){return e=this.compose(this.o.paragraph,this.transform)(e),ug(e)}table(e,t){let i=new aq.default(Object.assign({},{head:sq(e)[0]},this.tableSettings));return sq(t,this.transform).forEach(function(r){i.push(r)}),ug(this.o.table(i.toString()))}tablerow(e){return j0+e+j0+`
`}tablecell(e,t){return e+lq}strong(e){return this.o.strong(e)}em(e){return e=rq(e,this.o.reflowText),this.o.em(e)}codespan(e){return e=rq(e,this.o.reflowText),this.o.codespan(e.replace(/:/g,uq))}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&&I0.set(i,e),i&&i!=e)return F0(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 I0.entries())e.push(`${F0(t)}: ${i}`);return I0.clear(),e}},O0=fq});function mc(n,e=!1){let t=cg(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${cn(s)}${cn(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${cn(s)}`:c=`CocListFg${cn(s)}`,i.push({span:u,hlGroup:c})}else if(a){let c=`CocListBg${cn(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 cg(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=>{mq[u]?s.foreground=mq[u]:bq[u]?s.background=bq[u]:u==39?delete s.foreground:u==49?delete s.background:yq[u]?s[yq[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 mq,bq,yq,bc=_(()=>{"use strict";Fe();mq={30:"black",31:"red",32:"green",33:"yellow",34:"blue",35:"magenta",36:"cyan",37:"white",90:"grey"},bq={40:"black",41:"red",42:"green",43:"yellow",44:"blue",45:"magenta",46:"cyan",47:"white"},yq={1:"bold",3:"italic",4:"underline",9:"strikethrough"}});var wq=m((Q_e,vq)=>{"use strict";vq.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 hg=m((K_e,Dq)=>{"use strict";var Gpe=wq();Dq.exports=n=>typeof n=="string"?n.replace(Gpe(),""):n});function rb(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=zpe(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/);Qpe.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=Kpe(l,a,s.active);h.length&&i.push(...h)}o!=n.length-1&&t.push("\u2500"),o=o+1}return{lines:t,highlights:i,codes:r}}function Kpe(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:"CocUnderline"}),l=!1;break}else{let h=Q(c);i.push({colStart:0,colEnd:h,lnum:u+e,hlGroup:"CocUnderline"})}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:"CocUnderline"});break}else{let d=Q(c);i.push({colStart:h,colEnd:d,lnum:u+e,hlGroup:"CocUnderline"})}}a=a+c.length+1}return i}function zpe(n,e){ge.setOpt
2022-05-18 13:29:28 -04:00
`+c.join(`
2022-05-19 10:14:37 -04:00
`)),u=u.replace(/\s*$/,"");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,Cq.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 p=h[d-1];p&&/^\s*```\s*/.test(p)&&(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 f=mc(g,!0);if(f.highlights)for(let p of f.highlights){let{hlGroup:b,span:y}=p;i.push({hlGroup:b,lnum:o,colStart:y[0],colEnd:y[1]})}t.push(f.line),o++}return{lines:t,highlights:i,codes:r}}var Cq,Qpe,iRe,M0=_(()=>{"use strict";yH();pq();bc();Fe();Cq=x(hg()),Qpe=["Error","Warning","Info","Hint"],iRe=Y()("markdown-index")});var zt,zr=_(()=>{"use strict";zt=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 xq,Sq,Vpe,hRe,li,qo=_(()=>{"use strict";xq=x(Pi()),Sq=x(H());ce();M0();z();zr();Bt();Vpe=process.env.VIM_NODE_RPC=="1",hRe=Y()("model-float"),li=class{constructor(e){this.nvim=e;this.winid=0;this._bufnr=0;this.mutex=new zt;this.disposables=[];this.onCursorMoved=(0,xq.default)(this._onCursorMoved.bind(this),100)}bindEvents(e,t){let i=["InsertLeave","InsertEnter","BufEnter"];for(let r of i)E.on(r,o=>{o!=this._bufnr&&this.close()},null,this.disposables);E.on("MenuPopupChanged",()=>{E.pumAlignTop==t&&this.close()},null,this.disposables),this.disposables.push(Sq.Disposable.create(()=>{this.onCursorMoved.clear()})),E.on("CursorMoved",this.onCursorMoved.bind(this,e),this,this.disposables),E.on("CursorMovedI",this.onCursorMoved.bind(this,e),this,this.disposables)}unbind(){this.disposables.length&&(J(this.disposables),this.disposables=[])}_onCursorMoved(e,t,i){if(t!=this._bufnr&&!(t==this.targetBufnr&&Pe(i,this.cursor))&&(e||t!=this.targetBufnr||!E.insertMode)){this.close();return}}async create(e,t=!1,i=0){await this.show(e,{offsetX:i})}applyFloatConfig(e,t){for(let i of Object.keys(t)){if(i=="border"){t.border&&(e.border=[1,1,1,1]);continue}e[i]=t[i]}return e}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(p=>p.content.trim().length>0);let{lines:r,codes:o,highlights:s}=rb(e),a={pumAlignTop:E.pumAlignTop,preferTop:typeof t.preferTop=="boolean"?t.preferTop:!1,offsetX:t.offsetX||0,title:t.title||"",close:t.close?1:0,codes:o,highlights:s,modes:t.modes||["n","i","ic","s"]};Vpe||(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&&!t.border.every(p=>p==0)&&(a.border=t.border),t.title&&!a.border&&(a.border=[1,1,1,1]),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 p=u&&u.length>0?u[2]:this.winid;p&&(this.winid=0,this.nvim.call("coc#float#close",[p],!0),this.nvim.redrawVim());return}let[c,h,d,g,f]=u;this.winid=d,this._bufnr=g,this.targetBufnr=c,this.cursor=h,this.bindEvents(l,f==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.targetBufnr==e)}get bufnr(){return this
%s`,L,L,w,i);var I=w.type==="*"?q0:w.type==="?"?H0:"\\"+w.type;r=!0,i=i.slice(0,w.reStart)+I+"\\("+L}f(),o&&(i+="\\\\");var A=!1;switch(i.charAt(0)){case".":case"[":case"(":A=!0}for(var W=a.length-1;W>-1;W--){var B=a[W],N=i.slice(0,B.reStart),F=i.slice(B.reStart,B.reEnd-8),M=i.slice(B.reEnd-8,B.reEnd),Z=i.slice(B.reEnd);M+=Z;var K=N.split("(").length-1,ae=Z;for(p=0;p<K;p++)ae=ae.replace(/\)[+*?]?/,"");Z=ae;var je="";Z===""&&e!==ob&&(je="$");var _e=N+F+Z+je+M;i=_e}if(i!==""&&r&&(i="(?=.)"+i),A&&(i=d+i),e===ob)return[i,r];if(!r)return vme(n);var et=t.nocase?"i":"";try{var St=new RegExp("^"+i+"$",et)}catch{return new RegExp("$.")}return St._glob=n,St._src=i,St}zn.makeRe=function(n,e){return new ui(n,e||{}).makeRe()};ui.prototype.makeRe=bme;function bme(){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?q0:e.dot?cme:hme,i=e.nocase?"i":"",r=n.map(function(o){return o.map(function(s){return s===Y0?t:typeof s=="string"?wme(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}zn.match=function(n,e,t){t=t||{};var i=new ui(e,t);return n=n.filter(function(r){return i.match(r)}),i.options.nonull&&!n.length&&n.push(e),n};ui.prototype.match=yme;function yme(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;dg.sep!=="/"&&(n=n.split(dg.sep).join("/")),n=n.split(Wq),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}ui.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===Y0){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(`
2022-05-18 13:29:28 -04:00
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(`
2022-05-19 10:14:37 -04:00
>>> 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 f=r===s-1&&n[r]==="";return f}throw new Error("wtf?")};function vme(n){return n.replace(/\\(.)/g,"$1")}function wme(n){return n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var $q=m(W0=>{var gl=require("path"),Xs=process.platform==="win32",$s=require("fs"),Dme=process.env.NODE_DEBUG&&/fs/.test(process.env.NODE_DEBUG);function Cme(){var n;if(Dme){var e=new Error;n=t}else n=i;return n;function t(r){r&&(e.message=r.message,r=e,i(r))}function i(r){if(r){if(process.throwDeprecation)throw r;if(!process.noDeprecation){var o="fs: missing callback "+(r.stack||r.message);process.traceDeprecation?console.trace(o):console.error(o)}}}}function xme(n){return typeof n=="function"?n:Cme()}var bRe=gl.normalize;Xs?Yo=/(.*?)(?:[\/\\]+|$)/g:Yo=/(.*?)(?:[\/]+|$)/g;var Yo;Xs?gg=/^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/:gg=/^[\/]*/;var gg;W0.realpathSync=function(e,t){if(e=gl.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return t[e];var i=e,r={},o={},s,a,l,u;c();function c(){var b=gg.exec(e);s=b[0].length,a=b[0],l=b[0],u="",Xs&&!o[l]&&($s.lstatSync(l),o[l]=!0)}for(;s<e.length;){Yo.lastIndex=s;var h=Yo.exec(e);if(u=a,a+=h[0],l=u+h[1],s=Yo.lastIndex,!(o[l]||t&&t[l]===l)){var d;if(t&&Object.prototype.hasOwnProperty.call(t,l))d=t[l];else{var g=$s.lstatSync(l);if(!g.isSymbolicLink()){o[l]=!0,t&&(t[l]=l);continue}var f=null;if(!Xs){var p=g.dev.toString(32)+":"+g.ino.toString(32);r.hasOwnProperty(p)&&(f=r[p])}f===null&&($s.statSync(l),f=$s.readlinkSync(l)),d=gl.resolve(u,f),t&&(t[l]=d),Xs||(r[p]=f)}e=gl.resolve(d,e.slice(s)),c()}}return t&&(t[i]=e),e};W0.realpath=function(e,t,i){if(typeof i!="function"&&(i=xme(t),t=null),e=gl.resolve(e),t&&Object.prototype.hasOwnProperty.call(t,e))return process.nextTick(i.bind(null,null,t[e]));var r=e,o={},s={},a,l,u,c;h();function h(){var b=gg.exec(e);a=b[0].length,l=b[0],u=b[0],c="",Xs&&!s[u]?$s.lstat(u,function(y){if(y)return i(y);s[u]=!0,d()}):process.nextTick(d)}function d(){if(a>=e.length)return t&&(t[r]=e),i(null,e);Yo.lastIndex=a;var b=Yo.exec(e);return c=l,l+=b[0],u=c+b[1],a=Yo.lastIndex,s[u]||t&&t[u]===u?process.nextTick(d):t&&Object.prototype.hasOwnProperty.call(t,u)?p(t[u]):$s.lstat(u,g)}function g(b,y){if(b)return i(b);if(!y.isSymbolicLink())return s[u]=!0,t&&(t[u]=u),process.nextTick(d);if(!Xs){var w=y.dev.toString(32)+":"+y.ino.toString(32);if(o.hasOwnProperty(w))return f(null,o[w],u)}$s.stat(u,function(D){if(D)return i(D);$s.readlink(u,function(T,L){Xs||(o[w]=L),f(T,L)})})}function f(b,y,w){if(b)return i(b);var D=gl.resolve(c,y);t&&(t[w]=D),p(D)}function p(b){e=gl.resolve(b,e.slice(a)),h()}}});var X0=m((vRe,Qq)=>{Qq.exports=Us;Us.realpath=Us;Us.sync=$0;Us.realpathSync=$0;Us.monkeypatch=Tme;Us.unmonkeypatch=kme;var vc=require("fs"),Z0=vc.realpath,J0=vc.realpathSync,Sme=process.version,Xq=/^v[0-5]\./.test(Sme),Uq=$q();function Gq(n){return n&&n.syscall==="realpath"&&(n.code==="ELOOP"||n.code==="ENOMEM"||n.code==="ENAMETOOLONG")}function Us(n,e,t){if(Xq)return Z0(n,e,t);typeof e=="function"&&(t=e,e=null),Z0(n,e,function(i,r){Gq(i)?Uq.realpath(n,e,t):t(i,r)})}function $0(n,e){if(Xq)return J0(n,e);try{return J0(n,e)}catch(t){if(Gq(t))return Uq.realpathSync(n,e);throw t}}function Tme(){vc.realpath=Us,vc.realpathSync=$0}function kme(){vc.realpath=Z0,vc.realpathSync=J0}});var Kq=m((wRe,U0)=>{typeof Object.create=="function"?U0.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:U0.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 zq=m((DRe,Q0)=>{try{if(G0=require("util"),typeof G0.inherits!="function")throw"";Q0.exports=G0.inherits}catch{Q0.exports=Kq()}var G0});var ab=m((CRe,sb)=>{"use strict";function Vq(n){return n.charAt(0)==="/"}funct
2022-05-18 13:29:28 -04:00
See: https://github.com/isaacs/node-glob/issues/167`);return new Vt(n,e).found}function Vt(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
2022-05-19 10:14:37 -04:00
See: https://github.com/isaacs/node-glob/issues/167`);if(!(this instanceof Vt))return new Vt(n,e);if(Mme(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()}Vt.prototype._finish=function(){if(o2(this instanceof Vt),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=Ome.realpathSync(r,n.realpathCache);i[o]=!0}catch(s){if(s.syscall==="stat")i[n._makeAbs(r)]=!0;else throw s}})}fl.finish(this)};Vt.prototype._process=function(n,e,t){o2(this instanceof Vt);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=".":((lb(r)||lb(n.join("/")))&&(!r||!lb(r))&&(r="/"+r),s=r);var a=this._makeAbs(s);if(!Nme(this,s)){var l=o[0]===r2.GLOBSTAR;l?this._processGlobStar(r,s,a,o,e,t):this._processReaddir(r,s,a,o,e,t)}};Vt.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 f;l&&!n?f=!g.match(a):f=g.match(a),f&&h.push(g)}}var p=h.length;if(p!==0){if(i.length===1&&!this.mark&&!this.stat){this.matches[r]||(this.matches[r]=Object.create(null));for(var d=0;d<p;d++){var g=h[d];n&&(n.slice(-1)!=="/"?g=n+"/"+g:g=n+g),g.charAt(0)==="/"&&!this.nomount&&(g=V0.join(this.root,g)),this._emitMatch(r,g)}return}i.shift();for(var d=0;d<p;d++){var g=h[d],b;n?b=[n,g]:b=[g],this._process(b.concat(i),r,o)}}}};Vt.prototype._emitMatch=function(n,e){if(!Bme(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)}}};Vt.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};Vt.prototype._readdir=function(n,e){var t;if(e&&!eT(this.symlinks,n))return this._readdirInGlobStar(n);if(eT(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}};Vt.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};Vt.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}};Vt.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 f=l.concat(s[d],a);this._process(f,r,!0);var p=l.concat(s[d],i);this._process(p,r,!0)}}}};Vt.prototype._processSimple=function(n,e){var t=this._stat(n);if(this.matches[e]||(this.matches[e]=Object.create(null)),!!t){if(n&&lb(n)&&!this.nomount){var i=/[\/\\]$/.test(n);n.charAt(0)==="/"?n=V0.join(this.root,n):(n=V0.resolve(this.root,n),i&&(n+="/"))}process.platform==="win32"&&(n=n.replace(/\\/g,"/")),this._emitMatch(e,n)}};Vt.prototype._stat=function(n){var e=this._makeAbs(n),t=n.slice(-1)==="/";if(n.length>this.maxLength)return!1;if(!this.stat&&eT(this.cache,e)){var s=this.cache[e];if(Array.isArray(s)&&(s="DIR
2022-05-18 13:29:28 -04:00
`)}_append(e){let{nvim:t}=this,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+`
2022-05-19 10:14:37 -04:00
`)}clear(e){if(!this.validate())return;let{nvim:t}=this;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.command(`exe 'silent! bd! '.fnameescape('${this.bufname}')`,!0)}get bufname(){return`output:///${this.name}`}show(e){let{nvim:t}=this;t.pauseNotification(),t.command(`exe 'vsplit '.fnameescape('${this.bufname}')`,!0),e&&t.command("wincmd p",!0),t.resumeNotification(!0,!0),this.created=!0}validate(){return!this._disposed}dispose(){this.onDispose&&this.onDispose(),this._disposed=!0,this.hide(),this.lines=[]}}});var HRe,L2,Wo,yb=_(()=>{"use strict";ce();R2();HRe=Y()("core-channels"),L2=class{constructor(){this.outputChannels=new Map;this.bufnrs=new Map;this.disposable=E.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 bb(e,t,()=>{this.outputChannels.delete(e)});return this.outputChannels.set(e,i),i}show(e,t){let i=this.outputChannels.get(e);!i||i.show(t)}dispose(){this.disposable.dispose();for(let e of this.outputChannels.values())e.dispose();this.outputChannels.clear()}},Wo=new L2});var YRe,vb,F2=_(()=>{"use strict";YRe=Y()("model-terminal"),vb=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;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 fT,ibe,wb,I2=_(()=>{"use strict";F2();fT=x(H());z();ce();ibe=Y()("core-terminals"),wb=class{constructor(){this._terminals=new Map;this.disposables=[];this._onDidOpenTerminal=new fT.Emitter;this._onDidCloseTerminal=new fT.Emitter;this.onDidCloseTerminal=this._onDidCloseTerminal.event;this.onDidOpenTerminal=this._onDidOpenTerminal.event;E.on("BufUnload",e=>{if(this._terminals.has(e)){ibe.debug("terminal detach",e);let t=this._terminals.get(e);this._onDidCloseTerminal.fire(t),this._terminals.delete(e)}},null,this.disposables),E.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 vb(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.dispose();this._terminals.cle
`)],!0)}async function M2(n,e){if(e==="line"){let i=await n.call("line",["."]);return Sc.Range.create(i-1,0,i,0)}if(e==="cursor"){let[i,r]=await n.eval("coc#cursor#position()");return Sc.Range.create(i,r,i,r)}let t=await n.call("coc#cursor#get_selection",[e==="char"?1:0]);return t?Sc.Range.create(t[0],t[1],t[2],t[3]):null}async function N2(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 Sc,nbe,Cb=_(()=>{"use strict";Sc=x(H());Fe();nbe=process.env.VIM_NODE_RPC=="1"});var xb,mT=_(()=>{xb="0.0.80"});var yg,vg,Sb,Tb,wg,kb,Lr=_(()=>{"use strict";yg=(i=>(i[i.Buffer=0]="Buffer",i[i.LanguageServer=1]="LanguageServer",i[i.Global=2]="Global",i))(yg||{}),vg=(i=>(i[i.Native=0]="Native",i[i.Remote=1]="Remote",i[i.Service=2]="Service",i))(vg||{}),Sb=(i=>(i[i.More=0]="More",i[i.Warning=1]="Warning",i[i.Error=2]="Error",i))(Sb||{}),Tb=(i=>(i[i.Global=0]="Global",i[i.User=1]="User",i[i.Workspace=2]="Workspace",i))(Tb||{}),wg=(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))(wg||{}),kb=(r=>(r[r.Unknown=0]="Unknown",r[r.File=1]="File",r[r.Directory=2]="Directory",r[r.SymbolicLink=64]="SymbolicLink",r))(kb||{})});function bT(n,e){if(n.length<=1)return n;let t=n.length/2|0,i=n.slice(0,t),r=n.slice(t);bT(i,e),bT(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 B2(n,e,t=0){let i=e?[t]:[];for(let r=0;r<n.length;r++){let o=n.charCodeAt(r);(o===13||o===10)&&(o===13&&r+1<n.length&&n.charCodeAt(r+1)===10&&r++,i.push(t+r+1))}return i}function H2(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 obe(n){let e=H2(n.range);return e!==n.range?{newText:n.newText,range:e}:n}var kc,jn,Ec=_(()=>{"use strict";kc=class{constructor(e,t,i,r){this._uri=e,this._languageId=t,this._version=i,this._content=r,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let t=this.offsetAt(e.start),i=this.offsetAt(e.end);return this._content.substring(t,i)}return this._content}update(e,t){for(let i of e)if(kc.isIncremental(i)){let r=H2(i.range),o=this.offsetAt(r.start),s=this.offsetAt(r.end);this._content=this._content.substring(0,o)+i.text+this._content.substring(s,this._content.length);let a=Math.max(r.start.line,0),l=Math.max(r.end.line,0),u=this._lineOffsets,c=B2(i.text,!1,o);if(l-a===c.length)for(let d=0,g=c.length;d<g;d++)u[d+a+1]=c[d];else c.length<1e4?u.splice(a+1,l-a,...c):this._lineOffsets=u=u.slice(0,a+1).concat(c,u.slice(l+1));let h=i.text.length-(s-o);if(h!==0)for(let d=a+1+c.length,g=u.length;d<g;d++)u[d]=u[d]+h}else if(kc.isFull(i))this._content=i.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=t}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=B2(this._content,!0)),this._lineOffsets}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)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let t=e;return t!=null&&typeof t.text=="string"&&t.ra
`;break;case 114:D+="\r";break;case 116:D+=" ";break;case 117:var A=d(4,!0);A>=0?D+=String.fromCharCode(A):h=4;break;default:h=5}T=i;continue}if(L>=0&&L<=31)if(Dg(L)){D+=n.substring(T,i),h=2;break}else h=6;i++}return D}function b(){if(r="",h=0,o=i,l=a,c=u,i>=t)return o=t,s=17;var D=n.charCodeAt(i);if(yT(D)){do i++,r+=String.fromCharCode(D),D=n.charCodeAt(i);while(yT(D));return s=15}if(Dg(D))return i++,r+=String.fromCharCode(D),D===13&&n.charCodeAt(i)===10&&(i++,r+=`
`),a++,u=i,s=14;switch(D){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=p(),s=10;case 47:var T=i-1;if(n.charCodeAt(i+1)===47){for(i+=2;i<t&&!Dg(n.charCodeAt(i));)i++;return r=n.substring(T,i),s=12}if(n.charCodeAt(i+1)===42){i+=2;for(var L=t-1,I=!1;i<L;){var A=n.charCodeAt(i);if(A===42&&n.charCodeAt(i+1)===47){i+=2,I=!0;break}i++,Dg(A)&&(A===13&&n.charCodeAt(i)===10&&i++,a++,u=i)}return I||(i++,h=1),r=n.substring(T,i),s=13}return r+=String.fromCharCode(D),i++,s=16;case 45:if(r+=String.fromCharCode(D),i++,i===t||!Pc(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+=f(),s=11;default:for(;i<t&&y(D);)i++,D=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(D),i++,s=16}}function y(D){if(yT(D)||Dg(D))return!1;switch(D){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function w(){var D;do D=b();while(D>=12&&D<=15);return D}return{setPosition:g,getPosition:function(){return i},scan:e?w:b,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 yT(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 Dg(n){return n===10||n===13||n===8232||n===8233}function Pc(n){return n>=48&&n<=57}var Eb=_(()=>{"use strict"});function wT(n,e,t){var i,r,o,s,a;if(e){for(s=e.offset,a=s+e.length,o=s;o>0&&!xg(n,o-1);)o--;for(var l=a;l<n.length&&!xg(n,l);)l++;r=n.substring(o,l),i=abe(r,t)}else r=n,i=0,o=0,s=0,a=n.length;var u=lbe(t,n),c=!1,h=0,d;t.insertSpaces?d=vT(" ",t.tabSize||4):d=" ";var g=Cg(r,!1),f=!1;function p(){return u+vT(d,i+h)}function b(){var M=g.scan();for(c=!1;M===15||M===14;)c=c||M===14,M=g.scan();return f=M===16||g.getTokenError()!==0,M}var y=[];function w(M,Z,K){!f&&(!e||Z<a&&K>s)&&n.substring(Z,K)!==M&&y.push({offset:Z,length:K-Z,content:M})}var D=b();if(D!==17){var T=g.getTokenOffset()+o,L=vT(d,i);w(L,o,T)}for(;D!==17;){for(var I=g.getTokenOffset()+g.getTokenLength()+o,A=b(),W="",B=!1;!c&&(A===12||A===13);){var N=g.getTokenOffset()+o;w(" ",I,N),I=g.getTokenOffset()+g.getTokenLength()+o,B=A===12,W=B?p():"",A=b()}if(A===2)D!==1&&(h--,W=p());else if(A===4)D!==3&&(h--,W=p());else{switch(D){case 3:case 1:h++,W=p();break;case 5:case 12:W=p();break;case 13:c?W=p():B||(W=" ");break;case 6:B||(W=" ");break;case 10:if(A===6){B||(W="");break}case 7:case 8:case 9:case 11:case 2:case 4:A===12||A===13?B||(W=" "):A!==5&&A!==17&&(f=!0);break;case 16:f=!0;break}c&&(A===12||A===13)&&(W=p())}A===17&&(W=t.insertFinalNewline?u:"");var F=g.getTokenOffset()+o;w(W,I,F),D=A}return y}function vT(n,e){for(var t="",i=0;i<e;i++)t+=n;return t}function abe(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 lbe(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)===`
2022-05-18 13:29:28 -04:00
`?`\r
`:"\r";if(i===`
`)return`
`}return n&&n.eol||`
2022-05-19 10:14:37 -04:00
`}function xg(n,e){return`\r
`.indexOf(n.charAt(e))!==-1}var DT=_(()=>{"use strict";Eb()});function q2(n,e,t){e===void 0&&(e=[]),t===void 0&&(t=Sg.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 xT(n,a,t),r[0]}function CT(n,e,t){e===void 0&&(e=[]),t===void 0&&(t=Sg.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:cbe(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})}};xT(n,s,t);var a=i.children[0];return a&&delete a.parent,a}function Pb(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 xT(n,e,t){t===void 0&&(t=Sg.DEFAULT);var i=Cg(n,!1);function r(B){return B?function(){return B(i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter())}:function(){return!0}}function o(B){return B?function(N){return B(N,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),f=o(e.onError),p=t&&t.disallowComments,b=t&&t.allowTrailingComma;function y(){for(;;){var B=i.scan();switch(i.getTokenError()){case 4:w(14);break;case 5:w(15);break;case 3:w(13);break;case 1:p||w(11);break;case 2:w(12);break;case 6:w(16);break}switch(B){case 12:case 13:p?w(10):g();break;case 16:w(1);break;case 15:case 14:break;default:return B}}}function w(B,N,F){if(N===void 0&&(N=[]),F===void 0&&(F=[]),f(B),N.length+F.length>0)for(var M=i.getToken();M!==17;){if(N.indexOf(M)!==-1){y();break}else if(F.indexOf(M)!==-1)break;M=y()}}function D(B){var N=i.getTokenValue();return B?h(N):a(N),y(),!0}function T(){switch(i.getToken()){case 11:var B=i.getTokenValue(),N=Number(B);isNaN(N)&&(w(2),N=0),h(N);break;case 7:h(null);break;case 8:h(!0);break;case 9:h(!1);break;default:return!1}return y(),!0}function L(){return i.getToken()!==10?(w(3,[],[2,5]),!1):(D(!1),i.getToken()===6?(d(":"),y(),W()||w(4,[],[2,5])):w(5,[],[2,5]),!0)}function I(){s(),y();for(var B=!1;i.getToken()!==2&&i.getToken()!==17;){if(i.getToken()===5){if(B||w(4,[],[]),d(","),y(),i.getToken()===2&&b)break}else B&&w(6,[],[]);L()||w(4,[],[2,5]),B=!0}return l(),i.getToken()!==2?w(7,[2],[]):y(),!0}function A(){u(),y();for(var B=!1;i.getToken()!==4&&i.getToken()!==17;){if(i.getToken()===5){if(B||w(4,[],[]),d(","),y(),i.getToken()===4&&b)break}else B&&w(6,[],[]);W()||w(4,[],[4,5]),B=!0}return c(),i.getToken()!==4?w(8,[4],[]):y(),!0}function W(){switch(i.getToken()){case 3:return A();case 1:return I();case 10:return D(!0);default:return T()}}return y(),i.getToken()===17?t.allowEmptyContent?!0
2022-05-18 13:29:28 -04:00
augroup coc_dynamic_autocmd
autocmd!
${i.join(`
`)}
2022-05-19 10:14:37 -04:00
augroup end`;if(this.nvim.hasFunction("nvim_exec"))this.nvim.exec(r,!1);else{let o=IT.default.join(process.env.TMPDIR||nY.default.tmpdir(),`coc.nvim-${process.pid}.vim`);FT.default.mkdirSync(o,{recursive:!0});let s=IT.default.join(o,`coc-${process.pid}.vim`);FT.default.writeFileSync(s,r,"utf8");let a=`source ${s}`;this.env.isCygwin&&Ho.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),J(this.disposables)}}});var vl,Mb,sY=_(()=>{"use strict";vl=x(H());we();ce();z();Mb=class{constructor(e){this.documents=e;this.disposables=[];this.providers=new Map;this._onDidProviderChange=new vl.Emitter;this.onDidProviderChange=this._onDidProviderChange.event}attach(e){this.nvim=e,E.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 vl.CancellationTokenSource,o=await Promise.resolve(i.provideTextDocumentContent(O.parse(t),r.token)),s=await this.nvim.buffer;await s.setLines(o.split(/\r?\n/),{start:0,end:-1,strictIndexing:!1}),process.nextTick(()=>{E.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 vl.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),vl.Disposable.create(()=>{this.providers.delete(e),J(i),this._onDidProviderChange.fire()})}dispose(){J(this.disposables),this._onDidProviderChange.dispose(),this.providers.clear()}}});var uY=m((nFe,Nb)=>{"use strict";Nb.exports=Cbe;Nb.exports.format=aY;Nb.exports.parse=lY;var vbe=/\B(?=(\d{3})+(?!\d))/g,wbe=/(?:\.0*|(\.[^0]+)0+)$/,Ks={b:1,kb:1<<10,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},Dbe=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function Cbe(n,e){return typeof n=="string"?lY(n):typeof n=="number"?aY(n,e):null}function aY(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||!Ks[a.toLowerCase()])&&(t>=Ks.pb?a="PB":t>=Ks.tb?a="TB":t>=Ks.gb?a="GB":t>=Ks.mb?a="MB":t>=Ks.kb?a="KB":a="B");var l=n/Ks[a.toLowerCase()],u=l.toFixed(o);return s||(u=u.replace(wbe,"$1")),i&&(u=u.replace(vbe,i)),u+r+a}function lY(n){if(typeof n=="number"&&!isNaN(n))return n;if(typeof n!="string")return null;var e=Dbe.exec(n),t,i="b";return e?(t=parseFloat(e[1]),i=e[4].toLowerCase()):(t=parseInt(n,10),i="b"),Math.floor(Ks[i]*t)}});var Hb=m((rFe,mY)=>{var eo=-1,Fr=1,dn=0;function Pg(n,e,t,i){if(n===e)return n?[[dn,n]]:[];if(t!=null){var r=Ebe(n,e,t);if(r)return r}var o=AT(n,e),s=n.substring(0,o);n=n.substring(o),e=e.substring(o),o=OT(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=xbe(n,e);return s&&l.unshift([dn,s]),a&&l.push([dn,a]),hY(l,i),l}function xbe(n,e){var t;if(!n)return[[Fr,e]];if(!e)return[[eo,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=[[Fr,i.substring(0,o)],[dn,r],[Fr,i.substring(o+r.length)]],n.length>e.length&&(t[0][0]=t[2][0]=eo),t;if(r.length===1)return[[eo,n],[Fr,e]];var s=Tbe(n,e);if(s){var a=s[0],l=s[1],u=s[2],c=s[3],h=s[4],d=Pg(a,u),g=Pg(l,c);return d.concat([[dn,h]],g)}return Sbe(n,e)}function Sbe(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,f=0,p=0,b=0;b<r;b++){for(var y=-b+d;y<=b-g;y+=2){var w=o+y,D;y===-b||y!==b&&a[w-1]<a[w+1]?D=a[w+1]:D=a[w-1]+1;for(var T=D-y;D<t&&T<i&&n.charAt(D)===e.charAt(T);)D++,T++;if(a[w]=D,D>t)g+=2;else if(T>i)d+=2;else if(h){var L=o+c-y;if(L>=0&&L<s&&l[L]!==-1){var I=t-l[L];
2022-05-18 13:29:28 -04:00
`)+`
2022-05-19 10:14:37 -04:00
`:"";if(!(d.length===0&&a===r-c))return ln.replace(Oe.create(a,0,r-c,0),d)}var qb,aFe,MT=_(()=>{"use strict";qb=x(Hb());No();Fe();aFe=Y()("util-diff")});function zs(n){let{newText:e}=n,t=Yb(n.range),i=t.end.line-t.start.line;return e.split(/\r?\n/).length-i-1}function Yb(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 NT(n,e){if(n.length<=1)return n;let t=n.length/2|0,i=n.slice(0,t),r=n.slice(t);NT(i,e),NT(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 wY(n){let{changes:e,documentChanges:t}=n;return!(t&&t.length||e&&Object.keys(e).length)}function DY(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}=a,u=k2(a.range);if(o){if(T2(o,u.start)&&Ct(u)&&l.length>0){let h=t[t.length-1];h.newText=l,o=void 0;continue}o=void 0}l.includes("\r")&&(l=l.replace(/\r\n/g,`
`));let c=De(u.end,i);if(c>0&&(u.end={line:i.line,character:i.character}),n.getText(u)!==l){if(c===0&&r&&!Ct(u)&&l.endsWith(`
`)){l=l.slice(0,-1);let h=n.lines[i.line-1];u.end=Vs.Position.create(i.line-1,h.length)}else l.length==0&&(o=u.start);t.push({range:u,newText:l})}}return NT(t,(s,a)=>{let l=s.range.start.line-a.range.start.line;return l===0?s.range.start.character-a.range.start.character:l})}function CY(n,e){var s,a;if(e.length==1){let{start:l,end:u}=e[0].range,{lines:c}=n,h=(s=c[l.line])!=null?s:"",d=(a=c[u.line])!=null?a:"",g=h.substring(0,l.character)+e[0].newText+d.substring(u.character);return u.line>=c.length&&n.eol?g==""?[...c.slice(0,l.line)]:(g.endsWith(`
2022-05-18 13:29:28 -04:00
`)&&(g=g.slice(0,-1)),[...c.slice(0,l.line),...g.split(`
`)]):[...c.slice(0,l.line),...g.split(`
2022-05-19 10:14:37 -04:00
`),...c.slice(u.line+1)]}let t=n.getText(),i=0,r=[];for(let l of e){let u=n.offsetAt(l.range.start);if(u<i)throw new Error("Overlapping edit");u>i&&r.push(t.substring(i,u)),l.newText.length&&r.push(l.newText),i=n.offsetAt(l.range.end)}r.push(t.substring(i));let o=r.join("");if(o!==t)return aH(o,n.eol)}function xY(n,e){return e.map(t=>{var c,h;let{start:i,end:r}=t.range,o=(c=n[i.line])!=null?c:"",s=Q(o.slice(0,i.character)),a=r.line==i.line?o:(h=n[r.line])!=null?h:"",l=Q(a.slice(0,r.character)),{newText:u}=t;return[u.length>0?u.split(`
`):[],i.line,s,r.line,l]})}function Wb(n,e){let{range:t,newText:i}=e;if(De(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 Pbe(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;if(a.length>1){let c=a[a.length-1].length;return{line:t+l,character:c+i-s.character}}let u=r.start.character-r.end.character;return{line:t+l,character:u+o.length+i}}function SY(n,e){let t=Vs.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+=zs(o);continue}De(o.range.end,t)>0||(o.range.end.line==t.line?t=Pbe(t,o):(i=!0,t.line+=zs(o)))}return t}function BT(n,e){let t=0;for(let i of e){let r=Yb(i.range);De(r.end,n)<=0&&(t+=zs(i))}return t}function TY(n,e,t){var c,h;let i=n[0].range.start,r=n[n.length-1].range.end,o=e.length-r.line,s=((c=e[r.line])!=null?c:"").length-r.character,a=t.length-o,l=((h=t[a])!=null?h:"").length-s,u=_be(i,Vs.Position.create(a,l),t);return Vs.TextEdit.replace(Vs.Range.create(i,r),u)}function _be(n,e,t){var r,o;if(n.line===e.line)return((r=t[n.line])!=null?r:"").slice(n.character,e.character);let i=[];for(let s=n.line;s<=e.line;s++){let a=(o=t[s])!=null?o:"";s===n.line?i.push(a.slice(n.character)):s===e.line?i.push(a.slice(0,e.character)):i.push(a)}return i.join(`
`)}var Vs,ea=_(()=>{"use strict";Vs=x(H());bt();Fe()});var HT,mFe,ir,_g,kY=_(()=>{"use strict";HT=x(H());z();Ec();mFe=Y()("model-chars"),ir=class{constructor(e,t){this.start=e,this.end=t||e}static fromKeywordOption(e){let t=e.split(","),i=[];for(let r of t)if(r=="@")i.push(new ir(65,90)),i.push(new ir(97,122));else if(r=="@-@")i.push(new ir(64));else if(/^([A-Za-z])-([A-Za-z])$/.test(r)){let o=r.match(/^([A-Za-z])-([A-Za-z])$/);i.push(new ir(o[1].charCodeAt(0),o[2].charCodeAt(0)))}else if(/^\d+-\d+$/.test(r)){let o=r.match(/^(\d+)-(\d+)$/);i.push(new ir(Number(o[1]),Number(o[2])))}else if(/^\d+$/.test(r))i.push(new ir(Number(r)));else{let o=r.charCodeAt(0);i.some(s=>s.contains(o))||i.push(new ir(o))}return i}contains(e){return e>=this.start&&e<=this.end}},_g=class{constructor(e){this.ranges=[];e&&(this.ranges=ir.fromKeywordOption(e))}addKeyword(e){let t=e.charCodeAt(0),{ranges:i}=this;i.some(r=>r.contains(t))||i.push(new ir(t))}clone(){let e=new _g;return e.ranges=this.ranges.slice(),e}setKeywordOption(e){this.ranges=ir.fromKeywordOption(e)}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 Ur(),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}isKeywordCode(e){return e>255?!0:e<33?!1:this.ranges.some(t=>t.contains(e))}isKeywordChar(e){let{ranges:t}=this;if(/\s/.test(e))return!1;let i=e.charCodeAt(0);return i>255?!0:i<33?!1:t.some(r=>r.contains(i))}isKeyword(e){for(let t=0,i=e.length;t<i;t++)if(!this.isKeywordChar(e[t]))return!1;return!0}getLocalifyBonus(e,t,i,r=10*1024){let o=new Map,s=Math.max(0,e.line-50),a=Math.min(i.length,e.line+50),l=i.slice(s,a).join(`
2022-05-18 13:29:28 -04:00
`);if(l.length>r){let p=l.length,b=!1;for(;a>e.line+1;){let y=i[a-1].length;if(p-y<r){b=!0;break}a=a-1,p-=y}if(!b)for(;s<=e.line;){let y=i[s].length;if(p-y<r)break;p-=y,s+=1}l=i.slice(s,a).join(`
2022-05-19 10:14:37 -04:00
`)}e=HT.Position.create(e.line-s,e.character),t=HT.Position.create(t.line-s,t.character);let u=jn.create("","",1,l),c=u.offsetAt(e),h=l.length,d=h-u.offsetAt(t),g=0,f=!1;for(let p=0;p<c;p++){let b=this.isKeyword(l[p]);if(!f&&b)g=p;else if(f&&!b&&p-g>1){let y=l.substring(g,p);o.set(y,p/c)}f=b}g=h-d,f=!1;for(let p=g;p<l.length;p++){let b=this.isKeyword(l[p]);if(!f&&b)g=p;else if(f&&(!b||p==h-1)&&p-g>1){let y=p==h-1?p+1:p,w=l.substring(g,y),D=o.get(w)||0,T=h-p+(y-g);T!==d&&o.set(w,Math.max(D,T/d))}f=b}return o}}});var qT,YT,EY=_(()=>{"use strict";qT=x(H()),YT=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 qT.Range.create(this._line,0,this._line,this._text.length)}get rangeIncludingLineBreak(){return this._isLastLine?this.range:qT.Range.create(this._line,0,this._line+1,0)}get firstNonWhitespaceCharacterIndex(){return/^(\s*)/.exec(this._text)[1].length}get isEmptyOrWhitespace(){return this.firstNonWhitespaceCharacterIndex===this._text.length}}});function Rbe(n,e){let t=[],i=0;for(let r of n)t.push(i),i+=r.length+1;return e&&t.push(i),t}var Zb,Rg,PY=_(()=>{"use strict";Zb=x(H());EY();Rg=class{constructor(e,t,i,r,o,s){this.uri=e;this.languageId=t;this.version=i;this.lines=r;this.bufnr=o;this.eol=s}get content(){return this._content||(this._content=this.lines.join(`
2022-05-18 13:29:28 -04:00
`)+(this.eol?`
2022-05-19 10:14:37 -04:00
`:"")),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?Zb.Position.create(e,0):Zb.Position.create(e,this.lines[e].length)}get lineCount(){return this.lines.length+(this.eol?1:0)}getText(e){var t;if(e){let{start:i,end:r}=e;return i.line===r.line?i.character===r.character?"":((t=this.lines[i.line])!=null?t:"").substring(i.character,r.character):this.content.substring(this.offsetAt(e.start),this.offsetAt(e.end))}return this.content}lineAt(e){var i;let t=Zb.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 YT(t,(i=this.lines[t])!=null?i:"",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=Rbe(this.lines,this.eol)),this._lineOffsets}}});function WT(n){E.fire("BufDetach",[n])}var ZT,Jo,NFe,Jb,_Y=_(()=>{"use strict";ZT=x(Pi()),Jo=x(H());we();ce();MT();z();Bt();bt();Fe();ea();kY();PY();NFe=Y()("model-document"),Jb=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._previewwindow=!1;this._winid=-1;this.disposables=[];this.lines=[];this._onDocumentChange=new Jo.Emitter;this.onDocumentChange=this._onDocumentChange.event;this.fireContentChanges=(0,ZT.default)(()=>{this._fireContentChanges()},global.__TEST__?20:150),this.fetchContent=(0,ZT.default)(()=>{this._fetchContent()},100),this.init(r)}get content(){return this.syncLines.join(`
2022-05-18 13:29:28 -04:00
`)+(this.eol?`
2022-05-19 10:14:37 -04:00
`:"")}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:return this.env.filetypeMap[e]||e}}get schema(){return O.parse(this.uri).scheme}get lineCount(){return this.lines.length}get winid(){return this._winid}get indentkeys(){return this._indentkeys}get previewwindow(){return this._previewwindow}init(e){let t=this.buftype=e.buftype;this._indentkeys=e.indentkeys,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=Km(e.fullpath,this.bufnr,t,this.env.isCygwin),Array.isArray(e.lines)&&(this.lines=e.lines,this._noFetch=!0,this._attached=!0,this.attach()),this._filetype=this.convertFiletype(e.filetype),this.setIskeyword(e.iskeyword),this.createTextDocument(1,this.lines)}attach(){if(this.env.isVim)return;let e=this.lines;this.buffer.attach(!0).then(t=>{t||WT(this.bufnr)},t=>{WT(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,E.pumvisible)return;this.fireContentChanges()}},this.disposables),this.buffer.listen("detach",()=>{WT(this.bufnr)},this.disposables)}get dirty(){return this.lines!==this.syncLines}get hasChanged(){return this.dirty?!Pe(this.lines,this.syncLines):!1}_fireContentChanges(e){var s;if(this.lines===this.syncLines)return;let t=this._textDocument,i=[];if(!e){let{cursor:a,insertMode:l}=E,u;if(a&&a.bufnr==this.bufnr){let c=(s=this.lines[a.lnum-1])!=null?s:"";u=Jo.Position.create(a.lnum-1,yi(c,a.col-1))}e=vY(t.lines,this.lines,u,l)}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 p,b;if(Array.isArray(arguments[1])&&(e=arguments[1]),!this._attached||e.length===0)return;this._forceSync();let r=this.textDocument;if(e=DY(r,e),e.length===0)return;let o=CY(r,e);if(!o)return;let s=r.lines,a=bY(s,o,e[0].range.start.line);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=xY(s,e));let h,d=E.bufnr==this.bufnr,g;if(i&&d&&!l){let y=Jo.Position.is(i)?i:void 0;if(i===!0&&this.bufnr===((p=E.cursor)==null?void 0:p.bufnr)){let{col:w,lnum:D}=E.cursor;y=Jo.Position.create(D-1,yi(this.lines[D-1],w-1))}if(y){let w=SY(y,e);if(De(y,w)!==0){let D=(b=o[w.line])!=null?b:"",T=Ze(D,w.character)+1;h=[w.line+1,T]}g=Ze(this.lines[y.line],y.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 f=e.length==1?e[0]:TY(e,s,o);await iH(),this.lines=o,this.fireContentChanges.clear(),this._fireContentChanges(f)}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#u
2022-05-18 13:29:28 -04:00
`);return this.eol?e+`
2022-05-19 10:14:37 -04:00
`: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 Rg(this.uri,this.languageId,1,t,this.bufnr,this.eol)}setIskeyword(e){let t=this.chars=new _g(e),i=this.getVar("additional_keywords",[]);if(i&&Array.isArray(i))for(let r of i)t.addKeyword(r)}detach(){this._disposed||(J(this.disposables),this._disposed=!0,this._attached=!1,this.lines=[],this.fetchContent.clear(),this.fireContentChanges.clear(),this._onDocumentChange.dispose())}getLocalifyBonus(e,t,i){return this.chars.getLocalifyBonus(e,t,this.lines,i)}async synchronize(){if(!this.attached)return;let{changedtick:e}=this;await this.patchChange(),e!=this.changedtick&&await Ve(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())}onCursorHold(e){this.variables=e}}});var RY,JT,$T,wl,gn,$b,Xb,LY=_(()=>{"use strict";RY=x(uY()),JT=x(require("fs")),$T=x(require("os")),wl=x(require("path")),gn=x(H());we();ce();_Y();z();Ue();Fe();$b=Y()("core-documents"),Xb=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 gn.Emitter;this._onDidCloseDocument=new gn.Emitter;this._onDidChangeDocument=new gn.Emitter;this._onDidSaveDocument=new gn.Emitter;this._onWillSaveDocument=new gn.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()}async attach(e,t){if(this._attached)return;this.nvim=e,this._env=t,this._attached=!0;let r=this.configurations.getConfiguration("coc.preferences").get("maxFileSize","10MB");this.maxFileSize=RY.default.parse(r),e.setVar("coc_max_filesize",this.maxFileSize,!0);let{bufnrs:o,winid:s,bufnr:a,winids:l}=await this.nvim.call("coc#util#all_state");this.winids=new Set(l),this._bufnr=a,await Promise.all(o.map(c=>this.createDocument(c))),E.on("BufDetach",this.onBufDetach,this,this.disposables),E.on("VimLeavePre",()=>{this.resolveCurrent(void 0)},null,this.disposables),E.on("WinEnter",c=>{this.winids.add(c)},null,this.disposables),E.on("BufWinEnter",(c,h)=>{this.winids.add(h)},null,this.disposables),E.on("DirChanged",c=>{this._cwd=c},null,this.disposables),E.on("CursorHold",async()=>{let{bufnrs:c,winids:h}=await this.nvim.call("coc#util#all_state");for(let d of this.buffers.keys())c.includes(d)||E.fire("BufUnload",[d]);for(let d of this.winids)h.includes(d)||E.fire("WinClosed",[d]);this.winids=new Set(h)},null,this.disposables);let u=c=>{this._bufnr=c,this.createDocument(c)};E.on("CursorMoved",u,null,this.disposables),E.on("CursorMovedI",u,null,this.disposables),E.on("BufUnload",this.onBufUnload,this,this.disposables),E.on("BufEnter",this.onBufEnter,this,this.disposables),E.on("BufCreate",this.onBufCreate,this,this.disposables),E.on("TermOpen",this.onBufCreate,this,this.disposables),E.on("BufWritePost",this.onBufWritePost,this,this.disposables),E.on("BufWritePre",this.onBufWritePre,this,this.disposables),E.on("FileType",this.onFileTypeChange,this,this.disposables),E.fire("BufEnter",[a]),E.fire("BufWinEnter",[a,s]),E.on("BufEnter",c=>{this.createDocument(c)},null,thi
2022-05-18 13:29:28 -04:00
`)+`
2022-05-19 10:14:37 -04:00
`}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(),J(this.disposables)}}});function Fbe(n,e,t){let i=ta.default.join(n,e);if(typeof t!="string"){let r=t.baseUri.fsPath;if(!Me(r,i))return!1;let o=ta.default.relative(r,i);return(0,XT.default)(o,t.pattern,{dot:!0})}return(0,XT.default)(e,t,{dot:!0})}var ci,FY,XT,IY,ta,jY,Ht,Lbe,Ub,AY=_(()=>{"use strict";ci=x(Rn()),FY=x(ub()),XT=x(Vn()),IY=x(require("os")),ta=x(require("path")),jY=require("util"),Ht=x(H());we();z();Ue();Fe();Cb();Lbe=Y()("core-files"),Ub=class{constructor(e,t,i){this.documents=e;this.configurations=t;this.workspaceFolderControl=i;this._onDidCreateFiles=new Ht.Emitter;this._onDidRenameFiles=new Ht.Emitter;this._onDidDeleteFiles=new Ht.Emitter;this._onWillCreateFiles=new Ht.Emitter;this._onWillRenameFiles=new Ht.Emitter;this._onWillDeleteFiles=new Ht.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){this.nvim=e,this.env=t}async openTextDocument(e){e=typeof e=="string"?O.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(!ci.default.existsSync(e.fsPath))throw new Error(`${e.fsPath} doesn't exist.`);ci.default.accessSync(e.fsPath,ci.default.constants.R_OK)}return i=="untitled"?(await this.nvim.command(`edit ${e.path}`),t=await this.documents.document,await this.jumpTo(t.uri),t):(t=await this.loadResource(e.toString()),t&&await this.jumpTo(t.uri),t)}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}=O.parse(e),h=t==null?null:[t.line,t.character];if(c=="file"){let d=bg(ta.default.normalize(u));await this.nvim.call("coc#util#jump",[o,d,h])}else IY.default.platform()=="win32"&&(e=e.replace(/\/?/,"?")),await this.nvim.call("coc#util#jump",[o,e,h])}}async openResource(e){let{nvim:t}=this,i=O.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)}loadResource(e){let t=this.documents.getDocument(e);return t?Promise.resolve(t):this.loadResources([e]).then(i=>Array.isArray(i)?i[0]:void 0)}async loadResources(e){let{documents:t}=this,i=e.map(o=>{let s=O.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 renameCurrent(){let{nvim:e,documents:t}=this,i=await e.call("bufnr","%"),r=await e.call("getcwd"),o=t.getDocument(i);if(!o||o.buftype!=""||o.schema!="file"){e.echoError("current buffer is not file.");return}let s=O.parse(o.uri).fsPath,a=await e.callAsync("coc#util#with_callback",["input",["New path: ",s,"file"]]);if(a=a?a.trim():null,a==s||!a)return;let l=await o.buffer.lines,u=ci.default.existsSync(s);if(u){if(await e.eval("&modified")&&await e.command("noa w"),s.toLowerCase()!=a.toLowerCase()&&ci.default.existsSync(a)){if(!await Tc(this.nvim,`${a} exists, overwrite?`))return;ci.default.unlinkSync(a)}ci.default.renameSync(s,a)}this._onWillRenameFiles.fire({files:[{newUri:O.parse(a),oldUri:O.parse(s)}],waitUntil:async d=>{let g=await Promise.resolve(d);g&&Ht.WorkspaceEdit.is(g)&&await this.applyEdit(g)}}),this._onDidRenameFiles.fire({f
2022-05-18 13:29:28 -04:00
`)!=`
2022-05-19 10:14:37 -04:00
`&&(e.call("append",[0,l],!0),e.command("normal! Gdd",!0)),e.call("winrestview",[h],!0),await e.resumeNotification()}async createFile(e,t={}){let{documents:i}=this,r=await Ot(e);if(r&&!t.overwrite&&!t.ignoreIfExists){tr(this.nvim,`${e} already exists!`,"Error");return}if(!r||t.overwrite)if(e.endsWith("/"))e=i.expand(e),await ci.default.mkdirp(e);else{let o=O.file(e).toString();if(i.getDocument(o))return;ci.default.existsSync(ta.default.dirname(e))||ci.default.mkdirpSync(ta.default.dirname(e)),ci.default.writeFileSync(e,"","utf8"),await this.loadResource(o)}}async deleteFile(e,t={}){let{ignoreIfNotExists:i,recursive:r}=t,o=await Ot(e.replace(/\/$/,"")),s=o&&o.isDirectory();if(e.endsWith("/")&&!s){tr(this.nvim,`${e} is not directory`,"Error");return}if(!o&&!i){tr(this.nvim,`${e} doesn't exist`,"Error");return}if(o!=null){if(s&&!r){tr(this.nvim,"Can't remove directory, recursive not set","Error");return}try{if(s&&r?await ci.default.remove(e):s?await ci.default.rmdir(e):await ci.default.unlink(e),!s){let a=O.file(e).toString(),l=this.documents.getDocument(a);l&&await this.nvim.command(`silent! bwipeout! ${l.bufnr}`)}}catch(a){tr(this.nvim,`Error on delete ${e}: ${a}`,"Error")}}}async renameFile(e,t,i={}){let{overwrite:r,ignoreIfExists:o}=i,{nvim:s,documents:a}=this;try{let l=await Ot(t);if(l&&!r&&!o)throw new Error(`${t} already exists`);if(!l||r){let u=O.file(e).toString(),c=O.file(t).toString(),h=a.getDocument(u);if(h!=null){let d=h.bufnr==a.bufnr,g=a.getDocument(c);g&&await this.nvim.command(`silent ${g.bufnr}bwipeout!`);let f=h.getDocumentContent();if(await ci.default.writeFile(t,f,"utf8"),!d)await s.call("coc#ui#open_files",[[t]]),await s.command(`silent ${h.bufnr}bwipeout!`);else{let p=await s.call("winsaveview");s.pauseNotification(),s.call("coc#util#open_file",["keepalt edit",t],!0),s.command(`silent ${h.bufnr}bwipeout!`,!0),s.call("winrestview",[p],!0),await s.resumeNotification()}await ci.default.unlink(e)}else await w2(e,t)}}catch(l){tr(this.nvim,`Rename error: ${l}`,"Error")}}async currentUri(){let e=await this.nvim.call("bufnr",["%"]),t=this.documents.getDocument(e);return t?t.uri:null}async applyEdit(e){let{nvim:t,documents:i,configurations:r}=this,{documentChanges:o,changes:s}=e,a=await this.currentUri(),l=!1,u=[],c=0,h=r.getConfiguration("coc.preferences"),d=!global.__TEST__&&h.get("promptWorkspaceEdit",!0),g=h.get("listOfWorkspaceEdit","quickfix");try{if(o&&o.length){let f=this.getChangedUris(o);if(c=f.length,d){let b=f.reduce((y,w)=>y+(i.getDocument(w)==null?1:0),0);if(b&&!await Tc(this.nvim,`${b} documents on disk would be loaded for change, confirm?`))return}let p=new Map;for(let b of o)if(Ht.TextDocumentEdit.is(b)){let{textDocument:y,edits:w}=b,D=await this.loadResource(y.uri),T=y.uri===a;T&&(l=!0),await D.applyEdits(w,!1,T);for(let L of w)u.push({uri:D.uri,range:L.range})}else if(Ht.CreateFile.is(b)){let y=O.parse(b.uri).fsPath;await this.createFile(y,b.options)}else Ht.RenameFile.is(b)?(p.set(b.oldUri,b.newUri),await this.renameFile(O.parse(b.oldUri).fsPath,O.parse(b.newUri).fsPath,b.options)):Ht.DeleteFile.is(b)&&await this.deleteFile(O.parse(b.uri).fsPath,b.options);p.size&&u.forEach(b=>{let y=p.get(b.uri);y&&(b.uri=y)})}else if(s){let f=Object.keys(s),p=f.filter(b=>i.getDocument(b)==null);if(p.length){if(d&&!await Tc(this.nvim,`${p.length} documents on disk would be loaded for change, confirm?`))return;await this.loadResources(p)}for(let b of Object.keys(s)){let y=i.getDocument(b),w=O.parse(b).toString()===b;w&&(l=!0);let D=s[b];for(let T of D)u.push({uri:y.uri,range:T.range});await y.applyEdits(D,!1,w)}c=f.length}if(l&&this.nvim.redrawVim(),u.length){let f=await this.documents.getQuickfixList(u),p=u.every(b=>b.uri==a);g=="quickfix"?(await this.nvim.call("setqflist",[f]),p||tr(this.nvim,`changed ${c} buffers, use :wa to save changes to disk and :copen to open quickfix list`,"MoreMsg")):g=="location"&&(await t.setVar("coc_jump_locations",f),p||tr(this.nvim,`changed ${c} buffers, use :wa to save changes to disk and :CocList location to manage changed locations`,"MoreMsg"))}}catch(f){return Lbe.error(
2022-05-18 13:29:28 -04:00
`)),e[e.length-1]==""&&(e=e.slice(0,-1)),ia(e)}catch{return[]}}loadSync(){if(!aa.default.existsSync(this.file))return[];try{let e=aa.default.readFileSync(this.file,"utf8");return e=e.trim(),e.length?e.trim().split(`
`):[]}catch{return[]}}async add(e){let t;try{t=aa.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 aa.default.writeFile(this.file,t,"utf8")}async remove(e){let t=await this.load(),i=t.length;t=t.filter(r=>r!=e),t.length!=i&&await aa.default.writeFile(this.file,t.join(`
2022-05-19 10:14:37 -04:00
`),"utf8")}async clean(){try{await aa.default.unlink(this.file)}catch{}}}});var Ty,ky,_Z=_(()=>{"use strict";Ty=x(H());ce();z();ky=class{constructor(e,t){this.nvim=e;this.id=t;this.disposables=[];this._onExit=new Ty.Emitter;this._onStderr=new Ty.Emitter;this._onStdout=new Ty.Emitter;this.onExit=this._onExit.event;this.onStdout=this._onStdout.event;this.onStderr=this._onStderr.event;E.on("TaskExit",(i,r)=>{i==this.id&&this._onExit.fire(r)},null,this.disposables),E.on("TaskStderr",(i,r)=>{i==this.id&&this._onStderr.fire(r)},null,this.disposables),E.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(),J(this.disposables)}}});var FZ,Pk,la,RZ,LZ,rwe,IZ,v,V=_(()=>{"use strict";FZ=x(Rn()),Pk=x(require("os")),la=x(require("path"));we();mT();eY();iY();oY();yb();sY();LY();AY();gW();wZ();DZ();CZ();Cb();xZ();TZ();EZ();ce();PZ();kk();tf();_Z();z();RZ=29,LZ=Y()("workspace"),rwe=["showMessage","runTerminalCommand","openTerminal","showQuickpick","menuPick","openLocalConfig","showPrompt","createStatusBarItem","createOutputChannel","showOutputChannel","requestInput","echoLines","getCursorPosition","moveTo","getOffset","getSelectedRange","selectRange","createTerminal"],IZ=class{constructor(){this.version=xb;let e=la.default.normalize(process.env.COC_VIMCONFIG)||la.default.join(Pk.default.homedir(),".vim"),t=la.default.join(e,Er);this.configurations=new Zo(t,new Ab(this)),this.workspaceFolderControl=new xy(this.configurations);let i=this.documentsManager=new Xb(this.configurations,this.workspaceFolderControl);this.contentProvider=new Mb(i),this.watchers=new Dy,this.autocmds=new Ob(this.contentProvider,this.watchers),this.keymaps=new vy(i),this.locations=new wy(this.configurations,i,this.contentProvider),this.files=new Ub(i,this.configurations,this.workspaceFolderControl),this.editors=new Cy(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=global.__TEST__?null:this.getWatchmanPath();this.fileSystemWatchers=new Mg(this.workspaceFolderControl,r)}async init(e){let{nvim:t}=this;for(let o of rwe)Object.defineProperty(this,o,{get:()=>(...s)=>{let a=`
2022-05-18 13:29:28 -04:00
`+Error().stack.split(`
`).slice(2,4).join(`
2022-05-19 10:14:37 -04:00
`);return LZ.warn(`workspace.${o} is deprecated, please use window.${o} instead.`,a),e[o].apply(e,s)}});for(let o of["onDidOpenTerminal","onDidCloseTerminal"])Object.defineProperty(this,o,{get:()=>{let s=`
2022-05-18 13:29:28 -04:00
`+Error().stack.split(`
`).slice(2,4).join(`
2022-05-19 10:14:37 -04:00
`);return LZ.warn(`workspace.${o} is deprecated, please use window.${o} instead.`,s),e[o]}});let i=this._env=await t.call("coc#util#vim_info");e.init(i),this._env.apiversion!=RZ&&t.echoError(`API version ${this._env.apiversion} is not ${RZ}, please build coc.nvim by 'yarn install' after pull source code.`),this.workspaceFolderControl.setWorkspaceFolders(this._env.workspaceFolders),this.configurations.updateUserConfig(this._env.config),this.files.attach(t,i),this.contentProvider.attach(t),this.keymaps.attach(t),this.autocmds.attach(t,i),this.locations.attach(t,i),this.watchers.attach(t,i),await this.attach(),await this.editors.attach(t);let r=Wo.create("watchman",t);this.fileSystemWatchers.attach(r)}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 E.insertMode}get floatSupported(){return this.env.floating||this.env.textprop}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}get folderPaths(){return this.workspaceFolders.map(e=>O.parse(e.uri).fsPath)}get channelNames(){return Wo.names}get pluginRoot(){return la.default.dirname(__dirname)}get isVim(){return this._env.isVim}get isNvim(){return!this._env.isVim}get completeOpt(){return this._env.completeOpt}get filetypes(){return this.documentsManager.filetypes}get languageIds(){return this.documentsManager.languageIds}createNameSpace(e){return mZ(e)}getConfigFile(e){return this.configurations.getConfigFile(e)}has(e){return pZ(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 Sk(e,t.uri,t.languageId)}createFileSystemWatcher(e,t,i,r){return this.fileSystemWatchers.createFileSystemWatcher(e,t,i,r)}getWatchmanPath(){return bZ(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, try :CocCommand document.checkBuffer`);return t}getQuickfixItem(e,t,i="",r){return this.documentsManager.getQuickfixItem(e,t,i,r)}createMru(e){return new to(e)}async getQuickfixList(e){return this.documentsManager.getQuickfixList(e)}async showLocations(e){await this.locations.showLocations(e)}getLine(e,t){return this.documentsManager.getLine(e,t)}getWorkspaceFolder(e){return this.workspaceFolderControl.getWorkspaceFolder(O.parse(e))}readFile(e){return this.documentsManager.readFile(e)}async getCurrentState(){let e=await this.document,t=await Db(this.nvim);return{document:e.textDocument,position:t}}async getFormatOptions(e){return this.documentsManager.getFormatOptions(e)}resolveModule(e){return vZ(e)}async runCommand(e,t,i){return t=t||this.cwd,Gr(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.registerExprKeymap(e,t,i,r)}registerLocalKeymap(e,t,i,r=!1){return this.keymaps.registerLocalKeymap(e,t,i,r)}createTask(e){return new ky(this.nvim,e)}createDatabase(e){let t;global.hasOwnProperty("__TEST__")?(t=la.default.join(Pk.default.tmpdir(),`coc-${process.pid}`),FZ.default.mkdirpSync(t)):t=la.defau
`,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}};hv.parse=(n,e,t)=>new hv(uDe(cDe(n),e),t);var uDe=(n,e)=>e?Object.keys(n).reduce((t,i)=>(t[i]=n[i],t),e):n,cDe=n=>n.replace(/\n$/,"").split(`
`).reduce(hDe,Object.create(null)),hDe=(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};_$.exports=hv});var Gc=m((wBe,R$)=>{R$.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 gv=m((DBe,L$)=>{"use strict";L$.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 lE=m((CBe,F$)=>{"use strict";var fv=["|","<",">","?",":"],aE=fv.map(n=>String.fromCharCode(61440+n.charCodeAt(0))),dDe=new Map(fv.map((n,e)=>[n,aE[e]])),gDe=new Map(aE.map((n,e)=>[n,fv[e]]));F$.exports={encode:n=>fv.reduce((e,t)=>e.split(t).join(dDe.get(t)),n),decode:n=>aE.reduce((e,t)=>e.split(t).join(gDe.get(t)),n)}});var uE=m((xBe,j$)=>{var{isAbsolute:fDe,parse:I$}=require("path").win32;j$.exports=n=>{let e="",t=I$(n);for(;fDe(n)||t.root;){let i=n.charAt(0)==="/"&&n.slice(0,4)!=="//?/"?"/":t.root;n=n.substr(i.length),e+=i,t=I$(n)}return[e,n]}});var O$=m((SBe,A$)=>{"use strict";A$.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 yE=m((EBe,K$)=>{"use strict";var W$=Zc(),Z$=dv(),J$=Uc(),no=require("fs"),M$=require("path"),io=$c(),pDe=Gc(),$$=(n,e)=>e?(n=io(n).replace(/^\.(\/|$)/,""),pDe(e)+"/"+n):io(n),mDe=16*1024*1024,N$=Symbol("process"),B$=Symbol("file"),H$=Symbol("directory"),hE=Symbol("symlink"),q$=Symbol("hardlink"),hf=Symbol("header"),pv=Symbol("read"),dE=Symbol("lstat"),mv=Symbol("onlstat"),gE=Symbol("onread"),fE=Symbol("onreadlink"),pE=Symbol("openfile"),mE=Symbol("onopenfile"),fa=Symbol("close"),bv=Symbol("mode"),bE=Symbol("awaitDrain"),cE=Symbol("ondrain"),ro=Symbol("prefix"),Y$=Symbol("hadError"),X$=gv(),bDe=lE(),U$=uE(),G$=O$(),yv=X$(class extends W${constructor(e,t){t=t||{};super(t);if(typeof e!="string")throw new TypeError("path is required");this.path=io(e),this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid()||0,this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||mDe,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=io(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?io(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]=U$(this.path);r&&(this.path=o,i=r)}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=bDe.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=io(t.absolute||M$.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[mv](this.statCache.get(this.absolute)):this[dE]()}emit(e,...t){return e==="error"&&(this[Y$]=!0),super.emit(e,...t)}[dE](){no.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[mv](t)})}[mv](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=vDe(e),this.emit("stat",e),this[N$]()}[N$](){switch(this.type){case"File":return this[B$]();case"Directory":return this[H$]();case"SymbolicLink":return this[hE]();default:return this.end()}}[bv](e){return G$(e,this.type==="Directory",this.portable)}[ro](e){return $$(e,this.prefix)}[hf](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new J$({path:this[ro](this.path),linkpat
`).some(e=>e.indexOf("(https.js:")!==-1||e.indexOf("node:https:")!==-1)}function zv(n,e){return new zv.Agent(n,e)}(function(n){class e extends jxe.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:mP()?443:80}set defaultPort(i){this.explicitDefaultPort=i}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:mP()?"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=mP()),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),Mxe(g)){kf("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 f=new Error(`no Duplex stream was returned to agent-base for \`${i.method} ${i.path}\``);u(f)};if(typeof this.callback!="function"){u(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(kf("Converting legacy callback function to promise"),this.promisifiedCallback=Oxe.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{kf("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){kf("Freeing socket %o %o",i.constructor.name,r),i.destroy()}destroy(){kf("Destroying agent %o",this.constructor.name)}}n.Agent=e,n.prototype=n.Agent.prototype})(zv||(zv={}));L8.exports=zv});var I8=m(ql=>{"use strict";var Nxe=ql&&ql.__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())})},Ef=ql&&ql.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(ql,"__esModule",{value:!0});var Bxe=Ef(require("net")),Hxe=Ef(require("tls")),vP=Ef(require("url")),qxe=Ef(It()),Yxe=Ef(P8()),Wxe=yP(),Ta=(0,qxe.default)("http-proxy-agent");function Zxe(n){return typeof n=="string"?/^https:?$/i.test(n):!1}var F8=class extends Wxe.Agent{constructor(e){let t;if(typeof e=="string"?t=vP.default.parse(e):t=e,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");Ta("Creating new HttpProxyAgent instance: %o",t);super(t);let i=Object.assign({},t);this.secureProxy=t.secureProxy||Zxe(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 Nxe(this,void 0,void 0,function*(){let{proxy:i,secureProxy:r}=this,o=vP.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)
2022-05-18 13:29:28 -04:00
\r
2022-05-19 10:14:37 -04:00
`)+4,e.output[0]=e._header+a.substring(l),Ta("Output buffer: %o",e.output)):e.outputData&&e.outputData.length>0&&(Ta("Patching connection write() output buffer with updated header"),a=e.outputData[0].data,l=a.indexOf(`\r
2022-05-18 13:29:28 -04:00
\r
2022-05-19 10:14:37 -04:00
`)+4,e.outputData[0].data=e._header+a.substring(l),Ta("Output buffer: %o",e.outputData[0].data))}return yield(0,Yxe.default)(s,"connect"),s})}};ql.default=F8});var A8=m((CP,j8)=>{"use strict";var Jxe=CP&&CP.__importDefault||function(n){return n&&n.__esModule?n:{default:n}},wP=Jxe(I8());function DP(n){return new wP.default(n)}(function(n){n.HttpProxyAgent=wP.default,n.prototype=wP.default.prototype})(DP||(DP={}));j8.exports=DP});var O8=m(_f=>{"use strict";var $xe=_f&&_f.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(_f,"__esModule",{value:!0});var Xxe=$xe(It()),Pf=Xxe.default("https-proxy-agent:parse-proxy-response");function Uxe(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){Pf("onclose had error %o",h)}function l(){Pf("onend")}function u(h){s(),Pf("onerror %o",h),t(h)}function c(h){r.push(h),i+=h.length;let d=Buffer.concat(r,i);if(d.indexOf(`\r
2022-05-18 13:29:28 -04:00
\r
2022-05-19 10:14:37 -04:00
`)===-1){Pf("have not received end of HTTP headers yet..."),o();return}let f=d.toString("ascii",0,d.indexOf(`\r
`)),p=+f.split(" ")[1];Pf("got proxy server response: %o",f),e({statusCode:p,buffered:d})}n.on("error",u),n.on("close",a),n.on("end",l),o()})}_f.default=Uxe});var H8=m(Yl=>{"use strict";var Gxe=Yl&&Yl.__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())})},dh=Yl&&Yl.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Yl,"__esModule",{value:!0});var M8=dh(require("net")),N8=dh(require("tls")),Qxe=dh(require("url")),Kxe=dh(require("assert")),zxe=dh(It()),Vxe=yP(),eSe=dh(O8()),Rf=zxe.default("https-proxy-agent:agent"),B8=class extends Vxe.Agent{constructor(e){let t;if(typeof e=="string"?t=Qxe.default.parse(e):t=e,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");Rf("creating new HttpsProxyAgent instance: %o",t);super(t);let i=Object.assign({},t);this.secureProxy=t.secureProxy||nSe(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 Gxe(this,void 0,void 0,function*(){let{proxy:i,secureProxy:r}=this,o;r?(Rf("Creating `tls.Socket`: %o",i),o=N8.default.connect(i)):(Rf("Creating `net.Socket`: %o",i),o=M8.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;iSe(c,h)||(u+=`:${c}`),s.Host=u,s.Connection="close";for(let b of Object.keys(s))l+=`${b}: ${s[b]}\r
`;let d=eSe.default(o);o.write(`${l}\r
`);let{statusCode:g,buffered:f}=yield d;if(g===200){if(e.once("socket",tSe),t.secureEndpoint){let b=t.servername||t.host;if(!b)throw new Error('Could not determine "servername"');return Rf("Upgrading socket connection to TLS"),N8.default.connect(Object.assign(Object.assign({},rSe(t,"host","hostname","path","port")),{socket:o,servername:b}))}return o}o.destroy();let p=new M8.default.Socket;return p.readable=!0,e.once("socket",b=>{Rf("replaying proxy buffer for failed request"),Kxe.default(b.listenerCount("data")>0),b.push(f),b.push(null)}),p})}};Yl.default=B8;function tSe(n){n.resume()}function iSe(n,e){return Boolean(!e&&n===80||e&&n===443)}function nSe(n){return typeof n=="string"?/^https:?$/i.test(n):!1}function rSe(n,...e){let t={},i;for(i in n)e.includes(i)||(t[i]=n[i]);return t}});var Y8=m((TP,q8)=>{"use strict";var oSe=TP&&TP.__importDefault||function(n){return n&&n.__esModule?n:{default:n}},xP=oSe(H8());function SP(n){return new xP.default(n)}(function(n){n.HttpsProxyAgent=xP.default,n.prototype=xP.default.prototype})(SP||(SP={}));q8.exports=SP});var Z8=m((fHe,W8)=>{"use strict";var sSe=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];W8.exports=(n,e)=>{if(e._readableState.autoDestroy)throw new Error("The second stream must have the `autoDestroy` option set to `false`");let t=new Set(Object.keys(n).concat(sSe)),i={};for(let r of t)r in e||(i[r]={get(){let o=n[r];return typeof o=="function"?o.bind(n):o},set(o){n[r]=o},enumerable:!0,configurable:!1});return Object.defineProperties(e,i),n.once("aborted",()=>{e.destroy(),e.emit("aborted")}),n.once("close",()=>{n.complete&&e.readable?e.once("end",()=>{e.emit("close")}):e.emit("close")}),e}});var $8=m((pHe,J8)=>{"use strict";var{Transform:aSe,PassThrough:lSe}=require("stream"),kP=require("zlib"),uSe=Z8();J8.exports=n=>{let e=(n.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(e))return n;let t=e==="br";if(t&&typeof kP.createBrotliDecompress!="function")return n.destroy(new Error("Brotli is not supported on Node.js < 12")),n;let i=!0,r=new aSe({transform(a,l,u){i=!1,u(null,a)},flush(a){a()}}),o=new lSe({autoDestroy:!1,destroy(a,l){n.destroy(),l(a)}}),s=t?kP.createBrotliDecompress():kP.createUnzip();return s.once("error",a=>{if(i&&!n.readable){o.end();return}o.destroy(a)}),uSe(n,o),n.pipe(r).pipe(s).pipe(o),o}});function cSe(n){let e;n.protocol==="http:"?e=process.env.HTTP_PROXY||process.env.http_proxy||null:n.protocol==="https:"&&(e=process.env.HTTPS_PROXY||process.env.https_proxy||process.env.HTTP_PROXY||process.env.http_proxy||null);let t=process.env.NO_PROXY||process.env.no_proxy;if(t==="*")e=null;else if(t){let i=n.hostname.replace(/^\.*/,".").toLowerCase(),r=n.port||n.protocol.startsWith("https")?"443":"80",o=t.split(",");for(let s=0,a=o.length;s<a;s++){let l=o[s].trim().toLowerCase();if(l.includes(":")){let u=l.split(":",2),c=u[0].replace(/^\.*/,"."),h=u[1];if(r===h&&i.endsWith(c)){e=null;break}}else if(l=l.replace(/^\.*/,"."),i.endsWith(l)){e=null;break}}}return e}function hSe(n,e){let t=e.proxyUrl||cSe(n);if(t){let i=(0,EP.parse)(t);if(!/^https?:$/.test(i.protocol))return null;let r={host:i.hostname,port:i.port?Number(i.port):i.protocol==="https"?"443":"80",auth:i.auth,rejectUnauthorized:typeof e.strictSSL=="boolean"?e.strictSSL:!0};return z8.info(`Using proxy ${t} from ${e.proxyUrl?"configuration":"system environment"} for ${n.hostname}:`),n.protocol==="http:"?(0,G8.default)(r):(0,Q8.default)(r)}return null}function PP(n,e={}){let t=v.getConfiguration("http"),{data:i}=e,r=gSe(i),o={proxyUrl:t.get("proxy",""),strictSSL:t.get("proxyStrictSSL",!0),proxyAuthorization:t.get("proxyAuthorization",null),proxyCA:t.get("proxyCA",null)};e.query&&!n.includes("?")&&(n=`${n}?${(0,U8.stringify)(e.query)}`);let s=Object.assign(e.headers||{},{"Proxy-Authorization":o.proxyAuthorization}),a=(0,EP.parse)(n),l=hSe(a,o),u={method:e.method||"GET",hostname:a.hostname,port:a.port?parseInt(a.port,10):a.protocol==="
`)){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=mc(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(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})}}});function FP(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}var uG=_(()=>{"use strict"});var aw,cG=_(()=>{"use strict";we();uG();aw=class{constructor(e,t){if(typeof e!="string"&&(!e||!O.isUri(e)&&typeof e.uri!="string"))throw FP("base");if(typeof t!="string")throw FP("pattern");typeof e=="string"?this.baseUri=O.file(e):O.isUri(e)?this.baseUri=e:this.baseUri=O.parse(e.uri),this.pattern=t}toJSON(){return{pattern:this.pattern,baseUri:this.baseUri.toJSON()}}}});var dG=m((ZHe,hG)=>{"use strict";hG.exports=H()});function gG(n,e){if(!n.killed)if(DSe)try{let t={stdio:["pipe","pipe","ignore"]};return e&&(t.cwd=e),If.execFileSync("taskkill",["/T","/F","/PID",n.pid.toString()],t),!0}catch{return!1}else if(xSe||CSe)try{let t=(0,lw.join)(SSe,"bin/terminateProcess.sh");return!If.spawnSync(t,[n.pid.toString()]).error}catch{return!1}else return n.kill("SIGKILL"),!0}var If,lw,DSe,CSe,xSe,SSe,fG=_(()=>{"use strict";If=x(require("child_process")),lw=require("path"),DSe=process.platform==="win32",CSe=process.platform==="darwin",xSe=process.platform==="linux",SSe=(0,lw.dirname)(__dirname)});var pG,iqe,jf,IP=_(()=>{"use strict";pG=x(H());z();ke();"use strict";iqe=Y()("language-client-progressPart"),jf=class{constructor(e,t,i){this.client=e;this.token=t;this.disposables=[];this._cancelled=!1;this.statusBarItem=k.createStatusBarItem(99,{progress:!0}),this.disposables.push(e.onProgress(pG.WorkDoneProgress.type,this.token,r=>{switch(r.kind){case"begin":this.begin(r);break;case"report":this.report(r);break;case"end":this.done(r.message),i&&i(this);break}}))}begin(e){typeof this.title!="string"&&(this.title=e.title,this.report(e))}report(e){let t=this.statusBarItem,i=[];this.title&&i.push(this.title),typeof e.percentage=="number"&&i.push(e.percentage.toFixed(0)+"%"),e.message&&i.push(e.message),t.text=i.join(" "),t.show()}cancel(){this._cancelled||(this._cancelled=!0,J(this.disposables))}done(e){if(this._cancelled)return;let t=this.statusBarItem;t.text=`${this.title} ${e||"finished"}`,setTimeout(()=>{t.dispose()},300),this.cancel()}}});var jP,AP,mG=_(()=>{"use strict";jP=x(H()),AP=class{constructor(e){this.defaultDelay=e,this.timeout=void 0,this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0}trigger(e,t=this.defaultDelay){return this.task=e,t>=0&&this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise(i=>{this.onSuccess=i}).then(()=>{this.completionPromise=void 0,this.onSuccess=void 0;let i=this.task();return this.task=void 0,i})),(t>=0||this.timeout===void 0)&&(this.timeout=(0,jP.RAL)().timer.setTimeout(()=>{this.timeout=void 0,this.onSuccess(void 0)},t>=0?t:this.defaultDelay)),this.completionPromise}forceDelivery(){if(!this.completionPromise)return;this.cancelTimeout();let e=this.task();return this.completionPromise=void 0,this.onSuccess=void 0,this.task=void 0,e}isTriggered(){return this.timeout!==void 0}cancel(){this.cancelTimeout(),this.completionPromise=void 0}dispose(){this.cancelTimeout()}cancelTimeout(){this.timeout!==void 0&&((0,jP.RAL)().timer.clearTimeout(this.timeout),this.timeout=void 0)}}});function bG(n){return{uri:n.uri,languageId:n.languageId,version:n.version,text:n.getText()}}function yG(n){return{textDocument:{uri:n.uri}}}function vG(n){return{textDocument:{uri:n.uri,version:n.version},contentChanges:[{text:n.getText()}]}}function OP(n){return{textDocument:uw(n.document),reason:n.reason}}function uw(n){return{uri:n.uri,version:n.version}}function wG(n,e){let t={textDocument:uw(n)};return e&&(t.text=n.getText()),t}function Af(n){return n.toString()}function DG(n,e,t){return{textDocument:{uri:n.uri},position:e,context:Ki(t,["option"])}}function wn(n,e){return{textDocument:{uri:n.uri},position:e}}function CG(n,e,t){return{textDocument:Zl(n),position:e,context:t}}function Zl(n){return{uri:n.uri}}function xG(n,e,t){return{textDocument:{
2022-05-18 13:29:28 -04:00
`+Error().stack.split(`
`).slice(2,4).join(`
2022-05-19 10:14:37 -04:00
`);if(lo.warn(`${u} in the client options is deprecated. use disabledFeatures instead.`,c),this.warn(`${u} in the client options is deprecated. use disabledFeatures instead.`,c),i[u]===!0){let h=u.slice(7);this._clientOptions.disabledFeatures.push(h[0].toLowerCase()+h.slice(1))}}this.state=0,this._connectionPromise=void 0,this._resolvedConnection=void 0,this._initializeResult=void 0,this._listeners=void 0,this._providers=void 0,this._diagnostics=void 0,this._fileEvents=[],this._fileEventDelayer=new AP(250),this._onReady=new Promise((u,c)=>{this._onReadyCallbacks=new HP(u,c)}),this._onStop=void 0,this._stateChangeEmitter=new C.Emitter,this._trace=C.Trace.Off,this._tracer={log:(u,c)=>{Ee(u)?this.logTrace(u,c):this.logObjectTrace(u)}},this._syncedDocuments=new Map;let a=v.getConfiguration("coc.preferences");this._markdownSupport=a.get("enableMarkdown",!0),this.registerBuiltinFeatures()}get supportedMarkupKind(){return this._markdownSupport?[C.MarkupKind.Markdown,C.MarkupKind.PlainText]:[C.MarkupKind.PlainText]}get state(){return this._state}get id(){return this._id}get name(){return this._name}set state(e){let t=this.getPublicState();this._state=e;let i=this.getPublicState();i!==t&&this._stateChangeEmitter.fire({oldState:t,newState:i})}getPublicState(){return this.state===3?2:this.state===1?3:1}get initializeResult(){return this._initializeResult}sendRequest(e,...t){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");try{return this._resolvedConnection.sendRequest(e,...t)}catch(i){throw this.error(`Sending request ${Ee(e)?e:e.method} failed.`,i),i}}onRequest(e,t){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");try{return this._resolvedConnection.onRequest(e,t)}catch(i){throw this.error(`Registering request handler ${Ee(e)?e:e.method} failed.`,i),i}}sendNotification(e,t){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");try{this._resolvedConnection.sendNotification(e,t)}catch(i){throw this.error(`Sending notification ${Ee(e)?e:e.method} failed.`,i),i}}onNotification(e,t){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");try{return this._resolvedConnection.onNotification(e,t)}catch(i){throw this.error(`Registering notification handler ${Ee(e)?e:e.method} failed.`,i),i}}onProgress(e,t,i){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");try{if(e==C.WorkDoneProgress.type){let r=this._clientOptions.middleware.handleWorkDoneProgress;if(r!==void 0)return this._resolvedConnection.onProgress(e,t,o=>{r(t,o,()=>i(o))})}return this._resolvedConnection.onProgress(e,t,i)}catch(r){throw this.error(`Registering progress handler for token ${t} failed.`,r),r}}sendProgress(e,t,i){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");try{this._resolvedConnection.sendProgress(e,t,i)}catch(r){throw this.error(`Sending progress for token ${t} failed.`,r),r}}get clientOptions(){return this._clientOptions}get onDidChangeState(){return this._stateChangeEmitter.event}get outputChannel(){if(!this._outputChannel){let{outputChannelName:e}=this._clientOptions;this._outputChannel=k.createOutputChannel(e||this._name)}return this._outputChannel}get diagnostics(){return this._diagnostics}createDefaultErrorHandler(e){return new PG(this._id,e!=null?e:4)}set trace(e){this._trace=e,this.onReady().then(()=>{this.resolveConnection().then(t=>{t.trace(this._trace,this._tracer,{sendNotification:!1,traceFormat:this._traceFormat})})},()=>{})}logObjectTrace(e){e.isLSPMessage&&e.type?this.outputChannel.append(`[LSP - ${new Date().toLocaleTimeString()}] `):this.outputChannel.append(`[Trace - ${new Date().toLocaleTimeString()}] `),e&&this.outputChannel.appendLine(`${JSON.stringify(e)}`)}data2String(e){if(e instanceof C.ResponseError){let t=e;return` Message: ${t.message}
2022-05-18 13:29:28 -04:00
Code: ${t.code} ${t.data?`
2022-05-19 10:14:37 -04:00
`+t.data.toString():""}`}return e instanceof Error?Ee(e.stack)?e.stack:e.message:Ee(e)?e:e.toString()}_appendOutput(e,t,i){let r=3;switch(e){case"Info":r=1;break;case"Warn":r=2;break}this.outputChannel.appendLine(`[${e} - ${new Date().toLocaleTimeString()}] ${t}`);let o;i&&(o=this.data2String(i),this.outputChannel.appendLine(o)),this._clientOptions.revealOutputChannelOn<=r&&this.outputChannel.show(!0)}info(e,t){this._appendOutput("Info",e,t)}warn(e,t){this._appendOutput("Warn",e,t)}error(e,t){this._appendOutput("Error",e,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}onReady(){return this._onReady}get started(){return this.state!=0}isConnectionActive(){return this.state===3&&!!this._resolvedConnection}start(){if(this._rootPath=this.resolveRootPath(),this._rootPath===!1)return this.warn("Required root pattern not resolved, server won't start."),C.Disposable.create(()=>{});if(this._onReadyCallbacks.isUsed&&(this._onReady=new Promise((e,t)=>{this._onReadyCallbacks=new HP(e,t)})),this._listeners=[],this._providers=[],!this._diagnostics){let e=this._clientOptions,t=e.diagnosticCollectionName?e.diagnosticCollectionName:this._id;e.disabledFeatures.includes("diagnostics")||(this._diagnostics=j.createDiagnosticCollection(t))}return this.state=1,this.resolveConnection().then(e=>(e.onLogMessage(t=>{let i;switch(t.type){case C.MessageType.Error:i="error",this.error(t.message);break;case C.MessageType.Warning:i="warning",this.warn(t.message);break;case C.MessageType.Info:i="info",this.info(t.message);break;default:i="log",this.outputChannel.appendLine(t.message)}if(global.hasOwnProperty("__TEST__")){console.log(`[${i}] ${t.message}`);return}}),e.onShowMessage(t=>{switch(t.type){case C.MessageType.Error:k.showErrorMessage(t.message);break;case C.MessageType.Warning:k.showWarningMessage(t.message);break;case C.MessageType.Info:k.showInformationMessage(t.message);break;default:k.showInformationMessage(t.message)}}),e.onRequest(C.ShowMessageRequest.type,t=>{let i;switch(t.type){case C.MessageType.Error:i=k.showErrorMessage.bind(k);break;case C.MessageType.Warning:i=k.showWarningMessage.bind(k);break;case C.MessageType.Info:i=k.showInformationMessage.bind(k);break;default:i=k.showInformationMessage.bind(k)}let r=t.actions||[];return i(t.message,...r).then(o=>o==null?null:o)}),e.onRequest(C.ShowDocumentRequest.type,async t=>{var o;let i=async s=>{try{if(s.external===!0||/^https?:\/\//.test(s.uri))return await v.openResource(s.uri),{success:!0};{let{selection:a,takeFocus:l}=s;return l===!1?await v.loadFile(s.uri):(await v.jumpTo(s.uri,a==null?void 0:a.start),De(a.start,a.end)!=0&&await k.selectRange(a)),{success:!0}}}catch{return{success:!0}}},r=(o=this._clientOptions.middleware.window)==null?void 0:o.showDocument;return r!==void 0?r(t,i):i(t)}),e.onTelemetry(t=>{}),e.listen(),this.initialize(e))).then(void 0,e=>{this.state=2,this._onReadyCallbacks.reject(e),this.error("Starting client failed ",e)}),C.Disposable.create(()=>{this.needsStop()&&this.stop()})}resolveConnection(){return this._connectionPromise||(this._connectionPromise=this.createConnection()),this._connectionPromise}resolveRootPath(){if(this._clientOptions.workspaceFolder)return O.parse(this._clientOptions.workspaceFolder.uri).fsPath;let{ignoredRootPaths:e}=this._clientOptions,t=v.getConfiguration(this.id),i=t.get("rootPatterns",[]),r=t.get("requireRootPattern",!1),o;if(i&&i.length){let a=v.getDocument(v.bufnr);if(a&&a.schema=="file"){let l=NP.default.dirname(O.parse(a.uri).fsPath);o=db(l,i,v.cwd)}}if(r&&!o)return!1;let s=o||v.rootPath||v.cwd;return ei(s,kG.default.homedir())||Array.isArray(e)&&e.some(a=>ei(s,a))?(this.warn(`Ignored rootPath ${s} of client "${this._id}"`),null):s}initialize(e){let{initializationOptions:t,progressOnInitialization:i}=this._clientOptions;this.refreshTrace(e,!1);let r=this._rootPath,o={processId:process.pid,rootPath:r||null,ro
2022-05-18 13:29:28 -04:00
Related diagnostics:
2022-05-19 10:14:37 -04:00
`;for(let l of s.relatedInformation){let u=NP.default.basename(O.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(C.Diagnostic.create(l.location.range,l.message,C.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)}createConnection(){let e=(i,r,o)=>{lo.error("connection error:",i,r),this.handleConnectionError(i,r,o)},t=()=>{this.handleConnectionClosed()};return this.createMessageTransports(this._clientOptions.stdioEncoding||"utf8").then(i=>TSe(i.reader,i.writer,e,t,this._clientOptions.connectionOptions))}handleConnectionClosed(){if(this.state===5){lo.debug(`client ${this._id} normal close`);return}try{this._resolvedConnection&&this._resolvedConnection.dispose()}catch{}let e=1;if(this.state!==4)try{e=this._clientOptions.errorHandler.closed()}catch{}this._connectionPromise=void 0,this._resolvedConnection=void 0,e===1?(this.error("Connection to server got closed. Server will not be restarted."),this.state===1?(this._onReadyCallbacks.reject(new Error("Connection to server got closed. Server will not be restarted.")),this.state=2):this.state=5,this.cleanUp(!1,!0)):e===2&&(this.info("Connection to server got closed. Server will restart."),this.cleanUp(!1,!0),this.state=0,this.start())}restart(){this.cleanUp(!0,!1),this.start()}handleConnectionError(e,t,i){this._clientOptions.errorHandler.error(e,t,i)===2&&(this.error("Connection to server is erroring. Shutting down server."),this.stop())}hookConfigurationChanged(e){v.onDidChangeConfiguration(t=>{t.affectsConfiguration(this._id)&&this.refreshTrace(e,!0)},null,this._listeners)}refreshTrace(e,t=!1){let i=v.getConfiguration(this._id),r=C.Trace.Off,o=C.TraceFormat.Text;if(i){let s=i.get("trace.server","off");typeof s=="string"?r=C.Trace.fromString(s):(r=C.Trace.fromString(i.get("trace.server.verbosity","off")),o=C.TraceFormat.fromString(i.get("trace.server.format","text")))}t&&this._trace==r&&this._traceFormat==o||(this._trace=r,this._traceFormat=o,e.trace(this._trace,this._tracer,{sendNotification:t,traceFormat:this._traceFormat}))}hookFileEvents(e){let t=this._clientOptions.synchronize.fileEvents;if(!t)return;let i;Array.isArray(t)?i=t:i=[t],i&&this._dynamicFeatures.get(C.DidChangeWatchedFilesNotification.type.method).registerRaw(qe(),i)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),BP.is(e)){let t=e.registrationType;this._dynamicFeatures.set(t.method,e)}}getFeature(e){return this._dynamicFeatures.get(e)}registerBuiltinFeatures(){let{disabledFeatures:e}=this._clientOptions;e.includes("configuration")||this.registerFeature(new e6(this)),this.registerFeature(new LG(this,this._syncedDocuments)),this.registerFeature(new IG(this)),this.registerFeature(new FG(this,this._syncedDocuments)),e.includes("willSave")||this.registerFeature(new jG(this)),e.includes("willSaveWaitUntil")||this.registerFeature(new AG(this)),e.includes("didSave")||this.registerFeature(new OG(this)),e.includes("fileSystemWatcher")||this.registerFeature(new MG(this,t=>this.notifyFileEvent(t))),e.includes("completion")||this.registerFeature(new BG(this)),e.includes("hover")||this.registerFeature(new HG(this)),e.includes("signatureHelp")||this.registerFeature(new qG(this)),e.includes("references")||this.registerFeature(new WG(this)),e.includes("definition")||this.registerFeature(new YG(this)),e.includes("documentHighlight")||this.registerFeature(new ZG(this)),e.includes("documentSymbol")||this.registerFeature(new JG(this)),e.includes("codeAction")||this.registerFeature(new XG(this)),e.includes("workspaceSymbol")||this.registerFeature(new $G(this)),e.includes("codeLens")||this.registerFeature(new UG(this)),e.includes("documentFormatting")||this.registerFeature(new GG(this)),e.includes("documentRangeFormatting")||this.registerFeature(new QG(this)),e.includes("documentOnTypeFormatting")||this.registerFeature(new KG(this)),e.includes("rename")||this.registerFeature(new zG(this)),e.includes("documentLink")||this.registerFeature(new VG(this)),e.includes("executeCommand")||this.registerFeature(new t6(this))}fillIni
2022-05-18 13:29:28 -04:00
`)?i:i+`
2022-05-19 10:14:37 -04:00
`)}},p_=class{constructor(e,t){this._client=e;this._setting=t;this._listeners=[]}start(){return v.onDidChangeConfiguration(e=>{e.affectsConfiguration(this._setting)&&this.onDidChangeConfiguration()},null,this._listeners),this.onDidChangeConfiguration(),{dispose:()=>{J(this._listeners),this._client.needsStop()&&this._client.stop()}}}onDidChangeConfiguration(){let e=this._setting.indexOf("."),t=e>=0?this._setting.substr(0,e):this._setting,i=e>=0?this._setting.substr(e+1):void 0,r=i?v.getConfiguration(t).get(i,!0):v.getConfiguration(t);r&&this._client.needsStart()?this._client.start():!r&&this._client.needsStop()&&this._client.stop()}},PSe={createAll:n=>[]}});function _Se(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"}}function RSe(n){let e=n.map(t=>typeof t=="string"?t:t.language);return e=e.filter(t=>typeof t=="string"),Array.from(new Set(e))}function LSe(n,e,t){let{command:i,module:r,port:o,args:s,filetypes:a}=t;if(s=s||[],!a)return k.showMessage(`Wrong configuration of LS "${e}", filetypes not found`,"error"),null;if(!i&&!r&&!o)return k.showMessage(`Wrong configuration of LS "${e}", no command or module specified.`,"error"),null;let l;if(r){if(r=v.expand(r),!x6.default.existsSync(r))return k.showMessage(`Module file "${r}" not found for LS "${e}"`,"error"),null;l={module:r,runtime:t.runtime||process.execPath,args:s,transport:ISe(t),options:jSe(t)}}else i?l={command:i,args:s,options:ASe(t)}:o&&(l=()=>new Promise((g,f)=>{let p=new S6.default.Socket,b=t.host||"127.0.0.1";Ul.info(`languageserver "${n}" connecting to ${b}:${o}`),p.connect(o,b,()=>{g({reader:p,writer:p})}),p.on("error",y=>{f(new Error(`Connection error for ${n}: ${y.message}`))})}));let u=Array.from(t.disabledFeatures||[]);for(let g of["disableWorkspaceFolders","disableCompletion","disableDiagnostics"])if(t[g]===!0){let f=g.slice(7);u.push(f[0].toLowerCase()+f.slice(1))}let c=!!t.disableSnippetCompletion;return[{ignoredRootPaths:(t.ignoredRootPaths||[]).map(g=>v.expand(g)),disableSnippetCompletion:c,disableDynamicRegister:!!t.disableDynamicRegister,disabledFeatures:u,formatterPriority:t.formatterPriority||0,documentSelector:k6(t.filetypes,t.additionalSchemes),revealOutputChannelOn:FSe(t.revealOutputChannelOn),synchronize:{configurationSection:`${n}.settings`},diagnosticCollectionName:e,outputChannelName:n,stdioEncoding:t.stdioEncoding||"utf8",progressOnInitialization:t.progressOnInitialization!==!1,initializationOptions:t.initializationOptions||{}},l]}function FSe(n){switch(n){case"info":return 1;case"warn":return 2;case"error":return 3;case"never":return 4;default:return 4}}function k6(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 ISe(n){let{transport:e,transportPort:t}=n;return!e||e=="ipc"?1:e=="stdio"?0:e=="pipe"?2:{kind:3,port:t}}function jSe(n){return{cwd:n.cwd,execArgv:n.execArgv||[],env:n.env||void 0}}function ASe(n){return{cwd:n.cwd,detached:!!n.detached,shell:!!n.shell,env:n.env||void 0}}function D6(n){switch(n){case 2:return"running";case 3:return"starting";case 1:return"stopped";default:return"unknown"}}var C6,x6,S6,yh,Ul,T6,Mi,Hf=_(()=>{"use strict";C6=require("events"),x6=x(require("fs")),S6=x(require("net")),yh=x(H());m_();Lr();z();ke();V();Ul=Y()("services");T6=class extends C6.EventEmitter{constructor(){super(...arguments);this.registered=new Map;this.disposables=[]}init(){v.onDidOpenTextDocument(e=>{this.start(e)},null,this.disposables),v.onDidChangeConfiguration(e=>{e.affectsConfiguration("languageserver")&&this.createCustomServices()},null,this.disposables),this.createCustomServices()}dispose(){this.removeAllListeners(),J(this.disposables);for(let e of this.registered.values())e.dispose()}regist(e){let{id:t}=e;if(t||Ul.error("invalid service configuration. ",e.name),!this.registered.get(t))return this.registered.set(t,e),Ul.info(`registered service "${t}"`),this.shouldStart(e)&&e.start(),e.state==3&&thi
`),"error"),!1):!0}waitClient(e){let t=this.getService(e);return t&&t.state==3?Promise.resolve():t?new Promise(i=>{t.onServiceReady(()=>{i()})}):new Promise(i=>{let r=o=>{(o==e||o==`languageserver.${e}`)&&(this.off("ready",r),i())};this.on("ready",r)})}async registNotification(e,t){await this.waitClient(e);let i=this.getService(e);if(!i.client){k.showMessage(`Not a language client: ${e}`,"error");return}i.client.onNotification(t,async o=>{v.nvim.call("coc#do_notify",[e,t,o],!0)})}async sendNotification(e,t,i){if(!t)throw new Error("method required for ontification");let r=this.getService(e);if(!r||!r.client)throw new Error(`Language server ${e} not found`);if(r.state==1&&await r.client.onReady(),r.state!=3)throw new Error(`Language server ${e} not running`);await Promise.resolve(r.client.sendNotification(t,i))}async sendRequest(e,t,i,r){if(!t)throw new Error("method required for sendRequest");let o=this.getService(e);if(o||await Ve(100),o=this.getService(e),!o||!o.client)throw new Error(`Language server ${e} not found`);if(o.state==1&&await o.client.onReady(),o.state!=3)throw new Error(`Language server ${e} not running`);return r||(r=new yh.CancellationTokenSource().token),await Promise.resolve(o.client.sendRequest(t,i,r))}registLanguageClient(e,t){let i=typeof e=="string"?`languageserver.${e}`:e.id,r=[],o=new yh.Emitter,s=typeof e=="string"?null:e;if(this.registered.has(i))return;let a=!1,l={id:i,client:s,name:typeof e=="string"?e:e.name,selector:typeof e=="string"?k6(t.filetypes,t.additionalSchemes):e.clientOptions.documentSelector,state:0,onServiceReady:o.event,start:()=>{if(l.state==1||l.state==3||s&&!s.needsStart())return;if(a&&s)return s.restart(),Promise.resolve();if(!a){if(typeof e=="string"&&!s){let c=v.getConfiguration().get("languageserver",{})[e];if(!c||c.enable===!1)return;let h=LSe(i,e,c);if(!h)return;s=new Bf(i,e,h[1],h[0]),l.selector=h[0].documentSelector,l.client=s}s.onDidChangeState(c=>{let{oldState:h,newState:d}=c;d==3?l.state=1:d==2?l.state=3:d==1&&(l.state=5);let g=D6(h),f=D6(d);Ul.info(`${s.name} state change: ${g} => ${f}`)},null,r),a=!0}l.state=1,Ul.debug(`starting service: ${i}`);let u=s.start();return r.push(u),new Promise(c=>{s.onReady().then(()=>{o.fire(void 0),c()},h=>{k.showMessage(`Server ${i} failed to start: ${h}`,"error"),Ul.error(`Server ${i} failed to start:`,h),l.state=2,c()})})},dispose:async()=>{o.dispose(),J(r)},stop:async()=>{!s||!s.needsStop()||await Promise.resolve(s.stop())},restart:async()=>{s?(l.state=1,s.restart()):await l.start()}};return this.regist(l)}};Mi=new T6});var E6,Gl,vh,Tw=_(()=>{"use strict";V();ke();E6=require("events"),Gl=["<esc>","<space>","<tab>","<s-tab>","<bs>","<right>","<left>","<up>","<down>","<home>","<end>","<cr>","<FocusGained>","<FocusLost>","<ScrollWheelUp>","<ScrollWheelDown>","<LeftMouse>","<LeftDrag>","<LeftRelease>","<2-LeftMouse>","<C-a>","<C-b>","<C-c>","<C-d>","<C-e>","<C-f>","<C-g>","<C-h>","<C-i>","<C-j>","<C-k>","<C-l>","<C-m>","<C-n>","<C-o>","<C-p>","<C-q>","<C-r>","<C-s>","<C-t>","<C-u>","<C-v>","<C-w>","<C-x>","<C-y>","<C-z>","<A-a>","<A-b>","<A-c>","<A-d>","<A-e>","<A-f>","<A-g>","<A-h>","<A-i>","<A-j>","<A-k>","<A-l>","<A-m>","<A-n>","<A-o>","<A-p>","<A-q>","<A-r>","<A-s>","<A-t>","<A-u>","<A-v>","<A-w>","<A-x>","<A-y>","<A-z>"],vh=class extends E6.EventEmitter{constructor(){super();this.configuration=v.getConfiguration("list"),this.disposable=v.onDidChangeConfiguration(e=>{e.affectsConfiguration("list")&&(this.configuration=v.getConfiguration("list"),this.emit("change"))})}get(e,t){return this.configuration.get(e,t)}get previousKey(){return this.fixKey(this.configuration.get("previousKeymap","<C-j>"))}get nextKey(){return this.fixKey(this.configuration.get("nextKeymap","<C-k>"))}dispose(){this.disposable.dispose(),this.removeAllListeners()}fixKey(e){if(Gl.includes(e))return e;let t=Gl.find(i=>i.toLowerCase()==e.toLowerCase());return t||(k.showMessage(`Configured key "${e}" not supported.`,"error"),null)}}});var d$e,kw,P6=_(()=>{"use strict";ke();Tw();d$e=Y()("list-mappings"),kw=class{constructor(e,t,i){this.manager=e;this.nvim=t;th
`)&&(t=e.label=t.replace(/\r?\n/g," ")),t.includes(USe)){let{line:r,highlights:o}=mc(t);e.label=r,Array.isArray(e.ansiHighlights)||(e.ansiHighlights=o)}return e.converted=!0,e}dispose(){this.stop()}}});var v_,$6,QSe,z$e,Iw,X6=_(()=>{"use strict";v_=x(Pi()),$6=x(H());go();Wl();z();ke();V();L6();I6();J6();QSe=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],z$e=Y()("list-session"),Iw=class{constructor(e,t,i,r,o=[],s){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 _w(e,i.name,r,s),this.history=new Pw(t,i.name),this.worker=new Fw(e,i,t,r,{interactiveDebounceTime:s.get("interactiveDebounceTime",100),extendedSearchMode:s.get("extendedSearchMode",!0)}),this.interactiveDebounceTime=s.get("interactiveDebounceTime",100);let a=(0,v_.default)(async()=>{let[d,g,f]=await e.eval('[coc#list#has_preview(),win_getid(),line(".")]');if(d&&g==this.winid){let p=this.ui.lnumToIndex(f);await this.doPreview(p)}},50);this.disposables.push({dispose:()=>{a.clear()}}),this.ui.onDidChangeLine(a,null,this.disposables),this.ui.onDidChangeLine(this.resolveItem,this,this.disposables),this.ui.onDidLineChange(this.resolveItem,this,this.disposables);let l=(0,v_.default)(async()=>{this.updateStatus();let{autoPreview:d}=this.listOptions;if(!d){let[g,f]=await e.eval("[coc#list#has_preview(),mode()]");if(!g||f!="n")return}await this.doAction("preview")},50);this.disposables.push({dispose:()=>{l.clear()}}),this.ui.onDidLineChange(l,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(async()=>{await this.hide()},null,this.disposables),this.ui.onDidDoubleClick(async()=>{await this.doAction()},null,this.disposables),this.worker.onDidChangeItems(async({items:d,reload:g,append:f,finished:p})=>{if(!this.hidden)if(f)await this.ui.appendItems(d);else{let b=this.config.get("height",10);p&&!r.interactive&&r.input.length==0&&(b=Math.min(d.length,b)),await this.ui.drawItems(d,Math.max(1,b),g)}},null,this.disposables);let u=0,c,h;this.disposables.push($6.Disposable.create(()=>{c&&clearTimeout(c),h&&clearInterval(h)})),this.worker.onDidChangeLoading(d=>{this.hidden||(c&&clearTimeout(c),d?(u=Date.now(),h=setInterval(()=>{let g=Math.floor((Date.now()-u)%1e3/100);this.loadingFrame=QSe[g],this.updateStatus()},100)):c=setTimeout(()=>{this.loadingFrame="",h&&clearInterval(h),h=null,this.updateStatus()},Math.max(0,200-(Date.now()-u))))},null,this.disposables)}async start(e){this.args=e,this.cwd=v.cwd,this.hidden=!1;let{listOptions:t,listArgs:i}=this,r=await this.nvim.eval('[win_getid(),bufnr("%"),winheight("%")]');this.listArgs=i,this.history.load(t.input||""),this.window=this.nvim.createWindow(r[0]),this.buffer=this.nvim.createBuffer(r[1]),this.savedHeight=r[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 k.showMenuPicker(r,{title:"Choose action",shortcuts:!0}),c=c+1,v.isVim&&await Ve(10),this.prompt.start()):(await e.call("coc#prompt#stop_prompt",["list"]),c=await e.call("confirm"
`)]),await Ve(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){k.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||(t.index=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(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(!1,!0);await t.resumeNotification(!1),a&&(await Ve(10),t.call("feedkeys",["\x1B","int"],!0),t.command("redraw",!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){let s=y_(this.prompt.input,o);this.ui.updateItem(Object.assign({highlights:s},o),e,r!=o.label)}}}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 vn;if(o.addLine("NAME","Label"),o.addLine(` ${e.name} - ${e.description||""}
2022-05-18 13:29:28 -04:00
`),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(`
`)+`
2022-05-19 10:14:37 -04:00
`)}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={};ye.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()}catch(l){this.nvim.echoError(l)}}onInputChange(){this.timer&&clearTimeout(this.timer),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),J(this.disposables),this.worker.dispose(),this.ui.dispose()}}});var U6,G6,Q6,KSe,jw,K6=_(()=>{"use strict";U6=require("child_process"),G6=require("events"),Q6=x(require("readline"));z();V();KSe=Y()("list-commandTask"),jw=class extends G6.EventEmitter{constructor(e){super();this.o
`,"\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 _4=m((w8e,P4)=>{P4.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 L4=m((D8e,R4)=>{R4.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 I4=m((C8e,F4)=>{F4.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"
2022-05-18 13:29:28 -04:00
`,`
2022-05-19 10:14:37 -04:00
`,"","","","",""," ","%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 EQ=m(($8e,kQ)=>{kQ.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 _Q=m((X8e,PQ)=>{PQ.exports=["[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]"]});var LQ=m((U8e,RQ)=>{RQ.exports=["[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]","[?]
`)}function fV(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("${Xf(a)}", ${o}, ${s}, context)`),r}async function Th(n,e){try{await n.command(`pyx ${c0e(e.join(`
2022-05-18 13:29:28 -04:00
`))}`)}catch(t){let i=new Error(t instanceof Error?t.message:t.toString());throw i.stack=`Error on execute python code:
${e.join(`
`)}
2022-05-19 10:14:37 -04:00
`+(t instanceof Error?t.stack:t),i}}function Uf(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]=`"${Xf(o)}"`;return`t = (${i.join(",")},)`}function c0e(n,e=!1){if(!u0e&&e===!1)return n;let t=["import traceback, vim","vim.vars['errmsg'] = ''","try:"];return t.push(...n.split(`
2022-05-18 13:29:28 -04:00
`).map(i=>" "+i)),t.push("except Exception as e:"),t.push(" vim.vars['errmsg'] = traceback.format_exc()"),t.join(`
2022-05-19 10:14:37 -04:00
`)}function Xf(n){return n.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\t/g,"\\t").replace(/\n/g,"\\n")}function pV(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(d0e.test(n))throw new Error("pattern (?id/name)yes-pattern|no-pattern not supported");return n.replace(m0e,(e,t)=>e=="\\A"?"^":e.startsWith("(?#")?"":e.startsWith("(?P<")?"(?"+e.slice(3):e.startsWith("(?P=")?`\\k<${t}>`:"")}var hV,dV,B4e,u0e,h0e,d0e,g0e,f0e,p0e,m0e,C_=_(()=>{"use strict";hV=require("child_process"),dV=require("util"),B4e=Y()("snippets-eval"),u0e=process.env.VIM_NODE_RPC=="1";h0e=/\\A/,d0e=/\(\?\(\w+\).+\|/,g0e=/\(\?#.*?\)/,f0e=/\(\?P<\w+>.*?\)/,p0e=/\(\?P=(\w+)\)/,m0e=new RegExp(`${g0e.source}|${h0e.source}|${f0e.source}|${p0e.source}`,"g")});function mV(n,e){let t=[...n];for(;t.length>0;){let i=t.shift();if(!e(i))break;t.unshift(...i.children)}}function w0e(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(v0e.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 bV,b0e,y0e,Nr,x_,as,vt,ss,S_,rt,Gf,Kw,Qf,hr,yo,Kf,_a,v0e,zw=_(()=>{"use strict";bV=x(uV());na();cV();Fe();C_();b0e=Y()("snippets-parser"),y0e=["d","g","i","m","s","u","y"],Nr=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=Nr._table[i],typeof r=="number")return this.pos+=1,{type:r,pos:e,len:1};if(Nr.isDigitCharacter(i)){r=8;do t+=1,i=this.value.charCodeAt(e+t);while(Nr.isDigitCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}if(Nr.isVariableCharacter(i)){r=9;do i=this.value.charCodeAt(e+ ++t);while(Nr.isVariableCharacter(i)||Nr.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 Nr._table[i]>"u"&&!Nr.isDigitCharacter(i)&&!Nr.isVariableCharacter(i));return this.pos+=t,{type:r,pos:e,len:t}}},x_=Nr;x_._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};as=class{constructor(){this._children=[]}appendChild(e){return e instanceof vt&&this._children[this._children.length-1]instanceof vt?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 Kf)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}},vt=class extends as{constructor(e){super();this.value=e}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}toString(){return this.value}toTextmateString(){return vt.escape(this.value)}len(){return this.value.length}clone(){return new vt(this.value)}},ss=class extends as{constructor(e,t,i){super();this.code=e;this.kind=t;this._value="";this._related=[];if(t==="python"){let{_related:r}=this,o,s=/\bt\[(\d+)\]/g;for(;o=s.exec(e),o!=null;){let a=parseInt(o[1],10);r.includes(a)||r.push(a)}}i!==void 0&&(this._value=i)}get related(){return this._related}update(e){if(this.kind!=="python")return;let t=new Set;this.code=this.code.replace(/\bt\[(\d+)\]/g,(i,r)=>{let o=Number(r),s=e.has(o)?e.get(o):o;return t.add(s),`t[${s}]`}),this._related=Array.from(t)}get index(){if(this.parent instanceof rt)return this.parent.index}async resolve(e){if(!this.code.length)return;let t=await gV(e,this.kind,this.code,this._value);t!=null&&(this._value=t)}len(){return this._value.length}toString(){return this._value}get value(){return this._value}toTextmateString(){let e="";return this.kind=="python"?e="!p ":this.kind=="shell"?e="":this.kind=="vim"&&(e="!v "),"`"+e+this.code+"`"}clone(){return new ss(this.code,this.kind,this.value)}},S_=class extends as{},rt=class extends S_{constructor(e){super();this.index=e;this.primary=!1}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof Gf?this._children[0]:void 0}toTextmateString(){let e="";return this.transform&&(e=this.transform.toTextmateString()),this.children.length===0&&!this.transform?`$${this.index}`:this.children.length===0?`\${${this.index}${e}}`:this.choice?`\${${this.index}|${this.choice.toTextmateString()}|${e}}`:`\${${this.index}:${this.children.map(t=>t.toTextmateString()).join("")}${e}}`}clone(){let e=new rt(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}},Gf=class extends as{constructor(){super(...arguments);this.options=[]}appendChild(e){return e instanceof vt&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}toTextmateString(){return this.options.map(e=>e.value.repl
2022-05-18 13:29:28 -04:00
`)){let i="";this.snippet.walk(l=>{if(l==this)return!1;if(l instanceof vt){let u=l.toString().split(/\r?\n/);i=u[u.length-1].match(/^\s*/)[0]}return!0});let r=t.split(`
`),o=r.filter(l=>l.length>0).map(l=>l.match(/^\s*/)[0]),s=o.length==0?"":o.reduce((l,u)=>l.length<u.length?l:u);t=r.map((l,u)=>u==0||l.length==0||!l.startsWith(s)?l:i+l.slice(s.length)).join(`
2022-05-19 10:14:37 -04:00
`)}return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new vt(t)],!0):!1}toTextmateString(){let e="";return this.transform&&(e=this.transform.toTextmateString()),this.children.length===0?`\${${this.name}${e}}`:`\${${this.name}:${this.children.map(t=>t.toTextmateString()).join("")}${e}}`}clone(){let e=new yo(this.name,this.resolved);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}};Kf=class extends as{constructor(e){super();this.ultisnip=e===!0}get hasPython(){return this.ultisnip?this.pyBlocks.length>0:!1}get hasCodeBlock(){if(!this.ultisnip)return!1;let{pyBlocks:e,otherBlocks:t}=this;return e.length>0||t.length>0}get values(){if(this._values)return this._values;let e={},t=0;this.placeholders.forEach(i=>{t=Math.max(i.index,t),i.transform==null&&(i.primary||e[i.index]===void 0)&&(e[i.index]=i.toString())});for(let i=0;i<=t;i++)e[i]===void 0&&(e[i]="");return this._values=e,e}get orderedPyIndexBlocks(){let e=[],t=this.pyBlocks.filter(s=>typeof s.index=="number");if(t.length==0)return e;let i=t.map(s=>s.index),r=[],o=s=>{let{related:a}=s;return a.length==0||a.every(l=>!i.includes(l)||r.includes(l))?(r.push(s.index),e.push(s),!0):!1};for(;t.length>0;){let s=!1;for(let a of t)o(a)&&(s=!0);if(!s)break;t=t.filter(a=>!r.includes(a.index))}return e}async evalCodeBlocks(e,t){let{pyBlocks:i,otherBlocks:r}=this;if(await Promise.all(r.map(o=>{let s=o.value;return o.resolve(e).then(()=>{o.parent instanceof rt&&s!==o.value&&this.onPlaceholderUpdate(o.parent)})})),i.length){let o=Uf(this.values);await Th(e,[...t,o]);for(let a of i){let l=a.value;await a.resolve(e),l!==a.value&&a.parent instanceof rt&&(this.onPlaceholderUpdate(a.parent),await Th(e,[Uf(this.values)]))}for(let a of this.orderedPyIndexBlocks)await this.updatePyIndexBlock(e,a);let s=i.filter(a=>a.index===void 0&&a.related.length>0);for(let a of s)await a.resolve(e)}}async updatePythonCodes(e,t){let i;if(t instanceof rt)i=t.index;else for(;t.parent;){if(t instanceof rt){i=t.index;break}t=t.parent}if(i===void 0)return;let r=this.getDependentPyIndexBlocks(i);await Th(e,[Uf(this.values)]);for(let s of r)await this.updatePyIndexBlock(e,s);let o=this.pyBlocks.filter(s=>s.index===void 0&&s.related.length>0);for(let s of o)await s.resolve(e)}getDependentPyIndexBlocks(e){let t=[],i=[],r=this.pyBlocks.filter(s=>typeof s.index=="number"),o=s=>{let a=r.filter(l=>!i.includes(l.index)&&l.related.includes(s));a.length>0&&(t.push(...a),a.forEach(l=>{o(l.index)}))};return o(e),t}async updatePyIndexBlock(e,t){let i=t.value;await t.resolve(e),i!==t.value&&(t.parent instanceof rt&&this.onPlaceholderUpdate(t.parent),await Th(e,[Uf(this.values)]))}get placeholderInfo(){if(!this._placeholders){let e=[],t=[],i=[],r=[];this.walk(o=>{if(o instanceof rt)r.push(o);else if(o instanceof yo){let s=o.name.charCodeAt(0);(s<65||s>90)&&e.push(o)}else o instanceof ss&&(o.kind==="python"?t.push(o):i.push(o));return!0}),this._placeholders={placeholders:r,pyBlocks:t,otherBlocks:i,variables:e}}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:e}=this;return e.reduce((t,i)=>Math.max(t,i.index),0)}get first(){var o,s;let{placeholders:e,variables:t}=this,[i,r]=OY(e.filter(a=>!a.transform),a=>a.index!==0);if(i.length){let a=Math.min.apply(null,i.map(u=>u.index)),l=i.filter(u=>u.index==a);return(o=l.find(u=>u.primary))!=null?o:l[0]}return t.length?t[0]:(s=r.find(a=>a.primary))!=null?s:r[0]}insertSnippet(e,t,i,r){let o=t instanceof rt?t.index:this.maxIndexNumber+1,[s,a]=i,l=r?Qw(r):void 0,u=new _a(!!r,l).parse(e,!0),c=u.maxIndexNumber+1,h=new Map;for(let p of u.placeholders){let b=p.index;p.isFinalTabstop?p.index=c+o:p.index=p.index+o,h.set(b,p.index)}r&&u.pyBlocks.forEach(p=>{p.update(h)});let d=new Map;this.walk(p=>{if(p instanceof rt&&p.index>o){let b=p.index;p.index=p.index+c,d.set(b,p.index)
2022-05-18 13:29:28 -04:00
`:"";if(r.indexOf(`
`)==-1){let s=new ss(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 ss(o+s.join(`
2022-05-19 10:14:37 -04:00
`),"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 vt(t)),this._accept(void 0),!0}return!1}},v0e=[":","(",")","{","}"]});function T_(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=Ri(s,i.slice(0,l))),u>0&&(a=Ri(t.start,e.slice(0,-u))),Ni.TextEdit.replace(Ni.Range.create(s,a),h)}function yV(n,e,t){let i=Ni.Range.create(n,Ri(n,t));return ct(e,i)==0}function vV(n,e,t){var o;if(t.lines.length<n.line)return!1;let r=!0;for(let s=n.line;s>=0;s--){let a=(o=t.lines[s])!=null?o:"";if(s===n.line){let l=e.lines[s].slice(0,n.character);if(!a.startsWith(l)){r=!1;break}}else if(a!==e.lines[s]){r=!1;break}}return r}function wV(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=Ni.Position.create(s+o,a.length-l.length)}else if(a!==e.lines[s]){r=void 0;break}}return r}function DV(n,e,t){var a,l;let i=[],r=[],o=n.split(`
2022-05-18 13:29:28 -04:00
`),s=t.start.line-e.start.line;for(let u=0;u<=s;u++){let c=(a=o[u])!=null?a:"";u==s?i.push(u==0?c.substring(0,t.start.character-e.start.character):c.substring(0,t.start.character)):i.push(c)}s=e.end.line-t.end.line;for(let u=0;u<=s;u++){let c=(l=o[t.end.line-e.start.line+u])!=null?l:"";u==0?s==0?r.push(e.end.character==t.end.character?"":c.slice(t.end.character-e.end.character)):r.push(c.substring(t.end.character)):r.push(c)}return[i.join(`
`),r.join(`
2022-05-19 10:14:37 -04:00
`)]}function CV(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 xV(n){return!!(/^\s/.test(n)||n.indexOf(`
`)!==-1)}var Ni,eQe,Vw,k_=_(()=>{"use strict";Ni=x(H());Ec();bt();ea();C_();zw();eQe=Y()("snippets-snipet"),Vw=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?Qw(e):void 0,o=new _a(!!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=fV(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 rt){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(Ni.Range.create(Ri(g,h),Ri(g,h+c.toString())))}})}}),r.filter(l=>!Ct(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 Ni.Range.create(this.position,Ri(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),i=t.find(r=>r.primary)||t[0];return i!=null?i: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=>_i(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=Ni.Range.create(o,Ri(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:Wb(t,Ni.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=jn.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=>{l
`)){let h=o.getline(t.start.line),d=h.slice(t.end.character);if(d.length){let g=t.end.character,f=d.match(/^\s*/)[0].length,p=Bi.Range.create(t.end.line,g,t.end.line,g+f);a.push(Bi.TextEdit.replace(p,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.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.enableHighlight&&this.nvim.call("coc#highlight#clear_highlight",[this.bufnr,E_,0,-1],!0),this._onCancelEvent.fire(void 0),ls.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}=this;if(!r||!e)return;let{start:o,end:s}=e.range,a=s.character-o.character,l=Q(r.getline(o.line).slice(0,o.character))+1,u=this.current=e.marker;if(u instanceof rt&&u.choice&&u.choice.options.length){let c=u.choice.options.map(h=>h.value);await i.call("coc#snippet#show_choices",[o.line+1,l,a,c]),t&&i.call("coc#util#do_autocmd",["CocJumpPlaceholder"],!0)}else{let c=this.snippet.finalCount;await this.select(e,t),this.highlights(e),e.index==0&&(c==1?(ls.info("Jump to final placeholder, cancelling snippet session"),this.deactivate()):i.call("coc#snippet#disable",[],!0))}}highlights(e,t=!0){if(!this.enableHighlight)return;let i=this.document.buffer;this.nvim.pauseNotification(),i.clearNamespace(E_);let r=this.snippet.getRanges(e);r.length&&i.highlightRanges(E_,"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.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 k.getCursorPosition();this.snippet&&ct(e,this.snippet.range)!=0&&(ls.info("Cursor insert out of range, cancelling snippet session"),this.deactivate())}findPlaceholder(e){let{placeholder:t}=this;return t&&_i(e,t.range)?t:this.snippet.getPlaceholderByRange(e)||null}async synchronize(e){this.cancel(),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||Pe(i.lines,o.lines))return;let{range:s,text:a}=this.snippet;e&&!_i(e.range,s)&&(e=void 0);let l=wV(s.end,i,o);if(!l){ls.info("Content change after snippet, cancel snippet session"),this.deactivate();return}if(!vV(s.start,i,o)){let y=o.getText(Bi.Range.create(Bi.Position.create(0,0),l));if(y.endsWith(a)){let w=o.positionAt(y.length-a.length);this.snippet.resetStartPosition(w),this.textDocument=o,ls.info("Content change before snippet, reset snippet position");return}ls.info("Before and snippet body changed, cancel snippet session"),this.deactivate();return}let c=this.tokenSource=new Bi.CancellationToken
`),filetype:"txt"}]:[];await e.show(l,{modes:["n"]})}},500)),global.__TEST__)return;this.checkExtensions().logError();let t=v.getConfiguration("coc.preferences"),i=t.get("extensionUpdateCheck","never"),r=t.get("silentAutoupdate",!0);if(i!="never"){let o=new Date,s=new Date(o.getFullYear(),o.getMonth(),o.getDate()-(i=="daily"?0:7)),a=this.db.fetch("lastUpdate");if(a&&Number(a)>s.getTime())return;this.outputChannel.appendLine("Start auto update..."),this.updateExtensions(!1,r).logError()}}async updateExtensions(e,t=!1){if(!this.npm)return;let i=await this.getLockedList(),r=await this.globalExtensionStats();r=r.filter(l=>![...i,...this.disabled].includes(l.id)),this.db.push("lastUpdate",Date.now()),t&&k.showMessage("Updating extensions, checkout output:///extensions for details.","more");let o=this.installBuffer=new nf(!0,e,t?this.outputChannel:void 0);o.setExtensions(r.map(l=>l.id)),await o.show(v.nvim);let s=ow(this.npm,this.modulesFolder);await sg(r,l=>{let{id:u}=l;o.startProgress([u]);let c=l.exotic?l.uri:null,h=s(u);return h.on("message",(d,g)=>{o.addMessage(u,d,g)}),h.update(c).then(d=>{o.finishProgress(u,!0),d&&this.loadExtension(d).logError()},d=>{o.addMessage(u,d.message),o.finishProgress(u,!1)})},t?1:3)}async checkExtensions(){let{globalExtensions:e}=v.env;if(e&&e.length){let t=this.filterGlobalExtensions(e);this.installExtensions(t).logError()}}get installer(){return ow(this.npm,this.modulesFolder)}async installExtensions(e=[]){let{npm:t}=this;if(!t||!e.length)return;e=ia(e);let i=this.installBuffer=new nf;i.setExtensions(e),await i.show(v.nvim);let r=ow(this.npm,this.modulesFolder);await sg(e,s=>{i.startProgress([s]);let a=r(s);return a.on("message",(l,u)=>{i.addMessage(s,l,u)}),a.install().then(l=>{i.finishProgress(s,!0);let u=Ie.default.join(this.modulesFolder,l);this.loadExtension(u).logError()},l=>{i.addMessage(s,l.message),i.finishProgress(s,!1),en.error(`Error on install ${s}`,l)})})}getMissingExtensions(){let e=this.loadJson()||{dependencies:{}},t=[];for(let i of Object.keys(e.dependencies)){let r=Ie.default.join(this.modulesFolder,i);if(!pt.default.existsSync(r)){let o=e.dependencies[i];o.startsWith("http")?t.push(o):t.push(i)}}return t}get npm(){let e=v.getConfiguration("npm").get("binPath","npm");e=v.expand(e);for(let t of[e,"yarnpkg","yarn","npm"])try{return qV.default.sync(t)}catch{continue}return k.showMessage("Can't find npm or yarn in your $PATH","error"),null}get all(){return Array.from(this.extensions.values()).map(e=>e.extension).filter(e=>!this.isDisabled(e.id))}getExtension(e){return this.extensions.get(e)}getExtensionState(e){if(this.isDisabled(e))return"disabled";let i=this.extensions.get(e);if(!i)return"unknown";let{extension:r}=i;return r.isActive?"activated":"loaded"}async getExtensionStates(){let e=await this.localExtensionStats([]),t=await this.globalExtensionStats();return e.concat(t.filter(i=>e.find(r=>r.id==i.id)==null))}async getLockedList(){let e=await this.db.fetch("extension");return e=e||{},Object.keys(e).filter(t=>e[t].locked===!0)}async toggleLock(e){let t=`extension.${e}.locked`;await this.db.fetch(t)?this.db.delete(t):this.db.push(t,!0)}async toggleExtension(e){let t=this.getExtensionState(e);if(t==null)return;t=="activated"&&await this.deactivate(e);let i=`extension.${e}.disabled`;if(this.db.push(i,t!="disabled"),t!="disabled")this.disabled.add(e),await this.unloadExtension(e);else{this.disabled.delete(e);let r=Ie.default.join(this.modulesFolder,e);pt.default.existsSync(r)&&await this.loadExtension(r)}await Ve(200)}async reloadExtension(e){let t=this.extensions.get(e);if(!t){k.showMessage(`Extension ${e} not registered`,"error");return}if(t.type==3){k.showMessage(`Can't reload internal extension "${t.id}"`,"warning");return}t.type==2?await this.loadExtensionFile(t.filepath):t.directory?await this.loadExtension(t.directory):k.showMessage(`Can't reload extension ${t.id}`,"warning")}async cleanExtensions(){let e=this.modulesFolder;if(!pt.default.existsSync(e))return[];let t=this.globalExtensions,i=[];for(let r of t){let o=Ie.default.join(e,r),s=await pt.default.lstat(o);!s||
2022-05-18 13:29:28 -04:00
${a.message}
2022-05-19 10:14:37 -04:00
${a.stack}`)});return}let r=[],o=!1,s=()=>{if(!o)return o=!0,J(r),new Promise(a=>{if(!this.canActivate(e))return this.outputChannel.appendLine(`Extension ${e} is disabled or not loaded.`),a();this.activate(e).then(()=>{a()},l=>{k.showMessage(`Error on activate extension ${e}: ${l.message}`),this.outputChannel.appendLine(`Error on activate extension ${e}:${l.message}
${l.stack}`),a()})})};for(let a of i){let l=a.split(":"),u=l[0];if(u=="onLanguage"){if(v.languageIds.has(l[1])||v.filetypes.has(l[1])){await s();return}v.onDidOpenTextDocument(c=>{let h=v.getDocument(c.bufnr);(c.languageId==l[1]||h.filetype==l[1])&&s()},null,r)}else if(u=="onCommand")re.onCommandList.push(l[1]),E.on("Command",async c=>{c==l[1]&&(await s(),await Ve(500))},null,r);else if(u=="workspaceContains"){let c=async()=>{let d=v.workspaceFolders.map(g=>O.parse(g.uri).fsPath);for(let g of d)for(let f of l[1].split(/\s+/))if(await C2(g,f))return await s(),!0;return!1};if(v.onDidChangeWorkspaceFolders(c,null,r),await c())return}else if(u=="onFileSystem"){for(let c of v.documents)if(O.parse(c.uri).scheme==l[1]){await s();return}v.onDidOpenTextDocument(c=>{O.parse(c.uri).scheme==l[1]&&s()},null,r)}else k.showMessage(`Unsupported event ${a} of ${e}`,"error")}}createExtension(e,t,i){let r=t.name,o=!1,s,a=Ie.default.join(e,t.main||"index.js"),l,u=[],c,h={activate:()=>{if(s)return s;let g={subscriptions:u,extensionPath:e,globalState:this.memos.createMemento(`${r}|global`),workspaceState:this.memos.createMemento(`${r}|${v.rootPath}`),asAbsolutePath:f=>Ie.default.join(e,f),storagePath:Ie.default.join(this.root,`${r}-data`),logger:YV(r)};if(!l)try{let f=!(t.engines||{}).hasOwnProperty("coc");l=OV(r,a,f)}catch(f){en.error(`Error on createExtension ${r} from ${a}`,f);return}return s=new Promise((f,p)=>{try{Promise.resolve(l.activate(g)).then(b=>{o=!0,c=b,f(b)},b=>{en.error(`Error on active extension ${r}: ${b.message}`,b),p(b)})}catch(b){en.error(`Error on active extension ${r}: ${b}`,b instanceof Error?b.stack:b),p(b)}}),s}};Object.defineProperties(h,{id:{get:()=>r,enumerable:!0},packageJSON:{get:()=>t,enumerable:!0},extensionPath:{get:()=>e,enumerable:!0},isActive:{get:()=>o,enumerable:!0},exports:{get:()=>{if(!o)throw new Error(`Invalid access to exports, extension "${r}" not activated`);return c},enumerable:!0}}),this.extensions.set(r,{id:r,type:i,isLocal:i==1,extension:h,directory:e,filepath:a,deactivate:()=>{if(!!o&&(s=void 0,c=void 0,o=!1,J(u),u.splice(0,u.length),u=[],l&&l.deactivate))try{return Promise.resolve(l.deactivate()).catch(g=>{en.error(`Error on ${r} deactivate: `,g)})}catch(g){en.error(`Error on ${r} deactivate: `,g)}}});let{contributes:d}=t;if(d){let{configuration:g,rootPatterns:f,commands:p}=d;if(g&&g.properties){let{properties:b}=g,y={};for(let w of Object.keys(b)){let D=b[w].default;D!=null&&(y[w]=D)}v.configurations.extendsDefaults(y)}if(f&&f.length)for(let b of f)v.workspaceFolderControl.addRootPattern(b.filetype,b.patterns);if(p&&p.length)for(let b of p)re.titles.set(b.command,b.title)}this._onDidLoadExtension.fire(h),this.activated&&this.setupActiveEvents(r,t).logError()}filterGlobalExtensions(e){let t=new Map;e.forEach(s=>{let a=this.getExtensionName(s);a&&t.set(a,s)});let i=this.loadJson(),r=[],o=[];if(i&&i.dependencies)for(let s of Object.keys(i.dependencies)){let a=i.dependencies[s];typeof a=="string"&&pt.default.existsSync(Ie.default.join(this.modulesFolder,s,"package.json"))&&(o.push(s),/^https?:/.test(a)&&r.push(a))}for(let s of t.keys()){if(this.disabled.has(s)||this.extensions.has(s)){t.delete(s);continue}(/^https?:/.test(s)&&r.some(a=>a.startsWith(s))||o.includes(s))&&t.delete(s)}return Array.from(t.values())}getExtensionName(e){return/^https?:/.test(e)||!e.includes("@")?e:e.replace(/@[\d.]+$/,"")}get modulesFolder(){return Ie.default.join(this.root,global.__TEST__?"":"node_modules")}canActivate(e){return!this.disabled.has(e)&&this.extensions.has(e)}async unloadExtension(e){this.extensions.get(e)&&(await this.deactivate(e),this.extensions.delete(e),this._onDidUnloadExtension.fire(e))}checkDirectory(e){try{let t=Ie.default.join(e,"package.json");if(!pt.default.existsSync(t))throw new Error("package.json not found");let i=JSON.parse(pt.default.readFileSync(t,"utf8")),{name:r,engines:o,main:s}=i;if(!r||!o)throw new Error("can't find name & engines in package.json");if(!o||!kt(o))throw new Error(`invalid engines in ${t}`);if(s&&!pt.default.existsSync(Ie.default.join(e,s)))throw new Error(`main f
`])})}get nvim(){return v.nvim}createNativeSources(){this.disposables.push((zV(),Oa(KV)).regist(this.sourceMap,this.keywords)),this.disposables.push((tee(),Oa(eee)).regist(this.sourceMap,this.keywords)),this.disposables.push((see(),Oa(oee)).regist(this.sourceMap))}createLanguageSource(e,t,i,r,o,s,a){let l=new sD(e,t,r,i,o||[],a||[],s,this.completeConfig);return aee.debug("created service source",e),this.sourceMap.set(e,l),{dispose:()=>{this.sourceMap.delete(e)}}}async createVimSourceExtension(e,t){let i=dD.default.basename(t,".vim");try{await e.command(`source ${t}`);let r=await e.call("coc#util#remote_fns",i);for(let c of["init","complete"])if(!r.includes(c))return k.showMessage(`${c} not found for source ${i}`,"error"),null;let o=await e.call(`coc#source#${i}#init`,[]),s={name:`coc-source-${i}`,engines:{coc:">= 0.0.1"},activationEvents:o.filetypes?o.filetypes.map(c=>`onLanguage:${c}`):["*"],contributes:{configuration:{properties:{[`coc.source.${i}.enable`]:{type:"boolean",default:!0},[`coc.source.${i}.firstMatch`]:{type:"boolean",default:!!o.firstMatch},[`coc.source.${i}.triggerCharacters`]:{type:"number",default:o.triggerCharacters||[]},[`coc.source.${i}.priority`]:{type:"number",default:o.priority||9},[`coc.source.${i}.shortcut`]:{type:"string",default:o.shortcut||i.slice(0,3).toUpperCase(),description:"Shortcut text shown in complete menu."},[`coc.source.${i}.disableSyntaxes`]:{type:"array",default:[],items:{type:"string"}},[`coc.source.${i}.filetypes`]:{type:"array",default:o.filetypes||null,description:"Enabled filetypes.",items:{type:"string"}}}}}},a=new aD({name:i,filepath:t,sourceType:1,optionalFns:r.filter(c=>!["init","complete"].includes(c))}),l=!1,u={id:s.name,packageJSON:s,exports:void 0,extensionPath:t,activate:()=>(l=!0,this.addSource(a),Promise.resolve())};Object.defineProperty(u,"isActive",{get:()=>l}),ye.registerExtension(u,()=>{l=!1,this.removeSource(a)})}catch(r){k.showMessage(`Error on create vim source ${i}: ${r}`,"error")}}createRemoteSources(){let{runtimepath:e}=v.env,t=e.split(",");for(let i of t)this.createVimSources(i).logError()}async createVimSources(e){if(this.remoteSourcePaths.includes(e))return;this.remoteSourcePaths.push(e);let t=dD.default.join(e,"autoload/coc/source"),i=await Ot(t);if(i&&i.isDirectory()){let r=await uee.default.promisify(lee.default.readdir)(t);r=r.filter(s=>s.endsWith(".vim"));let o=r.map(s=>dD.default.join(t,s));if(o.length==0)return;await Promise.all(o.map(s=>this.createVimSourceExtension(this.nvim,s)))}}get names(){return Array.from(this.sourceMap.keys())}get sources(){return Array.from(this.sourceMap.values())}has(e){return this.names.findIndex(t=>t==e)!=-1}getSource(e){return e&&this.sourceMap.get(e)||null}shouldCommit(e,t){if(!e||!e.source)return!1;let i=this.getSource(e.source);return i&&i.sourceType==2&&typeof i.shouldCommit=="function"?i.shouldCommit(e,t):!1}getCompleteSources(e){let{filetype:t,disabled:i}=e,r=tt(e.line,0,e.colnr-1),o=e.input==""&&!!e.triggerCharacter,s=Km(e.filepath,e.bufnr,"",v.env.isCygwin);return i=Array.isArray(i)?i:[],o?this.getTriggerSources(r,t,s,i):this.getNormalSources(e.filetype,s,i)}getNormalSources(e,t,i=[]){let r=e.split(".");return this.sources.filter(o=>{let{filetypes:s,triggerOnly:a,name:l,documentSelector:u,enable:c}=o;return!(i.includes(l)||!c||a||s&&!UT(s,r)||u&&r.every(h=>v.match(u,{uri:t,languageId:h})==0))})}checkTrigger(e,t,i){let{triggerCharacters:r,triggerPatterns:o}=e;return!!((r==null?void 0:r.length)>0&&r.includes(i)||(o==null?void 0:o.length)>0&&o.findIndex(s=>s.test(t))!==-1)}shouldTrigger(e,t,i){return this.getTriggerSources(e,t,i).length>0}getTriggerSources(e,t,i,r=[]){if(!e)return[];let o=e[e.length-1],s=t.split(".");return this.sources.filter(a=>{let{filetypes:l,enable:u,documentSelector:c,name:h}=a;return r.includes(h)||!u||l&&!UT(l,s)||c&&s.every(d=>v.match(c,{uri:i,languageId:d})==0)?!1:this.checkTrigger(a,e,o)})}addSource(e){let{name:t}=e;return this.names.includes(t)&&aee.warn(`Recreate source ${t}`),this.sourceMap.set(t,e),ot.Disposable.create(()=>{this.sourceMap.delete(t)})}removeSource(e){let t=type
`)==-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,M_,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 f=await this.getTreeItem(g);if(f.collapsibleState!=0&&(f.collapsibleState=2,c>1)){let p=await Promise.resolve(this.provider.getChildren(g));d.push(...p)}}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:N_+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=k.getTabId(s),a||(this.bufnr=void 0);let l=await t.call("coc#window#find",["cocViewId",this.viewId]);if(this.bufnr&&l!==-1&&await t.call("winbufnr",[l])==this.bufnr){this._creating=!1;return}if(t.pauseNotification(),this.bufnr)l!=-1?(t.call("win_gotoid",[l],!
`),0,i]]);return t[s-1]}async withProgress(e,t){this.checkDialog("withProgress");let i=Error().stack,r=new yD(this.nvim,{task:t,title:e.title,cancellable:e.cancellable}),s=v.getConfiguration("notification").get("minProgressWidth",30);return await new Promise((l,u)=>{r.show(Object.assign(this.getNotificationPreference(i),{minWidth:s})).then(c=>{c||u(new Error("Unable to create notification window."))},u),r.onDidFinish(l)})}createTreeView(e,t){let i=(CD(),Oa(_ee)).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]);let a=await this.nvim.call("coc#highlight#get_highlights",s);if(!a||(o==null?void 0:o.isCancellationRequested))return null;i.sort((b,y)=>b.lnum-y.lnum);let l=[],u=v.has("nvim-0.6.0"),c=[],h=[],d=0,g=i.length-1,f=0,p=new Map;if(a.forEach(b=>{f=Math.max(f,b[1]);let y=p.get(b[1]);y?y.push(b):p.set(b[1],[b])}),a.length>0){let b=Array.isArray(r)?r[0]:0;for(let y=b;y<=f;y++){let w=p.get(y)||[],D=[];for(let T=d;T<=g;T++){let L=i[T];if(L.lnum==y)d=T+1,D.push(L);else{d=T;break}}D.length==0?w.length&&(u?c.push(...w.map(T=>T[4])):l.push(y)):w.length==0?h.push(...D.map(T=>H_(T))):(D.length!=w.length||!D.every((T,L)=>K0e(T,w[L])))&&(u?c.push(...w.map(T=>T[4])):l.push(y),h.push(...D.map(T=>H_(T))))}}for(let b=d;b<=g;b++)h.push(H_(i[b]));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 v.document,t;if(e.attached||(e.enabled?e.buftype!==""&&e.buftype!=="acwrite"?t=`Document not attached with buftype '${e.buftype}'`:t="Document not attached, file size exceed coc.preferences.maxFileSize":t="Document not attached, b:coc_enabled is 0"),t){await this.showDialog({title:"Buffer check result",content:t,highlight:"WarningMsg"});return}let i=new vn;i.addLine("Provider state","Title"),i.addLine("");for(let r of Q0e){let o=j.hasProvider(r,e.textDocument);i.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:i.content,highlights:i.highlights})}createNotification(e,t,i,r){return new Promise(o=>{let s={kind:e,content:t,buttons:i.map((l,u)=>({text:l,index:u})),callback:l=>{o(l)}};new nu(this.nvim,s).show(this.getNotificationPreference(r)).then(l=>{l||(Ree.error("Unable to open notification window"),o(-1)),i.length||o(-1)},l=>{Ree.error("Unable to open notification window",l),o(-1)})})}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=(go(),Oa(ZV)).default.getExtensionsInfo(),s=o.find(a=>ei(a.filepath,r));if(s)return s.name.startsWith("single")?Ph.default.basename(s.filepath):s.name;if(s=o.find(a=>Me(a.directory,r)),s)return s.name;if(Me(U0e,r))return"coc.nvim"}get dialogPreference(){let e=v.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=v.getConfiguration("dialog");return{rounded:e.get("rounded",!0),maxWidth:e.get("maxWidth"),highlight:e.get("floatHighlight"),borderhighlight:e.get("floatBorderHighlight")}}getNotificationPreference(e){let t=this.parseSource(e),i=v.getConfiguration("notification");return{broder:i.get("border",!0),focusable:i.get("focusable",!0),marginRight:i.ge
`)[0],a=_h(e.severity).slice(0,1).toUpperCase();return{bufnr:n,lnum:i.line+1,end_lnum:r.line+1,col:Array.isArray(t)?Ze((l=t[i.line])!=null?l:"",i.character)+1:i.character+1,end_col:Array.isArray(t)?Ze((u=t[r.line])!=null?u:"",r.character)+1:r.character+1,text:`[${o}${e.code?" "+e.code:""}] ${s} [${a}]`,type:a}}function SD(n,e){if((n.severity||1)!=(e.severity||1))return(n.severity||1)-(e.severity||1);let t=De(n.range.start,e.range.start);return t!=0?t:n.source>e.source?1:-1}function Aee(n){let e=n.tags||[];if(e.includes(Mt.DiagnosticTag.Deprecated))return"CocDeprecatedHighlight";if(e.includes(Mt.DiagnosticTag.Unnecessary))return"CocUnusedHighlight";switch(n.severity){case Mt.DiagnosticSeverity.Warning:return"CocWarningHighlight";case Mt.DiagnosticSeverity.Information:return"CocInfoHighlight";case Mt.DiagnosticSeverity.Hint:return"CocHintHighlight";default:return"CocErrorHighlight"}}var Mt,W_=_(()=>{"use strict";Mt=x(H());bt();Fe()});var Hee,TD,z0e,Oee,Mee,Nee,Bee,Z_,qee=_(()=>{"use strict";Hee=x(Pi()),TD=x(H());ce();Bt();bt();V();W_();z0e=Y()("diagnostic-buffer"),Oee="CocDiagnostic",Mee="diagnostic",Nee=["CocErrorHighlight","CocWarningHighlight","CocInfoHighlight","CocHintHighlight","CocDeprecatedHighlight","CocUnusedHighlight"],Bee=global.hasOwnProperty("__TEST__")?"MockAleResults":"ale#other_source#ShowResults",Z_=class{constructor(e,t,i,r){this.nvim=e;this.doc=t;this.config=i;this.onRefresh=r;this.diagnosticsMap=new Map;this._disposed=!1;this._dirty=!1;this._changeTs=0;this._textChangeTs=0;this._changedTick=0;let o=global.hasOwnProperty("__TEST__")?10:500;this.refreshHighlights=(0,Hee.debounce)(this._refresh.bind(this),o)}get dirty(){return this._dirty}get bufnr(){return this.doc.bufnr}get uri(){return this.doc.uri}onChange(e){this._changeTs=Date.now(),this.refreshHighlights.clear(),e.contentChanges.length===0&&this._refresh()}onTextChange(){this._textChangeTs=Date.now()}get displayByAle(){return this.config.displayByAle}clearHighlight(e){this.buffer.clearNamespace(Mee+e)}clearSigns(e){this.buffer.unplaceSign({group:Oee+e})}get diagnostics(){let e=[];for(let t of this.diagnosticsMap.values())e.push(...t);return e}get buffer(){return this.nvim.createBuffer(this.bufnr)}refreshAle(e,t){let i=t.map(r=>{let o=r.range;return{text:r.message,code:r.code,lnum:o.start.line+1,col:o.start.character+1,end_lnum:o.end.line+1,end_col:o.end.character,type:Iee(r.severity)}});this.nvim.call(Bee,[this.bufnr,"coc"+e,i],!0)}async update(e,t){let{diagnosticsMap:i}=this,r=i.get(e)||[];if(this.dirty===!1&&t.length==0&&r.length==0||(i.set(e,t),this._dirty===!1&&this.doc.changedtick==this._changedTick&&Pe(r,t)))return;let o=await this.getDiagnosticInfo();if(!o||o.winid==-1){this._dirty=!0;return}if(this._textChangeTs>this._changeTs){this._dirty=!0,this.refreshHighlights();return}if(this._dirty)this.refresh(this.diagnosticsMap,o);else{let s=new Map;s.set(e,t),this.refresh(s,o)}}async reset(e,t){let{diagnosticsMap:i}=this;for(let o of i.keys())e[o]==null&&(e[o]=[]);for(let[o,s]of Object.entries(e))this.diagnosticsMap.set(o,s);let r=await this.getDiagnosticInfo(t);if(!r){this._dirty=!0;return}this.refresh(this.diagnosticsMap,r)}async getDiagnosticInfo(e){let{refreshOnInsertMode:t}=this.config,{nvim:i,bufnr:r}=this,o=!t;if(e)o=!1;else if(E.insertMode&&!t)return;return await i.call("coc#util#diagnostic_info",[r,o])}refresh(e,t){let{nvim:i,displayByAle:r}=this;if(this._dirty=!1,this._changedTick=this.doc.changedtick,r){i.pauseNotification();for(let[o,s]of e.entries())this.refreshAle(o,s);i.resumeNotification(!0,!0)}else{let o=[];z0e.debug("Update UI",this.bufnr,Array.from(e.keys())),i.pauseNotification();for(let[s,a]of e.entries())a.length==0&&o.push(s),this.addSigns(s,a),this.updateHighlights(s,a);this.showVirtualText(t.lnum,t.bufnr),this.updateLocationList(t.winid,t.locationlist),this.setDiagnosticInfo(),i.resumeNotification(!0,!0),o.forEach(s=>{this.diagnosticsMap.delete(s)}),this.onRefresh(this.diagnostics)}}updateLocationList(e,t){if(!this.config.locationlistUpdate||e==-1||t!=="Diagnostics of coc")return;let i=this.toLocationListItems(this.diagn
`)||!Ct(r))));if(Ct(r)&&o.length>0&&(o=o.slice(0,1)),o.length==0)sp.debug("no affected ranges"),this.ranges.forEach(s=>{s.adjustFromEdit({range:r,newText:i})}),this.doHighlights();else if(o.length==1&&_i(r,o[0].range)){if(sp.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)){sp.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{sp.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(zs(hs.TextEdit.replace(e,t))!=0||!_i(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 hs.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;sp.debug("cursors cancel");let{nvim:e,doc:t}=this,i=t.buffer;this.activated=!1,this.ranges=[],e.pauseNotification(),i.clearNamespace("cursors"),i.setVar("coc_cursors_activated",0,!0),e.resumeNotification(!0,!0),this._onDidUpdate.fire(),this._onDidCancel.fire()}dispose(){!this.doc||(this._onDidCancel.dispose(),this._onDidUpdate.dispose(),J(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=RD(e,t.range,t.newText),a=rp(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=op(u,this.ranges,e);u.move(c*a)}this.doHighlights()}applyComposedEdit(e,t){var y,w,D;let i=(0,Fh.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]!=Fh.default.EQUAL||!l[1].startsWith(e[0].slice(0,o))))return this.cancel(),!1;let u=0,c=!1,h=[];for(let T=0;T<i.length;T++){let[L,I]=i[T];if(T==0&&o>0&&(I=I.slice(o)),L==Fh.default.EQUAL){if(u+=I.length,u>a)break}else if(L==Fh.default.DELETE){let A=u;if(u+=I.length,u>a){c=!0;break}h.push({offset:A,remove:I})}else{let A=i[T-1];A&&A[0]==Fh.default.DELETE?h[h.length-1].add=I:h.push({offset:u,add:I})}}if(c||!h.length)return this.cancel(),!1;let d=jn.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:(y=h[0].add)!=null?y:""};else if(iTe(h,a))g={prepend:[h[0].remove?h[0].remove.length:0,(w=h[0].add)!=null?w:""],append:[h[1].remove?h[1].remove.length:0,(D=h[1].add)!=null?D:""]};else{let T=r.text,L="",I="",A=h[0].offset;for(let W of h){if(W.offset>A+L.length){let B=T.slice(A+L.length,W.offset);L+=B,I+=B}W.add&&(I+=W.add),W.remove&&(L+=W.remove)}g={offset:A,remove:L.length,insert:I}}let f=this.ranges.map(T=>{let L=T.position.line-s,{start:I,end:A}=T.range,W=hs.Range.create(L,I.character,L,A.character);return T.applyChange(g),hs.TextEdit.replace(W,T.text)});if(jn.applyEdits(d,f)!==t.join(`
`))return this.cancel(),!1;let b=rp(g);if(b!=0)for(let T of this.ranges){let L=op(T,this.ranges);T.move(L*b)}return this.doHighlights(),!0}};function iTe(n,e){return!(n.length!=2||n[0].offset!=0||n[1].offset+(n[1].remove?n[1].remove.length:0)!==e)}var Ntt=Y()("cursors"),FD=class{constructor(e){this.nvim=e;this.sessionsMap=new Map;this.disposables=[];v.onDidCloseTextDocument(t=>{let i=this.getSession(t.bufnr);!i||(this.sessionsMap.delete(t.bufnr),i.cancel())},null,this.disposables)}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=await k.getCursorPosition(),l;if(t=="operator"){await o.command(`normal! ${i=="line"?"'[":"`["}`);let u=await k.getCursorPosition();await o.command(`normal! ${i=="line"?"']":"`]"}`);let c=await k.getCursorPosition();await k.moveTo(a);let h=De(u,c);if(h==0)return;h>=0&&([u,c]=[c,u]);let d=r.getline(c.line);c.character<d.length&&(c.character=c.character+1);let g=U_(r,Ih.Range.create(u,c));s.addRanges(g)}else if(t=="word"){if(l=r.getWordRangeAtPosition(a),!l){let u=r.getline(a.line);a.character==u.length?l=Ih.Range.create(a.line,Math.max(0,u.length-1),a.line,u.length):l=Ih.Range.create(a.line,a.character,a.line,a.character+1)}s.addRange(l),await o.command(`silent! call repeat#set("\\<Plug>(coc-cursors-${t})", -1)`)}else if(t=="position"){let u=r.getline(a.line);a.character>=u.length?l=Ih.Range.create(a.line,u.length-1,a.line,u.length):l=Ih.Range.create(a.line,a.character,a.line,a.character+1),s.addRange(l),await o.command(`silent! call repeat#set("\\<Plug>(coc-cursors-${t})", -1)`)}else if(t=="range"){await o.call("eval",'feedkeys("\\<esc>", "in")');let u=await k.getSelectedRange(i);if(!u)return;let c=i==""?nte(r,u):U_(r,u);for(let h of c)s.addRange(h)}else throw new Error(`select kind "${t}" not supported`)}createSession(e){let{bufnr:t}=e,i=this.getSession(t);return i||(i=new LD(this.nvim,e),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()}};Kl();ce();go();var hC=x(H());ce();xe();z();ke();V();var jh=x(H());Di();Kl();xe();ke();V();var $tt=Y()("handler-codeActions"),ID=class{constructor(e,t){this.nvim=e;this.handler=t;t.addDisposable(re.registerCommand("editor.action.organizeImport",async i=>{await this.organizeImport(i)})),re.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=jh.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){k.showMessage(`No${i?" "+i:""} code action available`,"warning");return}let l=await k.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,[jh.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||jh.Range.create(0,0,e.lineCount,0);let o={diagnostics:_t.getDiagnosticsInRange(e.textDocument,t)};i&&Array.isArray(i)&&(o.only=i);let s=await this.handler.withRequestToken("code action",a=>j.getCodeActions(e.textDocument,t,o,a));return!s||s.length==0?[]:(s.sort((a,l)=>a.isPreferred&&!l.isPreferred?-1:l.isPreferred&&!a.isPreferred||a.disabled&&!l.disabled?1:l.disabled&&!a.disabled?-1:0),s)}get floatActions(){return v.floatSupported?v.getConfiguration("coc.preferences").get("floatActions",!0):!1}async doCodeAction(e,t){let
`,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&&cte.has(l)){let u=a.trim()[0];if(u&&cte.get(l)==u){let c=[],h=await v.getFormatOptions(o.uri),d=h.insertSpaces?" ".repeat(h.tabSize):" ",g=a.match(/^\s*/)[0],f=ds.Position.create(r-1,s.length);if(o.filetype=="vim"){let p=`
`+g+d;c.push({range:ds.Range.create(r,g.length,r,g.length),newText:" \\ "}),p=p+"\\ ",c.push({range:ds.Range.create(f,f),newText:p}),await o.applyEdits(c),await k.moveTo(ds.Position.create(r,p.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 k.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=ds.Range.create(s-1,0,s-1+a,0)}let r=await v.getFormatOptions(e.uri),o=await this.handler.withRequestToken("Format range",s=>j.provideDocumentRangeFormattingEdits(e.textDocument,i,r,s));return o&&o.length>0?(await e.applyEdits(o,!1,!0),0):-1}};var su=x(H());ce();xe();z();V();var rnt=Y()("documentHighlight"),qD=class{constructor(e,t){this.nvim=e;this.handler=t;this.disposables=[];this.highlights=new Map;E.on(["CursorMoved","CursorMovedI"],()=>{this.cancel(),this.clearHighlights()},null,this.disposables),this.getConfiguration(),v.onDidChangeConfiguration(this.getConfiguration,this,this.disposables)}getConfiguration(e){let t=v.getConfiguration("documentHighlight");(!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||!j.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,su.Position.create(r[0],r[1]));if(!a)return;let l={};for(let c of a){if(!c.range)continue;let h=c.kind==su.DocumentHighlightKind.Text?"CocHighlightText":c.kind==su.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 su.CancellationTokenSource,s=this.timer=setTimeout(()=>{o.token.isCancellationRequested||o.cancel()},this.config.timeout),a=await j.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(),J(this.disposables)}};var hte=x(require("fs")),gs=x(H());we();xe();qo();z();Ue();V();var fnt=Y()("handler-hover"),YD=class{constructor(e,t){this.nvim=e;this.handler=t;this.disposables=[];this.documentLines=[];this.hasProvider=!1;this.excludeImages=!0;this.loadConfiguration(),v.onDidChangeConfiguration(this.loadConfiguration,this,this.disposables),this.hoverFactory=new li(e),this.disposables.push(this.hoverFactory)}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("setlocal bufhidden=wipe nobuflisted",!0),e.command("setfiletype markdown",!0),e.command(`if winnr('j') != winnr('k') | exe "normal! z${Math.min(this.documentLines.length,this.config.previewMaxHeight)}\\<cr> | endif"`,!0),await e.resume
`))};this.disposables.push(v.registerTextDocumentContentProvider("coc",t))}loadConfiguration(e){if(!e||e.affectsConfiguration("hover")){let t=v.getConfiguration("hover"),i=t.get("target","float");this.config={floatConfig:t.get("floatConfig",{}),autoHide:t.get("autoHide",!0),target:i=="float"&&!v.floatSupported?"preview":i,previewMaxHeight:t.get("previewMaxHeight",12)},this.config.target=="preview"&&this.registerProvider();let r=v.getConfiguration("coc.preferences");this.excludeImages=r.get("excludeImageLinksInMarkdownDocument",!0)}}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=>j.getHover(t.textDocument,i,a),!0);if(o==null||!o.length)return!1;let s=o.find(a=>gs.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}=await this.handler.getCurrentState();e=="preview"&&this.registerProvider(),this.handler.checkProvier("hover",t.textDocument),await t.synchronize();let r=await this.handler.withRequestToken("hover",s=>j.getHover(t.textDocument,i,s),!0);if(!(r!=null&&r.length))return!1;let o=await this.handler.withRequestToken("definitionHover",s=>j.getDefinitionLinks(t.textDocument,i,s),!1);if(o!=null&&o.length)for(let s of o){if(!s.targetRange)continue;let{start:a,end:l}=s.targetRange,u=l.line-a.line>=100?a.line+100:l.character==0?l.line-1:l.line,c=await aTe(s.targetUri,a.line,u);if(c.length){let h=c[0].match(/^\s*/)[0];h&&(c=c.map(d=>d.startsWith(h)?d.substring(h.length):d)),r.push({content:c.join(`
`),filetype:t.filetype})}}return await this.previewHover(r,e),!0}async previewHover(e,t){let i=[];t=t||this.config.target;let r=t==="preview";for(let s of e){if(sTe(s)){i.push(s);continue}let{contents:a}=s;if(Array.isArray(a))for(let l of a)typeof l=="string"?lp(i,l,"markdown",r):lp(i,l.value,l.language,r);else gs.MarkedString.is(a)?typeof a=="string"?lp(i,a,"markdown",r):lp(i,a.value,a.language,r):gs.MarkupContent.is(a)&&lp(i,a.value,rg(a)?"markdown":"txt",r)}if(t=="float"){let s=this.hoverFactory.applyFloatConfig({modes:["n"],autoHide:this.config.autoHide,excludeImages:this.excludeImages,maxWidth:80},this.config.floatConfig);await this.hoverFactory.show(i,s);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 gs.CancellationTokenSource,o=await j.getHover(t.textDocument,i,r.token);if(Array.isArray(o))for(let s of o){let{contents:a}=s;Array.isArray(a)?a.forEach(l=>{e.push(typeof l=="string"?l:l.value)}):gs.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),J(this.disposables)}};function lp(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 sTe(n){return n?typeof n.filetype=="string"&&typeof n.content=="string":!1}async function aTe(n,e,t){let i=v.getDocument(n);if(i)return i.getLines(e,t+1);let r=O.parse(n).fsPath;return hte.default.existsSync(r)?await Qs(r,e,t):[]}var au=x(H());ce();xe();qo();z();bt();ke();V();var Snt=Y()("handler-links"),lTe=/CocAction(Async)?\(["']openLink["']\)/,WD=class{constructor(e,t){this.nvim=e;this.handler=t;this.disposables=[];this.setConfiguration(),v.onDidChangeConfiguration(this.setConfiguration,this,this.disposables),this.floatFactory=new li(e),E.on("CursorHold",async()=>{!this._tooltip||!e.hasFunction("nvim_get_keymap")||await this.showTooltip()},null,this.disposables),E.on(["CursorMoved","InsertEnter"],()=>{this.cancel()},null,this.disposables)}setConfiguration(e){if(!e||e.affectsConfiguration("links")){let t=v.getConfiguration("links");this._tooltip=t.get("tooltip",!1)}}async showTooltip(){let{nvim:e,floatFactory:t}=this,r=(await e.getKeymap("n")).find(u=>lTe.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],{autoHide:!0})}async getLinks(){try{let{doc:e}=await this.handler.getCurrentState();if(!j.hasProvider("documentLink",e.textDocument))return[];let t=this.tokenSource=new au.CancellationTokenSource,i=await j.getDocumentLinks(e.textDocument,t.token);return t.token.isCancellationRequested?[]:i}catch{return[]}}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 k.getCursorPosition();if(e&&e.length){for(let a of e)if(ct(t,a.range)==0){if(!a.target){let l=this.tokenSource=this.tokenSource||new au.CancellationTokenSource;if(a=await j.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=au.DocumentLink.create(au.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(),J(this.disposables)}};var Hr=x(H());we();xe();Hf();V();var Int=Y()("handler-hover"),ZD=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 Hr.CancellationTokenSource;return j.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 Hr.CancellationTokenSource;return j.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 Hr.CancellationTokenSource;return j.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 Hr.CancellationTokenSource;return j.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 Hr.CancellationTokenSource;return j.getReferences(t.textDocument,{includeDeclar
`)))}else{l.push(u);let f=this.getDeleteRange(c);a.push(Ge.TextEdit.replace(f,""))}}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+=BT(Ge.Position.create(r,0),e)}}async getFileChanges(){let e=[],t=await this.buffer.lines;t.push(qr);let i=[],r,o;for(let s=0;s<t.length;s++){let a=t[s];if(a.startsWith(qr)){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 vn,a=[];for(let c of e){let h=[];for(let d of c.ranges){s.addLine(qr),s.addLine(qr);let g=o+s.length;s.addText(`${Me(t,c.filepath)?up.default.relative(t,c.filepath):c.filepath}`);let f=String(d.start+1).length+String(d.end).length+4;this.srcId||s.addText(" ".repeat(f));let p=0-s.length-o;d.highlights&&a.push(...d.highlights.map(T=>cTe(T,p)));let{lines:b,start:y,end:w,highlights:D}=d;b||(b=await this.getLines(c.filepath,y,w)),h.push({lines:b,lnum:g,start:y,highlights:D}),s.addLines(b)}if(h.length){let d={filepath:c.filepath,ranges:h},g=this._fileItems.find(f=>f.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 k.cursors.addRanges(a)}catch(o){this.changing=!1,uTe.error("Error on add file item:",o)}r()}findRange(e,t){let r=this.fileItems.find(o=>ei(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);Pe(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 k.showInformationMessage("No change."),await i.setOption("modified",!1),!1;let s={};for(let a of o){let l=O.file(a.filepath).toString(),u=s[l]||[];u.push({range:Ge.Range.create(a.start,0,a.end,0),newText:a.lines.join(`
2022-05-18 13:29:28 -04:00
`)+`
2022-05-19 10:14:37 -04:00
`}),s[l]=u}this.changing=!0,await v.applyEdit({changes:s}),this.changing=!1;for(let a of this.fileItems){let l=O.file(this.getAbsolutePath(a.filepath)).toString(),u=s[l];u&&u.length>0&&a.ranges.forEach(c=>{c.start+=BT(Ge.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=O.file(e).toString(),o=v.getDocument(r);return o?o.getLines(t,i):await Qs(e,t,i-1)}getAbsolutePath(e){return up.default.isAbsolute(e)?e:up.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?up.default.relative(s,u.filepath):u.filepath}`,h=Q(c)+1;for(let d of u.ranges){let g=d.start+d.lines.length,f=`:${d.start+1}:${g}`;for(let p=0;p<f.length;p++){let b=f[p];this.matchIds.add(l),a[d.lnum]=[d.start+1,g],t.call("matchaddpos",["Conceal",[[d.lnum,h+p]],99,l,{conceal:b,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=Ge.Position.create(o,0);break}let a=t.getline(s);if(a===qr){r=Ge.Position.create(s+1,0);break}if(s!=i&&a.startsWith(qr)){r=Ge.Position.create(s,0);break}}return Ge.Range.create(Ge.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=Ge.Position.create(s,a.length);break}if(t.getline(s+1).startsWith("\u3000")){r=Ge.Position.create(s,a.length);break}}return Ge.Range.create(Ge.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,J(this.disposables)}};function cTe(n,e){let{start:t,end:i}=n;return Ge.Range.create(t.line-e,t.character,i.line-e,i.character)}function hTe(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(qr)){let g=o[s.start.line].slice(0,s.start.character);if(g==c){r=g+u.slice(0,-1).join(`
2022-05-18 13:29:28 -04:00
`)+`
2022-05-19 10:14:37 -04:00
`;let{start:f,end:p}=s;l[0].range=Ge.Range.create(f.line,0,p.line,0)}}let h=o[s.start.line-1],d=u.length>1?u[u.length-2]:"";if(c==""&&d.startsWith(qr)&&h==d&&s.start.character==0&&s.end.character==0){r=h+`
2022-05-18 13:29:28 -04:00
`+u.slice(0,-2).join(`
`)+`
2022-05-19 10:14:37 -04:00
`;let{start:g,end:f}=s;l[0].range=Ge.Range.create(g.line-1,0,f.line-1,0)}}else if(Ct(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(qr)&&h==c){l[0].text=h+u.slice(0,-1).join(`
2022-05-18 13:29:28 -04:00
`)+`
2022-05-19 10:14:37 -04:00
`;let{start:d,end:g}=s;l[0].range=Ge.Range.create(d.line,0,g.line,0)}}return{contentChanges:l,bufnr:t,textDocument:i,original:r,originalLines:o}}var dte=require("child_process"),gte=require("events"),V_=x(require("path")),fte=x(require("readline"));No();Wl();bc();zr();ke();var dTe=Y()("handler-search"),gTe=["--color","ansi","--colors","path:fg:black","--colors","line:fg:green","--colors","match:fg:red","--no-messages","--heading","-n"],fTe="\x1B",pte=class extends gte.EventEmitter{start(e,t,i){this.process=(0,dte.spawn)(e,t,{cwd:i}),this.process.on("error",c=>{this.emit("error",c.message)});let r=fte.default.createInterface(this.process.stdout),o,s,a=[],l=[],u=!0;r.on("line",c=>{if(c.includes(fTe)){let h=cg(c);if(h[0].foreground=="black"){s={filepath:V_.default.join(i,h[0].text),ranges:[]};return}if(h[0].foreground=="green"){let g=parseInt(h[0].text,10)-1,f=h[0].text.length+1;u&&(o=g,u=!1);let p="";for(let y of h){if(y.foreground=="red"){let w=g-o,D=p.length-f;l.push(Oe.create(w,D,w,D+y.text.length))}p+=y.text}let b=p.slice(f);a.push(b)}}else{let h=c.trim().length==0;s&&(h||c.trim()=="--")&&s.ranges.push({lines:a,highlights:l,start:o}),h&&(this.emit("item",s),s=null),a=[],l=[],u=!0}}),r.on("close",()=>{s&&(a.length&&s.ranges.push({lines:a,highlights:l,start:o}),this.emit("item",s)),a=l=s=null,this.emit("end")})}dispose(){this.process&&this.process.kill()}},XD=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(gTe,e),u=pTe(e);u&&l.pop(),l.push("--",u?V_.default.isAbsolute(u)?u:`./${u.replace(/^\.\//,"")}`:"./"),this.task=new pte,this.task.start(o,l,t);let c=new zt,h=0,d=0,g=Date.now(),f=[],p=async()=>{if(f.length==0)return;let b=f.slice();f=[];let y=await c.acquire();try{await i.addFileItems(b)}catch(w){dTe.error(w)}y()};return new Promise((b,y)=>{let w=setInterval(p,300);this.task.on("item",async D=>{h++,d=d+D.ranges.reduce((T,L)=>T+L.highlights.length,0),f.push(D)}),this.task.on("error",D=>{clearInterval(w),k.showMessage(`Error on command "${o}": ${D}`,"error"),this.task=null,y(new Error(D))}),this.task.on("end",async()=>{clearInterval(w);try{await p(),(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 L=new vn;L.addText("Files","MoreMsg"),L.addText(": "),L.addText(`${h} `,"Number"),L.addText("Matches","MoreMsg"),L.addText(": "),L.addText(`${d} `,"Number"),L.addText("Duration","MoreMsg"),L.addText(": "),L.addText(`${Date.now()-g}ms`,"Number"),L.render(T,1,2)}T.setOption("modified",!1,!0),r.resumeNotification(!1,!0)}}catch(D){y(D);return}b()})})}abort(){var e;(e=this.task)==null||e.dispose()}};function pTe(n){if(n.length<2)return;let e=n.length;if(!n[e-1].startsWith("-")&&!n[e-2].startsWith("-"))return n[e-1]}var Srt=Y()("handler-refactor"),mTe="__coc_refactor__",bTe=0,UD=class{constructor(e,t){this.nvim=e;this.handler=t;this.buffers=new Map;this.disposables=[];this._onCreate=new Oh.Emitter;this.onCreate=this._onCreate.event;this.setConfiguration(),v.onDidChangeConfiguration(this.setConfiguration,this,this.disposables),E.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");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 doRefactor(){let{doc:e,position
2022-05-18 13:29:28 -04:00
Modifiers: ${s.join(", ")}
2022-05-19 10:14:37 -04:00
Highlight group: ${o.hlGroup||""}`,highlights:a}];await this.floatFactory.show(l,{autoHide:!0,focusable:!0,title:"Semantic token info",borderhighlight:"MoreMsg",border:[1,1,1,1]})}else this.floatFactory.close()}async fetchHighlightGroups(){let e=await this.nvim.call("coc#util#semantic_hlgroups");this.config.highlightGroups=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(){var a;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 vn;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",VD),r.addLine("");try{i.checkState();let l=i.highlights||[];r.addLine("The number of semantic tokens: "),r.addText(String(l.length),"Number"),r.addLine(""),r.addLine("Semantic highlight groups used by current buffer",VD),r.addLine("");let u=ia(l.filter(d=>d.hlGroup!=null).map(({hlGroup:d})=>d));for(let d of u)r.addTexts([{text:"-",hlGroup:"Comment"},{text:" "},{text:d,hlGroup:d}]);r.addLine(""),r.addLine("Tokens types that current Language Server supported:",VD),r.addLine("");let c=v.getDocument(i.bufnr),h=(a=j.getLegend(c.textDocument))!=null?a:j.getLegend(c.textDocument,!0);if(h.tokenTypes.length){for(let d of[...new Set(h.tokenTypes)]){let g=Nh+cn(d);r.addTexts([{text:"-",hlGroup:"Comment"},{text:" "},{text:g,hlGroup:g}])}r.addLine("")}else r.addLine("No token types supported","Comment"),r.addLine("");if(r.addLine("Tokens modifiers that current Language Server supported:",VD),r.addLine(""),h.tokenModifiers.length){for(let d of[...new Set(h.tokenModifiers)]){let g=Nh+cn(d);r.addTexts([{text:"-",hlGroup:"Comment"},{text:" "},{text:g,hlGroup:g}])}r.addLine("")}else r.addLine("No token modifiers exist","Comment"),r.addLine("")}catch(l){r.addLine(l instanceof Error?l.message:l.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(),J(this.disposables)}};var hp=x(H());ce();xe();qo();z();Fe();V();var Got=Y()("handler-signature"),tC=class{constructor(e,t){this.nvim=e;this.handler=t;this.disposables=[];this.signatureFactory=new li(e),this.loadConfiguration(),this.disposables.push(this.signatureFactory),v.onDidChangeConfiguration(this.loadConfiguration,this,this.disposables),E.on("CursorMovedI",async(i,r)=>{let o=this.lastPosition;!o||o.bufnr==i&&o.lnum==r[0]&&o.col<=r[1]||this.signatureFactory.close()},null,this.disposables),E.on(["InsertLeave","BufEnter"],()=>{var i;(i=this.tokenSource)==null||i.cancel()},null,this.disposables),E.on("TextChangedI",()=>{this.config.hideOnChange&&this.signatureFactory.close()},null,this.disposables),E.on("TextInsert",async(i,r,o)=>{if(!this.config.trigger)return;let s=this.getTextDocument(i);!s||!j.shouldTriggerSignatureHelp(s.textDocument,o)||await this._triggerSignatureHelp(s,{line:r.lnum-1,character:r.pre.length},!1)},null,this.disposables)}getTextDocument(e){let t=v.getDocument(e);if(!(!t||t.isCommandLine||!t.attached))return t}loadConfiguration(e){if(!e||e.affectsConfiguration("signature")){let t=v.getConfiguration("signature"),i=t.get("target","float");i=="float"&&!v.floatSupported&&(i="echo"),this.config={target:i,floatConfig:t.get("floatConfig",{}),trigger:t.get("enable",!0),wait:Math.max(t.get("triggerSignatureWait",500),200),preferAbove:t.get("preferShownAbove",!0),hideOnChange:t.get("hideOnTextChange",!1)}}}async triggerSignatureHelp(){let{doc:e,position:t}=await this.handler.getCurrentState();return j.hasProvider("signature",e.textDocument)?await this._t
`)||!Ct(r))));if(o.length==1&&_i(r,o[0].range)){if(i.includes(`
`)){this.cancelEdit();return}TTe.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=RD(e,t.range,t.newText),l=rp(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=op(c,this.ranges,e);c.move(h*l)}this.doHighlights()}doHighlights(){let{window:e,ranges:t}=this;e&&t&&(this.nvim.pauseNotification(),e.clearMatchGroup("^CocLinkedEditing"),e.highlightRanges("CocLinkedEditing",t.map(i=>i.range),99,!0),this.nvim.resumeNotification(!0,!0))}_checkPosition(e,t){if(E.pumvisible||!v.isAttached(e))return;let i=v.getDocument(e);if(!v.getConfiguration("coc.preferences",i.uri).get("enableLinkedEditing",!1)||!j.hasProvider("linkedEditing",i.textDocument))return;let s=yi(i.getline(t[0]-1),t[1]-1),a=aC.Position.create(t[0]-1,s);if(this.ranges){if(this.ranges.some(l=>ct(a,l.range)==0))return;this.cancelEdit()}this.enable(i,a)}async enable(e,t){let i=e.textDocument,o=(this.tokenSource=new aC.CancellationTokenSource).token,s=await this.nvim.window,a=await j.provideLinkedEdits(i,t,o);if(o.isCancellationRequested||!a||a.ranges.length==0)return;let l=a.ranges.map(u=>new Lh(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)}};ce();xe();V();var _te=x(Pi()),Hh=x(H());xe();Ik();bt();var kTe=global.hasOwnProperty("__TEST__")?10:100,ETe="CocInlayHint",uC=class{constructor(e,t,i){this.nvim=e;this.doc=t;this.config=i;this.regions=new lu;this.currentHints=[];this._onDidRefresh=new Hh.Emitter;this.onDidRefresh=this._onDidRefresh.event;this.render=(0,_te.default)(()=>{this.renderRange()},kTe),this.render()}get current(){return this.currentHints}clearCache(){this.currentHints=[],this.regions.clear(),this.render.clear()}onChange(){this.clearCache(),this.cancel(),this.render()}cancel(){this.render.clear(),this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource=null)}async renderRange(){if(this.cancel(),!j.hasProvider("inlayHint",this.doc.textDocument))return;this.tokenSource=new Hh.CancellationTokenSource;let e=this.tokenSource.token,t=await this.nvim.call("coc#window#visible_range",[this.doc.bufnr]);if(t==null||this.doc.dirty||e.isCancellationRequested||this.regions.has(t[0],t[1]))return;let i=Hh.Range.create(t[0]-1,0,t[1],0),r=await j.provideInlayHints(this.doc.textDocument,i,e);r==null||e.isCancellationRequested||(this.regions.add(t[0],t[1]),this.currentHints=this.currentHints.filter(o=>ct(o.position,i)!==0),this.currentHints.push(...r),this.setVirtualText(i,r))}setVirtualText(e,t){let{nvim:i,doc:r}=this,o=this.config.srcId,s=r.buffer,a={};for(let l of t){let u=[[ev(l),ETe]];a[l.position.line]===void 0?a[l.position.line]=u:(a[l.position.line].push([" ","Normal"]),a[l.position.line].push(u[0]))}i.pauseNotification(),s.clearNamespace(o,e.start.line,e.end.line+1);for(let l of Object.keys(a))s.setExtMark(o,Number(l),0,{virt_text:a[l],virt_text_pos:"eol"});i.resumeNotification(!1,!0),this._onDidRefresh.fire()}clearVirtualText(){let e=this.config.srcId;this.doc.buffer.clearNamespace(e)}dispose(){this.cancel()}};var cC=class{constructor(e,t){this.config={};e.createNamespace("coc-inlayHint").then(i=>{this.config.srcId=i}),this.buffers=v.registerBufferSync(i=>{if(!!v.has("nvim-0.5.0"))return new uC(e,i,this.config)}),t.addDisposable(this.buffers),t.addDisposable(j.onDidInlayHintRefresh(async i=>{for(let r of this.buffers.items)v.match(i,r.doc.textDocument)&&(r.clearCache(),j.hasProvider("inlayHint",r.doc.textDocument)?await r.renderRange():r.clearVirtualText())})),t.addDisposable(E.on("CursorMoved",i=>{this.refresh(i)})),t.addDisposable(E.on("WinScrolled",async i=>{let r=await e.call("winbufnr",[i]);r!=-1&&this.refresh(r)}))}getItem(e){return this.buffers.getIt
`+n.stack):console.error("UnhandledRejection: "+n),fC.error("unhandledRejection ",e,n)});
2022-05-18 13:29:28 -04:00
/*!
* 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
*/