324 lines
1.1 MiB
324 lines
1.1 MiB
var _J=Object.create,Zu=Object.defineProperty,PJ=Object.getPrototypeOf,TJ=Object.prototype.hasOwnProperty,RJ=Object.getOwnPropertyNames,NP=Object.getOwnPropertyDescriptor;var qP=r=>Zu(r,"__esModule",{value:!0});var g=(r,e)=>()=>(e||(e={exports:{}},r(e.exports,e)),e.exports),fo=(r,e)=>{qP(r);for(var t in e)Zu(r,t,{get:e[t],enumerable:!0})},kJ=(r,e,t)=>{if(qP(r),e&&typeof e=="object"||typeof e=="function")for(let i of RJ(e))!TJ.call(r,i)&&i!=="default"&&Zu(r,i,{get:()=>e[i],enumerable:!(t=NP(e,i))||t.enumerable});return r},S=r=>r&&r.__esModule?r:kJ(Zu(r!=null?_J(PJ(r)):{},"default",{value:r,enumerable:!0}),r),Ty=(r,e,t,i)=>{for(var n=i>1?void 0:i?NP(e,t):e,o=r.length-1,s;o>=0;o--)(s=r[o])&&(n=(i?s(e,t,n):s(n))||n);return i&&n&&Zu(e,t,n),n};var BP=g((cSe,$P)=>{"use strict";var IJ="Function.prototype.bind called on incompatible ",Ry=Array.prototype.slice,FJ=Object.prototype.toString,AJ="[object Function]";$P.exports=function(e){var t=this;if(typeof t!="function"||FJ.call(t)!==AJ)throw new TypeError(IJ+t);for(var i=Ry.call(arguments,1),n,o=function(){if(this instanceof n){var c=t.apply(this,i.concat(Ry.call(arguments)));return Object(c)===c?c:this}else return t.apply(e,i.concat(Ry.call(arguments)))},s=Math.max(0,t.length-i.length),a=[],l=0;l<s;l++)a.push("$"+l);if(n=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(o),t.prototype){var u=function(){};u.prototype=t.prototype,n.prototype=new u,u.prototype=null}return n}});var un=g((fSe,jP)=>{"use strict";var OJ=BP();jP.exports=Function.prototype.bind||OJ});var ky=g((pSe,UP)=>{"use strict";var WP=Object.prototype.toString;UP.exports=function(e){var t=WP.call(e),i=t==="[object Arguments]";return i||(i=t!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&WP.call(e.callee)==="[object Function]"),i}});var ZP=g((dSe,HP)=>{"use strict";var zP;Object.keys||(Qu=Object.prototype.hasOwnProperty,Iy=Object.prototype.toString,GP=ky(),Fy=Object.prototype.propertyIsEnumerable,VP=!Fy.call({toString:null},"toString"),KP=Fy.call(function(){},"prototype"),ec=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Ed=function(r){var e=r.constructor;return e&&e.prototype===r},JP={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},YP=function(){if(typeof window=="undefined")return!1;for(var r in window)try{if(!JP["$"+r]&&Qu.call(window,r)&&window[r]!==null&&typeof window[r]=="object")try{Ed(window[r])}catch(e){return!0}}catch(e){return!0}return!1}(),XP=function(r){if(typeof window=="undefined"||!YP)return Ed(r);try{return Ed(r)}catch(e){return!1}},zP=function(e){var t=e!==null&&typeof e=="object",i=Iy.call(e)==="[object Function]",n=GP(e),o=t&&Iy.call(e)==="[object String]",s=[];if(!t&&!i&&!n)throw new TypeError("Object.keys called on a non-object");var a=KP&&i;if(o&&e.length>0&&!Qu.call(e,0))for(var l=0;l<e.length;++l)s.push(String(l));if(n&&e.length>0)for(var u=0;u<e.length;++u)s.push(String(u));else for(var c in e)!(a&&c==="prototype")&&Qu.call(e,c)&&s.push(String(c));if(VP)for(var f=XP(e),p=0;p<ec.length;++p)!(f&&ec[p]==="constructor")&&Qu.call(e,ec[p])&&s.push(ec[p]);return s});var Qu,Iy,GP,Fy,VP,KP,ec,Ed,JP,YP,XP;HP.exports=zP});var rT=g((hSe,QP)=>{"use strict";var LJ=Array.prototype.slice,MJ=ky(),eT=Object.keys,Cd=eT?function(e){return eT(e)}:ZP(),tT=Object.keys;Cd.shim=function(){if(Object.keys){var e=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);e||(Object.keys=function(i){return MJ(i)?tT(LJ.call(i)):tT(i)})}else Object.keys=Cd;return Object.keys||Cd};QP.exports=Cd});var Fn=g((mSe,iT)=>{"use strict";var NJ=rT(),qJ=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",$J=Object.prototype.toString,BJ=Array.prototype.concat,Ay=Object.defineProperty,jJ=function(r){return typeof r=="function"&&$J.call(r)==="[object Function]"},UJ=function(){var r={};try{Ay(r,"x",{enumerable:!1,value:r});for(var e in r)return!1;return r.x===r}catch(t){return!1}},nT=Ay&&UJ(),WJ=function(r,e,t,i){e in r&&(!jJ(i)||!i())||(nT?Ay(r,e,{configurable:!0,enumerable:!1,value:t,writable:!0}):r[e]=t)},oT=function(r,e){var t=arguments.length>2?arguments[2]:{},i=NJ(e);qJ&&(i=BJ.call(i,Object.getOwnPropertySymbols(e)));for(var n=0;n<i.length;n+=1)WJ(r,i[n],e[i[n]],t[i[n]])};oT.supportsDescriptors=!!nT;iT.exports=oT});var _d=g((gSe,sT)=>{"use strict";sT.exports=function(){if(typeof Promise!="function")throw new TypeError("`Promise.prototype.finally` requires a global `Promise` be available.")}});var Oy=g((vSe,aT)=>{"use strict";var lT=Function.prototype.toString,HJ=/^\s*class\b/,uT=function(e){try{var t=lT.call(e);return HJ.test(t)}catch(i){return!1}},zJ=function(e){try{return uT(e)?!1:(lT.call(e),!0)}catch(t){return!1}},GJ=Object.prototype.toString,VJ="[object Function]",KJ="[object GeneratorFunction]",JJ=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";aT.exports=function(e){if(!e||typeof e!="function"&&typeof e!="object")return!1;if(typeof e=="function"&&!e.prototype)return!0;if(JJ)return zJ(e);if(uT(e))return!1;var t=GJ.call(e);return t===VJ||t===KJ}});var fT=g((ySe,cT)=>{"use strict";cT.exports=Oy()});var dT=g((bSe,pT)=>{"use strict";pT.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},t=Symbol("test"),i=Object(t);if(typeof t=="string"||Object.prototype.toString.call(t)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[t]=n;for(t in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,t);if(s.value!==n||s.enumerable!==!0)return!1}return!0}});var Li=g((wSe,hT)=>{"use strict";var mT=global.Symbol,YJ=dT();hT.exports=function(){return typeof mT!="function"||typeof Symbol!="function"||typeof mT("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:YJ()}});var bT=g((xSe,gT)=>{"use strict";var J,tc=TypeError,gs=Object.getOwnPropertyDescriptor;if(gs)try{gs({},"")}catch(r){gs=null}var Ly=function(){throw new tc},XJ=gs?function(){try{return arguments.callee,Ly}catch(r){try{return gs(arguments,"callee").get}catch(e){return Ly}}}():Ly,po=Li()(),Mi=Object.getPrototypeOf||function(r){return r.__proto__},Pd,My=Pd?Mi(Pd):J,vT,Ny=vT?vT.constructor:J,rc,qy=rc?Mi(rc):J,$y=rc?rc():J,By=typeof Uint8Array=="undefined"?J:Mi(Uint8Array),jy={"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?J:ArrayBuffer,"%ArrayBufferPrototype%":typeof ArrayBuffer=="undefined"?J:ArrayBuffer.prototype,"%ArrayIteratorPrototype%":po?Mi([][Symbol.iterator]()):J,"%ArrayPrototype%":Array.prototype,"%ArrayProto_entries%":Array.prototype.entries,"%ArrayProto_forEach%":Array.prototype.forEach,"%ArrayProto_keys%":Array.prototype.keys,"%ArrayProto_values%":Array.prototype.values,"%AsyncFromSyncIteratorPrototype%":J,"%AsyncFunction%":Ny,"%AsyncFunctionPrototype%":Ny?Ny.prototype:J,"%AsyncGenerator%":rc?Mi($y):J,"%AsyncGeneratorFunction%":qy,"%AsyncGeneratorPrototype%":qy?qy.prototype:J,"%AsyncIteratorPrototype%":$y&&po&&Symbol.asyncIterator?$y[Symbol.asyncIterator]():J,"%Atomics%":typeof Atomics=="undefined"?J:Atomics,"%Boolean%":Boolean,"%BooleanPrototype%":Boolean.prototype,"%DataView%":typeof DataView=="undefined"?J:DataView,"%DataViewPrototype%":typeof DataView=="undefined"?J:DataView.prototype,"%Date%":Date,"%DatePrototype%":Date.prototype,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%ErrorPrototype%":Error.prototype,"%eval%":eval,"%EvalError%":EvalError,"%EvalErrorPrototype%":EvalError.prototype,"%Float32Array%":typeof Float32Array=="undefined"?J:Float32Array,"%Float32ArrayPrototype%":typeof Float32Array=="undefined"?J:Float32Array.prototype,"%Float64Array%":typeof Float64Array=="undefined"?J:Float64Array,"%Float64ArrayPrototype%":typeof Float64Array=="undefined"?J:Float64Array.prototype,"%Function%":Function,"%FunctionPrototype%":Function.prototype,"%Generator%":Pd?Mi(Pd()):J,"%GeneratorFunction%":My,"%GeneratorPrototype%":My?My.prototype:J,"%Int8Array%":typeof Int8Array=="undefined"?J:Int8Array,"%Int8ArrayPrototype%":typeof Int8Array=="undefined"?J:Int8Array.prototype,"%Int16Array%":typeof Int16Array=="undefined"?J:Int16Array,"%Int16ArrayPrototype%":typeof Int16Array=="undefined"?J:Int8Array.prototype,"%Int32Array%":typeof Int32Array=="undefined"?J:Int32Array,"%Int32ArrayPrototype%":typeof Int32Array=="undefined"?J:Int32Array.prototype,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":po?Mi(Mi([][Symbol.iterator]())):J,"%JSON%":typeof JSON=="object"?JSON:J,"%JSONParse%":typeof JSON=="object"?JSON.parse:J,"%Map%":typeof Map=="undefined"?J:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!po?J:Mi(new Map()[Symbol.iterator]()),"%MapPrototype%":typeof Map=="undefined"?J:Map.prototype,"%Math%":Math,"%Number%":Number,"%NumberPrototype%":Number.prototype,"%Object%":Object,"%ObjectPrototype%":Object.prototype,"%ObjProto_toString%":Object.prototype.toString,"%ObjProto_valueOf%":Object.prototype.valueOf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?J:Promise,"%PromisePrototype%":typeof Promise=="undefined"?J:Promise.prototype,"%PromiseProto_then%":typeof Promise=="undefined"?J:Promise.prototype.then,"%Promise_all%":typeof Promise=="undefined"?J:Promise.all,"%Promise_reject%":typeof Promise=="undefined"?J:Promise.reject,"%Promise_resolve%":typeof Promise=="undefined"?J:Promise.resolve,"%Proxy%":typeof Proxy=="undefined"?J:Proxy,"%RangeError%":RangeError,"%RangeErrorPrototype%":RangeError.prototype,"%ReferenceError%":ReferenceError,"%ReferenceErrorPrototype%":ReferenceError.prototype,"%Reflect%":typeof Reflect=="undefined"?J:Reflect,"%RegExp%":RegExp,"%RegExpPrototype%":RegExp.prototype,"%Set%":typeof Set=="undefined"?J:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!po?J:Mi(new Set()[Symbol.iterator]()),"%SetPrototype%":typeof Set=="undefined"?J:Set.prototype,"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?J:SharedArrayBuffer,"%SharedArrayBufferPrototype%":typeof SharedArrayBuffer=="undefined"?J:SharedArrayBuffer.prototype,"%String%":String,"%StringIteratorPrototype%":po?Mi(""[Symbol.iterator]()):J,"%StringPrototype%":String.prototype,"%Symbol%":po?Symbol:J,"%SymbolPrototype%":po?Symbol.prototype:J,"%SyntaxError%":SyntaxError,"%SyntaxErrorPrototype%":SyntaxError.prototype,"%ThrowTypeError%":XJ,"%TypedArray%":By,"%TypedArrayPrototype%":By?By.prototype:J,"%TypeError%":tc,"%TypeErrorPrototype%":tc.prototype,"%Uint8Array%":typeof Uint8Array=="undefined"?J:Uint8Array,"%Uint8ArrayPrototype%":typeof Uint8Array=="undefined"?J:Uint8Array.prototype,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?J:Uint8ClampedArray,"%Uint8ClampedArrayPrototype%":typeof Uint8ClampedArray=="undefined"?J:Uint8ClampedArray.prototype,"%Uint16Array%":typeof Uint16Array=="undefined"?J:Uint16Array,"%Uint16ArrayPrototype%":typeof Uint16Array=="undefined"?J:Uint16Array.prototype,"%Uint32Array%":typeof Uint32Array=="undefined"?J:Uint32Array,"%Uint32ArrayPrototype%":typeof Uint32Array=="undefined"?J:Uint32Array.prototype,"%URIError%":URIError,"%URIErrorPrototype%":URIError.prototype,"%WeakMap%":typeof WeakMap=="undefined"?J:WeakMap,"%WeakMapPrototype%":typeof WeakMap=="undefined"?J:WeakMap.prototype,"%WeakSet%":typeof WeakSet=="undefined"?J:WeakSet,"%WeakSetPrototype%":typeof WeakSet=="undefined"?J:WeakSet.prototype},ZJ=un(),yT=ZJ.call(Function.call,String.prototype.replace),QJ=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,eY=/\\(\\)?/g,tY=function(e){var t=[];return yT(e,QJ,function(i,n,o,s){t[t.length]=o?yT(s,eY,"$1"):n||i}),t},rY=function(e,t){if(!(e in jy))throw new SyntaxError("intrinsic "+e+" does not exist!");if(typeof jy[e]=="undefined"&&!t)throw new tc("intrinsic "+e+" exists, but is not available. Please file an issue!");return jy[e]};gT.exports=function(e,t){if(typeof e!="string"||e.length===0)throw new TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new TypeError('"allowMissing" argument must be a boolean');for(var i=tY(e),n=rY("%"+(i.length>0?i[0]:"")+"%",t),o=1;o<i.length;o+=1)if(n!=null)if(gs&&o+1>=i.length){var s=gs(n,i[o]);if(!t&&!(i[o]in n))throw new tc("base intrinsic for "+e+" exists, but the property is not available.");n=s?s.get||s.value:n[i[o]]}else n=n[i[o]];return n}});var xT=g((DSe,wT)=>{"use strict";wT.exports=function(e){return typeof e=="function"&&!!e.prototype}});var ST=g((SSe,DT)=>{"use strict";DT.exports=function(e){if(e===null)return"Null";if(typeof e=="undefined")return"Undefined";if(typeof e=="function"||typeof e=="object")return"Object";if(typeof e=="number")return"Number";if(typeof e=="boolean")return"Boolean";if(typeof e=="string")return"String"}});var Uy=g((ESe,ET)=>{"use strict";var iY=ST();ET.exports=function(e){return typeof e=="symbol"?"Symbol":iY(e)}});var RT=g((CSe,CT)=>{"use strict";var _T=bT(),PT=_T("%Symbol.species%",!0),Wy=_T("%TypeError%"),nY=xT(),TT=Uy();CT.exports=function(e,t){if(TT(e)!=="Object")throw new Wy("Assertion failed: Type(O) is not Object");var i=e.constructor;if(typeof i=="undefined")return t;if(TT(i)!=="Object")throw new Wy("O.constructor is not an Object");var n=PT?i[PT]:void 0;if(n==null)return t;if(nY(n))return n;throw new Wy("no constructor found")}});var Gy=g((_Se,kT)=>{"use strict";var oY=_d();oY();var sY=fT(),aY=RT(),lY=Uy(),IT=function(e,t){return new e(function(i){i(t)})},uY=Promise,cY=function(e,t){return function(i){var n=t(),o=IT(e,n),s=function(){return i};return o.then(s)}},fY=function(e,t){return function(i){var n=t(),o=IT(e,n),s=function(){throw i};return o.then(s)}},Hy=function(e){var t=this;if(lY(t)!=="Object")throw new TypeError("receiver is not an Object");var i=aY(t,uY),n=e,o=e;return sY(e)&&(n=cY(i,e),o=fY(i,e)),t.then(n,o)};Object.getOwnPropertyDescriptor&&(zy=Object.getOwnPropertyDescriptor(Hy,"name"),zy&&zy.configurable&&Object.defineProperty(Hy,"name",{configurable:!0,value:"finally"}));var zy;kT.exports=Hy});var Vy=g((PSe,FT)=>{"use strict";var pY=_d(),dY=Gy();FT.exports=function(){return pY(),typeof Promise.prototype.finally=="function"?Promise.prototype.finally:dY}});var OT=g((TSe,AT)=>{"use strict";var hY=_d(),mY=Vy(),gY=Fn();AT.exports=function(){hY();var e=mY();return gY(Promise.prototype,{finally:e},{finally:function(){return Promise.prototype.finally!==e}}),e}});var qT=g((RSe,LT)=>{"use strict";var vY=un(),yY=Fn(),bY=Gy(),MT=Vy(),wY=OT(),NT=vY.call(Function.call,MT());yY(NT,{getPolyfill:MT,implementation:bY,shim:wY});LT.exports=NT});var BT=g((kSe,$T)=>{var Ma=1e3,Na=Ma*60,qa=Na*60,vs=qa*24,xY=vs*7,DY=vs*365.25;$T.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return SY(r);if(t==="number"&&isFinite(r))return e.long?CY(r):EY(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function SY(r){if(r=String(r),!(r.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(r);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*DY;case"weeks":case"week":case"w":return t*xY;case"days":case"day":case"d":return t*vs;case"hours":case"hour":case"hrs":case"hr":case"h":return t*qa;case"minutes":case"minute":case"mins":case"min":case"m":return t*Na;case"seconds":case"second":case"secs":case"sec":case"s":return t*Ma;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function EY(r){var e=Math.abs(r);return e>=vs?Math.round(r/vs)+"d":e>=qa?Math.round(r/qa)+"h":e>=Na?Math.round(r/Na)+"m":e>=Ma?Math.round(r/Ma)+"s":r+"ms"}function CY(r){var e=Math.abs(r);return e>=vs?Td(r,e,vs,"day"):e>=qa?Td(r,e,qa,"hour"):e>=Na?Td(r,e,Na,"minute"):e>=Ma?Td(r,e,Ma,"second"):r+" ms"}function Td(r,e,t,i){var n=e>=t*1.5;return Math.round(r/t)+" "+i+(n?"s":"")}});var Ky=g((ISe,jT)=>{function _Y(r){t.debug=t,t.default=t,t.coerce=u,t.disable=s,t.enable=o,t.enabled=a,t.humanize=BT(),Object.keys(r).forEach(c=>{t[c]=r[c]}),t.instances=[],t.names=[],t.skips=[],t.formatters={};function e(c){let f=0;for(let p=0;p<c.length;p++)f=(f<<5)-f+c.charCodeAt(p),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(c){let f;function p(...d){if(!p.enabled)return;let h=p,m=Number(new Date),y=m-(f||m);h.diff=y,h.prev=f,h.curr=m,f=m,d[0]=t.coerce(d[0]),typeof d[0]!="string"&&d.unshift("%O");let v=0;d[0]=d[0].replace(/%([a-zA-Z%])/g,(w,E)=>{if(w==="%%")return w;v++;let P=t.formatters[E];if(typeof P=="function"){let k=d[v];w=P.call(h,k),d.splice(v,1),v--}return w}),t.formatArgs.call(h,d),(h.log||t.log).apply(h,d)}return p.namespace=c,p.enabled=t.enabled(c),p.useColors=t.useColors(),p.color=e(c),p.destroy=i,p.extend=n,typeof t.init=="function"&&t.init(p),t.instances.push(p),p}function i(){let c=t.instances.indexOf(this);return c!==-1?(t.instances.splice(c,1),!0):!1}function n(c,f){let p=t(this.namespace+(typeof f=="undefined"?":":f)+c);return p.log=this.log,p}function o(c){t.save(c),t.names=[],t.skips=[];let f,p=(typeof c=="string"?c:"").split(/[\s,]+/),d=p.length;for(f=0;f<d;f++)!p[f]||(c=p[f].replace(/\*/g,".*?"),c[0]==="-"?t.skips.push(new RegExp("^"+c.substr(1)+"$")):t.names.push(new RegExp("^"+c+"$")));for(f=0;f<t.instances.length;f++){let h=t.instances[f];h.enabled=t.enabled(h.namespace)}}function s(){let c=[...t.names.map(l),...t.skips.map(l).map(f=>"-"+f)].join(",");return t.enable(""),c}function a(c){if(c[c.length-1]==="*")return!0;let f,p;for(f=0,p=t.skips.length;f<p;f++)if(t.skips[f].test(c))return!1;for(f=0,p=t.names.length;f<p;f++)if(t.names[f].test(c))return!0;return!1}function l(c){return c.toString().substring(2,c.toString().length-2).replace(/\.\*\?$/,"*")}function u(c){return c instanceof Error?c.stack||c.message:c}return t.enable(t.load()),t}jT.exports=_Y});var UT=g((ai,Rd)=>{ai.log=PY;ai.formatArgs=TY;ai.save=RY;ai.load=kY;ai.useColors=IY;ai.storage=FY();ai.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function IY(){return typeof window!="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document!="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function TY(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+Rd.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,i=0;r[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(t++,n==="%c"&&(i=t))}),r.splice(i,0,e)}function PY(...r){return typeof console=="object"&&console.log&&console.log(...r)}function RY(r){try{r?ai.storage.setItem("debug",r):ai.storage.removeItem("debug")}catch(e){}}function kY(){let r;try{r=ai.storage.getItem("debug")}catch(e){}return!r&&typeof process!="undefined"&&"env"in process&&(r=process.env.DEBUG),r}function FY(){try{return localStorage}catch(r){}}Rd.exports=Ky()(ai);var{formatters:AY}=Rd.exports;AY.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var HT=g((FSe,WT)=>{"use strict";WT.exports=(r,e=process.argv)=>{let t=r.startsWith("-")?"":r.length===1?"-":"--",i=e.indexOf(t+r),n=e.indexOf("--");return i!==-1&&(n===-1||i<n)}});var VT=g((ASe,zT)=>{"use strict";var OY=require("os"),GT=require("tty"),li=HT(),{env:Pt}=process,ho;li("no-color")||li("no-colors")||li("color=false")||li("color=never")?ho=0:(li("color")||li("colors")||li("color=true")||li("color=always"))&&(ho=1);"FORCE_COLOR"in Pt&&(Pt.FORCE_COLOR==="true"?ho=1:Pt.FORCE_COLOR==="false"?ho=0:ho=Pt.FORCE_COLOR.length===0?1:Math.min(parseInt(Pt.FORCE_COLOR,10),3));function Jy(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function Yy(r,e){if(ho===0)return 0;if(li("color=16m")||li("color=full")||li("color=truecolor"))return 3;if(li("color=256"))return 2;if(r&&!e&&ho===void 0)return 0;let t=ho||0;if(Pt.TERM==="dumb")return t;if(process.platform==="win32"){let i=OY.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in Pt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(i=>i in Pt)||Pt.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in Pt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Pt.TEAMCITY_VERSION)?1:0;if("GITHUB_ACTIONS"in Pt)return 1;if(Pt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Pt){let i=parseInt((Pt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Pt.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Pt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Pt.TERM)||"COLORTERM"in Pt?1:t}function LY(r){let e=Yy(r,r&&r.isTTY);return Jy(e)}zT.exports={supportsColor:LY,stdout:Jy(Yy(!0,GT.isatty(1))),stderr:Jy(Yy(!0,GT.isatty(2)))}});var JT=g((Qt,kd)=>{var MY=require("tty"),Xy=require("util");Qt.init=NY;Qt.log=qY;Qt.formatArgs=$Y;Qt.save=BY;Qt.load=jY;Qt.useColors=UY;Qt.colors=[6,2,3,4,5,1];try{let r=VT();r&&(r.stderr||r).level>=2&&(Qt.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(r){}Qt.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(n,o)=>o.toUpperCase()),i=process.env[e];return/^(yes|on|true|enabled)$/i.test(i)?i=!0:/^(no|off|false|disabled)$/i.test(i)?i=!1:i==="null"?i=null:i=Number(i),r[t]=i,r},{});function UY(){return"colors"in Qt.inspectOpts?Boolean(Qt.inspectOpts.colors):MY.isatty(process.stderr.fd)}function $Y(r){let{namespace:e,useColors:t}=this;if(t){let i=this.color,n="[3"+(i<8?i:"8;5;"+i),o=` ${n};1m${e} [0m`;r[0]=o+r[0].split(`
|
||
`).join(`
|
||
`+o),r.push(n+"m+"+kd.exports.humanize(this.diff)+"[0m")}else r[0]=WY()+e+" "+r[0]}function WY(){return Qt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function qY(...r){return process.stderr.write(Xy.format(...r)+`
|
||
`)}function BY(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function jY(){return process.env.DEBUG}function NY(r){r.inspectOpts={};let e=Object.keys(Qt.inspectOpts);for(let t=0;t<e.length;t++)r.inspectOpts[e[t]]=Qt.inspectOpts[e[t]]}kd.exports=Ky()(Qt);var{formatters:KT}=kd.exports;KT.o=function(r){return this.inspectOpts.colors=this.useColors,Xy.inspect(r,this.inspectOpts).replace(/\s*\n\s*/g," ")};KT.O=function(r){return this.inspectOpts.colors=this.useColors,Xy.inspect(r,this.inspectOpts)}});var gt=g((OSe,Zy)=>{typeof process=="undefined"||process.type==="renderer"||process.browser===!0||process.__nwjs?Zy.exports=UT():Zy.exports=JT()});var XT=g((LSe,YT)=>{"use strict";YT.exports=HY;function HY(r){if(r=r||{},r.circles)return zY(r);return r.proto?i:t;function e(n,o){for(var s=Object.keys(n),a=new Array(s.length),l=0;l<s.length;l++){var u=s[l],c=n[u];typeof c!="object"||c===null?a[u]=c:c instanceof Date?a[u]=new Date(c):a[u]=o(c)}return a}function t(n){if(typeof n!="object"||n===null)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return e(n,t);var o={};for(var s in n)if(Object.hasOwnProperty.call(n,s)!==!1){var a=n[s];typeof a!="object"||a===null?o[s]=a:a instanceof Date?o[s]=new Date(a):o[s]=t(a)}return o}function i(n){if(typeof n!="object"||n===null)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return e(n,i);var o={};for(var s in n){var a=n[s];typeof a!="object"||a===null?o[s]=a:a instanceof Date?o[s]=new Date(a):o[s]=i(a)}return o}}function zY(r){var e=[],t=[];return r.proto?o:n;function i(s,a){for(var l=Object.keys(s),u=new Array(l.length),c=0;c<l.length;c++){var f=l[c],p=s[f];if(typeof p!="object"||p===null)u[f]=p;else if(p instanceof Date)u[f]=new Date(p);else{var d=e.indexOf(p);d!==-1?u[f]=t[d]:u[f]=a(p)}}return u}function n(s){if(typeof s!="object"||s===null)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return i(s,n);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{var c=e.indexOf(u);c!==-1?a[l]=t[c]:a[l]=n(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);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{var c=e.indexOf(u);c!==-1?a[l]=t[c]:a[l]=o(u)}}return e.pop(),t.pop(),a}}});var bs=g((MSe,ZT)=>{var GY=require("util"),ys=gt()("log4js:configuration"),Id=[],Fd=[],QT=r=>!r,eR=r=>r&&typeof r=="object"&&!Array.isArray(r),VY=r=>/^[A-Za-z][A-Za-z0-9_]*$/g.test(r),KY=r=>r&&typeof r=="number"&&Number.isInteger(r),JY=r=>{Fd.push(r),ys(`Added listener, now ${Fd.length} listeners`)},YY=r=>{Id.push(r),ys(`Added pre-processing listener, now ${Id.length} listeners`)},tR=(r,e,t)=>{(Array.isArray(e)?e:[e]).forEach(n=>{if(n)throw new Error(`Problem with log4js configuration: (${GY.inspect(r,{depth:5})}) - ${t}`)})},XY=r=>{ys("New configuration to be validated: ",r),tR(r,QT(eR(r)),"must be an object."),ys(`Calling pre-processing listeners (${Id.length})`),Id.forEach(e=>e(r)),ys("Configuration pre-processing finished."),ys(`Calling configuration listeners (${Fd.length})`),Fd.forEach(e=>e(r)),ys("Configuration finished.")};ZT.exports={configure:XY,addListener:JY,addPreProcessingListener:YY,throwExceptionIf:tR,anObject:eR,anInteger:KY,validIdentifier:VY,not:QT}});var nR=g((NSe,ui)=>{"use strict";function rR(r,e){for(var t=r.toString();t.length<e;)t="0"+t;return t}function ws(r){return rR(r,2)}function ZY(r){var e=Math.abs(r),t=String(Math.floor(e/60)),i=String(e%60);return t.length===1&&(t="0"+t),i.length===1&&(i="0"+i),r<0?"+"+t+i:"-"+t+i}function iR(r,e){typeof r!="string"&&(e=r,r=ui.exports.ISO8601_FORMAT),e||(e=ui.exports.now());var t=ws(e.getDate()),i=ws(e.getMonth()+1),n=ws(e.getFullYear()),o=ws(n.substring(2,4)),s=r.indexOf("yyyy")>-1?n:o,a=ws(e.getHours()),l=ws(e.getMinutes()),u=ws(e.getSeconds()),c=rR(e.getMilliseconds(),3),f=ZY(e.getTimezoneOffset()),p=r.replace(/dd/g,t).replace(/MM/g,i).replace(/y{1,4}/g,s).replace(/hh/g,a).replace(/mm/g,l).replace(/ss/g,u).replace(/SSS/g,c).replace(/O/g,f);return p}function xs(r,e,t,i){r["set"+(i?"":"UTC")+e](t)}function QY(r,e,t){var i=r.indexOf("O")<0,n=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(c,f){xs(c,"FullYear",f,i)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(c,f){xs(c,"Month",f-1,i)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(c,f){xs(c,"Date",f,i)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(c,f){xs(c,"Hours",f,i)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(c,f){xs(c,"Minutes",f,i)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(c,f){xs(c,"Seconds",f,i)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(c,f){xs(c,"Milliseconds",f,i)}},{pattern:/O/,regexp:"[+-]\\d{3,4}|Z",fn:function(c,f){f==="Z"&&(f=0);var p=Math.abs(f),d=(f>0?-1:1)*(p%100+Math.floor(p/100)*60);c.setUTCMinutes(c.getUTCMinutes()+d)}}],o=n.reduce(function(c,f){return f.pattern.test(c.regexp)?(f.index=c.regexp.match(f.pattern).index,c.regexp=c.regexp.replace(f.pattern,"("+f.regexp+")")):f.index=-1,c},{regexp:r,index:[]}),s=n.filter(function(c){return c.index>-1});s.sort(function(c,f){return c.index-f.index});var a=new RegExp(o.regexp),l=a.exec(e);if(l){var u=t||ui.exports.now();return s.forEach(function(c,f){c.fn(u,l[f+1])}),u}throw new Error("String '"+e+"' could not be parsed as '"+r+"'")}function eX(r,e,t){if(!r)throw new Error("pattern must be supplied");return QY(r,e,t)}function tX(){return new Date}ui.exports=iR;ui.exports.asString=iR;ui.exports.parse=eX;ui.exports.now=tX;ui.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS";ui.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO";ui.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS";ui.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"});var eb=g((qSe,oR)=>{var mo=nR(),sR=require("os"),ic=require("util"),aR=require("path"),lR={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[90,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[91,39],yellow:[33,39]};function uR(r){return r?`[${lR[r][0]}m`:""}function cR(r){return r?`[${lR[r][1]}m`:""}function rX(r,e){return uR(e)+r+cR(e)}function fR(r,e){return rX(ic.format("[%s] [%s] %s - ",mo.asString(r.startTime),r.level.toString(),r.categoryName),e)}function pR(r){return fR(r)+ic.format(...r.data)}function Ad(r){return fR(r,r.level.colour)+ic.format(...r.data)}function dR(r){return ic.format(...r.data)}function hR(r){return r.data[0]}function mR(r,e){let t="%r %p %c - %m%n",i=/%(-?[0-9]+)?(\.?-?[0-9]+)?([[\]cdhmnprzxXyflos%])(\{([^}]+)\})?|([^%]+)/;r=r||t;function n(R,F){let q=R.categoryName;if(F){let K=parseInt(F,10),ae=q.split(".");K<ae.length&&(q=ae.slice(ae.length-K).join("."))}return q}function o(R,F){let q=mo.ISO8601_FORMAT;return F&&(q=F,q==="ISO8601"?q=mo.ISO8601_FORMAT:q==="ISO8601_WITH_TZ_OFFSET"?q=mo.ISO8601_WITH_TZ_OFFSET_FORMAT:q==="ABSOLUTE"?q=mo.ABSOLUTETIME_FORMAT:q==="DATE"&&(q=mo.DATETIME_FORMAT)),mo.asString(q,R.startTime)}function s(){return sR.hostname().toString()}function a(R){return ic.format(...R.data)}function l(){return sR.EOL}function u(R){return R.level.toString()}function c(R){return mo.asString("hh:mm:ss",R.startTime)}function f(R){return uR(R.level.colour)}function p(R){return cR(R.level.colour)}function d(){return"%"}function h(R){return R&&R.pid?R.pid.toString():process.pid.toString()}function m(){return h()}function y(R,F){return typeof e[F]!="undefined"?typeof e[F]=="function"?e[F](R):e[F]:null}function v(R,F){let q=R.context[F];return typeof q!="undefined"?typeof q=="function"?q(R):q:null}function x(R,F){let q=R.fileName||"";if(F){let K=parseInt(F,10),ae=q.split(aR.sep);ae.length>K&&(q=ae.slice(-K).join(aR.sep))}return q}function w(R){return R.lineNumber?`${R.lineNumber}`:""}function E(R){return R.columnNumber?`${R.columnNumber}`:""}function P(R){return R.callStack||""}let k={c:n,d:o,h:s,m:a,n:l,p:u,r:c,"[":f,"]":p,y:m,z:h,"%":d,x:y,X:v,f:x,l:w,o:E,s:P};function _(R,F,q){return k[R](F,q)}function O(R,F){let q;return R?(q=parseInt(R.substr(1),10),q>0?F.slice(0,q):F.slice(q)):F}function I(R,F){let q;if(R)if(R.charAt(0)==="-")for(q=parseInt(R.substr(1),10);F.length<q;)F+=" ";else for(q=parseInt(R,10);F.length<q;)F=` ${F}`;return F}function L(R,F,q){let K=R;return K=O(F,K),K=I(q,K),K}return function(R){let F="",q,K=r;for(;(q=i.exec(K))!==null;){let ae=q[1],Pe=q[2],We=q[3],Yt=q[5],Nt=q[6];if(Nt)F+=Nt.toString();else{let dr=_(We,R,Yt);F+=L(dr,Pe,ae)}K=K.substr(q.index+q[0].length)}return F}}var Qy={messagePassThrough(){return dR},basic(){return pR},colored(){return Ad},coloured(){return Ad},pattern(r){return mR(r&&r.pattern,r&&r.tokens)},dummy(){return hR}};oR.exports={basicLayout:pR,messagePassThroughLayout:dR,patternLayout:mR,colouredLayout:Ad,coloredLayout:Ad,dummyLayout:hR,addLayout(r,e){Qy[r]=e},layout(r,e){return Qy[r]&&Qy[r](e)}}});var Ds=g(($Se,gR)=>{var vt=bs(),vR=["white","grey","black","blue","cyan","green","magenta","red","yellow"],Tt=class{constructor(e,t,i){this.level=e,this.levelStr=t,this.colour=i}toString(){return this.levelStr}static getLevel(e,t){return e?e instanceof Tt?e:(e instanceof Object&&e.levelStr&&(e=e.levelStr),Tt[e.toString().toUpperCase()]||t):t}static addLevels(e){e&&(Object.keys(e).forEach(i=>{let n=i.toUpperCase();Tt[n]=new Tt(e[i].value,n,e[i].colour);let o=Tt.levels.findIndex(s=>s.levelStr===n);o>-1?Tt.levels[o]=Tt[n]:Tt.levels.push(Tt[n])}),Tt.levels.sort((i,n)=>i.level-n.level))}isLessThanOrEqualTo(e){return typeof e=="string"&&(e=Tt.getLevel(e)),this.level<=e.level}isGreaterThanOrEqualTo(e){return typeof e=="string"&&(e=Tt.getLevel(e)),this.level>=e.level}isEqualTo(e){return typeof e=="string"&&(e=Tt.getLevel(e)),this.level===e.level}};Tt.levels=[];Tt.addLevels({ALL:{value:Number.MIN_VALUE,colour:"grey"},TRACE:{value:5e3,colour:"blue"},DEBUG:{value:1e4,colour:"cyan"},INFO:{value:2e4,colour:"green"},WARN:{value:3e4,colour:"yellow"},ERROR:{value:4e4,colour:"red"},FATAL:{value:5e4,colour:"magenta"},MARK:{value:9007199254740992,colour:"grey"},OFF:{value:Number.MAX_VALUE,colour:"grey"}});vt.addListener(r=>{let e=r.levels;e&&(vt.throwExceptionIf(r,vt.not(vt.anObject(e)),"levels must be an object"),Object.keys(e).forEach(i=>{vt.throwExceptionIf(r,vt.not(vt.validIdentifier(i)),`level name "${i}" is not a valid identifier (must start with a letter, only contain A-Z,a-z,0-9,_)`),vt.throwExceptionIf(r,vt.not(vt.anObject(e[i])),`level "${i}" must be an object`),vt.throwExceptionIf(r,vt.not(e[i].value),`level "${i}" must have a 'value' property`),vt.throwExceptionIf(r,vt.not(vt.anInteger(e[i].value)),`level "${i}".value must have an integer value`),vt.throwExceptionIf(r,vt.not(e[i].colour),`level "${i}" must have a 'colour' property`),vt.throwExceptionIf(r,vt.not(vR.indexOf(e[i].colour)>-1),`level "${i}".colour must be one of ${vR.join(", ")}`)}))});vt.addListener(r=>{Tt.addLevels(r.levels)});gR.exports=Tt});var yR=g(iX=>{fo(iX,{default:()=>nX,parse:()=>oX,stringify:()=>sX});var tb=function(r,e){var t={parse:function(u,c){var f=JSON.parse(u,a).map(s),p=f[0],d=c||i,h=typeof p=="object"&&p?n(f,new Set,p,d):p;return d.call({"":h},"",h)},stringify:function(u,c,f){for(var p,d=new Map,h=[],m=[],y=c&&typeof c==typeof h?function(w,E){if(w===""||-1<c.indexOf(w))return E}:c||i,v=+o(d,h,y.call({"":u},"",u)),x=function(w,E){if(p)return p=!p,E;var P=y.call(this,w,E);switch(typeof P){case"object":if(P===null)return P;case e:return d.get(P)||o(d,h,P)}return P};v<h.length;v++)p=!0,m[v]=JSON.stringify(h[v],x,f);return"["+m.join(",")+"]"}};return t;function i(l,u){return u}function n(l,u,c,f){return Object.keys(c).reduce(function(p,d){var h=p[d];if(h instanceof r){var m=l[h];typeof m=="object"&&!u.has(m)?(u.add(m),p[d]=f.call(p,d,n(l,u,m,f))):p[d]=f.call(p,d,m)}else p[d]=f.call(p,d,h);return p},c)}function o(l,u,c){var f=r(u.push(c)-1);return l.set(c,f),f}function s(l){return l instanceof r?r(l):l}function a(l,u){return typeof u===e?new r(u):u}}(String,"string"),nX=tb,oX=tb.parse,sX=tb.stringify});var rb=g((jSe,bR)=>{var wR=yR(),xR=Ds(),nc=class{constructor(e,t,i,n,o){this.startTime=new Date,this.categoryName=e,this.data=i,this.level=t,this.context=Object.assign({},n),this.pid=process.pid,o&&(this.functionName=o.functionName,this.fileName=o.fileName,this.lineNumber=o.lineNumber,this.columnNumber=o.columnNumber,this.callStack=o.callStack)}serialise(){let e=this.data.map(t=>(t&&t.message&&t.stack&&(t=Object.assign({message:t.message,stack:t.stack},t)),t));return this.data=e,wR.stringify(this)}static deserialise(e){let t;try{let i=wR.parse(e);i.data=i.data.map(n=>{if(n&&n.message&&n.stack){let o=new Error(n);Object.keys(n).forEach(s=>{o[s]=n[s]}),n=o}return n}),t=new nc(i.categoryName,xR.getLevel(i.level.levelStr),i.data,i.context),t.startTime=new Date(i.startTime),t.pid=i.pid,t.cluster=i.cluster}catch(i){t=new nc("log4js",xR.ERROR,["Unable to parse log:",e,"because: ",i])}return t}};bR.exports=nc});var Ld=g((USe,DR)=>{var ci=gt()("log4js:clustering"),aX=rb(),lX=bs(),$a=!1,cn=null;try{cn=require("cluster")}catch(r){ci("cluster module not present"),$a=!0}var ib=[],oc=!1,sc="NODE_APP_INSTANCE",SR=()=>oc&&process.env[sc]==="0",nb=()=>$a||cn.isMaster||SR(),ER=r=>{ib.forEach(e=>e(r))},Od=(r,e)=>{if(ci("cluster message received from worker ",r,": ",e),r.topic&&r.data&&(e=r,r=void 0),e&&e.topic&&e.topic==="log4js:message"){ci("received message: ",e.data);let t=aX.deserialise(e.data);ER(t)}};$a||lX.addListener(r=>{ib.length=0,{pm2:oc,disableClustering:$a,pm2InstanceVar:sc="NODE_APP_INSTANCE"}=r,ci(`clustering disabled ? ${$a}`),ci(`cluster.isMaster ? ${cn&&cn.isMaster}`),ci(`pm2 enabled ? ${oc}`),ci(`pm2InstanceVar = ${sc}`),ci(`process.env[${sc}] = ${process.env[sc]}`),oc&&process.removeListener("message",Od),cn&&cn.removeListener&&cn.removeListener("message",Od),$a||r.disableClustering?ci("Not listening for cluster messages, because clustering disabled."):SR()?(ci("listening for PM2 broadcast messages"),process.on("message",Od)):cn.isMaster?(ci("listening for cluster messages"),cn.on("message",Od)):ci("not listening for messages, because we are not a master process")});DR.exports={onlyOnMaster:(r,e)=>nb()?r():e,isMaster:nb,send:r=>{nb()?ER(r):(oc||(r.cluster={workerId:cn.worker.id,worker:process.pid}),process.send({topic:"log4js:message",data:r.serialise()}))},onMessage:r=>{ib.push(r)}}});var TR=g((WSe,CR)=>{function uX(r){if(typeof r=="number"&&Number.isInteger(r))return r;let e={K:1024,M:1024*1024,G:1024*1024*1024},t=Object.keys(e),i=r.substr(r.length-1).toLocaleUpperCase(),n=r.substring(0,r.length-1).trim();if(t.indexOf(i)<0||!Number.isInteger(Number(n)))throw Error(`maxLogSize: "${r}" is invalid`);return n*e[i]}function cX(r,e){let t=Object.assign({},e);return Object.keys(r).forEach(i=>{t[i]&&(t[i]=r[i](e[i]))}),t}function _R(r){return cX({maxLogSize:uX},r)}var PR={file:_R,fileSync:_R};CR.exports.modifyConfig=r=>PR[r.type]?PR[r.type](r):r});var kR=g((HSe,RR)=>{var fX=console.log.bind(console);function pX(r,e){return t=>{fX(r(t,e))}}function dX(r,e){let t=e.colouredLayout;return r.layout&&(t=e.layout(r.layout.type,r.layout)),pX(t,r.timezoneOffset)}RR.exports.configure=dX});var FR=g(IR=>{function hX(r,e){return t=>{process.stdout.write(`${r(t,e)}
|
||
`)}}function mX(r,e){let t=e.colouredLayout;return r.layout&&(t=e.layout(r.layout.type,r.layout)),hX(t,r.timezoneOffset)}IR.configure=mX});var OR=g((GSe,AR)=>{function gX(r,e){return t=>{process.stderr.write(`${r(t,e)}
|
||
`)}}function vX(r,e){let t=e.colouredLayout;return r.layout&&(t=e.layout(r.layout.type,r.layout)),gX(t,r.timezoneOffset)}AR.exports.configure=vX});var MR=g((VSe,LR)=>{function yX(r,e,t,i){let n=i.getLevel(r),o=i.getLevel(e,i.FATAL);return s=>{let a=s.level;a.isGreaterThanOrEqualTo(n)&&a.isLessThanOrEqualTo(o)&&t(s)}}function bX(r,e,t,i){let n=t(r.appender);return yX(r.level,r.maxLevel,n,i)}LR.exports.configure=bX});var $R=g((KSe,NR)=>{var qR=gt()("log4js:categoryFilter");function wX(r,e){return typeof r=="string"&&(r=[r]),t=>{qR(`Checking ${t.categoryName} against ${r}`),r.indexOf(t.categoryName)===-1&&(qR("Not excluded, sending to appender"),e(t))}}function xX(r,e,t){let i=t(r.appender);return wX(r.exclude,i)}NR.exports.configure=xX});var UR=g((JSe,BR)=>{var jR=gt()("log4js:noLogFilter");function DX(r){return r.filter(t=>t!=null&&t!=="")}function SX(r,e){return t=>{jR(`Checking data: ${t.data} against filters: ${r}`),typeof r=="string"&&(r=[r]),r=DX(r);let i=new RegExp(r.join("|"),"i");(r.length===0||t.data.findIndex(n=>i.test(n))<0)&&(jR("Not excluded, sending to appender"),e(t))}}function EX(r,e,t){let i=t(r.appender);return SX(r.exclude,i)}BR.exports.configure=EX});var Er=g(ob=>{"use strict";ob.fromCallback=function(r){return Object.defineProperty(function(){if(typeof arguments[arguments.length-1]=="function")r.apply(this,arguments);else return new Promise((e,t)=>{arguments[arguments.length]=(i,n)=>{if(i)return t(i);e(n)},arguments.length++,r.apply(this,arguments)})},"name",{value:r.name})};ob.fromPromise=function(r){return Object.defineProperty(function(){let e=arguments[arguments.length-1];if(typeof e!="function")return r.apply(this,arguments);r.apply(this,arguments).then(t=>e(null,t),e)},"name",{value:r.name})}});var HR=g((XSe,WR)=>{var go=require("constants"),CX=process.cwd,Md=null,_X=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Md||(Md=CX.call(process)),Md};try{process.cwd()}catch(r){}var PX=process.chdir;process.chdir=function(r){Md=null,PX.call(process,r)};WR.exports=TX;function TX(r){go.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(r),r.lutimes||t(r),r.chown=o(r.chown),r.fchown=o(r.fchown),r.lchown=o(r.lchown),r.chmod=i(r.chmod),r.fchmod=i(r.fchmod),r.lchmod=i(r.lchmod),r.chownSync=s(r.chownSync),r.fchownSync=s(r.fchownSync),r.lchownSync=s(r.lchownSync),r.chmodSync=n(r.chmodSync),r.fchmodSync=n(r.fchmodSync),r.lchmodSync=n(r.lchmodSync),r.stat=a(r.stat),r.fstat=a(r.fstat),r.lstat=a(r.lstat),r.statSync=l(r.statSync),r.fstatSync=l(r.fstatSync),r.lstatSync=l(r.lstatSync),r.lchmod||(r.lchmod=function(c,f,p){p&&process.nextTick(p)},r.lchmodSync=function(){}),r.lchown||(r.lchown=function(c,f,p,d){d&&process.nextTick(d)},r.lchownSync=function(){}),_X==="win32"&&(r.rename=function(c){return function(f,p,d){var h=Date.now(),m=0;c(f,p,function y(v){if(v&&(v.code==="EACCES"||v.code==="EPERM")&&Date.now()-h<6e4){setTimeout(function(){r.stat(p,function(x,w){x&&x.code==="ENOENT"?c(f,p,y):d(v)})},m),m<100&&(m+=10);return}d&&d(v)})}}(r.rename)),r.read=function(c){function f(p,d,h,m,y,v){var x;if(v&&typeof v=="function"){var w=0;x=function(E,P,k){if(E&&E.code==="EAGAIN"&&w<10)return w++,c.call(r,p,d,h,m,y,x);v.apply(this,arguments)}}return c.call(r,p,d,h,m,y,x)}return f.__proto__=c,f}(r.read),r.readSync=function(c){return function(f,p,d,h,m){for(var y=0;;)try{return c.call(r,f,p,d,h,m)}catch(v){if(v.code==="EAGAIN"&&y<10){y++;continue}throw v}}}(r.readSync);function e(c){c.lchmod=function(f,p,d){c.open(f,go.O_WRONLY|go.O_SYMLINK,p,function(h,m){if(h){d&&d(h);return}c.fchmod(m,p,function(y){c.close(m,function(v){d&&d(y||v)})})})},c.lchmodSync=function(f,p){var d=c.openSync(f,go.O_WRONLY|go.O_SYMLINK,p),h=!0,m;try{m=c.fchmodSync(d,p),h=!1}finally{if(h)try{c.closeSync(d)}catch(y){}else c.closeSync(d)}return m}}function t(c){go.hasOwnProperty("O_SYMLINK")?(c.lutimes=function(f,p,d,h){c.open(f,go.O_SYMLINK,function(m,y){if(m){h&&h(m);return}c.futimes(y,p,d,function(v){c.close(y,function(x){h&&h(v||x)})})})},c.lutimesSync=function(f,p,d){var h=c.openSync(f,go.O_SYMLINK),m,y=!0;try{m=c.futimesSync(h,p,d),y=!1}finally{if(y)try{c.closeSync(h)}catch(v){}else c.closeSync(h)}return m}):(c.lutimes=function(f,p,d,h){h&&process.nextTick(h)},c.lutimesSync=function(){})}function i(c){return c&&function(f,p,d){return c.call(r,f,p,function(h){u(h)&&(h=null),d&&d.apply(this,arguments)})}}function n(c){return c&&function(f,p){try{return c.call(r,f,p)}catch(d){if(!u(d))throw d}}}function o(c){return c&&function(f,p,d,h){return c.call(r,f,p,d,function(m){u(m)&&(m=null),h&&h.apply(this,arguments)})}}function s(c){return c&&function(f,p,d){try{return c.call(r,f,p,d)}catch(h){if(!u(h))throw h}}}function a(c){return c&&function(f,p,d){typeof p=="function"&&(d=p,p=null);function h(m,y){y&&(y.uid<0&&(y.uid+=4294967296),y.gid<0&&(y.gid+=4294967296)),d&&d.apply(this,arguments)}return p?c.call(r,f,p,h):c.call(r,f,h)}}function l(c){return c&&function(f,p){var d=p?c.call(r,f,p):c.call(r,f);return d.uid<0&&(d.uid+=4294967296),d.gid<0&&(d.gid+=4294967296),d}}function u(c){if(!c||c.code==="ENOSYS")return!0;var f=!process.getuid||process.getuid()!==0;return!!(f&&(c.code==="EINVAL"||c.code==="EPERM"))}}});var VR=g((ZSe,zR)=>{var GR=require("stream").Stream;zR.exports=RX;function RX(r){return{ReadStream:e,WriteStream:t};function e(i,n){if(!(this instanceof e))return new e(i,n);GR.call(this);var o=this;this.path=i,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,n=n||{};for(var s=Object.keys(n),a=0,l=s.length;a<l;a++){var u=s[a];this[u]=n[u]}if(this.encoding&&this.setEncoding(this.encoding),this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.end===void 0)this.end=Infinity;else if(typeof this.end!="number")throw TypeError("end must be a Number");if(this.start>this.end)throw new Error("start must be <= end");this.pos=this.start}if(this.fd!==null){process.nextTick(function(){o._read()});return}r.open(this.path,this.flags,this.mode,function(c,f){if(c){o.emit("error",c),o.readable=!1;return}o.fd=f,o.emit("open",f),o._read()})}function t(i,n){if(!(this instanceof t))return new t(i,n);GR.call(this),this.path=i,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,n=n||{};for(var o=Object.keys(n),s=0,a=o.length;s<a;s++){var l=o[s];this[l]=n[l]}if(this.start!==void 0){if(typeof this.start!="number")throw TypeError("start must be a Number");if(this.start<0)throw new Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],this.fd===null&&(this._open=r.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}}});var JR=g((QSe,KR)=>{"use strict";KR.exports=kX;function kX(r){if(r===null||typeof r!="object")return r;if(r instanceof Object)var e={__proto__:r.__proto__};else var e=Object.create(null);return Object.getOwnPropertyNames(r).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}),e}});var Ce=g((eEe,sb)=>{var $t=require("fs"),IX=HR(),FX=VR(),AX=JR(),Nd=require("util"),Ni,qd;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Ni=Symbol.for("graceful-fs.queue"),qd=Symbol.for("graceful-fs.previous")):(Ni="___graceful-fs.queue",qd="___graceful-fs.previous");function OX(){}function YR(r,e){Object.defineProperty(r,Ni,{get:function(){return e}})}var ac=OX;Nd.debuglog?ac=Nd.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(ac=function(){var r=Nd.format.apply(Nd,arguments);r="GFS4: "+r.split(/\n/).join(`
|
||
GFS4: `),console.error(r)});$t[Ni]||(XR=global[Ni]||[],YR($t,XR),$t.close=function(r){function e(t,i){return r.call($t,t,function(n){n||Ss(),typeof i=="function"&&i.apply(this,arguments)})}return Object.defineProperty(e,qd,{value:r}),e}($t.close),$t.closeSync=function(r){function e(t){r.apply($t,arguments),Ss()}return Object.defineProperty(e,qd,{value:r}),e}($t.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){ac($t[Ni]),require("assert").equal($t[Ni].length,0)}));var XR;global[Ni]||YR(global,$t[Ni]);sb.exports=ab(AX($t));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!$t.__patched&&(sb.exports=ab($t),$t.__patched=!0);function ab(r){IX(r),r.gracefulify=ab,r.createReadStream=w,r.createWriteStream=E;var e=r.readFile;r.readFile=t;function t(_,O,I){return typeof O=="function"&&(I=O,O=null),L(_,O,I);function L(R,F,q){return e(R,F,function(K){K&&(K.code==="EMFILE"||K.code==="ENFILE")?lc([L,[R,F,q]]):(typeof q=="function"&&q.apply(this,arguments),Ss())})}}var i=r.writeFile;r.writeFile=n;function n(_,O,I,L){return typeof I=="function"&&(L=I,I=null),R(_,O,I,L);function R(F,q,K,ae){return i(F,q,K,function(Pe){Pe&&(Pe.code==="EMFILE"||Pe.code==="ENFILE")?lc([R,[F,q,K,ae]]):(typeof ae=="function"&&ae.apply(this,arguments),Ss())})}}var o=r.appendFile;o&&(r.appendFile=s);function s(_,O,I,L){return typeof I=="function"&&(L=I,I=null),R(_,O,I,L);function R(F,q,K,ae){return o(F,q,K,function(Pe){Pe&&(Pe.code==="EMFILE"||Pe.code==="ENFILE")?lc([R,[F,q,K,ae]]):(typeof ae=="function"&&ae.apply(this,arguments),Ss())})}}var a=r.readdir;r.readdir=l;function l(_,O,I){var L=[_];return typeof O!="function"?L.push(O):I=O,L.push(R),u(L);function R(F,q){q&&q.sort&&q.sort(),F&&(F.code==="EMFILE"||F.code==="ENFILE")?lc([u,[L]]):(typeof I=="function"&&I.apply(this,arguments),Ss())}}function u(_){return a.apply(r,_)}if(process.version.substr(0,4)==="v0.8"){var c=FX(r);m=c.ReadStream,v=c.WriteStream}var f=r.ReadStream;f&&(m.prototype=Object.create(f.prototype),m.prototype.open=y);var p=r.WriteStream;p&&(v.prototype=Object.create(p.prototype),v.prototype.open=x),Object.defineProperty(r,"ReadStream",{get:function(){return m},set:function(_){m=_},enumerable:!0,configurable:!0}),Object.defineProperty(r,"WriteStream",{get:function(){return v},set:function(_){v=_},enumerable:!0,configurable:!0});var d=m;Object.defineProperty(r,"FileReadStream",{get:function(){return d},set:function(_){d=_},enumerable:!0,configurable:!0});var h=v;Object.defineProperty(r,"FileWriteStream",{get:function(){return h},set:function(_){h=_},enumerable:!0,configurable:!0});function m(_,O){return this instanceof m?(f.apply(this,arguments),this):m.apply(Object.create(m.prototype),arguments)}function y(){var _=this;k(_.path,_.flags,_.mode,function(O,I){O?(_.autoClose&&_.destroy(),_.emit("error",O)):(_.fd=I,_.emit("open",I),_.read())})}function v(_,O){return this instanceof v?(p.apply(this,arguments),this):v.apply(Object.create(v.prototype),arguments)}function x(){var _=this;k(_.path,_.flags,_.mode,function(O,I){O?(_.destroy(),_.emit("error",O)):(_.fd=I,_.emit("open",I))})}function w(_,O){return new r.ReadStream(_,O)}function E(_,O){return new r.WriteStream(_,O)}var P=r.open;r.open=k;function k(_,O,I,L){return typeof I=="function"&&(L=I,I=null),R(_,O,I,L);function R(F,q,K,ae){return P(F,q,K,function(Pe,We){Pe&&(Pe.code==="EMFILE"||Pe.code==="ENFILE")?lc([R,[F,q,K,ae]]):(typeof ae=="function"&&ae.apply(this,arguments),Ss())})}}return r}function lc(r){ac("ENQUEUE",r[0].name,r[1]),$t[Ni].push(r)}function Ss(){var r=$t[Ni].shift();r&&(ac("RETRY",r[0].name,r[1]),r[0].apply(null,r[1]))}});var lb=g(Es=>{"use strict";var ZR=Er().fromCallback,fi=Ce(),LX=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","lchmod","link","lstat","mkdir","mkdtemp","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(r=>typeof fi[r]=="function");Object.keys(fi).forEach(r=>{r!=="promises"&&(Es[r]=fi[r])});LX.forEach(r=>{Es[r]=ZR(fi[r])});Es.exists=function(r,e){return typeof e=="function"?fi.exists(r,e):new Promise(t=>fi.exists(r,t))};Es.read=function(r,e,t,i,n,o){return typeof o=="function"?fi.read(r,e,t,i,n,o):new Promise((s,a)=>{fi.read(r,e,t,i,n,(l,u,c)=>{if(l)return a(l);s({bytesRead:u,buffer:c})})})};Es.write=function(r,e,...t){return typeof t[t.length-1]=="function"?fi.write(r,e,...t):new Promise((i,n)=>{fi.write(r,e,...t,(o,s,a)=>{if(o)return n(o);i({bytesWritten:s,buffer:a})})})};typeof fi.realpath.native=="function"&&(Es.realpath.native=ZR(fi.realpath.native))});var cb=g((rEe,QR)=>{"use strict";var ub=require("path");function e1(r){return r=ub.normalize(ub.resolve(r)).split(ub.sep),r.length>0?r[0]:null}var MX=/[<>:"|?*]/;function NX(r){let e=e1(r);return r=r.replace(e,""),MX.test(r)}QR.exports={getRootPath:e1,invalidWin32Path:NX}});var r1=g((iEe,t1)=>{"use strict";var qX=Ce(),fb=require("path"),$X=cb().invalidWin32Path,BX=parseInt("0777",8);function pb(r,e,t,i){if(typeof e=="function"?(t=e,e={}):(!e||typeof e!="object")&&(e={mode:e}),process.platform==="win32"&&$X(r)){let s=new Error(r+" contains invalid WIN32 path characters.");return s.code="EINVAL",t(s)}let n=e.mode,o=e.fs||qX;n===void 0&&(n=BX&~process.umask()),i||(i=null),t=t||function(){},r=fb.resolve(r),o.mkdir(r,n,s=>{if(!s)return i=i||r,t(null,i);switch(s.code){case"ENOENT":if(fb.dirname(r)===r)return t(s);pb(fb.dirname(r),e,(a,l)=>{a?t(a,l):pb(r,e,t,l)});break;default:o.stat(r,(a,l)=>{a||!l.isDirectory()?t(s,i):t(null,i)});break}})}t1.exports=pb});var n1=g((nEe,i1)=>{"use strict";var jX=Ce(),db=require("path"),UX=cb().invalidWin32Path,WX=parseInt("0777",8);function hb(r,e,t){(!e||typeof e!="object")&&(e={mode:e});let i=e.mode,n=e.fs||jX;if(process.platform==="win32"&&UX(r)){let o=new Error(r+" contains invalid WIN32 path characters.");throw o.code="EINVAL",o}i===void 0&&(i=WX&~process.umask()),t||(t=null),r=db.resolve(r);try{n.mkdirSync(r,i),t=t||r}catch(o){if(o.code==="ENOENT"){if(db.dirname(r)===r)throw o;t=hb(db.dirname(r),e,t),hb(r,e,t)}else{let s;try{s=n.statSync(r)}catch(a){throw o}if(!s.isDirectory())throw o}}return t}i1.exports=hb});var Br=g((oEe,o1)=>{"use strict";var HX=Er().fromCallback,mb=HX(r1()),gb=n1();o1.exports={mkdirs:mb,mkdirsSync:gb,mkdirp:mb,mkdirpSync:gb,ensureDir:mb,ensureDirSync:gb}});var vb=g((sEe,s1)=>{"use strict";var er=Ce(),a1=require("os"),$d=require("path");function zX(){let r=$d.join("millis-test-sync"+Date.now().toString()+Math.random().toString().slice(2));r=$d.join(a1.tmpdir(),r);let e=new Date(1435410243862);er.writeFileSync(r,"https://github.com/jprichardson/node-fs-extra/pull/141");let t=er.openSync(r,"r+");return er.futimesSync(t,e,e),er.closeSync(t),er.statSync(r).mtime>1435410243e3}function GX(r){let e=$d.join("millis-test"+Date.now().toString()+Math.random().toString().slice(2));e=$d.join(a1.tmpdir(),e);let t=new Date(1435410243862);er.writeFile(e,"https://github.com/jprichardson/node-fs-extra/pull/141",i=>{if(i)return r(i);er.open(e,"r+",(n,o)=>{if(n)return r(n);er.futimes(o,t,t,s=>{if(s)return r(s);er.close(o,a=>{if(a)return r(a);er.stat(e,(l,u)=>{if(l)return r(l);r(null,u.mtime>1435410243e3)})})})})})}function VX(r){if(typeof r=="number")return Math.floor(r/1e3)*1e3;if(r instanceof Date)return new Date(Math.floor(r.getTime()/1e3)*1e3);throw new Error("fs-extra: timeRemoveMillis() unknown parameter type")}function KX(r,e,t,i){er.open(r,"r+",(n,o)=>{if(n)return i(n);er.futimes(o,e,t,s=>{er.close(o,a=>{i&&i(s||a)})})})}function JX(r,e,t){let i=er.openSync(r,"r+");return er.futimesSync(i,e,t),er.closeSync(i)}s1.exports={hasMillisRes:GX,hasMillisResSync:zX,timeRemoveMillis:VX,utimesMillis:KX,utimesMillisSync:JX}});var fc=g((aEe,l1)=>{"use strict";var pi=Ce(),Cr=require("path"),u1=10,c1=5,YX=0,yb=process.versions.node.split("."),f1=Number.parseInt(yb[0],10),p1=Number.parseInt(yb[1],10),XX=Number.parseInt(yb[2],10);function uc(){if(f1>u1)return!0;if(f1===u1){if(p1>c1)return!0;if(p1===c1&&XX>=YX)return!0}return!1}function ZX(r,e,t){uc()?pi.stat(r,{bigint:!0},(i,n)=>{if(i)return t(i);pi.stat(e,{bigint:!0},(o,s)=>o?o.code==="ENOENT"?t(null,{srcStat:n,destStat:null}):t(o):t(null,{srcStat:n,destStat:s}))}):pi.stat(r,(i,n)=>{if(i)return t(i);pi.stat(e,(o,s)=>o?o.code==="ENOENT"?t(null,{srcStat:n,destStat:null}):t(o):t(null,{srcStat:n,destStat:s}))})}function QX(r,e){let t,i;uc()?t=pi.statSync(r,{bigint:!0}):t=pi.statSync(r);try{uc()?i=pi.statSync(e,{bigint:!0}):i=pi.statSync(e)}catch(n){if(n.code==="ENOENT")return{srcStat:t,destStat:null};throw n}return{srcStat:t,destStat:i}}function eZ(r,e,t,i){ZX(r,e,(n,o)=>{if(n)return i(n);let{srcStat:s,destStat:a}=o;return a&&a.ino&&a.dev&&a.ino===s.ino&&a.dev===s.dev?i(new Error("Source and destination must not be the same.")):s.isDirectory()&&bb(r,e)?i(new Error(cc(r,e,t))):i(null,{srcStat:s,destStat:a})})}function tZ(r,e,t){let{srcStat:i,destStat:n}=QX(r,e);if(n&&n.ino&&n.dev&&n.ino===i.ino&&n.dev===i.dev)throw new Error("Source and destination must not be the same.");if(i.isDirectory()&&bb(r,e))throw new Error(cc(r,e,t));return{srcStat:i,destStat:n}}function wb(r,e,t,i,n){let o=Cr.resolve(Cr.dirname(r)),s=Cr.resolve(Cr.dirname(t));if(s===o||s===Cr.parse(s).root)return n();uc()?pi.stat(s,{bigint:!0},(a,l)=>a?a.code==="ENOENT"?n():n(a):l.ino&&l.dev&&l.ino===e.ino&&l.dev===e.dev?n(new Error(cc(r,t,i))):wb(r,e,s,i,n)):pi.stat(s,(a,l)=>a?a.code==="ENOENT"?n():n(a):l.ino&&l.dev&&l.ino===e.ino&&l.dev===e.dev?n(new Error(cc(r,t,i))):wb(r,e,s,i,n))}function d1(r,e,t,i){let n=Cr.resolve(Cr.dirname(r)),o=Cr.resolve(Cr.dirname(t));if(o===n||o===Cr.parse(o).root)return;let s;try{uc()?s=pi.statSync(o,{bigint:!0}):s=pi.statSync(o)}catch(a){if(a.code==="ENOENT")return;throw a}if(s.ino&&s.dev&&s.ino===e.ino&&s.dev===e.dev)throw new Error(cc(r,t,i));return d1(r,e,o,i)}function bb(r,e){let t=Cr.resolve(r).split(Cr.sep).filter(n=>n),i=Cr.resolve(e).split(Cr.sep).filter(n=>n);return t.reduce((n,o,s)=>n&&i[s]===o,!0)}function cc(r,e,t){return`Cannot ${t} '${r}' to a subdirectory of itself, '${e}'.`}l1.exports={checkPaths:eZ,checkPathsSync:tZ,checkParentPaths:wb,checkParentPathsSync:d1,isSrcSubdir:bb}});var m1=g((lEe,h1)=>{"use strict";h1.exports=function(r){if(typeof Buffer.allocUnsafe=="function")try{return Buffer.allocUnsafe(r)}catch(e){return new Buffer(r)}return new Buffer(r)}});var w1=g((uEe,g1)=>{"use strict";var it=Ce(),pc=require("path"),rZ=Br().mkdirsSync,iZ=vb().utimesMillisSync,dc=fc();function oZ(r,e,t){typeof t=="function"&&(t={filter:t}),t=t||{},t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
||
|
||
see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:i,destStat:n}=dc.checkPathsSync(r,e,"copy");return dc.checkParentPathsSync(r,i,e,"copy"),nZ(n,r,e,t)}function nZ(r,e,t,i){if(i.filter&&!i.filter(e,t))return;let n=pc.dirname(t);return it.existsSync(n)||rZ(n),v1(r,e,t,i)}function v1(r,e,t,i){if(!(i.filter&&!i.filter(e,t)))return sZ(r,e,t,i)}function sZ(r,e,t,i){let o=(i.dereference?it.statSync:it.lstatSync)(e);if(o.isDirectory())return lZ(o,r,e,t,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return aZ(o,r,e,t,i);if(o.isSymbolicLink())return uZ(r,e,t,i)}function aZ(r,e,t,i,n){return e?cZ(r,t,i,n):y1(r,t,i,n)}function cZ(r,e,t,i){if(i.overwrite)return it.unlinkSync(t),y1(r,e,t,i);if(i.errorOnExist)throw new Error(`'${t}' already exists`)}function y1(r,e,t,i){return typeof it.copyFileSync=="function"?(it.copyFileSync(e,t),it.chmodSync(t,r.mode),i.preserveTimestamps?iZ(t,r.atime,r.mtime):void 0):fZ(r,e,t,i)}function fZ(r,e,t,i){let n=64*1024,o=m1()(n),s=it.openSync(e,"r"),a=it.openSync(t,"w",r.mode),l=0;for(;l<r.size;){let u=it.readSync(s,o,0,n,l);it.writeSync(a,o,0,u),l+=u}i.preserveTimestamps&&it.futimesSync(a,r.atime,r.mtime),it.closeSync(s),it.closeSync(a)}function lZ(r,e,t,i,n){if(!e)return pZ(r,t,i,n);if(e&&!e.isDirectory())throw new Error(`Cannot overwrite non-directory '${i}' with directory '${t}'.`);return b1(t,i,n)}function pZ(r,e,t,i){return it.mkdirSync(t),b1(e,t,i),it.chmodSync(t,r.mode)}function b1(r,e,t){it.readdirSync(r).forEach(i=>dZ(i,r,e,t))}function dZ(r,e,t,i){let n=pc.join(e,r),o=pc.join(t,r),{destStat:s}=dc.checkPathsSync(n,o,"copy");return v1(s,n,o,i)}function uZ(r,e,t,i){let n=it.readlinkSync(e);if(i.dereference&&(n=pc.resolve(process.cwd(),n)),r){let o;try{o=it.readlinkSync(t)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return it.symlinkSync(n,t);throw s}if(i.dereference&&(o=pc.resolve(process.cwd(),o)),dc.isSrcSubdir(n,o))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${o}'.`);if(it.statSync(t).isDirectory()&&dc.isSrcSubdir(o,n))throw new Error(`Cannot overwrite '${o}' with '${n}'.`);return hZ(n,t)}else return it.symlinkSync(n,t)}function hZ(r,e){return it.unlinkSync(e),it.symlinkSync(r,e)}g1.exports=oZ});var xb=g((cEe,x1)=>{"use strict";x1.exports={copySync:w1()}});var fn=g((fEe,D1)=>{"use strict";var mZ=Er().fromPromise,S1=lb();function gZ(r){return S1.access(r).then(()=>!0).catch(()=>!1)}D1.exports={pathExists:mZ(gZ),pathExistsSync:S1.existsSync}});var F1=g((pEe,E1)=>{"use strict";var Bt=Ce(),hc=require("path"),vZ=Br().mkdirs,yZ=fn().pathExists,bZ=vb().utimesMillis,mc=fc();function wZ(r,e,t,i){typeof t=="function"&&!i?(i=t,t={}):typeof t=="function"&&(t={filter:t}),i=i||function(){},t=t||{},t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
||
|
||
see https://github.com/jprichardson/node-fs-extra/issues/269`),mc.checkPaths(r,e,"copy",(n,o)=>{if(n)return i(n);let{srcStat:s,destStat:a}=o;mc.checkParentPaths(r,s,e,"copy",l=>l?i(l):t.filter?_1(C1,a,r,e,t,i):C1(a,r,e,t,i))})}function C1(r,e,t,i,n){let o=hc.dirname(t);yZ(o,(s,a)=>{if(s)return n(s);if(a)return Db(r,e,t,i,n);vZ(o,l=>l?n(l):Db(r,e,t,i,n))})}function _1(r,e,t,i,n,o){Promise.resolve(n.filter(t,i)).then(s=>s?r(e,t,i,n,o):o(),s=>o(s))}function Db(r,e,t,i,n){return i.filter?_1(P1,r,e,t,i,n):P1(r,e,t,i,n)}function P1(r,e,t,i,n){(i.dereference?Bt.stat:Bt.lstat)(e,(s,a)=>{if(s)return n(s);if(a.isDirectory())return DZ(a,r,e,t,i,n);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return xZ(a,r,e,t,i,n);if(a.isSymbolicLink())return SZ(r,e,t,i,n)})}function xZ(r,e,t,i,n,o){return e?EZ(r,t,i,n,o):T1(r,t,i,n,o)}function EZ(r,e,t,i,n){if(i.overwrite)Bt.unlink(t,o=>o?n(o):T1(r,e,t,i,n));else return i.errorOnExist?n(new Error(`'${t}' already exists`)):n()}function T1(r,e,t,i,n){return typeof Bt.copyFile=="function"?Bt.copyFile(e,t,o=>o?n(o):R1(r,t,i,n)):CZ(r,e,t,i,n)}function CZ(r,e,t,i,n){let o=Bt.createReadStream(e);o.on("error",s=>n(s)).once("open",()=>{let s=Bt.createWriteStream(t,{mode:r.mode});s.on("error",a=>n(a)).on("open",()=>o.pipe(s)).once("close",()=>R1(r,t,i,n))})}function R1(r,e,t,i){Bt.chmod(e,r.mode,n=>n?i(n):t.preserveTimestamps?bZ(e,r.atime,r.mtime,i):i())}function DZ(r,e,t,i,n,o){return e?e&&!e.isDirectory()?o(new Error(`Cannot overwrite non-directory '${i}' with directory '${t}'.`)):k1(t,i,n,o):_Z(r,t,i,n,o)}function _Z(r,e,t,i,n){Bt.mkdir(t,o=>{if(o)return n(o);k1(e,t,i,s=>s?n(s):Bt.chmod(t,r.mode,n))})}function k1(r,e,t,i){Bt.readdir(r,(n,o)=>n?i(n):I1(o,r,e,t,i))}function I1(r,e,t,i,n){let o=r.pop();return o?PZ(r,o,e,t,i,n):n()}function PZ(r,e,t,i,n,o){let s=hc.join(t,e),a=hc.join(i,e);mc.checkPaths(s,a,"copy",(l,u)=>{if(l)return o(l);let{destStat:c}=u;Db(c,s,a,n,f=>f?o(f):I1(r,t,i,n,o))})}function SZ(r,e,t,i,n){Bt.readlink(e,(o,s)=>{if(o)return n(o);if(i.dereference&&(s=hc.resolve(process.cwd(),s)),r)Bt.readlink(t,(a,l)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?Bt.symlink(s,t,n):n(a):(i.dereference&&(l=hc.resolve(process.cwd(),l)),mc.isSrcSubdir(s,l)?n(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${l}'.`)):r.isDirectory()&&mc.isSrcSubdir(l,s)?n(new Error(`Cannot overwrite '${l}' with '${s}'.`)):TZ(s,t,n)));else return Bt.symlink(s,t,n)})}function TZ(r,e,t){Bt.unlink(e,i=>i?t(i):Bt.symlink(r,e,t))}E1.exports=wZ});var Sb=g((dEe,A1)=>{"use strict";var RZ=Er().fromCallback;A1.exports={copy:RZ(F1())}});var U1=g((hEe,O1)=>{"use strict";var L1=Ce(),M1=require("path"),Oe=require("assert"),gc=process.platform==="win32";function N1(r){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(t=>{r[t]=r[t]||L1[t],t=t+"Sync",r[t]=r[t]||L1[t]}),r.maxBusyTries=r.maxBusyTries||3}function Eb(r,e,t){let i=0;typeof e=="function"&&(t=e,e={}),Oe(r,"rimraf: missing path"),Oe.strictEqual(typeof r,"string","rimraf: path should be a string"),Oe.strictEqual(typeof t,"function","rimraf: callback function required"),Oe(e,"rimraf: invalid options argument provided"),Oe.strictEqual(typeof e,"object","rimraf: options should be object"),N1(e),q1(r,e,function n(o){if(o){if((o.code==="EBUSY"||o.code==="ENOTEMPTY"||o.code==="EPERM")&&i<e.maxBusyTries){i++;let s=i*100;return setTimeout(()=>q1(r,e,n),s)}o.code==="ENOENT"&&(o=null)}t(o)})}function q1(r,e,t){Oe(r),Oe(e),Oe(typeof t=="function"),e.lstat(r,(i,n)=>{if(i&&i.code==="ENOENT")return t(null);if(i&&i.code==="EPERM"&&gc)return $1(r,e,i,t);if(n&&n.isDirectory())return Bd(r,e,i,t);e.unlink(r,o=>{if(o){if(o.code==="ENOENT")return t(null);if(o.code==="EPERM")return gc?$1(r,e,o,t):Bd(r,e,o,t);if(o.code==="EISDIR")return Bd(r,e,o,t)}return t(o)})})}function $1(r,e,t,i){Oe(r),Oe(e),Oe(typeof i=="function"),t&&Oe(t instanceof Error),e.chmod(r,438,n=>{n?i(n.code==="ENOENT"?null:t):e.stat(r,(o,s)=>{o?i(o.code==="ENOENT"?null:t):s.isDirectory()?Bd(r,e,t,i):e.unlink(r,i)})})}function B1(r,e,t){let i;Oe(r),Oe(e),t&&Oe(t instanceof Error);try{e.chmodSync(r,438)}catch(n){if(n.code==="ENOENT")return;throw t}try{i=e.statSync(r)}catch(n){if(n.code==="ENOENT")return;throw t}i.isDirectory()?jd(r,e,t):e.unlinkSync(r)}function Bd(r,e,t,i){Oe(r),Oe(e),t&&Oe(t instanceof Error),Oe(typeof i=="function"),e.rmdir(r,n=>{n&&(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")?kZ(r,e,i):n&&n.code==="ENOTDIR"?i(t):i(n)})}function kZ(r,e,t){Oe(r),Oe(e),Oe(typeof t=="function"),e.readdir(r,(i,n)=>{if(i)return t(i);let o=n.length,s;if(o===0)return e.rmdir(r,t);n.forEach(a=>{Eb(M1.join(r,a),e,l=>{if(!s){if(l)return t(s=l);--o==0&&e.rmdir(r,t)}})})})}function j1(r,e){let t;e=e||{},N1(e),Oe(r,"rimraf: missing path"),Oe.strictEqual(typeof r,"string","rimraf: path should be a string"),Oe(e,"rimraf: missing options"),Oe.strictEqual(typeof e,"object","rimraf: options should be object");try{t=e.lstatSync(r)}catch(i){if(i.code==="ENOENT")return;i.code==="EPERM"&&gc&&B1(r,e,i)}try{t&&t.isDirectory()?jd(r,e,null):e.unlinkSync(r)}catch(i){if(i.code==="ENOENT")return;if(i.code==="EPERM")return gc?B1(r,e,i):jd(r,e,i);if(i.code!=="EISDIR")throw i;jd(r,e,i)}}function jd(r,e,t){Oe(r),Oe(e),t&&Oe(t instanceof Error);try{e.rmdirSync(r)}catch(i){if(i.code==="ENOTDIR")throw t;if(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")IZ(r,e);else if(i.code!=="ENOENT")throw i}}function IZ(r,e){if(Oe(r),Oe(e),e.readdirSync(r).forEach(t=>j1(M1.join(r,t),e)),gc){let t=Date.now();do try{return e.rmdirSync(r,e)}catch(i){}while(Date.now()-t<500)}else return e.rmdirSync(r,e)}O1.exports=Eb;Eb.sync=j1});var vc=g((mEe,W1)=>{"use strict";var FZ=Er().fromCallback,H1=U1();W1.exports={remove:FZ(H1),removeSync:H1.sync}});var Z1=g((gEe,z1)=>{"use strict";var AZ=Er().fromCallback,G1=Ce(),V1=require("path"),K1=Br(),J1=vc(),Y1=AZ(function(e,t){t=t||function(){},G1.readdir(e,(i,n)=>{if(i)return K1.mkdirs(e,t);n=n.map(s=>V1.join(e,s)),o();function o(){let s=n.pop();if(!s)return t();J1.remove(s,a=>{if(a)return t(a);o()})}})});function X1(r){let e;try{e=G1.readdirSync(r)}catch(t){return K1.mkdirsSync(r)}e.forEach(t=>{t=V1.join(r,t),J1.removeSync(t)})}z1.exports={emptyDirSync:X1,emptydirSync:X1,emptyDir:Y1,emptydir:Y1}});var rk=g((vEe,Q1)=>{"use strict";var OZ=Er().fromCallback,ek=require("path"),yc=Ce(),tk=Br(),LZ=fn().pathExists;function MZ(r,e){function t(){yc.writeFile(r,"",i=>{if(i)return e(i);e()})}yc.stat(r,(i,n)=>{if(!i&&n.isFile())return e();let o=ek.dirname(r);LZ(o,(s,a)=>{if(s)return e(s);if(a)return t();tk.mkdirs(o,l=>{if(l)return e(l);t()})})})}function NZ(r){let e;try{e=yc.statSync(r)}catch(i){}if(e&&e.isFile())return;let t=ek.dirname(r);yc.existsSync(t)||tk.mkdirsSync(t),yc.writeFileSync(r,"")}Q1.exports={createFile:OZ(MZ),createFileSync:NZ}});var ak=g((yEe,ik)=>{"use strict";var qZ=Er().fromCallback,nk=require("path"),Cs=Ce(),ok=Br(),sk=fn().pathExists;function $Z(r,e,t){function i(n,o){Cs.link(n,o,s=>{if(s)return t(s);t(null)})}sk(e,(n,o)=>{if(n)return t(n);if(o)return t(null);Cs.lstat(r,s=>{if(s)return s.message=s.message.replace("lstat","ensureLink"),t(s);let a=nk.dirname(e);sk(a,(l,u)=>{if(l)return t(l);if(u)return i(r,e);ok.mkdirs(a,c=>{if(c)return t(c);i(r,e)})})})})}function BZ(r,e){if(Cs.existsSync(e))return;try{Cs.lstatSync(r)}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let i=nk.dirname(e);return Cs.existsSync(i)||ok.mkdirsSync(i),Cs.linkSync(r,e)}ik.exports={createLink:qZ($Z),createLinkSync:BZ}});var uk=g((bEe,lk)=>{"use strict";var vo=require("path"),bc=Ce(),jZ=fn().pathExists;function UZ(r,e,t){if(vo.isAbsolute(r))return bc.lstat(r,i=>i?(i.message=i.message.replace("lstat","ensureSymlink"),t(i)):t(null,{toCwd:r,toDst:r}));{let i=vo.dirname(e),n=vo.join(i,r);return jZ(n,(o,s)=>o?t(o):s?t(null,{toCwd:n,toDst:r}):bc.lstat(r,a=>a?(a.message=a.message.replace("lstat","ensureSymlink"),t(a)):t(null,{toCwd:r,toDst:vo.relative(i,r)})))}}function WZ(r,e){let t;if(vo.isAbsolute(r)){if(t=bc.existsSync(r),!t)throw new Error("absolute srcpath does not exist");return{toCwd:r,toDst:r}}else{let i=vo.dirname(e),n=vo.join(i,r);if(t=bc.existsSync(n),t)return{toCwd:n,toDst:r};if(t=bc.existsSync(r),!t)throw new Error("relative srcpath does not exist");return{toCwd:r,toDst:vo.relative(i,r)}}}lk.exports={symlinkPaths:UZ,symlinkPathsSync:WZ}});var pk=g((wEe,ck)=>{"use strict";var fk=Ce();function HZ(r,e,t){if(t=typeof e=="function"?e:t,e=typeof e=="function"?!1:e,e)return t(null,e);fk.lstat(r,(i,n)=>{if(i)return t(null,"file");e=n&&n.isDirectory()?"dir":"file",t(null,e)})}function zZ(r,e){let t;if(e)return e;try{t=fk.lstatSync(r)}catch(i){return"file"}return t&&t.isDirectory()?"dir":"file"}ck.exports={symlinkType:HZ,symlinkTypeSync:zZ}});var bk=g((xEe,dk)=>{"use strict";var GZ=Er().fromCallback,hk=require("path"),Ba=Ce(),mk=Br(),VZ=mk.mkdirs,KZ=mk.mkdirsSync,gk=uk(),JZ=gk.symlinkPaths,YZ=gk.symlinkPathsSync,vk=pk(),XZ=vk.symlinkType,ZZ=vk.symlinkTypeSync,yk=fn().pathExists;function QZ(r,e,t,i){i=typeof t=="function"?t:i,t=typeof t=="function"?!1:t,yk(e,(n,o)=>{if(n)return i(n);if(o)return i(null);JZ(r,e,(s,a)=>{if(s)return i(s);r=a.toDst,XZ(a.toCwd,t,(l,u)=>{if(l)return i(l);let c=hk.dirname(e);yk(c,(f,p)=>{if(f)return i(f);if(p)return Ba.symlink(r,e,u,i);VZ(c,d=>{if(d)return i(d);Ba.symlink(r,e,u,i)})})})})})}function eQ(r,e,t){if(Ba.existsSync(e))return;let n=YZ(r,e);r=n.toDst,t=ZZ(n.toCwd,t);let o=hk.dirname(e);return Ba.existsSync(o)||KZ(o),Ba.symlinkSync(r,e,t)}dk.exports={createSymlink:GZ(QZ),createSymlinkSync:eQ}});var xk=g((DEe,wk)=>{"use strict";var Ud=rk(),Wd=ak(),Hd=bk();wk.exports={createFile:Ud.createFile,createFileSync:Ud.createFileSync,ensureFile:Ud.createFile,ensureFileSync:Ud.createFileSync,createLink:Wd.createLink,createLinkSync:Wd.createLinkSync,ensureLink:Wd.createLink,ensureLinkSync:Wd.createLinkSync,createSymlink:Hd.createSymlink,createSymlinkSync:Hd.createSymlinkSync,ensureSymlink:Hd.createSymlink,ensureSymlinkSync:Hd.createSymlinkSync}});var Ck=g((SEe,Dk)=>{var ja;try{ja=Ce()}catch(r){ja=require("fs")}function tQ(r,e,t){t==null&&(t=e,e={}),typeof e=="string"&&(e={encoding:e}),e=e||{};var i=e.fs||ja,n=!0;"throws"in e&&(n=e.throws),i.readFile(r,e,function(o,s){if(o)return t(o);s=Sk(s);var a;try{a=JSON.parse(s,e?e.reviver:null)}catch(l){return n?(l.message=r+": "+l.message,t(l)):t(null,null)}t(null,a)})}function rQ(r,e){e=e||{},typeof e=="string"&&(e={encoding:e});var t=e.fs||ja,i=!0;"throws"in e&&(i=e.throws);try{var n=t.readFileSync(r,e);return n=Sk(n),JSON.parse(n,e.reviver)}catch(o){if(i)throw o.message=r+": "+o.message,o;return null}}function Ek(r,e){var t,i=`
|
||
`;typeof e=="object"&&e!==null&&(e.spaces&&(t=e.spaces),e.EOL&&(i=e.EOL));var n=JSON.stringify(r,e?e.replacer:null,t);return n.replace(/\n/g,i)+i}function iQ(r,e,t,i){i==null&&(i=t,t={}),t=t||{};var n=t.fs||ja,o="";try{o=Ek(e,t)}catch(s){i&&i(s,null);return}n.writeFile(r,o,t,i)}function nQ(r,e,t){t=t||{};var i=t.fs||ja,n=Ek(e,t);return i.writeFileSync(r,n,t)}function Sk(r){return Buffer.isBuffer(r)&&(r=r.toString("utf8")),r=r.replace(/^\uFEFF/,""),r}var oQ={readFile:tQ,readFileSync:rQ,writeFile:iQ,writeFileSync:nQ};Dk.exports=oQ});var Gd=g((EEe,_k)=>{"use strict";var Pk=Er().fromCallback,zd=Ck();_k.exports={readJson:Pk(zd.readFile),readJsonSync:zd.readFileSync,writeJson:Pk(zd.writeFile),writeJsonSync:zd.writeFileSync}});var kk=g((CEe,Tk)=>{"use strict";var sQ=require("path"),aQ=Br(),lQ=fn().pathExists,Rk=Gd();function uQ(r,e,t,i){typeof t=="function"&&(i=t,t={});let n=sQ.dirname(r);lQ(n,(o,s)=>{if(o)return i(o);if(s)return Rk.writeJson(r,e,t,i);aQ.mkdirs(n,a=>{if(a)return i(a);Rk.writeJson(r,e,t,i)})})}Tk.exports=uQ});var Fk=g((_Ee,Ik)=>{"use strict";var cQ=Ce(),fQ=require("path"),pQ=Br(),dQ=Gd();function hQ(r,e,t){let i=fQ.dirname(r);cQ.existsSync(i)||pQ.mkdirsSync(i),dQ.writeJsonSync(r,e,t)}Ik.exports=hQ});var Ok=g((PEe,Ak)=>{"use strict";var mQ=Er().fromCallback,mr=Gd();mr.outputJson=mQ(kk());mr.outputJsonSync=Fk();mr.outputJSON=mr.outputJson;mr.outputJSONSync=mr.outputJsonSync;mr.writeJSON=mr.writeJson;mr.writeJSONSync=mr.writeJsonSync;mr.readJSON=mr.readJson;mr.readJSONSync=mr.readJsonSync;Ak.exports=mr});var Bk=g((TEe,Lk)=>{"use strict";var Mk=Ce(),gQ=require("path"),vQ=xb().copySync,Nk=vc().removeSync,yQ=Br().mkdirpSync,qk=fc();function wQ(r,e,t){t=t||{};let i=t.overwrite||t.clobber||!1,{srcStat:n}=qk.checkPathsSync(r,e,"move");return qk.checkParentPathsSync(r,n,e,"move"),yQ(gQ.dirname(e)),bQ(r,e,i)}function bQ(r,e,t){if(t)return Nk(e),$k(r,e,t);if(Mk.existsSync(e))throw new Error("dest already exists.");return $k(r,e,t)}function $k(r,e,t){try{Mk.renameSync(r,e)}catch(i){if(i.code!=="EXDEV")throw i;return xQ(r,e,t)}}function xQ(r,e,t){return vQ(r,e,{overwrite:t,errorOnExist:!0}),Nk(r)}Lk.exports=wQ});var Uk=g((REe,jk)=>{"use strict";jk.exports={moveSync:Bk()}});var Vk=g((kEe,Wk)=>{"use strict";var DQ=Ce(),SQ=require("path"),EQ=Sb().copy,Hk=vc().remove,CQ=Br().mkdirp,_Q=fn().pathExists,zk=fc();function TQ(r,e,t,i){typeof t=="function"&&(i=t,t={});let n=t.overwrite||t.clobber||!1;zk.checkPaths(r,e,"move",(o,s)=>{if(o)return i(o);let{srcStat:a}=s;zk.checkParentPaths(r,a,e,"move",l=>{if(l)return i(l);CQ(SQ.dirname(e),u=>u?i(u):PQ(r,e,n,i))})})}function PQ(r,e,t,i){if(t)return Hk(e,n=>n?i(n):Gk(r,e,t,i));_Q(e,(n,o)=>n?i(n):o?i(new Error("dest already exists.")):Gk(r,e,t,i))}function Gk(r,e,t,i){DQ.rename(r,e,n=>n?n.code!=="EXDEV"?i(n):RQ(r,e,t,i):i())}function RQ(r,e,t,i){EQ(r,e,{overwrite:t,errorOnExist:!0},o=>o?i(o):Hk(r,i))}Wk.exports=TQ});var Jk=g((IEe,Kk)=>{"use strict";var kQ=Er().fromCallback;Kk.exports={move:kQ(Vk())}});var Qk=g((FEe,Yk)=>{"use strict";var IQ=Er().fromCallback,wc=Ce(),Xk=require("path"),Zk=Br(),FQ=fn().pathExists;function AQ(r,e,t,i){typeof t=="function"&&(i=t,t="utf8");let n=Xk.dirname(r);FQ(n,(o,s)=>{if(o)return i(o);if(s)return wc.writeFile(r,e,t,i);Zk.mkdirs(n,a=>{if(a)return i(a);wc.writeFile(r,e,t,i)})})}function OQ(r,...e){let t=Xk.dirname(r);if(wc.existsSync(t))return wc.writeFileSync(r,...e);Zk.mkdirsSync(t),wc.writeFileSync(r,...e)}Yk.exports={outputFile:IQ(AQ),outputFileSync:OQ}});var _b=g((AEe,Cb)=>{"use strict";Cb.exports=Object.assign({},lb(),xb(),Sb(),Z1(),xk(),Ok(),Br(),Uk(),Jk(),Qk(),fn(),vc());var eI=require("fs");Object.getOwnPropertyDescriptor(eI,"promises")&&Object.defineProperty(Cb.exports,"promises",{get(){return eI.promises}})});var rI=g((OEe,tI)=>{tI.exports=()=>new Date});var Pb=g((LEe,di)=>{"use strict";function iI(r,e){for(var t=r.toString();t.length<e;)t="0"+t;return t}function _s(r){return iI(r,2)}function LQ(r){var e=Math.abs(r),t=String(Math.floor(e/60)),i=String(e%60);return t.length===1&&(t="0"+t),i.length===1&&(i="0"+i),r<0?"+"+t+i:"-"+t+i}function Ps(r,e,t){return e?r["getUTC"+t]():r["get"+t]()}function nI(r,e){typeof r!="string"&&(e=r,r=di.exports.ISO8601_FORMAT),e||(e=di.exports.now());var t=r.indexOf("O")>-1,i=_s(Ps(e,t,"Date")),n=_s(Ps(e,t,"Month")+1),o=_s(Ps(e,t,"FullYear")),s=_s(o.substring(2,4)),a=r.indexOf("yyyy")>-1?o:s,l=_s(Ps(e,t,"Hours")),u=_s(Ps(e,t,"Minutes")),c=_s(Ps(e,t,"Seconds")),f=iI(Ps(e,t,"Milliseconds"),3),p=LQ(e.getTimezoneOffset()),d=r.replace(/dd/g,i).replace(/MM/g,n).replace(/y{1,4}/g,a).replace(/hh/g,l).replace(/mm/g,u).replace(/ss/g,c).replace(/SSS/g,f).replace(/O/g,p);return d}function MQ(r,e,t){var i=[{pattern:/y{1,4}/,regexp:"\\d{1,4}",fn:function(u,c){u.setFullYear(c)}},{pattern:/MM/,regexp:"\\d{1,2}",fn:function(u,c){u.setMonth(c-1)}},{pattern:/dd/,regexp:"\\d{1,2}",fn:function(u,c){u.setDate(c)}},{pattern:/hh/,regexp:"\\d{1,2}",fn:function(u,c){u.setHours(c)}},{pattern:/mm/,regexp:"\\d\\d",fn:function(u,c){u.setMinutes(c)}},{pattern:/ss/,regexp:"\\d\\d",fn:function(u,c){u.setSeconds(c)}},{pattern:/SSS/,regexp:"\\d\\d\\d",fn:function(u,c){u.setMilliseconds(c)}},{pattern:/O/,regexp:"[+-]\\d{3,4}|Z",fn:function(u,c){c==="Z"&&(c=0);var f=Math.abs(c),p=f%100+Math.floor(f/100)*60;u.setMinutes(u.getMinutes()+(c>0?p:-p))}}],n=i.reduce(function(u,c){return c.pattern.test(u.regexp)?(c.index=u.regexp.match(c.pattern).index,u.regexp=u.regexp.replace(c.pattern,"("+c.regexp+")")):c.index=-1,u},{regexp:r,index:[]}),o=i.filter(function(u){return u.index>-1});o.sort(function(u,c){return u.index-c.index});var s=new RegExp(n.regexp),a=s.exec(e);if(a){var l=t||di.exports.now();return o.forEach(function(u,c){u.fn(l,a[c+1])}),l}throw new Error("String '"+e+"' could not be parsed as '"+r+"'")}function NQ(r,e,t){if(!r)throw new Error("pattern must be supplied");return MQ(r,e,t)}function qQ(){return new Date}di.exports=nI;di.exports.asString=nI;di.exports.parse=NQ;di.exports.now=qQ;di.exports.ISO8601_FORMAT="yyyy-MM-ddThh:mm:ss.SSS";di.exports.ISO8601_WITH_TZ_OFFSET_FORMAT="yyyy-MM-ddThh:mm:ss.SSSO";di.exports.DATETIME_FORMAT="dd MM yyyy hh:mm:ss.SSS";di.exports.ABSOLUTETIME_FORMAT="hh:mm:ss.SSS"});var aI=g((MEe,oI)=>{var $Q=gt()("streamroller:fileNameFormatter"),BQ=require("path"),sI=".",jQ=".gz";oI.exports=({file:r,keepFileExt:e,needsIndex:t,alwaysIncludeDate:i,compress:n})=>{let o=BQ.join(r.dir,r.name),s=f=>f+r.ext,a=(f,p,d)=>(t||!d)&&p?f+sI+p:f,l=(f,p,d)=>(p>0||i)&&d?f+sI+d:f,u=(f,p)=>p&&n?f+jQ:f,c=e?[l,a,s,u]:[s,l,a,u];return({date:f,index:p})=>($Q(`_formatFileName: date=${f}, index=${p}`),c.reduce((d,h)=>h(d,p,f),o))}});var fI=g((NEe,lI)=>{var Ts=gt()("streamroller:fileNameParser"),UQ=".",uI=".gz",cI=Pb();lI.exports=({file:r,keepFileExt:e,pattern:t})=>{let i=(c,f)=>c.endsWith(uI)?(Ts("it is gzipped"),f.isCompressed=!0,c.slice(0,-1*uI.length)):c,n="__NOT_MATCHING__",u=[i,e?c=>c.startsWith(r.name)&&c.endsWith(r.ext)?(Ts("it starts and ends with the right things"),c.slice(r.name.length+1,-1*r.ext.length)):n:c=>c.startsWith(r.base)?(Ts("it starts with the right things"),c.slice(r.base.length+1)):n,t?(c,f)=>{let p=c.split(UQ),d=p[p.length-1];Ts("items: ",p,", indexStr: ",d);let h=c;d!==void 0&&d.match(/^\d+$/)?(h=c.slice(0,-1*(d.length+1)),Ts(`dateStr is ${h}`),t&&!h&&(h=d,d="0")):d="0";try{let m=cI.parse(t,h,new Date(0,0));return cI.asString(t,m)!==h?c:(f.index=parseInt(d,10),f.date=h,f.timestamp=m.getTime(),"")}catch(m){return Ts(`Problem parsing ${h} as ${t}, error was: `,m),c}}:(c,f)=>c.match(/^\d+$/)?(Ts("it has an index"),f.index=parseInt(c,10),""):c];return c=>{let f={filename:c,index:0,isCompressed:!1};return u.reduce((d,h)=>h(d,f),c)?null:f}}});var dI=g((qEe,pI)=>{var Rs=gt()("streamroller:moveAndMaybeCompressFile"),yo=_b(),WQ=require("zlib"),HQ=async(r,e,t)=>{if(r===e){Rs("moveAndMaybeCompressFile: source and target are the same, not doing anything");return}if(await yo.pathExists(r))if(Rs(`moveAndMaybeCompressFile: moving file from ${r} to ${e} ${t?"with":"without"} compress`),t)await new Promise((i,n)=>{yo.createReadStream(r).pipe(WQ.createGzip()).pipe(yo.createWriteStream(e)).on("finish",()=>{Rs(`moveAndMaybeCompressFile: finished compressing ${e}, deleting ${r}`),yo.unlink(r).then(i).catch(()=>{Rs(`Deleting ${r} failed, truncating instead`),yo.truncate(r).then(i).catch(n)})})});else{Rs(`moveAndMaybeCompressFile: deleting file=${e}, renaming ${r} to ${e}`);try{await yo.move(r,e,{overwrite:!0})}catch(i){Rs(`moveAndMaybeCompressFile: error moving ${r} to ${e}`,i),Rs("Trying copy+truncate instead"),await yo.copy(r,e,{overwrite:!0}),await yo.truncate(r)}}};pI.exports=HQ});var Yd=g(($Ee,hI)=>{var jr=gt()("streamroller:RollingFileWriteStream"),xc=_b(),Vd=require("path"),Kd=rI(),Jd=Pb(),{Writable:zQ}=require("stream"),GQ=aI(),VQ=fI(),KQ=dI(),mI=class extends zQ{constructor(e,t){jr(`constructor: creating RollingFileWriteStream. path=${e}`),super(t),this.options=this._parseOption(t),this.fileObject=Vd.parse(e),this.fileObject.dir===""&&(this.fileObject=Vd.parse(Vd.join(process.cwd(),e))),this.fileFormatter=GQ({file:this.fileObject,alwaysIncludeDate:this.options.alwaysIncludePattern,needsIndex:this.options.maxSize<Number.MAX_SAFE_INTEGER,compress:this.options.compress,keepFileExt:this.options.keepFileExt}),this.fileNameParser=VQ({file:this.fileObject,keepFileExt:this.options.keepFileExt,pattern:this.options.pattern}),this.state={currentSize:0},this.options.pattern&&(this.state.currentDate=Jd(this.options.pattern,Kd())),this.filename=this.fileFormatter({index:0,date:this.state.currentDate}),["a","a+","as","as+"].includes(this.options.flags)&&this._setExistingSizeAndDate(),jr(`constructor: create new file ${this.filename}, state=${JSON.stringify(this.state)}`),this._renewWriteStream()}_setExistingSizeAndDate(){try{let e=xc.statSync(this.filename);this.state.currentSize=e.size,this.options.pattern&&(this.state.currentDate=Jd(this.options.pattern,e.mtime))}catch(e){return}}_parseOption(e){let t={maxSize:Number.MAX_SAFE_INTEGER,numToKeep:Number.MAX_SAFE_INTEGER,encoding:"utf8",mode:parseInt("0644",8),flags:"a",compress:!1,keepFileExt:!1,alwaysIncludePattern:!1},i=Object.assign({},t,e);if(i.maxSize<=0)throw new Error(`options.maxSize (${i.maxSize}) should be > 0`);if(i.numToKeep<=0)throw new Error(`options.numToKeep (${i.numToKeep}) should be > 0`);return jr(`_parseOption: creating stream with option=${JSON.stringify(i)}`),i}_final(e){this.currentFileStream.end("",this.options.encoding,e)}_write(e,t,i){this._shouldRoll().then(()=>{jr(`_write: writing chunk. file=${this.currentFileStream.path} state=${JSON.stringify(this.state)} chunk=${e}`),this.currentFileStream.write(e,t,n=>{this.state.currentSize+=e.length,i(n)})})}async _shouldRoll(){(this._dateChanged()||this._tooBig())&&(jr(`_shouldRoll: rolling because dateChanged? ${this._dateChanged()} or tooBig? ${this._tooBig()}`),await this._roll())}_dateChanged(){return this.state.currentDate&&this.state.currentDate!==Jd(this.options.pattern,Kd())}_tooBig(){return this.state.currentSize>=this.options.maxSize}_roll(){return jr("_roll: closing the current stream"),new Promise((e,t)=>{this.currentFileStream.end("",this.options.encoding,()=>{this._moveOldFiles().then(e).catch(t)})})}async _moveOldFiles(){let e=await this._getExistingFiles(),t=this.state.currentDate?e.filter(i=>i.date===this.state.currentDate):e;for(let i=t.length;i>=0;i--){jr(`_moveOldFiles: i = ${i}`);let n=this.fileFormatter({date:this.state.currentDate,index:i}),o=this.fileFormatter({date:this.state.currentDate,index:i+1});await KQ(n,o,this.options.compress&&i===0)}this.state.currentSize=0,this.state.currentDate=this.state.currentDate?Jd(this.options.pattern,Kd()):null,jr(`_moveOldFiles: finished rolling files. state=${JSON.stringify(this.state)}`),this._renewWriteStream(),await new Promise((i,n)=>{this.currentFileStream.write("","utf8",()=>{this._clean().then(i).catch(n)})})}async _getExistingFiles(){let e=await xc.readdir(this.fileObject.dir).catch(()=>[]);jr(`_getExistingFiles: files=${e}`);let t=e.map(n=>this.fileNameParser(n)).filter(n=>n),i=n=>(n.timestamp?n.timestamp:Kd().getTime())-n.index;return t.sort((n,o)=>i(n)-i(o)),t}_renewWriteStream(){xc.ensureDirSync(this.fileObject.dir);let e=this.fileFormatter({date:this.state.currentDate,index:0}),t={flags:this.options.flags,encoding:this.options.encoding,mode:this.options.mode};this.currentFileStream=xc.createWriteStream(e,t),this.currentFileStream.on("error",i=>{this.emit("error",i)})}async _clean(){let e=await this._getExistingFiles();if(jr(`_clean: numToKeep = ${this.options.numToKeep}, existingFiles = ${e.length}`),jr("_clean: existing files are: ",e),this._tooManyFiles(e.length)){let t=e.slice(0,e.length-this.options.numToKeep-1).map(i=>Vd.format({dir:this.fileObject.dir,base:i.filename}));await JQ(t)}}_tooManyFiles(e){return this.options.numToKeep>0&&e>this.options.numToKeep}},JQ=r=>(jr(`deleteFiles: files to delete: ${r}`),Promise.all(r.map(e=>xc.unlink(e).catch(t=>{jr(`deleteFiles: error when unlinking ${e}, ignoring. Error was ${t}`)}))));hI.exports=mI});var yI=g((BEe,gI)=>{var YQ=Yd(),vI=class extends YQ{constructor(e,t,i,n){n||(n={}),t&&(n.maxSize=t),i||(i=1),n.numToKeep=i,super(e,n),this.backups=this.options.numToKeep,this.size=this.options.maxSize}get theStream(){return this.currentFileStream}};gI.exports=vI});var xI=g((jEe,bI)=>{var XQ=Yd(),wI=class extends XQ{constructor(e,t,i){t&&typeof t=="object"&&(i=t,t=null),i||(i={}),t||(t="yyyy-MM-dd"),i.daysToKeep&&(i.numToKeep=i.daysToKeep),t.startsWith(".")&&(t=t.substring(1)),i.pattern=t,super(e,i),this.mode=this.options.mode}get theStream(){return this.currentFileStream}};bI.exports=wI});var Tb=g((UEe,DI)=>{DI.exports={RollingFileWriteStream:Yd(),RollingFileStream:yI(),DateRollingFileStream:xI()}});var _I=g((WEe,SI)=>{var EI=gt()("log4js:file"),ZQ=require("path"),QQ=Tb(),eee=require("os"),tee=eee.EOL;function CI(r,e,t,i){let n=new QQ.RollingFileStream(r,e,t,i);return n.on("error",o=>{console.error("log4js.fileAppender - Writing to file %s, error happened ",r,o)}),n.on("drain",()=>{process.emit("log4js:pause",!1)}),n}function ree(r,e,t,i,n,o){r=ZQ.normalize(r),i=i===void 0?5:i,i=i===0?1:i,EI("Creating file appender (",r,", ",t,", ",i,", ",n,", ",o,")");let s=CI(r,t,i,n),a=function(l){if(n.removeColor===!0){let u=/\x1b[[0-9;]*m/g;l.data=l.data.map(c=>typeof c=="string"?c.replace(u,""):c)}s.write(e(l,o)+tee,"utf8")||process.emit("log4js:pause",!0)};return a.reopen=function(){s.end(()=>{s=CI(r,t,i,n)})},a.sighupHandler=function(){EI("SIGHUP handler called."),a.reopen()},a.shutdown=function(l){process.removeListener("SIGHUP",a.sighupHandler),s.end("","utf-8",l)},process.on("SIGHUP",a.sighupHandler),a}function iee(r,e){let t=e.basicLayout;return r.layout&&(t=e.layout(r.layout.type,r.layout)),ree(r.filename,t,r.maxLogSize,r.backups,r,r.timezoneOffset)}SI.exports.configure=iee});var TI=g((HEe,PI)=>{var nee=Tb(),oee=require("os"),see=oee.EOL;function aee(r,e,t,i,n){i.maxSize=i.maxLogSize;let o=new nee.DateRollingFileStream(r,e,i);o.on("drain",()=>{process.emit("log4js:pause",!1)});let s=function(a){o.write(t(a,n)+see,"utf8")||process.emit("log4js:pause",!0)};return s.shutdown=function(a){o.write("","utf-8",()=>{o.end(a)})},s}function lee(r,e){let t=e.basicLayout;return r.layout&&(t=e.layout(r.layout.type,r.layout)),r.alwaysIncludePattern||(r.alwaysIncludePattern=!1),aee(r.filename,r.pattern,t,r,r.timezoneOffset)}PI.exports.configure=lee});var FI=g((zEe,RI)=>{var An=gt()("log4js:fileSync"),Ua=require("path"),On=require("fs"),uee=require("os"),cee=uee.EOL||`
|
||
`;function kI(r,e){if(On.existsSync(r))return;let t=On.openSync(r,e.flags,e.mode);On.closeSync(t)}var II=class{constructor(e,t,i,n){An("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||1,this.options=n,this.currentSize=0;function s(a){let l=0;try{l=On.statSync(a).size}catch(u){kI(a,n)}return l}this.currentSize=s(this.filename)}shouldRoll(){return An("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(`^${Ua.basename(e)}`);function n(u){return i.test(u)}function o(u){return parseInt(u.substring(`${Ua.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(An(`Index of ${u} is ${c}`),c<t.backups){try{On.unlinkSync(`${e}.${c+1}`)}catch(f){}An(`Renaming ${u} -> ${e}.${c+1}`),On.renameSync(Ua.join(Ua.dirname(e),u),`${e}.${c+1}`)}}function l(){An("Renaming the old files"),On.readdirSync(Ua.dirname(e)).filter(n).sort(s).reverse().forEach(a)}An("Rolling, rolling, rolling"),l()}write(e,t){let i=this;function n(){An("writing the chunk to the file"),i.currentSize+=e.length,On.appendFileSync(i.filename,e)}An("in write"),this.shouldRoll()&&(this.currentSize=0,this.roll(this.filename)),n()}};function fee(r,e,t,i,n,o){An("fileSync appender created"),r=Ua.normalize(r),i=i===void 0?5:i,i=i===0?1:i;function s(l,u,c){let f;return u?f=new II(l,u,c,o):f=(p=>(kI(p,o),{write(d){On.appendFileSync(p,d)}}))(l),f}let a=s(r,t,i);return l=>{a.write(e(l,n)+cee)}}function pee(r,e){let t=e.basicLayout;r.layout&&(t=e.layout(r.layout.type,r.layout));let i={flags:r.flags||"a",encoding:r.encoding||"utf8",mode:r.mode||420};return fee(r.filename,t,r.maxLogSize,r.backups,r.timezoneOffset,i)}RI.exports.configure=pee});var kb=g((GEe,AI)=>{var dee=require("path"),ks=gt()("log4js:appenders"),hi=bs(),OI=Ld(),hee=Ds(),mee=eb(),gee=TR(),pn=new Map;pn.set("console",kR());pn.set("stdout",FR());pn.set("stderr",OR());pn.set("logLevelFilter",MR());pn.set("categoryFilter",$R());pn.set("noLogFilter",UR());pn.set("file",_I());pn.set("dateFile",TI());pn.set("fileSync",FI());var Dc=new Map,Rb=(r,e)=>{ks("Loading module from ",r);try{return require(r)}catch(t){hi.throwExceptionIf(e,t.code!=="MODULE_NOT_FOUND",`appender "${r}" could not be loaded (error was: ${t})`);return}},vee=(r,e)=>pn.get(r)||Rb(`./${r}`,e)||Rb(r,e)||""||Rb(dee.join(process.cwd(),r),e),Xd=new Set,LI=(r,e)=>{if(Dc.has(r))return Dc.get(r);if(!e.appenders[r])return!1;if(Xd.has(r))throw new Error(`Dependency loop detected for appender ${r}.`);Xd.add(r),ks(`Creating appender ${r}`);let t=yee(r,e);return Xd.delete(r),Dc.set(r,t),t},yee=(r,e)=>{let t=e.appenders[r],i=t.type.configure?t.type:vee(t.type,e);return hi.throwExceptionIf(e,hi.not(i),`appender "${r}" is not valid (type "${t.type}" could not be found)`),i.appender&&ks(`DEPRECATION: Appender ${t.type} exports an appender function.`),i.shutdown&&ks(`DEPRECATION: Appender ${t.type} exports a shutdown function.`),ks(`${r}: clustering.isMaster ? ${OI.isMaster()}`),ks(`${r}: appenderModule is ${require("util").inspect(i)}`),OI.onlyOnMaster(()=>(ks(`calling appenderModule.configure for ${r} / ${t.type}`),i.configure(gee.modifyConfig(t),mee,n=>LI(n,e),hee)),()=>{})},MI=r=>{Dc.clear(),Xd.clear();let e=[];Object.values(r.categories).forEach(t=>{e.push(...t.appenders)}),Object.keys(r.appenders).forEach(t=>{(e.includes(t)||r.appenders[t].type==="tcp-server")&&LI(t,r)})};MI({appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"trace"}}});hi.addListener(r=>{hi.throwExceptionIf(r,hi.not(hi.anObject(r.appenders)),'must have a property "appenders" of type object.');let e=Object.keys(r.appenders);hi.throwExceptionIf(r,hi.not(e.length),"must define at least one appender."),e.forEach(t=>{hi.throwExceptionIf(r,hi.not(r.appenders[t].type),`appender "${t}" is not valid (must be an object with property "type")`)})});hi.addListener(MI);AI.exports=Dc});var Fb=g((VEe,NI)=>{var Is=gt()("log4js:categories"),at=bs(),Ib=Ds(),qI=kb(),Wa=new Map;function $I(r,e,t){if(e.inherit===!1)return;let i=t.lastIndexOf(".");if(i<0)return;let n=t.substring(0,i),o=r.categories[n];o||(o={inherit:!0,appenders:[]}),$I(r,o,n),!r.categories[n]&&o.appenders&&o.appenders.length&&o.level&&(r.categories[n]=o),e.appenders=e.appenders||[],e.level=e.level||o.level,o.appenders.forEach(s=>{e.appenders.includes(s)||e.appenders.push(s)}),e.parent=o}function bee(r){if(!r.categories)return;Object.keys(r.categories).forEach(t=>{let i=r.categories[t];$I(r,i,t)})}at.addPreProcessingListener(r=>bee(r));at.addListener(r=>{at.throwExceptionIf(r,at.not(at.anObject(r.categories)),'must have a property "categories" of type object.');let e=Object.keys(r.categories);at.throwExceptionIf(r,at.not(e.length),"must define at least one category."),e.forEach(t=>{let i=r.categories[t];at.throwExceptionIf(r,[at.not(i.appenders),at.not(i.level)],`category "${t}" is not valid (must be an object with properties "appenders" and "level")`),at.throwExceptionIf(r,at.not(Array.isArray(i.appenders)),`category "${t}" is not valid (appenders must be an array of appender names)`),at.throwExceptionIf(r,at.not(i.appenders.length),`category "${t}" is not valid (appenders must contain at least one appender name)`),Object.prototype.hasOwnProperty.call(i,"enableCallStack")&&at.throwExceptionIf(r,typeof i.enableCallStack!="boolean",`category "${t}" is not valid (enableCallStack must be boolean type)`),i.appenders.forEach(n=>{at.throwExceptionIf(r,at.not(qI.get(n)),`category "${t}" is not valid (appender "${n}" is not defined)`)}),at.throwExceptionIf(r,at.not(Ib.getLevel(i.level)),`category "${t}" is not valid (level "${i.level}" not recognised; valid levels are ${Ib.levels.join(", ")})`)}),at.throwExceptionIf(r,at.not(r.categories.default),'must define a "default" category.')});var BI=r=>{Wa.clear(),Object.keys(r.categories).forEach(t=>{let i=r.categories[t],n=[];i.appenders.forEach(o=>{n.push(qI.get(o)),Is(`Creating category ${t}`),Wa.set(t,{appenders:n,level:Ib.getLevel(i.level),enableCallStack:i.enableCallStack||!1})})})};BI({categories:{default:{appenders:["out"],level:"OFF"}}});at.addListener(BI);var Fs=r=>(Is(`configForCategory: searching for config for ${r}`),Wa.has(r)?(Is(`configForCategory: ${r} exists in config, returning it`),Wa.get(r)):r.indexOf(".")>0?(Is(`configForCategory: ${r} has hierarchy, searching for parents`),Fs(r.substring(0,r.lastIndexOf(".")))):(Is("configForCategory: returning config for default category"),Fs("default"))),wee=r=>Fs(r).appenders,xee=r=>Fs(r).level,Dee=(r,e)=>{let t=Wa.get(r);if(Is(`setLevelForCategory: found ${t} for ${r}`),!t){let i=Fs(r);Is(`setLevelForCategory: no config found for category, found ${i} for parents of ${r}`),t={appenders:i.appenders}}t.level=e,Wa.set(r,t)},See=r=>Fs(r).enableCallStack===!0,Eee=(r,e)=>{Fs(r).enableCallStack=e};NI.exports={appendersForCategory:wee,getLevelForCategory:xee,setLevelForCategory:Dee,getEnableCallStackForCategory:See,setEnableCallStackForCategory:Eee}});var HI=g((KEe,jI)=>{var UI=gt()("log4js:logger"),Cee=rb(),bo=Ds(),_ee=Ld(),Zd=Fb(),Pee=bs(),Tee=/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/;function Ree(r,e=4){let t=r.stack.split(`
|
||
`).slice(e),i=Tee.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 Qd=class{constructor(e){if(!e)throw new Error("No category provided.");this.category=e,this.context={},this.parseCallStack=Ree,UI(`Logger created (${this.category}, ${this.level})`)}get level(){return bo.getLevel(Zd.getLevelForCategory(this.category),bo.TRACE)}set level(e){Zd.setLevelForCategory(this.category,bo.getLevel(e,this.level))}get useCallStack(){return Zd.getEnableCallStackForCategory(this.category)}set useCallStack(e){Zd.setEnableCallStackForCategory(this.category,e===!0)}log(e,...t){let i=bo.getLevel(e,bo.INFO);this.isLevelEnabled(i)&&this._log(i,t)}isLevelEnabled(e){return this.level.isLessThanOrEqualTo(e)}_log(e,t){UI(`sending log data (${e}) to appenders`);let i=new Cee(this.category,e,t,this.context,this.useCallStack&&this.parseCallStack(new Error));_ee.send(i)}addContext(e,t){this.context[e]=t}removeContext(e){delete this.context[e]}clearContext(){this.context={}}setParseCallStackFunction(e){this.parseCallStack=e}};function WI(r){let e=bo.getLevel(r),i=e.toString().toLowerCase().replace(/_([a-z])/g,o=>o[1].toUpperCase()),n=i[0].toUpperCase()+i.slice(1);Qd.prototype[`is${n}Enabled`]=function(){return this.isLevelEnabled(e)},Qd.prototype[i]=function(...o){this.log(e,...o)}}bo.levels.forEach(WI);Pee.addListener(()=>{bo.levels.forEach(WI)});jI.exports=Qd});var VI=g((JEe,zI)=>{var Ha=Ds(),kee=':remote-addr - - ":method :url HTTP/:http-version" :status :content-length ":referrer" ":user-agent"';function Iee(r){return r.originalUrl||r.url}function Fee(r,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},n=[];return n.push({token:":url",replacement:Iee(r)}),n.push({token:":protocol",replacement:r.protocol}),n.push({token:":hostname",replacement:r.hostname}),n.push({token:":method",replacement:r.method}),n.push({token:":status",replacement:e.__statusCode||e.statusCode}),n.push({token:":response-time",replacement:e.responseTime}),n.push({token:":date",replacement:new Date().toUTCString()}),n.push({token:":referrer",replacement:r.headers.referer||r.headers.referrer||""}),n.push({token:":http-version",replacement:`${r.httpVersionMajor}.${r.httpVersionMinor}`}),n.push({token:":remote-addr",replacement:r.headers["x-forwarded-for"]||r.ip||r._remoteAddress||r.socket&&(r.socket.remoteAddress||r.socket.socket&&r.socket.socket.remoteAddress)}),n.push({token:":user-agent",replacement:r.headers["user-agent"]}),n.push({token:":content-length",replacement:e.getHeader("content-length")||e.__headers&&e.__headers["Content-Length"]||"-"}),n.push({token:/:req\[([^\]]+)]/g,replacement(o,s){return r.headers[s.toLowerCase()]}}),n.push({token:/:res\[([^\]]+)]/g,replacement(o,s){return e.getHeader(s.toLowerCase())||e.__headers&&e.__headers[s]}}),i(t.concat(n))}function GI(r,e){for(let t=0;t<e.length;t++)r=r.replace(e[t].token,e[t].replacement);return r}function Aee(r){let e=null;if(r instanceof RegExp&&(e=r),typeof r=="string"&&(e=new RegExp(r)),Array.isArray(r)){let t=r.map(i=>i.source?i.source:i);e=new RegExp(t.join("|"))}return e}function Oee(r,e,t){let i=e;if(t){let n=t.find(o=>{let s=!1;return o.from&&o.to?s=r>=o.from&&r<=o.to:s=o.codes.indexOf(r)!==-1,s});n&&(i=Ha.getLevel(n.level,i))}return i}zI.exports=function(e,t){typeof t=="string"||typeof t=="function"?t={format:t}:t=t||{};let i=e,n=Ha.getLevel(t.level,Ha.INFO),o=t.format||kee,s=Aee(t.nolog);return(a,l,u)=>{if(a._logging||s&&s.test(a.originalUrl))return u();if(i.isLevelEnabled(n)||t.level==="auto"){let c=new Date,{writeHead:f}=l;a._logging=!0,l.writeHead=(p,d)=>{l.writeHead=f,l.writeHead(p,d),l.__statusCode=p,l.__headers=d||{}},l.on("finish",()=>{l.responseTime=new Date-c,l.statusCode&&t.level==="auto"&&(n=Ha.INFO,l.statusCode>=300&&(n=Ha.WARN),l.statusCode>=400&&(n=Ha.ERROR)),n=Oee(l.statusCode,n,t.statusRules);let p=Fee(a,l,t.tokens||[]);if(t.context&&i.addContext("res",l),typeof o=="function"){let d=o(a,l,h=>GI(h,p));d&&i.log(n,d)}else i.log(n,GI(o,p));t.context&&i.removeContext("res")})}return u()}}});var Ab=g((YEe,KI)=>{var wo=gt()("log4js:main"),Lee=require("fs"),Mee=XT()({proto:!0}),Nee=bs(),qee=eb(),$ee=Ds(),Bee=kb(),jee=Fb(),Uee=HI(),Wee=Ld(),Hee=VI(),eh=!1;function zee(r){if(!eh)return;wo("Received log event ",r),jee.appendersForCategory(r.categoryName).forEach(t=>{t(r)})}function Gee(r){wo(`Loading configuration from ${r}`);try{return JSON.parse(Lee.readFileSync(r,"utf8"))}catch(e){throw new Error(`Problem reading config from file "${r}". Error was ${e.message}`,e)}}function YI(r){let e=r;return typeof e=="string"&&(e=Gee(r)),wo(`Configuration is ${e}`),Nee.configure(Mee(e)),Wee.onMessage(zee),eh=!0,JI}function Vee(r){wo("Shutdown called. Disabling all log writing."),eh=!1;let e=Array.from(Bee.values()),t=e.reduceRight((s,a)=>a.shutdown?s+1:s,0),i=0,n;wo(`Found ${t} appenders with shutdown functions.`);function o(s){n=n||s,i+=1,wo(`Appender shutdowns complete: ${i} / ${t}`),i>=t&&(wo("All shutdown functions completed."),r&&r(n))}return t===0?(wo("No appenders with shutdown functions found."),r!==void 0&&r()):(e.filter(s=>s.shutdown).forEach(s=>s.shutdown(o)),null)}function Kee(r){return eh||YI(process.env.LOG4JS_CONFIG||{appenders:{out:{type:"stdout"}},categories:{default:{appenders:["out"],level:"OFF"}}}),new Uee(r||"default")}var JI={getLogger:Kee,configure:YI,shutdown:Vee,connectLogger:Hee,levels:$ee,addLayout:qee.addLayout};KI.exports=JI});var Ur=g(Ob=>{"use strict";Ob.fromCallback=function(r){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")r.apply(this,e);else return new Promise((t,i)=>{r.apply(this,e.concat([(n,o)=>n?i(n):t(o)]))})},"name",{value:r.name})};Ob.fromPromise=function(r){return Object.defineProperty(function(...e){let t=e[e.length-1];if(typeof t!="function")return r.apply(this,e);r.apply(this,e.slice(0,-1)).then(i=>t(null,i),t)},"name",{value:r.name})}});var Sc=g(xo=>{"use strict";var XI=Ur().fromCallback,gr=Ce(),Jee=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(r=>typeof gr[r]=="function");Object.keys(gr).forEach(r=>{r!=="promises"&&(xo[r]=gr[r])});Jee.forEach(r=>{xo[r]=XI(gr[r])});xo.exists=function(r,e){return typeof e=="function"?gr.exists(r,e):new Promise(t=>gr.exists(r,t))};xo.read=function(r,e,t,i,n,o){return typeof o=="function"?gr.read(r,e,t,i,n,o):new Promise((s,a)=>{gr.read(r,e,t,i,n,(l,u,c)=>{if(l)return a(l);s({bytesRead:u,buffer:c})})})};xo.write=function(r,e,...t){return typeof t[t.length-1]=="function"?gr.write(r,e,...t):new Promise((i,n)=>{gr.write(r,e,...t,(o,s,a)=>{if(o)return n(o);i({bytesWritten:s,buffer:a})})})};typeof gr.writev=="function"&&(xo.writev=function(r,e,...t){return typeof t[t.length-1]=="function"?gr.writev(r,e,...t):new Promise((i,n)=>{gr.writev(r,e,...t,(o,s,a)=>{if(o)return n(o);i({bytesWritten:s,buffers:a})})})});typeof gr.realpath.native=="function"&&(xo.realpath.native=XI(gr.realpath.native))});var Lb=g((QEe,ZI)=>{ZI.exports=r=>{let e=process.versions.node.split(".").map(t=>parseInt(t,10));return r=r.split(".").map(t=>parseInt(t,10)),e[0]>r[0]||e[0]===r[0]&&(e[1]>r[1]||e[1]===r[1]&&e[2]>=r[2])}});var iF=g((eCe,Mb)=>{"use strict";var za=Sc(),Ln=require("path"),Yee=Lb(),QI=Yee("10.12.0"),eF=r=>{if(process.platform==="win32"&&/[<>:"|?*]/.test(r.replace(Ln.parse(r).root,""))){let t=new Error(`Path contains invalid characters: ${r}`);throw t.code="EINVAL",t}},tF=r=>{let e={mode:511};return typeof r=="number"&&(r={mode:r}),{...e,...r}},rF=r=>{let e=new Error(`operation not permitted, mkdir '${r}'`);return e.code="EPERM",e.errno=-4048,e.path=r,e.syscall="mkdir",e};Mb.exports.makeDir=async(r,e)=>{if(eF(r),e=tF(e),QI){let i=Ln.resolve(r);return za.mkdir(i,{mode:e.mode,recursive:!0})}let t=async i=>{try{await za.mkdir(i,e.mode)}catch(n){if(n.code==="EPERM")throw n;if(n.code==="ENOENT"){if(Ln.dirname(i)===i)throw rF(i);if(n.message.includes("null bytes"))throw n;return await t(Ln.dirname(i)),t(i)}try{if(!(await za.stat(i)).isDirectory())throw new Error("The path is not a directory")}catch{throw n}}};return t(Ln.resolve(r))};Mb.exports.makeDirSync=(r,e)=>{if(eF(r),e=tF(e),QI){let i=Ln.resolve(r);return za.mkdirSync(i,{mode:e.mode,recursive:!0})}let t=i=>{try{za.mkdirSync(i,e.mode)}catch(n){if(n.code==="EPERM")throw n;if(n.code==="ENOENT"){if(Ln.dirname(i)===i)throw rF(i);if(n.message.includes("null bytes"))throw n;return t(Ln.dirname(i)),t(i)}try{if(!za.statSync(i).isDirectory())throw new Error("The path is not a directory")}catch{throw n}}};return t(Ln.resolve(r))}});var qi=g((tCe,nF)=>{"use strict";var Xee=Ur().fromPromise,{makeDir:Zee,makeDirSync:Nb}=iF(),qb=Xee(Zee);nF.exports={mkdirs:qb,mkdirsSync:Nb,mkdirp:qb,mkdirpSync:Nb,ensureDir:qb,ensureDirSync:Nb}});var $b=g((rCe,oF)=>{"use strict";var Ga=Ce();function Qee(r,e,t,i){Ga.open(r,"r+",(n,o)=>{if(n)return i(n);Ga.futimes(o,e,t,s=>{Ga.close(o,a=>{i&&i(s||a)})})})}function ete(r,e,t){let i=Ga.openSync(r,"r+");return Ga.futimesSync(i,e,t),Ga.closeSync(i)}oF.exports={utimesMillis:Qee,utimesMillisSync:ete}});var Ec=g((iCe,sF)=>{"use strict";var Va=Sc(),_r=require("path"),tte=require("util"),rte=Lb(),th=rte("10.5.0"),aF=r=>th?Va.stat(r,{bigint:!0}):Va.stat(r),Bb=r=>th?Va.statSync(r,{bigint:!0}):Va.statSync(r);function ite(r,e){return Promise.all([aF(r),aF(e).catch(t=>{if(t.code==="ENOENT")return null;throw t})]).then(([t,i])=>({srcStat:t,destStat:i}))}function nte(r,e){let t,i=Bb(r);try{t=Bb(e)}catch(n){if(n.code==="ENOENT")return{srcStat:i,destStat:null};throw n}return{srcStat:i,destStat:t}}function ote(r,e,t,i){tte.callbackify(ite)(r,e,(n,o)=>{if(n)return i(n);let{srcStat:s,destStat:a}=o;return a&&rh(s,a)?i(new Error("Source and destination must not be the same.")):s.isDirectory()&&jb(r,e)?i(new Error(ih(r,e,t))):i(null,{srcStat:s,destStat:a})})}function ste(r,e,t){let{srcStat:i,destStat:n}=nte(r,e);if(n&&rh(i,n))throw new Error("Source and destination must not be the same.");if(i.isDirectory()&&jb(r,e))throw new Error(ih(r,e,t));return{srcStat:i,destStat:n}}function lF(r,e,t,i,n){let o=_r.resolve(_r.dirname(r)),s=_r.resolve(_r.dirname(t));if(s===o||s===_r.parse(s).root)return n();let a=(l,u)=>l?l.code==="ENOENT"?n():n(l):rh(e,u)?n(new Error(ih(r,t,i))):lF(r,e,s,i,n);th?Va.stat(s,{bigint:!0},a):Va.stat(s,a)}function uF(r,e,t,i){let n=_r.resolve(_r.dirname(r)),o=_r.resolve(_r.dirname(t));if(o===n||o===_r.parse(o).root)return;let s;try{s=Bb(o)}catch(a){if(a.code==="ENOENT")return;throw a}if(rh(e,s))throw new Error(ih(r,t,i));return uF(r,e,o,i)}function rh(r,e){return!!(e.ino&&e.dev&&e.ino===r.ino&&e.dev===r.dev&&(th||e.ino<Number.MAX_SAFE_INTEGER||e.size===r.size&&e.mode===r.mode&&e.nlink===r.nlink&&e.atimeMs===r.atimeMs&&e.mtimeMs===r.mtimeMs&&e.ctimeMs===r.ctimeMs&&e.birthtimeMs===r.birthtimeMs))}function jb(r,e){let t=_r.resolve(r).split(_r.sep).filter(n=>n),i=_r.resolve(e).split(_r.sep).filter(n=>n);return t.reduce((n,o,s)=>n&&i[s]===o,!0)}function ih(r,e,t){return`Cannot ${t} '${r}' to a subdirectory of itself, '${e}'.`}sF.exports={checkPaths:ote,checkPathsSync:ste,checkParentPaths:lF,checkParentPathsSync:uF,isSrcSubdir:jb}});var hF=g((nCe,cF)=>{"use strict";var tr=Ce(),Cc=require("path"),ate=qi().mkdirsSync,lte=$b().utimesMillisSync,_c=Ec();function cte(r,e,t){typeof t=="function"&&(t={filter:t}),t=t||{},t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
||
|
||
see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:i,destStat:n}=_c.checkPathsSync(r,e,"copy");return _c.checkParentPathsSync(r,i,e,"copy"),ute(n,r,e,t)}function ute(r,e,t,i){if(i.filter&&!i.filter(e,t))return;let n=Cc.dirname(t);return tr.existsSync(n)||ate(n),fF(r,e,t,i)}function fF(r,e,t,i){if(!(i.filter&&!i.filter(e,t)))return fte(r,e,t,i)}function fte(r,e,t,i){let o=(i.dereference?tr.statSync:tr.lstatSync)(e);if(o.isDirectory())return dte(o,r,e,t,i);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return pte(o,r,e,t,i);if(o.isSymbolicLink())return hte(r,e,t,i)}function pte(r,e,t,i,n){return e?mte(r,t,i,n):pF(r,t,i,n)}function mte(r,e,t,i){if(i.overwrite)return tr.unlinkSync(t),pF(r,e,t,i);if(i.errorOnExist)throw new Error(`'${t}' already exists`)}function pF(r,e,t,i){return tr.copyFileSync(e,t),i.preserveTimestamps&>e(r.mode,e,t),Ub(t,r.mode)}function gte(r,e,t){return vte(r)&&yte(t,r),bte(e,t)}function vte(r){return(r&128)==0}function yte(r,e){return Ub(r,e|128)}function Ub(r,e){return tr.chmodSync(r,e)}function bte(r,e){let t=tr.statSync(r);return lte(e,t.atime,t.mtime)}function dte(r,e,t,i,n){if(!e)return wte(r.mode,t,i,n);if(e&&!e.isDirectory())throw new Error(`Cannot overwrite non-directory '${i}' with directory '${t}'.`);return dF(t,i,n)}function wte(r,e,t,i){return tr.mkdirSync(t),dF(e,t,i),Ub(t,r)}function dF(r,e,t){tr.readdirSync(r).forEach(i=>xte(i,r,e,t))}function xte(r,e,t,i){let n=Cc.join(e,r),o=Cc.join(t,r),{destStat:s}=_c.checkPathsSync(n,o,"copy");return fF(s,n,o,i)}function hte(r,e,t,i){let n=tr.readlinkSync(e);if(i.dereference&&(n=Cc.resolve(process.cwd(),n)),r){let o;try{o=tr.readlinkSync(t)}catch(s){if(s.code==="EINVAL"||s.code==="UNKNOWN")return tr.symlinkSync(n,t);throw s}if(i.dereference&&(o=Cc.resolve(process.cwd(),o)),_c.isSrcSubdir(n,o))throw new Error(`Cannot copy '${n}' to a subdirectory of itself, '${o}'.`);if(tr.statSync(t).isDirectory()&&_c.isSrcSubdir(o,n))throw new Error(`Cannot overwrite '${o}' with '${n}'.`);return Dte(n,t)}else return tr.symlinkSync(n,t)}function Dte(r,e){return tr.unlinkSync(e),tr.symlinkSync(r,e)}cF.exports=cte});var Wb=g((oCe,mF)=>{"use strict";mF.exports={copySync:hF()}});var Do=g((sCe,gF)=>{"use strict";var Ste=Ur().fromPromise,vF=Sc();function Ete(r){return vF.access(r).then(()=>!0).catch(()=>!1)}gF.exports={pathExists:Ste(Ete),pathExistsSync:vF.existsSync}});var _F=g((aCe,yF)=>{"use strict";var Pr=Ce(),Pc=require("path"),Cte=qi().mkdirs,_te=Do().pathExists,Pte=$b().utimesMillis,Tc=Ec();function Tte(r,e,t,i){typeof t=="function"&&!i?(i=t,t={}):typeof t=="function"&&(t={filter:t}),i=i||function(){},t=t||{},t.clobber="clobber"in t?!!t.clobber:!0,t.overwrite="overwrite"in t?!!t.overwrite:t.clobber,t.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
||
|
||
see https://github.com/jprichardson/node-fs-extra/issues/269`),Tc.checkPaths(r,e,"copy",(n,o)=>{if(n)return i(n);let{srcStat:s,destStat:a}=o;Tc.checkParentPaths(r,s,e,"copy",l=>l?i(l):t.filter?wF(bF,a,r,e,t,i):bF(a,r,e,t,i))})}function bF(r,e,t,i,n){let o=Pc.dirname(t);_te(o,(s,a)=>{if(s)return n(s);if(a)return Hb(r,e,t,i,n);Cte(o,l=>l?n(l):Hb(r,e,t,i,n))})}function wF(r,e,t,i,n,o){Promise.resolve(n.filter(t,i)).then(s=>s?r(e,t,i,n,o):o(),s=>o(s))}function Hb(r,e,t,i,n){return i.filter?wF(xF,r,e,t,i,n):xF(r,e,t,i,n)}function xF(r,e,t,i,n){(i.dereference?Pr.stat:Pr.lstat)(e,(s,a)=>{if(s)return n(s);if(a.isDirectory())return kte(a,r,e,t,i,n);if(a.isFile()||a.isCharacterDevice()||a.isBlockDevice())return Rte(a,r,e,t,i,n);if(a.isSymbolicLink())return Ite(r,e,t,i,n)})}function Rte(r,e,t,i,n,o){return e?Fte(r,t,i,n,o):DF(r,t,i,n,o)}function Fte(r,e,t,i,n){if(i.overwrite)Pr.unlink(t,o=>o?n(o):DF(r,e,t,i,n));else return i.errorOnExist?n(new Error(`'${t}' already exists`)):n()}function DF(r,e,t,i,n){Pr.copyFile(e,t,o=>o?n(o):i.preserveTimestamps?Ate(r.mode,e,t,n):nh(t,r.mode,n))}function Ate(r,e,t,i){return Ote(r)?Lte(t,r,n=>n?i(n):SF(r,e,t,i)):SF(r,e,t,i)}function Ote(r){return(r&128)==0}function Lte(r,e,t){return nh(r,e|128,t)}function SF(r,e,t,i){Mte(e,t,n=>n?i(n):nh(t,r,i))}function nh(r,e,t){return Pr.chmod(r,e,t)}function Mte(r,e,t){Pr.stat(r,(i,n)=>i?t(i):Pte(e,n.atime,n.mtime,t))}function kte(r,e,t,i,n,o){return e?e&&!e.isDirectory()?o(new Error(`Cannot overwrite non-directory '${i}' with directory '${t}'.`)):EF(t,i,n,o):Nte(r.mode,t,i,n,o)}function Nte(r,e,t,i,n){Pr.mkdir(t,o=>{if(o)return n(o);EF(e,t,i,s=>s?n(s):nh(t,r,n))})}function EF(r,e,t,i){Pr.readdir(r,(n,o)=>n?i(n):CF(o,r,e,t,i))}function CF(r,e,t,i,n){let o=r.pop();return o?qte(r,o,e,t,i,n):n()}function qte(r,e,t,i,n,o){let s=Pc.join(t,e),a=Pc.join(i,e);Tc.checkPaths(s,a,"copy",(l,u)=>{if(l)return o(l);let{destStat:c}=u;Hb(c,s,a,n,f=>f?o(f):CF(r,t,i,n,o))})}function Ite(r,e,t,i,n){Pr.readlink(e,(o,s)=>{if(o)return n(o);if(i.dereference&&(s=Pc.resolve(process.cwd(),s)),r)Pr.readlink(t,(a,l)=>a?a.code==="EINVAL"||a.code==="UNKNOWN"?Pr.symlink(s,t,n):n(a):(i.dereference&&(l=Pc.resolve(process.cwd(),l)),Tc.isSrcSubdir(s,l)?n(new Error(`Cannot copy '${s}' to a subdirectory of itself, '${l}'.`)):r.isDirectory()&&Tc.isSrcSubdir(l,s)?n(new Error(`Cannot overwrite '${l}' with '${s}'.`)):$te(s,t,n)));else return Pr.symlink(s,t,n)})}function $te(r,e,t){Pr.unlink(e,i=>i?t(i):Pr.symlink(r,e,t))}yF.exports=Tte});var zb=g((lCe,PF)=>{"use strict";var Bte=Ur().fromCallback;PF.exports={copy:Bte(_F())}});var MF=g((uCe,TF)=>{"use strict";var RF=Ce(),kF=require("path"),Ve=require("assert"),Rc=process.platform==="win32";function IF(r){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(t=>{r[t]=r[t]||RF[t],t=t+"Sync",r[t]=r[t]||RF[t]}),r.maxBusyTries=r.maxBusyTries||3}function Gb(r,e,t){let i=0;typeof e=="function"&&(t=e,e={}),Ve(r,"rimraf: missing path"),Ve.strictEqual(typeof r,"string","rimraf: path should be a string"),Ve.strictEqual(typeof t,"function","rimraf: callback function required"),Ve(e,"rimraf: invalid options argument provided"),Ve.strictEqual(typeof e,"object","rimraf: options should be object"),IF(e),FF(r,e,function n(o){if(o){if((o.code==="EBUSY"||o.code==="ENOTEMPTY"||o.code==="EPERM")&&i<e.maxBusyTries){i++;let s=i*100;return setTimeout(()=>FF(r,e,n),s)}o.code==="ENOENT"&&(o=null)}t(o)})}function FF(r,e,t){Ve(r),Ve(e),Ve(typeof t=="function"),e.lstat(r,(i,n)=>{if(i&&i.code==="ENOENT")return t(null);if(i&&i.code==="EPERM"&&Rc)return AF(r,e,i,t);if(n&&n.isDirectory())return oh(r,e,i,t);e.unlink(r,o=>{if(o){if(o.code==="ENOENT")return t(null);if(o.code==="EPERM")return Rc?AF(r,e,o,t):oh(r,e,o,t);if(o.code==="EISDIR")return oh(r,e,o,t)}return t(o)})})}function AF(r,e,t,i){Ve(r),Ve(e),Ve(typeof i=="function"),e.chmod(r,438,n=>{n?i(n.code==="ENOENT"?null:t):e.stat(r,(o,s)=>{o?i(o.code==="ENOENT"?null:t):s.isDirectory()?oh(r,e,t,i):e.unlink(r,i)})})}function OF(r,e,t){let i;Ve(r),Ve(e);try{e.chmodSync(r,438)}catch(n){if(n.code==="ENOENT")return;throw t}try{i=e.statSync(r)}catch(n){if(n.code==="ENOENT")return;throw t}i.isDirectory()?sh(r,e,t):e.unlinkSync(r)}function oh(r,e,t,i){Ve(r),Ve(e),Ve(typeof i=="function"),e.rmdir(r,n=>{n&&(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")?jte(r,e,i):n&&n.code==="ENOTDIR"?i(t):i(n)})}function jte(r,e,t){Ve(r),Ve(e),Ve(typeof t=="function"),e.readdir(r,(i,n)=>{if(i)return t(i);let o=n.length,s;if(o===0)return e.rmdir(r,t);n.forEach(a=>{Gb(kF.join(r,a),e,l=>{if(!s){if(l)return t(s=l);--o==0&&e.rmdir(r,t)}})})})}function LF(r,e){let t;e=e||{},IF(e),Ve(r,"rimraf: missing path"),Ve.strictEqual(typeof r,"string","rimraf: path should be a string"),Ve(e,"rimraf: missing options"),Ve.strictEqual(typeof e,"object","rimraf: options should be object");try{t=e.lstatSync(r)}catch(i){if(i.code==="ENOENT")return;i.code==="EPERM"&&Rc&&OF(r,e,i)}try{t&&t.isDirectory()?sh(r,e,null):e.unlinkSync(r)}catch(i){if(i.code==="ENOENT")return;if(i.code==="EPERM")return Rc?OF(r,e,i):sh(r,e,i);if(i.code!=="EISDIR")throw i;sh(r,e,i)}}function sh(r,e,t){Ve(r),Ve(e);try{e.rmdirSync(r)}catch(i){if(i.code==="ENOTDIR")throw t;if(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")Ute(r,e);else if(i.code!=="ENOENT")throw i}}function Ute(r,e){if(Ve(r),Ve(e),e.readdirSync(r).forEach(t=>LF(kF.join(r,t),e)),Rc){let t=Date.now();do try{return e.rmdirSync(r,e)}catch{}while(Date.now()-t<500)}else return e.rmdirSync(r,e)}TF.exports=Gb;Gb.sync=LF});var kc=g((cCe,NF)=>{"use strict";var Wte=Ur().fromCallback,qF=MF();NF.exports={remove:Wte(qF),removeSync:qF.sync}});var GF=g((fCe,$F)=>{"use strict";var Hte=Ur().fromCallback,BF=Ce(),jF=require("path"),UF=qi(),WF=kc(),HF=Hte(function(e,t){t=t||function(){},BF.readdir(e,(i,n)=>{if(i)return UF.mkdirs(e,t);n=n.map(s=>jF.join(e,s)),o();function o(){let s=n.pop();if(!s)return t();WF.remove(s,a=>{if(a)return t(a);o()})}})});function zF(r){let e;try{e=BF.readdirSync(r)}catch{return UF.mkdirsSync(r)}e.forEach(t=>{t=jF.join(r,t),WF.removeSync(t)})}$F.exports={emptyDirSync:zF,emptydirSync:zF,emptyDir:HF,emptydir:HF}});var YF=g((pCe,VF)=>{"use strict";var zte=Ur().fromCallback,KF=require("path"),So=Ce(),JF=qi();function Gte(r,e){function t(){So.writeFile(r,"",i=>{if(i)return e(i);e()})}So.stat(r,(i,n)=>{if(!i&&n.isFile())return e();let o=KF.dirname(r);So.stat(o,(s,a)=>{if(s)return s.code==="ENOENT"?JF.mkdirs(o,l=>{if(l)return e(l);t()}):e(s);a.isDirectory()?t():So.readdir(o,l=>{if(l)return e(l)})})})}function Vte(r){let e;try{e=So.statSync(r)}catch{}if(e&&e.isFile())return;let t=KF.dirname(r);try{So.statSync(t).isDirectory()||So.readdirSync(t)}catch(i){if(i&&i.code==="ENOENT")JF.mkdirsSync(t);else throw i}So.writeFileSync(r,"")}VF.exports={createFile:zte(Gte),createFileSync:Vte}});var tA=g((dCe,XF)=>{"use strict";var Kte=Ur().fromCallback,ZF=require("path"),As=Ce(),QF=qi(),eA=Do().pathExists;function Jte(r,e,t){function i(n,o){As.link(n,o,s=>{if(s)return t(s);t(null)})}eA(e,(n,o)=>{if(n)return t(n);if(o)return t(null);As.lstat(r,s=>{if(s)return s.message=s.message.replace("lstat","ensureLink"),t(s);let a=ZF.dirname(e);eA(a,(l,u)=>{if(l)return t(l);if(u)return i(r,e);QF.mkdirs(a,c=>{if(c)return t(c);i(r,e)})})})})}function Yte(r,e){if(As.existsSync(e))return;try{As.lstatSync(r)}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}let i=ZF.dirname(e);return As.existsSync(i)||QF.mkdirsSync(i),As.linkSync(r,e)}XF.exports={createLink:Kte(Jte),createLinkSync:Yte}});var iA=g((hCe,rA)=>{"use strict";var Eo=require("path"),Ic=Ce(),Xte=Do().pathExists;function Zte(r,e,t){if(Eo.isAbsolute(r))return Ic.lstat(r,i=>i?(i.message=i.message.replace("lstat","ensureSymlink"),t(i)):t(null,{toCwd:r,toDst:r}));{let i=Eo.dirname(e),n=Eo.join(i,r);return Xte(n,(o,s)=>o?t(o):s?t(null,{toCwd:n,toDst:r}):Ic.lstat(r,a=>a?(a.message=a.message.replace("lstat","ensureSymlink"),t(a)):t(null,{toCwd:r,toDst:Eo.relative(i,r)})))}}function Qte(r,e){let t;if(Eo.isAbsolute(r)){if(t=Ic.existsSync(r),!t)throw new Error("absolute srcpath does not exist");return{toCwd:r,toDst:r}}else{let i=Eo.dirname(e),n=Eo.join(i,r);if(t=Ic.existsSync(n),t)return{toCwd:n,toDst:r};if(t=Ic.existsSync(r),!t)throw new Error("relative srcpath does not exist");return{toCwd:r,toDst:Eo.relative(i,r)}}}rA.exports={symlinkPaths:Zte,symlinkPathsSync:Qte}});var sA=g((mCe,nA)=>{"use strict";var oA=Ce();function ere(r,e,t){if(t=typeof e=="function"?e:t,e=typeof e=="function"?!1:e,e)return t(null,e);oA.lstat(r,(i,n)=>{if(i)return t(null,"file");e=n&&n.isDirectory()?"dir":"file",t(null,e)})}function tre(r,e){let t;if(e)return e;try{t=oA.lstatSync(r)}catch{return"file"}return t&&t.isDirectory()?"dir":"file"}nA.exports={symlinkType:ere,symlinkTypeSync:tre}});var dA=g((gCe,aA)=>{"use strict";var rre=Ur().fromCallback,lA=require("path"),Ka=Ce(),uA=qi(),ire=uA.mkdirs,nre=uA.mkdirsSync,cA=iA(),ore=cA.symlinkPaths,sre=cA.symlinkPathsSync,fA=sA(),are=fA.symlinkType,lre=fA.symlinkTypeSync,pA=Do().pathExists;function ure(r,e,t,i){i=typeof t=="function"?t:i,t=typeof t=="function"?!1:t,pA(e,(n,o)=>{if(n)return i(n);if(o)return i(null);ore(r,e,(s,a)=>{if(s)return i(s);r=a.toDst,are(a.toCwd,t,(l,u)=>{if(l)return i(l);let c=lA.dirname(e);pA(c,(f,p)=>{if(f)return i(f);if(p)return Ka.symlink(r,e,u,i);ire(c,d=>{if(d)return i(d);Ka.symlink(r,e,u,i)})})})})})}function cre(r,e,t){if(Ka.existsSync(e))return;let n=sre(r,e);r=n.toDst,t=lre(n.toCwd,t);let o=lA.dirname(e);return Ka.existsSync(o)||nre(o),Ka.symlinkSync(r,e,t)}aA.exports={createSymlink:rre(ure),createSymlinkSync:cre}});var mA=g((vCe,hA)=>{"use strict";var ah=YF(),lh=tA(),uh=dA();hA.exports={createFile:ah.createFile,createFileSync:ah.createFileSync,ensureFile:ah.createFile,ensureFileSync:ah.createFileSync,createLink:lh.createLink,createLinkSync:lh.createLinkSync,ensureLink:lh.createLink,ensureLinkSync:lh.createLinkSync,createSymlink:uh.createSymlink,createSymlinkSync:uh.createSymlinkSync,ensureSymlink:uh.createSymlink,ensureSymlinkSync:uh.createSymlinkSync}});var gA=g(Vb=>{"use strict";Vb.fromCallback=function(r){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")r.apply(this,e);else return new Promise((t,i)=>{r.call(this,...e,(n,o)=>n!=null?i(n):t(o))})},"name",{value:r.name})};Vb.fromPromise=function(r){return Object.defineProperty(function(...e){let t=e[e.length-1];if(typeof t!="function")return r.apply(this,e);r.apply(this,e.slice(0,-1)).then(i=>t(null,i),t)},"name",{value:r.name})}});var ch=g((bCe,vA)=>{function fre(r,{EOL:e=`
|
||
`,finalEOL:t=!0,replacer:i=null,spaces:n}={}){let o=t?e:"";return JSON.stringify(r,i,n).replace(/\n/g,e)+o}function pre(r){return Buffer.isBuffer(r)&&(r=r.toString("utf8")),r.replace(/^\uFEFF/,"")}vA.exports={stringify:fre,stripBom:pre}});var xA=g((wCe,yA)=>{var Ja;try{Ja=Ce()}catch(r){Ja=require("fs")}var fh=gA(),{stringify:bA,stripBom:wA}=ch();async function dre(r,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||Ja,i="throws"in e?e.throws:!0,n=await fh.fromCallback(t.readFile)(r,e);n=wA(n);let o;try{o=JSON.parse(n,e?e.reviver:null)}catch(s){if(i)throw s.message=`${r}: ${s.message}`,s;return null}return o}var hre=fh.fromPromise(dre);function mre(r,e={}){typeof e=="string"&&(e={encoding:e});let t=e.fs||Ja,i="throws"in e?e.throws:!0;try{let n=t.readFileSync(r,e);return n=wA(n),JSON.parse(n,e.reviver)}catch(n){if(i)throw n.message=`${r}: ${n.message}`,n;return null}}async function gre(r,e,t={}){let i=t.fs||Ja,n=bA(e,t);await fh.fromCallback(i.writeFile)(r,n,t)}var vre=fh.fromPromise(gre);function yre(r,e,t={}){let i=t.fs||Ja,n=bA(e,t);return i.writeFileSync(r,n,t)}var bre={readFile:hre,readFileSync:mre,writeFile:vre,writeFileSync:yre};yA.exports=bre});var SA=g((xCe,DA)=>{"use strict";var ph=xA();DA.exports={readJson:ph.readFile,readJsonSync:ph.readFileSync,writeJson:ph.writeFile,writeJsonSync:ph.writeFileSync}});var dh=g((DCe,EA)=>{"use strict";var wre=Ur().fromCallback,Fc=Ce(),CA=require("path"),_A=qi(),xre=Do().pathExists;function Dre(r,e,t,i){typeof t=="function"&&(i=t,t="utf8");let n=CA.dirname(r);xre(n,(o,s)=>{if(o)return i(o);if(s)return Fc.writeFile(r,e,t,i);_A.mkdirs(n,a=>{if(a)return i(a);Fc.writeFile(r,e,t,i)})})}function Sre(r,...e){let t=CA.dirname(r);if(Fc.existsSync(t))return Fc.writeFileSync(r,...e);_A.mkdirsSync(t),Fc.writeFileSync(r,...e)}EA.exports={outputFile:wre(Dre),outputFileSync:Sre}});var TA=g((SCe,PA)=>{"use strict";var{stringify:Ere}=ch(),{outputFile:Cre}=dh();async function _re(r,e,t={}){let i=Ere(e,t);await Cre(r,i,t)}PA.exports=_re});var kA=g((ECe,RA)=>{"use strict";var{stringify:Pre}=ch(),{outputFileSync:Tre}=dh();function Rre(r,e,t){let i=Pre(e,t);Tre(r,i,t)}RA.exports=Rre});var FA=g((CCe,IA)=>{"use strict";var kre=Ur().fromPromise,vr=SA();vr.outputJson=kre(TA());vr.outputJsonSync=kA();vr.outputJSON=vr.outputJson;vr.outputJSONSync=vr.outputJsonSync;vr.writeJSON=vr.writeJson;vr.writeJSONSync=vr.writeJsonSync;vr.readJSON=vr.readJson;vr.readJSONSync=vr.readJsonSync;IA.exports=vr});var qA=g((_Ce,AA)=>{"use strict";var OA=Ce(),Ire=require("path"),Fre=Wb().copySync,LA=kc().removeSync,Are=qi().mkdirpSync,MA=Ec();function Lre(r,e,t){t=t||{};let i=t.overwrite||t.clobber||!1,{srcStat:n}=MA.checkPathsSync(r,e,"move");return MA.checkParentPathsSync(r,n,e,"move"),Are(Ire.dirname(e)),Ore(r,e,i)}function Ore(r,e,t){if(t)return LA(e),NA(r,e,t);if(OA.existsSync(e))throw new Error("dest already exists.");return NA(r,e,t)}function NA(r,e,t){try{OA.renameSync(r,e)}catch(i){if(i.code!=="EXDEV")throw i;return Mre(r,e,t)}}function Mre(r,e,t){return Fre(r,e,{overwrite:t,errorOnExist:!0}),LA(r)}AA.exports=Lre});var BA=g((PCe,$A)=>{"use strict";$A.exports={moveSync:qA()}});var zA=g((TCe,jA)=>{"use strict";var Nre=Ce(),qre=require("path"),$re=zb().copy,UA=kc().remove,Bre=qi().mkdirp,jre=Do().pathExists,WA=Ec();function Wre(r,e,t,i){typeof t=="function"&&(i=t,t={});let n=t.overwrite||t.clobber||!1;WA.checkPaths(r,e,"move",(o,s)=>{if(o)return i(o);let{srcStat:a}=s;WA.checkParentPaths(r,a,e,"move",l=>{if(l)return i(l);Bre(qre.dirname(e),u=>u?i(u):Ure(r,e,n,i))})})}function Ure(r,e,t,i){if(t)return UA(e,n=>n?i(n):HA(r,e,t,i));jre(e,(n,o)=>n?i(n):o?i(new Error("dest already exists.")):HA(r,e,t,i))}function HA(r,e,t,i){Nre.rename(r,e,n=>n?n.code!=="EXDEV"?i(n):Hre(r,e,t,i):i())}function Hre(r,e,t,i){$re(r,e,{overwrite:t,errorOnExist:!0},o=>o?i(o):UA(r,i))}jA.exports=Wre});var VA=g((RCe,GA)=>{"use strict";var zre=Ur().fromCallback;GA.exports={move:zre(zA())}});var $i=g((kCe,Kb)=>{"use strict";Kb.exports={...Sc(),...Wb(),...zb(),...GF(),...mA(),...FA(),...qi(),...BA(),...VA(),...dh(),...Do(),...kc()};var KA=require("fs");Object.getOwnPropertyDescriptor(KA,"promises")&&Object.defineProperty(Kb.exports,"promises",{get(){return KA.promises}})});var j=g((ICe,JA)=>{var Os=S(require("fs")),Jb=S(Ab()),hh=S(require("path")),YA=S(require("os")),XA=S($i());function Gre(){let r=process.env.NVIM_COC_LOG_FILE;if(r)return r;let e=process.env.XDG_RUNTIME_DIR;if(e)try{return Os.default.accessSync(e,Os.default.constants.R_OK|Os.default.constants.W_OK),hh.default.join(e,`coc-nvim-${process.pid}.log`)}catch(i){}let t=YA.default.tmpdir();return e=hh.default.join(t,`coc.nvim-${process.pid}`),Os.default.existsSync(e)||XA.mkdirpSync(e),hh.default.join(e,"coc-nvim.log")}var Vre=1024*1024,Kre=10,mh=Gre(),Jre=process.env.NVIM_COC_LOG_LEVEL||"info";if(Os.default.existsSync(mh))try{Os.default.writeFileSync(mh,"",{encoding:"utf8",mode:438})}catch(r){}Jb.default.configure({disableClustering:!0,appenders:{out:{type:"file",mode:438,filename:mh,maxLogSize:Vre,backups:Kre,layout:{type:"pattern",pattern:`%d{ISO8601} %p (pid:${process.pid}) [%c] - %m`}}},categories:{default:{appenders:["out"],level:Jre}}});JA.exports=(r="coc-nvim")=>{let e=Jb.default.getLogger(r);return e.getLogFile=()=>mh,e}});var gh=g(()=>{Promise.prototype.logError=function(){this.catch(r=>{j()("extensions").error(r)})}});var QA=g((Yb,ZA)=>{ZA.exports=Xb(typeof Buffer!="undefined"&&Buffer)||Xb(Yb.Buffer)||Xb(typeof window!="undefined"&&window.Buffer)||Yb.Buffer;function Xb(r){return r&&r.isBuffer&&r}});var vh=g((OCe,eO)=>{var Yre={}.toString;eO.exports=Array.isArray||function(r){return Yre.call(r)=="[object Array]"}});var iO=g((Ya,tO)=>{var Xa=Wr(),Ya=tO.exports=rO(0);Ya.alloc=rO;Ya.concat=Xa.concat;Ya.from=Xre;function rO(r){return new Array(r)}function Xre(r){if(!Xa.isBuffer(r)&&Xa.isView(r))r=Xa.Uint8Array.from(r);else if(Xa.isArrayBuffer(r))r=new Uint8Array(r);else{if(typeof r=="string")return Xa.from.call(Ya,r);if(typeof r=="number")throw new TypeError('"value" argument must not be a number')}return Array.prototype.slice.call(r)}});var sO=g((Za,nO)=>{var Mn=Wr(),Qa=Mn.global,Za=nO.exports=Mn.hasBuffer?oO(0):[];Za.alloc=Mn.hasBuffer&&Qa.alloc||oO;Za.concat=Mn.concat;Za.from=Zre;function oO(r){return new Qa(r)}function Zre(r){if(!Mn.isBuffer(r)&&Mn.isView(r))r=Mn.Uint8Array.from(r);else if(Mn.isArrayBuffer(r))r=new Uint8Array(r);else{if(typeof r=="string")return Mn.from.call(Za,r);if(typeof r=="number")throw new TypeError('"value" argument must not be a number')}return Qa.from&&Qa.from.length!==1?Qa.from(r):new Qa(r)}});var uO=g((el,aO)=>{var yh=Wr(),el=aO.exports=yh.hasArrayBuffer?lO(0):[];el.alloc=lO;el.concat=yh.concat;el.from=Qre;function lO(r){return new Uint8Array(r)}function Qre(r){if(yh.isView(r)){var e=r.byteOffset,t=r.byteLength;r=r.buffer,r.byteLength!==t&&(r.slice?r=r.slice(e,e+t):(r=new Uint8Array(r),r.byteLength!==t&&(r=Array.prototype.slice.call(r,e,e+t))))}else{if(typeof r=="string")return yh.from.call(el,r);if(typeof r=="number")throw new TypeError('"value" argument must not be a number')}return new Uint8Array(r)}});var cO=g(bh=>{bh.copy=eie;bh.toString=tie;bh.write=rie;function rie(r,e){for(var t=this,i=e||(e|=0),n=r.length,o=0,s=0;s<n;)o=r.charCodeAt(s++),o<128?t[i++]=o:o<2048?(t[i++]=192|o>>>6,t[i++]=128|o&63):o<55296||o>57343?(t[i++]=224|o>>>12,t[i++]=128|o>>>6&63,t[i++]=128|o&63):(o=(o-55296<<10|r.charCodeAt(s++)-56320)+65536,t[i++]=240|o>>>18,t[i++]=128|o>>>12&63,t[i++]=128|o>>>6&63,t[i++]=128|o&63);return i-e}function tie(r,e,t){var i=this,n=e|0;t||(t=i.length);for(var o="",s=0;n<t;){if(s=i[n++],s<128){o+=String.fromCharCode(s);continue}(s&224)==192?s=(s&31)<<6|i[n++]&63:(s&240)==224?s=(s&15)<<12|(i[n++]&63)<<6|i[n++]&63:(s&248)==240&&(s=(s&7)<<18|(i[n++]&63)<<12|(i[n++]&63)<<6|i[n++]&63),s>=65536?(s-=65536,o+=String.fromCharCode((s>>>10)+55296,(s&1023)+56320)):o+=String.fromCharCode(s)}return o}function eie(r,e,t,i){var n;t||(t=0),!i&&i!==0&&(i=this.length),e||(e=0);var o=i-t;if(r===this&&t<e&&e<i)for(n=o-1;n>=0;n--)r[n+e]=this[n+t];else for(n=0;n<o;n++)r[n+e]=this[n+t];return o}});var wh=g(Ac=>{var Zb=cO();Ac.copy=fO;Ac.slice=pO;Ac.toString=iie;Ac.write=nie("write");var Co=Wr(),dO=Co.global,hO=Co.hasBuffer&&"TYPED_ARRAY_SUPPORT"in dO,mO=hO&&!dO.TYPED_ARRAY_SUPPORT;function fO(r,e,t,i){var n=Co.isBuffer(this),o=Co.isBuffer(r);if(n&&o)return this.copy(r,e,t,i);if(!mO&&!n&&!o&&Co.isView(this)&&Co.isView(r)){var s=t||i!=null?pO.call(this,t,i):this;return r.set(s,e),s.length}else return Zb.copy.call(this,r,e,t,i)}function pO(r,e){var t=this.slice||!mO&&this.subarray;if(t)return t.call(this,r,e);var i=Co.alloc.call(this,e-r);return fO.call(this,i,0,r,e),i}function iie(r,e,t){var i=!hO&&Co.isBuffer(this)?this.toString:Zb.toString;return i.apply(this,arguments)}function nie(r){return e;function e(){var t=this[r]||Zb[r];return t.apply(this,arguments)}}});var Wr=g(rr=>{var Qb=rr.global=QA(),gO=rr.hasBuffer=Qb&&!!Qb.isBuffer,ew=rr.hasArrayBuffer=typeof ArrayBuffer!="undefined",oie=rr.isArray=vh();rr.isArrayBuffer=ew?sie:tw;var aie=rr.isBuffer=gO?Qb.isBuffer:tw,lie=rr.isView=ew?ArrayBuffer.isView||vO("ArrayBuffer","buffer"):tw;rr.alloc=rw;rr.concat=uie;rr.from=cie;var yO=rr.Array=iO(),bO=rr.Buffer=sO(),wO=rr.Uint8Array=uO(),iw=rr.prototype=wh();function cie(r){return typeof r=="string"?fie.call(this,r):xO(this).from(r)}function rw(r){return xO(this).alloc(r)}function uie(r,e){e||(e=0,Array.prototype.forEach.call(r,o));var t=this!==rr&&this||r[0],i=rw.call(t,e),n=0;return Array.prototype.forEach.call(r,s),i;function o(a){e+=a.length}function s(a){n+=iw.copy.call(a,i,n)}}var pie=vO("ArrayBuffer");function sie(r){return r instanceof ArrayBuffer||pie(r)}function fie(r){var e=r.length*3,t=rw.call(this,e),i=iw.write.call(t,r);return e!==i&&(t=iw.slice.call(t,0,i)),t}function xO(r){return aie(r)?bO:lie(r)?wO:oie(r)?yO:gO?bO:ew?wO:yO}function tw(){return!1}function vO(r,e){return r="[object "+r+"]",function(t){return t!=null&&{}.toString.call(e?t[e]:t)===r}}});var xh=g(DO=>{DO.ExtBuffer=nw;var die=Wr();function nw(r,e){if(!(this instanceof nw))return new nw(r,e);this.buffer=die.from(r),this.type=e}});var EO=g(SO=>{SO.setExtPackers=hie;var Dh=Wr(),mie=Dh.global,Bi=Dh.Uint8Array.from,ow,gie={name:1,message:1,stack:1,columnNumber:1,fileName:1,lineNumber:1};function hie(r){r.addExtPacker(14,Error,[Ls,mi]),r.addExtPacker(1,EvalError,[Ls,mi]),r.addExtPacker(2,RangeError,[Ls,mi]),r.addExtPacker(3,ReferenceError,[Ls,mi]),r.addExtPacker(4,SyntaxError,[Ls,mi]),r.addExtPacker(5,TypeError,[Ls,mi]),r.addExtPacker(6,URIError,[Ls,mi]),r.addExtPacker(10,RegExp,[vie,mi]),r.addExtPacker(11,Boolean,[sw,mi]),r.addExtPacker(12,String,[sw,mi]),r.addExtPacker(13,Date,[Number,mi]),r.addExtPacker(15,Number,[sw,mi]),typeof Uint8Array!="undefined"&&(r.addExtPacker(17,Int8Array,Bi),r.addExtPacker(18,Uint8Array,Bi),r.addExtPacker(19,Int16Array,Bi),r.addExtPacker(20,Uint16Array,Bi),r.addExtPacker(21,Int32Array,Bi),r.addExtPacker(22,Uint32Array,Bi),r.addExtPacker(23,Float32Array,Bi),typeof Float64Array!="undefined"&&r.addExtPacker(24,Float64Array,Bi),typeof Uint8ClampedArray!="undefined"&&r.addExtPacker(25,Uint8ClampedArray,Bi),r.addExtPacker(26,ArrayBuffer,Bi),r.addExtPacker(29,DataView,Bi)),Dh.hasBuffer&&r.addExtPacker(27,mie,Dh.from)}function mi(r){return ow||(ow=aw().encode),ow(r)}function sw(r){return r.valueOf()}function vie(r){r=RegExp.prototype.toString.call(r).split("/"),r.shift();var e=[r.pop()];return e.unshift(r.join("/")),e}function Ls(r){var e={};for(var t in gie)e[t]=r[t];return e}});var Sh=g(Oc=>{var yie,bie,wie,xie;(function(r){var e="undefined",t=e!==typeof Buffer&&Buffer,i=e!==typeof Uint8Array&&Uint8Array,n=e!==typeof ArrayBuffer&&ArrayBuffer,o=[0,0,0,0,0,0,0,0],s=Array.isArray||P,a=4294967296,l=16777216,u;yie=c("Uint64BE",!0,!0),bie=c("Int64BE",!0,!1),wie=c("Uint64LE",!1,!0),xie=c("Int64LE",!1,!1);function c(k,_,O){var I=_?0:4,L=_?4:0,R=_?0:3,F=_?1:2,q=_?2:1,K=_?3:0,ae=_?v:w,Pe=_?x:E,We=dr.prototype,Yt="is"+k,Nt="_"+Yt;return We.buffer=void 0,We.offset=0,We[Nt]=!0,We.toNumber=Dd,We.toString=_y,We.toJSON=Dd,We.toArray=f,t&&(We.toBuffer=p),i&&(We.toArrayBuffer=d),dr[Yt]=kn,r[k]=dr,dr;function dr(Se,ve,fe,Ee){return this instanceof dr?In(this,Se,ve,fe,Ee):new dr(Se,ve,fe,Ee)}function kn(Se){return!!(Se&&Se[Nt])}function In(Se,ve,fe,Ee,Ct){if(i&&n&&(ve instanceof n&&(ve=new i(ve)),Ee instanceof n&&(Ee=new i(Ee))),!ve&&!fe&&!Ee&&!u){Se.buffer=y(o,0);return}if(!h(ve,fe)){var Oi=u||Array;Ct=fe,Ee=ve,fe=0,ve=new Oi(8)}Se.buffer=ve,Se.offset=fe|=0,e!==typeof Ee&&(typeof Ee=="string"?Cy(ve,fe,Ee,Ct||10):h(Ee,Ct)?m(ve,fe,Ee,Ct):typeof Ct=="number"?(Fa(ve,fe+I,Ee),Fa(ve,fe+L,Ct)):Ee>0?ae(ve,fe,Ee):Ee<0?Pe(ve,fe,Ee):m(ve,fe,o,0))}function Cy(Se,ve,fe,Ee){var Ct=0,Oi=fe.length,Xt=0,qt=0;fe[0]==="-"&&Ct++;for(var Py=Ct;Ct<Oi;){var Sd=parseInt(fe[Ct++],Ee);if(!(Sd>=0))break;qt=qt*Ee+Sd,Xt=Xt*Ee+Math.floor(qt/a),qt%=a}Py&&(Xt=~Xt,qt?qt=a-qt:Xt++),Fa(Se,ve+I,Xt),Fa(Se,ve+L,qt)}function Dd(){var Se=this.buffer,ve=this.offset,fe=Aa(Se,ve+I),Ee=Aa(Se,ve+L);return O||(fe|=0),fe?fe*a+Ee:Ee}function _y(Se){var ve=this.buffer,fe=this.offset,Ee=Aa(ve,fe+I),Ct=Aa(ve,fe+L),Oi="",Xt=!O&&Ee&2147483648;for(Xt&&(Ee=~Ee,Ct=a-Ct),Se=Se||10;;){var qt=Ee%Se*a+Ct;if(Ee=Math.floor(Ee/Se),Ct=Math.floor(qt/Se),Oi=(qt%Se).toString(Se)+Oi,!Ee&&!Ct)break}return Xt&&(Oi="-"+Oi),Oi}function Fa(Se,ve,fe){Se[ve+K]=fe&255,fe=fe>>8,Se[ve+q]=fe&255,fe=fe>>8,Se[ve+F]=fe&255,fe=fe>>8,Se[ve+R]=fe&255}function Aa(Se,ve){return Se[ve+R]*l+(Se[ve+F]<<16)+(Se[ve+q]<<8)+Se[ve+K]}}function f(k){var _=this.buffer,O=this.offset;return u=null,k!==!1&&O===0&&_.length===8&&s(_)?_:y(_,O)}function p(k){var _=this.buffer,O=this.offset;if(u=t,k!==!1&&O===0&&_.length===8&&Buffer.isBuffer(_))return _;var I=new t(8);return m(I,0,_,O),I}function d(k){var _=this.buffer,O=this.offset,I=_.buffer;if(u=i,k!==!1&&O===0&&I instanceof n&&I.byteLength===8)return I;var L=new i(8);return m(L,0,_,O),L.buffer}function h(k,_){var O=k&&k.length;return _|=0,O&&_+8<=O&&typeof k[_]!="string"}function m(k,_,O,I){_|=0,I|=0;for(var L=0;L<8;L++)k[_++]=O[I++]&255}function y(k,_){return Array.prototype.slice.call(k,_,_+8)}function v(k,_,O){for(var I=_+8;I>_;)k[--I]=O&255,O/=256}function x(k,_,O){var I=_+8;for(O++;I>_;)k[--I]=-O&255^255,O/=256}function w(k,_,O){for(var I=_+8;_<I;)k[_++]=O&255,O/=256}function E(k,_,O){var I=_+8;for(O++;_<I;)k[_++]=-O&255^255,O/=256}function P(k){return!!k&&Object.prototype.toString.call(k)=="[object Array]"}})(typeof Oc=="object"&&typeof Oc.nodeName!="string"?Oc:Oc||{})});var uw=g(lw=>{lw.read=function(r,e,t,i,n){var o,s,a=n*8-i-1,l=(1<<a)-1,u=l>>1,c=-7,f=t?n-1:0,p=t?-1:1,d=r[e+f];for(f+=p,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=o*256+r[e+f],f+=p,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=i;c>0;s=s*256+r[e+f],f+=p,c-=8);if(o===0)o=1-u;else{if(o===l)return s?NaN:(d?-1:1)*Infinity;s=s+Math.pow(2,i),o=o-u}return(d?-1:1)*s*Math.pow(2,o-i)};lw.write=function(r,e,t,i,n,o){var s,a,l,u=o*8-n-1,c=(1<<u)-1,f=c>>1,p=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,h=i?1:-1,m=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===Infinity?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+f>=1?e+=p/l:e+=p*Math.pow(2,1-f),e*l>=2&&(s++,l/=2),s+f>=c?(a=0,s=c):s+f>=1?(a=(e*l-1)*Math.pow(2,n),s=s+f):(a=e*Math.pow(2,f-1)*Math.pow(2,n),s=0));n>=8;r[t+d]=a&255,d+=h,a/=256,n-=8);for(s=s<<n|a,u+=n;u>0;r[t+d]=s&255,d+=h,s/=256,u-=8);r[t+d-h]|=m*128}});var cw=g(CO=>{var Die=CO.uint8=new Array(256);for(var Eh=0;Eh<=255;Eh++)Die[Eh]=Sie(Eh);function Sie(r){return function(e){var t=e.reserve(1);e.buffer[t]=r}}});var MO=g(_O=>{var PO=uw(),TO=Sh(),Eie=TO.Uint64BE,Cie=TO.Int64BE,RO=cw().uint8,Ch=Wr(),nt=Ch.global,_ie=Ch.hasBuffer&&"TYPED_ARRAY_SUPPORT"in nt,Pie=_ie&&!nt.TYPED_ARRAY_SUPPORT,kO=Ch.hasBuffer&&nt.prototype||{};_O.getWriteToken=Tie;function Tie(r){return r&&r.uint8array?Rie():Pie||Ch.hasBuffer&&r&&r.safe?kie():IO()}function Rie(){var r=IO();return r[202]=Be(202,4,FO),r[203]=Be(203,8,AO),r}function IO(){var r=RO.slice();return r[196]=Lc(196),r[197]=Ms(197),r[198]=Ns(198),r[199]=Lc(199),r[200]=Ms(200),r[201]=Ns(201),r[202]=Be(202,4,kO.writeFloatBE||FO,!0),r[203]=Be(203,8,kO.writeDoubleBE||AO,!0),r[204]=Lc(204),r[205]=Ms(205),r[206]=Ns(206),r[207]=Be(207,8,OO),r[208]=Lc(208),r[209]=Ms(209),r[210]=Ns(210),r[211]=Be(211,8,LO),r[217]=Lc(217),r[218]=Ms(218),r[219]=Ns(219),r[220]=Ms(220),r[221]=Ns(221),r[222]=Ms(222),r[223]=Ns(223),r}function kie(){var r=RO.slice();return r[196]=Be(196,1,nt.prototype.writeUInt8),r[197]=Be(197,2,nt.prototype.writeUInt16BE),r[198]=Be(198,4,nt.prototype.writeUInt32BE),r[199]=Be(199,1,nt.prototype.writeUInt8),r[200]=Be(200,2,nt.prototype.writeUInt16BE),r[201]=Be(201,4,nt.prototype.writeUInt32BE),r[202]=Be(202,4,nt.prototype.writeFloatBE),r[203]=Be(203,8,nt.prototype.writeDoubleBE),r[204]=Be(204,1,nt.prototype.writeUInt8),r[205]=Be(205,2,nt.prototype.writeUInt16BE),r[206]=Be(206,4,nt.prototype.writeUInt32BE),r[207]=Be(207,8,OO),r[208]=Be(208,1,nt.prototype.writeInt8),r[209]=Be(209,2,nt.prototype.writeInt16BE),r[210]=Be(210,4,nt.prototype.writeInt32BE),r[211]=Be(211,8,LO),r[217]=Be(217,1,nt.prototype.writeUInt8),r[218]=Be(218,2,nt.prototype.writeUInt16BE),r[219]=Be(219,4,nt.prototype.writeUInt32BE),r[220]=Be(220,2,nt.prototype.writeUInt16BE),r[221]=Be(221,4,nt.prototype.writeUInt32BE),r[222]=Be(222,2,nt.prototype.writeUInt16BE),r[223]=Be(223,4,nt.prototype.writeUInt32BE),r}function Lc(r){return function(e,t){var i=e.reserve(2),n=e.buffer;n[i++]=r,n[i]=t}}function Ms(r){return function(e,t){var i=e.reserve(3),n=e.buffer;n[i++]=r,n[i++]=t>>>8,n[i]=t}}function Ns(r){return function(e,t){var i=e.reserve(5),n=e.buffer;n[i++]=r,n[i++]=t>>>24,n[i++]=t>>>16,n[i++]=t>>>8,n[i]=t}}function Be(r,e,t,i){return function(n,o){var s=n.reserve(e+1);n.buffer[s++]=r,t.call(n.buffer,o,s,i)}}function OO(r,e){new Eie(this,e,r)}function LO(r,e){new Cie(this,e,r)}function FO(r,e){PO.write(this,r,e,!1,23,4)}function AO(r,e){PO.write(this,r,e,!1,52,8)}});var jO=g(NO=>{var Iie=vh(),qO=Sh(),Fie=qO.Uint64BE,Aie=qO.Int64BE,$O=Wr(),BO=wh(),Oie=MO(),Lie=cw().uint8,Mie=xh().ExtBuffer,Nie=typeof Uint8Array!="undefined",qie=typeof Map!="undefined",tl=[];tl[1]=212;tl[2]=213;tl[4]=214;tl[8]=215;tl[16]=216;NO.getWriteType=$ie;function $ie(r){var e=Oie.getWriteToken(r),t=r&&r.useraw,i=Nie&&r&&r.binarraybuffer,n=i?$O.isArrayBuffer:$O.isBuffer,o=i?P:E,s=qie&&r&&r.usemap,a=s?O:_,l={boolean:u,function:x,number:c,object:t?v:y,string:m(t?h:d),symbol:x,undefined:x};return l;function u(L,R){var F=R?195:194;e[F](L,R)}function c(L,R){var F=R|0,q;if(R!==F){q=203,e[q](L,R);return}else-32<=F&&F<=127?q=F&255:0<=F?q=F<=255?204:F<=65535?205:206:q=-128<=F?208:-32768<=F?209:210;e[q](L,F)}function f(L,R){var F=207;e[F](L,R.toArray())}function p(L,R){var F=211;e[F](L,R.toArray())}function d(L){return L<32?1:L<=255?2:L<=65535?3:5}function h(L){return L<32?1:L<=65535?3:5}function m(L){return R;function R(F,q){var K=q.length,ae=5+K*3;F.offset=F.reserve(ae);var Pe=F.buffer,We=L(K),Yt=F.offset+We;K=BO.write.call(Pe,q,Yt);var Nt=L(K);if(We!==Nt){var dr=Yt+Nt-We,kn=Yt+K;BO.copy.call(Pe,Pe,dr,Yt,kn)}var In=Nt===1?160+K:Nt<=3?215+Nt:219;e[In](F,K),F.offset+=K}}function y(L,R){if(R===null)return x(L,R);if(n(R))return o(L,R);if(Iie(R))return w(L,R);if(Fie.isUint64BE(R))return f(L,R);if(Aie.isInt64BE(R))return p(L,R);var F=L.codec.getExtPacker(R);if(F&&(R=F(R)),R instanceof Mie)return k(L,R);a(L,R)}function v(L,R){if(n(R))return I(L,R);y(L,R)}function x(L,R){var F=192;e[F](L,R)}function w(L,R){var F=R.length,q=F<16?144+F:F<=65535?220:221;e[q](L,F);for(var K=L.codec.encode,ae=0;ae<F;ae++)K(L,R[ae])}function E(L,R){var F=R.length,q=F<255?196:F<=65535?197:198;e[q](L,F),L.send(R)}function P(L,R){E(L,new Uint8Array(R))}function k(L,R){var F=R.buffer,q=F.length,K=tl[q]||(q<255?199:q<=65535?200:201);e[K](L,q),Lie[R.type](L),L.send(F)}function _(L,R){var F=Object.keys(R),q=F.length,K=q<16?128+q:q<=65535?222:223;e[K](L,q);var ae=L.codec.encode;F.forEach(function(Pe){ae(L,Pe),ae(L,R[Pe])})}function O(L,R){if(!(R instanceof Map))return _(L,R);var F=R.size,q=F<16?128+F:F<=65535?222:223;e[q](L,F);var K=L.codec.encode;R.forEach(function(ae,Pe,We){K(L,Pe),K(L,ae)})}function I(L,R){var F=R.length,q=F<32?160+F:F<=65535?218:219;e[q](L,F),L.send(R)}}});var Nc=g(Mc=>{var Bie=vh();Mc.createCodec=UO;Mc.install=jie;Mc.filter=Uie;var Wie=Wr();function rl(r){if(!(this instanceof rl))return new rl(r);this.options=r,this.init()}rl.prototype.init=function(){var r=this.options;return r&&r.uint8array&&(this.bufferish=Wie.Uint8Array),this};function jie(r){for(var e in r)rl.prototype[e]=Hie(rl.prototype[e],r[e])}function Hie(r,e){return r&&e?t:r||e;function t(){return r.apply(this,arguments),e.apply(this,arguments)}}function zie(r){return r=r.slice(),function(t){return r.reduce(e,t)};function e(t,i){return i(t)}}function Uie(r){return Bie(r)?zie(r):r}function UO(r){return new rl(r)}Mc.preset=UO({preset:!0})});var _h=g(WO=>{var Gie=xh().ExtBuffer,Vie=EO(),Kie=jO(),fw=Nc();fw.install({addExtPacker:Jie,getExtPacker:Yie,init:HO});WO.preset=HO.call(fw.preset);function Xie(r){var e=Kie.getWriteType(r);return t;function t(i,n){var o=e[typeof n];if(!o)throw new Error('Unsupported type "'+typeof n+'": '+n);o(i,n)}}function HO(){var r=this.options;return this.encode=Xie(r),r&&r.preset&&Vie.setExtPackers(this),this}function Jie(r,e,t){t=fw.filter(t);var i=e.name;if(i&&i!=="Object"){var n=this.extPackers||(this.extPackers={});n[i]=s}else{var o=this.extEncoderList||(this.extEncoderList=[]);o.unshift([e,s])}function s(a){return t&&(a=t(a)),new Gie(a,r)}}function Yie(r){var e=this.extPackers||(this.extPackers={}),t=r.constructor,i=t&&t.name&&e[t.name];if(i)return i;for(var n=this.extEncoderList||(this.extEncoderList=[]),o=n.length,s=0;s<o;s++){var a=n[s];if(t===a[0])return a[1]}}});var dw=g(pw=>{pw.FlexDecoder=il;pw.FlexEncoder=nl;var qc=Wr(),Zie=2048,Qie=65536,zO="BUFFER_SHORTAGE";function il(){if(!(this instanceof il))return new il}function nl(){if(!(this instanceof nl))return new nl}il.mixin=GO(ene());il.mixin(il.prototype);nl.mixin=GO(tne());nl.mixin(nl.prototype);function ene(){return{bufferish:qc,write:r,fetch:rne,flush:e,push:KO,pull:ine,read:VO,reserve:t,offset:0};function r(i){var n=this.offset?qc.prototype.slice.call(this.buffer,this.offset):this.buffer;this.buffer=n?i?this.bufferish.concat([n,i]):n:i,this.offset=0}function e(){for(;this.offset<this.buffer.length;){var i=this.offset,n;try{n=this.fetch()}catch(o){if(o&&o.message!=zO)throw o;this.offset=i;break}this.push(n)}}function t(i){var n=this.offset,o=n+i;if(o>this.buffer.length)throw new Error(zO);return this.offset=o,n}}function tne(){return{bufferish:qc,write:nne,fetch:r,flush:e,push:KO,pull:t,read:VO,reserve:i,send:n,maxBufferSize:Qie,minBufferSize:Zie,offset:0,start:0};function r(){var o=this.start;if(o<this.offset){var s=this.start=this.offset;return qc.prototype.slice.call(this.buffer,o,s)}}function e(){for(;this.start<this.offset;){var o=this.fetch();o&&this.push(o)}}function t(){var o=this.buffers||(this.buffers=[]),s=o.length>1?this.bufferish.concat(o):o[0];return o.length=0,s}function i(o){var s=o|0;if(this.buffer){var a=this.buffer.length,l=this.offset|0,u=l+s;if(u<a)return this.offset=u,l;this.flush(),o=Math.max(o,Math.min(a*2,this.maxBufferSize))}return o=Math.max(o,this.minBufferSize),this.buffer=this.bufferish.alloc(o),this.start=0,this.offset=s,0}function n(o){var s=o.length;if(s>this.minBufferSize)this.flush(),this.push(o);else{var a=this.reserve(s);qc.prototype.copy.call(o,this.buffer,a)}}}function nne(){throw new Error("method not implemented: write()")}function rne(){throw new Error("method not implemented: fetch()")}function VO(){var r=this.buffers&&this.buffers.length;return r?(this.flush(),this.pull()):this.fetch()}function KO(r){var e=this.buffers||(this.buffers=[]);e.push(r)}function ine(){var r=this.buffers||(this.buffers=[]);return r.shift()}function GO(r){return e;function e(t){for(var i in r)t[i]=r[i];return t}}});var Ph=g(JO=>{JO.EncodeBuffer=ol;var one=_h().preset,sne=dw().FlexEncoder;sne.mixin(ol.prototype);function ol(r){if(!(this instanceof ol))return new ol(r);if(r&&(this.options=r,r.codec)){var e=this.codec=r.codec;e.bufferish&&(this.bufferish=e.bufferish)}}ol.prototype.codec=one;ol.prototype.write=function(r){this.codec.encode(this,r)}});var aw=g(YO=>{YO.encode=ane;var lne=Ph().EncodeBuffer;function ane(r,e){var t=new lne(e);return t.write(r),t.read()}});var QO=g(XO=>{XO.setExtUnpackers=une;var ZO=Wr(),cne=ZO.global,hw,fne={name:1,message:1,stack:1,columnNumber:1,fileName:1,lineNumber:1};function une(r){r.addExtUnpacker(14,[gi,qs(Error)]),r.addExtUnpacker(1,[gi,qs(EvalError)]),r.addExtUnpacker(2,[gi,qs(RangeError)]),r.addExtUnpacker(3,[gi,qs(ReferenceError)]),r.addExtUnpacker(4,[gi,qs(SyntaxError)]),r.addExtUnpacker(5,[gi,qs(TypeError)]),r.addExtUnpacker(6,[gi,qs(URIError)]),r.addExtUnpacker(10,[gi,pne]),r.addExtUnpacker(11,[gi,yr(Boolean)]),r.addExtUnpacker(12,[gi,yr(String)]),r.addExtUnpacker(13,[gi,yr(Date)]),r.addExtUnpacker(15,[gi,yr(Number)]),typeof Uint8Array!="undefined"&&(r.addExtUnpacker(17,yr(Int8Array)),r.addExtUnpacker(18,yr(Uint8Array)),r.addExtUnpacker(19,[_o,yr(Int16Array)]),r.addExtUnpacker(20,[_o,yr(Uint16Array)]),r.addExtUnpacker(21,[_o,yr(Int32Array)]),r.addExtUnpacker(22,[_o,yr(Uint32Array)]),r.addExtUnpacker(23,[_o,yr(Float32Array)]),typeof Float64Array!="undefined"&&r.addExtUnpacker(24,[_o,yr(Float64Array)]),typeof Uint8ClampedArray!="undefined"&&r.addExtUnpacker(25,yr(Uint8ClampedArray)),r.addExtUnpacker(26,_o),r.addExtUnpacker(29,[_o,yr(DataView)])),ZO.hasBuffer&&r.addExtUnpacker(27,yr(cne))}function gi(r){return hw||(hw=mw().decode),hw(r)}function pne(r){return RegExp.apply(null,r)}function qs(r){return function(e){var t=new r;for(var i in fne)t[i]=e[i];return t}}function yr(r){return function(e){return new r(e)}}function _o(r){return new Uint8Array(r).buffer}});var yw=g(gw=>{var eL=uw(),tL=Sh(),rL=tL.Uint64BE,iL=tL.Int64BE;gw.getReadFormat=dne;gw.readUint8=nL;var vw=Wr(),Th=wh(),hne=typeof Map!="undefined",mne=!0;function dne(r){var e=vw.hasArrayBuffer&&r&&r.binarraybuffer,t=r&&r.int64,i=hne&&r&&r.usemap,n={map:i?vne:gne,array:yne,str:bne,bin:e?xne:wne,ext:Dne,uint8:nL,uint16:Ene,uint32:_ne,uint64:Rh(8,t?kne:Tne),int8:Sne,int16:Cne,int32:Pne,int64:Rh(8,t?Ine:Rne),float32:Rh(4,Fne),float64:Rh(8,Ane)};return n}function gne(r,e){var t={},i,n=new Array(e),o=new Array(e),s=r.codec.decode;for(i=0;i<e;i++)n[i]=s(r),o[i]=s(r);for(i=0;i<e;i++)t[n[i]]=o[i];return t}function vne(r,e){var t=new Map,i,n=new Array(e),o=new Array(e),s=r.codec.decode;for(i=0;i<e;i++)n[i]=s(r),o[i]=s(r);for(i=0;i<e;i++)t.set(n[i],o[i]);return t}function yne(r,e){for(var t=new Array(e),i=r.codec.decode,n=0;n<e;n++)t[n]=i(r);return t}function bne(r,e){var t=r.reserve(e),i=t+e;return Th.toString.call(r.buffer,"utf-8",t,i)}function wne(r,e){var t=r.reserve(e),i=t+e,n=Th.slice.call(r.buffer,t,i);return vw.from(n)}function xne(r,e){var t=r.reserve(e),i=t+e,n=Th.slice.call(r.buffer,t,i);return vw.Uint8Array.from(n).buffer}function Dne(r,e){var t=r.reserve(e+1),i=r.buffer[t++],n=t+e,o=r.codec.getExtUnpacker(i);if(!o)throw new Error("Invalid ext type: "+(i&&"0x"+i.toString(16)));var s=Th.slice.call(r.buffer,t,n);return o(s)}function nL(r){var e=r.reserve(1);return r.buffer[e]}function Sne(r){var e=r.reserve(1),t=r.buffer[e];return t&128?t-256:t}function Ene(r){var e=r.reserve(2),t=r.buffer;return t[e++]<<8|t[e]}function Cne(r){var e=r.reserve(2),t=r.buffer,i=t[e++]<<8|t[e];return i&32768?i-65536:i}function _ne(r){var e=r.reserve(4),t=r.buffer;return t[e++]*16777216+(t[e++]<<16)+(t[e++]<<8)+t[e]}function Pne(r){var e=r.reserve(4),t=r.buffer;return t[e++]<<24|t[e++]<<16|t[e++]<<8|t[e]}function Rh(r,e){return function(t){var i=t.reserve(r);return e.call(t.buffer,i,mne)}}function Tne(r){return new rL(this,r).toNumber()}function Rne(r){return new iL(this,r).toNumber()}function kne(r){return new rL(this,r)}function Ine(r){return new iL(this,r)}function Fne(r){return eL.read(this,r,!1,23,4)}function Ane(r){return eL.read(this,r,!1,52,8)}});var aL=g(oL=>{var One=yw();oL.getReadToken=Lne;function Lne(r){var e=One.getReadFormat(r);return r&&r.useraw?Mne(e):sL(e)}function sL(r){var e,t=new Array(256);for(e=0;e<=127;e++)t[e]=$c(e);for(e=128;e<=143;e++)t[e]=Nn(e-128,r.map);for(e=144;e<=159;e++)t[e]=Nn(e-144,r.array);for(e=160;e<=191;e++)t[e]=Nn(e-160,r.str);for(t[192]=$c(null),t[193]=null,t[194]=$c(!1),t[195]=$c(!0),t[196]=Hr(r.uint8,r.bin),t[197]=Hr(r.uint16,r.bin),t[198]=Hr(r.uint32,r.bin),t[199]=Hr(r.uint8,r.ext),t[200]=Hr(r.uint16,r.ext),t[201]=Hr(r.uint32,r.ext),t[202]=r.float32,t[203]=r.float64,t[204]=r.uint8,t[205]=r.uint16,t[206]=r.uint32,t[207]=r.uint64,t[208]=r.int8,t[209]=r.int16,t[210]=r.int32,t[211]=r.int64,t[212]=Nn(1,r.ext),t[213]=Nn(2,r.ext),t[214]=Nn(4,r.ext),t[215]=Nn(8,r.ext),t[216]=Nn(16,r.ext),t[217]=Hr(r.uint8,r.str),t[218]=Hr(r.uint16,r.str),t[219]=Hr(r.uint32,r.str),t[220]=Hr(r.uint16,r.array),t[221]=Hr(r.uint32,r.array),t[222]=Hr(r.uint16,r.map),t[223]=Hr(r.uint32,r.map),e=224;e<=255;e++)t[e]=$c(e-256);return t}function Mne(r){var e,t=sL(r).slice();for(t[217]=t[196],t[218]=t[197],t[219]=t[198],e=160;e<=191;e++)t[e]=Nn(e-160,r.bin);return t}function $c(r){return function(){return r}}function Hr(r,e){return function(t){var i=r(t);return e(t,i)}}function Nn(r,e){return function(t){return e(t,r)}}});var kh=g(lL=>{var Nne=xh().ExtBuffer,qne=QO(),$ne=yw().readUint8,Bne=aL(),bw=Nc();bw.install({addExtUnpacker:jne,getExtUnpacker:Une,init:uL});lL.preset=uL.call(bw.preset);function Wne(r){var e=Bne.getReadToken(r);return t;function t(i){var n=$ne(i),o=e[n];if(!o)throw new Error("Invalid type: "+(n&&"0x"+n.toString(16)));return o(i)}}function uL(){var r=this.options;return this.decode=Wne(r),r&&r.preset&&qne.setExtUnpackers(this),this}function jne(r,e){var t=this.extUnpackers||(this.extUnpackers=[]);t[r]=bw.filter(e)}function Une(r){var e=this.extUnpackers||(this.extUnpackers=[]);return e[r]||t;function t(i){return new Nne(i,r)}}});var Ih=g(cL=>{cL.DecodeBuffer=sl;var Hne=kh().preset,zne=dw().FlexDecoder;zne.mixin(sl.prototype);function sl(r){if(!(this instanceof sl))return new sl(r);if(r&&(this.options=r,r.codec)){var e=this.codec=r.codec;e.bufferish&&(this.bufferish=e.bufferish)}}sl.prototype.codec=Hne;sl.prototype.fetch=function(){return this.codec.decode(this)}});var mw=g(fL=>{fL.decode=Gne;var Vne=Ih().DecodeBuffer;function Gne(r,e){var t=new Vne(e);return t.write(r),t.read()}});var Dw=g((r_e,ww)=>{function xw(){if(!(this instanceof xw))return new xw}(function(r){typeof ww!="undefined"&&(ww.exports=r);var e="listeners",t={on:n,once:o,off:s,emit:a};i(r.prototype),r.mixin=i;function i(u){for(var c in t)u[c]=t[c];return u}function n(u,c){return l(this,u).push(c),this}function o(u,c){var f=this;return p.originalListener=c,l(f,u).push(p),f;function p(){s.call(f,u,p),c.apply(this,arguments)}}function s(u,c){var f=this,p;if(!arguments.length)delete f[e];else if(c){if(p=l(f,u,!0),p){if(p=p.filter(d),!p.length)return s.call(f,u);f[e][u]=p}}else if(p=f[e],p&&(delete p[u],!Object.keys(p).length))return s.call(f);return f;function d(h){return h!==c&&h.originalListener!==c}}function a(u,c){var f=this,p=l(f,u,!0);if(!p)return!1;var d=arguments.length;if(d===1)p.forEach(m);else if(d===2)p.forEach(y);else{var h=Array.prototype.slice.call(arguments,1);p.forEach(v)}return!!p.length;function m(x){x.call(f)}function y(x){x.call(f,c)}function v(x){x.apply(f,h)}}function l(u,c,f){if(!(f&&!u[e])){var p=u[e]||(u[e]={});return p[c]||(p[c]=[])}}})(xw)});var hL=g(pL=>{pL.Encoder=$s;var Kne=Dw(),dL=Ph().EncodeBuffer;function $s(r){if(!(this instanceof $s))return new $s(r);dL.call(this,r)}$s.prototype=new dL;Kne.mixin($s.prototype);$s.prototype.encode=function(r){this.write(r),this.emit("data",this.read())};$s.prototype.end=function(r){arguments.length&&this.encode(r),this.flush(),this.emit("end")}});var vL=g(mL=>{mL.Decoder=Po;var Jne=Dw(),gL=Ih().DecodeBuffer;function Po(r){if(!(this instanceof Po))return new Po(r);gL.call(this,r)}Po.prototype=new gL;Jne.mixin(Po.prototype);Po.prototype.decode=function(r){arguments.length&&this.write(r),this.flush()};Po.prototype.push=function(r){this.emit("data",r)};Po.prototype.end=function(r){this.decode(r),this.emit("end")}});var wL=g(yL=>{yL.createEncodeStream=al;var Yne=require("util"),bL=require("stream").Transform,Xne=Ph().EncodeBuffer;Yne.inherits(al,bL);var Zne={objectMode:!0};function al(r){if(!(this instanceof al))return new al(r);r?r.objectMode=!0:r=Zne,bL.call(this,r);var e=this,t=this.encoder=new Xne(r);t.push=function(i){e.push(i)}}al.prototype._transform=function(r,e,t){this.encoder.write(r),t&&t()};al.prototype._flush=function(r){this.encoder.flush(),r&&r()}});var SL=g(xL=>{xL.createDecodeStream=Bc;var Qne=require("util"),DL=require("stream").Transform,eoe=Ih().DecodeBuffer;Qne.inherits(Bc,DL);var toe={objectMode:!0};function Bc(r){if(!(this instanceof Bc))return new Bc(r);r?r.objectMode=!0:r=toe,DL.call(this,r);var e=this,t=this.decoder=new eoe(r);t.push=function(i){e.push(i)}}Bc.prototype._transform=function(r,e,t){this.decoder.write(r),this.decoder.flush(),t&&t()}});var CL=g(EL=>{kh();_h();EL.createCodec=Nc().createCodec});var PL=g(_L=>{kh();_h();_L.codec={preset:Nc().preset}});var TL=g(qn=>{qn.encode=aw().encode;qn.decode=mw().decode;qn.Encoder=hL().Encoder;qn.Decoder=vL().Decoder;qn.createEncodeStream=wL().createEncodeStream;qn.createDecodeStream=SL().createDecodeStream;qn.createCodec=CL().createCodec;qn.codec=PL().codec});var kL=g(Sw=>{"use strict";Object.defineProperty(Sw,"__esModule",{value:!0});var roe=require("stream"),RL=class extends roe.Transform{constructor(){super({readableHighWaterMark:10*1024*1024,writableHighWaterMark:10*1024*1024});this.chunks=null,this.timer=null}sendData(){let{chunks:e}=this;if(e){this.chunks=null;let t=Buffer.concat(e);this.push(t)}}_transform(e,t,i){let{chunks:n,timer:o}=this,s=Buffer.poolSize;if(o&&clearTimeout(o),e.length<s){if(!n)return i(null,e);n.push(e),this.sendData(),i()}else n?n.push(e):this.chunks=[e],this.timer=setTimeout(this.sendData.bind(this),20),i()}_flush(e){let{chunks:t}=this;if(t){this.chunks=null;let i=Buffer.concat(t);e(null,i)}else e()}};Sw.default=RL});var jc=g(Fh=>{"use strict";Object.defineProperty(Fh,"__esModule",{value:!0});Fh.BaseApi=void 0;var ioe=require("events"),noe=process.env.VIM_NODE_RPC=="1",IL=class extends ioe.EventEmitter{constructor({transport:e,data:t,client:i}){super();this.setTransport(e),this.data=t,this.client=i}setTransport(e){this.transport=e}equals(e){try{return String(this.data)===String(e.data)}catch(t){return!1}}async request(e,t=[]){let i=Error().stack;return new Promise((n,o)=>{this.transport.request(e,this.getArgsByPrefix(t),(s,a)=>{if(s){let l=new Error(`request error ${e} - ${s[1]}`);l.stack=i,e.endsWith("get_var")||this.client.logError(`request error on "${e}"`,t,s[1],i),o(l)}else n(a)})})}getArgsByPrefix(e){return this.prefix!=="nvim_"&&e[0]!=this?[noe?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))}};Fh.BaseApi=IL});var Uc=g(Ah=>{"use strict";Object.defineProperty(Ah,"__esModule",{value:!0});Ah.Buffer=void 0;var ooe=jc(),FL=class extends ooe.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 n=typeof i=="undefined"?!0:i;return this.request(`${this.prefix}get_lines`,[e,t,n])}setLines(e,{start:t,end:i,strictIndexing:n}={strictIndexing:!0},o=!1){let s=typeof n=="undefined"?!0:n,a=typeof e=="string"?[e]:e,l=typeof i!="undefined"?i:t+1;return this[o?"notify":"request"](`${this.prefix}set_lines`,[t,l,s,a])}setVirtualText(e,t,i,n={}){return this.notify(`${this.prefix}set_virtual_text`,[e,t,i,n]),Promise.resolve(e)}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])}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:n,srcId:o}){if(!e)throw new Error("hlGroup should not empty");let s=typeof n!="undefined"?n:-1,a=typeof i!="undefined"?i:-0,l=typeof o!="undefined"?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:n,lineEnd:o}=Object.assign({},t,e);return this.notify(`${this.prefix}clear_highlight`,[i,n,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])}listen(e,t,i){this.client.attachBufferEvent(this,e,t),i&&i.push({dispose:()=>{this.client.detachBufferEvent(this,e,t)}})}};Ah.Buffer=FL});var Wc=g(Oh=>{"use strict";Object.defineProperty(Oh,"__esModule",{value:!0});Oh.Window=void 0;var soe=jc(),Ew=require("timers"),AL=class extends soe.BaseApi{constructor(){super(...arguments);this.prefix="nvim_win_"}get id(){return this.data}get buffer(){return this.request(`${this.prefix}get_buf`,[])}get tabpage(){return this.request(`${this.prefix}get_tabpage`,[])}get cursor(){return this.request(`${this.prefix}get_cursor`,[])}setCursor(e,t=!1){return this[t?"notify":"request"](`${this.prefix}set_cursor`,[e])}get height(){return this.request(`${this.prefix}get_height`,[])}setHeight(e,t=!1){return this[t?"notify":"request"](`${this.prefix}set_height`,[e])}get width(){return this.request(`${this.prefix}get_width`,[])}setWidth(e,t=!1){return this[t?"notify":"request"](`${this.prefix}set_height`,[e])}get position(){return this.request(`${this.prefix}get_position`,[])}get row(){return this.request(`${this.prefix}get_position`,[]).then(e=>e[0])}get col(){return this.request(`${this.prefix}get_position`,[]).then(e=>e[1])}get valid(){return this.request(`${this.prefix}is_valid`,[])}get number(){return this.request(`${this.prefix}get_number`,[])}setConfig(e,t){return this[t?"notify":"request"](`${this.prefix}set_config`,[e])}getConfig(){return this.request(`${this.prefix}get_config`,[])}close(e,t){if(t){this.notify(`${this.prefix}close`,[e]);let i=0,n=setInterval(()=>{if(i==5)return Ew.clearInterval(n);this.request(`${this.prefix}is_valid`,[]).then(o=>{o?this.notify(`${this.prefix}close`,[e]):Ew.clearInterval(n)},()=>{Ew.clearInterval(n)}),i++},50);return null}return this.request(`${this.prefix}close`,[e])}highlightRanges(e,t,i=10,n){if(n){this.client.call("coc#highlight#match_ranges",[this.id,0,t,e,i],!0);return}return this.client.call("coc#highlight#match_ranges",[this.id,0,t,e,i])}clearMatchGroup(e){this.client.call("coc#highlight#clear_match_group",[this.id,e],!0)}clearMatches(e){this.client.call("coc#highlight#clear_matches",[this.id,e],!0)}};Oh.Window=AL});var Hc=g(Lh=>{"use strict";Object.defineProperty(Lh,"__esModule",{value:!0});Lh.Tabpage=void 0;var aoe=jc(),OL=class extends aoe.BaseApi{constructor(){super(...arguments);this.prefix="nvim_tabpage_"}get windows(){return this.request(`${this.prefix}list_wins`,[])}get window(){return this.request(`${this.prefix}get_win`,[])}get valid(){return this.request(`${this.prefix}is_valid`,[])}get number(){return this.request(`${this.prefix}get_number`,[])}getOption(){throw new Error("Tabpage does not have `getOption`")}setOption(){throw new Error("Tabpage does not have `setOption`")}};Lh.Tabpage=OL});var LL=g(Bs=>{"use strict";Object.defineProperty(Bs,"__esModule",{value:!0});Bs.Metadata=Bs.ExtType=void 0;var loe=Uc(),uoe=Wc(),coe=Hc(),foe;(function(r){r[r.Buffer=0]="Buffer",r[r.Window=1]="Window",r[r.Tabpage=2]="Tabpage"})(foe=Bs.ExtType||(Bs.ExtType={}));Bs.Metadata=[{constructor:loe.Buffer,name:"Buffer",prefix:"nvim_buf_"},{constructor:uoe.Window,name:"Window",prefix:"nvim_win_"},{constructor:coe.Tabpage,name:"Tabpage",prefix:"nvim_tabpage_"}]});var zc=g(ll=>{"use strict";var Cw=ll&&ll.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ll,"__esModule",{value:!0});ll.createLogger=void 0;var _w=Cw(require("fs")),poe=Cw(require("os")),Pw=Cw(require("path"));function doe(){let r=process.env.NODE_CLIENT_LOG_FILE;if(r)return r;let e=process.env.XDG_RUNTIME_DIR;return e?Pw.default.join(e,"node-client.log"):Pw.default.join(poe.default.tmpdir(),`node-client-${process.pid}.log`)}var Tw=doe(),ML=process.env.NODE_CLIENT_LOG_LEVEL||"info",Rw=process.getuid&&process.getuid()==0;if(!Rw)try{_w.default.mkdirSync(Pw.default.dirname(Tw),{recursive:!0}),_w.default.writeFileSync(Tw,"",{encoding:"utf8",mode:438})}catch(r){Rw=!0}function NL(r){return r==null?r:Array.isArray(r)?r.map(e=>NL(e)):typeof r=="object"&&typeof r.prefix=="string"&&typeof r.data=="number"?"["+r.prefix+r.data+"]":r}function hoe(r){return r==null?String(r):typeof r=="object"?JSON.stringify(r,null,2):String(r)}var qL=class{constructor(e){this.name=e}get stream(){return Rw?null:this._stream?this._stream:(this._stream=_w.default.createWriteStream(Tw,{encoding:"utf8"}),this._stream)}getText(e,t,i){let n="";if(i.length){let o=NL(i);n=" "+o.map(s=>hoe(s))}return`${new Date().toLocaleTimeString()} ${e.toUpperCase()} [${this.name}] - ${t}${n}
|
||
`}debug(e,...t){ML!="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))}error(e,...t){this.stream!=null&&this.stream.write(this.getText("error",e,t))}trace(e,...t){ML!="trace"||this.stream==null||this.stream.write(this.getText("trace",e,t))}};function moe(r){return new qL(r)}ll.createLogger=moe});var Iw=g(kw=>{"use strict";Object.defineProperty(kw,"__esModule",{value:!0});var goe=require("events"),voe=zc(),$L=process.env.NODE_CLIENT_LOG_LEVEL=="debug",Gc=voe.createLogger("transport"),BL=class extends goe.EventEmitter{constructor(e){super();this.logger=e,this.pauseLevel=0,this.paused=new Map}debug(e,...t){!$L||Gc.debug(e,...t)}info(e,...t){Gc.info(e,...t)}debugMessage(e){if(!$L)return;let t=e[0];t==0?Gc.debug("receive request:",e.slice(1)):t==1||(t==2?Gc.debug("receive notification:",e.slice(1)):Gc.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,null]);let i=Error().stack;this.pauseLevel=t-1;let n=this.paused.get(t);return this.paused.delete(t),n&&n.length?new Promise((o,s)=>{if(!e)return this.request("nvim_call_atomic",[n],(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,f]=l[1],[p,d]=n[u];this.logger.error(`request error ${c} on "${p}"`,d,f,i)}o(l)});this.notify("nvim_call_atomic",[n]),o()}):e?null:Promise.resolve([[],void 0])}};kw.default=BL});var WL=g(vi=>{"use strict";var yoe=vi&&vi.__createBinding||(Object.create?function(r,e,t,i){i===void 0&&(i=t),Object.defineProperty(r,i,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]}),boe=vi&&vi.__setModuleDefault||(Object.create?function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}:function(r,e){r.default=e}),woe=vi&&vi.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&yoe(e,r,t);return boe(e,r),e},jL=vi&&vi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(vi,"__esModule",{value:!0});vi.NvimTransport=void 0;var $n=woe(TL()),xoe=jL(kL()),Doe=LL(),Soe=jL(Iw()),UL=class extends Soe.default{constructor(e){super(e);this.pending=new Map,this.nextRequestId=1,this.attached=!1;let t=this.setupCodec();this.encodeStream=$n.createEncodeStream({codec:t}),this.decodeStream=$n.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],n=this.pending.get(i);if(n){this.pending.delete(i);let o=e[2];o&&o.length!=2&&(o=[0,o instanceof Error?o.message:o]),n(o,e[3])}}else t===2?this.emit("notification",e[1].toString(),e[2]):console.error(`Invalid message type ${t}`)}setupCodec(){let e=$n.createCodec();return Doe.Metadata.forEach(({constructor:t},i)=>{e.addExtPacker(i,t,n=>$n.encode(n.data)),e.addExtUnpacker(i,n=>new t({transport:this,client:this.client,data:$n.decode(n)}))}),this.codec=e,this.codec}attach(e,t,i){this.encodeStream=this.encodeStream.pipe(e);let n=new xoe.default;t.pipe(n).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 n=this.nextRequestId;this.nextRequestId=this.nextRequestId+1;let o=Date.now();this.debug("request to nvim:",n,e,t),this.encodeStream.write($n.encode([0,n,e,t],{codec:this.codec}));let s=Error().stack,a=setTimeout(()=>{this.debug(`request to vim blocked more than 1s: ${e}`,t,s)},1e3);this.pending.set(n,(l,u)=>{clearTimeout(a),this.debug("response of nvim:",n,`${Date.now()-o}ms`,u,l),i(l,u)})}notify(e,t){if(!!this.attached){if(this.pauseLevel!=0){let i=this.paused.get(this.pauseLevel);if(i){i.push([e,t]);return}}this.debug("nvim notification:",e,t),this.encodeStream.write($n.encode([2,e,t],{codec:this.codec}))}}send(e){this.encodeStream.write($n.encode(e,{codec:this.codec}))}createResponse(e){let{encodeStream:t}=this,i=Date.now(),n=!1,o=setTimeout(()=>{this.debug("request to client cost more than 1s",e)},1e3);return{send:(s,a)=>{clearTimeout(o),!(n||!this.attached)&&(this.debug("response of client:",e,`${Date.now()-i}ms`,s,a==!0),n=!0,t.write($n.encode([1,e,a?s:null,a?null:s])))}}}};vi.NvimTransport=UL});var GL=g(Vc=>{"use strict";var HL=Vc&&Vc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vc,"__esModule",{value:!0});var Eoe=HL(require("events")),Coe=HL(require("readline")),_oe=zc(),ul=_oe.createLogger("connection"),b_e=process.env.NODE_CLIENT_LOG_LEVEL=="debug",zL=class extends Eoe.default{constructor(e,t){super();this.readable=e,this.writeable=t;let i=Coe.default.createInterface(this.readable);i.on("line",n=>{this.parseData(n)}),i.on("close",()=>{ul.error("connection closed"),process.exit(0)})}parseData(e){if(e.length==0)return;let t;try{t=JSON.parse(e)}catch(o){console.error(`Invalid data from vim: ${e}`);return}let[i,n]=t;i>0?(ul.debug("received request:",i,n),this.emit("request",i,n)):i==0?(ul.debug("received notification:",n),this.emit("notification",n)):(ul.debug("received response:",i,n),this.emit("response",i,n))}response(e,t){this.send([e,t||null])}notify(e,t){this.send([0,[e,t||null]])}send(e){ul.debug("send to vim:",e);try{this.writeable.write(JSON.stringify(e)+`
|
||
`)}catch(t){ul.error("Send error:",e)}}redraw(e=!1){this.send(["redraw",e?"force":""])}commmand(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()}};Vc.default=zL});var KL=g(Fw=>{"use strict";Object.defineProperty(Fw,"__esModule",{value:!0});var Poe=zc(),Toe=Poe.createLogger("request"),Roe=process.env.NODE_CLIENT_LOG_LEVEL=="debug",koe=process.env.COC_NVIM=="1"?"coc#api#call":"nvim#api#call",VL=class{constructor(e,t,i){this.connection=e,this.cb=t,this.id=i}request(e,t=[]){this.method=e,this.args=t,this.connection.call(koe,[e.slice(5),t],this.id)}callback(e,t,i){let{method:n,cb:o}=this;if(Roe&&t&&Toe.debug(`request ${this.method} error:`,t,this.args),t)return o([0,t.toString()]);switch(n){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)}}};Fw.default=VL});var YL=g(cl=>{"use strict";var Aw=cl&&cl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(cl,"__esModule",{value:!0});cl.VimTransport=void 0;var Ioe=Aw(Iw()),Foe=Aw(GL()),Aoe=Aw(KL()),JL=class extends Ioe.default{constructor(e){super(e);this.pending=new Map,this.nextRequestId=-1,this.attached=!1,this.notifyMethod=process.env.COC_NVIM=="1"?"coc#api#notify":"nvim#api#notify"}attach(e,t,i){let n=this.connection=new Foe.default(t,e);this.attached=!0,this.client=i,n.on("request",(o,s)=>{let[a,l]=s;this.emit("request",a,l,this.createResponse(o))}),n.on("notification",o=>{let[s,a]=o;this.emit("notification",s.toString(),a)}),n.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 n=this.nextRequestId;this.nextRequestId=this.nextRequestId-1;let o=Date.now();this.debug("request to vim:",n,e,t);let s=setTimeout(()=>{this.debug("request to vim cost more than 1s",e,t)},1e3),a=new Aoe.default(this.connection,(l,u)=>{clearTimeout(s),this.debug("response from vim cost:",n,`${Date.now()-o}ms`),i(l,u)},n);this.pending.set(n,a),a.request(e,t)}notify(e,t){if(!!this.attached){if(this.pauseLevel!=0){let i=this.paused.get(this.pauseLevel);if(i){i.push([e,t]);return}}this.connection.call(this.notifyMethod,[e.slice(5),t])}}createResponse(e){let t=!1,{connection:i}=this,n=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()-n}ms`),i.response(e,[l,a?null:s])}}}};cl.VimTransport=JL});var ZL=g(Mh=>{"use strict";Object.defineProperty(Mh,"__esModule",{value:!0});Mh.Neovim=void 0;var Ooe=jc(),Loe=Uc(),Moe=Hc(),Noe=Wc(),qoe=process.env.VIM_NODE_RPC=="1",XL=class extends Ooe.BaseApi{constructor(){super(...arguments);this.prefix="nvim_",this.Buffer=Loe.Buffer,this.Window=Noe.Window,this.Tabpage=Moe.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 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=[]){let i=this.getArgs(t);return this.request(`${this.prefix}execute_lua`,[e,i])}executeLua(e,t=[]){return this.lua(e,t)}callDictFunction(e,t,i=[]){let n=this.getArgs(i);return this.request(`${this.prefix}call_dict_function`,[e,t,n])}call(e,t=[],i){let n=this.getArgs(t);return i?(this.notify(`${this.prefix}call_function`,[e,n]),null):this.request(`${this.prefix}call_function`,[e,n])}callTimer(e,t=[],i){let n=this.getArgs(t);return i?(this.notify(`${this.prefix}call_function`,["coc#util#timer",[e,n]]),null):qoe?(this.notify(`${this.prefix}call_function`,["coc#util#timer",[e,n]]),new Promise(o=>{setTimeout(()=>{o(null)},20)})):this.request(`${this.prefix}call_function`,["coc#util#timer",[e,n]])}callAsync(e,t=[]){let i=this.getArgs(t);return this.client.sendAsyncRequest(e,i)}callFunction(e,t=[]){return this.call(e,t)}callAtomic(e){return this.request(`${this.prefix}call_atomic`,[e])}command(e,t){return t?(this.notify(`${this.prefix}command`,[e]),null):this.request(`${this.prefix}command`,[e])}commandOutput(e){return this.request(`${this.prefix}command_output`,[e])}getVvar(e){return this.request(`${this.prefix}get_vvar`,[e])}feedKeys(e,t,i){return this.request(`${this.prefix}feedkeys`,[e,t,i])}input(e){return this.request(`${this.prefix}input`,[e])}parseExpression(e,t,i){return this.request(`${this.prefix}parse_expression`,[e,t,i])}getProc(e){return this.request(`${this.prefix}get_proc`,[e])}getProcChildren(e){return this.request(`${this.prefix}get_proc_children`,[e])}replaceTermcodes(e,t,i,n){return this.request(`${this.prefix}replace_termcodes`,[e,t,i,n])}strWidth(e){return this.request(`${this.prefix}strwidth`,[e])}outWrite(e){this.notify(`${this.prefix}out_write`,[e])}outWriteLine(e){this.outWrite(`${e}
|
||
`)}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,n,o){this.notify(`${this.prefix}set_client_info`,[e,t,i,n,o])}async quit(){this.command("qa!",!0),this.transport&&this.transport.detach()}};Mh.Neovim=XL});var Nh=g(fl=>{"use strict";Object.defineProperty(fl,"__esModule",{value:!0});fl.NeovimClient=fl.AsyncResponse=void 0;var $oe=WL(),Boe=YL(),joe=ZL(),Uoe=Uc(),Woe=Wc(),Hoe=Hc(),zoe=zc(),QL=zoe.createLogger("client"),Goe=process.env.VIM_NODE_RPC=="1",Ow=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)}}};fl.AsyncResponse=Ow;var eM=class extends joe.Neovim{constructor(e){super({});this.logger=e,this.requestId=1,this.responses=new Map,this.attachedBuffers=new Map,Object.defineProperty(this,"client",{value:this});let t=Goe?new Boe.VimTransport(e):new $oe.NvimTransport(e);this.setTransport(t),this.transportAttached=!1,this.handleRequest=this.handleRequest.bind(this),this.handleNotification=this.handleNotification.bind(this)}logError(e,...t){!this.logger||this.logger.error(e,...t)}createBuffer(e){return new Uoe.Buffer({transport:this.transport,data:e,client:this})}createWindow(e){return new Woe.Window({transport:this.transport,data:e,client:this})}createTabpage(e){return new Hoe.Tabpage({transport:this.transport,data:e,client:this})}send(e){this.transport.send(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!="undefined"}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((n,o)=>{let s=new Ow(i,(a,l)=>{if(a)return o(a);n(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:n}=t[0];if(!this.attachedBuffers.has(n))return;(this.attachedBuffers.get(n).get(i)||[]).forEach(a=>a(...t)),i==="detach"&&this.attachedBuffers.delete(n);return}if(e.startsWith("nvim_async_request")){let[i,n,o]=t;this.handleRequest(n,o,{send:(s,a)=>{this.notify("nvim_call_function",["coc#rpc#async_response",[i,s,a]])}})}if(e.startsWith("nvim_async_response")){let[i,n,o]=t,s=this.responses.get(i);if(!s){console.error(`Response not found for request ${i}`);return}this.responses.delete(i),s.finish(n,o);return}}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.removeAllListeners("request"),this.transport.removeAllListeners("notification"),this.transport.removeAllListeners("detach")}),e?this._isReady=this.generateApi():(this._channelId=0,this._isReady=Promise.resolve(!0))}requestApi(){return new Promise((e,t)=>{this.transport.request("nvim_get_api_info",[],(i,n)=>{i?t(new Error(Array.isArray(i)?i[1]:i.message||i.toString())):e(n)})})}async generateApi(){let e;try{e=await this.requestApi()}catch(t){console.error("Could not get vim api results"),QL.error(t)}if(e)try{let[t,i]=e;return this.functions=i.functions.map(n=>n.name),this._channelId=t,!0}catch(t){return QL.error(t.stack),null}return null}attachBufferEvent(e,t,i){let n=this.attachedBuffers.get(e.id)||new Map,o=n.get(t)||[];o.includes(i)||(o.push(i),n.set(t,o),this.attachedBuffers.set(e.id,n))}detachBufferEvent(e,t,i){let n=this.attachedBuffers.get(e.id);if(!n||!n.has(t))return;let o=n.get(t).filter(s=>s!==i);n.set(t,o)}pauseNotification(){this.transport.pauseNotification();let e=Error().stack;process.nextTick(()=>{this.transport.pauseLevel>0&&this.logError("resumeNotification not called within same tick:",e)})}resumeNotification(e,t){return e?Promise.resolve(this.transport.cancelNotification()):t?Promise.resolve(this.transport.resumeNotification(!0)):Promise.resolve(this.transport.resumeNotification())}hasFunction(e){return this.functions?this.functions.indexOf(e)!==-1:!0}};fl.NeovimClient=eM});var tM=g(qh=>{"use strict";Object.defineProperty(qh,"__esModule",{value:!0});qh.attach=void 0;var Voe=require("net"),Koe=Nh();function Joe({reader:r,writer:e,proc:t,socket:i},n=null,o=!0){let s,a,l;if(i){let u=Voe.createConnection(i);s=u,a=u,u.once("close",()=>{l.detach()})}else r&&e?(s=e,a=r):t&&(s=t.stdin,a=t.stdout,t.once("disconnect",()=>{l.detach()}));if(s.on("error",u=>{u.code=="EPIPE"&&l.detach()}),s&&a)return l=new Koe.NeovimClient(n),l.attach({writer:s,reader:a},o),l;throw new Error("Invalid arguments, could not attach")}qh.attach=Joe});var rM=g(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.Tabpage=yi.Window=yi.Buffer=yi.NeovimClient=yi.Neovim=void 0;var Yoe=Nh();Object.defineProperty(yi,"Neovim",{enumerable:!0,get:function(){return Yoe.NeovimClient}});var Xoe=Nh();Object.defineProperty(yi,"NeovimClient",{enumerable:!0,get:function(){return Xoe.NeovimClient}});var Zoe=Uc();Object.defineProperty(yi,"Buffer",{enumerable:!0,get:function(){return Zoe.Buffer}});var Qoe=Wc();Object.defineProperty(yi,"Window",{enumerable:!0,get:function(){return Qoe.Window}});var ese=Hc();Object.defineProperty(yi,"Tabpage",{enumerable:!0,get:function(){return ese.Tabpage}})});var Lw=g(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.Window=Tr.Tabpage=Tr.Buffer=Tr.NeovimClient=Tr.Neovim=Tr.attach=void 0;var tse=tM();Object.defineProperty(Tr,"attach",{enumerable:!0,get:function(){return tse.attach}});var Kc=rM();Object.defineProperty(Tr,"Neovim",{enumerable:!0,get:function(){return Kc.Neovim}});Object.defineProperty(Tr,"NeovimClient",{enumerable:!0,get:function(){return Kc.NeovimClient}});Object.defineProperty(Tr,"Buffer",{enumerable:!0,get:function(){return Kc.Buffer}});Object.defineProperty(Tr,"Tabpage",{enumerable:!0,get:function(){return Kc.Tabpage}});Object.defineProperty(Tr,"Window",{enumerable:!0,get:function(){return Kc.Window}})});var pl=g(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});function rse(r){return r===!0||r===!1}Bn.boolean=rse;function iM(r){return typeof r=="string"||r instanceof String}Bn.string=iM;function ise(r){return typeof r=="number"||r instanceof Number}Bn.number=ise;function nse(r){return r instanceof Error}Bn.error=nse;function ose(r){return typeof r=="function"}Bn.func=ose;function nM(r){return Array.isArray(r)}Bn.array=nM;function sse(r){return nM(r)&&r.every(e=>iM(e))}Bn.stringArray=sse});var TM=g(Le=>{"use strict";Object.defineProperty(Le,"__esModule",{value:!0});var js=pl(),oM;(function(r){r.ParseError=-32700,r.InvalidRequest=-32600,r.MethodNotFound=-32601,r.InvalidParams=-32602,r.InternalError=-32603,r.serverErrorStart=-32099,r.serverErrorEnd=-32e3,r.ServerNotInitialized=-32002,r.UnknownErrorCode=-32001,r.RequestCancelled=-32800,r.ContentModified=-32801,r.MessageWriteError=1,r.MessageReadError=2})(oM=Le.ErrorCodes||(Le.ErrorCodes={}));var $h=class extends Error{constructor(e,t,i){super(t);this.code=js.number(e)?e:oM.UnknownErrorCode,this.data=i,Object.setPrototypeOf(this,$h.prototype)}toJson(){return{code:this.code,message:this.message,data:this.data}}};Le.ResponseError=$h;var ot=class{constructor(e,t){this._method=e,this._numberOfParams=t}get method(){return this._method}get numberOfParams(){return this._numberOfParams}};Le.AbstractMessageType=ot;var sM=class extends ot{constructor(e){super(e,0)}};Le.RequestType0=sM;var aM=class extends ot{constructor(e){super(e,1)}};Le.RequestType=aM;var lM=class extends ot{constructor(e){super(e,1)}};Le.RequestType1=lM;var uM=class extends ot{constructor(e){super(e,2)}};Le.RequestType2=uM;var cM=class extends ot{constructor(e){super(e,3)}};Le.RequestType3=cM;var fM=class extends ot{constructor(e){super(e,4)}};Le.RequestType4=fM;var pM=class extends ot{constructor(e){super(e,5)}};Le.RequestType5=pM;var dM=class extends ot{constructor(e){super(e,6)}};Le.RequestType6=dM;var hM=class extends ot{constructor(e){super(e,7)}};Le.RequestType7=hM;var mM=class extends ot{constructor(e){super(e,8)}};Le.RequestType8=mM;var gM=class extends ot{constructor(e){super(e,9)}};Le.RequestType9=gM;var vM=class extends ot{constructor(e){super(e,1);this._=void 0}};Le.NotificationType=vM;var yM=class extends ot{constructor(e){super(e,0)}};Le.NotificationType0=yM;var bM=class extends ot{constructor(e){super(e,1)}};Le.NotificationType1=bM;var wM=class extends ot{constructor(e){super(e,2)}};Le.NotificationType2=wM;var xM=class extends ot{constructor(e){super(e,3)}};Le.NotificationType3=xM;var DM=class extends ot{constructor(e){super(e,4)}};Le.NotificationType4=DM;var SM=class extends ot{constructor(e){super(e,5)}};Le.NotificationType5=SM;var EM=class extends ot{constructor(e){super(e,6)}};Le.NotificationType6=EM;var CM=class extends ot{constructor(e){super(e,7)}};Le.NotificationType7=CM;var _M=class extends ot{constructor(e){super(e,8)}};Le.NotificationType8=_M;var PM=class extends ot{constructor(e){super(e,9)}};Le.NotificationType9=PM;function ase(r){let e=r;return e&&js.string(e.method)&&(js.string(e.id)||js.number(e.id))}Le.isRequestMessage=ase;function lse(r){let e=r;return e&&js.string(e.method)&&r.id===void 0}Le.isNotificationMessage=lse;function use(r){let e=r;return e&&(e.result!==void 0||!!e.error)&&(js.string(e.id)||js.number(e.id)||e.id===null)}Le.isResponseMessage=use});var Yc=g(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});var cse;(function(r){function e(t){return{dispose:t}}r.create=e})(cse=Us.Disposable||(Us.Disposable={}));var fse;(function(r){let e={dispose(){}};r.None=function(){return e}})(fse=Us.Event||(Us.Event={}));var RM=class{add(e,t=null,i){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(t),Array.isArray(i)&&i.push({dispose:()=>this.remove(e,t)})}remove(e,t=null){if(!!this._callbacks){for(var i=!1,n=0,o=this._callbacks.length;n<o;n++)if(this._callbacks[n]===e)if(this._contexts[n]===t){this._callbacks.splice(n,1),this._contexts.splice(n,1);return}else i=!0;if(i)throw new Error("When adding a listener with a context, you should remove it with the same context")}}invoke(...e){if(!this._callbacks)return[];for(var t=[],i=this._callbacks.slice(0),n=this._contexts.slice(0),o=0,s=i.length;o<s;o++)try{t.push(i[o].apply(n[o],e))}catch(a){console.error(a)}return t}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}},Jc=class{constructor(e){this._options=e}get event(){return this._event||(this._event=(e,t,i)=>{this._callbacks||(this._callbacks=new RM),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,t);let n;return n={dispose:()=>{this._callbacks.remove(e,t),n.dispose=Jc._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this)}},Array.isArray(i)&&i.push(n),n}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}};Us.Emitter=Jc;Jc._noop=function(){}});var jh=g(To=>{"use strict";Object.defineProperty(To,"__esModule",{value:!0});var Mw=Yc(),dl=pl(),Nw=8192,kM=Buffer.from("\r","ascii")[0],IM=Buffer.from(`
|
||
`,"ascii")[0],pse=`\r
|
||
`,FM=class{constructor(e="utf8"){this.encoding=e,this.index=0,this.buffer=Buffer.allocUnsafe(Nw)}append(e){var t=e;if(typeof e=="string"){var i=e,n=Buffer.byteLength(i,this.encoding);t=Buffer.allocUnsafe(n),t.write(i,0,n,this.encoding)}if(this.buffer.length-this.index>=t.length)t.copy(this.buffer,this.index,0,t.length);else{var o=(Math.ceil((this.index+t.length)/Nw)+1)*Nw;this.index===0?(this.buffer=Buffer.allocUnsafe(o),t.copy(this.buffer,0,0,t.length)):this.buffer=Buffer.concat([this.buffer.slice(0,this.index),t],o)}this.index+=t.length}tryReadHeaders(){let e,t=0;for(;t+3<this.index&&(this.buffer[t]!==kM||this.buffer[t+1]!==IM||this.buffer[t+2]!==kM||this.buffer[t+3]!==IM);)t++;if(t+3>=this.index)return e;e=Object.create(null),this.buffer.toString("ascii",0,t).split(pse).forEach(o=>{let s=o.indexOf(":");if(s===-1)throw new Error("Message header must separate key and value using :");let a=o.substr(0,s),l=o.substr(s+1).trim();e[a]=l});let n=t+4;return this.buffer=this.buffer.slice(n),this.index=this.index-n,e}tryReadContent(e){if(this.index<e)return null;let t=this.buffer.toString(this.encoding,0,e),i=e;return this.buffer.copy(this.buffer,0,i),this.index=this.index-i,t}get numberOfBytes(){return this.index}},dse;(function(r){function e(t){let i=t;return i&&dl.func(i.listen)&&dl.func(i.dispose)&&dl.func(i.onError)&&dl.func(i.onClose)&&dl.func(i.onPartialMessage)}r.is=e})(dse=To.MessageReader||(To.MessageReader={}));var Bh=class{constructor(){this.errorEmitter=new Mw.Emitter,this.closeEmitter=new Mw.Emitter,this.partialMessageEmitter=new Mw.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e)}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${dl.string(e.message)?e.message:"unknown"}`)}};To.AbstractMessageReader=Bh;var qw=class extends Bh{constructor(e,t="utf8"){super();this.readable=e,this.buffer=new FM(t),this._partialMessageTimeout=1e4}set partialMessageTimeout(e){this._partialMessageTimeout=e}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e,this.readable.on("data",t=>{this.onData(t)}),this.readable.on("error",t=>this.fireError(t)),this.readable.on("close",()=>this.fireClose())}onData(e){for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders();if(!n)return;let o=n["Content-Length"];if(!o)throw new Error("Header must provide a Content-Length property.");let s=parseInt(o);if(isNaN(s))throw new Error("Content-Length value must be a number.");this.nextMessageLength=s}var t=this.buffer.tryReadContent(this.nextMessageLength);if(t===null){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.messageToken++;var i=JSON.parse(t);this.callback(i)}}clearPartialMessageTimer(){this.partialMessageTimer&&(clearTimeout(this.partialMessageTimer),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=setTimeout((e,t)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:t}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}};To.StreamMessageReader=qw;var AM=class extends Bh{constructor(e){super();this.process=e;let t=this.process;t.on("error",i=>this.fireError(i)),t.on("close",()=>this.fireClose())}listen(e){this.process.on("message",e)}};To.IPCMessageReader=AM;var OM=class extends qw{constructor(e,t="utf-8"){super(e,t)}};To.SocketMessageReader=OM});var Wh=g(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});var LM=Yc(),Xc=pl(),MM="Content-Length: ",Uh=`\r
|
||
`,hse;(function(r){function e(t){let i=t;return i&&Xc.func(i.dispose)&&Xc.func(i.onClose)&&Xc.func(i.onError)&&Xc.func(i.write)}r.is=e})(hse=Ro.MessageWriter||(Ro.MessageWriter={}));var Zc=class{constructor(){this.errorEmitter=new LM.Emitter,this.closeEmitter=new LM.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: ${Xc.string(e.message)?e.message:"unknown"}`)}};Ro.AbstractMessageWriter=Zc;var NM=class extends Zc{constructor(e,t="utf8"){super();this.writable=e,this.encoding=t,this.errorCount=0,this.writable.on("error",i=>this.fireError(i)),this.writable.on("close",()=>this.fireClose())}write(e){let t=JSON.stringify(e),i=Buffer.byteLength(t,this.encoding),n=[MM,i.toString(),Uh,Uh];try{this.writable.write(n.join(""),"ascii"),this.writable.write(t,this.encoding),this.errorCount=0}catch(o){this.errorCount++,this.fireError(o,e,this.errorCount)}}};Ro.StreamMessageWriter=NM;var qM=class extends Zc{constructor(e){super();this.process=e,this.errorCount=0,this.queue=[],this.sending=!1;let t=this.process;t.on("error",i=>this.fireError(i)),t.on("close",()=>this.fireClose)}write(e){!this.sending&&this.queue.length===0?this.doWriteMessage(e):this.queue.push(e)}doWriteMessage(e){try{this.process.send&&(this.sending=!0,this.process.send(e,void 0,void 0,t=>{this.sending=!1,t?(this.errorCount++,this.fireError(t,e,this.errorCount)):this.errorCount=0,this.queue.length>0&&this.doWriteMessage(this.queue.shift())}))}catch(t){this.errorCount++,this.fireError(t,e,this.errorCount)}}};Ro.IPCMessageWriter=qM;var $M=class extends Zc{constructor(e,t="utf8"){super();this.socket=e,this.queue=[],this.sending=!1,this.encoding=t,this.errorCount=0,this.socket.on("error",i=>this.fireError(i)),this.socket.on("close",()=>this.fireClose())}dispose(){super.dispose(),this.socket.destroy()}write(e){!this.sending&&this.queue.length===0?this.doWriteMessage(e):this.queue.push(e)}doWriteMessage(e){let t=JSON.stringify(e),i=Buffer.byteLength(t,this.encoding),n=[MM,i.toString(),Uh,Uh];try{this.sending=!0,this.socket.write(n.join(""),"ascii",o=>{o&&this.handleError(o,e);try{this.socket.write(t,this.encoding,s=>{this.sending=!1,s?this.handleError(s,e):this.errorCount=0,this.queue.length>0&&this.doWriteMessage(this.queue.shift())})}catch(s){this.handleError(s,e)}})}catch(o){this.handleError(o,e)}}handleError(e,t){this.errorCount++,this.fireError(e,t,this.errorCount)}};Ro.SocketMessageWriter=$M});var jM=g(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});var $w=Yc(),mse=pl(),Bw;(function(r){r.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:$w.Event.None}),r.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:$w.Event.None});function e(t){let i=t;return i&&(i===r.None||i===r.Cancelled||mse.boolean(i.isCancellationRequested)&&!!i.onCancellationRequested)}r.is=e})(Bw=Qc.CancellationToken||(Qc.CancellationToken={}));var gse=Object.freeze(function(r,e){let t=setTimeout(r.bind(e),0);return{dispose(){clearTimeout(t)}}}),jw=class{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?gse:(this._emitter||(this._emitter=new $w.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}},BM=class{get token(){return this._token||(this._token=new jw),this._token}cancel(){this._token?this._token.cancel():this._token=Bw.Cancelled}dispose(){this._token?this._token instanceof jw&&this._token.dispose():this._token=Bw.None}};Qc.CancellationTokenSource=BM});var WM=g(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});var dn;(function(r){r.None=0,r.First=1,r.Last=2})(dn=ef.Touch||(ef.Touch={}));var UM=class{constructor(){this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}has(e){return this._map.has(e)}get(e){let t=this._map.get(e);if(!!t)return t.value}set(e,t,i=dn.None){let n=this._map.get(e);if(n)n.value=t,i!==dn.None&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case dn.None:this.addItemLast(n);break;case dn.First:this.addItemFirst(n);break;case dn.Last:this.addItemLast(n);break;default:this.addItemLast(n);break}this._map.set(e,n),this._size++}}delete(e){let t=this._map.get(e);return t?(this._map.delete(e),this.removeItem(t),this._size--,!0):!1}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._head;for(;i;)t?e.bind(t)(i.value,i.key,this):e(i.value,i.key,this),i=i.next}forEachReverse(e,t){let i=this._tail;for(;i;)t?e.bind(t)(i.value,i.key,this):e(i.value,i.key,this),i=i.previous}values(){let e=[],t=this._head;for(;t;)e.push(t.value),t=t.next;return e}keys(){let e=[],t=this._head;for(;t;)e.push(t.key),t=t.next;return e}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head)this._head=e.next;else if(e===this._tail)this._tail=e.previous;else{let t=e.next,i=e.previous;if(!t||!i)throw new Error("Invalid list");t.previous=i,i.next=t}}touch(e,t){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(t!==dn.First&&t!==dn.Last)){if(t===dn.First){if(e===this._head)return;let i=e.next,n=e.previous;e===this._tail?(n.next=void 0,this._tail=n):(i.previous=n,n.next=i),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e}else if(t===dn.Last){if(e===this._tail)return;let i=e.next,n=e.previous;e===this._head?(i.previous=void 0,this._head=i):(i.previous=n,n.next=i),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e}}}};ef.LinkedMap=UM});var VM=g(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});var vse=require("path"),yse=require("os"),bse=require("crypto"),HM=require("net"),zM=jh(),GM=Wh();function wse(){let r=bse.randomBytes(21).toString("hex");return process.platform==="win32"?`\\\\.\\pipe\\vscode-jsonrpc-${r}-sock`:vse.join(yse.tmpdir(),`vscode-${r}.sock`)}tf.generateRandomPipeName=wse;function xse(r,e="utf-8"){let t,i=new Promise((n,o)=>{t=n});return new Promise((n,o)=>{let s=HM.createServer(a=>{s.close(),t([new zM.SocketMessageReader(a,e),new GM.SocketMessageWriter(a,e)])});s.on("error",o),s.listen(r,()=>{s.removeListener("error",o),n({onConnected:()=>i})})})}tf.createClientPipeTransport=xse;function Dse(r,e="utf-8"){let t=HM.createConnection(r);return[new zM.SocketMessageReader(t,e),new GM.SocketMessageWriter(t,e)]}tf.createServerPipeTransport=Dse});var XM=g(Hh=>{"use strict";Object.defineProperty(Hh,"__esModule",{value:!0});var KM=require("net"),JM=jh(),YM=Wh();function Sse(r,e="utf-8"){let t,i=new Promise((n,o)=>{t=n});return new Promise((n,o)=>{let s=KM.createServer(a=>{s.close(),t([new JM.SocketMessageReader(a,e),new YM.SocketMessageWriter(a,e)])});s.on("error",o),s.listen(r,"127.0.0.1",()=>{s.removeListener("error",o),n({onConnected:()=>i})})})}Hh.createClientSocketTransport=Sse;function Ese(r,e="utf-8"){let t=KM.createConnection(r,"127.0.0.1");return[new JM.SocketMessageReader(t,e),new YM.SocketMessageWriter(t,e)]}Hh.createServerSocketTransport=Ese});var bi=g(Q=>{"use strict";function ZM(r){for(var e in r)Q.hasOwnProperty(e)||(Q[e]=r[e])}Object.defineProperty(Q,"__esModule",{value:!0});var jt=pl(),ne=TM();Q.RequestType=ne.RequestType;Q.RequestType0=ne.RequestType0;Q.RequestType1=ne.RequestType1;Q.RequestType2=ne.RequestType2;Q.RequestType3=ne.RequestType3;Q.RequestType4=ne.RequestType4;Q.RequestType5=ne.RequestType5;Q.RequestType6=ne.RequestType6;Q.RequestType7=ne.RequestType7;Q.RequestType8=ne.RequestType8;Q.RequestType9=ne.RequestType9;Q.ResponseError=ne.ResponseError;Q.ErrorCodes=ne.ErrorCodes;Q.NotificationType=ne.NotificationType;Q.NotificationType0=ne.NotificationType0;Q.NotificationType1=ne.NotificationType1;Q.NotificationType2=ne.NotificationType2;Q.NotificationType3=ne.NotificationType3;Q.NotificationType4=ne.NotificationType4;Q.NotificationType5=ne.NotificationType5;Q.NotificationType6=ne.NotificationType6;Q.NotificationType7=ne.NotificationType7;Q.NotificationType8=ne.NotificationType8;Q.NotificationType9=ne.NotificationType9;var rf=jh();Q.MessageReader=rf.MessageReader;Q.StreamMessageReader=rf.StreamMessageReader;Q.IPCMessageReader=rf.IPCMessageReader;Q.SocketMessageReader=rf.SocketMessageReader;var nf=Wh();Q.MessageWriter=nf.MessageWriter;Q.StreamMessageWriter=nf.StreamMessageWriter;Q.IPCMessageWriter=nf.IPCMessageWriter;Q.SocketMessageWriter=nf.SocketMessageWriter;var ko=Yc();Q.Disposable=ko.Disposable;Q.Event=ko.Event;Q.Emitter=ko.Emitter;var hl=jM();Q.CancellationTokenSource=hl.CancellationTokenSource;Q.CancellationToken=hl.CancellationToken;var QM=WM();ZM(VM());ZM(XM());var of;(function(r){r.type=new ne.NotificationType("$/cancelRequest")})(of||(of={}));var zh;(function(r){r.type=new ne.NotificationType("$/progress")})(zh||(zh={}));var eN=class{constructor(){}};Q.ProgressType=eN;Q.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var yt;(function(r){r[r.Off=0]="Off",r[r.Messages=1]="Messages",r[r.Verbose=2]="Verbose"})(yt=Q.Trace||(Q.Trace={}));(function(r){function e(i){if(!jt.string(i))return r.Off;switch(i=i.toLowerCase(),i){case"off":return r.Off;case"messages":return r.Messages;case"verbose":return r.Verbose;default:return r.Off}}r.fromString=e;function t(i){switch(i){case r.Off:return"off";case r.Messages:return"messages";case r.Verbose:return"verbose";default:return"off"}}r.toString=t})(yt=Q.Trace||(Q.Trace={}));var ji;(function(r){r.Text="text",r.JSON="json"})(ji=Q.TraceFormat||(Q.TraceFormat={}));(function(r){function e(t){return t=t.toLowerCase(),t==="json"?r.JSON:r.Text}r.fromString=e})(ji=Q.TraceFormat||(Q.TraceFormat={}));var tN;(function(r){r.type=new ne.NotificationType("$/setTraceNotification")})(tN=Q.SetTraceNotification||(Q.SetTraceNotification={}));var Uw;(function(r){r.type=new ne.NotificationType("$/logTraceNotification")})(Uw=Q.LogTraceNotification||(Q.LogTraceNotification={}));var Gh;(function(r){r[r.Closed=1]="Closed",r[r.Disposed=2]="Disposed",r[r.AlreadyListening=3]="AlreadyListening"})(Gh=Q.ConnectionErrors||(Q.ConnectionErrors={}));var Ws=class extends Error{constructor(e,t){super(t);this.code=e,Object.setPrototypeOf(this,Ws.prototype)}};Q.ConnectionError=Ws;var Cse;(function(r){function e(t){let i=t;return i&&jt.func(i.cancelUndispatched)}r.is=e})(Cse=Q.ConnectionStrategy||(Q.ConnectionStrategy={}));var Ui;(function(r){r[r.New=1]="New",r[r.Listening=2]="Listening",r[r.Closed=3]="Closed",r[r.Disposed=4]="Disposed"})(Ui||(Ui={}));function _se(r,e,t,i){let n=0,o=0,s=0,a="2.0",l,u=Object.create(null),c,f=Object.create(null),p=new Map,d,h=new QM.LinkedMap,m=Object.create(null),y=Object.create(null),v=yt.Off,x=ji.Text,w,E=Ui.New,P=new ko.Emitter,k=new ko.Emitter,_=new ko.Emitter,O=new ko.Emitter,I=new ko.Emitter;function L(T){return"req-"+T.toString()}function R(T){return T===null?"res-unknown-"+(++s).toString():"res-"+T.toString()}function F(){return"not-"+(++o).toString()}function q(T,B){ne.isRequestMessage(B)?T.set(L(B.id),B):ne.isResponseMessage(B)?T.set(R(B.id),B):T.set(F(),B)}function K(T){}function ae(){return E===Ui.Listening}function Pe(){return E===Ui.Closed}function We(){return E===Ui.Disposed}function Yt(){(E===Ui.New||E===Ui.Listening)&&(E=Ui.Closed,k.fire(void 0))}function Nt(T){P.fire([T,void 0,void 0])}function dr(T){P.fire(T)}r.onClose(Yt),r.onError(Nt),e.onClose(Yt),e.onError(dr);function kn(){d||h.size===0||(d=setImmediate(()=>{d=void 0,In()}))}function In(){if(h.size===0)return;let T=h.shift();try{ne.isRequestMessage(T)?Dd(T):ne.isNotificationMessage(T)?Fa(T):ne.isResponseMessage(T)?_y(T):Aa(T)}finally{kn()}}let Cy=T=>{try{if(ne.isNotificationMessage(T)&&T.method===of.type.method){let B=L(T.params.id),V=h.get(B);if(ne.isRequestMessage(V)){let te=i&&i.cancelUndispatched?i.cancelUndispatched(V,K):K(V);if(te&&(te.error!==void 0||te.result!==void 0)){h.delete(B),te.id=V.id,fe(te,T.method,Date.now()),e.write(te);return}}}q(h,T)}finally{kn()}};function Dd(T){if(We())return;function B(tt,hr,rt){let Zt={jsonrpc:a,id:T.id};tt instanceof ne.ResponseError?Zt.error=tt.toJson():Zt.result=tt===void 0?null:tt,fe(Zt,hr,rt),e.write(Zt)}function V(tt,hr,rt){let Zt={jsonrpc:a,id:T.id,error:tt.toJson()};fe(Zt,hr,rt),e.write(Zt)}function te(tt,hr,rt){tt===void 0&&(tt=null);let Zt={jsonrpc:a,id:T.id,result:tt};fe(Zt,hr,rt),e.write(Zt)}Ee(T);let Qe=u[T.method],si,ln;Qe&&(si=Qe.type,ln=Qe.handler);let _t=Date.now();if(ln||l){let tt=new hl.CancellationTokenSource,hr=String(T.id);y[hr]=tt;try{let rt;T.params===void 0||si!==void 0&&si.numberOfParams===0?rt=ln?ln(tt.token):l(T.method,tt.token):jt.array(T.params)&&(si===void 0||si.numberOfParams>1)?rt=ln?ln(...T.params,tt.token):l(T.method,...T.params,tt.token):rt=ln?ln(T.params,tt.token):l(T.method,T.params,tt.token);let Zt=rt;rt?Zt.then?Zt.then(ms=>{delete y[hr],B(ms,T.method,_t)},ms=>{delete y[hr],ms instanceof ne.ResponseError?V(ms,T.method,_t):ms&&jt.string(ms.message)?V(new ne.ResponseError(ne.ErrorCodes.InternalError,`Request ${T.method} failed with message: ${ms.message}`),T.method,_t):V(new ne.ResponseError(ne.ErrorCodes.InternalError,`Request ${T.method} failed unexpectedly without providing any details.`),T.method,_t)}):(delete y[hr],B(rt,T.method,_t)):(delete y[hr],te(rt,T.method,_t))}catch(rt){delete y[hr],rt instanceof ne.ResponseError?B(rt,T.method,_t):rt&&jt.string(rt.message)?V(new ne.ResponseError(ne.ErrorCodes.InternalError,`Request ${T.method} failed with message: ${rt.message}`),T.method,_t):V(new ne.ResponseError(ne.ErrorCodes.InternalError,`Request ${T.method} failed unexpectedly without providing any details.`),T.method,_t)}}else V(new ne.ResponseError(ne.ErrorCodes.MethodNotFound,`Unhandled method ${T.method}`),T.method,_t)}function _y(T){if(!We())if(T.id===null)T.error?t.error(`Received response message without id: Error is:
|
||
${JSON.stringify(T.error,void 0,4)}`):t.error("Received response message without id. No further error information provided.");else{let B=String(T.id),V=m[B];if(Oi(T,V),V){delete m[B];try{if(T.error){let te=T.error;V.reject(new ne.ResponseError(te.code,te.message,te.data))}else if(T.result!==void 0)V.resolve(T.result);else throw new Error("Should never happen.")}catch(te){te.message?t.error(`Response handler '${V.method}' failed with message: ${te.message}`):t.error(`Response handler '${V.method}' failed unexpectedly.`)}}}}function Fa(T){if(We())return;let B,V;if(T.method===of.type.method)V=te=>{let Qe=te.id,si=y[String(Qe)];si&&si.cancel()};else{let te=f[T.method];te&&(V=te.handler,B=te.type)}if(V||c)try{Ct(T),T.params===void 0||B!==void 0&&B.numberOfParams===0?V?V():c(T.method):jt.array(T.params)&&(B===void 0||B.numberOfParams>1)?V?V(...T.params):c(T.method,...T.params):V?V(T.params):c(T.method,T.params)}catch(te){te.message?t.error(`Notification handler '${T.method}' failed with message: ${te.message}`):t.error(`Notification handler '${T.method}' failed unexpectedly.`)}else _.fire(T)}function Aa(T){if(!T){t.error("Received empty message.");return}t.error(`Received message which is neither a response nor a notification message:
|
||
${JSON.stringify(T,null,4)}`);let B=T;if(jt.string(B.id)||jt.number(B.id)){let V=String(B.id),te=m[V];te&&te.reject(new Error("The received response has neither a result nor an error property."))}}function Se(T){if(!(v===yt.Off||!w))if(x===ji.Text){let B;v===yt.Verbose&&T.params&&(B=`Params: ${JSON.stringify(T.params,null,4)}
|
||
|
||
`),w.log(`Sending request '${T.method} - (${T.id})'.`,B)}else Xt("send-request",T)}function ve(T){if(!(v===yt.Off||!w))if(x===ji.Text){let B;v===yt.Verbose&&(T.params?B=`Params: ${JSON.stringify(T.params,null,4)}
|
||
|
||
`:B=`No parameters provided.
|
||
|
||
`),w.log(`Sending notification '${T.method}'.`,B)}else Xt("send-notification",T)}function fe(T,B,V){if(!(v===yt.Off||!w))if(x===ji.Text){let te;v===yt.Verbose&&(T.error&&T.error.data?te=`Error data: ${JSON.stringify(T.error.data,null,4)}
|
||
|
||
`:T.result?te=`Result: ${JSON.stringify(T.result,null,4)}
|
||
|
||
`:T.error===void 0&&(te=`No result returned.
|
||
|
||
`)),w.log(`Sending response '${B} - (${T.id})'. Processing request took ${Date.now()-V}ms`,te)}else Xt("send-response",T)}function Ee(T){if(!(v===yt.Off||!w))if(x===ji.Text){let B;v===yt.Verbose&&T.params&&(B=`Params: ${JSON.stringify(T.params,null,4)}
|
||
|
||
`),w.log(`Received request '${T.method} - (${T.id})'.`,B)}else Xt("receive-request",T)}function Ct(T){if(!(v===yt.Off||!w||T.method===Uw.type.method))if(x===ji.Text){let B;v===yt.Verbose&&(T.params?B=`Params: ${JSON.stringify(T.params,null,4)}
|
||
|
||
`:B=`No parameters provided.
|
||
|
||
`),w.log(`Received notification '${T.method}'.`,B)}else Xt("receive-notification",T)}function Oi(T,B){if(!(v===yt.Off||!w))if(x===ji.Text){let V;if(v===yt.Verbose&&(T.error&&T.error.data?V=`Error data: ${JSON.stringify(T.error.data,null,4)}
|
||
|
||
`:T.result?V=`Result: ${JSON.stringify(T.result,null,4)}
|
||
|
||
`:T.error===void 0&&(V=`No result returned.
|
||
|
||
`)),B){let te=T.error?` Request failed: ${T.error.message} (${T.error.code}).`:"";w.log(`Received response '${B.method} - (${T.id})' in ${Date.now()-B.timerStart}ms.${te}`,V)}else w.log(`Received response ${T.id} without active response promise.`,V)}else Xt("receive-response",T)}function Xt(T,B){if(!w||v===yt.Off)return;let V={isLSPMessage:!0,type:T,message:B,timestamp:Date.now()};w.log(V)}function qt(){if(Pe())throw new Ws(Gh.Closed,"Connection is closed.");if(We())throw new Ws(Gh.Disposed,"Connection is disposed.")}function Py(){if(ae())throw new Ws(Gh.AlreadyListening,"Connection is already listening")}function Sd(){if(!ae())throw new Error("Call listen() first.")}function Oa(T){return T===void 0?null:T}function MP(T,B){let V,te=T.numberOfParams;switch(te){case 0:V=null;break;case 1:V=Oa(B[0]);break;default:V=[];for(let Qe=0;Qe<B.length&&Qe<te;Qe++)V.push(Oa(B[Qe]));if(B.length<te)for(let Qe=B.length;Qe<te;Qe++)V.push(null);break}return V}let La={sendNotification:(T,...B)=>{qt();let V,te;if(jt.string(T))switch(V=T,B.length){case 0:te=null;break;case 1:te=B[0];break;default:te=B;break}else V=T.method,te=MP(T,B);let Qe={jsonrpc:a,method:V,params:te};ve(Qe),e.write(Qe)},onNotification:(T,B)=>{qt(),jt.func(T)?c=T:B&&(jt.string(T)?f[T]={type:void 0,handler:B}:f[T.method]={type:T,handler:B})},onProgress:(T,B,V)=>{if(p.has(B))throw new Error(`Progress handler for token ${B} already registered`);return p.set(B,V),{dispose:()=>{p.delete(B)}}},sendProgress:(T,B,V)=>{La.sendNotification(zh.type,{token:B,value:V})},onUnhandledProgress:O.event,sendRequest:(T,...B)=>{qt(),Sd();let V,te,Qe;if(jt.string(T))switch(V=T,B.length){case 0:te=null;break;case 1:hl.CancellationToken.is(B[0])?(te=null,Qe=B[0]):te=Oa(B[0]);break;default:let _t=B.length-1;hl.CancellationToken.is(B[_t])?(Qe=B[_t],B.length===2?te=Oa(B[0]):te=B.slice(0,_t).map(tt=>Oa(tt))):te=B.map(tt=>Oa(tt));break}else{V=T.method,te=MP(T,B);let _t=T.numberOfParams;Qe=hl.CancellationToken.is(B[_t])?B[_t]:void 0}let si=n++,ln=new Promise((_t,tt)=>{let hr={jsonrpc:a,id:si,method:V,params:te},rt={method:V,timerStart:Date.now(),resolve:_t,reject:tt};Se(hr);try{e.write(hr)}catch(Zt){rt.reject(new ne.ResponseError(ne.ErrorCodes.MessageWriteError,Zt.message?Zt.message:"Unknown reason")),rt=null}rt&&(m[String(si)]=rt)});return Qe&&Qe.onCancellationRequested(()=>{La.sendNotification(of.type,{id:si})}),ln},onRequest:(T,B)=>{qt(),jt.func(T)?l=T:B&&(jt.string(T)?u[T]={type:void 0,handler:B}:u[T.method]={type:T,handler:B})},trace:(T,B,V)=>{let te=!1,Qe=ji.Text;V!==void 0&&(jt.boolean(V)?te=V:(te=V.sendNotification||!1,Qe=V.traceFormat||ji.Text)),v=T,x=Qe,v===yt.Off?w=void 0:w=B,te&&!Pe()&&!We()&&La.sendNotification(tN.type,{value:yt.toString(T)})},onError:P.event,onClose:k.event,onUnhandledNotification:_.event,onDispose:I.event,dispose:()=>{if(We())return;E=Ui.Disposed,I.fire(void 0);let T=new Error("Connection got disposed.");Object.keys(m).forEach(B=>{m[B].reject(T)}),m=Object.create(null),y=Object.create(null),h=new QM.LinkedMap,jt.func(e.dispose)&&e.dispose(),jt.func(r.dispose)&&r.dispose()},listen:()=>{qt(),Py(),E=Ui.Listening,r.listen(Cy)},inspect:()=>{console.log("inspect")}};return La.onNotification(Uw.type,T=>{v===yt.Off||!w||w.log(T.message,v===yt.Verbose?T.verbose:void 0)}),La.onNotification(zh.type,T=>{let B=p.get(T.token);B?B(T.value):O.fire(T)}),La}function Pse(r){return r.listen!==void 0&&r.read===void 0}function Tse(r){return r.write!==void 0&&r.end===void 0}function Rse(r,e,t,i){t||(t=Q.NullLogger);let n=Pse(r)?r:new rf.StreamMessageReader(r),o=Tse(e)?e:new nf.StreamMessageWriter(e);return _se(n,o,t,i)}Q.createMessageConnection=Rse});var jn=g(kse=>{fo(kse,{CodeAction:()=>hx,CodeActionContext:()=>dx,CodeActionKind:()=>px,CodeLens:()=>mx,Color:()=>Kh,ColorInformation:()=>Hw,ColorPresentation:()=>zw,Command:()=>ml,CompletionItem:()=>tx,CompletionItemKind:()=>Zw,CompletionItemTag:()=>ex,CompletionList:()=>rx,CreateFile:()=>uf,DeleteFile:()=>ff,Diagnostic:()=>sf,DiagnosticRelatedInformation:()=>Jh,DiagnosticSeverity:()=>Kw,DiagnosticTag:()=>Jw,DocumentHighlight:()=>ax,DocumentHighlightKind:()=>sx,DocumentLink:()=>vx,DocumentSymbol:()=>fx,EOL:()=>Fse,FoldingRange:()=>Vw,FoldingRangeKind:()=>Gw,FormattingOptions:()=>gx,Hover:()=>ix,InsertTextFormat:()=>Qw,Location:()=>Vh,LocationLink:()=>Ww,MarkedString:()=>pf,MarkupContent:()=>Zh,MarkupKind:()=>gl,ParameterInformation:()=>nx,Position:()=>Wi,Range:()=>ir,RenameFile:()=>cf,SelectionRange:()=>yx,SignatureInformation:()=>ox,SymbolInformation:()=>cx,SymbolKind:()=>lx,SymbolTag:()=>ux,TextDocument:()=>bx,TextDocumentEdit:()=>af,TextDocumentIdentifier:()=>Yw,TextDocumentItem:()=>Xw,TextEdit:()=>Io,VersionedTextDocumentIdentifier:()=>lf,WorkspaceChange:()=>Ise,WorkspaceEdit:()=>Yh});"use strict";var Wi;(function(r){function e(i,n){return{line:i,character:n}}r.create=e;function t(i){var n=i;return N.objectLiteral(n)&&N.number(n.line)&&N.number(n.character)}r.is=t})(Wi||(Wi={}));var ir;(function(r){function e(i,n,o,s){if(N.number(i)&&N.number(n)&&N.number(o)&&N.number(s))return{start:Wi.create(i,n),end:Wi.create(o,s)};if(Wi.is(i)&&Wi.is(n))return{start:i,end:n};throw new Error("Range#create called with invalid arguments["+i+", "+n+", "+o+", "+s+"]")}r.create=e;function t(i){var n=i;return N.objectLiteral(n)&&Wi.is(n.start)&&Wi.is(n.end)}r.is=t})(ir||(ir={}));var Vh;(function(r){function e(i,n){return{uri:i,range:n}}r.create=e;function t(i){var n=i;return N.defined(n)&&ir.is(n.range)&&(N.string(n.uri)||N.undefined(n.uri))}r.is=t})(Vh||(Vh={}));var Ww;(function(r){function e(i,n,o,s){return{targetUri:i,targetRange:n,targetSelectionRange:o,originSelectionRange:s}}r.create=e;function t(i){var n=i;return N.defined(n)&&ir.is(n.targetRange)&&N.string(n.targetUri)&&(ir.is(n.targetSelectionRange)||N.undefined(n.targetSelectionRange))&&(ir.is(n.originSelectionRange)||N.undefined(n.originSelectionRange))}r.is=t})(Ww||(Ww={}));var Kh;(function(r){function e(i,n,o,s){return{red:i,green:n,blue:o,alpha:s}}r.create=e;function t(i){var n=i;return N.number(n.red)&&N.number(n.green)&&N.number(n.blue)&&N.number(n.alpha)}r.is=t})(Kh||(Kh={}));var Hw;(function(r){function e(i,n){return{range:i,color:n}}r.create=e;function t(i){var n=i;return ir.is(n.range)&&Kh.is(n.color)}r.is=t})(Hw||(Hw={}));var zw;(function(r){function e(i,n,o){return{label:i,textEdit:n,additionalTextEdits:o}}r.create=e;function t(i){var n=i;return N.string(n.label)&&(N.undefined(n.textEdit)||Io.is(n))&&(N.undefined(n.additionalTextEdits)||N.typedArray(n.additionalTextEdits,Io.is))}r.is=t})(zw||(zw={}));var Gw;(function(r){r.Comment="comment",r.Imports="imports",r.Region="region"})(Gw||(Gw={}));var Vw;(function(r){function e(i,n,o,s,a){var l={startLine:i,endLine:n};return N.defined(o)&&(l.startCharacter=o),N.defined(s)&&(l.endCharacter=s),N.defined(a)&&(l.kind=a),l}r.create=e;function t(i){var n=i;return N.number(n.startLine)&&N.number(n.startLine)&&(N.undefined(n.startCharacter)||N.number(n.startCharacter))&&(N.undefined(n.endCharacter)||N.number(n.endCharacter))&&(N.undefined(n.kind)||N.string(n.kind))}r.is=t})(Vw||(Vw={}));var Jh;(function(r){function e(i,n){return{location:i,message:n}}r.create=e;function t(i){var n=i;return N.defined(n)&&Vh.is(n.location)&&N.string(n.message)}r.is=t})(Jh||(Jh={}));var Kw;(function(r){r.Error=1,r.Warning=2,r.Information=3,r.Hint=4})(Kw||(Kw={}));var Jw;(function(r){r.Unnecessary=1,r.Deprecated=2})(Jw||(Jw={}));var sf;(function(r){function e(i,n,o,s,a,l){var u={range:i,message:n};return N.defined(o)&&(u.severity=o),N.defined(s)&&(u.code=s),N.defined(a)&&(u.source=a),N.defined(l)&&(u.relatedInformation=l),u}r.create=e;function t(i){var n=i;return N.defined(n)&&ir.is(n.range)&&N.string(n.message)&&(N.number(n.severity)||N.undefined(n.severity))&&(N.number(n.code)||N.string(n.code)||N.undefined(n.code))&&(N.string(n.source)||N.undefined(n.source))&&(N.undefined(n.relatedInformation)||N.typedArray(n.relatedInformation,Jh.is))}r.is=t})(sf||(sf={}));var ml;(function(r){function e(i,n){for(var o=[],s=2;s<arguments.length;s++)o[s-2]=arguments[s];var a={title:i,command:n};return N.defined(o)&&o.length>0&&(a.arguments=o),a}r.create=e;function t(i){var n=i;return N.defined(n)&&N.string(n.title)&&N.string(n.command)}r.is=t})(ml||(ml={}));var Io;(function(r){function e(o,s){return{range:o,newText:s}}r.replace=e;function t(o,s){return{range:{start:o,end:o},newText:s}}r.insert=t;function i(o){return{range:o,newText:""}}r.del=i;function n(o){var s=o;return N.objectLiteral(s)&&N.string(s.newText)&&ir.is(s.range)}r.is=n})(Io||(Io={}));var af;(function(r){function e(i,n){return{textDocument:i,edits:n}}r.create=e;function t(i){var n=i;return N.defined(n)&&lf.is(n.textDocument)&&Array.isArray(n.edits)}r.is=t})(af||(af={}));var uf;(function(r){function e(i,n){var o={kind:"create",uri:i};return n!==void 0&&(n.overwrite!==void 0||n.ignoreIfExists!==void 0)&&(o.options=n),o}r.create=e;function t(i){var n=i;return n&&n.kind==="create"&&N.string(n.uri)&&(n.options===void 0||(n.options.overwrite===void 0||N.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||N.boolean(n.options.ignoreIfExists)))}r.is=t})(uf||(uf={}));var cf;(function(r){function e(i,n,o){var s={kind:"rename",oldUri:i,newUri:n};return o!==void 0&&(o.overwrite!==void 0||o.ignoreIfExists!==void 0)&&(s.options=o),s}r.create=e;function t(i){var n=i;return n&&n.kind==="rename"&&N.string(n.oldUri)&&N.string(n.newUri)&&(n.options===void 0||(n.options.overwrite===void 0||N.boolean(n.options.overwrite))&&(n.options.ignoreIfExists===void 0||N.boolean(n.options.ignoreIfExists)))}r.is=t})(cf||(cf={}));var ff;(function(r){function e(i,n){var o={kind:"delete",uri:i};return n!==void 0&&(n.recursive!==void 0||n.ignoreIfNotExists!==void 0)&&(o.options=n),o}r.create=e;function t(i){var n=i;return n&&n.kind==="delete"&&N.string(n.uri)&&(n.options===void 0||(n.options.recursive===void 0||N.boolean(n.options.recursive))&&(n.options.ignoreIfNotExists===void 0||N.boolean(n.options.ignoreIfNotExists)))}r.is=t})(ff||(ff={}));var Yh;(function(r){function e(t){var i=t;return i&&(i.changes!==void 0||i.documentChanges!==void 0)&&(i.documentChanges===void 0||i.documentChanges.every(function(n){return N.string(n.kind)?uf.is(n)||cf.is(n)||ff.is(n):af.is(n)}))}r.is=e})(Yh||(Yh={}));var Xh=function(){function r(e){this.edits=e}return r.prototype.insert=function(e,t){this.edits.push(Io.insert(e,t))},r.prototype.replace=function(e,t){this.edits.push(Io.replace(e,t))},r.prototype.delete=function(e){this.edits.push(Io.del(e))},r.prototype.add=function(e){this.edits.push(e)},r.prototype.all=function(){return this.edits},r.prototype.clear=function(){this.edits.splice(0,this.edits.length)},r}(),Ise=function(){function r(e){var t=this;this._textEditChanges=Object.create(null),e&&(this._workspaceEdit=e,e.documentChanges?e.documentChanges.forEach(function(i){if(af.is(i)){var n=new Xh(i.edits);t._textEditChanges[i.textDocument.uri]=n}}):e.changes&&Object.keys(e.changes).forEach(function(i){var n=new Xh(e.changes[i]);t._textEditChanges[i]=n}))}return Object.defineProperty(r.prototype,"edit",{get:function(){return this._workspaceEdit},enumerable:!0,configurable:!0}),r.prototype.getTextEditChange=function(e){if(lf.is(e)){if(this._workspaceEdit||(this._workspaceEdit={documentChanges:[]}),!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t=e,i=this._textEditChanges[t.uri];if(!i){var n=[],o={textDocument:t,edits:n};this._workspaceEdit.documentChanges.push(o),i=new Xh(n),this._textEditChanges[t.uri]=i}return i}else{if(this._workspaceEdit||(this._workspaceEdit={changes:Object.create(null)}),!this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var i=this._textEditChanges[e];if(!i){var n=[];this._workspaceEdit.changes[e]=n,i=new Xh(n),this._textEditChanges[e]=i}return i}},r.prototype.createFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(uf.create(e,t))},r.prototype.renameFile=function(e,t,i){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(cf.create(e,t,i))},r.prototype.deleteFile=function(e,t){this.checkDocumentChanges(),this._workspaceEdit.documentChanges.push(ff.create(e,t))},r.prototype.checkDocumentChanges=function(){if(!this._workspaceEdit||!this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.")},r}(),Yw;(function(r){function e(i){return{uri:i}}r.create=e;function t(i){var n=i;return N.defined(n)&&N.string(n.uri)}r.is=t})(Yw||(Yw={}));var lf;(function(r){function e(i,n){return{uri:i,version:n}}r.create=e;function t(i){var n=i;return N.defined(n)&&N.string(n.uri)&&(n.version===null||N.number(n.version))}r.is=t})(lf||(lf={}));var Xw;(function(r){function e(i,n,o,s){return{uri:i,languageId:n,version:o,text:s}}r.create=e;function t(i){var n=i;return N.defined(n)&&N.string(n.uri)&&N.string(n.languageId)&&N.number(n.version)&&N.string(n.text)}r.is=t})(Xw||(Xw={}));var gl;(function(r){r.PlainText="plaintext",r.Markdown="markdown"})(gl||(gl={}));(function(r){function e(t){var i=t;return i===r.PlainText||i===r.Markdown}r.is=e})(gl||(gl={}));var Zh;(function(r){function e(t){var i=t;return N.objectLiteral(t)&&gl.is(i.kind)&&N.string(i.value)}r.is=e})(Zh||(Zh={}));var Zw;(function(r){r.Text=1,r.Method=2,r.Function=3,r.Constructor=4,r.Field=5,r.Variable=6,r.Class=7,r.Interface=8,r.Module=9,r.Property=10,r.Unit=11,r.Value=12,r.Enum=13,r.Keyword=14,r.Snippet=15,r.Color=16,r.File=17,r.Reference=18,r.Folder=19,r.EnumMember=20,r.Constant=21,r.Struct=22,r.Event=23,r.Operator=24,r.TypeParameter=25})(Zw||(Zw={}));var Qw;(function(r){r.PlainText=1,r.Snippet=2})(Qw||(Qw={}));var ex;(function(r){r.Deprecated=1})(ex||(ex={}));var tx;(function(r){function e(t){return{label:t}}r.create=e})(tx||(tx={}));var rx;(function(r){function e(t,i){return{items:t||[],isIncomplete:!!i}}r.create=e})(rx||(rx={}));var pf;(function(r){function e(i){return i.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}r.fromPlainText=e;function t(i){var n=i;return N.string(n)||N.objectLiteral(n)&&N.string(n.language)&&N.string(n.value)}r.is=t})(pf||(pf={}));var ix;(function(r){function e(t){var i=t;return!!i&&N.objectLiteral(i)&&(Zh.is(i.contents)||pf.is(i.contents)||N.typedArray(i.contents,pf.is))&&(t.range===void 0||ir.is(t.range))}r.is=e})(ix||(ix={}));var nx;(function(r){function e(t,i){return i?{label:t,documentation:i}:{label:t}}r.create=e})(nx||(nx={}));var ox;(function(r){function e(t,i){for(var n=[],o=2;o<arguments.length;o++)n[o-2]=arguments[o];var s={label:t};return N.defined(i)&&(s.documentation=i),N.defined(n)?s.parameters=n:s.parameters=[],s}r.create=e})(ox||(ox={}));var sx;(function(r){r.Text=1,r.Read=2,r.Write=3})(sx||(sx={}));var ax;(function(r){function e(t,i){var n={range:t};return N.number(i)&&(n.kind=i),n}r.create=e})(ax||(ax={}));var lx;(function(r){r.File=1,r.Module=2,r.Namespace=3,r.Package=4,r.Class=5,r.Method=6,r.Property=7,r.Field=8,r.Constructor=9,r.Enum=10,r.Interface=11,r.Function=12,r.Variable=13,r.Constant=14,r.String=15,r.Number=16,r.Boolean=17,r.Array=18,r.Object=19,r.Key=20,r.Null=21,r.EnumMember=22,r.Struct=23,r.Event=24,r.Operator=25,r.TypeParameter=26})(lx||(lx={}));var ux;(function(r){r.Deprecated=1})(ux||(ux={}));var cx;(function(r){function e(t,i,n,o,s){var a={name:t,kind:i,location:{uri:o,range:n}};return s&&(a.containerName=s),a}r.create=e})(cx||(cx={}));var fx;(function(r){function e(i,n,o,s,a,l){var u={name:i,detail:n,kind:o,range:s,selectionRange:a};return l!==void 0&&(u.children=l),u}r.create=e;function t(i){var n=i;return n&&N.string(n.name)&&N.number(n.kind)&&ir.is(n.range)&&ir.is(n.selectionRange)&&(n.detail===void 0||N.string(n.detail))&&(n.deprecated===void 0||N.boolean(n.deprecated))&&(n.children===void 0||Array.isArray(n.children))}r.is=t})(fx||(fx={}));var px;(function(r){r.Empty="",r.QuickFix="quickfix",r.Refactor="refactor",r.RefactorExtract="refactor.extract",r.RefactorInline="refactor.inline",r.RefactorRewrite="refactor.rewrite",r.Source="source",r.SourceOrganizeImports="source.organizeImports",r.SourceFixAll="source.fixAll"})(px||(px={}));var dx;(function(r){function e(i,n){var o={diagnostics:i};return n!=null&&(o.only=n),o}r.create=e;function t(i){var n=i;return N.defined(n)&&N.typedArray(n.diagnostics,sf.is)&&(n.only===void 0||N.typedArray(n.only,N.string))}r.is=t})(dx||(dx={}));var hx;(function(r){function e(i,n,o){var s={title:i};return ml.is(n)?s.command=n:s.edit=n,o!==void 0&&(s.kind=o),s}r.create=e;function t(i){var n=i;return n&&N.string(n.title)&&(n.diagnostics===void 0||N.typedArray(n.diagnostics,sf.is))&&(n.kind===void 0||N.string(n.kind))&&(n.edit!==void 0||n.command!==void 0)&&(n.command===void 0||ml.is(n.command))&&(n.isPreferred===void 0||N.boolean(n.isPreferred))&&(n.edit===void 0||Yh.is(n.edit))}r.is=t})(hx||(hx={}));var mx;(function(r){function e(i,n){var o={range:i};return N.defined(n)&&(o.data=n),o}r.create=e;function t(i){var n=i;return N.defined(n)&&ir.is(n.range)&&(N.undefined(n.command)||ml.is(n.command))}r.is=t})(mx||(mx={}));var gx;(function(r){function e(i,n){return{tabSize:i,insertSpaces:n}}r.create=e;function t(i){var n=i;return N.defined(n)&&N.number(n.tabSize)&&N.boolean(n.insertSpaces)}r.is=t})(gx||(gx={}));var vx;(function(r){function e(i,n,o){return{range:i,target:n,data:o}}r.create=e;function t(i){var n=i;return N.defined(n)&&ir.is(n.range)&&(N.undefined(n.target)||N.string(n.target))}r.is=t})(vx||(vx={}));var yx;(function(r){function e(i,n){return{range:i,parent:n}}r.create=e;function t(i){var n=i;return n!==void 0&&ir.is(n.range)&&(n.parent===void 0||r.is(n.parent))}r.is=t})(yx||(yx={}));var Fse=[`
|
||
`,`\r
|
||
`,"\r"],bx;(function(r){function e(o,s,a,l){return new Ase(o,s,a,l)}r.create=e;function t(o){var s=o;return!!(N.defined(s)&&N.string(s.uri)&&(N.undefined(s.languageId)||N.string(s.languageId))&&N.number(s.lineCount)&&N.func(s.getText)&&N.func(s.positionAt)&&N.func(s.offsetAt))}r.is=t;function i(o,s){for(var a=o.getText(),l=n(s,function(h,m){var y=h.range.start.line-m.range.start.line;return y===0?h.range.start.character-m.range.start.character:y}),u=a.length,c=l.length-1;c>=0;c--){var f=l[c],p=o.offsetAt(f.range.start),d=o.offsetAt(f.range.end);if(d<=u)a=a.substring(0,p)+f.newText+a.substring(d,a.length);else throw new Error("Overlapping edit");u=p}return a}r.applyEdits=i;function n(o,s){if(o.length<=1)return o;var a=o.length/2|0,l=o.slice(0,a),u=o.slice(a);n(l,s),n(u,s);for(var c=0,f=0,p=0;c<l.length&&f<u.length;){var d=s(l[c],u[f]);d<=0?o[p++]=l[c++]:o[p++]=u[f++]}for(;c<l.length;)o[p++]=l[c++];for(;f<u.length;)o[p++]=u[f++];return o}})(bx||(bx={}));var Ase=function(){function r(e,t,i,n){this._uri=e,this._languageId=t,this._version=i,this._content=n,this._lineOffsets=void 0}return Object.defineProperty(r.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),r.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},r.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},r.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var e=[],t=this._content,i=!0,n=0;n<t.length;n++){i&&(e.push(n),i=!1);var o=t.charAt(n);i=o==="\r"||o===`
|
||
`,o==="\r"&&n+1<t.length&&t.charAt(n+1)===`
|
||
`&&n++}i&&t.length>0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},r.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),i=0,n=t.length;if(n===0)return Wi.create(0,e);for(;i<n;){var o=Math.floor((i+n)/2);t[o]>e?n=o:i=o+1}var s=i-1;return Wi.create(s,e-t[s])},r.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],n=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(i+e.character,n),i)},Object.defineProperty(r.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),r}(),N;(function(r){var e=Object.prototype.toString;function t(c){return typeof c!="undefined"}r.defined=t;function i(c){return typeof c=="undefined"}r.undefined=i;function n(c){return c===!0||c===!1}r.boolean=n;function o(c){return e.call(c)==="[object String]"}r.string=o;function s(c){return e.call(c)==="[object Number]"}r.number=s;function a(c){return e.call(c)==="[object Function]"}r.func=a;function l(c){return c!==null&&typeof c=="object"}r.objectLiteral=l;function u(c,f){return Array.isArray(c)&&c.every(f)}r.typedArray=u})(N||(N={}))});var nN=g(Hi=>{"use strict";Object.defineProperty(Hi,"__esModule",{value:!0});function Ose(r){return r===!0||r===!1}Hi.boolean=Ose;function rN(r){return typeof r=="string"||r instanceof String}Hi.string=rN;function Lse(r){return typeof r=="number"||r instanceof Number}Hi.number=Lse;function Mse(r){return r instanceof Error}Hi.error=Mse;function Nse(r){return typeof r=="function"}Hi.func=Nse;function iN(r){return Array.isArray(r)}Hi.array=iN;function qse(r){return iN(r)&&r.every(e=>rN(e))}Hi.stringArray=qse;function $se(r,e){return Array.isArray(r)&&r.every(e)}Hi.typedArray=$se;function Bse(r){return r!==null&&typeof r=="object"}Hi.objectLiteral=Bse});var zr=g(vl=>{"use strict";Object.defineProperty(vl,"__esModule",{value:!0});var Qh=bi(),oN=class extends Qh.RequestType0{constructor(e){super(e)}};vl.ProtocolRequestType0=oN;var sN=class extends Qh.RequestType{constructor(e){super(e)}};vl.ProtocolRequestType=sN;var aN=class extends Qh.NotificationType{constructor(e){super(e)}};vl.ProtocolNotificationType=aN;var lN=class extends Qh.NotificationType0{constructor(e){super(e)}};vl.ProtocolNotificationType0=lN});var uN=g(em=>{"use strict";Object.defineProperty(em,"__esModule",{value:!0});var jse=bi(),Use=zr(),Wse;(function(r){r.method="textDocument/implementation",r.type=new Use.ProtocolRequestType(r.method),r.resultType=new jse.ProgressType})(Wse=em.ImplementationRequest||(em.ImplementationRequest={}))});var cN=g(tm=>{"use strict";Object.defineProperty(tm,"__esModule",{value:!0});var Hse=bi(),zse=zr(),Gse;(function(r){r.method="textDocument/typeDefinition",r.type=new zse.ProtocolRequestType(r.method),r.resultType=new Hse.ProgressType})(Gse=tm.TypeDefinitionRequest||(tm.TypeDefinitionRequest={}))});var pN=g(yl=>{"use strict";Object.defineProperty(yl,"__esModule",{value:!0});var fN=zr(),Vse;(function(r){r.type=new fN.ProtocolRequestType0("workspace/workspaceFolders")})(Vse=yl.WorkspaceFoldersRequest||(yl.WorkspaceFoldersRequest={}));var Kse;(function(r){r.type=new fN.ProtocolNotificationType("workspace/didChangeWorkspaceFolders")})(Kse=yl.DidChangeWorkspaceFoldersNotification||(yl.DidChangeWorkspaceFoldersNotification={}))});var dN=g(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});var Jse=zr(),Yse;(function(r){r.type=new Jse.ProtocolRequestType("workspace/configuration")})(Yse=rm.ConfigurationRequest||(rm.ConfigurationRequest={}))});var mN=g(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});var Xse=bi(),hN=zr(),Zse;(function(r){r.method="textDocument/documentColor",r.type=new hN.ProtocolRequestType(r.method),r.resultType=new Xse.ProgressType})(Zse=bl.DocumentColorRequest||(bl.DocumentColorRequest={}));var Qse;(function(r){r.type=new hN.ProtocolRequestType("textDocument/colorPresentation")})(Qse=bl.ColorPresentationRequest||(bl.ColorPresentationRequest={}))});var gN=g(wl=>{"use strict";Object.defineProperty(wl,"__esModule",{value:!0});var eae=bi(),tae=zr(),rae;(function(r){r.Comment="comment",r.Imports="imports",r.Region="region"})(rae=wl.FoldingRangeKind||(wl.FoldingRangeKind={}));var iae;(function(r){r.method="textDocument/foldingRange",r.type=new tae.ProtocolRequestType(r.method),r.resultType=new eae.ProgressType})(iae=wl.FoldingRangeRequest||(wl.FoldingRangeRequest={}))});var vN=g(im=>{"use strict";Object.defineProperty(im,"__esModule",{value:!0});var nae=bi(),oae=zr(),sae;(function(r){r.method="textDocument/declaration",r.type=new oae.ProtocolRequestType(r.method),r.resultType=new nae.ProgressType})(sae=im.DeclarationRequest||(im.DeclarationRequest={}))});var yN=g(nm=>{"use strict";Object.defineProperty(nm,"__esModule",{value:!0});var aae=bi(),lae=zr(),uae;(function(r){r.method="textDocument/selectionRange",r.type=new lae.ProtocolRequestType(r.method),r.resultType=new aae.ProgressType})(uae=nm.SelectionRangeRequest||(nm.SelectionRangeRequest={}))});var wN=g(Fo=>{"use strict";Object.defineProperty(Fo,"__esModule",{value:!0});var cae=bi(),bN=zr(),fae;(function(r){r.type=new cae.ProgressType})(fae=Fo.WorkDoneProgress||(Fo.WorkDoneProgress={}));var pae;(function(r){r.type=new bN.ProtocolRequestType("window/workDoneProgress/create")})(pae=Fo.WorkDoneProgressCreateRequest||(Fo.WorkDoneProgressCreateRequest={}));var dae;(function(r){r.type=new bN.ProtocolNotificationType("window/workDoneProgress/cancel")})(dae=Fo.WorkDoneProgressCancelNotification||(Fo.WorkDoneProgressCancelNotification={}))});var CN=g(M=>{"use strict";Object.defineProperty(M,"__esModule",{value:!0});var Ao=nN(),Un=bi(),pe=zr(),hae=uN();M.ImplementationRequest=hae.ImplementationRequest;var mae=cN();M.TypeDefinitionRequest=mae.TypeDefinitionRequest;var xN=pN();M.WorkspaceFoldersRequest=xN.WorkspaceFoldersRequest;M.DidChangeWorkspaceFoldersNotification=xN.DidChangeWorkspaceFoldersNotification;var gae=dN();M.ConfigurationRequest=gae.ConfigurationRequest;var DN=mN();M.DocumentColorRequest=DN.DocumentColorRequest;M.ColorPresentationRequest=DN.ColorPresentationRequest;var vae=gN();M.FoldingRangeRequest=vae.FoldingRangeRequest;var yae=vN();M.DeclarationRequest=yae.DeclarationRequest;var bae=yN();M.SelectionRangeRequest=bae.SelectionRangeRequest;var wx=wN();M.WorkDoneProgress=wx.WorkDoneProgress;M.WorkDoneProgressCreateRequest=wx.WorkDoneProgressCreateRequest;M.WorkDoneProgressCancelNotification=wx.WorkDoneProgressCancelNotification;var SN;(function(r){function e(t){let i=t;return Ao.string(i.language)||Ao.string(i.scheme)||Ao.string(i.pattern)}r.is=e})(SN=M.DocumentFilter||(M.DocumentFilter={}));var EN;(function(r){function e(t){if(!Array.isArray(t))return!1;for(let i of t)if(!Ao.string(i)&&!SN.is(i))return!1;return!0}r.is=e})(EN=M.DocumentSelector||(M.DocumentSelector={}));var wae;(function(r){r.type=new pe.ProtocolRequestType("client/registerCapability")})(wae=M.RegistrationRequest||(M.RegistrationRequest={}));var xae;(function(r){r.type=new pe.ProtocolRequestType("client/unregisterCapability")})(xae=M.UnregistrationRequest||(M.UnregistrationRequest={}));var Dae;(function(r){r.Create="create",r.Rename="rename",r.Delete="delete"})(Dae=M.ResourceOperationKind||(M.ResourceOperationKind={}));var Sae;(function(r){r.Abort="abort",r.Transactional="transactional",r.TextOnlyTransactional="textOnlyTransactional",r.Undo="undo"})(Sae=M.FailureHandlingKind||(M.FailureHandlingKind={}));var Eae;(function(r){function e(t){let i=t;return i&&Ao.string(i.id)&&i.id.length>0}r.hasId=e})(Eae=M.StaticRegistrationOptions||(M.StaticRegistrationOptions={}));var Cae;(function(r){function e(t){let i=t;return i&&(i.documentSelector===null||EN.is(i.documentSelector))}r.is=e})(Cae=M.TextDocumentRegistrationOptions||(M.TextDocumentRegistrationOptions={}));var _ae;(function(r){function e(i){let n=i;return Ao.objectLiteral(n)&&(n.workDoneProgress===void 0||Ao.boolean(n.workDoneProgress))}r.is=e;function t(i){let n=i;return n&&Ao.boolean(n.workDoneProgress)}r.hasWorkDoneProgress=t})(_ae=M.WorkDoneProgressOptions||(M.WorkDoneProgressOptions={}));var Pae;(function(r){r.type=new pe.ProtocolRequestType("initialize")})(Pae=M.InitializeRequest||(M.InitializeRequest={}));var Tae;(function(r){r.unknownProtocolVersion=1})(Tae=M.InitializeError||(M.InitializeError={}));var Rae;(function(r){r.type=new pe.ProtocolNotificationType("initialized")})(Rae=M.InitializedNotification||(M.InitializedNotification={}));var kae;(function(r){r.type=new pe.ProtocolRequestType0("shutdown")})(kae=M.ShutdownRequest||(M.ShutdownRequest={}));var Iae;(function(r){r.type=new pe.ProtocolNotificationType0("exit")})(Iae=M.ExitNotification||(M.ExitNotification={}));var Fae;(function(r){r.type=new pe.ProtocolNotificationType("workspace/didChangeConfiguration")})(Fae=M.DidChangeConfigurationNotification||(M.DidChangeConfigurationNotification={}));var Aae;(function(r){r.Error=1,r.Warning=2,r.Info=3,r.Log=4})(Aae=M.MessageType||(M.MessageType={}));var Oae;(function(r){r.type=new pe.ProtocolNotificationType("window/showMessage")})(Oae=M.ShowMessageNotification||(M.ShowMessageNotification={}));var Lae;(function(r){r.type=new pe.ProtocolRequestType("window/showMessageRequest")})(Lae=M.ShowMessageRequest||(M.ShowMessageRequest={}));var Mae;(function(r){r.type=new pe.ProtocolNotificationType("window/logMessage")})(Mae=M.LogMessageNotification||(M.LogMessageNotification={}));var Nae;(function(r){r.type=new pe.ProtocolNotificationType("telemetry/event")})(Nae=M.TelemetryEventNotification||(M.TelemetryEventNotification={}));var qae;(function(r){r.None=0,r.Full=1,r.Incremental=2})(qae=M.TextDocumentSyncKind||(M.TextDocumentSyncKind={}));var $ae;(function(r){r.method="textDocument/didOpen",r.type=new pe.ProtocolNotificationType(r.method)})($ae=M.DidOpenTextDocumentNotification||(M.DidOpenTextDocumentNotification={}));var Bae;(function(r){r.method="textDocument/didChange",r.type=new pe.ProtocolNotificationType(r.method)})(Bae=M.DidChangeTextDocumentNotification||(M.DidChangeTextDocumentNotification={}));var jae;(function(r){r.method="textDocument/didClose",r.type=new pe.ProtocolNotificationType(r.method)})(jae=M.DidCloseTextDocumentNotification||(M.DidCloseTextDocumentNotification={}));var Uae;(function(r){r.method="textDocument/didSave",r.type=new pe.ProtocolNotificationType(r.method)})(Uae=M.DidSaveTextDocumentNotification||(M.DidSaveTextDocumentNotification={}));var Wae;(function(r){r.Manual=1,r.AfterDelay=2,r.FocusOut=3})(Wae=M.TextDocumentSaveReason||(M.TextDocumentSaveReason={}));var Hae;(function(r){r.method="textDocument/willSave",r.type=new pe.ProtocolNotificationType(r.method)})(Hae=M.WillSaveTextDocumentNotification||(M.WillSaveTextDocumentNotification={}));var zae;(function(r){r.method="textDocument/willSaveWaitUntil",r.type=new pe.ProtocolRequestType(r.method)})(zae=M.WillSaveTextDocumentWaitUntilRequest||(M.WillSaveTextDocumentWaitUntilRequest={}));var Gae;(function(r){r.type=new pe.ProtocolNotificationType("workspace/didChangeWatchedFiles")})(Gae=M.DidChangeWatchedFilesNotification||(M.DidChangeWatchedFilesNotification={}));var Vae;(function(r){r.Created=1,r.Changed=2,r.Deleted=3})(Vae=M.FileChangeType||(M.FileChangeType={}));var Kae;(function(r){r.Create=1,r.Change=2,r.Delete=4})(Kae=M.WatchKind||(M.WatchKind={}));var Jae;(function(r){r.type=new pe.ProtocolNotificationType("textDocument/publishDiagnostics")})(Jae=M.PublishDiagnosticsNotification||(M.PublishDiagnosticsNotification={}));var Yae;(function(r){r.Invoked=1,r.TriggerCharacter=2,r.TriggerForIncompleteCompletions=3})(Yae=M.CompletionTriggerKind||(M.CompletionTriggerKind={}));var Xae;(function(r){r.method="textDocument/completion",r.type=new pe.ProtocolRequestType(r.method),r.resultType=new Un.ProgressType})(Xae=M.CompletionRequest||(M.CompletionRequest={}));var Zae;(function(r){r.method="completionItem/resolve",r.type=new pe.ProtocolRequestType(r.method)})(Zae=M.CompletionResolveRequest||(M.CompletionResolveRequest={}));var Qae;(function(r){r.method="textDocument/hover",r.type=new pe.ProtocolRequestType(r.method)})(Qae=M.HoverRequest||(M.HoverRequest={}));var ele;(function(r){r.Invoked=1,r.TriggerCharacter=2,r.ContentChange=3})(ele=M.SignatureHelpTriggerKind||(M.SignatureHelpTriggerKind={}));var tle;(function(r){r.method="textDocument/signatureHelp",r.type=new pe.ProtocolRequestType(r.method)})(tle=M.SignatureHelpRequest||(M.SignatureHelpRequest={}));var rle;(function(r){r.method="textDocument/definition",r.type=new pe.ProtocolRequestType(r.method),r.resultType=new Un.ProgressType})(rle=M.DefinitionRequest||(M.DefinitionRequest={}));var ile;(function(r){r.method="textDocument/references",r.type=new pe.ProtocolRequestType(r.method),r.resultType=new Un.ProgressType})(ile=M.ReferencesRequest||(M.ReferencesRequest={}));var nle;(function(r){r.method="textDocument/documentHighlight",r.type=new pe.ProtocolRequestType(r.method),r.resultType=new Un.ProgressType})(nle=M.DocumentHighlightRequest||(M.DocumentHighlightRequest={}));var ole;(function(r){r.method="textDocument/documentSymbol",r.type=new pe.ProtocolRequestType(r.method),r.resultType=new Un.ProgressType})(ole=M.DocumentSymbolRequest||(M.DocumentSymbolRequest={}));var sle;(function(r){r.method="textDocument/codeAction",r.type=new pe.ProtocolRequestType(r.method),r.resultType=new Un.ProgressType})(sle=M.CodeActionRequest||(M.CodeActionRequest={}));var ale;(function(r){r.method="workspace/symbol",r.type=new pe.ProtocolRequestType(r.method),r.resultType=new Un.ProgressType})(ale=M.WorkspaceSymbolRequest||(M.WorkspaceSymbolRequest={}));var lle;(function(r){r.type=new pe.ProtocolRequestType("textDocument/codeLens"),r.resultType=new Un.ProgressType})(lle=M.CodeLensRequest||(M.CodeLensRequest={}));var ule;(function(r){r.type=new pe.ProtocolRequestType("codeLens/resolve")})(ule=M.CodeLensResolveRequest||(M.CodeLensResolveRequest={}));var cle;(function(r){r.method="textDocument/documentLink",r.type=new pe.ProtocolRequestType(r.method),r.resultType=new Un.ProgressType})(cle=M.DocumentLinkRequest||(M.DocumentLinkRequest={}));var fle;(function(r){r.type=new pe.ProtocolRequestType("documentLink/resolve")})(fle=M.DocumentLinkResolveRequest||(M.DocumentLinkResolveRequest={}));var ple;(function(r){r.method="textDocument/formatting",r.type=new pe.ProtocolRequestType(r.method)})(ple=M.DocumentFormattingRequest||(M.DocumentFormattingRequest={}));var dle;(function(r){r.method="textDocument/rangeFormatting",r.type=new pe.ProtocolRequestType(r.method)})(dle=M.DocumentRangeFormattingRequest||(M.DocumentRangeFormattingRequest={}));var hle;(function(r){r.method="textDocument/onTypeFormatting",r.type=new pe.ProtocolRequestType(r.method)})(hle=M.DocumentOnTypeFormattingRequest||(M.DocumentOnTypeFormattingRequest={}));var mle;(function(r){r.method="textDocument/rename",r.type=new pe.ProtocolRequestType(r.method)})(mle=M.RenameRequest||(M.RenameRequest={}));var gle;(function(r){r.method="textDocument/prepareRename",r.type=new pe.ProtocolRequestType(r.method)})(gle=M.PrepareRenameRequest||(M.PrepareRenameRequest={}));var vle;(function(r){r.type=new pe.ProtocolRequestType("workspace/executeCommand")})(vle=M.ExecuteCommandRequest||(M.ExecuteCommandRequest={}));var yle;(function(r){r.type=new pe.ProtocolRequestType("workspace/applyEdit")})(yle=M.ApplyWorkspaceEditRequest||(M.ApplyWorkspaceEditRequest={}))});var _N=g(Oo=>{"use strict";Object.defineProperty(Oo,"__esModule",{value:!0});var xx=zr(),ble;(function(r){r.method="textDocument/prepareCallHierarchy",r.type=new xx.ProtocolRequestType(r.method)})(ble=Oo.CallHierarchyPrepareRequest||(Oo.CallHierarchyPrepareRequest={}));var wle;(function(r){r.method="callHierarchy/incomingCalls",r.type=new xx.ProtocolRequestType(r.method)})(wle=Oo.CallHierarchyIncomingCallsRequest||(Oo.CallHierarchyIncomingCallsRequest={}));var xle;(function(r){r.method="callHierarchy/outgoingCalls",r.type=new xx.ProtocolRequestType(r.method)})(xle=Oo.CallHierarchyOutgoingCallsRequest||(Oo.CallHierarchyOutgoingCallsRequest={}))});var PN=g(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});var Dx=zr(),Dle;(function(r){r.comment="comment",r.keyword="keyword",r.string="string",r.number="number",r.regexp="regexp",r.operator="operator",r.namespace="namespace",r.type="type",r.struct="struct",r.class="class",r.interface="interface",r.enum="enum",r.typeParameter="typeParameter",r.function="function",r.member="member",r.property="property",r.macro="macro",r.variable="variable",r.parameter="parameter",r.label="label"})(Dle=Rr.SemanticTokenTypes||(Rr.SemanticTokenTypes={}));var Sle;(function(r){r.documentation="documentation",r.declaration="declaration",r.definition="definition",r.reference="reference",r.static="static",r.abstract="abstract",r.deprecated="deprecated",r.async="async",r.volatile="volatile",r.readonly="readonly"})(Sle=Rr.SemanticTokenModifiers||(Rr.SemanticTokenModifiers={}));var Ele;(function(r){function e(t){let i=t;return i!==void 0&&(i.resultId===void 0||typeof i.resultId=="string")&&Array.isArray(i.data)&&(i.data.length===0||typeof i.data[0]=="number")}r.is=e})(Ele=Rr.SemanticTokens||(Rr.SemanticTokens={}));var Cle;(function(r){r.method="textDocument/semanticTokens",r.type=new Dx.ProtocolRequestType(r.method)})(Cle=Rr.SemanticTokensRequest||(Rr.SemanticTokensRequest={}));var _le;(function(r){r.method="textDocument/semanticTokens/edits",r.type=new Dx.ProtocolRequestType(r.method)})(_le=Rr.SemanticTokensEditsRequest||(Rr.SemanticTokensEditsRequest={}));var Ple;(function(r){r.method="textDocument/semanticTokens/range",r.type=new Dx.ProtocolRequestType(r.method)})(Ple=Rr.SemanticTokensRangeRequest||(Rr.SemanticTokensRangeRequest={}))});var W=g(_e=>{"use strict";function TN(r){for(var e in r)_e.hasOwnProperty(e)||(_e[e]=r[e])}Object.defineProperty(_e,"__esModule",{value:!0});var je=bi();_e.ErrorCodes=je.ErrorCodes;_e.ResponseError=je.ResponseError;_e.CancellationToken=je.CancellationToken;_e.CancellationTokenSource=je.CancellationTokenSource;_e.Disposable=je.Disposable;_e.Event=je.Event;_e.Emitter=je.Emitter;_e.Trace=je.Trace;_e.TraceFormat=je.TraceFormat;_e.SetTraceNotification=je.SetTraceNotification;_e.LogTraceNotification=je.LogTraceNotification;_e.RequestType=je.RequestType;_e.RequestType0=je.RequestType0;_e.NotificationType=je.NotificationType;_e.NotificationType0=je.NotificationType0;_e.MessageReader=je.MessageReader;_e.MessageWriter=je.MessageWriter;_e.ConnectionStrategy=je.ConnectionStrategy;_e.StreamMessageReader=je.StreamMessageReader;_e.StreamMessageWriter=je.StreamMessageWriter;_e.IPCMessageReader=je.IPCMessageReader;_e.IPCMessageWriter=je.IPCMessageWriter;_e.createClientPipeTransport=je.createClientPipeTransport;_e.createServerPipeTransport=je.createServerPipeTransport;_e.generateRandomPipeName=je.generateRandomPipeName;_e.createClientSocketTransport=je.createClientSocketTransport;_e.createServerSocketTransport=je.createServerSocketTransport;_e.ProgressType=je.ProgressType;TN(jn());TN(CN());var xl=_N(),Wn=PN(),Tle;(function(r){let e;(function(a){a.method=xl.CallHierarchyPrepareRequest.method,a.type=xl.CallHierarchyPrepareRequest.type})(e=r.CallHierarchyPrepareRequest||(r.CallHierarchyPrepareRequest={}));let t;(function(a){a.method=xl.CallHierarchyIncomingCallsRequest.method,a.type=xl.CallHierarchyIncomingCallsRequest.type})(t=r.CallHierarchyIncomingCallsRequest||(r.CallHierarchyIncomingCallsRequest={}));let i;(function(a){a.method=xl.CallHierarchyOutgoingCallsRequest.method,a.type=xl.CallHierarchyOutgoingCallsRequest.type})(i=r.CallHierarchyOutgoingCallsRequest||(r.CallHierarchyOutgoingCallsRequest={})),r.SemanticTokenTypes=Wn.SemanticTokenTypes,r.SemanticTokenModifiers=Wn.SemanticTokenModifiers,r.SemanticTokens=Wn.SemanticTokens;let n;(function(a){a.method=Wn.SemanticTokensRequest.method,a.type=Wn.SemanticTokensRequest.type})(n=r.SemanticTokensRequest||(r.SemanticTokensRequest={}));let o;(function(a){a.method=Wn.SemanticTokensEditsRequest.method,a.type=Wn.SemanticTokensEditsRequest.type})(o=r.SemanticTokensEditsRequest||(r.SemanticTokensEditsRequest={}));let s;(function(a){a.method=Wn.SemanticTokensRangeRequest.method,a.type=Wn.SemanticTokensRangeRequest.type})(s=r.SemanticTokensRangeRequest||(r.SemanticTokensRangeRequest={}))})(Tle=_e.Proposed||(_e.Proposed={}));function Rle(r,e,t,i){return je.createMessageConnection(r,e,t,i)}_e.createProtocolConnection=Rle});var Gr=g((ePe,RN)=>{function Sx(r,e,t){var i,n,o,s,a;e==null&&(e=100);function l(){var c=Date.now()-s;c<e&&c>=0?i=setTimeout(l,e-c):(i=null,t||(a=r.apply(o,n),o=n=null))}var u=function(){o=this,n=arguments,s=Date.now();var c=t&&!i;return i||(i=setTimeout(l,e)),c&&(a=r.apply(o,n),o=n=null),a};return u.clear=function(){i&&(clearTimeout(i),i=null)},u.flush=function(){i&&(a=r.apply(o,n),o=n=null,clearTimeout(i),i=null)},u}Sx.debounce=Sx;RN.exports=Sx});var IN=g((tPe,kN)=>{"use strict";var lt={rfc3986:{}};lt.generate=function(){var r="|",e="0-9",t="["+e+"]",i="a-zA-Z",n="["+i+"]";lt.rfc3986.cidr=t+r+"[1-2]"+t+r+"3[0-2]";var o=e+"A-Fa-f",s="["+o+"]",a=i+e+"-\\._~",l="!\\$&'\\(\\)\\*\\+,;=",u="%"+o,c=a+u+l+":@",f="["+c+"]",p="0?",d="(?:"+p+p+t+r+p+"[1-9]"+t+r+"1"+t+t+r+"2[0-4]"+t+r+"25[0-5])";lt.rfc3986.IPv4address="(?:"+d+"\\.){3}"+d;var h=s+"{1,4}",m="(?:"+h+":"+h+"|"+lt.rfc3986.IPv4address+")",y="(?:"+h+":){6}"+m,v="::(?:"+h+":){5}"+m,x="(?:"+h+")?::(?:"+h+":){4}"+m,w="(?:(?:"+h+":){0,1}"+h+")?::(?:"+h+":){3}"+m,E="(?:(?:"+h+":){0,2}"+h+")?::(?:"+h+":){2}"+m,P="(?:(?:"+h+":){0,3}"+h+")?::"+h+":"+m,k="(?:(?:"+h+":){0,4}"+h+")?::"+m,_="(?:(?:"+h+":){0,5}"+h+")?::"+h,O="(?:(?:"+h+":){0,6}"+h+")?::";lt.rfc3986.IPv6address="(?:"+y+r+v+r+x+r+w+r+E+r+P+r+k+r+_+r+O+")",lt.rfc3986.IPvFuture="v"+s+"+\\.["+a+l+":]+",lt.rfc3986.scheme=n+"["+i+e+"+-\\.]*";var I="["+a+u+l+":]*";lt.rfc3986.IPLiteral="\\[(?:"+lt.rfc3986.IPv6address+r+lt.rfc3986.IPvFuture+")\\]";var L="["+a+u+l+"]{0,255}",R="(?:"+lt.rfc3986.IPLiteral+r+lt.rfc3986.IPv4address+r+L+")",F=t+"*",q="(?:"+I+"@)?"+R+"(?::"+F+")?",K=f+"*",ae=f+"+",Pe="(?:\\/"+K+")*",We="\\/(?:"+ae+Pe+")?",Yt=ae+Pe;lt.rfc3986.hierPart="(?:(?:\\/\\/"+q+Pe+")"+r+We+r+Yt+")",lt.rfc3986.query="["+c+"\\/\\?]*(?=#|$)",lt.rfc3986.fragment="["+c+"\\/\\?]*",lt.rfc3986.uri="^(?:"+lt.rfc3986.scheme+":"+lt.rfc3986.hierPart+")(?:\\?"+lt.rfc3986.query+")?(?:#"+lt.rfc3986.fragment+")?$"};lt.generate();kN.exports=lt.rfc3986});var Ex=g((rPe,FN)=>{"use strict";var df=IN();function kle(r){return r.replace(/[\^\$\.\*\+\-\?\=\!\:\|\\\/\(\)\[\]\{\}\,]/g,"\\$&")}var hf={Uri:{createUriRegex:function(r){if(r=r||{},typeof r!="object"||Array.isArray(r))throw new Error("options must be an object");var e="";if(r.scheme){if(Array.isArray(r.scheme)||(r.scheme=[r.scheme]),r.scheme.length<=0)throw new Error("scheme must have at least 1 scheme specified");for(var t=0;t<r.scheme.length;++t){var i=r.scheme[t];if(!(i instanceof RegExp||typeof i=="string"))throw new Error("scheme must only contain Regular Expressions or Strings");if(e=e+(e?"|":""),i instanceof RegExp)e=e+i.source;else{if(!/[a-zA-Z][a-zA-Z0-9+-\.]*/.test(i))throw new Error("scheme at position "+t+" must be a valid scheme");e=e+kle(i)}}}var n="(?:"+(e||df.scheme)+")";return new RegExp("^(?:"+n+":"+df.hierPart+")(?:\\?"+df.query+")?(?:#"+df.fragment+")?$")},uriRegex:new RegExp(df.uri)}};hf.Uri.isValid=function(r){return hf.Uri.uriRegex.test(r)};FN.exports={createUriRegex:hf.Uri.createUriRegex,uriRegex:hf.Uri.uriRegex,isValid:hf.Uri.isValid}});var HN=g((nPe,BN)=>{BN.exports=jN;jN.sync=Ble;var UN=require("fs");function jle(r,e){var t=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!t||(t=t.split(";"),t.indexOf("")!==-1))return!0;for(var i=0;i<t.length;i++){var n=t[i].toLowerCase();if(n&&r.substr(-n.length).toLowerCase()===n)return!0}return!1}function WN(r,e,t){return!r.isSymbolicLink()&&!r.isFile()?!1:jle(e,t)}function jN(r,e,t){UN.stat(r,function(i,n){t(i,i?!1:WN(n,r,e))})}function Ble(r,e){return WN(UN.statSync(r),r,e)}});var JN=g((oPe,zN)=>{zN.exports=GN;GN.sync=Ule;var VN=require("fs");function GN(r,e,t){VN.stat(r,function(i,n){t(i,i?!1:KN(n,e))})}function Ule(r,e){return KN(VN.statSync(r),e)}function KN(r,e){return r.isFile()&&Wle(r,e)}function Wle(r,e){var t=r.mode,i=r.uid,n=r.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),u=parseInt("001",8),c=a|l,f=t&u||t&l&&n===s||t&a&&i===o||t&c&&o===0;return f}});var XN=g((aPe,YN)=>{var sPe=require("fs"),sm;process.platform==="win32"||global.TESTING_WINDOWS?sm=HN():sm=JN();YN.exports=_x;_x.sync=Hle;function _x(r,e,t){if(typeof e=="function"&&(t=e,e={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(i,n){_x(r,e||{},function(o,s){o?n(o):i(s)})})}sm(r,e||{},function(i,n){i&&(i.code==="EACCES"||e&&e.ignoreErrors)&&(i=null,n=!1),t(i,n)})}function Hle(r,e){try{return sm.sync(r,e||{})}catch(t){if(e&&e.ignoreErrors||t.code==="EACCES")return!1;throw t}}});var El=g((lPe,ZN)=>{var Sl=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",QN=require("path"),zle=Sl?";":":",eq=XN(),tq=r=>Object.assign(new Error(`not found: ${r}`),{code:"ENOENT"}),rq=(r,e)=>{let t=e.colon||zle,i=r.match(/\//)||Sl&&r.match(/\\/)?[""]:[...Sl?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(t)],n=Sl?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=Sl?n.split(t):[""];return Sl&&r.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:i,pathExt:o,pathExtExe:n}},iq=(r,e,t)=>{typeof e=="function"&&(t=e,e={}),e||(e={});let{pathEnv:i,pathExt:n,pathExtExe:o}=rq(r,e),s=[],a=u=>new Promise((c,f)=>{if(u===i.length)return e.all&&s.length?c(s):f(tq(r));let p=i[u],d=/^".*"$/.test(p)?p.slice(1,-1):p,h=QN.join(d,r),m=!d&&/^\.[\\\/]/.test(r)?r.slice(0,2)+h:h;c(l(m,u,0))}),l=(u,c,f)=>new Promise((p,d)=>{if(f===n.length)return p(a(c+1));let h=n[f];eq(u+h,{pathExt:o},(m,y)=>{if(!m&&y)if(e.all)s.push(u+h);else return p(u+h);return p(l(u,c,f+1))})});return t?a(0).then(u=>t(null,u),t):a(0)},Gle=(r,e)=>{e=e||{};let{pathEnv:t,pathExt:i,pathExtExe:n}=rq(r,e),o=[];for(let s=0;s<t.length;s++){let a=t[s],l=/^".*"$/.test(a)?a.slice(1,-1):a,u=QN.join(l,r),c=!l&&/^\.[\\\/]/.test(r)?r.slice(0,2)+u:u;for(let f=0;f<i.length;f++){let p=c+i[f];try{if(eq.sync(p,{pathExt:n}))if(e.all)o.push(p);else return p}catch(d){}}}if(e.all&&o.length)return o;if(e.nothrow)return null;throw tq(r)};ZN.exports=iq;iq.sync=Gle});var yf=g((wPe,hq)=>{var nue="2.0.0",oue=256,sue=Number.MAX_SAFE_INTEGER||9007199254740991,aue=16;hq.exports={SEMVER_SPEC_VERSION:nue,MAX_LENGTH:oue,MAX_SAFE_INTEGER:sue,MAX_SAFE_COMPONENT_LENGTH:aue}});var bf=g((xPe,mq)=>{var lue=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...r)=>console.error("SEMVER",...r):()=>{};mq.exports=lue});var zs=g((Mo,gq)=>{var{MAX_SAFE_COMPONENT_LENGTH:Lx}=yf(),uue=bf();Mo=gq.exports={};var cue=Mo.re=[],Y=Mo.src=[],X=Mo.t={},fue=0,de=(r,e,t)=>{let i=fue++;uue(i,e),X[r]=i,Y[i]=e,cue[i]=new RegExp(e,t?"g":void 0)};de("NUMERICIDENTIFIER","0|[1-9]\\d*");de("NUMERICIDENTIFIERLOOSE","[0-9]+");de("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");de("MAINVERSION",`(${Y[X.NUMERICIDENTIFIER]})\\.(${Y[X.NUMERICIDENTIFIER]})\\.(${Y[X.NUMERICIDENTIFIER]})`);de("MAINVERSIONLOOSE",`(${Y[X.NUMERICIDENTIFIERLOOSE]})\\.(${Y[X.NUMERICIDENTIFIERLOOSE]})\\.(${Y[X.NUMERICIDENTIFIERLOOSE]})`);de("PRERELEASEIDENTIFIER",`(?:${Y[X.NUMERICIDENTIFIER]}|${Y[X.NONNUMERICIDENTIFIER]})`);de("PRERELEASEIDENTIFIERLOOSE",`(?:${Y[X.NUMERICIDENTIFIERLOOSE]}|${Y[X.NONNUMERICIDENTIFIER]})`);de("PRERELEASE",`(?:-(${Y[X.PRERELEASEIDENTIFIER]}(?:\\.${Y[X.PRERELEASEIDENTIFIER]})*))`);de("PRERELEASELOOSE",`(?:-?(${Y[X.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${Y[X.PRERELEASEIDENTIFIERLOOSE]})*))`);de("BUILDIDENTIFIER","[0-9A-Za-z-]+");de("BUILD",`(?:\\+(${Y[X.BUILDIDENTIFIER]}(?:\\.${Y[X.BUILDIDENTIFIER]})*))`);de("FULLPLAIN",`v?${Y[X.MAINVERSION]}${Y[X.PRERELEASE]}?${Y[X.BUILD]}?`);de("FULL",`^${Y[X.FULLPLAIN]}$`);de("LOOSEPLAIN",`[v=\\s]*${Y[X.MAINVERSIONLOOSE]}${Y[X.PRERELEASELOOSE]}?${Y[X.BUILD]}?`);de("LOOSE",`^${Y[X.LOOSEPLAIN]}$`);de("GTLT","((?:<|>)?=?)");de("XRANGEIDENTIFIERLOOSE",`${Y[X.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);de("XRANGEIDENTIFIER",`${Y[X.NUMERICIDENTIFIER]}|x|X|\\*`);de("XRANGEPLAIN",`[v=\\s]*(${Y[X.XRANGEIDENTIFIER]})(?:\\.(${Y[X.XRANGEIDENTIFIER]})(?:\\.(${Y[X.XRANGEIDENTIFIER]})(?:${Y[X.PRERELEASE]})?${Y[X.BUILD]}?)?)?`);de("XRANGEPLAINLOOSE",`[v=\\s]*(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:\\.(${Y[X.XRANGEIDENTIFIERLOOSE]})(?:${Y[X.PRERELEASELOOSE]})?${Y[X.BUILD]}?)?)?`);de("XRANGE",`^${Y[X.GTLT]}\\s*${Y[X.XRANGEPLAIN]}$`);de("XRANGELOOSE",`^${Y[X.GTLT]}\\s*${Y[X.XRANGEPLAINLOOSE]}$`);de("COERCE",`(^|[^\\d])(\\d{1,${Lx}})(?:\\.(\\d{1,${Lx}}))?(?:\\.(\\d{1,${Lx}}))?(?:$|[^\\d])`);de("COERCERTL",Y[X.COERCE],!0);de("LONETILDE","(?:~>?)");de("TILDETRIM",`(\\s*)${Y[X.LONETILDE]}\\s+`,!0);Mo.tildeTrimReplace="$1~";de("TILDE",`^${Y[X.LONETILDE]}${Y[X.XRANGEPLAIN]}$`);de("TILDELOOSE",`^${Y[X.LONETILDE]}${Y[X.XRANGEPLAINLOOSE]}$`);de("LONECARET","(?:\\^)");de("CARETTRIM",`(\\s*)${Y[X.LONECARET]}\\s+`,!0);Mo.caretTrimReplace="$1^";de("CARET",`^${Y[X.LONECARET]}${Y[X.XRANGEPLAIN]}$`);de("CARETLOOSE",`^${Y[X.LONECARET]}${Y[X.XRANGEPLAINLOOSE]}$`);de("COMPARATORLOOSE",`^${Y[X.GTLT]}\\s*(${Y[X.LOOSEPLAIN]})$|^$`);de("COMPARATOR",`^${Y[X.GTLT]}\\s*(${Y[X.FULLPLAIN]})$|^$`);de("COMPARATORTRIM",`(\\s*)${Y[X.GTLT]}\\s*(${Y[X.LOOSEPLAIN]}|${Y[X.XRANGEPLAIN]})`,!0);Mo.comparatorTrimReplace="$1$2$3";de("HYPHENRANGE",`^\\s*(${Y[X.XRANGEPLAIN]})\\s+-\\s+(${Y[X.XRANGEPLAIN]})\\s*$`);de("HYPHENRANGELOOSE",`^\\s*(${Y[X.XRANGEPLAINLOOSE]})\\s+-\\s+(${Y[X.XRANGEPLAINLOOSE]})\\s*$`);de("STAR","(<|>)?=?\\s*\\*");de("GTE0","^\\s*>=\\s*0.0.0\\s*$");de("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")});var pm=g((DPe,vq)=>{var yq=/^[0-9]+$/,bq=(r,e)=>{let t=yq.test(r),i=yq.test(e);return t&&i&&(r=+r,e=+e),r===e?0:t&&!i?-1:i&&!t?1:r<e?-1:1},pue=(r,e)=>bq(e,r);vq.exports={compareIdentifiers:bq,rcompareIdentifiers:pue}});var nr=g((SPe,wq)=>{var dm=bf(),{MAX_LENGTH:xq,MAX_SAFE_INTEGER:hm}=yf(),{re:Dq,t:Sq}=zs(),{compareIdentifiers:wf}=pm(),wi=class{constructor(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof wi){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid Version: ${e}`);if(e.length>xq)throw new TypeError(`version is longer than ${xq} characters`);dm("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let i=e.trim().match(t.loose?Dq[Sq.LOOSE]:Dq[Sq.FULL]);if(!i)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+i[1],this.minor=+i[2],this.patch=+i[3],this.major>hm||this.major<0)throw new TypeError("Invalid major version");if(this.minor>hm||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>hm||this.patch<0)throw new TypeError("Invalid patch version");i[4]?this.prerelease=i[4].split(".").map(n=>{if(/^[0-9]+$/.test(n)){let o=+n;if(o>=0&&o<hm)return o}return n}):this.prerelease=[],this.build=i[5]?i[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(dm("SemVer.compare",this.version,this.options,e),!(e instanceof wi)){if(typeof e=="string"&&e===this.version)return 0;e=new wi(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof wi||(e=new wi(e,this.options)),wf(this.major,e.major)||wf(this.minor,e.minor)||wf(this.patch,e.patch)}comparePre(e){if(e instanceof wi||(e=new wi(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let i=this.prerelease[t],n=e.prerelease[t];if(dm("prerelease compare",t,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return wf(i,n)}while(++t)}compareBuild(e){e instanceof wi||(e=new wi(e,this.options));let t=0;do{let i=this.build[t],n=e.build[t];if(dm("prerelease compare",t,i,n),i===void 0&&n===void 0)return 0;if(n===void 0)return 1;if(i===void 0)return-1;if(i===n)continue;return wf(i,n)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",t),this.inc("pre",t);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);i===-1&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}};wq.exports=wi});var Gs=g((EPe,Eq)=>{var{MAX_LENGTH:due}=yf(),{re:Cq,t:_q}=zs(),Pq=nr(),hue=(r,e)=>{if((!e||typeof e!="object")&&(e={loose:!!e,includePrerelease:!1}),r instanceof Pq)return r;if(typeof r!="string"||r.length>due||!(e.loose?Cq[_q.LOOSE]:Cq[_q.FULL]).test(r))return null;try{return new Pq(r,e)}catch(i){return null}};Eq.exports=hue});var Rq=g((CPe,Tq)=>{var mue=Gs(),gue=(r,e)=>{let t=mue(r,e);return t?t.version:null};Tq.exports=gue});var Iq=g((_Pe,kq)=>{var vue=Gs(),yue=(r,e)=>{let t=vue(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null};kq.exports=yue});var Aq=g((PPe,Fq)=>{var bue=nr(),wue=(r,e,t,i)=>{typeof t=="string"&&(i=t,t=void 0);try{return new bue(r,t).inc(e,i).version}catch(n){return null}};Fq.exports=wue});var xi=g((TPe,Oq)=>{var Lq=nr(),xue=(r,e,t)=>new Lq(r,t).compare(new Lq(e,t));Oq.exports=xue});var mm=g((RPe,Mq)=>{var Due=xi(),Sue=(r,e,t)=>Due(r,e,t)===0;Mq.exports=Sue});var $q=g((kPe,Nq)=>{var qq=Gs(),Eue=mm(),Cue=(r,e)=>{if(Eue(r,e))return null;{let t=qq(r),i=qq(e),n=t.prerelease.length||i.prerelease.length,o=n?"pre":"",s=n?"prerelease":"";for(let a in t)if((a==="major"||a==="minor"||a==="patch")&&t[a]!==i[a])return o+a;return s}};Nq.exports=Cue});var jq=g((IPe,Bq)=>{var _ue=nr(),Pue=(r,e)=>new _ue(r,e).major;Bq.exports=Pue});var Wq=g((FPe,Uq)=>{var Tue=nr(),Rue=(r,e)=>new Tue(r,e).minor;Uq.exports=Rue});var zq=g((APe,Hq)=>{var kue=nr(),Iue=(r,e)=>new kue(r,e).patch;Hq.exports=Iue});var Vq=g((OPe,Gq)=>{var Fue=Gs(),Aue=(r,e)=>{let t=Fue(r,e);return t&&t.prerelease.length?t.prerelease:null};Gq.exports=Aue});var Jq=g((LPe,Kq)=>{var Oue=xi(),Lue=(r,e,t)=>Oue(e,r,t);Kq.exports=Lue});var Xq=g((MPe,Yq)=>{var Mue=xi(),Nue=(r,e)=>Mue(r,e,!0);Yq.exports=Nue});var gm=g((NPe,Zq)=>{var Qq=nr(),que=(r,e,t)=>{let i=new Qq(r,t),n=new Qq(e,t);return i.compare(n)||i.compareBuild(n)};Zq.exports=que});var t2=g((qPe,e2)=>{var $ue=gm(),Bue=(r,e)=>r.sort((t,i)=>$ue(t,i,e));e2.exports=Bue});var i2=g(($Pe,r2)=>{var jue=gm(),Uue=(r,e)=>r.sort((t,i)=>jue(i,t,e));r2.exports=Uue});var xf=g((BPe,n2)=>{var Wue=xi(),Hue=(r,e,t)=>Wue(r,e,t)>0;n2.exports=Hue});var vm=g((jPe,o2)=>{var zue=xi(),Gue=(r,e,t)=>zue(r,e,t)<0;o2.exports=Gue});var Mx=g((UPe,s2)=>{var Vue=xi(),Kue=(r,e,t)=>Vue(r,e,t)!==0;s2.exports=Kue});var ym=g((WPe,a2)=>{var Jue=xi(),Yue=(r,e,t)=>Jue(r,e,t)>=0;a2.exports=Yue});var bm=g((HPe,l2)=>{var Xue=xi(),Zue=(r,e,t)=>Xue(r,e,t)<=0;l2.exports=Zue});var Nx=g((zPe,u2)=>{var Que=mm(),ece=Mx(),tce=xf(),rce=ym(),ice=vm(),nce=bm(),oce=(r,e,t,i)=>{switch(e){case"===":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r===t;case"!==":return typeof r=="object"&&(r=r.version),typeof t=="object"&&(t=t.version),r!==t;case"":case"=":case"==":return Que(r,t,i);case"!=":return ece(r,t,i);case">":return tce(r,t,i);case">=":return rce(r,t,i);case"<":return ice(r,t,i);case"<=":return nce(r,t,i);default:throw new TypeError(`Invalid operator: ${e}`)}};u2.exports=oce});var f2=g((GPe,c2)=>{var sce=nr(),ace=Gs(),{re:wm,t:xm}=zs(),lce=(r,e)=>{if(r instanceof sce)return r;if(typeof r=="number"&&(r=String(r)),typeof r!="string")return null;e=e||{};let t=null;if(!e.rtl)t=r.match(wm[xm.COERCE]);else{let i;for(;(i=wm[xm.COERCERTL].exec(r))&&(!t||t.index+t[0].length!==r.length);)(!t||i.index+i[0].length!==t.index+t[0].length)&&(t=i),wm[xm.COERCERTL].lastIndex=i.index+i[1].length+i[2].length;wm[xm.COERCERTL].lastIndex=-1}return t===null?null:ace(`${t[2]}.${t[3]||"0"}.${t[4]||"0"}`,e)};c2.exports=lce});var Di=g((VPe,p2)=>{var Rl=class{constructor(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof Rl)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new Rl(e.raw,t);if(e instanceof qx)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(i=>this.parseRange(i.trim())).filter(i=>i.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map(e=>e.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let t=this.options.loose;e=e.trim();let i=t?or[Ut.HYPHENRANGELOOSE]:or[Ut.HYPHENRANGE];e=e.replace(i,mce(this.options.includePrerelease)),ft("hyphen replace",e),e=e.replace(or[Ut.COMPARATORTRIM],cce),ft("comparator trim",e,or[Ut.COMPARATORTRIM]),e=e.replace(or[Ut.TILDETRIM],fce),e=e.replace(or[Ut.CARETTRIM],pce),e=e.split(/\s+/).join(" ");let n=t?or[Ut.COMPARATORLOOSE]:or[Ut.COMPARATOR];return e.split(" ").map(o=>dce(o,this.options)).join(" ").split(/\s+/).map(o=>hce(o,this.options)).filter(this.options.loose?o=>!!o.match(n):()=>!0).map(o=>new qx(o,this.options))}intersects(e,t){if(!(e instanceof Rl))throw new TypeError("a Range is required");return this.set.some(i=>d2(i,t)&&e.set.some(n=>d2(n,t)&&i.every(o=>n.every(s=>o.intersects(s,t)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new uce(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(gce(this.set[t],e,this.options))return!0;return!1}};p2.exports=Rl;var qx=Df(),ft=bf(),uce=nr(),{re:or,t:Ut,comparatorTrimReplace:cce,tildeTrimReplace:fce,caretTrimReplace:pce}=zs(),d2=(r,e)=>{let t=!0,i=r.slice(),n=i.pop();for(;t&&i.length;)t=i.every(o=>n.intersects(o,e)),n=i.pop();return t},dce=(r,e)=>(ft("comp",r,e),r=yce(r,e),ft("caret",r),r=vce(r,e),ft("tildes",r),r=bce(r,e),ft("xrange",r),r=wce(r,e),ft("stars",r),r),br=r=>!r||r.toLowerCase()==="x"||r==="*",vce=(r,e)=>r.trim().split(/\s+/).map(t=>xce(t,e)).join(" "),xce=(r,e)=>{let t=e.loose?or[Ut.TILDELOOSE]:or[Ut.TILDE];return r.replace(t,(i,n,o,s,a)=>{ft("tilde",r,i,n,o,s,a);let l;return br(n)?l="":br(o)?l=`>=${n}.0.0 <${+n+1}.0.0-0`:br(s)?l=`>=${n}.${o}.0 <${n}.${+o+1}.0-0`:a?(ft("replaceTilde pr",a),l=`>=${n}.${o}.${s}-${a} <${n}.${+o+1}.0-0`):l=`>=${n}.${o}.${s} <${n}.${+o+1}.0-0`,ft("tilde return",l),l})},yce=(r,e)=>r.trim().split(/\s+/).map(t=>Dce(t,e)).join(" "),Dce=(r,e)=>{ft("caret",r,e);let t=e.loose?or[Ut.CARETLOOSE]:or[Ut.CARET],i=e.includePrerelease?"-0":"";return r.replace(t,(n,o,s,a,l)=>{ft("caret",r,n,o,s,a,l);let u;return br(o)?u="":br(s)?u=`>=${o}.0.0${i} <${+o+1}.0.0-0`:br(a)?o==="0"?u=`>=${o}.${s}.0${i} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.0${i} <${+o+1}.0.0-0`:l?(ft("replaceCaret pr",l),o==="0"?s==="0"?u=`>=${o}.${s}.${a}-${l} <${o}.${s}.${+a+1}-0`:u=`>=${o}.${s}.${a}-${l} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.${a}-${l} <${+o+1}.0.0-0`):(ft("no pr"),o==="0"?s==="0"?u=`>=${o}.${s}.${a}${i} <${o}.${s}.${+a+1}-0`:u=`>=${o}.${s}.${a}${i} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),ft("caret return",u),u})},bce=(r,e)=>(ft("replaceXRanges",r,e),r.split(/\s+/).map(t=>Sce(t,e)).join(" ")),Sce=(r,e)=>{r=r.trim();let t=e.loose?or[Ut.XRANGELOOSE]:or[Ut.XRANGE];return r.replace(t,(i,n,o,s,a,l)=>{ft("xRange",r,i,n,o,s,a,l);let u=br(o),c=u||br(s),f=c||br(a),p=f;return n==="="&&p&&(n=""),l=e.includePrerelease?"-0":"",u?n===">"||n==="<"?i="<0.0.0-0":i="*":n&&p?(c&&(s=0),a=0,n===">"?(n=">=",c?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):n==="<="&&(n="<",c?o=+o+1:s=+s+1),n==="<"&&(l="-0"),i=`${n+o}.${s}.${a}${l}`):c?i=`>=${o}.0.0${l} <${+o+1}.0.0-0`:f&&(i=`>=${o}.${s}.0${l} <${o}.${+s+1}.0-0`),ft("xRange return",i),i})},wce=(r,e)=>(ft("replaceStars",r,e),r.trim().replace(or[Ut.STAR],"")),hce=(r,e)=>(ft("replaceGTE0",r,e),r.trim().replace(or[e.includePrerelease?Ut.GTE0PRE:Ut.GTE0],"")),mce=r=>(e,t,i,n,o,s,a,l,u,c,f,p,d)=>(br(i)?t="":br(n)?t=`>=${i}.0.0${r?"-0":""}`:br(o)?t=`>=${i}.${n}.0${r?"-0":""}`:s?t=`>=${t}`:t=`>=${t}${r?"-0":""}`,br(u)?l="":br(c)?l=`<${+u+1}.0.0-0`:br(f)?l=`<${u}.${+c+1}.0-0`:p?l=`<=${u}.${c}.${f}-${p}`:r?l=`<${u}.${c}.${+f+1}-0`:l=`<=${l}`,`${t} ${l}`.trim()),gce=(r,e,t)=>{for(let i=0;i<r.length;i++)if(!r[i].test(e))return!1;if(e.prerelease.length&&!t.includePrerelease){for(let i=0;i<r.length;i++)if(ft(r[i].semver),r[i].semver!==qx.ANY&&r[i].semver.prerelease.length>0){let n=r[i].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}});var Df=g((KPe,h2)=>{var Sf=Symbol("SemVer ANY"),Ef=class{static get ANY(){return Sf}constructor(e,t){if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),e instanceof Ef){if(e.loose===!!t.loose)return e;e=e.value}Bx("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===Sf?this.value="":this.value=this.operator+this.semver.version,Bx("comp",this)}parse(e){let t=this.options.loose?m2[g2.COMPARATORLOOSE]:m2[g2.COMPARATOR],i=e.match(t);if(!i)throw new TypeError(`Invalid comparator: ${e}`);this.operator=i[1]!==void 0?i[1]:"",this.operator==="="&&(this.operator=""),i[2]?this.semver=new v2(i[2],this.options.loose):this.semver=Sf}toString(){return this.value}test(e){if(Bx("Comparator.test",e,this.options.loose),this.semver===Sf||e===Sf)return!0;if(typeof e=="string")try{e=new v2(e,this.options)}catch(t){return!1}return $x(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Ef))throw new TypeError("a Comparator is required");if((!t||typeof t!="object")&&(t={loose:!!t,includePrerelease:!1}),this.operator==="")return this.value===""?!0:new y2(e.value,t).test(this.value);if(e.operator==="")return e.value===""?!0:new y2(this.value,t).test(e.semver);let i=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">"),n=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<"),o=this.semver.version===e.semver.version,s=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<="),a=$x(this.semver,"<",e.semver,t)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),l=$x(this.semver,">",e.semver,t)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return i||n||o&&s||a||l}};h2.exports=Ef;var{re:m2,t:g2}=zs(),$x=Nx(),Bx=bf(),v2=nr(),y2=Di()});var Cf=g((JPe,b2)=>{var Ece=Di(),Cce=(r,e,t)=>{try{e=new Ece(e,t)}catch(i){return!1}return e.test(r)};b2.exports=Cce});var x2=g((YPe,w2)=>{var _ce=Di(),Pce=(r,e)=>new _ce(r,e).set.map(t=>t.map(i=>i.value).join(" ").trim().split(" "));w2.exports=Pce});var S2=g((XPe,D2)=>{var Tce=nr(),Rce=Di(),kce=(r,e,t)=>{let i=null,n=null,o=null;try{o=new Rce(e,t)}catch(s){return null}return r.forEach(s=>{o.test(s)&&(!i||n.compare(s)===-1)&&(i=s,n=new Tce(i,t))}),i};D2.exports=kce});var C2=g((ZPe,E2)=>{var Ice=nr(),Fce=Di(),Ace=(r,e,t)=>{let i=null,n=null,o=null;try{o=new Fce(e,t)}catch(s){return null}return r.forEach(s=>{o.test(s)&&(!i||n.compare(s)===1)&&(i=s,n=new Ice(i,t))}),i};E2.exports=Ace});var P2=g((QPe,_2)=>{var jx=nr(),Oce=Di(),Lce=xf(),Mce=(r,e)=>{r=new Oce(r,e);let t=new jx("0.0.0");if(r.test(t)||(t=new jx("0.0.0-0"),r.test(t)))return t;t=null;for(let i=0;i<r.set.length;++i)r.set[i].forEach(o=>{let s=new jx(o.semver.version);switch(o.operator){case">":s.prerelease.length===0?s.patch++:s.prerelease.push(0),s.raw=s.format();case"":case">=":(!t||Lce(t,s))&&(t=s);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}});return t&&r.test(t)?t:null};_2.exports=Mce});var R2=g((eTe,T2)=>{var Nce=Di(),qce=(r,e)=>{try{return new Nce(r,e).range||"*"}catch(t){return null}};T2.exports=qce});var Dm=g((tTe,k2)=>{var $ce=nr(),I2=Df(),{ANY:Bce}=I2,jce=Di(),Uce=Cf(),F2=xf(),A2=vm(),Wce=bm(),Hce=ym(),zce=(r,e,t,i)=>{r=new $ce(r,i),e=new jce(e,i);let n,o,s,a,l;switch(t){case">":n=F2,o=Wce,s=A2,a=">",l=">=";break;case"<":n=A2,o=Hce,s=F2,a="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Uce(r,e,i))return!1;for(let u=0;u<e.set.length;++u){let c=e.set[u],f=null,p=null;if(c.forEach(d=>{d.semver===Bce&&(d=new I2(">=0.0.0")),f=f||d,p=p||d,n(d.semver,f.semver,i)?f=d:s(d.semver,p.semver,i)&&(p=d)}),f.operator===a||f.operator===l||(!p.operator||p.operator===a)&&o(r,p.semver))return!1;if(p.operator===l&&s(r,p.semver))return!1}return!0};k2.exports=zce});var L2=g((rTe,O2)=>{var Gce=Dm(),Vce=(r,e,t)=>Gce(r,e,">",t);O2.exports=Vce});var N2=g((iTe,M2)=>{var Kce=Dm(),Jce=(r,e,t)=>Kce(r,e,"<",t);M2.exports=Jce});var B2=g((nTe,q2)=>{var $2=Di(),Yce=(r,e,t)=>(r=new $2(r,t),e=new $2(e,t),r.intersects(e));q2.exports=Yce});var U2=g((oTe,j2)=>{var Xce=Cf(),Zce=xi();j2.exports=(r,e,t)=>{let i=[],n=null,o=null,s=r.sort((c,f)=>Zce(c,f,t));for(let c of s)Xce(c,e,t)?(o=c,n||(n=c)):(o&&i.push([n,o]),o=null,n=null);n&&i.push([n,null]);let a=[];for(let[c,f]of i)c===f?a.push(c):!f&&c===s[0]?a.push("*"):f?c===s[0]?a.push(`<=${f}`):a.push(`${c} - ${f}`):a.push(`>=${c}`);let l=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return l.length<u.length?l:e}});var K2=g((sTe,W2)=>{var H2=Di(),{ANY:z2}=Df(),_f=Cf(),Ux=xi(),efe=(r,e,t)=>{r=new H2(r,t),e=new H2(e,t);let i=!1;e:for(let n of r.set){for(let o of e.set){let s=Qce(n,o,t);if(i=i||s!==null,s)continue e}if(i)return!1}return!0},Qce=(r,e,t)=>{if(r.length===1&&r[0].semver===z2)return e.length===1&&e[0].semver===z2;let i=new Set,n,o;for(let f of r)f.operator===">"||f.operator===">="?n=G2(n,f,t):f.operator==="<"||f.operator==="<="?o=V2(o,f,t):i.add(f.semver);if(i.size>1)return null;let s;if(n&&o){if(s=Ux(n.semver,o.semver,t),s>0)return null;if(s===0&&(n.operator!==">="||o.operator!=="<="))return null}for(let f of i){if(n&&!_f(f,String(n),t)||o&&!_f(f,String(o),t))return null;for(let p of e)if(!_f(f,String(p),t))return!1;return!0}let a,l,u,c;for(let f of e){if(c=c||f.operator===">"||f.operator===">=",u=u||f.operator==="<"||f.operator==="<=",n){if(f.operator===">"||f.operator===">="){if(a=G2(n,f,t),a===f)return!1}else if(n.operator===">="&&!_f(n.semver,String(f),t))return!1}if(o){if(f.operator==="<"||f.operator==="<="){if(l=V2(o,f,t),l===f)return!1}else if(o.operator==="<="&&!_f(o.semver,String(f),t))return!1}if(!f.operator&&(o||n)&&s!==0)return!1}return!(n&&u&&!o&&s!==0||o&&c&&!n&&s!==0)},G2=(r,e,t)=>{if(!r)return e;let i=Ux(r.semver,e.semver,t);return i>0?r:i<0||e.operator===">"&&r.operator===">="?e:r},V2=(r,e,t)=>{if(!r)return e;let i=Ux(r.semver,e.semver,t);return i<0?r:i>0||e.operator==="<"&&r.operator==="<="?e:r};W2.exports=efe});var Pf=g((aTe,J2)=>{var Wx=zs();J2.exports={re:Wx.re,src:Wx.src,tokens:Wx.t,SEMVER_SPEC_VERSION:yf().SEMVER_SPEC_VERSION,SemVer:nr(),compareIdentifiers:pm().compareIdentifiers,rcompareIdentifiers:pm().rcompareIdentifiers,parse:Gs(),valid:Rq(),clean:Iq(),inc:Aq(),diff:$q(),major:jq(),minor:Wq(),patch:zq(),prerelease:Vq(),compare:xi(),rcompare:Jq(),compareLoose:Xq(),compareBuild:gm(),sort:t2(),rsort:i2(),gt:xf(),lt:vm(),eq:mm(),neq:Mx(),gte:ym(),lte:bm(),cmp:Nx(),coerce:f2(),Comparator:Df(),Range:Di(),satisfies:Cf(),toComparators:x2(),maxSatisfying:S2(),minSatisfying:C2(),minVersion:P2(),validRange:R2(),outside:Dm(),gtr:L2(),ltr:N2(),intersects:B2(),simplifyRange:U2(),subset:K2()}});var kl=g((lTe,Hx)=>{function Y2(){return{baseUrl:null,breaks:!1,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 tfe(r){Hx.exports.defaults=r}Hx.exports={defaults:Y2(),getDefaults:Y2,changeDefaults:tfe}});var Vs=g((uTe,X2)=>{var rfe=/[&<>"']/,ife=/[&<>"']/g,nfe=/[<>"']|&(?!#?\w+;)/,ofe=/[<>"']|&(?!#?\w+;)/g,sfe={"&":"&","<":"<",">":">",'"':""","'":"'"},Z2=r=>sfe[r];function afe(r,e){if(e){if(rfe.test(r))return r.replace(ife,Z2)}else if(nfe.test(r))return r.replace(ofe,Z2);return r}var lfe=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function Q2(r){return r.replace(lfe,(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)):""))}var ufe=/(^|[^\[])\^/g;function cfe(r,e){r=r.source||r,e=e||"";let t={replace:(i,n)=>(n=n.source||n,n=n.replace(ufe,"$1"),r=r.replace(i,n),t),getRegex:()=>new RegExp(r,e)};return t}var ffe=/[^\w:]/g,pfe=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function dfe(r,e,t){if(r){let i;try{i=decodeURIComponent(Q2(t)).replace(ffe,"").toLowerCase()}catch(n){return null}if(i.indexOf("javascript:")===0||i.indexOf("vbscript:")===0||i.indexOf("data:")===0)return null}e&&!pfe.test(t)&&(t=e$(e,t));try{t=encodeURI(t).replace(/%25/g,"%")}catch(i){return null}return t}var Sm={},hfe=/^[^:]+:\/*[^/]*$/,mfe=/^([^:]+:)[\s\S]*$/,gfe=/^([^:]+:\/*[^/]*)[\s\S]*$/;function e$(r,e){Sm[" "+r]||(hfe.test(r)?Sm[" "+r]=r+"/":Sm[" "+r]=t$(r,"/",!0)),r=Sm[" "+r];let t=r.indexOf(":")===-1;return e.substring(0,2)==="//"?t?e:r.replace(mfe,"$1")+e:e.charAt(0)==="/"?t?e:r.replace(gfe,"$1")+e:r+e}var vfe={exec:function(){}};function yfe(r){let e=1,t,i;for(;e<arguments.length;e++){t=arguments[e];for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}return r}function bfe(r,e){let t=r.replace(/\|/g,(o,s,a)=>{let l=!1,u=s;for(;--u>=0&&a[u]==="\\";)l=!l;return l?"|":" |"}),i=t.split(/ \|/),n=0;if(i.length>e)i.splice(e);else for(;i.length<e;)i.push("");for(;n<i.length;n++)i[n]=i[n].trim().replace(/\\\|/g,"|");return i}function t$(r,e,t){let i=r.length;if(i===0)return"";let n=0;for(;n<i;){let o=r.charAt(i-n-1);if(o===e&&!t)n++;else if(o!==e&&t)n++;else break}return r.substr(0,i-n)}function wfe(r,e){if(r.indexOf(e[1])===-1)return-1;let t=r.length,i=0,n=0;for(;n<t;n++)if(r[n]==="\\")n++;else if(r[n]===e[0])i++;else if(r[n]===e[1]&&(i--,i<0))return n;return-1}function xfe(r){r&&r.sanitize&&!r.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function Dfe(r,e){if(e<1)return"";let t="";for(;e>1;)e&1&&(t+=r),e>>=1,r+=r;return t+r}X2.exports={escape:afe,unescape:Q2,edit:cfe,cleanUrl:dfe,resolveUrl:e$,noopTest:vfe,merge:yfe,splitCells:bfe,rtrim:t$,findClosingBracket:wfe,checkSanitizeDeprecation:xfe,repeatString:Dfe}});var zx=g((fTe,r$)=>{var{defaults:Sfe}=kl(),{rtrim:Efe,splitCells:Em,escape:Si,findClosingBracket:Cfe}=Vs();function i$(r,e,t){let i=e.href,n=e.title?Si(e.title):null,o=r[1].replace(/\\([\[\]])/g,"$1");return r[0].charAt(0)!=="!"?{type:"link",raw:t,href:i,title:n,text:o}:{type:"image",raw:t,href:i,title:n,text:Si(o)}}function _fe(r,e){let t=r.match(/^(\s+)(?:```)/);if(t===null)return e;let i=t[1];return e.split(`
|
||
`).map(n=>{let o=n.match(/^\s+/);if(o===null)return n;let[s]=o;return s.length>=i.length?n.slice(i.length):n}).join(`
|
||
`)}r$.exports=class{constructor(e){this.options=e||Sfe}space(e){let t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:`
|
||
`}}code(e,t){let i=this.rules.block.code.exec(e);if(i){let n=t[t.length-1];if(n&&n.type==="paragraph")return{raw:i[0],text:i[0].trimRight()};let o=i[0].replace(/^ {4}/gm,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?o:Efe(o,`
|
||
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let i=t[0],n=_fe(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[1].length,text:t[2]}}nptable(e){let t=this.rules.block.nptable.exec(e);if(t){let i={type:"table",header:Em(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split(`
|
||
`):[],raw:t[0]};if(i.header.length===i.align.length){let n=i.align.length,o;for(o=0;o<n;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(n=i.cells.length,o=0;o<n;o++)i.cells[o]=Em(i.cells[o],i.header.length);return i}}}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],text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let i=t[0],n=t[2],o=n.length>1,s={type:"list",raw:i,ordered:o,start:o?+n.slice(0,-1):"",loose:!1,items:[]},a=t[0].match(this.rules.block.item),l=!1,u,c,f,p,d,h,m,y,v=a.length;f=this.rules.block.listItemStart.exec(a[0]);for(let x=0;x<v;x++){if(u=a[x],i=u,x!==v-1){if(p=this.rules.block.listItemStart.exec(a[x+1]),p[1].length>f[0].length||p[1].length>3){a.splice(x,2,a[x]+`
|
||
`+a[x+1]),x--,v--;continue}else(!this.options.pedantic||this.options.smartLists?p[2][p[2].length-1]!==n[n.length-1]:o===(p[2].length===1))&&(d=a.slice(x+1).join(`
|
||
`),s.raw=s.raw.substring(0,s.raw.length-d.length),x=v-1);f=p}c=u.length,u=u.replace(/^ *([*+-]|\d+[.)]) ?/,""),~u.indexOf(`
|
||
`)&&(c-=u.length,u=this.options.pedantic?u.replace(/^ {1,4}/gm,""):u.replace(new RegExp("^ {1,"+c+"}","gm"),"")),h=l||/\n\n(?!\s*$)/.test(u),x!==v-1&&(l=u.charAt(u.length-1)===`
|
||
`,h||(h=l)),h&&(s.loose=!0),this.options.gfm&&(m=/^\[[ xX]\] /.test(u),y=void 0,m&&(y=u[1]!==" ",u=u.replace(/^\[[ xX]\] +/,""))),s.items.push({type:"list_item",raw:i,task:m,checked:y,loose:h,text:u})}return s}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:this.options.sanitize?"paragraph":"html",raw:t[0],pre:!this.options.sanitizer&&(t[1]==="pre"||t[1]==="script"||t[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):Si(t[0]):t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{tag:t[1].toLowerCase().replace(/\s+/g," "),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:Em(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split(`
|
||
`):[]};if(i.header.length===i.align.length){i.raw=t[0];let n=i.align.length,o;for(o=0;o<n;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(n=i.cells.length,o=0;o<n;o++)i.cells[o]=Em(i.cells[o].replace(/^ *\| *| *\| *$/g,""),i.header.length);return i}}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1]}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t)return{type:"paragraph",raw:t[0],text:t[1].charAt(t[1].length-1)===`
|
||
`?t[1].slice(0,-1):t[1]}}text(e,t){let i=this.rules.block.text.exec(e);if(i){let n=t[t.length-1];return n&&n.type==="text"?{raw:i[0],text:i[0]}:{type:"text",raw:i[0],text:i[0]}}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Si(t[1])}}tag(e,t,i){let n=this.rules.inline.tag.exec(e);if(n)return!t&&/^<a /i.test(n[0])?t=!0:t&&/^<\/a>/i.test(n[0])&&(t=!1),!i&&/^<(pre|code|kbd|script)(\s|>)/i.test(n[0])?i=!0:i&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(n[0])&&(i=!1),{type:this.options.sanitize?"text":"html",raw:n[0],inLink:t,inRawBlock:i,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):Si(n[0]):n[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let i=Cfe(t[2],"()");if(i>-1){let l=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,l).trim(),t[3]=""}let n=t[2],o="";if(this.options.pedantic){let a=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);a?(n=a[1],o=a[3]):o=""}else o=t[3]?t[3].slice(1,-1):"";return n=n.trim().replace(/^<([\s\S]*)>$/,"$1"),i$(t,{href:n&&n.replace(this.rules.inline._escapes,"$1"),title:o&&o.replace(this.rules.inline._escapes,"$1")},t[0])}}reflink(e,t){let i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){let n=(i[2]||i[1]).replace(/\s+/g," ");if(n=t[n.toLowerCase()],!n||!n.href){let s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return i$(i,n,i[0])}}strong(e,t,i=""){let n=this.rules.inline.strong.start.exec(e);if(n&&(!n[1]||n[1]&&(i===""||this.rules.inline.punctuation.exec(i)))){t=t.slice(-1*e.length);let o=n[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;o.lastIndex=0;let s;for(;(n=o.exec(t))!=null;)if(s=this.rules.inline.strong.middle.exec(t.slice(0,n.index+3)),s)return{type:"strong",raw:e.slice(0,s[0].length),text:e.slice(2,s[0].length-2)}}}em(e,t,i=""){let n=this.rules.inline.em.start.exec(e);if(n&&(!n[1]||n[1]&&(i===""||this.rules.inline.punctuation.exec(i)))){t=t.slice(-1*e.length);let o=n[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;o.lastIndex=0;let s;for(;(n=o.exec(t))!=null;)if(s=this.rules.inline.em.middle.exec(t.slice(0,n.index+2)),s)return{type:"em",raw:e.slice(0,s[0].length),text:e.slice(1,s[0].length-1)}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let i=t[2].replace(/\n/g," "),n=/[^ ]/.test(i),o=i.startsWith(" ")&&i.endsWith(" ");return n&&o&&(i=i.substring(1,i.length-1)),i=Si(i,!0),{type:"codespan",raw:t[0],text:i}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}}autolink(e,t){let i=this.rules.inline.autolink.exec(e);if(i){let n,o;return i[2]==="@"?(n=Si(this.options.mangle?t(i[1]):i[1]),o="mailto:"+n):(n=Si(i[1]),o=n),{type:"link",raw:i[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}url(e,t){let i;if(i=this.rules.inline.url.exec(e)){let n,o;if(i[2]==="@")n=Si(this.options.mangle?t(i[0]):i[0]),o="mailto:"+n;else{let s;do s=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0];while(s!==i[0]);n=Si(i[0]),i[1]==="www."?o="http://"+n:o=n}return{type:"link",raw:i[0],text:n,href:o,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(e,t,i){let n=this.rules.inline.text.exec(e);if(n){let o;return t?o=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):Si(n[0]):n[0]:o=Si(this.options.smartypants?i(n[0]):n[0]),{type:"text",raw:n[0],text:o}}}}});var o$=g((pTe,n$)=>{var{noopTest:Tf,edit:Te,merge:Ks}=Vs(),se={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:Tf,table:Tf,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};se._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/;se._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/;se.def=Te(se.def).replace("label",se._label).replace("title",se._title).getRegex();se.bullet=/(?:[*+-]|\d{1,9}[.)])/;se.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/;se.item=Te(se.item,"gm").replace(/bull/g,se.bullet).getRegex();se.listItemStart=Te(/^( *)(bull)/).replace("bull",se.bullet).getRegex();se.list=Te(se.list).replace(/bull/g,se.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+se.def.source+")").getRegex();se._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul";se._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/;se.html=Te(se.html,"i").replace("comment",se._comment).replace("tag",se._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex();se.paragraph=Te(se._paragraph).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",se._tag).getRegex();se.blockquote=Te(se.blockquote).replace("paragraph",se.paragraph).getRegex();se.normal=Ks({},se);se.gfm=Ks({},se.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"});se.gfm.nptable=Te(se.gfm.nptable).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",se._tag).getRegex();se.gfm.table=Te(se.gfm.table).replace("hr",se.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",se._tag).getRegex();se.pedantic=Ks({},se.normal,{html:Te(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",se._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Tf,paragraph:Te(se.normal._paragraph).replace("hr",se.hr).replace("heading",` *#{1,6} *[^
|
||
]`).replace("lheading",se.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var H={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Tf,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)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation_\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation*\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation_\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation*\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:Tf,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\s*punctuation])/};H._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~";H.punctuation=Te(H.punctuation).replace(/punctuation/g,H._punctuation).getRegex();H._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>";H._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*";H._comment=Te(se._comment).replace("(?:-->|$)","-->").getRegex();H.em.start=Te(H.em.start).replace(/punctuation/g,H._punctuation).getRegex();H.em.middle=Te(H.em.middle).replace(/punctuation/g,H._punctuation).replace(/overlapSkip/g,H._overlapSkip).getRegex();H.em.endAst=Te(H.em.endAst,"g").replace(/punctuation/g,H._punctuation).getRegex();H.em.endUnd=Te(H.em.endUnd,"g").replace(/punctuation/g,H._punctuation).getRegex();H.strong.start=Te(H.strong.start).replace(/punctuation/g,H._punctuation).getRegex();H.strong.middle=Te(H.strong.middle).replace(/punctuation/g,H._punctuation).replace(/overlapSkip/g,H._overlapSkip).getRegex();H.strong.endAst=Te(H.strong.endAst,"g").replace(/punctuation/g,H._punctuation).getRegex();H.strong.endUnd=Te(H.strong.endUnd,"g").replace(/punctuation/g,H._punctuation).getRegex();H.blockSkip=Te(H._blockSkip,"g").getRegex();H.overlapSkip=Te(H._overlapSkip,"g").getRegex();H._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g;H._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/;H._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])?)+(?![-_])/;H.autolink=Te(H.autolink).replace("scheme",H._scheme).replace("email",H._email).getRegex();H._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/;H.tag=Te(H.tag).replace("comment",H._comment).replace("attribute",H._attribute).getRegex();H._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/;H._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/;H._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;H.link=Te(H.link).replace("label",H._label).replace("href",H._href).replace("title",H._title).getRegex();H.reflink=Te(H.reflink).replace("label",H._label).getRegex();H.reflinkSearch=Te(H.reflinkSearch,"g").replace("reflink",H.reflink).replace("nolink",H.nolink).getRegex();H.normal=Ks({},H);H.pedantic=Ks({},H.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:Te(/^!?\[(label)\]\((.*?)\)/).replace("label",H._label).getRegex(),reflink:Te(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",H._label).getRegex()});H.gfm=Ks({},H.normal,{escape:Te(H.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)|[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/});H.gfm.url=Te(H.gfm.url,"i").replace("email",H.gfm._extended_email).getRegex();H.breaks=Ks({},H.gfm,{br:Te(H.br).replace("{2,}","*").getRegex(),text:Te(H.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});n$.exports={block:se,inline:H}});var u$=g((dTe,s$)=>{var Pfe=zx(),{defaults:Tfe}=kl(),{block:Cm,inline:Rf}=o$(),{repeatString:a$}=Vs();function Rfe(r){return r.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 l$(r){let e="",t,i,n=r.length;for(t=0;t<n;t++)i=r.charCodeAt(t),Math.random()>.5&&(i="x"+i.toString(16)),e+="&#"+i+";";return e}s$.exports=class Gx{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Tfe,this.options.tokenizer=this.options.tokenizer||new Pfe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;let t={block:Cm.normal,inline:Rf.normal};this.options.pedantic?(t.block=Cm.pedantic,t.inline=Rf.pedantic):this.options.gfm&&(t.block=Cm.gfm,this.options.breaks?t.inline=Rf.breaks:t.inline=Rf.gfm),this.tokenizer.rules=t}static get rules(){return{block:Cm,inline:Rf}}static lex(e,t){return new Gx(t).lex(e)}static lexInline(e,t){return new Gx(t).inlineTokens(e)}lex(e){return e=e.replace(/\r\n|\r/g,`
|
||
`).replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens}blockTokens(e,t=[],i=!0){e=e.replace(/^ +$/gm,"");let n,o,s,a;for(;e;){if(n=this.tokenizer.space(e)){e=e.substring(n.raw.length),n.type&&t.push(n);continue}if(n=this.tokenizer.code(e,t)){e=e.substring(n.raw.length),n.type?t.push(n):(a=t[t.length-1],a.raw+=`
|
||
`+n.raw,a.text+=`
|
||
`+n.text);continue}if(n=this.tokenizer.fences(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.heading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.nptable(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.hr(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.blockquote(e)){e=e.substring(n.raw.length),n.tokens=this.blockTokens(n.text,[],i),t.push(n);continue}if(n=this.tokenizer.list(e)){for(e=e.substring(n.raw.length),s=n.items.length,o=0;o<s;o++)n.items[o].tokens=this.blockTokens(n.items[o].text,[],!1);t.push(n);continue}if(n=this.tokenizer.html(e)){e=e.substring(n.raw.length),t.push(n);continue}if(i&&(n=this.tokenizer.def(e))){e=e.substring(n.raw.length),this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title});continue}if(n=this.tokenizer.table(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.lheading(e)){e=e.substring(n.raw.length),t.push(n);continue}if(i&&(n=this.tokenizer.paragraph(e))){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.text(e,t)){e=e.substring(n.raw.length),n.type?t.push(n):(a=t[t.length-1],a.raw+=`
|
||
`+n.raw,a.text+=`
|
||
`+n.text);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return t}inline(e){let t,i,n,o,s,a,l=e.length;for(t=0;t<l;t++)switch(a=e[t],a.type){case"paragraph":case"text":case"heading":{a.tokens=[],this.inlineTokens(a.text,a.tokens);break}case"table":{for(a.tokens={header:[],cells:[]},o=a.header.length,i=0;i<o;i++)a.tokens.header[i]=[],this.inlineTokens(a.header[i],a.tokens.header[i]);for(o=a.cells.length,i=0;i<o;i++)for(s=a.cells[i],a.tokens.cells[i]=[],n=0;n<s.length;n++)a.tokens.cells[i][n]=[],this.inlineTokens(s[n],a.tokens.cells[i][n]);break}case"blockquote":{this.inline(a.tokens);break}case"list":{for(o=a.items.length,i=0;i<o;i++)this.inline(a.items[i].tokens);break}default:}return e}inlineTokens(e,t=[],i=!1,n=!1){let 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)+"["+a$("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)+"["+a$("a",a[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;e;){if(l||(u=""),l=!1,o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e,i,n)){e=e.substring(o.raw.length),i=o.inLink,n=o.inRawBlock,t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),o.type==="link"&&(o.tokens=this.inlineTokens(o.text,[],!0,n)),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length),o.type==="link"&&(o.tokens=this.inlineTokens(o.text,[],!0,n)),t.push(o);continue}if(o=this.tokenizer.strong(e,s,u)){e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],i,n),t.push(o);continue}if(o=this.tokenizer.em(e,s,u)){e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],i,n),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),o.tokens=this.inlineTokens(o.text,[],i,n),t.push(o);continue}if(o=this.tokenizer.autolink(e,l$)){e=e.substring(o.raw.length),t.push(o);continue}if(!i&&(o=this.tokenizer.url(e,l$))){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.inlineText(e,n,Rfe)){e=e.substring(o.raw.length),u=o.raw.slice(-1),l=!0,t.push(o);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}}});var Vx=g((mTe,c$)=>{var{defaults:kfe}=kl(),{cleanUrl:f$,escape:_m}=Vs();c$.exports=class{constructor(e){this.options=e||kfe}code(e,t,i){let n=(t||"").match(/\S*/)[0];if(this.options.highlight){let o=this.options.highlight(e,n);o!=null&&o!==e&&(i=!0,e=o)}return n?'<pre><code class="'+this.options.langPrefix+_m(n,!0)+'">'+(i?e:_m(e,!0))+`</code></pre>
|
||
`:"<pre><code>"+(i?e:_m(e,!0))+`</code></pre>
|
||
`}blockquote(e){return`<blockquote>
|
||
`+e+`</blockquote>
|
||
`}html(e){return e}heading(e,t,i,n){return this.options.headerIds?"<h"+t+' id="'+this.options.headerPrefix+n.slug(i)+'">'+e+"</h"+t+`>
|
||
`:"<h"+t+">"+e+"</h"+t+`>
|
||
`}hr(){return this.options.xhtml?`<hr/>
|
||
`:`<hr>
|
||
`}list(e,t,i){let n=t?"ol":"ul",o=t&&i!==1?' start="'+i+'"':"";return"<"+n+o+`>
|
||
`+e+"</"+n+`>
|
||
`}listitem(e){return"<li>"+e+`</li>
|
||
`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return"<p>"+e+`</p>
|
||
`}table(e,t){return t&&(t="<tbody>"+t+"</tbody>"),`<table>
|
||
<thead>
|
||
`+e+`</thead>
|
||
`+t+`</table>
|
||
`}tablerow(e){return`<tr>
|
||
`+e+`</tr>
|
||
`}tablecell(e,t){let i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"</"+i+`>
|
||
`}strong(e){return"<strong>"+e+"</strong>"}em(e){return"<em>"+e+"</em>"}codespan(e){return"<code>"+e+"</code>"}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return"<del>"+e+"</del>"}link(e,t,i){if(e=f$(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let n='<a href="'+_m(e)+'"';return t&&(n+=' title="'+t+'"'),n+=">"+i+"</a>",n}image(e,t,i){if(e=f$(this.options.sanitize,this.options.baseUrl,e),e===null)return i;let n='<img src="'+e+'" alt="'+i+'"';return t&&(n+=' title="'+t+'"'),n+=this.options.xhtml?"/>":">",n}text(e){return e}}});var Kx=g((vTe,p$)=>{p$.exports=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""}}});var Jx=g((bTe,d$)=>{d$.exports=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,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do n++,i=e+"-"+n;while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i}slug(e,t={}){let i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)}}});var m$=g((wTe,h$)=>{var Ife=Vx(),Ffe=Kx(),Afe=Jx(),{defaults:Ofe}=kl(),{unescape:Lfe}=Vs();h$.exports=class Yx{constructor(e){this.options=e||Ofe,this.options.renderer=this.options.renderer||new Ife,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ffe,this.slugger=new Afe}static parse(e,t){return new Yx(t).parse(e)}static parseInline(e,t){return new Yx(t).parseInline(e)}parse(e,t=!0){let i="",n,o,s,a,l,u,c,f,p,d,h,m,y,v,x,w,E,P,k=e.length;for(n=0;n<k;n++)switch(d=e[n],d.type){case"space":continue;case"hr":{i+=this.renderer.hr();continue}case"heading":{i+=this.renderer.heading(this.parseInline(d.tokens),d.depth,Lfe(this.parseInline(d.tokens,this.textRenderer)),this.slugger);continue}case"code":{i+=this.renderer.code(d.text,d.lang,d.escaped);continue}case"table":{for(f="",c="",a=d.header.length,o=0;o<a;o++)c+=this.renderer.tablecell(this.parseInline(d.tokens.header[o]),{header:!0,align:d.align[o]});for(f+=this.renderer.tablerow(c),p="",a=d.cells.length,o=0;o<a;o++){for(u=d.tokens.cells[o],c="",l=u.length,s=0;s<l;s++)c+=this.renderer.tablecell(this.parseInline(u[s]),{header:!1,align:d.align[s]});p+=this.renderer.tablerow(c)}i+=this.renderer.table(f,p);continue}case"blockquote":{p=this.parse(d.tokens),i+=this.renderer.blockquote(p);continue}case"list":{for(h=d.ordered,m=d.start,y=d.loose,a=d.items.length,p="",o=0;o<a;o++)x=d.items[o],w=x.checked,E=x.task,v="",x.task&&(P=this.renderer.checkbox(w),y?x.tokens.length>0&&x.tokens[0].type==="text"?(x.tokens[0].text=P+" "+x.tokens[0].text,x.tokens[0].tokens&&x.tokens[0].tokens.length>0&&x.tokens[0].tokens[0].type==="text"&&(x.tokens[0].tokens[0].text=P+" "+x.tokens[0].tokens[0].text)):x.tokens.unshift({type:"text",text:P}):v+=P),v+=this.parse(x.tokens,y),p+=this.renderer.listitem(v,E,w);i+=this.renderer.list(p,h,m);continue}case"html":{i+=this.renderer.html(d.text);continue}case"paragraph":{i+=this.renderer.paragraph(this.parseInline(d.tokens));continue}case"text":{for(p=d.tokens?this.parseInline(d.tokens):d.text;n+1<k&&e[n+1].type==="text";)d=e[++n],p+=`
|
||
`+(d.tokens?this.parseInline(d.tokens):d.text);i+=t?this.renderer.paragraph(p):p;continue}default:{let _='Token with "'+d.type+'" type was not found.';if(this.options.silent){console.error(_);return}else throw new Error(_)}}return i}parseInline(e,t){t=t||this.renderer;let i="",n,o,s=e.length;for(n=0;n<s;n++)switch(o=e[n],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 a='Token with "'+o.type+'" type was not found.';if(this.options.silent){console.error(a);return}else throw new Error(a)}}return i}}});var x$=g((xTe,g$)=>{var kf=u$(),If=m$(),v$=zx(),y$=Vx(),Mfe=Kx(),Nfe=Jx(),{merge:Pm,checkSanitizeDeprecation:b$,escape:w$}=Vs(),{getDefaults:qfe,changeDefaults:$fe,defaults:Bfe}=kl();function Re(r,e,t){if(typeof r=="undefined"||r===null)throw new Error("marked(): input parameter is undefined or null");if(typeof r!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected");if(typeof e=="function"&&(t=e,e=null),e=Pm({},Re.defaults,e||{}),b$(e),t){let i=e.highlight,n;try{n=kf.lex(r,e)}catch(a){return t(a)}let o=function(a){let l;if(!a)try{l=If.parse(n,e)}catch(u){a=u}return e.highlight=i,a?t(a):t(null,l)};if(!i||i.length<3||(delete e.highlight,!n.length))return o();let s=0;Re.walkTokens(n,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=kf.lex(r,e);return e.walkTokens&&Re.walkTokens(i,e.walkTokens),If.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>"+w$(i.message+"",!0)+"</pre>";throw i}}Re.options=Re.setOptions=function(r){return Pm(Re.defaults,r),$fe(Re.defaults),Re};Re.getDefaults=qfe;Re.defaults=Bfe;Re.use=function(r){let e=Pm({},r);if(r.renderer){let t=Re.defaults.renderer||new y$;for(let i in r.renderer){let n=t[i];t[i]=(...o)=>{let s=r.renderer[i].apply(t,o);return s===!1&&(s=n.apply(t,o)),s}}e.renderer=t}if(r.tokenizer){let t=Re.defaults.tokenizer||new v$;for(let i in r.tokenizer){let n=t[i];t[i]=(...o)=>{let s=r.tokenizer[i].apply(t,o);return s===!1&&(s=n.apply(t,o)),s}}e.tokenizer=t}if(r.walkTokens){let t=Re.defaults.walkTokens;e.walkTokens=i=>{r.walkTokens(i),t&&t(i)}}Re.setOptions(e)};Re.walkTokens=function(r,e){for(let t of r)switch(e(t),t.type){case"table":{for(let i of t.tokens.header)Re.walkTokens(i,e);for(let i of t.tokens.cells)for(let n of i)Re.walkTokens(n,e);break}case"list":{Re.walkTokens(t.items,e);break}default:t.tokens&&Re.walkTokens(t.tokens,e)}};Re.parseInline=function(r,e){if(typeof r=="undefined"||r===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof r!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected");e=Pm({},Re.defaults,e||{}),b$(e);try{let t=kf.lexInline(r,e);return e.walkTokens&&Re.walkTokens(t,e.walkTokens),If.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>"+w$(t.message+"",!0)+"</pre>";throw t}};Re.Parser=If;Re.parser=If.parse;Re.Renderer=y$;Re.TextRenderer=Mfe;Re.Lexer=kf;Re.lexer=kf.lex;Re.Tokenizer=v$;Re.Slugger=Nfe;Re.parse=Re;g$.exports=Re});var S$=g((DTe,D$)=>{"use strict";var jfe=/[|\\{}()[\]^$+*?.]/g;D$.exports=function(r){if(typeof r!="string")throw new TypeError("Expected a string");return r.replace(jfe,"\\$&")}});var C$=g((STe,E$)=>{"use strict";E$.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var Zx=g((ETe,_$)=>{var Js=C$(),P$={};for(var Xx in Js)Js.hasOwnProperty(Xx)&&(P$[Js[Xx]]=Xx);var ee=_$.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var kr in ee)if(ee.hasOwnProperty(kr)){if(!("channels"in ee[kr]))throw new Error("missing channels property: "+kr);if(!("labels"in ee[kr]))throw new Error("missing channel labels property: "+kr);if(ee[kr].labels.length!==ee[kr].channels)throw new Error("channel and label counts mismatch: "+kr);T$=ee[kr].channels,R$=ee[kr].labels,delete ee[kr].channels,delete ee[kr].labels,Object.defineProperty(ee[kr],"channels",{value:T$}),Object.defineProperty(ee[kr],"labels",{value:R$})}var T$,R$;ee.rgb.hsl=function(r){var e=r[0]/255,t=r[1]/255,i=r[2]/255,n=Math.min(e,t,i),o=Math.max(e,t,i),s=o-n,a,l,u;return o===n?a=0:e===o?a=(t-i)/s:t===o?a=2+(i-e)/s:i===o&&(a=4+(e-t)/s),a=Math.min(a*60,360),a<0&&(a+=360),u=(n+o)/2,o===n?l=0:u<=.5?l=s/(o+n):l=s/(2-o-n),[a,l*100,u*100]};ee.rgb.hsv=function(r){var e,t,i,n,o,s=r[0]/255,a=r[1]/255,l=r[2]/255,u=Math.max(s,a,l),c=u-Math.min(s,a,l),f=function(p){return(u-p)/6/c+1/2};return c===0?n=o=0:(o=c/u,e=f(s),t=f(a),i=f(l),s===u?n=i-t:a===u?n=1/3+e-i:l===u&&(n=2/3+t-e),n<0?n+=1:n>1&&(n-=1)),[n*360,o*100,u*100]};ee.rgb.hwb=function(r){var e=r[0],t=r[1],i=r[2],n=ee.rgb.hsl(r)[0],o=1/255*Math.min(e,Math.min(t,i));return i=1-1/255*Math.max(e,Math.max(t,i)),[n,o*100,i*100]};ee.rgb.cmyk=function(r){var e=r[0]/255,t=r[1]/255,i=r[2]/255,n,o,s,a;return a=Math.min(1-e,1-t,1-i),n=(1-e-a)/(1-a)||0,o=(1-t-a)/(1-a)||0,s=(1-i-a)/(1-a)||0,[n*100,o*100,s*100,a*100]};function Ufe(r,e){return Math.pow(r[0]-e[0],2)+Math.pow(r[1]-e[1],2)+Math.pow(r[2]-e[2],2)}ee.rgb.keyword=function(r){var e=P$[r];if(e)return e;var t=Infinity,i;for(var n in Js)if(Js.hasOwnProperty(n)){var o=Js[n],s=Ufe(r,o);s<t&&(t=s,i=n)}return i};ee.keyword.rgb=function(r){return Js[r]};ee.rgb.xyz=function(r){var e=r[0]/255,t=r[1]/255,i=r[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,t=t>.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92;var n=e*.4124+t*.3576+i*.1805,o=e*.2126+t*.7152+i*.0722,s=e*.0193+t*.1192+i*.9505;return[n*100,o*100,s*100]};ee.rgb.lab=function(r){var e=ee.rgb.xyz(r),t=e[0],i=e[1],n=e[2],o,s,a;return t/=95.047,i/=100,n/=108.883,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,n=n>.008856?Math.pow(n,1/3):7.787*n+16/116,o=116*i-16,s=500*(t-i),a=200*(i-n),[o,s,a]};ee.hsl.rgb=function(r){var e=r[0]/360,t=r[1]/100,i=r[2]/100,n,o,s,a,l;if(t===0)return l=i*255,[l,l,l];i<.5?o=i*(1+t):o=i+t-i*t,n=2*i-o,a=[0,0,0];for(var u=0;u<3;u++)s=e+1/3*-(u-1),s<0&&s++,s>1&&s--,6*s<1?l=n+(o-n)*6*s:2*s<1?l=o:3*s<2?l=n+(o-n)*(2/3-s)*6:l=n,a[u]=l*255;return a};ee.hsl.hsv=function(r){var e=r[0],t=r[1]/100,i=r[2]/100,n=t,o=Math.max(i,.01),s,a;return i*=2,t*=i<=1?i:2-i,n*=o<=1?o:2-o,a=(i+t)/2,s=i===0?2*n/(o+n):2*t/(i+t),[e,s*100,a*100]};ee.hsv.rgb=function(r){var e=r[0]/60,t=r[1]/100,i=r[2]/100,n=Math.floor(e)%6,o=e-Math.floor(e),s=255*i*(1-t),a=255*i*(1-t*o),l=255*i*(1-t*(1-o));switch(i*=255,n){case 0:return[i,l,s];case 1:return[a,i,s];case 2:return[s,i,l];case 3:return[s,a,i];case 4:return[l,s,i];case 5:return[i,s,a]}};ee.hsv.hsl=function(r){var e=r[0],t=r[1]/100,i=r[2]/100,n=Math.max(i,.01),o,s,a;return a=(2-t)*i,o=(2-t)*n,s=t*n,s/=o<=1?o:2-o,s=s||0,a/=2,[e,s*100,a*100]};ee.hwb.rgb=function(r){var e=r[0]/360,t=r[1]/100,i=r[2]/100,n=t+i,o,s,a,l;n>1&&(t/=n,i/=n),o=Math.floor(6*e),s=1-i,a=6*e-o,(o&1)!=0&&(a=1-a),l=t+a*(s-t);var u,c,f;switch(o){default:case 6:case 0:u=s,c=l,f=t;break;case 1:u=l,c=s,f=t;break;case 2:u=t,c=s,f=l;break;case 3:u=t,c=l,f=s;break;case 4:u=l,c=t,f=s;break;case 5:u=s,c=t,f=l;break}return[u*255,c*255,f*255]};ee.cmyk.rgb=function(r){var e=r[0]/100,t=r[1]/100,i=r[2]/100,n=r[3]/100,o,s,a;return o=1-Math.min(1,e*(1-n)+n),s=1-Math.min(1,t*(1-n)+n),a=1-Math.min(1,i*(1-n)+n),[o*255,s*255,a*255]};ee.xyz.rgb=function(r){var e=r[0]/100,t=r[1]/100,i=r[2]/100,n,o,s;return n=e*3.2406+t*-1.5372+i*-.4986,o=e*-.9689+t*1.8758+i*.0415,s=e*.0557+t*-.204+i*1.057,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o*12.92,s=s>.0031308?1.055*Math.pow(s,1/2.4)-.055:s*12.92,n=Math.min(Math.max(0,n),1),o=Math.min(Math.max(0,o),1),s=Math.min(Math.max(0,s),1),[n*255,o*255,s*255]};ee.xyz.lab=function(r){var e=r[0],t=r[1],i=r[2],n,o,s;return e/=95.047,t/=100,i/=108.883,e=e>.008856?Math.pow(e,1/3):7.787*e+16/116,t=t>.008856?Math.pow(t,1/3):7.787*t+16/116,i=i>.008856?Math.pow(i,1/3):7.787*i+16/116,n=116*t-16,o=500*(e-t),s=200*(t-i),[n,o,s]};ee.lab.xyz=function(r){var e=r[0],t=r[1],i=r[2],n,o,s;o=(e+16)/116,n=t/500+o,s=o-i/200;var a=Math.pow(o,3),l=Math.pow(n,3),u=Math.pow(s,3);return o=a>.008856?a:(o-16/116)/7.787,n=l>.008856?l:(n-16/116)/7.787,s=u>.008856?u:(s-16/116)/7.787,n*=95.047,o*=100,s*=108.883,[n,o,s]};ee.lab.lch=function(r){var e=r[0],t=r[1],i=r[2],n,o,s;return n=Math.atan2(i,t),o=n*360/2/Math.PI,o<0&&(o+=360),s=Math.sqrt(t*t+i*i),[e,s,o]};ee.lch.lab=function(r){var e=r[0],t=r[1],i=r[2],n,o,s;return s=i/360*2*Math.PI,n=t*Math.cos(s),o=t*Math.sin(s),[e,n,o]};ee.rgb.ansi16=function(r){var e=r[0],t=r[1],i=r[2],n=1 in arguments?arguments[1]:ee.rgb.hsv(r)[2];if(n=Math.round(n/50),n===0)return 30;var o=30+(Math.round(i/255)<<2|Math.round(t/255)<<1|Math.round(e/255));return n===2&&(o+=60),o};ee.hsv.ansi16=function(r){return ee.rgb.ansi16(ee.hsv.rgb(r),r[2])};ee.rgb.ansi256=function(r){var e=r[0],t=r[1],i=r[2];if(e===t&&t===i)return e<8?16:e>248?231:Math.round((e-8)/247*24)+232;var n=16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(i/255*5);return n};ee.ansi16.rgb=function(r){var e=r%10;if(e===0||e===7)return r>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var t=(~~(r>50)+1)*.5,i=(e&1)*t*255,n=(e>>1&1)*t*255,o=(e>>2&1)*t*255;return[i,n,o]};ee.ansi256.rgb=function(r){if(r>=232){var e=(r-232)*10+8;return[e,e,e]}r-=16;var t,i=Math.floor(r/36)/5*255,n=Math.floor((t=r%36)/6)/5*255,o=t%6/5*255;return[i,n,o]};ee.rgb.hex=function(r){var e=((Math.round(r[0])&255)<<16)+((Math.round(r[1])&255)<<8)+(Math.round(r[2])&255),t=e.toString(16).toUpperCase();return"000000".substring(t.length)+t};ee.hex.rgb=function(r){var e=r.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var t=e[0];e[0].length===3&&(t=t.split("").map(function(a){return a+a}).join(""));var i=parseInt(t,16),n=i>>16&255,o=i>>8&255,s=i&255;return[n,o,s]};ee.rgb.hcg=function(r){var e=r[0]/255,t=r[1]/255,i=r[2]/255,n=Math.max(Math.max(e,t),i),o=Math.min(Math.min(e,t),i),s=n-o,a,l;return s<1?a=o/(1-s):a=0,s<=0?l=0:n===e?l=(t-i)/s%6:n===t?l=2+(i-e)/s:l=4+(e-t)/s+4,l/=6,l%=1,[l*360,s*100,a*100]};ee.hsl.hcg=function(r){var e=r[1]/100,t=r[2]/100,i=1,n=0;return t<.5?i=2*e*t:i=2*e*(1-t),i<1&&(n=(t-.5*i)/(1-i)),[r[0],i*100,n*100]};ee.hsv.hcg=function(r){var e=r[1]/100,t=r[2]/100,i=e*t,n=0;return i<1&&(n=(t-i)/(1-i)),[r[0],i*100,n*100]};ee.hcg.rgb=function(r){var e=r[0]/360,t=r[1]/100,i=r[2]/100;if(t===0)return[i*255,i*255,i*255];var n=[0,0,0],o=e%1*6,s=o%1,a=1-s,l=0;switch(Math.floor(o)){case 0:n[0]=1,n[1]=s,n[2]=0;break;case 1:n[0]=a,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=s;break;case 3:n[0]=0,n[1]=a,n[2]=1;break;case 4:n[0]=s,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=a}return l=(1-t)*i,[(t*n[0]+l)*255,(t*n[1]+l)*255,(t*n[2]+l)*255]};ee.hcg.hsv=function(r){var e=r[1]/100,t=r[2]/100,i=e+t*(1-e),n=0;return i>0&&(n=e/i),[r[0],n*100,i*100]};ee.hcg.hsl=function(r){var e=r[1]/100,t=r[2]/100,i=t*(1-e)+.5*e,n=0;return i>0&&i<.5?n=e/(2*i):i>=.5&&i<1&&(n=e/(2*(1-i))),[r[0],n*100,i*100]};ee.hcg.hwb=function(r){var e=r[1]/100,t=r[2]/100,i=e+t*(1-e);return[r[0],(i-e)*100,(1-i)*100]};ee.hwb.hcg=function(r){var e=r[1]/100,t=r[2]/100,i=1-t,n=i-e,o=0;return n<1&&(o=(i-n)/(1-n)),[r[0],n*100,o*100]};ee.apple.rgb=function(r){return[r[0]/65535*255,r[1]/65535*255,r[2]/65535*255]};ee.rgb.apple=function(r){return[r[0]/255*65535,r[1]/255*65535,r[2]/255*65535]};ee.gray.rgb=function(r){return[r[0]/100*255,r[0]/100*255,r[0]/100*255]};ee.gray.hsl=ee.gray.hsv=function(r){return[0,0,r[0]]};ee.gray.hwb=function(r){return[0,100,r[0]]};ee.gray.cmyk=function(r){return[0,0,0,r[0]]};ee.gray.lab=function(r){return[r[0],0,0]};ee.gray.hex=function(r){var e=Math.round(r[0]/100*255)&255,t=(e<<16)+(e<<8)+e,i=t.toString(16).toUpperCase();return"000000".substring(i.length)+i};ee.rgb.gray=function(r){var e=(r[0]+r[1]+r[2])/3;return[e/255*100]}});var I$=g((CTe,k$)=>{var Tm=Zx();function Wfe(){for(var r={},e=Object.keys(Tm),t=e.length,i=0;i<t;i++)r[e[i]]={distance:-1,parent:null};return r}function Hfe(r){var e=Wfe(),t=[r];for(e[r].distance=0;t.length;)for(var i=t.pop(),n=Object.keys(Tm[i]),o=n.length,s=0;s<o;s++){var a=n[s],l=e[a];l.distance===-1&&(l.distance=e[i].distance+1,l.parent=i,t.unshift(a))}return e}function zfe(r,e){return function(t){return e(r(t))}}function Gfe(r,e){for(var t=[e[r].parent,r],i=Tm[e[r].parent][r],n=e[r].parent;e[n].parent;)t.unshift(e[n].parent),i=zfe(Tm[e[n].parent][n],i),n=e[n].parent;return i.conversion=t,i}k$.exports=function(r){for(var e=Hfe(r),t={},i=Object.keys(e),n=i.length,o=0;o<n;o++){var s=i[o],a=e[s];a.parent!==null&&(t[s]=Gfe(s,e))}return t}});var A$=g((_Te,F$)=>{var Qx=Zx(),Vfe=I$(),Il={},Kfe=Object.keys(Qx);function Jfe(r){var e=function(t){return t==null?t:(arguments.length>1&&(t=Array.prototype.slice.call(arguments)),r(t))};return"conversion"in r&&(e.conversion=r.conversion),e}function Yfe(r){var e=function(t){if(t==null)return t;arguments.length>1&&(t=Array.prototype.slice.call(arguments));var i=r(t);if(typeof i=="object")for(var n=i.length,o=0;o<n;o++)i[o]=Math.round(i[o]);return i};return"conversion"in r&&(e.conversion=r.conversion),e}Kfe.forEach(function(r){Il[r]={},Object.defineProperty(Il[r],"channels",{value:Qx[r].channels}),Object.defineProperty(Il[r],"labels",{value:Qx[r].labels});var e=Vfe(r),t=Object.keys(e);t.forEach(function(i){var n=e[i];Il[r][i]=Yfe(n),Il[r][i].raw=Jfe(n)})});F$.exports=Il});var L$=g((PTe,O$)=>{"use strict";var Fl=A$(),Rm=(r,e)=>function(){return`[${r.apply(Fl,arguments)+e}m`},km=(r,e)=>function(){let t=r.apply(Fl,arguments);return`[${38+e};5;${t}m`},Im=(r,e)=>function(){let t=r.apply(Fl,arguments);return`[${38+e};2;${t[0]};${t[1]};${t[2]}m`};function Xfe(){let r=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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],gray:[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.grey=e.color.gray;for(let n of Object.keys(e)){let o=e[n];for(let s of Object.keys(o)){let a=o[s];e[s]={open:`[${a[0]}m`,close:`[${a[1]}m`},o[s]=e[s],r.set(a[0],a[1])}Object.defineProperty(e,n,{value:o,enumerable:!1}),Object.defineProperty(e,"codes",{value:r,enumerable:!1})}let t=n=>n,i=(n,o,s)=>[n,o,s];e.color.close="[39m",e.bgColor.close="[49m",e.color.ansi={ansi:Rm(t,0)},e.color.ansi256={ansi256:km(t,0)},e.color.ansi16m={rgb:Im(i,0)},e.bgColor.ansi={ansi:Rm(t,10)},e.bgColor.ansi256={ansi256:km(t,10)},e.bgColor.ansi16m={rgb:Im(i,10)};for(let n of Object.keys(Fl)){if(typeof Fl[n]!="object")continue;let o=Fl[n];n==="ansi16"&&(n="ansi"),"ansi16"in o&&(e.color.ansi[n]=Rm(o.ansi16,0),e.bgColor.ansi[n]=Rm(o.ansi16,10)),"ansi256"in o&&(e.color.ansi256[n]=km(o.ansi256,0),e.bgColor.ansi256[n]=km(o.ansi256,10)),"rgb"in o&&(e.color.ansi16m[n]=Im(o.rgb,0),e.bgColor.ansi16m[n]=Im(o.rgb,10))}return e}Object.defineProperty(O$,"exports",{enumerable:!0,get:Xfe})});var N$=g((TTe,M$)=>{"use strict";M$.exports=(r,e)=>{e=e||process.argv;let t=r.startsWith("-")?"":r.length===1?"-":"--",i=e.indexOf(t+r),n=e.indexOf("--");return i!==-1&&(n===-1?!0:i<n)}});var $$=g((RTe,q$)=>{"use strict";var Zfe=require("os"),Vi=N$(),sr=process.env,Al;Vi("no-color")||Vi("no-colors")||Vi("color=false")?Al=!1:(Vi("color")||Vi("colors")||Vi("color=true")||Vi("color=always"))&&(Al=!0);"FORCE_COLOR"in sr&&(Al=sr.FORCE_COLOR.length===0||parseInt(sr.FORCE_COLOR,10)!==0);function Qfe(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function epe(r){if(Al===!1)return 0;if(Vi("color=16m")||Vi("color=full")||Vi("color=truecolor"))return 3;if(Vi("color=256"))return 2;if(r&&!r.isTTY&&Al!==!0)return 0;let e=Al?1:0;if(process.platform==="win32"){let t=Zfe.release().split(".");return Number(process.versions.node.split(".")[0])>=8&&Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in sr)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(t=>t in sr)||sr.CI_NAME==="codeship"?1:e;if("TEAMCITY_VERSION"in sr)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(sr.TEAMCITY_VERSION)?1:0;if(sr.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in sr){let t=parseInt((sr.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(sr.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(sr.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(sr.TERM)||"COLORTERM"in sr?1:(sr.TERM==="dumb",e)}function eD(r){let e=epe(r);return Qfe(e)}q$.exports={supportsColor:eD,stdout:eD(process.stdout),stderr:eD(process.stderr)}});var H$=g((kTe,B$)=>{"use strict";var tpe=/(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,j$=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,rpe=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,ipe=/\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi,npe=new Map([["n",`
|
||
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e",""],["a","\x07"]]);function U$(r){return r[0]==="u"&&r.length===5||r[0]==="x"&&r.length===3?String.fromCharCode(parseInt(r.slice(1),16)):npe.get(r)||r}function ope(r,e){let t=[],i=e.trim().split(/\s*,\s*/g),n;for(let o of i)if(!isNaN(o))t.push(Number(o));else if(n=o.match(rpe))t.push(n[2].replace(ipe,(s,a,l)=>a?U$(a):l));else throw new Error(`Invalid Chalk template style argument: ${o} (in style '${r}')`);return t}function spe(r){j$.lastIndex=0;let e=[],t;for(;(t=j$.exec(r))!==null;){let i=t[1];if(t[2]){let n=ope(i,t[2]);e.push([i].concat(n))}else e.push([i])}return e}function W$(r,e){let t={};for(let n of e)for(let o of n.styles)t[o[0]]=n.inverse?null:o.slice(1);let i=r;for(let n of Object.keys(t))if(Array.isArray(t[n])){if(!(n in i))throw new Error(`Unknown Chalk style: ${n}`);t[n].length>0?i=i[n].apply(i,t[n]):i=i[n]}return i}B$.exports=(r,e)=>{let t=[],i=[],n=[];if(e.replace(tpe,(o,s,a,l,u,c)=>{if(s)n.push(U$(s));else if(l){let f=n.join("");n=[],i.push(t.length===0?f:W$(r,t)(f)),t.push({inverse:a,styles:spe(l)})}else if(u){if(t.length===0)throw new Error("Found extraneous } in Chalk template literal");i.push(W$(r,t)(n.join(""))),n=[],t.pop()}else n.push(c)}),i.push(n.join("")),t.length>0){let o=`Chalk template literal is missing ${t.length} closing bracket${t.length===1?"":"s"} (\`}\`)`;throw new Error(o)}return i.join("")}});var J$=g((ITe,Ff)=>{"use strict";var tD=S$(),xt=L$(),rD=$$().stdout,ape=H$(),z$=process.platform==="win32"&&!(process.env.TERM||"").toLowerCase().startsWith("xterm"),G$=["ansi","ansi","ansi256","ansi16m"],V$=new Set(["gray"]),Ol=Object.create(null);function K$(r,e){e=e||{};let t=rD?rD.level:0;r.level=e.level===void 0?t:e.level,r.enabled="enabled"in e?e.enabled:r.level>0}function Af(r){if(!this||!(this instanceof Af)||this.template){let e={};return K$(e,r),e.template=function(){let t=[].slice.call(arguments);return lpe.apply(null,[e.template].concat(t))},Object.setPrototypeOf(e,Af.prototype),Object.setPrototypeOf(e.template,e),e.template.constructor=Af,e.template}K$(this,r)}z$&&(xt.blue.open="[94m");for(let r of Object.keys(xt))xt[r].closeRe=new RegExp(tD(xt[r].close),"g"),Ol[r]={get(){let e=xt[r];return Fm.call(this,this._styles?this._styles.concat(e):[e],this._empty,r)}};Ol.visible={get(){return Fm.call(this,this._styles||[],!0,"visible")}};xt.color.closeRe=new RegExp(tD(xt.color.close),"g");for(let r of Object.keys(xt.color.ansi))V$.has(r)||(Ol[r]={get(){let e=this.level;return function(){let i={open:xt.color[G$[e]][r].apply(null,arguments),close:xt.color.close,closeRe:xt.color.closeRe};return Fm.call(this,this._styles?this._styles.concat(i):[i],this._empty,r)}}});xt.bgColor.closeRe=new RegExp(tD(xt.bgColor.close),"g");for(let r of Object.keys(xt.bgColor.ansi)){if(V$.has(r))continue;let e="bg"+r[0].toUpperCase()+r.slice(1);Ol[e]={get(){let t=this.level;return function(){let n={open:xt.bgColor[G$[t]][r].apply(null,arguments),close:xt.bgColor.close,closeRe:xt.bgColor.closeRe};return Fm.call(this,this._styles?this._styles.concat(n):[n],this._empty,r)}}}}var upe=Object.defineProperties(()=>{},Ol);function Fm(r,e,t){let i=function(){return cpe.apply(i,arguments)};i._styles=r,i._empty=e;let n=this;return Object.defineProperty(i,"level",{enumerable:!0,get(){return n.level},set(o){n.level=o}}),Object.defineProperty(i,"enabled",{enumerable:!0,get(){return n.enabled},set(o){n.enabled=o}}),i.hasGrey=this.hasGrey||t==="gray"||t==="grey",i.__proto__=upe,i}function cpe(){let r=arguments,e=r.length,t=String(arguments[0]);if(e===0)return"";if(e>1)for(let n=1;n<e;n++)t+=" "+r[n];if(!this.enabled||this.level<=0||!t)return this._empty?"":t;let i=xt.dim.open;z$&&this.hasGrey&&(xt.dim.open="");for(let n of this._styles.slice().reverse())t=n.open+t.replace(n.closeRe,n.open)+n.close,t=t.replace(/\r?\n/g,`${n.close}$&${n.open}`);return xt.dim.open=i,t}function lpe(r,e){if(!Array.isArray(e))return[].slice.call(arguments,1).join(" ");let t=[].slice.call(arguments,2),i=[e.raw[0]];for(let n=1;n<e.length;n++)i.push(String(t[n-1]).replace(/[{}\\]/g,"\\$&")),i.push(String(e.raw[n]));return ape(r,i.join(""))}Object.defineProperties(Af.prototype,Ol);Ff.exports=Af();Ff.exports.supportsColor=rD;Ff.exports.default=Ff.exports});var X$=g((FTe,Y$)=>{"use strict";Y$.exports=({onlyFirst:r=!1}={})=>{let e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,r?void 0:"g")}});var iD=g((ATe,Z$)=>{"use strict";var fpe=X$();Z$.exports=r=>typeof r=="string"?r.replace(fpe(),""):r});var eB=g((OTe,nD)=>{"use strict";var Q$=r=>Number.isNaN(r)?!1:r>=4352&&(r<=4447||r===9001||r===9002||11904<=r&&r<=12871&&r!==12351||12880<=r&&r<=19903||19968<=r&&r<=42182||43360<=r&&r<=43388||44032<=r&&r<=55203||63744<=r&&r<=64255||65040<=r&&r<=65049||65072<=r&&r<=65131||65281<=r&&r<=65376||65504<=r&&r<=65510||110592<=r&&r<=110593||127488<=r&&r<=127569||131072<=r&&r<=262141);nD.exports=Q$;nD.exports.default=Q$});var rB=g((LTe,tB)=>{"use strict";tB.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F|\uD83D\uDC68(?:\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68\uD83C\uDFFB|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|[\u2695\u2696\u2708]\uFE0F|\uD83D[\uDC66\uDC67]|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708])\uFE0F|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C[\uDFFB-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)\uD83C\uDFFB|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB\uDFFC])|\uD83D\uDC69(?:\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D\uD83D\uDC69)(?:\uD83C[\uDFFB-\uDFFD])|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|(?:(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)\uFE0F|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:(?:\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\u200D[\u2640\u2642])|\uD83C\uDFF4\u200D\u2620)\uFE0F|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF4\uD83C\uDDF2|\uD83C\uDDF6\uD83C\uDDE6|[#\*0-9]\uFE0F\u20E3|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83D\uDC69(?:\uD83C[\uDFFB-\uDFFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270A-\u270D]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC70\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDCAA\uDD74\uDD7A\uDD90\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD36\uDDB5\uDDB6\uDDBB\uDDD2-\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5\uDEEB\uDEEC\uDEF4-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFA\uDFE0-\uDFEB]|\uD83E[\uDD0D-\uDD3A\uDD3C-\uDD45\uDD47-\uDD71\uDD73-\uDD76\uDD7A-\uDDA2\uDDA5-\uDDAA\uDDAE-\uDDCA\uDDCD-\uDDFF\uDE70-\uDE73\uDE78-\uDE7A\uDE80-\uDE82\uDE90-\uDE95])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});var nB=g((MTe,oD)=>{"use strict";var ppe=iD(),dpe=eB(),hpe=rB(),iB=r=>{if(r=r.replace(hpe()," "),typeof r!="string"||r.length===0)return 0;r=ppe(r);let e=0;for(let t=0;t<r.length;t++){let i=r.codePointAt(t);i<=31||i>=127&&i<=159||i>=768&&i<=879||(i>65535&&t++,e+=dpe(i)?2:1)}return e};oD.exports=iB;oD.exports.default=iB});var sB=g(Ll=>{var mpe=nB();Ll.repeat=function(r,e){return Array(e+1).join(r)};Ll.pad=function(r,e,t,i){if(e+1>=r.length)switch(i){case"left":r=Array(e+1-r.length).join(t)+r;break;case"both":var n=Math.ceil((padlen=e-r.length)/2),o=padlen-n;r=Array(o+1).join(t)+r+Array(n+1).join(t);break;default:r=r+Array(e+1-r.length).join(t)}return r};Ll.truncate=function(r,e,t){return t=t||"\u2026",r.length>=e?r.substr(0,e-t.length)+t:r};function oB(r,e){for(var t in e)e[t]&&e[t].constructor&&e[t].constructor===Object?(r[t]=r[t]||{},oB(r[t],e[t])):r[t]=e[t];return r}Ll.options=oB;Ll.strlen=function(r){var e=/\u001b\[(?:\d*;){0,5}\d*m/g,t=(""+(r!=null?r:"")).replace(e,""),i=t.split(`
|
||
`);return i.reduce(function(n,o){var s=mpe(o);return s>n?s:n},0)}});var lB=g((qTe,aB)=>{aB.exports={name:"cli-table",description:"Pretty unicode tables for the CLI",version:"0.3.4",license:"MIT",author:"Guillermo Rauch <guillermo@learnboost.com>",contributors:["Sonny Michaud <michaud.sonny@gmail.com> (http://github.com/sonnym)","Gabriel Sambarino <gabriel.sambarino@gmail.com> (http://github.com/chrean)"],repository:{type:"git",url:"https://github.com/Automattic/cli-table.git"},keywords:["cli","colors","table"],dependencies:{chalk:"^2.4.1","string-width":"^4.2.0"},devDependencies:{"@babel/core":"^7.12.9","@babel/preset-env":"^7.12.7","@babel/preset-typescript":"^7.12.7","babel-jest":"^26.6.3",expect:"^26.6.2",expresso:"~0.9",jest:"^26.6.3","jest-mock":"^26.6.2","publish-please":"^5.5.2","ts-node":"^9.1.0",typescript:"^4.1.2"},main:"lib",files:["lib"],scripts:{test:"jest","publish-please":"publish-please --access public"},engines:{node:">= 10.0.0"}}});var uB=g(($Te,sD)=>{var gpe=J$(),Ys=sB(),aD=Ys.repeat,vpe=Ys.truncate,ype=Ys.pad;function Of(r){this.options=Ys.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",colors:!0,colWidths:[],colAligns:[],style:{"padding-left":1,"padding-right":1,head:["red"],border:["white"],compact:!1},head:[]},r)}Of.prototype.__proto__=Array.prototype;Of.prototype.__defineGetter__("width",function(){var r=this.toString().split(`
|
||
`);return r.length?r[0].length:0});Of.prototype.render;Of.prototype.toString=function(){var r="",e=this.options,t=e.style,i=e.head,n=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(v){if(Array.isArray(v)&&v.length)u(v);else{var x=Object.keys(v)[0],w=v[x];s[0]=Math.max(s[0]||0,c(x)||0),Array.isArray(w)&&w.length?u(w,1):s[1]=Math.max(s[1]||0,c(w)||0)}})}a=(s.length==1?s[0]:s.reduce(function(v,x){return v+x}))+s.length+1;function u(v,x){var x=x||0;v.forEach(function(w,E){s[E+x]=Math.max(s[E+x]||0,c(w)||0)})}function c(v){return typeof v=="object"&&v&&v.width!=null?v.width:(typeof v=="object"&&v!==null?Ys.strlen(v.text):Ys.strlen(v))+(t["padding-left"]||0)+(t["padding-right"]||0)}function f(v,x,w,E){var P=0,v=x+aD(v,a-2)+w;return s.forEach(function(k,_){_!=s.length-1&&(P+=k+1,v=v.substr(0,P)+E+v.substr(P+1))}),h(e.style.border,v)}function p(){var v=f(n.top,n["top-left"]||n.top,n["top-right"]||n.top,n["top-mid"]);v&&(r+=v+`
|
||
`)}function d(v,x){var w=[],E=0;if(!Array.isArray(v)&&typeof v=="object"){var P=Object.keys(v)[0],k=v[P],_=!0;Array.isArray(k)?(v=k,v.unshift(P)):v=[P,k]}v.forEach(function(L,R){var F=(L==null?"":L).toString().split(`
|
||
`).reduce(function(K,ae){return K.push(m(ae,R)),K},[]),q=F.length;q>E&&(E=q),w.push({contents:F,height:q})});var O=new Array(E);w.forEach(function(L,R){L.contents.forEach(function(K,ae){O[ae]||(O[ae]=[]),(x||_&&R===0&&e.style.head)&&(K=h(e.style.head,K)),O[ae].push(K)});for(var F=L.height,q=E;F<q;F++)O[F]||(O[F]=[]),O[F].push(m("",R))});var I="";return O.forEach(function(L,R){I.length>0&&(I+=`
|
||
`+h(e.style.border,n.left)),I+=L.join(h(e.style.border,n.middle))+h(e.style.border,n.right)}),h(e.style.border,n.left)+I}function h(v,x){return x?(e.colors&&v.forEach(function(w){x=gpe[w](x)}),x):""}function m(v,x){var v=String(typeof v=="object"&&v.text?v.text:v),w=Ys.strlen(v),E=s[x]-(t["padding-left"]||0)-(t["padding-right"]||0),P=e.colAligns[x]||"left";return aD(" ",t["padding-left"]||0)+(w==E?v:w<E?ype(v,E+(v.length-w)," ",P=="left"?"right":P=="middle"?"both":"left"):o?vpe(v,E,o):v)+aD(" ",t["padding-right"]||0)}i.length&&(p(),r+=d(i,t.head)+`
|
||
`),this.length&&this.forEach(function(v,x){if(!i.length&&x==0)p();else if(!t.compact||x<!!i.length?1:v.length==0){var w=f(n.mid,n["left-mid"],n["right-mid"],n["mid-mid"]);w&&(r+=w+`
|
||
`)}Array.isArray(v)&&!v.length||(r+=d(v)+`
|
||
`)});var y=f(n.bottom,n["bottom-left"]||n.bottom,n["bottom-right"]||n.bottom,n["bottom-mid"]);return y?r+=y:r=r.slice(0,-1),r};sD.exports=Of;sD.exports.version=lB().version});var hB=g((BTe,cB)=>{"use strict";var fB=10,pB=(r=0)=>e=>`[${38+r};5;${e}m`,dB=(r=0)=>(e,t,i)=>`[${38+r};2;${e};${t};${i}m`;function bpe(){let r=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],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[n,o]of Object.entries(i))e[n]={open:`[${o[0]}m`,close:`[${o[1]}m`},i[n]=e[n],r.set(o[0],o[1]);Object.defineProperty(e,t,{value:i,enumerable:!1})}return Object.defineProperty(e,"codes",{value:r,enumerable:!1}),e.color.close="[39m",e.bgColor.close="[49m",e.color.ansi256=pB(),e.color.ansi16m=dB(),e.bgColor.ansi256=pB(fB),e.bgColor.ansi16m=dB(fB),e.rgbToAnsi256=(t,i,n)=>t===i&&i===n?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(n/255*5),e.hexToRgb=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:n}=i.groups;n.length===3&&(n=n.split("").map(s=>s+s).join(""));let o=Number.parseInt(n,16);return[o>>16&255,o>>8&255,o&255]},e.hexToAnsi256=t=>e.rgbToAnsi256(...e.hexToRgb(t)),e}Object.defineProperty(cB,"exports",{enumerable:!0,get:bpe})});var o3=g((ZRe,jm)=>{"use strict";jm.exports=Vpe;jm.exports.format=i3;jm.exports.parse=n3;var Kpe=/\B(?=(\d{3})+(?!\d))/g,Jpe=/(?:\.0*|(\.[^0]+)0+)$/,$o={b:1,kb:1<<10,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},Ype=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function Vpe(r,e){return typeof r=="string"?n3(r):typeof r=="number"?i3(r,e):null}function i3(r,e){if(!Number.isFinite(r))return null;var t=Math.abs(r),i=e&&e.thousandsSeparator||"",n=e&&e.unitSeparator||"",o=e&&e.decimalPlaces!==void 0?e.decimalPlaces:2,s=Boolean(e&&e.fixedDecimals),a=e&&e.unit||"";(!a||!$o[a.toLowerCase()])&&(t>=$o.pb?a="PB":t>=$o.tb?a="TB":t>=$o.gb?a="GB":t>=$o.mb?a="MB":t>=$o.kb?a="KB":a="B");var l=r/$o[a.toLowerCase()],u=l.toFixed(o);return s||(u=u.replace(Jpe,"$1")),i&&(u=u.replace(Kpe,i)),u+n+a}function n3(r){if(typeof r=="number"&&!isNaN(r))return r;if(typeof r!="string")return null;var e=Ype.exec(r),t,i="b";return e?(t=parseFloat(e[1]),i=e[4].toLowerCase()):(t=parseInt(r,10),i="b"),Math.floor($o[i]*t)}});var Bl=g((QRe,s3)=>{var vn=-1,Yi=1,Ir=0;function Bf(r,e,t,i){if(r===e)return r?[[Ir,r]]:[];if(t!=null){var n=Zpe(r,e,t);if(n)return n}var o=RD(r,e),s=r.substring(0,o);r=r.substring(o),e=e.substring(o),o=kD(r,e);var a=r.substring(r.length-o);r=r.substring(0,r.length-o),e=e.substring(0,e.length-o);var l=Xpe(r,e);return s&&l.unshift([Ir,s]),a&&l.push([Ir,a]),a3(l,i),l}function Xpe(r,e){var t;if(!r)return[[Yi,e]];if(!e)return[[vn,r]];var i=r.length>e.length?r:e,n=r.length>e.length?e:r,o=i.indexOf(n);if(o!==-1)return t=[[Yi,i.substring(0,o)],[Ir,n],[Yi,i.substring(o+n.length)]],r.length>e.length&&(t[0][0]=t[2][0]=vn),t;if(n.length===1)return[[vn,r],[Yi,e]];var s=ede(r,e);if(s){var a=s[0],l=s[1],u=s[2],c=s[3],f=s[4],p=Bf(a,u),d=Bf(l,c);return p.concat([[Ir,f]],d)}return Qpe(r,e)}function Qpe(r,e){for(var t=r.length,i=e.length,n=Math.ceil((t+i)/2),o=n,s=2*n,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,f=c%2!=0,p=0,d=0,h=0,m=0,y=0;y<n;y++){for(var v=-y+p;v<=y-d;v+=2){var x=o+v,w;v===-y||v!==y&&a[x-1]<a[x+1]?w=a[x+1]:w=a[x-1]+1;for(var E=w-v;w<t&&E<i&&r.charAt(w)===e.charAt(E);)w++,E++;if(a[x]=w,w>t)d+=2;else if(E>i)p+=2;else if(f){var P=o+c-v;if(P>=0&&P<s&&l[P]!==-1){var k=t-l[P];if(w>=k)return l3(r,e,w,E)}}}for(var _=-y+h;_<=y-m;_+=2){var P=o+_,k;_===-y||_!==y&&l[P-1]<l[P+1]?k=l[P+1]:k=l[P-1]+1;for(var O=k-_;k<t&&O<i&&r.charAt(t-k-1)===e.charAt(i-O-1);)k++,O++;if(l[P]=k,k>t)m+=2;else if(O>i)h+=2;else if(!f){var x=o+c-_;if(x>=0&&x<s&&a[x]!==-1){var w=a[x],E=o+w-x;if(k=t-k,w>=k)return l3(r,e,w,E)}}}}return[[vn,r],[Yi,e]]}function l3(r,e,t,i){var n=r.substring(0,t),o=e.substring(0,i),s=r.substring(t),a=e.substring(i),l=Bf(n,o),u=Bf(s,a);return l.concat(u)}function RD(r,e){if(!r||!e||r.charAt(0)!==e.charAt(0))return 0;for(var t=0,i=Math.min(r.length,e.length),n=i,o=0;t<n;)r.substring(o,n)==e.substring(o,n)?(t=n,o=t):i=n,n=Math.floor((i-t)/2+t);return u3(r.charCodeAt(n-1))&&n--,n}function kD(r,e){if(!r||!e||r.slice(-1)!==e.slice(-1))return 0;for(var t=0,i=Math.min(r.length,e.length),n=i,o=0;t<n;)r.substring(r.length-n,r.length-o)==e.substring(e.length-n,e.length-o)?(t=n,o=t):i=n,n=Math.floor((i-t)/2+t);return c3(r.charCodeAt(r.length-n))&&n--,n}function ede(r,e){var t=r.length>e.length?r:e,i=r.length>e.length?e:r;if(t.length<4||i.length*2<t.length)return null;function n(d,h,m){for(var y=d.substring(m,m+Math.floor(d.length/4)),v=-1,x="",w,E,P,k;(v=h.indexOf(y,v+1))!==-1;){var _=RD(d.substring(m),h.substring(v)),O=kD(d.substring(0,m),h.substring(0,v));x.length<O+_&&(x=h.substring(v-O,v)+h.substring(v,v+_),w=d.substring(0,m-O),E=d.substring(m+_),P=h.substring(0,v-O),k=h.substring(v+_))}return x.length*2>=d.length?[w,E,P,k,x]:null}var o=n(t,i,Math.ceil(t.length/4)),s=n(t,i,Math.ceil(t.length/2)),a;if(!o&&!s)return null;s?o?a=o[4].length>s[4].length?o:s:a=s:a=o;var l,u,c,f;r.length>e.length?(l=a[0],u=a[1],c=a[2],f=a[3]):(c=a[0],f=a[1],l=a[2],u=a[3]);var p=a[4];return[l,u,c,f,p]}function a3(r,e){r.push([Ir,""]);for(var t=0,i=0,n=0,o="",s="",a;t<r.length;){if(t<r.length-1&&!r[t][1]){r.splice(t,1);continue}switch(r[t][0]){case Yi:n++,s+=r[t][1],t++;break;case vn:i++,o+=r[t][1],t++;break;case Ir:var l=t-n-i-1;if(e){if(l>=0&&p3(r[l][1])){var u=r[l][1].slice(-1);if(r[l][1]=r[l][1].slice(0,-1),o=u+o,s=u+s,!r[l][1]){r.splice(l,1),t--;var c=l-1;r[c]&&r[c][0]===Yi&&(n++,s=r[c][1]+s,c--),r[c]&&r[c][0]===vn&&(i++,o=r[c][1]+o,c--),l=c}}if(f3(r[t][1])){var u=r[t][1].charAt(0);r[t][1]=r[t][1].slice(1),o+=u,s+=u}}if(t<r.length-1&&!r[t][1]){r.splice(t,1);break}if(o.length>0||s.length>0){o.length>0&&s.length>0&&(a=RD(s,o),a!==0&&(l>=0?r[l][1]+=s.substring(0,a):(r.splice(0,0,[Ir,s.substring(0,a)]),t++),s=s.substring(a),o=o.substring(a)),a=kD(s,o),a!==0&&(r[t][1]=s.substring(s.length-a)+r[t][1],s=s.substring(0,s.length-a),o=o.substring(0,o.length-a)));var f=n+i;o.length===0&&s.length===0?(r.splice(t-f,f),t=t-f):o.length===0?(r.splice(t-f,f,[Yi,s]),t=t-f+1):s.length===0?(r.splice(t-f,f,[vn,o]),t=t-f+1):(r.splice(t-f,f,[vn,o],[Yi,s]),t=t-f+2)}t!==0&&r[t-1][0]===Ir?(r[t-1][1]+=r[t][1],r.splice(t,1)):t++,n=0,i=0,o="",s="";break}}r[r.length-1][1]===""&&r.pop();var p=!1;for(t=1;t<r.length-1;)r[t-1][0]===Ir&&r[t+1][0]===Ir&&(r[t][1].substring(r[t][1].length-r[t-1][1].length)===r[t-1][1]?(r[t][1]=r[t-1][1]+r[t][1].substring(0,r[t][1].length-r[t-1][1].length),r[t+1][1]=r[t-1][1]+r[t+1][1],r.splice(t-1,1),p=!0):r[t][1].substring(0,r[t+1][1].length)==r[t+1][1]&&(r[t-1][1]+=r[t+1][1],r[t][1]=r[t][1].substring(r[t+1][1].length)+r[t+1][1],r.splice(t+1,1),p=!0)),t++;p&&a3(r,e)}function u3(r){return r>=55296&&r<=56319}function c3(r){return r>=56320&&r<=57343}function f3(r){return c3(r.charCodeAt(0))}function p3(r){return u3(r.charCodeAt(r.length-1))}function tde(r){for(var e=[],t=0;t<r.length;t++)r[t][1].length>0&&e.push(r[t]);return e}function ID(r,e,t,i){return p3(r)||f3(i)?null:tde([[Ir,r],[vn,e],[Yi,t],[Ir,i]])}function Zpe(r,e,t){var i=typeof t=="number"?{index:t,length:0}:t.oldRange,n=typeof t=="number"?null:t.newRange,o=r.length,s=e.length;if(i.length===0&&(n===null||n.length===0)){var a=i.index,l=r.slice(0,a),u=r.slice(a),c=n?n.index:null;e:{var f=a+s-o;if(c!==null&&c!==f||f<0||f>s)break e;var p=e.slice(0,f),d=e.slice(f);if(d!==u)break e;var h=Math.min(a,f),m=l.slice(0,h),y=p.slice(0,h);if(m!==y)break e;var v=l.slice(h),x=p.slice(h);return ID(m,v,x,u)}e:{if(c!==null&&c!==a)break e;var w=a,p=e.slice(0,w),d=e.slice(w);if(p!==l)break e;var E=Math.min(o-w,s-w),P=u.slice(u.length-E),k=d.slice(d.length-E);if(P!==k)break e;var v=u.slice(0,u.length-E),x=d.slice(0,d.length-E);return ID(l,v,x,P)}}if(i.length>0&&n&&n.length===0){e:{var m=r.slice(0,i.index),P=r.slice(i.index+i.length),h=m.length,E=P.length;if(s<h+E)break e;var y=e.slice(0,h),k=e.slice(s-E);if(m!==y||P!==k)break e;var v=r.slice(h,o-E),x=e.slice(h,s-E);return ID(m,v,x,P)}}return null}function Um(r,e,t){return Bf(r,e,t,!0)}Um.INSERT=Yi;Um.DELETE=vn;Um.EQUAL=Ir;s3.exports=Um});var P3=g((O1e,_3)=>{_3.exports=function(r,e){for(var t=[],i=0;i<r.length;i++){var n=e(r[i],i);cde(n)?t.push.apply(t,n):t.push(n)}return t};var cde=Array.isArray||function(r){return Object.prototype.toString.call(r)==="[object Array]"}});var F3=g((L1e,T3)=>{"use strict";T3.exports=R3;function R3(r,e,t){r instanceof RegExp&&(r=k3(r,t)),e instanceof RegExp&&(e=k3(e,t));var i=I3(r,e,t);return i&&{start:i[0],end:i[1],pre:t.slice(0,i[0]),body:t.slice(i[0]+r.length,i[1]),post:t.slice(i[1]+e.length)}}function k3(r,e){var t=e.match(r);return t?t[0]:null}R3.range=I3;function I3(r,e,t){var i,n,o,s,a,l=t.indexOf(r),u=t.indexOf(e,l+1),c=l;if(l>=0&&u>0){for(i=[],o=t.length;c>=0&&!a;)c==l?(i.push(c),l=t.indexOf(r,c+1)):i.length==1?a=[i.pop(),u]:(n=i.pop(),n<o&&(o=n,s=u),u=t.indexOf(e,c+1)),c=l<u&&l>=0?l:u;i.length&&(a=[o,s])}return a}});var B3=g((M1e,A3)=>{var fde=P3(),O3=F3();A3.exports=pde;var L3="\0SLASH"+Math.random()+"\0",M3="\0OPEN"+Math.random()+"\0",$D="\0CLOSE"+Math.random()+"\0",N3="\0COMMA"+Math.random()+"\0",q3="\0PERIOD"+Math.random()+"\0";function BD(r){return parseInt(r,10)==r?parseInt(r,10):r.charCodeAt(0)}function dde(r){return r.split("\\\\").join(L3).split("\\{").join(M3).split("\\}").join($D).split("\\,").join(N3).split("\\.").join(q3)}function hde(r){return r.split(L3).join("\\").split(M3).join("{").split($D).join("}").split(N3).join(",").split(q3).join(".")}function $3(r){if(!r)return[""];var e=[],t=O3("{","}",r);if(!t)return r.split(",");var i=t.pre,n=t.body,o=t.post,s=i.split(",");s[s.length-1]+="{"+n+"}";var a=$3(o);return o.length&&(s[s.length-1]+=a.shift(),s.push.apply(s,a)),e.push.apply(e,s),e}function pde(r){return r?(r.substr(0,2)==="{}"&&(r="\\{\\}"+r.substr(2)),Wl(dde(r),!0).map(hde)):[]}function mde(r){return"{"+r+"}"}function gde(r){return/^-?0\d/.test(r)}function vde(r,e){return r<=e}function yde(r,e){return r>=e}function Wl(r,e){var t=[],i=O3("{","}",r);if(!i||/\$$/.test(i.pre))return[r];var n=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(i.body),o=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(i.body),s=n||o,a=i.body.indexOf(",")>=0;if(!s&&!a)return i.post.match(/,.*\}/)?(r=i.pre+"{"+i.body+$D+i.post,Wl(r)):[r];var l;if(s)l=i.body.split(/\.\./);else if(l=$3(i.body),l.length===1&&(l=Wl(l[0],!1).map(mde),l.length===1)){var c=i.post.length?Wl(i.post,!1):[""];return c.map(function(R){return i.pre+l[0]+R})}var u=i.pre,c=i.post.length?Wl(i.post,!1):[""],f;if(s){var p=BD(l[0]),d=BD(l[1]),h=Math.max(l[0].length,l[1].length),m=l.length==3?Math.abs(BD(l[2])):1,y=vde,v=d<p;v&&(m*=-1,y=yde);var x=l.some(gde);f=[];for(var w=p;y(w,d);w+=m){var E;if(o)E=String.fromCharCode(w),E==="\\"&&(E="");else if(E=String(w),x){var P=h-E.length;if(P>0){var k=new Array(P+1).join("0");w<0?E="-"+k+E.slice(1):E=k+E}}f.push(E)}}else f=fde(l,function(L){return Wl(L,!1)});for(var _=0;_<f.length;_++)for(var O=0;O<c.length;O++){var I=u+f[_]+c[O];(!e||s||I)&&t.push(I)}return t}});var Qs=g((N1e,j3)=>{j3.exports=Ei;Ei.Minimatch=At;var Vf={sep:"/"};try{Vf=require("path")}catch(r){}var jD=Ei.GLOBSTAR=At.GLOBSTAR={},bde=B3(),U3={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}},UD="[^/]",WD=UD+"*?",wde="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",xde="(?:(?!(?:\\/|^)\\.).)*?",W3=Dde("().*{}+?[]^$\\!");function Dde(r){return r.split("").reduce(function(e,t){return e[t]=!0,e},{})}var H3=/\/+/;Ei.filter=Sde;function Sde(r,e){return e=e||{},function(t,i,n){return Ei(t,r,e)}}function z3(r,e){r=r||{},e=e||{};var t={};return Object.keys(e).forEach(function(i){t[i]=e[i]}),Object.keys(r).forEach(function(i){t[i]=r[i]}),t}Ei.defaults=function(r){if(!r||!Object.keys(r).length)return Ei;var e=Ei,t=function(n,o,s){return e.minimatch(n,o,z3(r,s))};return t.Minimatch=function(n,o){return new e.Minimatch(n,z3(r,o))},t};At.defaults=function(r){return!r||!Object.keys(r).length?At:Ei.defaults(r).Minimatch};function Ei(r,e,t){if(typeof e!="string")throw new TypeError("glob pattern string required");return t||(t={}),!t.nocomment&&e.charAt(0)==="#"?!1:e.trim()===""?r==="":new At(e,t).match(r)}function At(r,e){if(!(this instanceof At))return new At(r,e);if(typeof r!="string")throw new TypeError("glob pattern string required");e||(e={}),r=r.trim(),Vf.sep!=="/"&&(r=r.split(Vf.sep).join("/")),this.options=e,this.set=[],this.pattern=r,this.regexp=null,this.negate=!1,this.comment=!1,this.empty=!1,this.make()}At.prototype.debug=function(){};At.prototype.make=Ede;function Ede(){if(!this._made){var r=this.pattern,e=this.options;if(!e.nocomment&&r.charAt(0)==="#"){this.comment=!0;return}if(!r){this.empty=!0;return}this.parseNegate();var t=this.globSet=this.braceExpand();e.debug&&(this.debug=console.error),this.debug(this.pattern,t),t=this.globParts=t.map(function(i){return i.split(H3)}),this.debug(this.pattern,t),t=t.map(function(i,n,o){return i.map(this.parse,this)},this),this.debug(this.pattern,t),t=t.filter(function(i){return i.indexOf(!1)===-1}),this.debug(this.pattern,t),this.set=t}}At.prototype.parseNegate=Cde;function Cde(){var r=this.pattern,e=!1,t=this.options,i=0;if(!t.nonegate){for(var n=0,o=r.length;n<o&&r.charAt(n)==="!";n++)e=!e,i++;i&&(this.pattern=r.substr(i)),this.negate=e}}Ei.braceExpand=function(r,e){return G3(r,e)};At.prototype.braceExpand=G3;function G3(r,e){if(e||(this instanceof At?e=this.options:e={}),r=typeof r=="undefined"?this.pattern:r,typeof r=="undefined")throw new TypeError("undefined pattern");return e.nobrace||!r.match(/\{.*\}/)?[r]:bde(r)}At.prototype.parse=_de;var Km={};function _de(r,e){if(r.length>1024*64)throw new TypeError("pattern is too long");var t=this.options;if(!t.noglobstar&&r==="**")return jD;if(r==="")return"";var i="",n=!!t.nocase,o=!1,s=[],a=[],l,u=!1,c=-1,f=-1,p=r.charAt(0)==="."?"":t.dot?"(?!(?:^|\\/)\\.{1,2}(?:$|\\/))":"(?!\\.)",d=this;function h(){if(l){switch(l){case"*":i+=WD,n=!0;break;case"?":i+=UD,n=!0;break;default:i+="\\"+l;break}d.debug("clearStateChar %j %j",l,i),l=!1}}for(var m=0,y=r.length,v;m<y&&(v=r.charAt(m));m++){if(this.debug("%s %s %s %j",r,m,i,v),o&&W3[v]){i+="\\"+v,o=!1;continue}switch(v){case"/":return!1;case"\\":h(),o=!0;continue;case"?":case"*":case"+":case"@":case"!":if(this.debug("%s %s %s %j <-- stateChar",r,m,i,v),u){this.debug(" in class"),v==="!"&&m===f+1&&(v="^"),i+=v;continue}d.debug("call clearStateChar %j",l),h(),l=v,t.noext&&h();continue;case"(":if(u){i+="(";continue}if(!l){i+="\\(";continue}s.push({type:l,start:m-1,reStart:i.length,open:U3[l].open,close:U3[l].close}),i+=l==="!"?"(?:(?!(?:":"(?:",this.debug("plType %j %j",l,i),l=!1;continue;case")":if(u||!s.length){i+="\\)";continue}h(),n=!0;var x=s.pop();i+=x.close,x.type==="!"&&a.push(x),x.reEnd=i.length;continue;case"|":if(u||!s.length||o){i+="\\|",o=!1;continue}h(),i+="|";continue;case"[":if(h(),u){i+="\\"+v;continue}u=!0,f=m,c=i.length,i+=v;continue;case"]":if(m===f+1||!u){i+="\\"+v,o=!1;continue}if(u){var w=r.substring(f+1,m);try{RegExp("["+w+"]")}catch(dr){var E=this.parse(w,Km);i=i.substr(0,c)+"\\["+E[0]+"\\]",n=n||E[1],u=!1;continue}}n=!0,u=!1,i+=v;continue;default:h(),o?o=!1:W3[v]&&!(v==="^"&&u)&&(i+="\\"),i+=v}}for(u&&(w=r.substr(f+1),E=this.parse(w,Km),i=i.substr(0,c)+"\\["+E[0],n=n||E[1]),x=s.pop();x;x=s.pop()){var P=i.slice(x.reStart+x.open.length);this.debug("setting tail",i,x),P=P.replace(/((?:\\{2}){0,64})(\\?)\|/g,function(dr,kn,In){return In||(In="\\"),kn+kn+In+"|"}),this.debug(`tail=%j
|
||
%s`,P,P,x,i);var k=x.type==="*"?WD:x.type==="?"?UD:"\\"+x.type;n=!0,i=i.slice(0,x.reStart)+k+"\\("+P}h(),o&&(i+="\\\\");var _=!1;switch(i.charAt(0)){case".":case"[":case"(":_=!0}for(var O=a.length-1;O>-1;O--){var I=a[O],L=i.slice(0,I.reStart),R=i.slice(I.reStart,I.reEnd-8),F=i.slice(I.reEnd-8,I.reEnd),q=i.slice(I.reEnd);F+=q;var K=L.split("(").length-1,ae=q;for(m=0;m<K;m++)ae=ae.replace(/\)[+*?]?/,"");q=ae;var Pe="";q===""&&e!==Km&&(Pe="$");var We=L+R+q+Pe+F;i=We}if(i!==""&&n&&(i="(?=.)"+i),_&&(i=p+i),e===Km)return[i,n];if(!n)return Pde(r);var Yt=t.nocase?"i":"";try{var Nt=new RegExp("^"+i+"$",Yt)}catch(dr){return new RegExp("$.")}return Nt._glob=r,Nt._src=i,Nt}Ei.makeRe=function(r,e){return new At(r,e||{}).makeRe()};At.prototype.makeRe=Tde;function Tde(){if(this.regexp||this.regexp===!1)return this.regexp;var r=this.set;if(!r.length)return this.regexp=!1,this.regexp;var e=this.options,t=e.noglobstar?WD:e.dot?wde:xde,i=e.nocase?"i":"",n=r.map(function(o){return o.map(function(s){return s===jD?t:typeof s=="string"?Rde(s):s._src}).join("\\/")}).join("|");n="^(?:"+n+")$",this.negate&&(n="^(?!"+n+").*$");try{this.regexp=new RegExp(n,i)}catch(o){this.regexp=!1}return this.regexp}Ei.match=function(r,e,t){t=t||{};var i=new At(e,t);return r=r.filter(function(n){return i.match(n)}),i.options.nonull&&!r.length&&r.push(e),r};At.prototype.match=kde;function kde(r,e){if(this.debug("match",r,this.pattern),this.comment)return!1;if(this.empty)return r==="";if(r==="/"&&e)return!0;var t=this.options;Vf.sep!=="/"&&(r=r.split(Vf.sep).join("/")),r=r.split(H3),this.debug(this.pattern,"split",r);var i=this.set;this.debug(this.pattern,"set",i);var n,o;for(o=r.length-1;o>=0&&(n=r[o],!n);o--);for(o=0;o<i.length;o++){var s=i[o],a=r;t.matchBase&&s.length===1&&(a=[n]);var l=this.matchOne(a,s,e);if(l)return t.flipNegate?!0:!this.negate}return t.flipNegate?!1:this.negate}At.prototype.matchOne=function(r,e,t){var i=this.options;this.debug("matchOne",{this:this,file:r,pattern:e}),this.debug("matchOne",r.length,e.length);for(var n=0,o=0,s=r.length,a=e.length;n<s&&o<a;n++,o++){this.debug("matchOne loop");var l=e[o],u=r[n];if(this.debug(e,l,u),l===!1)return!1;if(l===jD){this.debug("GLOBSTAR",[e,l,u]);var c=n,f=o+1;if(f===a){for(this.debug("** at the end");n<s;n++)if(r[n]==="."||r[n]===".."||!i.dot&&r[n].charAt(0)===".")return!1;return!0}for(;c<s;){var p=r[c];if(this.debug(`
|
||
globstar while`,r,c,e,f,p),this.matchOne(r.slice(c),e.slice(f),t))return this.debug("globstar found match!",c,s,p),!0;if(p==="."||p===".."||!i.dot&&p.charAt(0)==="."){this.debug("dot detected!",r,c,e,f);break}this.debug("globstar swallow a segment, and continue"),c++}return!!(t&&(this.debug(`
|
||
>>> no match, partial?`,r,c,e,f),c===s))}var d;if(typeof l=="string"?(i.nocase?d=u.toLowerCase()===l.toLowerCase():d=u===l,this.debug("string match",l,u,d)):(d=u.match(l),this.debug("pattern match",l,u,d)),!d)return!1}if(n===s&&o===a)return!0;if(n===s)return t;if(o===a){var h=n===s-1&&r[n]==="";return h}throw new Error("wtf?")};function Pde(r){return r.replace(/\\(.)/g,"$1")}function Rde(r){return r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}});var gj=g((sIe,hj)=>{var p0=4294967296,mj=[];for(var ep=0;ep<256;ep++)mj[ep]=(ep>15?"":"0")+ep.toString(16);var tp=hj.exports=function(r,e){r instanceof Buffer?(this.buffer=r,this.offset=e||0):Object.prototype.toString.call(r)=="[object Uint8Array]"?(this.buffer=new Buffer(r),this.offset=e||0):(this.buffer=this.buffer||new Buffer(8),this.offset=0,this.setValue.apply(this,arguments))};tp.MAX_INT=Math.pow(2,53);tp.MIN_INT=-Math.pow(2,53);tp.prototype={constructor:tp,_2scomp:function(){for(var r=this.buffer,e=this.offset,t=1,i=e+7;i>=e;i--){var n=(r[i]^255)+t;r[i]=n&255,t=n>>8}},setValue:function(r,e){var t=!1;if(arguments.length==1)if(typeof r=="number"){if(t=r<0,r=Math.abs(r),e=r%p0,r=r/p0,r>p0)throw new RangeError(r+" is outside Int64 range");r=r|0}else if(typeof r=="string")r=(r+"").replace(/^0x/,""),e=r.substr(-8),r=r.length>8?r.substr(0,r.length-8):"",r=parseInt(r,16),e=parseInt(e,16);else throw new Error(r+" must be a Number or String");for(var i=this.buffer,n=this.offset,o=7;o>=0;o--)i[n+o]=e&255,e=o==4?r:e>>>8;t&&this._2scomp()},toNumber:function(r){for(var e=this.buffer,t=this.offset,i=e[t]&128,n=0,o=1,s=7,a=1;s>=0;s--,a*=256){var l=e[t+s];i&&(l=(l^255)+o,o=l>>8,l=l&255),n+=l*a}return!r&&n>=tp.MAX_INT?i?-Infinity:Infinity:i?-n:n},valueOf:function(){return this.toNumber(!1)},toString:function(r){return this.valueOf().toString(r||10)},toOctetString:function(r){for(var e=new Array(8),t=this.buffer,i=this.offset,n=0;n<8;n++)e[n]=mj[t[i+n]];return e.join(r||"")},toBuffer:function(r){if(r&&this.offset===0)return this.buffer;var e=new Buffer(8);return this.buffer.copy(e,0,this.offset,this.offset+8),e},copy:function(r,e){this.buffer.copy(r,e||0,this.offset,this.offset+8)},compare:function(r){if((this.buffer[this.offset]&128)!=(r.buffer[r.offset]&128))return r.buffer[r.offset]-this.buffer[this.offset];for(var e=0;e<8;e++)if(this.buffer[this.offset+e]!==r.buffer[r.offset+e])return this.buffer[this.offset+e]-r.buffer[r.offset+e];return 0},equals:function(r){return this.compare(r)===0},inspect:function(){return"[Int64 value:"+this+" octets:"+this.toOctetString(" ")+"]"}}});var Pj=g(rp=>{var vj=require("events").EventEmitter,Mde=require("util"),Nde=require("os"),aIe=require("assert"),ip=gj(),Wo=Nde.endianness()=="BE";function yj(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Ot(r){this.buf=Buffer.alloc(yj(r||8192)),this.readOffset=0,this.writeOffset=0}rp.Accumulator=Ot;Ot.prototype.writeAvail=function(){return this.buf.length-this.writeOffset};Ot.prototype.readAvail=function(){return this.writeOffset-this.readOffset};Ot.prototype.reserve=function(r){if(!(r<this.writeAvail())&&(this.readOffset>0&&(this.buf.copy(this.buf,0,this.readOffset,this.writeOffset),this.writeOffset-=this.readOffset,this.readOffset=0),!(r<this.writeAvail()))){var e=Buffer.alloc(yj(this.buf.length+r-this.writeAvail()));this.buf.copy(e),this.buf=e}};Ot.prototype.append=function(r){if(Buffer.isBuffer(r))this.reserve(r.length),r.copy(this.buf,this.writeOffset,0,r.length),this.writeOffset+=r.length;else{var e=Buffer.byteLength(r);this.reserve(e),this.buf.write(r,this.writeOffset),this.writeOffset+=e}};Ot.prototype.assertReadableSize=function(r){if(this.readAvail()<r)throw new Error("wanted to read "+r+" bytes but only have "+this.readAvail())};Ot.prototype.peekString=function(r){return this.assertReadableSize(r),this.buf.toString("utf-8",this.readOffset,this.readOffset+r)};Ot.prototype.readString=function(r){var e=this.peekString(r);return this.readOffset+=r,e};Ot.prototype.peekInt=function(r){switch(this.assertReadableSize(r),r){case 1:return this.buf.readInt8(this.readOffset,r);case 2:return Wo?this.buf.readInt16BE(this.readOffset,r):this.buf.readInt16LE(this.readOffset,r);case 4:return Wo?this.buf.readInt32BE(this.readOffset,r):this.buf.readInt32LE(this.readOffset,r);case 8:var e=this.buf.slice(this.readOffset,this.readOffset+8);return Wo?new ip(e):new ip(bj(e));default:throw new Error("invalid integer size "+r)}};Ot.prototype.readInt=function(r){var e=this.peekInt(r);return e instanceof ip&&isFinite(e.valueOf())&&(e=e.valueOf()),this.readOffset+=r,e};Ot.prototype.peekDouble=function(){return this.assertReadableSize(8),Wo?this.buf.readDoubleBE(this.readOffset):this.buf.readDoubleLE(this.readOffset)};Ot.prototype.readDouble=function(){var r=this.peekDouble();return this.readOffset+=8,r};Ot.prototype.readAdvance=function(r){if(r>0)this.assertReadableSize(r);else if(r<0&&this.readOffset+r<0)throw new Error("advance with negative offset "+r+" would seek off the start of the buffer");this.readOffset+=r};Ot.prototype.writeByte=function(r){this.reserve(1),this.buf.writeInt8(r,this.writeOffset),++this.writeOffset};Ot.prototype.writeInt=function(r,e){switch(this.reserve(e),e){case 1:this.buf.writeInt8(r,this.writeOffset);break;case 2:Wo?this.buf.writeInt16BE(r,this.writeOffset):this.buf.writeInt16LE(r,this.writeOffset);break;case 4:Wo?this.buf.writeInt32BE(r,this.writeOffset):this.buf.writeInt32LE(r,this.writeOffset);break;default:throw new Error("unsupported integer size "+e)}this.writeOffset+=e};Ot.prototype.writeDouble=function(r){this.reserve(8),Wo?this.buf.writeDoubleBE(r,this.writeOffset):this.buf.writeDoubleLE(r,this.writeOffset),this.writeOffset+=8};var d0=0,h0=1,m0=2,g0=3,v0=4,ig=5,ng=6,wj=7,xj=8,Dj=9,Sj=10,Ej=11,qde=12,y0=0,Cj=1,$de=127,Bde=32767,jde=2147483647;function Ar(){vj.call(this),this.buf=new Ot,this.state=y0}Mde.inherits(Ar,vj);rp.BunserBuf=Ar;Ar.prototype.append=function(r,e){if(e)return this.buf.append(r),this.process(e);try{this.buf.append(r)}catch(t){this.emit("error",t);return}this.processLater()};Ar.prototype.processLater=function(){var r=this;process.nextTick(function(){try{r.process(!1)}catch(e){r.emit("error",e)}})};Ar.prototype.process=function(r){if(this.state==y0){if(this.buf.readAvail()<2)return;if(this.expectCode(0),this.expectCode(1),this.pduLen=this.decodeInt(!0),this.pduLen===!1){this.buf.readAdvance(-2);return}this.buf.reserve(this.pduLen),this.state=Cj}if(this.state==Cj){if(this.buf.readAvail()<this.pduLen)return;var e=this.decodeAny();if(r)return e;this.emit("value",e),this.state=y0}!r&&this.buf.readAvail()>0&&this.processLater()};Ar.prototype.raise=function(r){throw new Error(r+", in Buffer of length "+this.buf.buf.length+" ("+this.buf.readAvail()+" readable) at offset "+this.buf.readOffset+" buffer: "+JSON.stringify(this.buf.buf.slice(this.buf.readOffset,this.buf.readOffset+32).toJSON()))};Ar.prototype.expectCode=function(r){var e=this.buf.readInt(1);e!=r&&this.raise("expected bser opcode "+r+" but got "+e)};Ar.prototype.decodeAny=function(){var r=this.buf.peekInt(1);switch(r){case g0:case v0:case ig:case ng:return this.decodeInt();case wj:return this.buf.readAdvance(1),this.buf.readDouble();case xj:return this.buf.readAdvance(1),!0;case Dj:return this.buf.readAdvance(1),!1;case Sj:return this.buf.readAdvance(1),null;case m0:return this.decodeString();case d0:return this.decodeArray();case h0:return this.decodeObject();case Ej:return this.decodeTemplate();default:this.raise("unhandled bser opcode "+r)}};Ar.prototype.decodeArray=function(){this.expectCode(d0);for(var r=this.decodeInt(),e=[],t=0;t<r;++t)e.push(this.decodeAny());return e};Ar.prototype.decodeObject=function(){this.expectCode(h0);for(var r=this.decodeInt(),e={},t=0;t<r;++t){var i=this.decodeString(),n=this.decodeAny();e[i]=n}return e};Ar.prototype.decodeTemplate=function(){this.expectCode(Ej);for(var r=this.decodeArray(),e=this.decodeInt(),t=[],i=0;i<e;++i){for(var n={},o=0;o<r.length;++o){if(this.buf.peekInt(1)==qde){this.buf.readAdvance(1);continue}var s=this.decodeAny();n[r[o]]=s}t.push(n)}return t};Ar.prototype.decodeString=function(){this.expectCode(m0);var r=this.decodeInt();return this.buf.readString(r)};Ar.prototype.decodeInt=function(r){if(r&&this.buf.readAvail()<1)return!1;this.buf.assertReadableSize(1);var e=this.buf.peekInt(1),t=0;switch(e){case g0:t=1;break;case v0:t=2;break;case ig:t=4;break;case ng:t=8;break;default:this.raise("invalid bser int encoding "+e)}return r&&this.buf.readAvail()<1+t?!1:(this.buf.readAdvance(1),this.buf.readInt(t))};function Ude(r){var e=new Ar,t=e.append(r,!0);if(e.buf.readAvail())throw Error("excess data found after input buffer, use BunserBuf instead");if(typeof t=="undefined")throw Error("no bser found in string and no error raised!?");return t}rp.loadFromBuffer=Ude;function bj(r){for(var e=Buffer.alloc(r.length),t=0;t<r.length;t++)e[t]=r[r.length-1-t];return e}function _j(r,e){var t=e.toBuffer();if(Wo){r.writeByte(ng),r.append(t);return}var i=bj(t);r.writeByte(ng),r.append(i)}function og(r,e){var t=Math.abs(e);t<=$de?(r.writeByte(g0),r.writeInt(e,1)):t<=Bde?(r.writeByte(v0),r.writeInt(e,2)):t<=jde?(r.writeByte(ig),r.writeInt(e,4)):_j(r,new ip(e))}function sg(r,e){switch(typeof e){case"number":isFinite(e)&&Math.floor(e)===e?og(r,e):(r.writeByte(wj),r.writeDouble(e));return;case"string":r.writeByte(m0),og(r,Buffer.byteLength(e)),r.append(e);return;case"boolean":r.writeByte(e?xj:Dj);return;case"object":if(e===null){r.writeByte(Sj);return}if(e instanceof ip){_j(r,e);return}if(Array.isArray(e)){r.writeByte(d0),og(r,e.length);for(var t=0;t<e.length;++t)sg(r,e[t]);return}r.writeByte(h0);for(var i=Object.keys(e),n=i.length,t=0;t<i.length;++t){var o=i[t],s=e[o];typeof s=="undefined"&&n--}og(r,n);for(var t=0;t<i.length;++t){var o=i[t],s=e[o];if(typeof s!="undefined"){sg(r,o);try{sg(r,s)}catch(c){throw new Error(c.message+" (while serializing object property with name `"+o+"')")}}}return;default:throw new Error("cannot serialize type "+typeof e+" to BSER")}}function Wde(r){var e=new Ot;e.writeByte(0),e.writeByte(1),e.writeByte(ig),e.writeInt(0,4),sg(e,r);var t=e.writeOffset,i=t-7;return e.writeOffset=3,e.writeInt(i,4),e.writeOffset=t,e.buf.slice(0,t)}rp.dumpToBuffer=Wde});var Oj=g((uIe,Tj)=>{"use strict";var Hde=require("net"),Rj=require("events").EventEmitter,zde=require("util"),Gde=require("child_process"),kj=Pj(),Ij=["subscription","log"];function Vn(r){var e=this;Rj.call(this),this.watchmanBinaryPath="watchman",r&&r.watchmanBinaryPath&&(this.watchmanBinaryPath=r.watchmanBinaryPath.trim()),this.commands=[]}zde.inherits(Vn,Rj);Tj.exports.Client=Vn;Vn.prototype.sendNextCommand=function(){this.currentCommand||(this.currentCommand=this.commands.shift(),!!this.currentCommand&&this.socket.write(kj.dumpToBuffer(this.currentCommand.cmd)))};Vn.prototype.cancelCommands=function(r){var e=new Error(r),t=this.commands;this.commands=[],this.currentCommand&&(t.unshift(this.currentCommand),this.currentCommand=null),t.forEach(function(i){i.cb(e)})};Vn.prototype.connect=function(){var r=this;function e(l){r.bunser=new kj.BunserBuf,r.bunser.on("value",function(u){for(var c=!1,f=0;f<Ij.length;f++){var p=Ij[f];p in u&&(c=p)}if(c)r.emit(c,u);else if(r.currentCommand){var d=r.currentCommand;if(r.currentCommand=null,"error"in u){var h=new Error(u.error);h.watchmanResponse=u,d.cb(h)}else d.cb(null,u)}r.sendNextCommand()}),r.bunser.on("error",function(u){r.emit("error",u)}),r.socket=Hde.createConnection(l),r.socket.on("connect",function(){r.connecting=!1,r.emit("connect"),r.sendNextCommand()}),r.socket.on("error",function(u){r.connecting=!1,r.emit("error",u)}),r.socket.on("data",function(u){r.bunser&&r.bunser.append(u)}),r.socket.on("end",function(){r.socket=null,r.bunser=null,r.cancelCommands("The watchman connection was closed"),r.emit("end")})}if(process.env.WATCHMAN_SOCK){e(process.env.WATCHMAN_SOCK);return}var t=["--no-pretty","get-sockname"],i=null,n=!1;function o(l){n||(n=!0,l.errno==="EACCES"?l.message="The Watchman CLI is installed but cannot be spawned because of a permission problem":l.errno==="ENOENT"&&(l.message="Watchman was not found in PATH. See https://facebook.github.io/watchman/docs/install.html for installation instructions"),console.error("Watchman: ",l.message),r.emit("error",l))}try{i=Gde.spawn(this.watchmanBinaryPath,t,{stdio:["ignore","pipe","pipe"]})}catch(l){o(l);return}var s=[],a=[];i.stdout.on("data",function(l){s.push(l)}),i.stderr.on("data",function(l){l=l.toString("utf8"),a.push(l),console.error(l)}),i.on("error",function(l){o(l)}),i.on("close",function(l,u){if(l!==0){o(new Error(r.watchmanBinaryPath+" "+t.join(" ")+" returned with exit code="+l+", signal="+u+", stderr= "+a.join("")));return}try{var c=JSON.parse(s.join(""));if("error"in c){var f=new Error(c.error);f.watchmanResponse=c,r.emit("error",f);return}e(c.sockname)}catch(p){r.emit("error",p)}})};Vn.prototype.command=function(r,e){if(e=e||function(){},this.commands.push({cmd:r,cb:e}),!this.socket){if(!this.connecting){this.connecting=!0,this.connect();return}return}this.sendNextCommand()};var Fj={"cmd-watch-del-all":"3.1.1","cmd-watch-project":"3.1",relative_root:"3.3","term-dirname":"3.1","term-idirname":"3.1",wildmatch:"3.7"};function Vde(r,e){r=r.split("."),e=e.split(".");for(var t=0;t<3;t++){var i=parseInt(r[t]||"0")-parseInt(e[t]||"0");if(i!=0)return i}return 0}function Aj(r,e){return e in Fj?Vde(r,Fj[e])>=0:!1}Vn.prototype._synthesizeCapabilityCheck=function(r,e,t){r.capabilities={};var i=r.version;return e.forEach(function(n){r.capabilities[n]=Aj(i,n)}),t.forEach(function(n){var o=Aj(i,n);r.capabilities[n]=o,o||(r.error="client required capability `"+n+"` is not supported by this server")}),r};Vn.prototype.capabilityCheck=function(r,e){var t=r.optional||[],i=r.required||[],n=this;this.command(["version",{optional:t,required:i}],function(o,s){if(o){e(o);return}if(!("capabilities"in s)&&(s=n._synthesizeCapabilityCheck(s,t,i),s.error)){o=new Error(s.error),o.watchmanResponse=s,e(o);return}e(null,s)})};Vn.prototype.end=function(){this.cancelCommands("The client was ended"),this.socket&&(this.socket.end(),this.socket=null),this.bunser=null}});var oU=g(ia=>{ia.parse=ia.decode=ihe;ia.stringify=ia.encode=rU;ia.safe=Yl;ia.unsafe=hg;var k0=typeof process!="undefined"&&process.platform==="win32"?`\r
|
||
`:`
|
||
`;function rU(r,e){var t=[],i="";typeof e=="string"?e={section:e,whitespace:!1}:(e=e||{},e.whitespace=e.whitespace===!0);var n=e.whitespace?" = ":"=";return Object.keys(r).forEach(function(o,s,a){var l=r[o];l&&Array.isArray(l)?l.forEach(function(u){i+=Yl(o+"[]")+n+Yl(u)+`
|
||
`}):l&&typeof l=="object"?t.push(o):i+=Yl(o)+n+Yl(l)+k0}),e.section&&i.length&&(i="["+Yl(e.section)+"]"+k0+i),t.forEach(function(o,s,a){var l=iU(o).join("\\."),u=(e.section?e.section+".":"")+l,c=rU(r[o],{section:u,whitespace:e.whitespace});i.length&&c.length&&(i+=k0),i+=c}),i}function iU(r){return r.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(function(e){return e.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")})}function ihe(r){var e={},t=e,i=null,n=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=r.split(/[\r\n]+/g);return o.forEach(function(s,a,l){if(!(!s||s.match(/^\s*[;#]/))){var u=s.match(n);if(!!u){if(u[1]!==void 0){i=hg(u[1]),t=e[i]=e[i]||{};return}var c=hg(u[2]),f=u[3]?hg(u[4]):!0;switch(f){case"true":case"false":case"null":f=JSON.parse(f)}c.length>2&&c.slice(-2)==="[]"&&(c=c.substring(0,c.length-2),t[c]?Array.isArray(t[c])||(t[c]=[t[c]]):t[c]=[]),Array.isArray(t[c])?t[c].push(f):t[c]=f}}}),Object.keys(e).filter(function(s,a,l){if(!e[s]||typeof e[s]!="object"||Array.isArray(e[s]))return!1;var u=iU(s),c=e,f=u.pop(),p=f.replace(/\\\./g,".");return u.forEach(function(d,h,m){(!c[d]||typeof c[d]!="object")&&(c[d]={}),c=c[d]}),c===e&&p===f?!1:(c[p]=e[s],!0)}).forEach(function(s,a,l){delete e[s]}),e}function nU(r){return r.charAt(0)==='"'&&r.slice(-1)==='"'||r.charAt(0)==="'"&&r.slice(-1)==="'"}function Yl(r){return typeof r!="string"||r.match(/[=\r\n]/)||r.match(/^\[/)||r.length>1&&nU(r)||r!==r.trim()?JSON.stringify(r):r.replace(/;/g,"\\;").replace(/#/g,"\\#")}function hg(r,e){if(r=(r||"").trim(),nU(r)){r.charAt(0)==="'"&&(r=r.substr(1,r.length-2));try{r=JSON.parse(r)}catch(a){}}else{for(var t=!1,i="",n=0,o=r.length;n<o;n++){var s=r.charAt(n);if(t)"\\;#".indexOf(s)!==-1?i+=s:i+="\\"+s,t=!1;else{if(";#".indexOf(s)!==-1)break;s==="\\"?t=!0:i+=s}}return t&&(i+="\\"),i.trim()}return r}});var lU=g((FAe,sU)=>{"use strict";var I0=1,aU=2;function nhe(){return""}function ohe(r,e,t){return r.slice(e,t).replace(/\S/g," ")}sU.exports=function(r,e){e=e||{};for(var t,i,n=!1,o=!1,s=0,a="",l=e.whitespace===!1?nhe:ohe,u=0;u<r.length;u++){if(t=r[u],i=r[u+1],!o&&t==='"'){var c=r[u-1]==="\\"&&r[u-2]!=="\\";c||(n=!n)}if(!n){if(!o&&t+i==="//")a+=r.slice(s,u),s=u,o=I0,u++;else if(o===I0&&t+i===`\r
|
||
`){u++,o=!1,a+=l(r,s,u),s=u;continue}else if(o===I0&&t===`
|
||
`)o=!1,a+=l(r,s,u),s=u;else if(!o&&t+i==="/*"){a+=r.slice(s,u),s=u,o=aU,u++;continue}else if(o===aU&&t+i==="*/"){u++,o=!1,a+=l(r,s,u+1),s=u+1;continue}}}return a+(o?l(r.substr(s)):r.substr(s))}});var cU=g(Xl=>{"use strict";var uU=require("fs"),she=oU(),up=require("path"),ahe=lU(),lhe=Xl.parse=function(r){return/^\s*{/.test(r)?JSON.parse(ahe(r)):she.parse(r)},uhe=Xl.file=function(){var r=[].slice.call(arguments).filter(function(n){return n!=null});for(var e in r)if(typeof r[e]!="string")return;var t=up.join.apply(null,r),i;try{return uU.readFileSync(t,"utf-8")}catch(n){return}},AAe=Xl.json=function(){var r=uhe.apply(null,arguments);return r?lhe(r):null},OAe=Xl.env=function(r,e){e=e||process.env;var t={},i=r.length;for(var n in e)if(n.toLowerCase().indexOf(r.toLowerCase())===0){for(var o=n.substring(i).split("__"),s;(s=o.indexOf(""))>-1;)o.splice(s,1);var a=t;o.forEach(function(u,c){!u||typeof a!="object"||(c===o.length-1&&(a[u]=e[n]),a[u]===void 0&&(a[u]={}),a=a[u])})}return t},LAe=Xl.find=function(){var r=up.join.apply(null,[].slice.call(arguments));function e(t,i){var n=up.join(t,i);try{return uU.statSync(n),n}catch(o){if(up.dirname(t)!==t)return e(up.dirname(t),i)}}return e(process.cwd(),r)}});var gU=g((NAe,fU)=>{"use strict";function pU(r){return r instanceof Buffer||r instanceof Date||r instanceof RegExp}function dU(r){if(r instanceof Buffer){var e=Buffer.alloc?Buffer.alloc(r.length):new Buffer(r.length);return r.copy(e),e}else{if(r instanceof Date)return new Date(r.getTime());if(r instanceof RegExp)return new RegExp(r);throw new Error("Unexpected situation")}}function hU(r){var e=[];return r.forEach(function(t,i){typeof t=="object"&&t!==null?Array.isArray(t)?e[i]=hU(t):pU(t)?e[i]=dU(t):e[i]=F0({},t):e[i]=t}),e}function mU(r,e){return e==="__proto__"?void 0:r[e]}var F0=fU.exports=function(){if(arguments.length<1||typeof arguments[0]!="object")return!1;if(arguments.length<2)return arguments[0];var r=arguments[0],e=Array.prototype.slice.call(arguments,1),t,i,n;return e.forEach(function(o){typeof o!="object"||o===null||Array.isArray(o)||Object.keys(o).forEach(function(s){if(i=mU(r,s),t=mU(o,s),t!==r)if(typeof t!="object"||t===null){r[s]=t;return}else if(Array.isArray(t)){r[s]=hU(t);return}else if(pU(t)){r[s]=dU(t);return}else if(typeof i!="object"||i===null||Array.isArray(i)){r[s]=F0({},t);return}else{r[s]=F0(i,t);return}})}),r}});var bU=g((qAe,vU)=>{vU.exports=function(r,e){e||(e={});var t={bools:{},strings:{},unknownFn:null};typeof e.unknown=="function"&&(t.unknownFn=e.unknown),typeof e.boolean=="boolean"&&e.boolean?t.allBools=!0:[].concat(e.boolean).filter(Boolean).forEach(function(E){t.bools[E]=!0});var i={};Object.keys(e.alias||{}).forEach(function(E){i[E]=[].concat(e.alias[E]),i[E].forEach(function(P){i[P]=[E].concat(i[E].filter(function(k){return P!==k}))})}),[].concat(e.string).filter(Boolean).forEach(function(E){t.strings[E]=!0,i[E]&&(t.strings[i[E]]=!0)});var n=e.default||{},o={_:[]};Object.keys(t.bools).forEach(function(E){l(E,n[E]===void 0?!1:n[E])});var s=[];r.indexOf("--")!==-1&&(s=r.slice(r.indexOf("--")+1),r=r.slice(0,r.indexOf("--")));function a(E,P){return t.allBools&&/^--[^=]+$/.test(P)||t.strings[E]||t.bools[E]||i[E]}function l(E,P,k){if(!(k&&t.unknownFn&&!a(E,k)&&t.unknownFn(k)===!1)){var _=!t.strings[E]&&yU(P)?Number(P):P;u(o,E.split("."),_),(i[E]||[]).forEach(function(O){u(o,O.split("."),_)})}}function u(E,P,k){for(var _=E,O=0;O<P.length-1;O++){var I=P[O];if(I==="__proto__")return;_[I]===void 0&&(_[I]={}),(_[I]===Object.prototype||_[I]===Number.prototype||_[I]===String.prototype)&&(_[I]={}),_[I]===Array.prototype&&(_[I]=[]),_=_[I]}var I=P[P.length-1];I!=="__proto__"&&((_===Object.prototype||_===Number.prototype||_===String.prototype)&&(_={}),_===Array.prototype&&(_=[]),_[I]===void 0||t.bools[I]||typeof _[I]=="boolean"?_[I]=k:Array.isArray(_[I])?_[I].push(k):_[I]=[_[I],k])}function c(E){return i[E].some(function(P){return t.bools[P]})}for(var f=0;f<r.length;f++){var p=r[f];if(/^--.+=/.test(p)){var d=p.match(/^--([^=]+)=([\s\S]*)$/),h=d[1],m=d[2];t.bools[h]&&(m=m!=="false"),l(h,m,p)}else if(/^--no-.+/.test(p)){var h=p.match(/^--no-(.+)/)[1];l(h,!1,p)}else if(/^--.+/.test(p)){var h=p.match(/^--(.+)/)[1],y=r[f+1];y!==void 0&&!/^-/.test(y)&&!t.bools[h]&&!t.allBools&&(i[h]?!c(h):!0)?(l(h,y,p),f++):/^(true|false)$/.test(y)?(l(h,y==="true",p),f++):l(h,t.strings[h]?"":!0,p)}else if(/^-[^-]+/.test(p)){for(var v=p.slice(1,-1).split(""),x=!1,w=0;w<v.length;w++){var y=p.slice(w+2);if(y==="-"){l(v[w],y,p);continue}if(/[A-Za-z]/.test(v[w])&&/=/.test(y)){l(v[w],y.split("=")[1],p),x=!0;break}if(/[A-Za-z]/.test(v[w])&&/-?\d+(\.\d*)?(e-?\d+)?$/.test(y)){l(v[w],y,p),x=!0;break}if(v[w+1]&&v[w+1].match(/\W/)){l(v[w],p.slice(w+2),p),x=!0;break}else l(v[w],t.strings[v[w]]?"":!0,p)}var h=p.slice(-1)[0];!x&&h!=="-"&&(r[f+1]&&!/^(-|--)[^-]/.test(r[f+1])&&!t.bools[h]&&(i[h]?!c(h):!0)?(l(h,r[f+1],p),f++):r[f+1]&&/^(true|false)$/.test(r[f+1])?(l(h,r[f+1]==="true",p),f++):l(h,t.strings[h]?"":!0,p))}else if((!t.unknownFn||t.unknownFn(p)!==!1)&&o._.push(t.strings._||!yU(p)?p:Number(p)),e.stopEarly){o._.push.apply(o._,r.slice(f+1));break}}return Object.keys(n).forEach(function(E){che(o,E.split("."))||(u(o,E.split("."),n[E]),(i[E]||[]).forEach(function(P){u(o,P.split("."),n[E])}))}),e["--"]?(o["--"]=new Array,s.forEach(function(E){o["--"].push(E)})):s.forEach(function(E){o._.push(E)}),o};function che(r,e){var t=r;e.slice(0,-1).forEach(function(n){t=t[n]||{}});var i=e[e.length-1];return i in t}function yU(r){return typeof r=="number"||/^0x[0-9a-f]+$/i.test(r)?!0:/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(r)}});var SU=g(($Ae,wU)=>{var cp=cU(),Zl=require("path").join,fhe=gU(),xU="/etc",DU=process.platform==="win32",fp=DU?process.env.USERPROFILE:process.env.HOME;wU.exports=function(r,e,t,i){if(typeof r!="string")throw new Error("rc(name): name *must* be string");t||(t=bU()(process.argv.slice(2))),e=(typeof e=="string"?cp.json(e):e)||{},i=i||cp.parse;var n=cp.env(r+"_"),o=[e],s=[];function a(l){if(!(s.indexOf(l)>=0)){var u=cp.file(l);u&&(o.push(i(u)),s.push(l))}}return DU||[Zl(xU,r,"config"),Zl(xU,r+"rc")].forEach(a),fp&&[Zl(fp,".config",r,"config"),Zl(fp,".config",r),Zl(fp,"."+r,"config"),Zl(fp,"."+r+"rc")].forEach(a),a(cp.find("."+r+"rc")),n.config&&a(n.config),t.config&&a(t.config),fhe.apply(null,o.concat([n,t,s.length?{configs:s,config:s[s.length-1]}:void 0]))}});var _U=g((A0,EU)=>{var mg=require("buffer"),Kn=mg.Buffer;function CU(r,e){for(var t in r)e[t]=r[t]}Kn.from&&Kn.alloc&&Kn.allocUnsafe&&Kn.allocUnsafeSlow?EU.exports=mg:(CU(mg,A0),A0.Buffer=Ql);function Ql(r,e,t){return Kn(r,e,t)}CU(Kn,Ql);Ql.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return Kn(r,e,t)};Ql.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var i=Kn(r);return e!==void 0?typeof t=="string"?i.fill(e,t):i.fill(e):i.fill(0),i};Ql.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Kn(r)};Ql.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return mg.SlowBuffer(r)}});var FU=g((BAe,O0)=>{"use strict";O0.exports=phe;O0.exports.parse=dhe;var PU=require("path").basename,hhe=_U().Buffer,mhe=/[\x00-\x20"'()*,/:;<=>?@[\\\]{}\x7f]/g,ghe=/%[0-9A-Fa-f]{2}/,vhe=/%([0-9A-Fa-f]{2})/g,TU=/[^\x20-\x7e\xa0-\xff]/g,yhe=/\\([\u0000-\u007f])/g,bhe=/([\\"])/g,RU=/;[\x09\x20]*([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*=[\x09\x20]*("(?:[\x20!\x23-\x5b\x5d-\x7e\x80-\xff]|\\[\x20-\x7e])*"|[!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*/g,whe=/^[\x20-\x7e\x80-\xff]+$/,xhe=/^[!#$%&'*+.0-9A-Z^_`a-z|~-]+$/,Dhe=/^([A-Za-z0-9!#$%&+\-^_`{}~]+)'(?:[A-Za-z]{2,3}(?:-[A-Za-z]{3}){0,3}|[A-Za-z]{4,8}|)'((?:%[0-9A-Fa-f]{2}|[A-Za-z0-9!#$&+.^_`|~-])+)$/,She=/^([!#$%&'*+.0-9A-Z^_`a-z|~-]+)[\x09\x20]*(?:$|;)/;function phe(r,e){var t=e||{},i=t.type||"attachment",n=Ehe(r,t.fallback);return Che(new kU(i,n))}function Ehe(r,e){if(r!==void 0){var t={};if(typeof r!="string")throw new TypeError("filename must be a string");if(e===void 0&&(e=!0),typeof e!="string"&&typeof e!="boolean")throw new TypeError("fallback must be a string or boolean");if(typeof e=="string"&&TU.test(e))throw new TypeError("fallback must be ISO-8859-1 string");var i=PU(r),n=whe.test(i),o=typeof e!="string"?e&&IU(i):PU(e),s=typeof o=="string"&&o!==i;return(s||!n||ghe.test(i))&&(t["filename*"]=i),(n||s)&&(t.filename=s?o:i),t}}function Che(r){var e=r.parameters,t=r.type;if(!t||typeof t!="string"||!xhe.test(t))throw new TypeError("invalid type");var i=String(t).toLowerCase();if(e&&typeof e=="object")for(var n,o=Object.keys(e).sort(),s=0;s<o.length;s++){n=o[s];var a=n.substr(-1)==="*"?Phe(e[n]):_he(e[n]);i+="; "+n+"="+a}return i}function Rhe(r){var e=Dhe.exec(r);if(!e)throw new TypeError("invalid extended field value");var t=e[1].toLowerCase(),i=e[2],n,o=i.replace(vhe,The);switch(t){case"iso-8859-1":n=IU(o);break;case"utf-8":n=hhe.from(o,"binary").toString("utf8");break;default:throw new TypeError("unsupported charset in extended field")}return n}function IU(r){return String(r).replace(TU,"?")}function dhe(r){if(!r||typeof r!="string")throw new TypeError("argument string is required");var e=She.exec(r);if(!e)throw new TypeError("invalid type format");var t=e[0].length,i=e[1].toLowerCase(),n,o=[],s={},a;for(t=RU.lastIndex=e[0].substr(-1)===";"?t-1:t;e=RU.exec(r);){if(e.index!==t)throw new TypeError("invalid parameter format");if(t+=e[0].length,n=e[1].toLowerCase(),a=e[2],o.indexOf(n)!==-1)throw new TypeError("invalid duplicate parameter");if(o.push(n),n.indexOf("*")+1===n.length){n=n.slice(0,-1),a=Rhe(a),s[n]=a;continue}typeof s[n]!="string"&&(a[0]==='"'&&(a=a.substr(1,a.length-2).replace(yhe,"$1")),s[n]=a)}if(t!==-1&&t!==r.length)throw new TypeError("invalid parameter format");return new kU(i,s)}function The(r,e){return String.fromCharCode(parseInt(e,16))}function khe(r){return"%"+String(r).charCodeAt(0).toString(16).toUpperCase()}function _he(r){var e=String(r);return'"'+e.replace(bhe,"\\$1")+'"'}function Phe(r){var e=String(r),t=encodeURIComponent(e).replace(mhe,khe);return"UTF-8''"+t}function kU(r,e){this.type=r,this.parameters=e}});var OU=g((jAe,AU)=>{var L0;try{L0=gt()("follow-redirects")}catch(r){L0=function(){}}AU.exports=L0});var B0=g((UAe,M0)=>{var eu=require("url"),N0=eu.URL,Ihe=require("http"),Fhe=require("https"),LU=require("stream").Writable,Ahe=require("assert"),MU=OU(),q0=Object.create(null);["abort","aborted","connect","error","socket","timeout"].forEach(function(r){q0[r]=function(e,t,i){this._redirectable.emit(r,e,t,i)}});var Ohe=gg("ERR_FR_REDIRECTION_FAILURE",""),Lhe=gg("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded"),Mhe=gg("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),Nhe=gg("ERR_STREAM_WRITE_AFTER_END","write after end");function Ti(r,e){LU.call(this),this._sanitizeOptions(r),this._options=r,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var t=this;this._onNativeResponse=function(i){t._processResponse(i)},this._performRequest()}Ti.prototype=Object.create(LU.prototype);Ti.prototype.write=function(r,e,t){if(this._ending)throw new Nhe;if(!(typeof r=="string"||typeof r=="object"&&"length"in r))throw new TypeError("data should be a string, Buffer or Uint8Array");if(typeof e=="function"&&(t=e,e=null),r.length===0){t&&t();return}this._requestBodyLength+r.length<=this._options.maxBodyLength?(this._requestBodyLength+=r.length,this._requestBodyBuffers.push({data:r,encoding:e}),this._currentRequest.write(r,e,t)):(this.emit("error",new Mhe),this.abort())};Ti.prototype.end=function(r,e,t){if(typeof r=="function"?(t=r,r=e=null):typeof e=="function"&&(t=e,e=null),!r)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var i=this,n=this._currentRequest;this.write(r,e,function(){i._ended=!0,n.end(null,null,t)}),this._ending=!0}};Ti.prototype.setHeader=function(r,e){this._options.headers[r]=e,this._currentRequest.setHeader(r,e)};Ti.prototype.removeHeader=function(r){delete this._options.headers[r],this._currentRequest.removeHeader(r)};Ti.prototype.setTimeout=function(r,e){if(e&&this.once("timeout",e),this.socket)NU(this,r);else{var t=this;this._currentRequest.once("socket",function(){NU(t,r)})}return this.once("response",qU),this.once("error",qU),this};function NU(r,e){clearTimeout(r._timeout),r._timeout=setTimeout(function(){r.emit("timeout")},e)}function qU(){clearTimeout(this._timeout)}["abort","flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(r){Ti.prototype[r]=function(e,t){return this._currentRequest[r](e,t)}});["aborted","connection","socket"].forEach(function(r){Object.defineProperty(Ti.prototype,r,{get:function(){return this._currentRequest[r]}})});Ti.prototype._sanitizeOptions=function(r){if(r.headers||(r.headers={}),r.host&&(r.hostname||(r.hostname=r.host),delete r.host),!r.pathname&&r.path){var e=r.path.indexOf("?");e<0?r.pathname=r.path:(r.pathname=r.path.substring(0,e),r.search=r.path.substring(e))}};Ti.prototype._performRequest=function(){var r=this._options.protocol,e=this._options.nativeProtocols[r];if(!e){this.emit("error",new TypeError("Unsupported protocol "+r));return}if(this._options.agents){var t=r.substr(0,r.length-1);this._options.agent=this._options.agents[t]}var i=this._currentRequest=e.request(this._options,this._onNativeResponse);this._currentUrl=eu.format(this._options),i._redirectable=this;for(var n in q0)n&&i.on(n,q0[n]);if(this._isRedirect){var o=0,s=this,a=this._requestBodyBuffers;(function l(u){if(i===s._currentRequest)if(u)s.emit("error",u);else if(o<a.length){var c=a[o++];i.finished||i.write(c.data,c.encoding,l)}else s._ended&&i.end()})()}};Ti.prototype._processResponse=function(r){var e=r.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:r.headers,statusCode:e});var t=r.headers.location;if(t&&this._options.followRedirects!==!1&&e>=300&&e<400){if(this._currentRequest.removeAllListeners(),this._currentRequest.on("error",qhe),this._currentRequest.abort(),r.destroy(),++this._redirectCount>this._options.maxRedirects){this.emit("error",new Lhe);return}((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],$0(/^content-/i,this._options.headers));var i=$0(/^host$/i,this._options.headers)||eu.parse(this._currentUrl).hostname,n=eu.resolve(this._currentUrl,t);MU("redirecting to",n),this._isRedirect=!0;var o=eu.parse(n);if(Object.assign(this._options,o),o.hostname!==i&&$0(/^authorization$/i,this._options.headers),typeof this._options.beforeRedirect=="function"){var s={headers:r.headers};try{this._options.beforeRedirect.call(null,this._options,s)}catch(l){this.emit("error",l);return}this._sanitizeOptions(this._options)}try{this._performRequest()}catch(l){var a=new Ohe("Redirected request failed: "+l.message);a.cause=l,this.emit("error",a)}}else r.responseUrl=this._currentUrl,r.redirects=this._redirects,this.emit("response",r),this._requestBodyBuffers=[]};function BU(r){var e={maxRedirects:21,maxBodyLength:10*1024*1024},t={};return Object.keys(r).forEach(function(i){var n=i+":",o=t[n]=r[i],s=e[i]=Object.create(o);s.request=function(a,l,u){if(typeof a=="string"){var c=a;try{a=$U(new N0(c))}catch(f){a=eu.parse(c)}}else N0&&a instanceof N0?a=$U(a):(u=l,l=a,a={protocol:n});return typeof l=="function"&&(u=l,l=null),l=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},a,l),l.nativeProtocols=t,Ahe.equal(l.protocol,n,"protocol mismatch"),MU("options",l),new Ti(l,u)},s.get=function(a,l,u){var c=s.request(a,l,u);return c.end(),c}}),e}function qhe(){}function $U(r){var e={protocol:r.protocol,hostname:r.hostname.startsWith("[")?r.hostname.slice(1,-1):r.hostname,hash:r.hash,search:r.search,pathname:r.pathname,path:r.pathname+r.search,href:r.href};return r.port!==""&&(e.port=Number(r.port)),e}function $0(r,e){var t;for(var i in e)r.test(i)&&(t=e[i],delete e[i]);return t}function gg(r,e){function t(i){Error.captureStackTrace(this,this.constructor),this.message=i||e}return t.prototype=new Error,t.prototype.constructor=t,t.prototype.name="Error ["+r+"]",t.prototype.code=r,t}M0.exports=BU({http:Ihe,https:Fhe});M0.exports.wrap=BU});var tu=g((HAe,jU)=>{"use strict";var UU=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"]]),WAe=jU.exports=r=>r?Object.keys(r).map(e=>[UU.has(e)?UU.get(e):e,r[e]]).reduce((e,t)=>(e[t[0]]=t[1],e),Object.create(null)):{}});var HU=g((zAe,WU)=>{"use strict";WU.exports=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var vg=g((GAe,zU)=>{"use strict";zU.exports=Ie;Ie.Node=na;Ie.create=Ie;function Ie(r){var e=this;if(e instanceof Ie||(e=new Ie),e.tail=null,e.head=null,e.length=0,r&&typeof r.forEach=="function")r.forEach(function(n){e.push(n)});else if(arguments.length>0)for(var t=0,i=arguments.length;t<i;t++)e.push(arguments[t]);return e}Ie.prototype.removeNode=function(r){if(r.list!==this)throw new Error("removing node which does not belong to this list");var e=r.next,t=r.prev;return e&&(e.prev=t),t&&(t.next=e),r===this.head&&(this.head=e),r===this.tail&&(this.tail=t),r.list.length--,r.next=null,r.prev=null,r.list=null,e};Ie.prototype.unshiftNode=function(r){if(r!==this.head){r.list&&r.list.removeNode(r);var e=this.head;r.list=this,r.next=e,e&&(e.prev=r),this.head=r,this.tail||(this.tail=r),this.length++}};Ie.prototype.pushNode=function(r){if(r!==this.tail){r.list&&r.list.removeNode(r);var e=this.tail;r.list=this,r.prev=e,e&&(e.next=r),this.tail=r,this.head||(this.head=r),this.length++}};Ie.prototype.push=function(){for(var r=0,e=arguments.length;r<e;r++)$he(this,arguments[r]);return this.length};Ie.prototype.unshift=function(){for(var r=0,e=arguments.length;r<e;r++)Bhe(this,arguments[r]);return this.length};Ie.prototype.pop=function(){if(!!this.tail){var r=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,r}};Ie.prototype.shift=function(){if(!!this.head){var r=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,r}};Ie.prototype.forEach=function(r,e){e=e||this;for(var t=this.head,i=0;t!==null;i++)r.call(e,t.value,i,this),t=t.next};Ie.prototype.forEachReverse=function(r,e){e=e||this;for(var t=this.tail,i=this.length-1;t!==null;i--)r.call(e,t.value,i,this),t=t.prev};Ie.prototype.get=function(r){for(var e=0,t=this.head;t!==null&&e<r;e++)t=t.next;if(e===r&&t!==null)return t.value};Ie.prototype.getReverse=function(r){for(var e=0,t=this.tail;t!==null&&e<r;e++)t=t.prev;if(e===r&&t!==null)return t.value};Ie.prototype.map=function(r,e){e=e||this;for(var t=new Ie,i=this.head;i!==null;)t.push(r.call(e,i.value,this)),i=i.next;return t};Ie.prototype.mapReverse=function(r,e){e=e||this;for(var t=new Ie,i=this.tail;i!==null;)t.push(r.call(e,i.value,this)),i=i.prev;return t};Ie.prototype.reduce=function(r,e){var t,i=this.head;if(arguments.length>1)t=e;else if(this.head)i=this.head.next,t=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;i!==null;n++)t=r(t,i.value,n),i=i.next;return t};Ie.prototype.reduceReverse=function(r,e){var t,i=this.tail;if(arguments.length>1)t=e;else if(this.tail)i=this.tail.prev,t=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=this.length-1;i!==null;n--)t=r(t,i.value,n),i=i.prev;return t};Ie.prototype.toArray=function(){for(var r=new Array(this.length),e=0,t=this.head;t!==null;e++)r[e]=t.value,t=t.next;return r};Ie.prototype.toArrayReverse=function(){for(var r=new Array(this.length),e=0,t=this.tail;t!==null;e++)r[e]=t.value,t=t.prev;return r};Ie.prototype.slice=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new Ie;if(e<r||e<0)return t;r<0&&(r=0),e>this.length&&(e=this.length);for(var i=0,n=this.head;n!==null&&i<r;i++)n=n.next;for(;n!==null&&i<e;i++,n=n.next)t.push(n.value);return t};Ie.prototype.sliceReverse=function(r,e){e=e||this.length,e<0&&(e+=this.length),r=r||0,r<0&&(r+=this.length);var t=new Ie;if(e<r||e<0)return t;r<0&&(r=0),e>this.length&&(e=this.length);for(var i=this.length,n=this.tail;n!==null&&i>e;i--)n=n.prev;for(;n!==null&&i>r;i--,n=n.prev)t.push(n.value);return t};Ie.prototype.splice=function(r,e,...t){r>this.length&&(r=this.length-1),r<0&&(r=this.length+r);for(var i=0,n=this.head;n!==null&&i<r;i++)n=n.next;for(var o=[],i=0;n&&i<e;i++)o.push(n.value),n=this.removeNode(n);n===null&&(n=this.tail),n!==this.head&&n!==this.tail&&(n=n.prev);for(var i=0;i<t.length;i++)n=jhe(this,n,t[i]);return o};Ie.prototype.reverse=function(){for(var r=this.head,e=this.tail,t=r;t!==null;t=t.prev){var i=t.prev;t.prev=t.next,t.next=i}return this.head=e,this.tail=r,this};function jhe(r,e,t){var i=e===r.head?new na(t,null,e,r):new na(t,e,e.next,r);return i.next===null&&(r.tail=i),i.prev===null&&(r.head=i),r.length++,i}function $he(r,e){r.tail=new na(e,r.tail,null,r),r.head||(r.head=r.tail),r.length++}function Bhe(r,e){r.head=new na(e,null,r.head,r),r.tail||(r.tail=r.head),r.length++}function na(r,e,t,i){if(!(this instanceof na))return new na(r,e,t,i);this.list=i,this.value=r,e?(e.next=this,this.prev=e):this.prev=null,t?(t.prev=this,this.next=t):this.next=null}try{HU()(Ie)}catch(r){}});var ru=g((VAe,GU)=>{"use strict";var Uhe=require("events"),VU=require("stream"),pp=vg(),KU=require("string_decoder").StringDecoder,Jn=Symbol("EOF"),dp=Symbol("maybeEmitEnd"),zo=Symbol("emittedEnd"),yg=Symbol("emittingEnd"),bg=Symbol("closed"),JU=Symbol("read"),YU=Symbol("flush"),XU=Symbol("flushChunk"),Or=Symbol("encoding"),Yn=Symbol("decoder"),wg=Symbol("flowing"),hp=Symbol("paused"),mp=Symbol("resume"),Lr=Symbol("bufferLength"),ZU=Symbol("bufferPush"),j0=Symbol("bufferShift"),lr=Symbol("objectMode"),ur=Symbol("destroyed"),QU=global._MP_NO_ITERATOR_SYMBOLS_!=="1",Whe=QU&&Symbol.asyncIterator||Symbol("asyncIterator not implemented"),Hhe=QU&&Symbol.iterator||Symbol("iterator not implemented"),e6=r=>r==="end"||r==="finish"||r==="prefinish",zhe=r=>r instanceof ArrayBuffer||typeof r=="object"&&r.constructor&&r.constructor.name==="ArrayBuffer"&&r.byteLength>=0,Ghe=r=>!Buffer.isBuffer(r)&&ArrayBuffer.isView(r);GU.exports=class t6 extends VU{constructor(e){super();this[wg]=!1,this[hp]=!1,this.pipes=new pp,this.buffer=new pp,this[lr]=e&&e.objectMode||!1,this[lr]?this[Or]=null:this[Or]=e&&e.encoding||null,this[Or]==="buffer"&&(this[Or]=null),this[Yn]=this[Or]?new KU(this[Or]):null,this[Jn]=!1,this[zo]=!1,this[yg]=!1,this[bg]=!1,this.writable=!0,this.readable=!0,this[Lr]=0,this[ur]=!1}get bufferLength(){return this[Lr]}get encoding(){return this[Or]}set encoding(e){if(this[lr])throw new Error("cannot set encoding in objectMode");if(this[Or]&&e!==this[Or]&&(this[Yn]&&this[Yn].lastNeed||this[Lr]))throw new Error("cannot change encoding");this[Or]!==e&&(this[Yn]=e?new KU(e):null,this.buffer.length&&(this.buffer=this.buffer.map(t=>this[Yn].write(t)))),this[Or]=e}setEncoding(e){this.encoding=e}get objectMode(){return this[lr]}set objectMode(e){this[lr]=this[lr]||!!e}write(e,t,i){if(this[Jn])throw new Error("write after end");if(this[ur])return this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;if(typeof t=="function"&&(i=t,t="utf8"),t||(t="utf8"),!this[lr]&&!Buffer.isBuffer(e)&&(Ghe(e)?e=Buffer.from(e.buffer,e.byteOffset,e.byteLength):zhe(e)?e=Buffer.from(e):typeof e!="string"&&(this.objectMode=!0)),!this.objectMode&&!e.length){let n=this.flowing;return this[Lr]!==0&&this.emit("readable"),i&&i(),n}typeof e=="string"&&!this[lr]&&!(t===this[Or]&&!this[Yn].lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[Or]&&(e=this[Yn].write(e));try{return this.flowing?(this.emit("data",e),this.flowing):(this[ZU](e),!1)}finally{this[Lr]!==0&&this.emit("readable"),i&&i()}}read(e){if(this[ur])return null;try{return this[Lr]===0||e===0||e>this[Lr]?null:(this[lr]&&(e=null),this.buffer.length>1&&!this[lr]&&(this.encoding?this.buffer=new pp([Array.from(this.buffer).join("")]):this.buffer=new pp([Buffer.concat(Array.from(this.buffer),this[Lr])])),this[JU](e||null,this.buffer.head.value))}finally{this[dp]()}}[JU](e,t){return e===t.length||e===null?this[j0]():(this.buffer.head.value=t.slice(e),t=t.slice(0,e),this[Lr]-=e),this.emit("data",t),!this.buffer.length&&!this[Jn]&&this.emit("drain"),t}end(e,t,i){return typeof e=="function"&&(i=e,e=null),typeof t=="function"&&(i=t,t="utf8"),e&&this.write(e,t),i&&this.once("end",i),this[Jn]=!0,this.writable=!1,(this.flowing||!this[hp])&&this[dp](),this}[mp](){this[ur]||(this[hp]=!1,this[wg]=!0,this.emit("resume"),this.buffer.length?this[YU]():this[Jn]?this[dp]():this.emit("drain"))}resume(){return this[mp]()}pause(){this[wg]=!1,this[hp]=!0}get destroyed(){return this[ur]}get flowing(){return this[wg]}get paused(){return this[hp]}[ZU](e){return this[lr]?this[Lr]+=1:this[Lr]+=e.length,this.buffer.push(e)}[j0](){return this.buffer.length&&(this[lr]?this[Lr]-=1:this[Lr]-=this.buffer.head.value.length),this.buffer.shift()}[YU](){do;while(this[XU](this[j0]()));!this.buffer.length&&!this[Jn]&&this.emit("drain")}[XU](e){return e?(this.emit("data",e),this.flowing):!1}pipe(e,t){if(this[ur])return;let i=this[zo];t=t||{},e===process.stdout||e===process.stderr?t.end=!1:t.end=t.end!==!1;let n={dest:e,opts:t,ondrain:o=>this[mp]()};return this.pipes.push(n),e.on("drain",n.ondrain),this[mp](),i&&n.opts.end&&n.dest.end(),e}addListener(e,t){return this.on(e,t)}on(e,t){try{return super.on(e,t)}finally{e==="data"&&!this.pipes.length&&!this.flowing?this[mp]():e6(e)&&this[zo]&&(super.emit(e),this.removeAllListeners(e))}}get emittedEnd(){return this[zo]}[dp](){!this[yg]&&!this[zo]&&!this[ur]&&this.buffer.length===0&&this[Jn]&&(this[yg]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[bg]&&this.emit("close"),this[yg]=!1)}emit(e,t){if(e!=="error"&&e!=="close"&&e!==ur&&this[ur])return;if(e==="data"){if(!t)return;this.pipes.length&&this.pipes.forEach(n=>n.dest.write(t)===!1&&this.pause())}else if(e==="end"){if(this[zo]===!0)return;this[zo]=!0,this.readable=!1,this[Yn]&&(t=this[Yn].end(),t&&(this.pipes.forEach(n=>n.dest.write(t)),super.emit("data",t))),this.pipes.forEach(n=>{n.dest.removeListener("drain",n.ondrain),n.opts.end&&n.dest.end()})}else if(e==="close"&&(this[bg]=!0,!this[zo]&&!this[ur]))return;let i=new Array(arguments.length);if(i[0]=e,i[1]=t,arguments.length>2)for(let n=2;n<arguments.length;n++)i[n]=arguments[n];try{return super.emit.apply(this,i)}finally{e6(e)?this.removeAllListeners(e):this[dp]()}}collect(){let e=[];this[lr]||(e.dataLength=0);let t=this.promise();return this.on("data",i=>{e.push(i),this[lr]||(e.dataLength+=i.length)}),t.then(()=>e)}concat(){return this[lr]?Promise.reject(new Error("cannot concat in objectMode")):this.collect().then(e=>this[lr]?Promise.reject(new Error("cannot concat in objectMode")):this[Or]?e.join(""):Buffer.concat(e,e.dataLength))}promise(){return new Promise((e,t)=>{this.on(ur,()=>t(new Error("stream destroyed"))),this.on("end",()=>e()),this.on("error",i=>t(i))})}[Whe](){return{next:()=>{let t=this.read();if(t!==null)return Promise.resolve({done:!1,value:t});if(this[Jn])return Promise.resolve({done:!0});let i=null,n=null,o=u=>{this.removeListener("data",s),this.removeListener("end",a),n(u)},s=u=>{this.removeListener("error",o),this.removeListener("end",a),this.pause(),i({value:u,done:!!this[Jn]})},a=()=>{this.removeListener("error",o),this.removeListener("data",s),i({done:!0})},l=()=>o(new Error("stream destroyed"));return new Promise((u,c)=>{n=c,i=u,this.once(ur,l),this.once("error",o),this.once("end",a),this.once("data",s)})}}}[Hhe](){return{next:()=>{let t=this.read();return{value:t,done:t===null}}}}destroy(e){return this[ur]?(e?this.emit("error",e):this.emit(ur),this):(this[ur]=!0,this.buffer=new pp,this[Lr]=0,typeof this.close=="function"&&!this[bg]&&this.close(),e?this.emit("error",e):this.emit(ur),this)}static isStream(e){return!!e&&(e instanceof t6||e instanceof VU||e instanceof Uhe&&(typeof e.pipe=="function"||typeof e.write=="function"&&typeof e.end=="function"))}}});var i6=g((KAe,r6)=>{var Vhe=require("zlib").constants||{ZLIB_VERNUM:4736};r6.exports=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:Infinity,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},Vhe))});var Y0=g(ti=>{"use strict";var U0=require("assert"),Go=require("buffer").Buffer,n6=require("zlib"),oa=ti.constants=i6(),Khe=ru(),o6=Go.concat,sa=Symbol("_superWrite"),gp=class extends Error{constructor(e){super("zlib: "+e.message);this.code=e.code,this.errno=e.errno,this.code||(this.code="ZLIB_ERROR"),this.message="zlib: "+e.message,Error.captureStackTrace(this,this.constructor)}get name(){return"ZlibError"}},Jhe=Symbol("opts"),vp=Symbol("flushFlag"),s6=Symbol("finishFlushFlag"),W0=Symbol("fullFlushFlag"),Xe=Symbol("handle"),xg=Symbol("onError"),iu=Symbol("sawError"),H0=Symbol("level"),z0=Symbol("strategy"),G0=Symbol("ended"),JAe=Symbol("_defaultFullFlush"),V0=class extends Khe{constructor(e,t){if(!e||typeof e!="object")throw new TypeError("invalid options for ZlibBase constructor");super(e);this[iu]=!1,this[G0]=!1,this[Jhe]=e,this[vp]=e.flush,this[s6]=e.finishFlush;try{this[Xe]=new n6[t](e)}catch(i){throw new gp(i)}this[xg]=i=>{this[iu]||(this[iu]=!0,this.close(),this.emit("error",i))},this[Xe].on("error",i=>this[xg](new gp(i))),this.once("end",()=>this.close)}close(){this[Xe]&&(this[Xe].close(),this[Xe]=null,this.emit("close"))}reset(){if(!this[iu])return U0(this[Xe],"zlib binding closed"),this[Xe].reset()}flush(e){this.ended||(typeof e!="number"&&(e=this[W0]),this.write(Object.assign(Go.alloc(0),{[vp]:e})))}end(e,t,i){return e&&this.write(e,t),this.flush(this[s6]),this[G0]=!0,super.end(null,null,i)}get ended(){return this[G0]}write(e,t,i){if(typeof t=="function"&&(i=t,t="utf8"),typeof e=="string"&&(e=Go.from(e,t)),this[iu])return;U0(this[Xe],"zlib binding closed");let n=this[Xe]._handle,o=n.close;n.close=()=>{};let s=this[Xe].close;this[Xe].close=()=>{},Go.concat=u=>u;let a;try{let u=typeof e[vp]=="number"?e[vp]:this[vp];a=this[Xe]._processChunk(e,u),Go.concat=o6}catch(u){Go.concat=o6,this[xg](new gp(u))}finally{this[Xe]&&(this[Xe]._handle=n,n.close=o,this[Xe].close=s,this[Xe].removeAllListeners("error"))}this[Xe]&&this[Xe].on("error",u=>this[xg](new gp(u)));let l;if(a)if(Array.isArray(a)&&a.length>0){l=this[sa](Go.from(a[0]));for(let u=1;u<a.length;u++)l=this[sa](a[u])}else l=this[sa](Go.from(a));return i&&i(),l}[sa](e){return super.write(e)}},Vo=class extends V0{constructor(e,t){e=e||{},e.flush=e.flush||oa.Z_NO_FLUSH,e.finishFlush=e.finishFlush||oa.Z_FINISH,super(e,t),this[W0]=oa.Z_FULL_FLUSH,this[H0]=e.level,this[z0]=e.strategy}params(e,t){if(!this[iu]){if(!this[Xe])throw new Error("cannot switch params when binding is closed");if(!this[Xe].params)throw new Error("not supported in this implementation");if(this[H0]!==e||this[z0]!==t){this.flush(oa.Z_SYNC_FLUSH),U0(this[Xe],"zlib binding closed");let i=this[Xe].flush;this[Xe].flush=(n,o)=>{this.flush(n),o()};try{this[Xe].params(e,t)}finally{this[Xe].flush=i}this[Xe]&&(this[H0]=e,this[z0]=t)}}}},a6=class extends Vo{constructor(e){super(e,"Deflate")}},l6=class extends Vo{constructor(e){super(e,"Inflate")}},K0=Symbol("_portable"),u6=class extends Vo{constructor(e){super(e,"Gzip");this[K0]=e&&!!e.portable}[sa](e){return this[K0]?(this[K0]=!1,e[9]=255,super[sa](e)):super[sa](e)}},c6=class extends Vo{constructor(e){super(e,"Gunzip")}},f6=class extends Vo{constructor(e){super(e,"DeflateRaw")}},p6=class extends Vo{constructor(e){super(e,"InflateRaw")}},d6=class extends Vo{constructor(e){super(e,"Unzip")}},J0=class extends V0{constructor(e,t){e=e||{},e.flush=e.flush||oa.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||oa.BROTLI_OPERATION_FINISH,super(e,t),this[W0]=oa.BROTLI_OPERATION_FLUSH}},h6=class extends J0{constructor(e){super(e,"BrotliCompress")}},m6=class extends J0{constructor(e){super(e,"BrotliDecompress")}};ti.Deflate=a6;ti.Inflate=l6;ti.Gzip=u6;ti.Gunzip=c6;ti.DeflateRaw=f6;ti.InflateRaw=p6;ti.Unzip=d6;typeof n6.BrotliCompress=="function"?(ti.BrotliCompress=h6,ti.BrotliDecompress=m6):ti.BrotliCompress=ti.BrotliDecompress=class{constructor(){throw new Error("Brotli is not supported in this version of Node.js")}}});var yp=g(Dg=>{"use strict";Dg.name=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]);Dg.code=new Map(Array.from(Dg.name).map(r=>[r[1],r[0]]))});var bp=g((eOe,g6)=>{"use strict";var ZAe=yp(),Yhe=ru(),X0=Symbol("slurp");g6.exports=class extends Yhe{constructor(e,t,i){super();switch(this.pause(),this.extended=t,this.globalExtended=i,this.header=e,this.startBlockSize=512*Math.ceil(e.size/512),this.blockRemain=this.startBlockSize,this.remain=e.size,this.type=e.type,this.meta=!1,this.ignore=!1,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}this.path=e.path,this.mode=e.mode,this.mode&&(this.mode=this.mode&4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=e.size,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath,this.uname=e.uname,this.gname=e.gname,t&&this[X0](t),i&&this[X0](i,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");let i=this.remain,n=this.blockRemain;return this.remain=Math.max(0,i-t),this.blockRemain=Math.max(0,n-t),this.ignore?!0:i>=t?super.write(e):super.write(e.slice(0,i))}[X0](e,t){for(let i in e)e[i]!==null&&e[i]!==void 0&&!(t&&i==="path")&&(this[i]=e[i])}}});var b6=g(Z0=>{"use strict";var tOe=Z0.encode=(r,e)=>{if(Number.isSafeInteger(r))r<0?Zhe(r,e):Xhe(r,e);else throw Error("cannot encode number outside of javascript safe integer range");return e},Xhe=(r,e)=>{e[0]=128;for(var t=e.length;t>1;t--)e[t-1]=r&255,r=Math.floor(r/256)},Zhe=(r,e)=>{e[0]=255;var t=!1;r=r*-1;for(var i=e.length;i>1;i--){var n=r&255;r=Math.floor(r/256),t?e[i-1]=v6(n):n===0?e[i-1]=0:(t=!0,e[i-1]=y6(n))}},rOe=Z0.parse=r=>{var e=r[r.length-1],t=r[0],i;if(t===128)i=eme(r.slice(1,r.length));else if(t===255)i=Qhe(r);else throw Error("invalid base256 encoding");if(!Number.isSafeInteger(i))throw Error("parsed number outside of javascript safe integer range");return i},Qhe=r=>{for(var e=r.length,t=0,i=!1,n=e-1;n>-1;n--){var o=r[n],s;i?s=v6(o):o===0?s=o:(i=!0,s=y6(o)),s!==0&&(t-=s*Math.pow(256,e-n-1))}return t},eme=r=>{for(var e=r.length,t=0,i=e-1;i>-1;i--){var n=r[i];n!==0&&(t+=n*Math.pow(256,e-i-1))}return t},v6=r=>(255^r)&255,y6=r=>(255^r)+1&255});var ou=g((nOe,w6)=>{"use strict";var Q0=yp(),nu=require("path").posix,x6=b6(),eS=Symbol("slurp"),ri=Symbol("type"),D6=class{constructor(e,t,i,n){this.cksumValid=!1,this.needPax=!1,this.nullBlock=!1,this.block=null,this.path=null,this.mode=null,this.uid=null,this.gid=null,this.size=null,this.mtime=null,this.cksum=null,this[ri]="0",this.linkpath=null,this.uname=null,this.gname=null,this.devmaj=0,this.devmin=0,this.atime=null,this.ctime=null,Buffer.isBuffer(e)?this.decode(e,t||0,i,n):e&&this.set(e)}decode(e,t,i,n){if(t||(t=0),!e||!(e.length>=t+512))throw new Error("need 512 bytes for header");if(this.path=aa(e,t,100),this.mode=Ko(e,t+100,8),this.uid=Ko(e,t+108,8),this.gid=Ko(e,t+116,8),this.size=Ko(e,t+124,12),this.mtime=tS(e,t+136,12),this.cksum=Ko(e,t+148,12),this[eS](i),this[eS](n,!0),this[ri]=aa(e,t+156,1),this[ri]===""&&(this[ri]="0"),this[ri]==="0"&&this.path.substr(-1)==="/"&&(this[ri]="5"),this[ri]==="5"&&(this.size=0),this.linkpath=aa(e,t+157,100),e.slice(t+257,t+265).toString()==="ustar\x0000")if(this.uname=aa(e,t+265,32),this.gname=aa(e,t+297,32),this.devmaj=Ko(e,t+329,8),this.devmin=Ko(e,t+337,8),e[t+475]!==0){let s=aa(e,t+345,155);this.path=s+"/"+this.path}else{let s=aa(e,t+345,130);s&&(this.path=s+"/"+this.path),this.atime=tS(e,t+476,12),this.ctime=tS(e,t+488,12)}let o=8*32;for(let s=t;s<t+148;s++)o+=e[s];for(let s=t+156;s<t+512;s++)o+=e[s];this.cksumValid=o===this.cksum,this.cksum===null&&o===8*32&&(this.nullBlock=!0)}[eS](e,t){for(let i in e)e[i]!==null&&e[i]!==void 0&&!(t&&i==="path")&&(this[i]=e[i])}encode(e,t){if(e||(e=this.block=Buffer.alloc(512),t=0),t||(t=0),!(e.length>=t+512))throw new Error("need 512 bytes for header");let i=this.ctime||this.atime?130:155,n=tme(this.path||"",i),o=n[0],s=n[1];this.needPax=n[2],this.needPax=la(e,t,100,o)||this.needPax,this.needPax=Jo(e,t+100,8,this.mode)||this.needPax,this.needPax=Jo(e,t+108,8,this.uid)||this.needPax,this.needPax=Jo(e,t+116,8,this.gid)||this.needPax,this.needPax=Jo(e,t+124,12,this.size)||this.needPax,this.needPax=rS(e,t+136,12,this.mtime)||this.needPax,e[t+156]=this[ri].charCodeAt(0),this.needPax=la(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=la(e,t+265,32,this.uname)||this.needPax,this.needPax=la(e,t+297,32,this.gname)||this.needPax,this.needPax=Jo(e,t+329,8,this.devmaj)||this.needPax,this.needPax=Jo(e,t+337,8,this.devmin)||this.needPax,this.needPax=la(e,t+345,i,s)||this.needPax,e[t+475]!==0?this.needPax=la(e,t+345,155,s)||this.needPax:(this.needPax=la(e,t+345,130,s)||this.needPax,this.needPax=rS(e,t+476,12,this.atime)||this.needPax,this.needPax=rS(e,t+488,12,this.ctime)||this.needPax);let a=8*32;for(let l=t;l<t+148;l++)a+=e[l];for(let l=t+156;l<t+512;l++)a+=e[l];return this.cksum=a,Jo(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}set(e){for(let t in e)e[t]!==null&&e[t]!==void 0&&(this[t]=e[t])}get type(){return Q0.name.get(this[ri])||this[ri]}get typeKey(){return this[ri]}set type(e){Q0.code.has(e)?this[ri]=Q0.code.get(e):this[ri]=e}},tme=(r,e)=>{let t=100,i=r,n="",o,s=nu.parse(r).root||".";if(Buffer.byteLength(i)<t)o=[i,n,!1];else{n=nu.dirname(i),i=nu.basename(i);do Buffer.byteLength(i)<=t&&Buffer.byteLength(n)<=e?o=[i,n,!1]:Buffer.byteLength(i)>t&&Buffer.byteLength(n)<=e?o=[i.substr(0,t-1),n,!0]:(i=nu.join(nu.basename(n),i),n=nu.dirname(n));while(n!==s&&!o);o||(o=[r.substr(0,t-1),"",!0])}return o},aa=(r,e,t)=>r.slice(e,e+t).toString("utf8").replace(/\0.*/,""),tS=(r,e,t)=>rme(Ko(r,e,t)),rme=r=>r===null?null:new Date(r*1e3),Ko=(r,e,t)=>r[e]&128?x6.parse(r.slice(e,e+t)):ime(r,e,t),nme=r=>isNaN(r)?null:r,ime=(r,e,t)=>nme(parseInt(r.slice(e,e+t).toString("utf8").replace(/\0.*$/,"").trim(),8)),ome={12:8589934591,8:2097151},Jo=(r,e,t,i)=>i===null?!1:i>ome[t]||i<0?(x6.encode(i,r.slice(e,e+t)),!0):(sme(r,e,t,i),!1),sme=(r,e,t,i)=>r.write(ame(i,t),e,t,"ascii"),ame=(r,e)=>lme(Math.floor(r).toString(8),e),lme=(r,e)=>(r.length===e-1?r:new Array(e-r.length-1).join("0")+r+" ")+"\0",rS=(r,e,t,i)=>i===null?!1:Jo(r,e,t,i.getTime()/1e3),ume=new Array(156).join("\0"),la=(r,e,t,i)=>i===null?!1:(r.write(i+ume,e,t,"utf8"),i.length!==Buffer.byteLength(i)||i.length>t);w6.exports=D6});var Eg=g((oOe,S6)=>{"use strict";var cme=ou(),fme=require("path"),Sg=class{constructor(e,t){this.atime=e.atime||null,this.charset=e.charset||null,this.comment=e.comment||null,this.ctime=e.ctime||null,this.gid=e.gid||null,this.gname=e.gname||null,this.linkpath=e.linkpath||null,this.mtime=e.mtime||null,this.path=e.path||null,this.size=e.size||null,this.uid=e.uid||null,this.uname=e.uname||null,this.dev=e.dev||null,this.ino=e.ino||null,this.nlink=e.nlink||null,this.global=t||!1}encode(){let e=this.encodeBody();if(e==="")return null;let t=Buffer.byteLength(e),i=512*Math.ceil(1+t/512),n=Buffer.allocUnsafe(i);for(let o=0;o<512;o++)n[o]=0;new cme({path:("PaxHeader/"+fme.basename(this.path)).slice(0,99),mode:this.mode||420,uid:this.uid||null,gid:this.gid||null,size:t,mtime:this.mtime||null,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime||null,ctime:this.ctime||null}).encode(n),n.write(e,512,t,"utf8");for(let o=t+512;o<n.length;o++)n[o]=0;return n}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(e){if(this[e]===null||this[e]===void 0)return"";let t=this[e]instanceof Date?this[e].getTime()/1e3:this[e],i=" "+(e==="dev"||e==="ino"||e==="nlink"?"SCHILY.":"")+e+"="+t+`
|
||
`,n=Buffer.byteLength(i),o=Math.floor(Math.log(n)/Math.log(10))+1;return n+o>=Math.pow(10,o)&&(o+=1),o+n+i}};Sg.parse=(r,e,t)=>new Sg(pme(dme(r),e),t);var pme=(r,e)=>e?Object.keys(r).reduce((t,i)=>(t[i]=r[i],t),e):r,dme=r=>r.replace(/\n$/,"").split(`
|
||
`).reduce(hme,Object.create(null)),hme=(r,e)=>{let t=parseInt(e,10);if(t!==Buffer.byteLength(e)+1)return r;e=e.substr((t+" ").length);let i=e.split("="),n=i.shift().replace(/^SCHILY\.(dev|ino|nlink)/,"$1");if(!n)return r;let o=i.join("=");return r[n]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n)?new Date(o*1e3):/^[0-9]+$/.test(o)?+o:o,r};S6.exports=Sg});var Cg=g((sOe,E6)=>{"use strict";E6.exports=r=>class extends r{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 nS=g((aOe,C6)=>{"use strict";var _g=["|","<",">","?",":"],iS=_g.map(r=>String.fromCharCode(61440+r.charCodeAt(0))),mme=new Map(_g.map((r,e)=>[r,iS[e]])),gme=new Map(iS.map((r,e)=>[r,_g[e]]));C6.exports={encode:r=>_g.reduce((e,t)=>e.split(t).join(mme.get(t)),r),decode:r=>iS.reduce((e,t)=>e.split(t).join(gme.get(t)),r)}});var P6=g((lOe,_6)=>{"use strict";_6.exports=(r,e,t)=>(r&=4095,t&&(r=(r|384)&~18),e&&(r&256&&(r|=64),r&32&&(r|=8),r&4&&(r|=1)),r)});var fS=g((dOe,T6)=>{"use strict";var R6=ru(),k6=Eg(),I6=ou(),uOe=bp(),bn=require("fs"),su=require("path"),cOe=yp(),vme=16*1024*1024,F6=Symbol("process"),A6=Symbol("file"),O6=Symbol("directory"),oS=Symbol("symlink"),L6=Symbol("hardlink"),wp=Symbol("header"),Pg=Symbol("read"),sS=Symbol("lstat"),Tg=Symbol("onlstat"),aS=Symbol("onread"),lS=Symbol("onreadlink"),uS=Symbol("openfile"),cS=Symbol("onopenfile"),ua=Symbol("close"),Rg=Symbol("mode"),M6=Cg(),yme=nS(),N6=P6(),kg=M6(class extends R6{constructor(e,t){if(t=t||{},super(t),typeof e!="string")throw new TypeError("path is required");this.path=e,this.portable=!!t.portable,this.myuid=process.getuid&&process.getuid(),this.myuser=process.env.USER||"",this.maxReadSize=t.maxReadSize||vme,this.linkCache=t.linkCache||new Map,this.statCache=t.statCache||new Map,this.preservePaths=!!t.preservePaths,this.cwd=t.cwd||process.cwd(),this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.mtime=t.mtime||null,typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let i=!1;if(!this.preservePaths&&su.win32.isAbsolute(e)){let n=su.win32.parse(e);this.path=e.substr(n.root.length),i=n.root}this.win32=!!t.win32||process.platform==="win32",this.win32&&(this.path=yme.decode(this.path.replace(/\\/g,"/")),e=e.replace(/\\/g,"/")),this.absolute=t.absolute||su.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[Tg](this.statCache.get(this.absolute)):this[sS]()}[sS](){bn.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[Tg](t)})}[Tg](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=bme(e),this.emit("stat",e),this[F6]()}[F6](){switch(this.type){case"File":return this[A6]();case"Directory":return this[O6]();case"SymbolicLink":return this[oS]();default:return this.end()}}[Rg](e){return N6(e,this.type==="Directory",this.portable)}[wp](){this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.header=new I6({path:this.path,linkpath:this.linkpath,mode:this[Rg](this.stat.mode),uid:this.portable?null:this.stat.uid,gid:this.portable?null:this.stat.gid,size:this.stat.size,mtime:this.noMtime?null:this.mtime||this.stat.mtime,type:this.type,uname:this.portable?null:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?null:this.stat.atime,ctime:this.portable?null:this.stat.ctime}),this.header.encode()&&!this.noPax&&this.write(new k6({atime:this.portable?null:this.header.atime,ctime:this.portable?null:this.header.ctime,gid:this.portable?null:this.header.gid,mtime:this.noMtime?null:this.mtime||this.header.mtime,path:this.path,linkpath:this.linkpath,size:this.header.size,uid:this.portable?null:this.header.uid,uname:this.portable?null:this.header.uname,dev:this.portable?null:this.stat.dev,ino:this.portable?null:this.stat.ino,nlink:this.portable?null:this.stat.nlink}).encode()),this.write(this.header.block)}[O6](){this.path.substr(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[wp](),this.end()}[oS](){bn.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[lS](t)})}[lS](e){this.linkpath=e.replace(/\\/g,"/"),this[wp](),this.end()}[L6](e){this.type="Link",this.linkpath=su.relative(this.cwd,e).replace(/\\/g,"/"),this.stat.size=0,this[wp](),this.end()}[A6](){if(this.stat.nlink>1){let e=this.stat.dev+":"+this.stat.ino;if(this.linkCache.has(e)){let t=this.linkCache.get(e);if(t.indexOf(this.cwd)===0)return this[L6](t)}this.linkCache.set(e,this.absolute)}if(this[wp](),this.stat.size===0)return this.end();this[uS]()}[uS](){bn.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[cS](t)})}[cS](e){let t=512*Math.ceil(this.stat.size/512),i=Math.min(t,this.maxReadSize),n=Buffer.allocUnsafe(i);this[Pg](e,n,0,n.length,0,this.stat.size,t)}[Pg](e,t,i,n,o,s,a){bn.read(e,t,i,n,o,(l,u)=>{if(l)return this[ua](e,()=>this.emit("error",l));this[aS](e,t,i,n,o,s,a,u)})}[ua](e,t){bn.close(e,t)}[aS](e,t,i,n,o,s,a,l){if(l<=0&&s>0){let c=new Error("encountered unexpected EOF");return c.path=this.absolute,c.syscall="read",c.code="EOF",this[ua](e,()=>this.emit("error",c))}if(l>s){let c=new Error("did not encounter expected EOF");return c.path=this.absolute,c.syscall="read",c.code="EOF",this[ua](e,()=>this.emit("error",c))}if(l===s)for(let c=l;c<n&&l<a;c++)t[c+i]=0,l++,s++;let u=i===0&&l===t.length?t:t.slice(i,i+l);if(s-=l,a-=l,o+=l,i+=l,this.write(u),!s)return a&&this.write(Buffer.alloc(a)),this[ua](e,c=>c?this.emit("error",c):this.end());i>=n&&(t=Buffer.allocUnsafe(n),i=0),n=t.length-i,this[Pg](e,t,i,n,o,s,a)}}),q6=class extends kg{constructor(e,t){super(e,t)}[sS](){this[Tg](bn.lstatSync(this.absolute))}[oS](){this[lS](bn.readlinkSync(this.absolute))}[uS](){this[cS](bn.openSync(this.absolute,"r"))}[Pg](e,t,i,n,o,s,a){let l=!0;try{let u=bn.readSync(e,t,i,n,o);this[aS](e,t,i,n,o,s,a,u),l=!1}finally{if(l)try{this[ua](e,()=>{})}catch(u){}}}[ua](e,t){bn.closeSync(e),t()}},wme=M6(class extends R6{constructor(e,t){t=t||{},super(t),this.preservePaths=!!t.preservePaths,this.portable=!!t.portable,this.strict=!!t.strict,this.noPax=!!t.noPax,this.noMtime=!!t.noMtime,this.readEntry=e,this.type=e.type,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.path=e.path,this.mode=this[Rg](e.mode),this.uid=this.portable?null:e.uid,this.gid=this.portable?null:e.gid,this.uname=this.portable?null:e.uname,this.gname=this.portable?null:e.gname,this.size=e.size,this.mtime=this.noMtime?null:t.mtime||e.mtime,this.atime=this.portable?null:e.atime,this.ctime=this.portable?null:e.ctime,this.linkpath=e.linkpath,typeof t.onwarn=="function"&&this.on("warn",t.onwarn);let i=!1;if(su.isAbsolute(this.path)&&!this.preservePaths){let n=su.parse(this.path);i=n.root,this.path=this.path.substr(n.root.length)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.header=new I6({path:this.path,linkpath:this.linkpath,mode:this.mode,uid:this.portable?null:this.uid,gid:this.portable?null:this.gid,size:this.size,mtime:this.noMtime?null:this.mtime,type:this.type,uname:this.portable?null:this.uname,atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime}),i&&this.warn("TAR_ENTRY_INFO",`stripping ${i} from absolute path`,{entry:this,path:i+this.path}),this.header.encode()&&!this.noPax&&super.write(new k6({atime:this.portable?null:this.atime,ctime:this.portable?null:this.ctime,gid:this.portable?null:this.gid,mtime:this.noMtime?null:this.mtime,path:this.path,linkpath:this.linkpath,size:this.size,uid:this.portable?null:this.uid,uname:this.portable?null:this.uname,dev:this.portable?null:this.readEntry.dev,ino:this.portable?null:this.readEntry.ino,nlink:this.portable?null:this.readEntry.nlink}).encode()),super.write(this.header.block),e.pipe(this)}[Rg](e){return N6(e,this.type==="Directory",this.portable)}write(e){let t=e.length;if(t>this.blockRemain)throw new Error("writing more to entry than is appropriate");return this.blockRemain-=t,super.write(e)}end(){return this.blockRemain&&this.write(Buffer.alloc(this.blockRemain)),super.end()}});kg.Sync=q6;kg.Tar=wme;var bme=r=>r.isFile()?"File":r.isDirectory()?"Directory":r.isSymbolicLink()?"SymbolicLink":"Unsupported";T6.exports=kg});var qg=g((mOe,$6)=>{"use strict";var pS=class{constructor(e,t){this.path=e||"./",this.absolute=t,this.entry=null,this.stat=null,this.readdir=null,this.pending=!1,this.ignore=!1,this.piped=!1}},xme=ru(),Dme=Y0(),Sme=bp(),dS=fS(),Eme=dS.Sync,Cme=dS.Tar,_me=vg(),B6=Buffer.alloc(1024),Ig=Symbol("onStat"),Fg=Symbol("ended"),wn=Symbol("queue"),au=Symbol("current"),ca=Symbol("process"),Ag=Symbol("processing"),j6=Symbol("processJob"),xn=Symbol("jobs"),hS=Symbol("jobDone"),Og=Symbol("addFSEntry"),U6=Symbol("addTarEntry"),mS=Symbol("stat"),gS=Symbol("readdir"),Lg=Symbol("onreaddir"),Mg=Symbol("pipe"),W6=Symbol("entry"),vS=Symbol("entryOpt"),yS=Symbol("writeEntryClass"),H6=Symbol("write"),bS=Symbol("ondrain"),Ng=require("fs"),z6=require("path"),Pme=Cg(),wS=Pme(class extends xme{constructor(e){super(e);e=e||Object.create(null),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=(e.prefix||"").replace(/(\\|\/)+$/,""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this[yS]=dS,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,this.zip=null,e.gzip?(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new Dme.Gzip(e.gzip),this.zip.on("data",t=>super.write(t)),this.zip.on("end",t=>super.end()),this.zip.on("drain",t=>this[bS]()),this.on("resume",t=>this.zip.resume())):this.on("drain",this[bS]),this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,this.mtime=e.mtime||null,this.filter=typeof e.filter=="function"?e.filter:t=>!0,this[wn]=new _me,this[xn]=0,this.jobs=+e.jobs||4,this[Ag]=!1,this[Fg]=!1}[H6](e){return super.write(e)}add(e){return this.write(e),this}end(e){return e&&this.write(e),this[Fg]=!0,this[ca](),this}write(e){if(this[Fg])throw new Error("write after end");return e instanceof Sme?this[U6](e):this[Og](e),this.flowing}[U6](e){let t=z6.resolve(this.cwd,e.path);if(this.prefix&&(e.path=this.prefix+"/"+e.path.replace(/^\.(\/+|$)/,"")),!this.filter(e.path,e))e.resume();else{let i=new pS(e.path,t,!1);i.entry=new Cme(e,this[vS](i)),i.entry.on("end",n=>this[hS](i)),this[xn]+=1,this[wn].push(i)}this[ca]()}[Og](e){let t=z6.resolve(this.cwd,e);this.prefix&&(e=this.prefix+"/"+e.replace(/^\.(\/+|$)/,"")),this[wn].push(new pS(e,t)),this[ca]()}[mS](e){e.pending=!0,this[xn]+=1;let t=this.follow?"stat":"lstat";Ng[t](e.absolute,(i,n)=>{e.pending=!1,this[xn]-=1,i?this.emit("error",i):this[Ig](e,n)})}[Ig](e,t){this.statCache.set(e.absolute,t),e.stat=t,this.filter(e.path,t)||(e.ignore=!0),this[ca]()}[gS](e){e.pending=!0,this[xn]+=1,Ng.readdir(e.absolute,(t,i)=>{if(e.pending=!1,this[xn]-=1,t)return this.emit("error",t);this[Lg](e,i)})}[Lg](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[ca]()}[ca](){if(!this[Ag]){this[Ag]=!0;for(let e=this[wn].head;e!==null&&this[xn]<this.jobs;e=e.next)if(this[j6](e.value),e.value.ignore){let t=e.next;this[wn].removeNode(e),e.next=t}this[Ag]=!1,this[Fg]&&!this[wn].length&&this[xn]===0&&(this.zip?this.zip.end(B6):(super.write(B6),super.end()))}}get[au](){return this[wn]&&this[wn].head&&this[wn].head.value}[hS](e){this[wn].shift(),this[xn]-=1,this[ca]()}[j6](e){if(!e.pending){if(e.entry){e===this[au]&&!e.piped&&this[Mg](e);return}if(e.stat||(this.statCache.has(e.absolute)?this[Ig](e,this.statCache.get(e.absolute)):this[mS](e)),!!e.stat&&!e.ignore&&!(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir&&(this.readdirCache.has(e.absolute)?this[Lg](e,this.readdirCache.get(e.absolute)):this[gS](e),!e.readdir))){if(e.entry=this[W6](e),!e.entry){e.ignore=!0;return}e===this[au]&&!e.piped&&this[Mg](e)}}}[vS](e){return{onwarn:(t,i,n)=>this.warn(t,i,n),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime}}[W6](e){this[xn]+=1;try{return new this[yS](e.path,this[vS](e)).on("end",()=>this[hS](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[bS](){this[au]&&this[au].entry&&this[au].entry.resume()}[Mg](e){e.piped=!0,e.readdir&&e.readdir.forEach(n=>{let o=this.prefix?e.path.slice(this.prefix.length+1)||"./":e.path,s=o==="./"?"":o.replace(/\/*$/,"/");this[Og](s+n)});let t=e.entry,i=this.zip;i?t.on("data",n=>{i.write(n)||t.pause()}):t.on("data",n=>{super.write(n)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}}),G6=class extends wS{constructor(e){super(e);this[yS]=Eme}pause(){}resume(){}[mS](e){let t=this.follow?"statSync":"lstatSync";this[Ig](e,Ng[t](e.absolute))}[gS](e,t){this[Lg](e,Ng.readdirSync(e.absolute))}[Mg](e){let t=e.entry,i=this.zip;e.readdir&&e.readdir.forEach(n=>{let o=this.prefix?e.path.slice(this.prefix.length+1)||"./":e.path,s=o==="./"?"":o.replace(/\/*$/,"/");this[Og](s+n)}),i?t.on("data",n=>{i.write(n)}):t.on("data",n=>{super[H6](n)})}};wS.Sync=G6;$6.exports=wS});var mu=g(xp=>{"use strict";var Tme=ru(),Rme=require("events").EventEmitter,Mr=require("fs"),xS=Mr.writev;if(!xS){let r=process.binding("fs"),e=r.FSReqWrap||r.FSReqCallback;xS=(t,i,n,o)=>{let s=(l,u)=>o(l,u,i),a=new e;a.oncomplete=s,r.writeBuffers(t,i,n,a)}}var lu=Symbol("_autoClose"),rn=Symbol("_close"),Dp=Symbol("_ended"),ze=Symbol("_fd"),V6=Symbol("_finished"),Yo=Symbol("_flags"),DS=Symbol("_flush"),SS=Symbol("_handleChunk"),ES=Symbol("_makeBuf"),$g=Symbol("_mode"),Bg=Symbol("_needDrain"),uu=Symbol("_onerror"),cu=Symbol("_onopen"),CS=Symbol("_onread"),fu=Symbol("_onwrite"),Xo=Symbol("_open"),Xn=Symbol("_path"),fa=Symbol("_pos"),Dn=Symbol("_queue"),pu=Symbol("_read"),K6=Symbol("_readSize"),Zo=Symbol("_reading"),jg=Symbol("_remain"),J6=Symbol("_size"),Ug=Symbol("_write"),du=Symbol("_writing"),Wg=Symbol("_defaultFlag"),hu=Symbol("_errored"),_S=class extends Tme{constructor(e,t){if(t=t||{},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw new TypeError("path must be a string");this[hu]=!1,this[ze]=typeof t.fd=="number"?t.fd:null,this[Xn]=e,this[K6]=t.readSize||16*1024*1024,this[Zo]=!1,this[J6]=typeof t.size=="number"?t.size:Infinity,this[jg]=this[J6],this[lu]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[ze]=="number"?this[pu]():this[Xo]()}get fd(){return this[ze]}get path(){return this[Xn]}write(){throw new TypeError("this is a readable stream")}end(){throw new TypeError("this is a readable stream")}[Xo](){Mr.open(this[Xn],"r",(e,t)=>this[cu](e,t))}[cu](e,t){e?this[uu](e):(this[ze]=t,this.emit("open",t),this[pu]())}[ES](){return Buffer.allocUnsafe(Math.min(this[K6],this[jg]))}[pu](){if(!this[Zo]){this[Zo]=!0;let e=this[ES]();if(e.length===0)return process.nextTick(()=>this[CS](null,0,e));Mr.read(this[ze],e,0,e.length,null,(t,i,n)=>this[CS](t,i,n))}}[CS](e,t,i){this[Zo]=!1,e?this[uu](e):this[SS](t,i)&&this[pu]()}[rn](){if(this[lu]&&typeof this[ze]=="number"){let e=this[ze];this[ze]=null,Mr.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[uu](e){this[Zo]=!0,this[rn](),this.emit("error",e)}[SS](e,t){let i=!1;return this[jg]-=e,e>0&&(i=super.write(e<t.length?t.slice(0,e):t)),(e===0||this[jg]<=0)&&(i=!1,this[rn](),super.end()),i}emit(e,t){switch(e){case"prefinish":case"finish":break;case"drain":typeof this[ze]=="number"&&this[pu]();break;case"error":return this[hu]?void 0:(this[hu]=!0,super.emit(e,t));default:return super.emit(e,t)}}},Y6=class extends _S{[Xo](){let e=!0;try{this[cu](null,Mr.openSync(this[Xn],"r")),e=!1}finally{e&&this[rn]()}}[pu](){let e=!0;try{if(!this[Zo]){this[Zo]=!0;do{let t=this[ES](),i=t.length===0?0:Mr.readSync(this[ze],t,0,t.length,null);if(!this[SS](i,t))break}while(!0);this[Zo]=!1}e=!1}finally{e&&this[rn]()}}[rn](){if(this[lu]&&typeof this[ze]=="number"){let e=this[ze];this[ze]=null,Mr.closeSync(e),this.emit("close")}}},PS=class extends Rme{constructor(e,t){t=t||{},super(t),this.readable=!1,this.writable=!0,this[hu]=!1,this[du]=!1,this[Dp]=!1,this[Bg]=!1,this[Dn]=[],this[Xn]=e,this[ze]=typeof t.fd=="number"?t.fd:null,this[$g]=t.mode===void 0?438:t.mode,this[fa]=typeof t.start=="number"?t.start:null,this[lu]=typeof t.autoClose=="boolean"?t.autoClose:!0;let i=this[fa]!==null?"r+":"w";this[Wg]=t.flags===void 0,this[Yo]=this[Wg]?i:t.flags,this[ze]===null&&this[Xo]()}emit(e,t){if(e==="error"){if(this[hu])return;this[hu]=!0}return super.emit(e,t)}get fd(){return this[ze]}get path(){return this[Xn]}[uu](e){this[rn](),this[du]=!0,this.emit("error",e)}[Xo](){Mr.open(this[Xn],this[Yo],this[$g],(e,t)=>this[cu](e,t))}[cu](e,t){this[Wg]&&this[Yo]==="r+"&&e&&e.code==="ENOENT"?(this[Yo]="w",this[Xo]()):e?this[uu](e):(this[ze]=t,this.emit("open",t),this[DS]())}end(e,t){return e&&this.write(e,t),this[Dp]=!0,!this[du]&&!this[Dn].length&&typeof this[ze]=="number"&&this[fu](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[Dp]?(this.emit("error",new Error("write() after end()")),!1):this[ze]===null||this[du]||this[Dn].length?(this[Dn].push(e),this[Bg]=!0,!1):(this[du]=!0,this[Ug](e),!0)}[Ug](e){Mr.write(this[ze],e,0,e.length,this[fa],(t,i)=>this[fu](t,i))}[fu](e,t){e?this[uu](e):(this[fa]!==null&&(this[fa]+=t),this[Dn].length?this[DS]():(this[du]=!1,this[Dp]&&!this[V6]?(this[V6]=!0,this[rn](),this.emit("finish")):this[Bg]&&(this[Bg]=!1,this.emit("drain"))))}[DS](){if(this[Dn].length===0)this[Dp]&&this[fu](null,0);else if(this[Dn].length===1)this[Ug](this[Dn].pop());else{let e=this[Dn];this[Dn]=[],xS(this[ze],e,this[fa],(t,i)=>this[fu](t,i))}}[rn](){if(this[lu]&&typeof this[ze]=="number"){let e=this[ze];this[ze]=null,Mr.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},X6=class extends PS{[Xo](){let e;if(this[Wg]&&this[Yo]==="r+")try{e=Mr.openSync(this[Xn],this[Yo],this[$g])}catch(t){if(t.code==="ENOENT")return this[Yo]="w",this[Xo]();throw t}else e=Mr.openSync(this[Xn],this[Yo],this[$g]);this[cu](null,e)}[rn](){if(this[lu]&&typeof this[ze]=="number"){let e=this[ze];this[ze]=null,Mr.closeSync(e),this.emit("close")}}[Ug](e){let t=!0;try{this[fu](null,Mr.writeSync(this[ze],e,0,e.length,this[fa])),t=!1}finally{if(t)try{this[rn]()}catch(i){}}}};xp.ReadStream=_S;xp.ReadStreamSync=Y6;xp.WriteStream=PS;xp.WriteStreamSync=X6});var Cp=g((bOe,Z6)=>{"use strict";var kme=Cg(),vOe=require("path"),Ime=ou(),Fme=require("events"),Ame=vg(),Ome=1024*1024,Lme=bp(),Q6=Eg(),Mme=Y0(),TS=Buffer.from([31,139]),Ri=Symbol("state"),pa=Symbol("writeEntry"),Zn=Symbol("readEntry"),RS=Symbol("nextEntry"),e8=Symbol("processEntry"),ki=Symbol("extendedHeader"),Sp=Symbol("globalExtendedHeader"),Qo=Symbol("meta"),t8=Symbol("emitMeta"),et=Symbol("buffer"),Qn=Symbol("queue"),da=Symbol("ended"),r8=Symbol("emittedEnd"),ha=Symbol("emit"),Nr=Symbol("unzip"),Hg=Symbol("consumeChunk"),zg=Symbol("consumeChunkSub"),kS=Symbol("consumeBody"),i8=Symbol("consumeMeta"),n8=Symbol("consumeHeader"),Gg=Symbol("consuming"),IS=Symbol("bufferConcat"),FS=Symbol("maybeEnd"),Ep=Symbol("writing"),es=Symbol("aborted"),Vg=Symbol("onDone"),ma=Symbol("sawValidEntry"),Kg=Symbol("sawNullBlock"),Jg=Symbol("sawEOF"),Nme=r=>!0;Z6.exports=kme(class extends Fme{constructor(e){e=e||{},super(e),this.file=e.file||"",this[ma]=null,this.on(Vg,t=>{(this[Ri]==="begin"||this[ma]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(Vg,e.ondone):this.on(Vg,t=>{this.emit("prefinish"),this.emit("finish"),this.emit("end"),this.emit("close")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||Ome,this.filter=typeof e.filter=="function"?e.filter:Nme,this.writable=!0,this.readable=!1,this[Qn]=new Ame,this[et]=null,this[Zn]=null,this[pa]=null,this[Ri]="begin",this[Qo]="",this[ki]=null,this[Sp]=null,this[da]=!1,this[Nr]=null,this[es]=!1,this[Kg]=!1,this[Jg]=!1,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onentry=="function"&&this.on("entry",e.onentry)}[n8](e,t){this[ma]===null&&(this[ma]=!1);let i;try{i=new Ime(e,t,this[ki],this[Sp])}catch(n){return this.warn("TAR_ENTRY_INVALID",n)}if(i.nullBlock)this[Kg]?(this[Jg]=!0,this[Ri]==="begin"&&(this[Ri]="header"),this[ha]("eof")):(this[Kg]=!0,this[ha]("nullBlock"));else if(this[Kg]=!1,!i.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i});else if(!i.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else{let n=i.type;if(/^(Symbolic)?Link$/.test(n)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(!/^(Symbolic)?Link$/.test(n)&&i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i});else{let o=this[pa]=new Lme(i,this[ki],this[Sp]);if(!this[ma])if(o.remain){let s=()=>{o.invalid||(this[ma]=!0)};o.on("end",s)}else this[ma]=!0;o.meta?o.size>this.maxMetaEntrySize?(o.ignore=!0,this[ha]("ignoredEntry",o),this[Ri]="ignore",o.resume()):o.size>0&&(this[Qo]="",o.on("data",s=>this[Qo]+=s),this[Ri]="meta"):(this[ki]=null,o.ignore=o.ignore||!this.filter(o.path,o),o.ignore?(this[ha]("ignoredEntry",o),this[Ri]=o.remain?"ignore":"header",o.resume()):(o.remain?this[Ri]="body":(this[Ri]="header",o.end()),this[Zn]?this[Qn].push(o):(this[Qn].push(o),this[RS]())))}}}[e8](e){let t=!0;return e?Array.isArray(e)?this.emit.apply(this,e):(this[Zn]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",i=>this[RS]()),t=!1)):(this[Zn]=null,t=!1),t}[RS](){do;while(this[e8](this[Qn].shift()));if(!this[Qn].length){let e=this[Zn];!e||e.flowing||e.size===e.remain?this[Ep]||this.emit("drain"):e.once("drain",i=>this.emit("drain"))}}[kS](e,t){let i=this[pa],n=i.blockRemain,o=n>=e.length&&t===0?e:e.slice(t,t+n);return i.write(o),i.blockRemain||(this[Ri]="header",this[pa]=null,i.end()),o.length}[i8](e,t){let i=this[pa],n=this[kS](e,t);return this[pa]||this[t8](i),n}[ha](e,t,i){!this[Qn].length&&!this[Zn]?this.emit(e,t,i):this[Qn].push([e,t,i])}[t8](e){switch(this[ha]("meta",this[Qo]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[ki]=Q6.parse(this[Qo],this[ki],!1);break;case"GlobalExtendedHeader":this[Sp]=Q6.parse(this[Qo],this[Sp],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":this[ki]=this[ki]||Object.create(null),this[ki].path=this[Qo].replace(/\0.*/,"");break;case"NextFileHasLongLinkpath":this[ki]=this[ki]||Object.create(null),this[ki].linkpath=this[Qo].replace(/\0.*/,"");break;default:throw new Error("unknown meta: "+e.type)}}abort(e){this[es]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e){if(this[es])return;if(this[Nr]===null&&e){if(this[et]&&(e=Buffer.concat([this[et],e]),this[et]=null),e.length<TS.length)return this[et]=e,!0;for(let i=0;this[Nr]===null&&i<TS.length;i++)e[i]!==TS[i]&&(this[Nr]=!1);if(this[Nr]===null){let i=this[da];this[da]=!1,this[Nr]=new Mme.Unzip,this[Nr].on("data",o=>this[Hg](o)),this[Nr].on("error",o=>this.abort(o)),this[Nr].on("end",o=>{this[da]=!0,this[Hg]()}),this[Ep]=!0;let n=this[Nr][i?"end":"write"](e);return this[Ep]=!1,n}}this[Ep]=!0,this[Nr]?this[Nr].write(e):this[Hg](e),this[Ep]=!1;let t=this[Qn].length?!1:this[Zn]?this[Zn].flowing:!0;return!t&&!this[Qn].length&&this[Zn].once("drain",i=>this.emit("drain")),t}[IS](e){e&&!this[es]&&(this[et]=this[et]?Buffer.concat([this[et],e]):e)}[FS](){if(this[da]&&!this[r8]&&!this[es]&&!this[Gg]){this[r8]=!0;let e=this[pa];if(e&&e.blockRemain){let t=this[et]?this[et].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[et]&&e.write(this[et]),e.end()}this[ha](Vg)}}[Hg](e){if(this[Gg])this[IS](e);else if(!e&&!this[et])this[FS]();else{if(this[Gg]=!0,this[et]){this[IS](e);let t=this[et];this[et]=null,this[zg](t)}else this[zg](e);for(;this[et]&&this[et].length>=512&&!this[es]&&!this[Jg];){let t=this[et];this[et]=null,this[zg](t)}this[Gg]=!1}(!this[et]||this[da])&&this[FS]()}[zg](e){let t=0,i=e.length;for(;t+512<=i&&!this[es]&&!this[Jg];)switch(this[Ri]){case"begin":case"header":this[n8](e,t),t+=512;break;case"ignore":case"body":t+=this[kS](e,t);break;case"meta":t+=this[i8](e,t);break;default:throw new Error("invalid state: "+this[Ri])}t<i&&(this[et]?this[et]=Buffer.concat([e.slice(t),this[et]]):this[et]=e.slice(t))}end(e){this[es]||(this[Nr]?this[Nr].end(e):(this[da]=!0,this.write(e)))}})});var Yg=g((xOe,o8)=>{"use strict";var qme=tu(),s8=Cp(),gu=require("fs"),$me=mu(),a8=require("path"),wOe=o8.exports=(r,e,t)=>{typeof r=="function"?(t=r,e=null,r={}):Array.isArray(r)&&(e=r,r={}),typeof e=="function"&&(t=e,e=null),e?e=Array.from(e):e=[];let i=qme(r);if(i.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return e.length&&jme(i,e),i.noResume||Bme(i),i.file&&i.sync?Ume(i):i.file?Wme(i,t):l8(i)},Bme=r=>{let e=r.onentry;r.onentry=e?t=>{e(t),t.resume()}:t=>t.resume()},jme=(r,e)=>{let t=new Map(e.map(o=>[o.replace(/\/+$/,""),!0])),i=r.filter,n=(o,s)=>{let a=s||a8.parse(o).root||".",l=o===a?!1:t.has(o)?t.get(o):n(a8.dirname(o),a);return t.set(o,l),l};r.filter=i?(o,s)=>i(o,s)&&n(o.replace(/\/+$/,"")):o=>n(o.replace(/\/+$/,""))},Ume=r=>{let e=l8(r),t=r.file,i=!0,n;try{let o=gu.statSync(t),s=r.maxReadSize||16*1024*1024;if(o.size<s)e.end(gu.readFileSync(t));else{let a=0,l=Buffer.allocUnsafe(s);for(n=gu.openSync(t,"r");a<o.size;){let u=gu.readSync(n,l,0,s,a);a+=u,e.write(l.slice(0,u))}e.end()}i=!1}finally{if(i&&n)try{gu.closeSync(n)}catch(o){}}},Wme=(r,e)=>{let t=new s8(r),i=r.maxReadSize||16*1024*1024,n=r.file,o=new Promise((s,a)=>{t.on("error",a),t.on("end",s),gu.stat(n,(l,u)=>{if(l)a(l);else{let c=new $me.ReadStream(n,{readSize:i,size:u.size});c.on("error",a),c.pipe(t)}})});return e?o.then(e,e):o},l8=r=>new s8(r)});var h8=g((EOe,u8)=>{"use strict";var Hme=tu(),Xg=qg(),DOe=require("fs"),c8=mu(),f8=Yg(),p8=require("path"),SOe=u8.exports=(r,e,t)=>{if(typeof e=="function"&&(t=e),Array.isArray(r)&&(e=r,r={}),!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");e=Array.from(e);let i=Hme(r);if(i.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return i.file&&i.sync?zme(i,e):i.file?Gme(i,e,t):i.sync?Vme(i,e):Kme(i,e)},zme=(r,e)=>{let t=new Xg.Sync(r),i=new c8.WriteStreamSync(r.file,{mode:r.mode||438});t.pipe(i),d8(t,e)},Gme=(r,e,t)=>{let i=new Xg(r),n=new c8.WriteStream(r.file,{mode:r.mode||438});i.pipe(n);let o=new Promise((s,a)=>{n.on("error",a),n.on("close",s),i.on("error",a)});return AS(i,e),t?o.then(t,t):o},d8=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?f8({file:p8.resolve(r.cwd,t.substr(1)),sync:!0,noResume:!0,onentry:i=>r.add(i)}):r.add(t)}),r.end()},AS=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return f8({file:p8.resolve(r.cwd,t.substr(1)),noResume:!0,onentry:i=>r.add(i)}).then(i=>AS(r,e));r.add(t)}r.end()},Vme=(r,e)=>{let t=new Xg.Sync(r);return d8(t,e),t},Kme=(r,e)=>{let t=new Xg(r);return AS(t,e),t}});var OS=g((POe,m8)=>{"use strict";var Jme=tu(),g8=qg(),COe=Cp(),Ii=require("fs"),v8=mu(),y8=Yg(),b8=require("path"),w8=ou(),_Oe=m8.exports=(r,e,t)=>{let i=Jme(r);if(!i.file)throw new TypeError("file is required");if(i.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),i.sync?Yme(i,e):Xme(i,e,t)},Yme=(r,e)=>{let t=new g8.Sync(r),i=!0,n,o;try{try{n=Ii.openSync(r.file,"r+")}catch(l){if(l.code==="ENOENT")n=Ii.openSync(r.file,"w+");else throw l}let s=Ii.fstatSync(n),a=Buffer.alloc(512);e:for(o=0;o<s.size;o+=512){for(let c=0,f=0;c<512;c+=f){if(f=Ii.readSync(n,a,c,a.length-c,o+c),o===0&&a[0]===31&&a[1]===139)throw new Error("cannot append to compressed archives");if(!f)break e}let l=new w8(a);if(!l.cksumValid)break;let u=512*Math.ceil(l.size/512);if(o+u+512>s.size)break;o+=u,r.mtimeCache&&r.mtimeCache.set(l.path,l.mtime)}i=!1,Zme(r,t,o,n,e)}finally{if(i)try{Ii.closeSync(n)}catch(s){}}},Zme=(r,e,t,i,n)=>{let o=new v8.WriteStreamSync(r.file,{fd:i,start:t});e.pipe(o),Qme(e,n)},Xme=(r,e,t)=>{e=Array.from(e);let i=new g8(r),n=(s,a,l)=>{let u=(h,m)=>{h?Ii.close(s,y=>l(h)):l(null,m)},c=0;if(a===0)return u(null,0);let f=0,p=Buffer.alloc(512),d=(h,m)=>{if(h)return u(h);if(f+=m,f<512&&m)return Ii.read(s,p,f,p.length-f,c+f,d);if(c===0&&p[0]===31&&p[1]===139)return u(new Error("cannot append to compressed archives"));if(f<512)return u(null,c);let y=new w8(p);if(!y.cksumValid)return u(null,c);let v=512*Math.ceil(y.size/512);if(c+v+512>a||(c+=v+512,c>=a))return u(null,c);r.mtimeCache&&r.mtimeCache.set(y.path,y.mtime),f=0,Ii.read(s,p,0,512,c,d)};Ii.read(s,p,0,512,c,d)},o=new Promise((s,a)=>{i.on("error",a);let l="r+",u=(c,f)=>{if(c&&c.code==="ENOENT"&&l==="r+")return l="w+",Ii.open(r.file,l,u);if(c)return a(c);Ii.fstat(f,(p,d)=>{if(p)return a(p);n(f,d.size,(h,m)=>{if(h)return a(h);let y=new v8.WriteStream(r.file,{fd:f,start:m});i.pipe(y),y.on("error",a),y.on("close",s),x8(i,e)})})};Ii.open(r.file,l,u)});return t?o.then(t,t):o},Qme=(r,e)=>{e.forEach(t=>{t.charAt(0)==="@"?y8({file:b8.resolve(r.cwd,t.substr(1)),sync:!0,noResume:!0,onentry:i=>r.add(i)}):r.add(t)}),r.end()},x8=(r,e)=>{for(;e.length;){let t=e.shift();if(t.charAt(0)==="@")return y8({file:b8.resolve(r.cwd,t.substr(1)),noResume:!0,onentry:i=>r.add(i)}).then(i=>x8(r,e));r.add(t)}r.end()}});var S8=g((ROe,D8)=>{"use strict";var ege=tu(),tge=OS(),TOe=D8.exports=(r,e,t)=>{let i=ege(r);if(!i.file)throw new TypeError("file is required");if(i.gzip)throw new TypeError("cannot append to compressed archives");if(!e||!Array.isArray(e)||!e.length)throw new TypeError("no files or directories specified");return e=Array.from(e),rge(i),tge(i,e,t)},rge=r=>{let e=r.filter;r.mtimeCache||(r.mtimeCache=new Map),r.filter=e?(t,i)=>e(t,i)&&!(r.mtimeCache.get(t)>i.mtime):(t,i)=>!(r.mtimeCache.get(t)>i.mtime)}});var _8=g((kOe,E8)=>{var{promisify:C8}=require("util"),ts=require("fs"),ige=r=>{if(!r)r={mode:511,fs:ts};else if(typeof r=="object")r={mode:511,fs:ts,...r};else if(typeof r=="number")r={mode:r,fs:ts};else if(typeof r=="string")r={mode:parseInt(r,8),fs:ts};else throw new TypeError("invalid options argument");return r.mkdir=r.mkdir||r.fs.mkdir||ts.mkdir,r.mkdirAsync=C8(r.mkdir),r.stat=r.stat||r.fs.stat||ts.stat,r.statAsync=C8(r.stat),r.statSync=r.statSync||r.fs.statSync||ts.statSync,r.mkdirSync=r.mkdirSync||r.fs.mkdirSync||ts.mkdirSync,r};E8.exports=ige});var T8=g((IOe,P8)=>{var nge=process.env.__TESTING_MKDIRP_PLATFORM__||process.platform,{resolve:oge,parse:sge}=require("path"),age=r=>{if(/\0/.test(r))throw Object.assign(new TypeError("path must be a string without null bytes"),{path:r,code:"ERR_INVALID_ARG_VALUE"});if(r=oge(r),nge==="win32"){let e=/[*|"<>?:]/,{root:t}=sge(r);if(e.test(r.substr(t.length)))throw Object.assign(new Error("Illegal characters in path."),{path:r,code:"EINVAL"})}return r};P8.exports=age});var A8=g((FOe,R8)=>{var{dirname:k8}=require("path"),I8=(r,e,t=void 0)=>t===e?Promise.resolve():r.statAsync(e).then(i=>i.isDirectory()?t:void 0,i=>i.code==="ENOENT"?I8(r,k8(e),e):void 0),F8=(r,e,t=void 0)=>{if(t!==e)try{return r.statSync(e).isDirectory()?t:void 0}catch(i){return i.code==="ENOENT"?F8(r,k8(e),e):void 0}};R8.exports={findMade:I8,findMadeSync:F8}});var NS=g((AOe,O8)=>{var{dirname:L8}=require("path"),LS=(r,e,t)=>{e.recursive=!1;let i=L8(r);return i===r?e.mkdirAsync(r,e).catch(n=>{if(n.code!=="EISDIR")throw n}):e.mkdirAsync(r,e).then(()=>t||r,n=>{if(n.code==="ENOENT")return LS(i,e).then(o=>LS(r,e,o));if(n.code!=="EEXIST"&&n.code!=="EROFS")throw n;return e.statAsync(r).then(o=>{if(o.isDirectory())return t;throw n},()=>{throw n})})},MS=(r,e,t)=>{let i=L8(r);if(e.recursive=!1,i===r)try{return e.mkdirSync(r,e)}catch(n){if(n.code!=="EISDIR")throw n;return}try{return e.mkdirSync(r,e),t||r}catch(n){if(n.code==="ENOENT")return MS(r,e,MS(i,e,t));if(n.code!=="EEXIST"&&n.code!=="EROFS")throw n;try{if(!e.statSync(r).isDirectory())throw n}catch(o){throw n}}};O8.exports={mkdirpManual:LS,mkdirpManualSync:MS}});var q8=g((OOe,M8)=>{var{dirname:N8}=require("path"),{findMade:lge,findMadeSync:uge}=A8(),{mkdirpManual:cge,mkdirpManualSync:fge}=NS(),pge=(r,e)=>(e.recursive=!0,N8(r)===r?e.mkdirAsync(r,e):lge(e,r).then(i=>e.mkdirAsync(r,e).then(()=>i).catch(n=>{if(n.code==="ENOENT")return cge(r,e);throw n}))),dge=(r,e)=>{if(e.recursive=!0,N8(r)===r)return e.mkdirSync(r,e);let i=uge(e,r);try{return e.mkdirSync(r,e),i}catch(n){if(n.code==="ENOENT")return fge(r,e);throw n}};M8.exports={mkdirpNative:pge,mkdirpNativeSync:dge}});var U8=g((LOe,$8)=>{var B8=require("fs"),hge=process.env.__TESTING_MKDIRP_NODE_VERSION__||process.version,qS=hge.replace(/^v/,"").split("."),j8=+qS[0]>10||+qS[0]==10&&+qS[1]>=12,mge=j8?r=>r.mkdir===B8.mkdir:()=>!1,gge=j8?r=>r.mkdirSync===B8.mkdirSync:()=>!1;$8.exports={useNative:mge,useNativeSync:gge}});var K8=g((MOe,W8)=>{var vu=_8(),yu=T8(),{mkdirpNative:H8,mkdirpNativeSync:z8}=q8(),{mkdirpManual:G8,mkdirpManualSync:V8}=NS(),{useNative:vge,useNativeSync:yge}=U8(),bu=(r,e)=>(r=yu(r),e=vu(e),vge(e)?H8(r,e):G8(r,e)),bge=(r,e)=>(r=yu(r),e=vu(e),yge(e)?z8(r,e):V8(r,e));bu.sync=bge;bu.native=(r,e)=>H8(yu(r),vu(e));bu.manual=(r,e)=>G8(yu(r),vu(e));bu.nativeSync=(r,e)=>z8(yu(r),vu(e));bu.manualSync=(r,e)=>V8(yu(r),vu(e));W8.exports=bu});var tW=g((NOe,J8)=>{"use strict";var Fi=require("fs"),ga=require("path"),wge=Fi.lchown?"lchown":"chown",xge=Fi.lchownSync?"lchownSync":"chownSync",Y8=Fi.lchown&&!process.version.match(/v1[1-9]+\./)&&!process.version.match(/v10\.[6-9]/),X8=(r,e,t)=>{try{return Fi[xge](r,e,t)}catch(i){if(i.code!=="ENOENT")throw i}},Dge=(r,e,t)=>{try{return Fi.chownSync(r,e,t)}catch(i){if(i.code!=="ENOENT")throw i}},Sge=Y8?(r,e,t,i)=>n=>{!n||n.code!=="EISDIR"?i(n):Fi.chown(r,e,t,i)}:(r,e,t,i)=>i,$S=Y8?(r,e,t)=>{try{return X8(r,e,t)}catch(i){if(i.code!=="EISDIR")throw i;Dge(r,e,t)}}:(r,e,t)=>X8(r,e,t),Ege=process.version,Z8=(r,e,t)=>Fi.readdir(r,e,t),Cge=(r,e)=>Fi.readdirSync(r,e);/^v4\./.test(Ege)&&(Z8=(r,e,t)=>Fi.readdir(r,t));var Zg=(r,e,t,i)=>{Fi[wge](r,e,t,Sge(r,e,t,n=>{i(n&&n.code!=="ENOENT"?n:null)}))},Q8=(r,e,t,i,n)=>{if(typeof e=="string")return Fi.lstat(ga.resolve(r,e),(o,s)=>{if(o)return n(o.code!=="ENOENT"?o:null);s.name=e,Q8(r,s,t,i,n)});if(e.isDirectory())BS(ga.resolve(r,e.name),t,i,o=>{if(o)return n(o);let s=ga.resolve(r,e.name);Zg(s,t,i,n)});else{let o=ga.resolve(r,e.name);Zg(o,t,i,n)}},BS=(r,e,t,i)=>{Z8(r,{withFileTypes:!0},(n,o)=>{if(n){if(n.code==="ENOENT")return i();if(n.code!=="ENOTDIR"&&n.code!=="ENOTSUP")return i(n)}if(n||!o.length)return Zg(r,e,t,i);let s=o.length,a=null,l=u=>{if(!a){if(u)return i(a=u);if(--s==0)return Zg(r,e,t,i)}};o.forEach(u=>Q8(r,u,e,t,l))})},_ge=(r,e,t,i)=>{if(typeof e=="string")try{let n=Fi.lstatSync(ga.resolve(r,e));n.name=e,e=n}catch(n){if(n.code==="ENOENT")return;throw n}e.isDirectory()&&eW(ga.resolve(r,e.name),t,i),$S(ga.resolve(r,e.name),t,i)},eW=(r,e,t)=>{let i;try{i=Cge(r,{withFileTypes:!0})}catch(n){if(n.code==="ENOENT")return;if(n.code==="ENOTDIR"||n.code==="ENOTSUP")return $S(r,e,t);throw n}return i&&i.length&&i.forEach(n=>_ge(r,n,e,t)),$S(r,e,t)};J8.exports=BS;BS.sync=eW});var oW=g((BOe,jS)=>{"use strict";var rW=K8(),Ai=require("fs"),Qg=require("path"),iW=tW(),US=class extends Error{constructor(e,t){super("Cannot extract through symbolic link");this.path=t,this.symlink=e}get name(){return"SylinkError"}},_p=class extends Error{constructor(e,t){super(t+": Cannot cd into '"+e+"'");this.path=e,this.code=t}get name(){return"CwdError"}},qOe=jS.exports=(r,e,t)=>{let i=e.umask,n=e.mode|448,o=(n&i)!=0,s=e.uid,a=e.gid,l=typeof s=="number"&&typeof a=="number"&&(s!==e.processUid||a!==e.processGid),u=e.preserve,c=e.unlink,f=e.cache,p=e.cwd,d=(y,v)=>{y?t(y):(f.set(r,!0),v&&l?iW(v,s,a,x=>d(x)):o?Ai.chmod(r,n,t):t())};if(f&&f.get(r)===!0)return d();if(r===p)return Ai.stat(r,(y,v)=>{(y||!v.isDirectory())&&(y=new _p(r,y&&y.code||"ENOTDIR")),d(y)});if(u)return rW(r,{mode:n}).then(y=>d(null,y),d);let m=Qg.relative(p,r).split(/\/|\\/);ev(p,m,n,f,c,p,null,d)},ev=(r,e,t,i,n,o,s,a)=>{if(!e.length)return a(null,s);let l=e.shift(),u=r+"/"+l;if(i.get(u))return ev(u,e,t,i,n,o,s,a);Ai.mkdir(u,t,nW(u,e,t,i,n,o,s,a))},nW=(r,e,t,i,n,o,s,a)=>l=>{if(l){if(l.path&&Qg.dirname(l.path)===o&&(l.code==="ENOTDIR"||l.code==="ENOENT"))return a(new _p(o,l.code));Ai.lstat(r,(u,c)=>{if(u)a(u);else if(c.isDirectory())ev(r,e,t,i,n,o,s,a);else if(n)Ai.unlink(r,f=>{if(f)return a(f);Ai.mkdir(r,t,nW(r,e,t,i,n,o,s,a))});else{if(c.isSymbolicLink())return a(new US(r,r+"/"+e.join("/")));a(l)}})}else s=s||r,ev(r,e,t,i,n,o,s,a)},$Oe=jS.exports.sync=(r,e)=>{let t=e.umask,i=e.mode|448,n=(i&t)!=0,o=e.uid,s=e.gid,a=typeof o=="number"&&typeof s=="number"&&(o!==e.processUid||s!==e.processGid),l=e.preserve,u=e.unlink,c=e.cache,f=e.cwd,p=y=>{c.set(r,!0),y&&a&&iW.sync(y,o,s),n&&Ai.chmodSync(r,i)};if(c&&c.get(r)===!0)return p();if(r===f){let y=!1,v="ENOTDIR";try{y=Ai.statSync(r).isDirectory()}catch(x){v=x.code}finally{if(!y)throw new _p(r,v)}p();return}if(l)return p(rW.sync(r,i));let h=Qg.relative(f,r).split(/\/|\\/),m=null;for(let y=h.shift(),v=f;y&&(v+="/"+y);y=h.shift())if(!c.get(v))try{Ai.mkdirSync(v,i),m=m||v,c.set(v,!0)}catch(x){if(x.path&&Qg.dirname(x.path)===f&&(x.code==="ENOTDIR"||x.code==="ENOENT"))return new _p(f,x.code);let w=Ai.lstatSync(v);if(w.isDirectory()){c.set(v,!0);continue}else if(u){Ai.unlinkSync(v),Ai.mkdirSync(v,i),m=m||v,c.set(v,!0);continue}else if(w.isSymbolicLink())return new US(v,v+"/"+h.join("/"))}return p(m)}});var lW=g((jOe,sW)=>{var aW=require("assert");sW.exports=()=>{let r=new Map,e=new Map,{join:t}=require("path"),i=c=>t(c).split(/[\\\/]/).slice(0,-1).reduce((f,p)=>f.length?f.concat(t(f[f.length-1],p)):[p],[]),n=new Set,o=c=>{let f=e.get(c);if(!f)throw new Error("function does not have any path reservations");return{paths:f.paths.map(p=>r.get(p)),dirs:[...f.dirs].map(p=>r.get(p))}},s=c=>{let{paths:f,dirs:p}=o(c);return f.every(d=>d[0]===c)&&p.every(d=>d[0]instanceof Set&&d[0].has(c))},a=c=>n.has(c)||!s(c)?!1:(n.add(c),c(()=>l(c)),!0),l=c=>{if(!n.has(c))return!1;let{paths:f,dirs:p}=e.get(c),d=new Set;return f.forEach(h=>{let m=r.get(h);aW.equal(m[0],c),m.length===1?r.delete(h):(m.shift(),typeof m[0]=="function"?d.add(m[0]):m[0].forEach(y=>d.add(y)))}),p.forEach(h=>{let m=r.get(h);aW(m[0]instanceof Set),m[0].size===1&&m.length===1?r.delete(h):m[0].size===1?(m.shift(),d.add(m[0])):m[0].delete(c)}),n.delete(c),d.forEach(h=>a(h)),!0};return{check:s,reserve:(c,f)=>{let p=new Set(c.map(d=>i(d)).reduce((d,h)=>d.concat(h)));return e.set(f,{dirs:p,paths:c}),c.forEach(d=>{let h=r.get(d);h?h.push(f):r.set(d,[f])}),p.forEach(d=>{let h=r.get(d);h?h[h.length-1]instanceof Set?h[h.length-1].add(f):h.push(new Set([f])):r.set(d,[new Set([f])])}),a(f)}}}});var fW=g((UOe,uW)=>{var Pge=process.env.__FAKE_PLATFORM__||process.platform,Tge=Pge==="win32",Rge=global.__FAKE_TESTING_FS__||require("fs"),{O_CREAT:kge,O_TRUNC:Ige,O_WRONLY:Fge,UV_FS_O_FILEMAP:cW=0}=Rge.constants,Age=Tge&&!!cW,Oge=512*1024,Lge=cW|Ige|kge|Fge;uW.exports=Age?r=>r<Oge?Lge:"w":()=>"w"});var XS=g((GOe,pW)=>{"use strict";var Mge=require("assert"),WOe=require("events").EventEmitter,Nge=Cp(),qe=require("fs"),qge=mu(),eo=require("path"),WS=oW(),HOe=WS.sync,dW=nS(),$ge=lW(),hW=Symbol("onEntry"),HS=Symbol("checkFs"),mW=Symbol("checkFs2"),zS=Symbol("isReusable"),to=Symbol("makeFs"),GS=Symbol("file"),VS=Symbol("directory"),tv=Symbol("link"),gW=Symbol("symlink"),vW=Symbol("hardlink"),yW=Symbol("unsupported"),zOe=Symbol("unknown"),bW=Symbol("checkPath"),wu=Symbol("mkdir"),xr=Symbol("onError"),rv=Symbol("pending"),wW=Symbol("pend"),xu=Symbol("unpend"),KS=Symbol("ended"),JS=Symbol("maybeClose"),YS=Symbol("skip"),Pp=Symbol("doChown"),Tp=Symbol("uid"),Rp=Symbol("gid"),xW=require("crypto"),DW=fW(),iv=()=>{throw new Error("sync function called cb somehow?!?")},Bge=(r,e)=>{if(process.platform!=="win32")return qe.unlink(r,e);let t=r+".DELETE."+xW.randomBytes(16).toString("hex");qe.rename(r,t,i=>{if(i)return e(i);qe.unlink(t,e)})},jge=r=>{if(process.platform!=="win32")return qe.unlinkSync(r);let e=r+".DELETE."+xW.randomBytes(16).toString("hex");qe.renameSync(r,e),qe.unlinkSync(e)},SW=(r,e,t)=>r===r>>>0?r:e===e>>>0?e:t,nv=class extends Nge{constructor(e){if(e||(e={}),e.ondone=t=>{this[KS]=!0,this[JS]()},super(e),this.reservations=$ge(),this.transform=typeof e.transform=="function"?e.transform:null,this.writable=!0,this.readable=!1,this[rv]=0,this[KS]=!1,this.dirCache=e.dirCache||new Map,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw new TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw new TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=null,this.gid=null,this.setOwner=!1;e.preserveOwner===void 0&&typeof e.uid!="number"?this.preserveOwner=process.getuid&&process.getuid()===0:this.preserveOwner=!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():null,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():null,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||process.platform==="win32",this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=eo.resolve(e.cwd||process.cwd()),this.strip=+e.strip||0,this.processUmask=process.umask(),this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[hW](t))}warn(e,t,i={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(i.recoverable=!1),super.warn(e,t,i)}[JS](){this[KS]&&this[rv]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"),this.emit("close"))}[bW](e){if(this.strip){let t=e.path.split(/\/|\\/);if(t.length<this.strip)return!1;if(e.path=t.slice(this.strip).join("/"),e.type==="Link"){let i=e.linkpath.split(/\/|\\/);i.length>=this.strip&&(e.linkpath=i.slice(this.strip).join("/"))}}if(!this.preservePaths){let t=e.path;if(t.match(/(^|\/|\\)\.\.(\\|\/|$)/))return this.warn("TAR_ENTRY_ERROR","path contains '..'",{entry:e,path:t}),!1;if(eo.win32.isAbsolute(t)){let i=eo.win32.parse(t);e.path=t.substr(i.root.length);let n=i.root;this.warn("TAR_ENTRY_INFO",`stripping ${n} from absolute path`,{entry:e,path:t})}}if(this.win32){let t=eo.win32.parse(e.path);e.path=t.root===""?dW.encode(e.path):t.root+dW.encode(e.path.substr(t.root.length))}return eo.isAbsolute(e.path)?e.absolute=e.path:e.absolute=eo.resolve(this.cwd,e.path),!0}[hW](e){if(!this[bW](e))return e.resume();switch(Mge.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode=e.mode|448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[HS](e);case"CharacterDevice":case"BlockDevice":case"FIFO":return this[yW](e)}}[xr](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[xu](),t.resume())}[wu](e,t,i){WS(e,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t},i)}[Pp](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[Tp](e){return SW(this.uid,e.uid,this.processUid)}[Rp](e){return SW(this.gid,e.gid,this.processGid)}[GS](e,t){let i=e.mode&4095||this.fmode,n=new qge.WriteStream(e.absolute,{flags:DW(e.size),mode:i,autoClose:!1});n.on("error",l=>this[xr](l,e));let o=1,s=l=>{if(l)return this[xr](l,e);--o==0&&qe.close(n.fd,u=>{t(),u?this[xr](u,e):this[xu]()})};n.on("finish",l=>{let u=e.absolute,c=n.fd;if(e.mtime&&!this.noMtime){o++;let f=e.atime||new Date,p=e.mtime;qe.futimes(c,f,p,d=>d?qe.utimes(u,f,p,h=>s(h&&d)):s())}if(this[Pp](e)){o++;let f=this[Tp](e),p=this[Rp](e);qe.fchown(c,f,p,d=>d?qe.chown(u,f,p,h=>s(h&&d)):s())}s()});let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",l=>this[xr](l,e)),e.pipe(a)),a.pipe(n)}[VS](e,t){let i=e.mode&4095||this.dmode;this[wu](e.absolute,i,n=>{if(n)return t(),this[xr](n,e);let o=1,s=a=>{--o==0&&(t(),this[xu](),e.resume())};e.mtime&&!this.noMtime&&(o++,qe.utimes(e.absolute,e.atime||new Date,e.mtime,s)),this[Pp](e)&&(o++,qe.chown(e.absolute,this[Tp](e),this[Rp](e),s)),s()})}[yW](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[gW](e,t){this[tv](e,e.linkpath,"symlink",t)}[vW](e,t){this[tv](e,eo.resolve(this.cwd,e.linkpath),"link",t)}[wW](){this[rv]++}[xu](){this[rv]--,this[JS]()}[YS](e){this[xu](),e.resume()}[zS](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&process.platform!=="win32"}[HS](e){this[wW]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,i=>this[mW](e,i))}[mW](e,t){this[wu](eo.dirname(e.absolute),this.dmode,i=>{if(i)return t(),this[xr](i,e);qe.lstat(e.absolute,(n,o)=>{o&&(this.keep||this.newer&&o.mtime>e.mtime)?(this[YS](e),t()):n||this[zS](e,o)?this[to](null,e,t):o.isDirectory()?e.type==="Directory"?!e.mode||(o.mode&4095)===e.mode?this[to](null,e,t):qe.chmod(e.absolute,e.mode,s=>this[to](s,e,t)):qe.rmdir(e.absolute,s=>this[to](s,e,t)):Bge(e.absolute,s=>this[to](s,e,t))})})}[to](e,t,i){if(e)return this[xr](e,t);switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[GS](t,i);case"Link":return this[vW](t,i);case"SymbolicLink":return this[gW](t,i);case"Directory":case"GNUDumpDir":return this[VS](t,i)}}[tv](e,t,i,n){qe[i](t,e.absolute,o=>{if(o)return this[xr](o,e);n(),this[xu](),e.resume()})}},EW=class extends nv{constructor(e){super(e)}[HS](e){let t=this[wu](eo.dirname(e.absolute),this.dmode,iv);if(t)return this[xr](t,e);try{let i=qe.lstatSync(e.absolute);if(this.keep||this.newer&&i.mtime>e.mtime)return this[YS](e);if(this[zS](e,i))return this[to](null,e,iv);try{return i.isDirectory()?e.type==="Directory"?e.mode&&(i.mode&4095)!==e.mode&&qe.chmodSync(e.absolute,e.mode):qe.rmdirSync(e.absolute):jge(e.absolute),this[to](null,e,iv)}catch(n){return this[xr](n,e)}}catch(i){return this[to](null,e,iv)}}[GS](e,t){let i=e.mode&4095||this.fmode,n=l=>{let u;try{qe.closeSync(s)}catch(c){u=c}(l||u)&&this[xr](l||u,e)},o,s;try{s=qe.openSync(e.absolute,DW(e.size),i)}catch(l){return n(l)}let a=this.transform&&this.transform(e)||e;a!==e&&(a.on("error",l=>this[xr](l,e)),e.pipe(a)),a.on("data",l=>{try{qe.writeSync(s,l,0,l.length)}catch(u){n(u)}}),a.on("end",l=>{let u=null;if(e.mtime&&!this.noMtime){let c=e.atime||new Date,f=e.mtime;try{qe.futimesSync(s,c,f)}catch(p){try{qe.utimesSync(e.absolute,c,f)}catch(d){u=p}}}if(this[Pp](e)){let c=this[Tp](e),f=this[Rp](e);try{qe.fchownSync(s,c,f)}catch(p){try{qe.chownSync(e.absolute,c,f)}catch(d){u=u||p}}}n(u)})}[VS](e,t){let i=e.mode&4095||this.dmode,n=this[wu](e.absolute,i);if(n)return this[xr](n,e);if(e.mtime&&!this.noMtime)try{qe.utimesSync(e.absolute,e.atime||new Date,e.mtime)}catch(o){}if(this[Pp](e))try{qe.chownSync(e.absolute,this[Tp](e),this[Rp](e))}catch(o){}e.resume()}[wu](e,t){try{return WS.sync(e,{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cache:this.dirCache,cwd:this.cwd,mode:t})}catch(i){return i}}[tv](e,t,i,n){try{qe[i+"Sync"](t,e.absolute),e.resume()}catch(o){return this[xr](o,e)}}};nv.Sync=EW;pW.exports=nv});var RW=g((KOe,CW)=>{"use strict";var Uge=tu(),ov=XS(),_W=require("fs"),PW=mu(),TW=require("path"),VOe=CW.exports=(r,e,t)=>{typeof r=="function"?(t=r,e=null,r={}):Array.isArray(r)&&(e=r,r={}),typeof e=="function"&&(t=e,e=null),e?e=Array.from(e):e=[];let i=Uge(r);if(i.sync&&typeof t=="function")throw new TypeError("callback not supported for sync tar functions");if(!i.file&&typeof t=="function")throw new TypeError("callback only supported with file option");return e.length&&Wge(i,e),i.file&&i.sync?Hge(i):i.file?zge(i,t):i.sync?Gge(i):Vge(i)},Wge=(r,e)=>{let t=new Map(e.map(o=>[o.replace(/\/+$/,""),!0])),i=r.filter,n=(o,s)=>{let a=s||TW.parse(o).root||".",l=o===a?!1:t.has(o)?t.get(o):n(TW.dirname(o),a);return t.set(o,l),l};r.filter=i?(o,s)=>i(o,s)&&n(o.replace(/\/+$/,"")):o=>n(o.replace(/\/+$/,""))},Hge=r=>{let e=new ov.Sync(r),t=r.file,i=!0,n,o=_W.statSync(t),s=r.maxReadSize||16*1024*1024;new PW.ReadStreamSync(t,{readSize:s,size:o.size}).pipe(e)},zge=(r,e)=>{let t=new ov(r),i=r.maxReadSize||16*1024*1024,n=r.file,o=new Promise((s,a)=>{t.on("error",a),t.on("close",s),_W.stat(n,(l,u)=>{if(l)a(l);else{let c=new PW.ReadStream(n,{readSize:i,size:u.size});c.on("error",a),c.pipe(t)}})});return e?o.then(e,e):o},Gge=r=>new ov.Sync(r),Vge=r=>new ov(r)});var kW=g(It=>{"use strict";It.c=It.create=h8();It.r=It.replace=OS();It.t=It.list=Yg();It.u=It.update=S8();It.x=It.extract=RW();It.Pack=qg();It.Unpack=XS();It.Parse=Cp();It.ReadEntry=bp();It.WriteEntry=fS();It.Header=ou();It.Pax=Eg();It.types=yp()});var OW=g((YOe,IW)=>{IW.exports=cr;function cr(r){if(!(this instanceof cr))return new cr(r);this.value=r}cr.prototype.get=function(r){for(var e=this.value,t=0;t<r.length;t++){var i=r[t];if(!Object.hasOwnProperty.call(e,i)){e=void 0;break}e=e[i]}return e};cr.prototype.set=function(r,e){for(var t=this.value,i=0;i<r.length-1;i++){var n=r[i];Object.hasOwnProperty.call(t,n)||(t[n]={}),t=t[n]}return t[r[i]]=e,e};cr.prototype.map=function(r){return FW(this.value,r,!0)};cr.prototype.forEach=function(r){return this.value=FW(this.value,r,!1),this.value};cr.prototype.reduce=function(r,e){var t=arguments.length===1,i=t?this.value:e;return this.forEach(function(n){(!this.isRoot||!t)&&(i=r.call(this,i,n))}),i};cr.prototype.deepEqual=function(r){if(arguments.length!==1)throw new Error("deepEqual requires exactly one object to compare against");var e=!0,t=r;return this.forEach(function(i){var n=function(){e=!1}.bind(this);if(!this.isRoot){if(typeof t!="object")return n();t=t[this.key]}var o=t;this.post(function(){t=o});var s=function(f){return Object.prototype.toString.call(f)};if(this.circular)cr(r).get(this.circular.path)!==o&&n();else if(typeof o!=typeof i)n();else if(o===null||i===null||o===void 0||i===void 0)o!==i&&n();else if(o.__proto__!==i.__proto__)n();else if(o!==i){if(typeof o=="function")o instanceof RegExp?o.toString()!=i.toString()&&n():o!==i&&n();else if(typeof o=="object")if(s(i)==="[object Arguments]"||s(o)==="[object Arguments]")s(o)!==s(i)&&n();else if(o instanceof Date||i instanceof Date)(!(o instanceof Date)||!(i instanceof Date)||o.getTime()!==i.getTime())&&n();else{var a=Object.keys(o),l=Object.keys(i);if(a.length!==l.length)return n();for(var u=0;u<a.length;u++){var c=a[u];Object.hasOwnProperty.call(i,c)||n()}}}}),e};cr.prototype.paths=function(){var r=[];return this.forEach(function(e){r.push(this.path)}),r};cr.prototype.nodes=function(){var r=[];return this.forEach(function(e){r.push(this.node)}),r};cr.prototype.clone=function(){var r=[],e=[];return function t(i){for(var n=0;n<r.length;n++)if(r[n]===i)return e[n];if(typeof i=="object"&&i!==null){var o=AW(i);return r.push(i),e.push(o),Object.keys(i).forEach(function(s){o[s]=t(i[s])}),r.pop(),e.pop(),o}else return i}(this.value)};function FW(r,e,t){var i=[],n=[],o=!0;return function s(a){var l=t?AW(a):a,u={},c={node:l,node_:a,path:[].concat(i),parent:n.slice(-1)[0],key:i.slice(-1)[0],isRoot:i.length===0,level:i.length,circular:null,update:function(h){c.isRoot||(c.parent.node[c.key]=h),c.node=h},delete:function(){delete c.parent.node[c.key]},remove:function(){Array.isArray(c.parent.node)?c.parent.node.splice(c.key,1):delete c.parent.node[c.key]},before:function(h){u.before=h},after:function(h){u.after=h},pre:function(h){u.pre=h},post:function(h){u.post=h},stop:function(){o=!1}};if(!o)return c;if(typeof l=="object"&&l!==null){c.isLeaf=Object.keys(l).length==0;for(var f=0;f<n.length;f++)if(n[f].node_===a){c.circular=n[f];break}}else c.isLeaf=!0;c.notLeaf=!c.isLeaf,c.notRoot=!c.isRoot;var p=e.call(c,c.node);if(p!==void 0&&c.update&&c.update(p),u.before&&u.before.call(c,c.node),typeof c.node=="object"&&c.node!==null&&!c.circular){n.push(c);var d=Object.keys(c.node);d.forEach(function(h,m){i.push(h),u.pre&&u.pre.call(c,c.node[h],h);var y=s(c.node[h]);t&&Object.hasOwnProperty.call(c.node,h)&&(c.node[h]=y.node),y.isLast=m==d.length-1,y.isFirst=m==0,u.post&&u.post.call(c,y),i.pop()}),n.pop()}return u.after&&u.after.call(c,c.node),c}(r).node}Object.keys(cr.prototype).forEach(function(r){cr[r]=function(e){var t=[].slice.call(arguments,1),i=cr(e);return i[r].apply(i,t)}});function AW(r){if(typeof r=="object"&&r!==null){var e;return Array.isArray(r)?e=[]:r instanceof Date?e=new Date(r):r instanceof Boolean?e=new Boolean(r):r instanceof Number?e=new Number(r):r instanceof String?e=new String(r):e=Object.create(Object.getPrototypeOf(r)),Object.keys(r).forEach(function(t){e[t]=r[t]}),e}else return r}});var MW=g((XOe,LW)=>{var Kge=OW(),Jge=require("events").EventEmitter;LW.exports=Du;function Du(r){var e=Du.saw(r,{}),t=r.call(e.handlers,e);return t!==void 0&&(e.handlers=t),e.record(),e.chain()}Du.light=function(e){var t=Du.saw(e,{}),i=e.call(t.handlers,t);return i!==void 0&&(t.handlers=i),t.chain()};Du.saw=function(r,e){var t=new Jge;return t.handlers=e,t.actions=[],t.chain=function(){var i=Kge(t.handlers).map(function(n){if(this.isRoot)return n;var o=this.path;typeof n=="function"&&this.update(function(){return t.actions.push({path:o,args:[].slice.call(arguments)}),i})});return process.nextTick(function(){t.emit("begin"),t.next()}),i},t.pop=function(){return t.actions.shift()},t.next=function(){var i=t.pop();if(!i)t.emit("end");else if(!i.trap){var n=t.handlers;i.path.forEach(function(o){n=n[o]}),n.apply(t.handlers,i.args)}},t.nest=function(i){var n=[].slice.call(arguments,1),o=!0;if(typeof i=="boolean"){var o=i;i=n.shift()}var s=Du.saw(r,{}),a=r.call(s.handlers,s);a!==void 0&&(s.handlers=a),typeof t.step!="undefined"&&s.record(),i.apply(s.chain(),n),o!==!1&&s.on("end",t.next)},t.record=function(){Yge(t)},["trap","down","jump"].forEach(function(i){t[i]=function(){throw new Error("To use the trap, down and jump features, please call record() first to start recording actions.")}}),t};function Yge(r){r.step=0,r.pop=function(){return r.actions[r.step++]},r.trap=function(e,t){var i=Array.isArray(e)?e:[e];r.actions.push({path:i,step:r.step,cb:t,trap:!0})},r.down=function(e){var t=(Array.isArray(e)?e:[e]).join("/"),i=r.actions.slice(r.step).map(function(o){return o.trap&&o.step<=r.step?!1:o.path.join("/")==t}).indexOf(!0);i>=0?r.step+=i:r.step=r.actions.length;var n=r.actions[r.step-1];n&&n.trap?(r.step=n.step,n.cb()):r.next()},r.jump=function(e){r.step=e,r.next()}}});var qW=g((ZOe,NW)=>{NW.exports=Dr;function Dr(r){if(!(this instanceof Dr))return new Dr(r);this.buffers=r||[],this.length=this.buffers.reduce(function(e,t){return e+t.length},0)}Dr.prototype.push=function(){for(var r=0;r<arguments.length;r++)if(!Buffer.isBuffer(arguments[r]))throw new TypeError("Tried to push a non-buffer");for(var r=0;r<arguments.length;r++){var e=arguments[r];this.buffers.push(e),this.length+=e.length}return this.length};Dr.prototype.unshift=function(){for(var r=0;r<arguments.length;r++)if(!Buffer.isBuffer(arguments[r]))throw new TypeError("Tried to unshift a non-buffer");for(var r=0;r<arguments.length;r++){var e=arguments[r];this.buffers.unshift(e),this.length+=e.length}return this.length};Dr.prototype.copy=function(r,e,t,i){return this.slice(t,i).copy(r,e,0,i-t)};Dr.prototype.splice=function(r,e){var t=this.buffers,i=r>=0?r:this.length-r,n=[].slice.call(arguments,2);e===void 0?e=this.length-i:e>this.length-i&&(e=this.length-i);for(var r=0;r<n.length;r++)this.length+=n[r].length;for(var o=new Dr,s=0,a=0,l=0;l<t.length&&a+t[l].length<i;l++)a+=t[l].length;if(i-a>0){var u=i-a;if(u+e<t[l].length){o.push(t[l].slice(u,u+e));for(var c=t[l],f=new Buffer(u),r=0;r<u;r++)f[r]=c[r];for(var p=new Buffer(c.length-u-e),r=u+e;r<c.length;r++)p[r-e-u]=c[r];if(n.length>0){var d=n.slice();d.unshift(f),d.push(p),t.splice.apply(t,[l,1].concat(d)),l+=d.length,n=[]}else t.splice(l,1,f,p),l+=2}else o.push(t[l].slice(u)),t[l]=t[l].slice(0,u),l++}for(n.length>0&&(t.splice.apply(t,[l,0].concat(n)),l+=n.length);o.length<e;){var h=t[l],m=h.length,y=Math.min(m,e-o.length);y===m?(o.push(h),t.splice(l,1)):(o.push(h.slice(0,y)),t[l]=t[l].slice(y))}return this.length-=o.length,o};Dr.prototype.slice=function(r,e){var t=this.buffers;e===void 0&&(e=this.length),r===void 0&&(r=0),e>this.length&&(e=this.length);for(var i=0,n=0;n<t.length&&i+t[n].length<=r;n++)i+=t[n].length;for(var o=new Buffer(e-r),s=0,a=n;s<e-r&&a<t.length;a++){var l=t[a].length,u=s===0?r-i:0,c=s+l>=e-r?Math.min(u+(e-r)-s,l):l;t[a].copy(o,s,u,c),s+=c-u}return o};Dr.prototype.pos=function(r){if(r<0||r>=this.length)throw new Error("oob");for(var e=r,t=0,i=null;;){if(i=this.buffers[t],e<i.length)return{buf:t,offset:e};e-=i.length,t++}};Dr.prototype.get=function(e){var t=this.pos(e);return this.buffers[t.buf].get(t.offset)};Dr.prototype.set=function(e,t){var i=this.pos(e);return this.buffers[i.buf].set(i.offset,t)};Dr.prototype.indexOf=function(r,e){if(typeof r=="string")r=new Buffer(r);else if(!(r instanceof Buffer))throw new Error("Invalid type for a search string");if(!r.length)return 0;if(!this.length)return-1;var t=0,i=0,n=0,o,s=0;if(e){var a=this.pos(e);t=a.buf,i=a.offset,s=e}for(;;){for(;i>=this.buffers[t].length;)if(i=0,t++,t>=this.buffers.length)return-1;var l=this.buffers[t][i];if(l==r[n]){if(n==0&&(o={i:t,j:i,pos:s}),n++,n==r.length)return o.pos}else n!=0&&(t=o.i,i=o.j,s=o.pos,n=0);i++,s++}};Dr.prototype.toBuffer=function(){return this.slice()};Dr.prototype.toString=function(r,e,t){return this.slice(e,t).toString(r)}});var BW=g((QOe,$W)=>{$W.exports=function(r){function e(i,n){var o=t.store,s=i.split(".");s.slice(0,-1).forEach(function(l){o[l]===void 0&&(o[l]={}),o=o[l]});var a=s[s.length-1];return arguments.length==1?o[a]:o[a]=n}var t={get:function(i){return e(i)},set:function(i,n){return e(i,n)},store:r||{}};return t}});var GW=g((va,jW)=>{var Xge=MW(),UW=require("events").EventEmitter,Zge=qW(),sv=BW(),Qge=require("stream").Stream;va=jW.exports=function(r,e){if(Buffer.isBuffer(r))return va.parse(r);var t=va.stream();return r&&r.pipe?r.pipe(t):r&&(r.on(e||"data",function(i){t.write(i)}),r.on("end",function(){t.end()})),t};va.stream=function(r){if(r)return va.apply(null,arguments);var e=null;function t(f,p,d){e={bytes:f,skip:d,cb:function(h){e=null,p(h)}},n()}var i=null;function n(){if(!e){c&&(u=!0);return}if(typeof e=="function")e();else{var f=i+e.bytes;if(a.length>=f){var p;i==null?(p=a.splice(0,f),e.skip||(p=p.slice())):(e.skip||(p=a.slice(i,f)),i=f),e.skip?e.cb():e.cb(p)}}}function o(f){function p(){u||f.next()}var d=WW(function(h,m){return function(y){t(h,function(v){l.set(y,m(v)),p()})}});return d.tap=function(h){f.nest(h,l.store)},d.into=function(h,m){l.get(h)||l.set(h,{});var y=l;l=sv(y.get(h)),f.nest(function(){m.apply(this,arguments),this.tap(function(){l=y})},l.store)},d.flush=function(){l.store={},p()},d.loop=function(h){var m=!1;f.nest(!1,function y(){this.vars=l.store,h.call(this,function(){m=!0,p()},l.store),this.tap(function(){m?f.next():y.call(this)}.bind(this))},l.store)},d.buffer=function(h,m){typeof m=="string"&&(m=l.get(m)),t(m,function(y){l.set(h,y),p()})},d.skip=function(h){typeof h=="string"&&(h=l.get(h)),t(h,function(){p()})},d.scan=function(m,y){if(typeof y=="string")y=new Buffer(y);else if(!Buffer.isBuffer(y))throw new Error("search must be a Buffer or a string");var v=0;e=function(){var x=a.indexOf(y,i+v),w=x-i-v;x!==-1?(e=null,i!=null?(l.set(m,a.slice(i,i+v+w)),i+=v+w+y.length):(l.set(m,a.slice(0,v+w)),a.splice(0,v+w+y.length)),p(),n()):w=Math.max(a.length-y.length-i-v,0),v+=w},n()},d.peek=function(h){i=0,f.nest(function(){h.call(this,l.store),this.tap(function(){i=null})})},d}var s=Xge.light(o);s.writable=!0;var a=Zge();s.write=function(f){a.push(f),n()};var l=sv(),u=!1,c=!1;return s.end=function(){c=!0},s.pipe=Qge.prototype.pipe,Object.getOwnPropertyNames(UW.prototype).forEach(function(f){s[f]=UW.prototype[f]}),s};va.parse=function(e){var t=WW(function(o,s){return function(a){if(i+o<=e.length){var l=e.slice(i,i+o);i+=o,n.set(a,s(l))}else n.set(a,null);return t}}),i=0,n=sv();return t.vars=n.store,t.tap=function(o){return o.call(t,n.store),t},t.into=function(o,s){n.get(o)||n.set(o,{});var a=n;return n=sv(a.get(o)),s.call(t,n.store),n=a,t},t.loop=function(o){for(var s=!1,a=function(){s=!0};s===!1;)o.call(t,a,n.store);return t},t.buffer=function(o,s){typeof s=="string"&&(s=n.get(s));var a=e.slice(i,Math.min(e.length,i+s));return i+=s,n.set(o,a),t},t.skip=function(o){return typeof o=="string"&&(o=n.get(o)),i+=o,t},t.scan=function(o,s){if(typeof s=="string")s=new Buffer(s);else if(!Buffer.isBuffer(s))throw new Error("search must be a Buffer or a string");n.set(o,null);for(var a=0;a+i<=e.length-s.length+1;a++){for(var l=0;l<s.length&&e[i+a+l]===s[l];l++);if(l===s.length)break}return n.set(o,e.slice(i,i+a)),i+=a+s.length,t},t.peek=function(o){var s=i;return o.call(t,n.store),i=s,t},t.flush=function(){return n.store={},t},t.eof=function(){return i>=e.length},t};function HW(r){for(var e=0,t=0;t<r.length;t++)e+=Math.pow(256,t)*r[t];return e}function zW(r){for(var e=0,t=0;t<r.length;t++)e+=Math.pow(256,r.length-t-1)*r[t];return e}function eve(r){var e=zW(r);return(r[0]&128)==128&&(e-=Math.pow(256,r.length)),e}function tve(r){var e=HW(r);return(r[r.length-1]&128)==128&&(e-=Math.pow(256,r.length)),e}function WW(r){var e={};return[1,2,4,8].forEach(function(t){var i=t*8;e["word"+i+"le"]=e["word"+i+"lu"]=r(t,HW),e["word"+i+"ls"]=r(t,tve),e["word"+i+"be"]=e["word"+i+"bu"]=r(t,zW),e["word"+i+"bs"]=r(t,eve)}),e.word8=e.word8u=e.word8be,e.word8s=e.word8bs,e}});var JW=g((eLe,VW)=>{var KW=require("stream").Transform,rve=require("util");function ya(r,e){if(!(this instanceof ya))return new ya;KW.call(this);var t=typeof r=="object"?r.pattern:r;this.pattern=Buffer.isBuffer(t)?t:Buffer.from(t),this.requiredLength=this.pattern.length,r.requiredExtraSize&&(this.requiredLength+=r.requiredExtraSize),this.data=new Buffer(""),this.bytesSoFar=0,this.matchFn=e}rve.inherits(ya,KW);ya.prototype.checkDataChunk=function(r){var e=this.data.length>=this.requiredLength;if(!!e){var t=this.data.indexOf(this.pattern,r?1:0);if(t>=0&&t+this.requiredLength>this.data.length){if(t>0){var i=this.data.slice(0,t);this.push(i),this.bytesSoFar+=t,this.data=this.data.slice(t)}return}if(t===-1){var n=this.data.length-this.requiredLength+1,i=this.data.slice(0,n);this.push(i),this.bytesSoFar+=n,this.data=this.data.slice(n);return}if(t>0){var i=this.data.slice(0,t);this.data=this.data.slice(t),this.push(i),this.bytesSoFar+=t}var o=this.matchFn?this.matchFn(this.data,this.bytesSoFar):!0;if(o){this.data=new Buffer("");return}return!0}};ya.prototype._transform=function(r,e,t){this.data=Buffer.concat([this.data,r]);for(var i=!0;this.checkDataChunk(!i);)i=!1;t()};ya.prototype._flush=function(r){if(this.data.length>0)for(var e=!0;this.checkDataChunk(!e);)e=!1;this.data.length>0&&(this.push(this.data),this.data=null),r()};VW.exports=ya});var XW=g((tLe,YW)=>{"use strict";var ZS=require("stream"),ive=require("util").inherits;function kp(){if(!(this instanceof kp))return new kp;ZS.PassThrough.call(this),this.path=null,this.type=null,this.isDirectory=!1}ive(kp,ZS.PassThrough);kp.prototype.autodrain=function(){return this.pipe(new ZS.Transform({transform:function(r,e,t){t()}}))};YW.exports=kp});var eE=g((rLe,ZW)=>{"use strict";var rs=GW(),QS=require("stream"),nve=require("util"),ove=require("zlib"),sve=JW(),QW=XW(),oe={STREAM_START:0,START:1,LOCAL_FILE_HEADER:2,LOCAL_FILE_HEADER_SUFFIX:3,FILE_DATA:4,FILE_DATA_END:5,DATA_DESCRIPTOR:6,CENTRAL_DIRECTORY_FILE_HEADER:7,CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:8,CDIR64_END:9,CDIR64_END_DATA_SECTOR:10,CDIR64_LOCATOR:11,CENTRAL_DIRECTORY_END:12,CENTRAL_DIRECTORY_END_COMMENT:13,TRAILING_JUNK:14,ERROR:99},Ip=4294967296,ave=67324752,lve=134695760,uve=33639248,cve=101075792,fve=117853008,pve=101010256;function zt(r){if(!(this instanceof zt))return new zt(r);QS.Transform.call(this),this.options=r||{},this.data=new Buffer(""),this.state=oe.STREAM_START,this.skippedBytes=0,this.parsedEntity=null,this.outStreamInfo={}}nve.inherits(zt,QS.Transform);zt.prototype.processDataChunk=function(r){var e;switch(this.state){case oe.STREAM_START:case oe.START:e=4;break;case oe.LOCAL_FILE_HEADER:e=26;break;case oe.LOCAL_FILE_HEADER_SUFFIX:e=this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength;break;case oe.DATA_DESCRIPTOR:e=12;break;case oe.CENTRAL_DIRECTORY_FILE_HEADER:e=42;break;case oe.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:e=this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength+this.parsedEntity.fileCommentLength;break;case oe.CDIR64_END:e=52;break;case oe.CDIR64_END_DATA_SECTOR:e=this.parsedEntity.centralDirectoryRecordSize-44;break;case oe.CDIR64_LOCATOR:e=16;break;case oe.CENTRAL_DIRECTORY_END:e=18;break;case oe.CENTRAL_DIRECTORY_END_COMMENT:e=this.parsedEntity.commentLength;break;case oe.FILE_DATA:return 0;case oe.FILE_DATA_END:return 0;case oe.TRAILING_JUNK:return this.options.debug&&console.log("found",r.length,"bytes of TRAILING_JUNK"),r.length;default:return r.length}var t=r.length;if(t<e)return 0;switch(this.state){case oe.STREAM_START:case oe.START:var i=r.readUInt32LE(0);switch(i){case ave:this.state=oe.LOCAL_FILE_HEADER;break;case uve:this.state=oe.CENTRAL_DIRECTORY_FILE_HEADER;break;case cve:this.state=oe.CDIR64_END;break;case fve:this.state=oe.CDIR64_LOCATOR;break;case pve:this.state=oe.CENTRAL_DIRECTORY_END;break;default:var n=this.state===oe.STREAM_START;if(!n&&(i&65535)!=19280&&this.skippedBytes<26){for(var o=i,s=4,a=1;a<4&&o!==0;a++)if(o=o>>>8,(o&255)==80){s=a;break}return this.skippedBytes+=s,this.options.debug&&console.log("Skipped",this.skippedBytes,"bytes"),s}this.state=oe.ERROR;var l=n?"Not a valid zip file":"Invalid signature in zip file";if(this.options.debug){var u=r.readUInt32LE(0),c;try{c=r.slice(0,4).toString()}catch(E){}console.log("Unexpected signature in zip file: 0x"+u.toString(16),'"'+c+'", skipped',this.skippedBytes,"bytes")}return this.emit("error",new Error(l)),r.length}return this.skippedBytes=0,e;case oe.LOCAL_FILE_HEADER:return this.parsedEntity=this._readFile(r),this.state=oe.LOCAL_FILE_HEADER_SUFFIX,e;case oe.LOCAL_FILE_HEADER_SUFFIX:var f=new QW,p=(this.parsedEntity.flags&2048)!=0;f.path=this._decodeString(r.slice(0,this.parsedEntity.fileNameLength),p);var d=r.slice(this.parsedEntity.fileNameLength,this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength),h=this._readExtraFields(d);if(h&&h.parsed&&(h.parsed.path&&!p&&(f.path=h.parsed.path),Number.isFinite(h.parsed.uncompressedSize)&&this.parsedEntity.uncompressedSize===Ip-1&&(this.parsedEntity.uncompressedSize=h.parsed.uncompressedSize),Number.isFinite(h.parsed.compressedSize)&&this.parsedEntity.compressedSize===Ip-1&&(this.parsedEntity.compressedSize=h.parsed.compressedSize)),this.parsedEntity.extra=h.parsed||{},this.options.debug){let E=Object.assign({},this.parsedEntity,{path:f.path,flags:"0x"+this.parsedEntity.flags.toString(16),extraFields:h&&h.debug});console.log("decoded LOCAL_FILE_HEADER:",JSON.stringify(E,null,2))}return this._prepareOutStream(this.parsedEntity,f),this.emit("entry",f),this.state=oe.FILE_DATA,e;case oe.CENTRAL_DIRECTORY_FILE_HEADER:return this.parsedEntity=this._readCentralDirectoryEntry(r),this.state=oe.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX,e;case oe.CENTRAL_DIRECTORY_FILE_HEADER_SUFFIX:var p=(this.parsedEntity.flags&2048)!=0,m=this._decodeString(r.slice(0,this.parsedEntity.fileNameLength),p),d=r.slice(this.parsedEntity.fileNameLength,this.parsedEntity.fileNameLength+this.parsedEntity.extraFieldLength),h=this._readExtraFields(d);h&&h.parsed&&h.parsed.path&&!p&&(m=h.parsed.path),this.parsedEntity.extra=h.parsed;var y=(this.parsedEntity.versionMadeBy&65280)>>8==3,v,x;if(y){v=this.parsedEntity.externalFileAttributes>>>16;var w=v>>>12;x=(w&10)==10}if(this.options.debug){let E=Object.assign({},this.parsedEntity,{path:m,flags:"0x"+this.parsedEntity.flags.toString(16),unixAttrs:v&&"0"+v.toString(8),isSymlink:x,extraFields:h.debug});console.log("decoded CENTRAL_DIRECTORY_FILE_HEADER:",JSON.stringify(E,null,2))}return this.state=oe.START,e;case oe.CDIR64_END:return this.parsedEntity=this._readEndOfCentralDirectory64(r),this.options.debug&&console.log("decoded CDIR64_END_RECORD:",this.parsedEntity),this.state=oe.CDIR64_END_DATA_SECTOR,e;case oe.CDIR64_END_DATA_SECTOR:return this.state=oe.START,e;case oe.CDIR64_LOCATOR:return this.state=oe.START,e;case oe.CENTRAL_DIRECTORY_END:return this.parsedEntity=this._readEndOfCentralDirectory(r),this.options.debug&&console.log("decoded CENTRAL_DIRECTORY_END:",this.parsedEntity),this.state=oe.CENTRAL_DIRECTORY_END_COMMENT,e;case oe.CENTRAL_DIRECTORY_END_COMMENT:return this.options.debug&&console.log("decoded CENTRAL_DIRECTORY_END_COMMENT:",r.slice(0,e).toString()),this.state=oe.TRAILING_JUNK,e;case oe.ERROR:return r.length;default:return console.log("didn't handle state #",this.state,"discarding"),r.length}};zt.prototype._prepareOutStream=function(r,e){var t=this,i=r.uncompressedSize===0&&/[\/\\]$/.test(e.path);e.path=e.path.replace(/^([/\\]*[.]+[/\\]+)*[/\\]*/,""),e.type=i?"Directory":"File",e.isDirectory=i;var n=!(r.flags&8);n&&(e.size=r.uncompressedSize);var o=r.versionsNeededToExtract<=45;if(this.outStreamInfo={stream:null,limit:n?r.compressedSize:-1,written:0},n)this.outStreamInfo.stream=new QS.PassThrough;else{var s=new Buffer(4);s.writeUInt32LE(lve,0);var a=r.extra.zip64Mode,l=a?20:12,u={pattern:s,requiredExtraSize:l},c=new sve(u,function(m,y){var v=t._readDataDescriptor(m,a),x=v.compressedSize===y;if(!a&&!x&&y>=Ip)for(var w=y-Ip;w>=0&&(x=v.compressedSize===w,!x);)w-=Ip;if(!!x){t.state=oe.FILE_DATA_END;var E=a?24:16;return t.data.length>0?t.data=Buffer.concat([m.slice(E),t.data]):t.data=m.slice(E),!0}});this.outStreamInfo.stream=c}var f=r.flags&1||r.flags&64;if(f||!o){var p=f?"Encrypted files are not supported!":"Zip version "+Math.floor(r.versionsNeededToExtract/10)+"."+r.versionsNeededToExtract%10+" is not supported";e.skip=!0,setImmediate(()=>{e.emit("error",new Error(p))}),this.outStreamInfo.stream.pipe(new QW().autodrain());return}var d=r.compressionMethod>0;if(d){var h=ove.createInflateRaw();h.on("error",function(m){t.state=oe.ERROR,t.emit("error",m)}),this.outStreamInfo.stream.pipe(h).pipe(e)}else this.outStreamInfo.stream.pipe(e);this._drainAllEntries&&e.autodrain()};zt.prototype._readFile=function(r){var e=rs.parse(r).word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").vars;return e};zt.prototype._readExtraFields=function(r){var e={},t={parsed:e};this.options.debug&&(t.debug=[]);for(var i=0;i<r.length;){var n=rs.parse(r).skip(i).word16lu("extraId").word16lu("extraSize").vars;i+=4;var o=void 0;switch(n.extraId){case 1:o="Zip64 extended information extra field";var s=rs.parse(r.slice(i,i+n.extraSize)).word64lu("uncompressedSize").word64lu("compressedSize").word64lu("offsetToLocalHeader").word32lu("diskStartNumber").vars;s.uncompressedSize!==null&&(e.uncompressedSize=s.uncompressedSize),s.compressedSize!==null&&(e.compressedSize=s.compressedSize),e.zip64Mode=!0;break;case 10:o="NTFS extra field";break;case 21589:o="extended timestamp";var a=r.readUInt8(i),l=1;n.extraSize>=l+4&&a&1&&(e.mtime=new Date(r.readUInt32LE(i+l)*1e3),l+=4),n.extraSize>=l+4&&a&2&&(e.atime=new Date(r.readUInt32LE(i+l)*1e3),l+=4),n.extraSize>=l+4&&a&4&&(e.ctime=new Date(r.readUInt32LE(i+l)*1e3));break;case 28789:o="Info-ZIP Unicode Path Extra Field";var u=r.readUInt8(i);if(u===1){var l=1,c=r.readUInt32LE(i+l);l+=4;var f=r.slice(i+l);e.path=f.toString()}break;case 13:case 22613:o=n.extraId===13?"PKWARE Unix":"Info-ZIP UNIX (type 1)";var l=0;if(n.extraSize>=8){var p=new Date(r.readUInt32LE(i+l)*1e3);l+=4;var d=new Date(r.readUInt32LE(i+l)*1e3);if(l+=4,e.atime=p,e.mtime=d,n.extraSize>=12){var h=r.readUInt16LE(i+l);l+=2;var m=r.readUInt16LE(i+l);l+=2,e.uid=h,e.gid=m}}break;case 30805:o="Info-ZIP UNIX (type 2)";var l=0;if(n.extraSize>=4){var h=r.readUInt16LE(i+l);l+=2;var m=r.readUInt16LE(i+l);l+=2,e.uid=h,e.gid=m}break;case 30837:o="Info-ZIP New Unix";var l=0,y=r.readUInt8(i);if(l+=1,y===1){var v=r.readUInt8(i+l);l+=1,v<=6&&(e.uid=r.readUIntLE(i+l,v)),l+=v;var x=r.readUInt8(i+l);l+=1,x<=6&&(e.gid=r.readUIntLE(i+l,x))}break;case 30062:o="ASi Unix";var l=0;if(n.extraSize>=14){var w=r.readUInt32LE(i+l);l+=4;var E=r.readUInt16LE(i+l);l+=2;var P=r.readUInt32LE(i+l);l+=4;var h=r.readUInt16LE(i+l);l+=2;var m=r.readUInt16LE(i+l);if(l+=2,e.mode=E,e.uid=h,e.gid=m,n.extraSize>14){var k=i+l,_=i+n.extraSize-14,O=this._decodeString(r.slice(k,_));e.symlink=O}}break}this.options.debug&&t.debug.push({extraId:"0x"+n.extraId.toString(16),description:o,data:r.slice(i,i+n.extraSize).inspect()}),i+=n.extraSize}return t};zt.prototype._readDataDescriptor=function(r,e){if(e){var t=rs.parse(r).word32lu("dataDescriptorSignature").word32lu("crc32").word64lu("compressedSize").word64lu("uncompressedSize").vars;return t}var t=rs.parse(r).word32lu("dataDescriptorSignature").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").vars;return t};zt.prototype._readCentralDirectoryEntry=function(r){var e=rs.parse(r).word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word16lu("flags").word16lu("compressionMethod").word16lu("lastModifiedTime").word16lu("lastModifiedDate").word32lu("crc32").word32lu("compressedSize").word32lu("uncompressedSize").word16lu("fileNameLength").word16lu("extraFieldLength").word16lu("fileCommentLength").word16lu("diskNumber").word16lu("internalFileAttributes").word32lu("externalFileAttributes").word32lu("offsetToLocalFileHeader").vars;return e};zt.prototype._readEndOfCentralDirectory64=function(r){var e=rs.parse(r).word64lu("centralDirectoryRecordSize").word16lu("versionMadeBy").word16lu("versionsNeededToExtract").word32lu("diskNumber").word32lu("diskNumberWithCentralDirectoryStart").word64lu("centralDirectoryEntries").word64lu("totalCentralDirectoryEntries").word64lu("sizeOfCentralDirectory").word64lu("offsetToStartOfCentralDirectory").vars;return e};zt.prototype._readEndOfCentralDirectory=function(r){var e=rs.parse(r).word16lu("diskNumber").word16lu("diskStart").word16lu("centralDirectoryEntries").word16lu("totalCentralDirectoryEntries").word32lu("sizeOfCentralDirectory").word32lu("offsetToStartOfCentralDirectory").word16lu("commentLength").vars;return e};var dve="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ";zt.prototype._decodeString=function(r,e){if(e)return r.toString("utf8");if(this.options.decodeString)return this.options.decodeString(r);let t="";for(var i=0;i<r.length;i++)t+=dve[r[i]];return t};zt.prototype._parseOrOutput=function(r,e){for(var t;(t=this.processDataChunk(this.data))>0&&(this.data=this.data.slice(t),this.data.length!==0););if(this.state===oe.FILE_DATA){if(this.outStreamInfo.limit>=0){var i=this.outStreamInfo.limit-this.outStreamInfo.written,n;i<this.data.length?(n=this.data.slice(0,i),this.data=this.data.slice(i)):(n=this.data,this.data=new Buffer("")),this.outStreamInfo.written+=n.length,this.outStreamInfo.limit===this.outStreamInfo.written?(this.state=oe.START,this.outStreamInfo.stream.end(n,r,e)):this.outStreamInfo.stream.write(n,r,e)}else{var n=this.data;this.data=new Buffer(""),this.outStreamInfo.written+=n.length;var o=this.outStreamInfo.stream;o.write(n,r,()=>{if(this.state===oe.FILE_DATA_END)return this.state=oe.START,o.end(e);e()})}return}e()};zt.prototype.drainAll=function(){this._drainAllEntries=!0};zt.prototype._transform=function(r,e,t){var i=this;i.data.length>0?i.data=Buffer.concat([i.data,r]):i.data=r;var n=i.data.length,o=function(){if(i.data.length>0&&i.data.length<n){n=i.data.length,i._parseOrOutput(e,o);return}t()};i._parseOrOutput(e,o)};zt.prototype._flush=function(r){var e=this;if(e.data.length>0){e._parseOrOutput("buffer",function(){if(e.data.length>0)return setImmediate(function(){e._flush(r)});r()});return}if(e.state===oe.FILE_DATA)return r(new Error("Stream finished in an invalid state, uncompression failed"));setImmediate(r)};ZW.exports=zt});var t5=g((iLe,e5)=>{var Fp=require("stream").Transform,hve=require("util"),mve=eE();function is(r){if(!(this instanceof is))return new is(r);var e=r||{};Fp.call(this,{readableObjectMode:!0}),this.opts=r||{},this.unzipStream=new mve(this.opts);var t=this;this.unzipStream.on("entry",function(i){t.push(i)}),this.unzipStream.on("error",function(i){t.emit("error",i)})}hve.inherits(is,Fp);is.prototype._transform=function(r,e,t){this.unzipStream.write(r,e,t)};is.prototype._flush=function(r){var e=this;this.unzipStream.end(function(){process.nextTick(function(){e.emit("close")}),r()})};is.prototype.on=function(r,e){return r==="entry"?Fp.prototype.on.call(this,"data",e):Fp.prototype.on.call(this,r,e)};is.prototype.drainAll=function(){return this.unzipStream.drainAll(),this.pipe(new Fp({objectMode:!0,transform:function(r,e,t){t()}}))};e5.exports=is});var o5=g((nLe,r5)=>{var Ap=require("path"),i5=require("fs"),n5=parseInt("0777",8);r5.exports=Su.mkdirp=Su.mkdirP=Su;function Su(r,e,t,i){typeof e=="function"?(t=e,e={}):(!e||typeof e!="object")&&(e={mode:e});var n=e.mode,o=e.fs||i5;n===void 0&&(n=n5),i||(i=null);var s=t||function(){};r=Ap.resolve(r),o.mkdir(r,n,function(a){if(!a)return i=i||r,s(null,i);switch(a.code){case"ENOENT":if(Ap.dirname(r)===r)return s(a);Su(Ap.dirname(r),e,function(l,u){l?s(l,u):Su(r,e,s,u)});break;default:o.stat(r,function(l,u){l||!u.isDirectory()?s(a,i):s(null,i)});break}})}Su.sync=function r(e,t,i){(!t||typeof t!="object")&&(t={mode:t});var n=t.mode,o=t.fs||i5;n===void 0&&(n=n5),i||(i=null),e=Ap.resolve(e);try{o.mkdirSync(e,n),i=i||e}catch(a){switch(a.code){case"ENOENT":i=r(Ap.dirname(e),t,i),r(e,t,i);break;default:var s;try{s=o.statSync(e)}catch(l){throw a}if(!s.isDirectory())throw a;break}}return i}});var u5=g((oLe,s5)=>{var gve=require("fs"),a5=require("path"),vve=require("util"),yve=o5(),l5=require("stream").Transform,bve=eE();function ns(r){if(!(this instanceof ns))return new ns(r);l5.call(this),this.opts=r||{},this.unzipStream=new bve(this.opts),this.unfinishedEntries=0,this.afterFlushWait=!1,this.createdDirectories={};var e=this;this.unzipStream.on("entry",this._processEntry.bind(this)),this.unzipStream.on("error",function(t){e.emit("error",t)})}vve.inherits(ns,l5);ns.prototype._transform=function(r,e,t){this.unzipStream.write(r,e,t)};ns.prototype._flush=function(r){var e=this,t=function(){process.nextTick(function(){e.emit("close")}),r()};this.unzipStream.end(function(){if(e.unfinishedEntries>0)return e.afterFlushWait=!0,e.on("await-finished",t);t()})};ns.prototype._processEntry=function(r){var e=this,t=a5.join(this.opts.path,r.path),i=r.isDirectory?t:a5.dirname(t);this.unfinishedEntries++;var n=function(){var o=gve.createWriteStream(t);o.on("close",function(){e.unfinishedEntries--,e._notifyAwaiter()}),o.on("error",function(s){e.emit("error",s)}),r.pipe(o)};if(this.createdDirectories[i]||i===".")return n();yve(i,function(o){if(o)return e.emit("error",o);if(e.createdDirectories[i]=!0,r.isDirectory){e.unfinishedEntries--,e._notifyAwaiter();return}n()})};ns.prototype._notifyAwaiter=function(){this.afterFlushWait&&this.unfinishedEntries===0&&(this.emit("await-finished"),this.afterFlushWait=!1)};s5.exports=ns});var c5=g(tE=>{"use strict";tE.Parse=t5();tE.Extract=u5()});var p5=g((aLe,f5)=>{"use strict";function wve(){}function av(r,e){let t=av.spread(r,e),i=t.then(n=>n[0]);return i.cancel=t.cancel,i}(function(r){function e(t,i){let n=null,o=new Promise((s,a)=>{function l(){t.removeListener(i,u),t.removeListener("error",c),o.cancel=wve}function u(...f){l(),s(f)}function c(f){l(),a(f)}n=l,t.on(i,u),t.on("error",c)});if(!n)throw new TypeError("Could not get `cancel()` function");return o.cancel=n,o}r.spread=e})(av||(av={}));f5.exports=av});var d5=g(rE=>{"use strict";Object.defineProperty(rE,"__esModule",{value:!0});function xve(r){return function(e,t){return new Promise((i,n)=>{r.call(this,e,t,(o,s)=>{o?n(o):i(s)})})}}rE.default=xve});var oE=g((iE,h5)=>{"use strict";var m5=iE&&iE.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},Dve=require("events"),Sve=m5(gt()),Eve=m5(d5()),Op=Sve.default("agent-base");function Cve(r){return Boolean(r)&&typeof r.addRequest=="function"}function nE(){let{stack:r}=new Error;return typeof r!="string"?!1:r.split(`
|
||
`).some(e=>e.indexOf("(https.js:")!==-1||e.indexOf("node:https:")!==-1)}function lv(r,e){return new lv.Agent(r,e)}(function(r){class e extends Dve.EventEmitter{constructor(i,n){super();let o=n;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=Infinity,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:nE()?443:80}set defaultPort(i){this.explicitDefaultPort=i}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:nE()?"https:":"http:"}set protocol(i){this.explicitProtocol=i}callback(i,n,o){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(i,n){let o=Object.assign({},n);typeof o.secureEndpoint!="boolean"&&(o.secureEndpoint=nE()),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=d=>{i._hadError||(i.emit("error",d),i._hadError=!0)},c=()=>{a=null,s=!0;let d=new Error(`A "socket" was not created for HTTP request before ${l}ms`);d.code="ETIMEOUT",u(d)},f=d=>{s||(a!==null&&(clearTimeout(a),a=null),u(d))},p=d=>{if(s)return;if(a!=null&&(clearTimeout(a),a=null),Cve(d)){Op("Callback returned another Agent instance %o",d.constructor.name),d.addRequest(i,o);return}if(d){d.once("free",()=>{this.freeSocket(d,o)}),i.onSocket(d);return}let h=new Error(`no Duplex stream was returned to agent-base for \`${i.method} ${i.path}\``);u(h)};if(typeof this.callback!="function"){u(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(Op("Converting legacy callback function to promise"),this.promisifiedCallback=Eve.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{Op("Resolving socket for %o request: %o",o.protocol,`${i.method} ${i.path}`),Promise.resolve(this.promisifiedCallback(i,o)).then(p,f)}catch(d){Promise.reject(d).catch(f)}}freeSocket(i,n){Op("Freeing socket %o %o",i.constructor.name,n),i.destroy()}destroy(){Op("Destroying agent %o",this.constructor.name)}}r.Agent=e,r.prototype=r.Agent.prototype})(lv||(lv={}));h5.exports=lv});var v5=g(ba=>{"use strict";var _ve=ba&&ba.__awaiter||function(r,e,t,i){function n(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(f){s(f)}}function l(c){try{u(i.throw(c))}catch(f){s(f)}}function u(c){c.done?o(c.value):n(c.value).then(a,l)}u((i=i.apply(r,e||[])).next())})},Lp=ba&&ba.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ba,"__esModule",{value:!0});var Pve=Lp(require("net")),Tve=Lp(require("tls")),sE=Lp(require("url")),Rve=Lp(gt()),kve=Lp(p5()),Ive=oE(),os=Rve.default("http-proxy-agent");function Fve(r){return typeof r=="string"?/^https:?$/i.test(r):!1}var g5=class extends Ive.Agent{constructor(e){let t;if(typeof e=="string"?t=sE.default.parse(e):t=e,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");os("Creating new HttpProxyAgent instance: %o",t),super(t);let i=Object.assign({},t);this.secureProxy=t.secureProxy||Fve(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 _ve(this,void 0,void 0,function*(){let{proxy:i,secureProxy:n}=this,o=sE.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)),o.port==="80"&&delete o.port,e.path=sE.default.format(o),i.auth&&e.setHeader("Proxy-Authorization",`Basic ${Buffer.from(i.auth).toString("base64")}`);let s;if(n?(os("Creating `tls.Socket`: %o",i),s=Tve.default.connect(i)):(os("Creating `net.Socket`: %o",i),s=Pve.default.connect(i)),e._header){let a,l;os("Regenerating stored HTTP header string for request"),e._header=null,e._implicitHeader(),e.output&&e.output.length>0?(os("Patching connection write() output buffer with updated header"),a=e.output[0],l=a.indexOf(`\r
|
||
\r
|
||
`)+4,e.output[0]=e._header+a.substring(l),os("Output buffer: %o",e.output)):e.outputData&&e.outputData.length>0&&(os("Patching connection write() output buffer with updated header"),a=e.outputData[0].data,l=a.indexOf(`\r
|
||
\r
|
||
`)+4,e.outputData[0].data=e._header+a.substring(l),os("Output buffer: %o",e.outputData[0].data))}return yield kve.default(s,"connect"),s})}};ba.default=g5});var b5=g((aE,y5)=>{"use strict";var Ave=aE&&aE.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},lE=Ave(v5());function uE(r){return new lE.default(r)}(function(r){r.HttpProxyAgent=lE.default,r.prototype=lE.default.prototype})(uE||(uE={}));y5.exports=uE});var w5=g(Mp=>{"use strict";var Ove=Mp&&Mp.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Mp,"__esModule",{value:!0});var Lve=Ove(gt()),Np=Lve.default("https-proxy-agent:parse-proxy-response");function Mve(r){return new Promise((e,t)=>{let i=0,n=[];function o(){let f=r.read();f?c(f):r.once("readable",o)}function s(){r.removeListener("end",l),r.removeListener("error",u),r.removeListener("close",a),r.removeListener("readable",o)}function a(f){Np("onclose had error %o",f)}function l(){Np("onend")}function u(f){s(),Np("onerror %o",f),t(f)}function c(f){n.push(f),i+=f.length;let p=Buffer.concat(n,i);if(p.indexOf(`\r
|
||
\r
|
||
`)===-1){Np("have not received end of HTTP headers yet..."),o();return}let h=p.toString("ascii",0,p.indexOf(`\r
|
||
`)),m=+h.split(" ")[1];Np("got proxy server response: %o",h),e({statusCode:m,buffered:p})}r.on("error",u),r.on("close",a),r.on("end",l),o()})}Mp.default=Mve});var E5=g(wa=>{"use strict";var Nve=wa&&wa.__awaiter||function(r,e,t,i){function n(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(f){s(f)}}function l(c){try{u(i.throw(c))}catch(f){s(f)}}function u(c){c.done?o(c.value):n(c.value).then(a,l)}u((i=i.apply(r,e||[])).next())})},Eu=wa&&wa.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(wa,"__esModule",{value:!0});var x5=Eu(require("net")),D5=Eu(require("tls")),qve=Eu(require("url")),$ve=Eu(require("assert")),Bve=Eu(gt()),jve=oE(),Uve=Eu(w5()),qp=Bve.default("https-proxy-agent:agent"),S5=class extends jve.Agent{constructor(e){let t;if(typeof e=="string"?t=qve.default.parse(e):t=e,!t)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");qp("creating new HttpsProxyAgent instance: %o",t),super(t);let i=Object.assign({},t);this.secureProxy=t.secureProxy||zve(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 Nve(this,void 0,void 0,function*(){let{proxy:i,secureProxy:n}=this,o;n?(qp("Creating `tls.Socket`: %o",i),o=D5.default.connect(i)):(qp("Creating `net.Socket`: %o",i),o=x5.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:f}=t;Hve(c,f)||(u+=`:${c}`),s.Host=u,s.Connection="close";for(let y of Object.keys(s))l+=`${y}: ${s[y]}\r
|
||
`;let p=Uve.default(o);o.write(`${l}\r
|
||
`);let{statusCode:d,buffered:h}=yield p;if(d===200){if(e.once("socket",Wve),t.secureEndpoint){let y=t.servername||t.host;if(!y)throw new Error('Could not determine "servername"');return qp("Upgrading socket connection to TLS"),D5.default.connect(Object.assign(Object.assign({},Gve(t,"host","hostname","path","port")),{socket:o,servername:y}))}return o}o.destroy();let m=new x5.default.Socket;return m.readable=!0,e.once("socket",y=>{qp("replaying proxy buffer for failed request"),$ve.default(y.listenerCount("data")>0),y.push(h),y.push(null)}),m})}};wa.default=S5;function Wve(r){r.resume()}function Hve(r,e){return Boolean(!e&&r===80||e&&r===443)}function zve(r){return typeof r=="string"?/^https:?$/i.test(r):!1}function Gve(r,...e){let t={},i;for(i in r)e.includes(i)||(t[i]=r[i]);return t}});var _5=g((cE,C5)=>{"use strict";var Vve=cE&&cE.__importDefault||function(r){return r&&r.__esModule?r:{default:r}},fE=Vve(E5());function pE(r){return new fE.default(r)}(function(r){r.HttpsProxyAgent=fE.default,r.prototype=fE.default.prototype})(pE||(pE={}));C5.exports=pE});var T5=g((pLe,P5)=>{"use strict";var Kve=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];P5.exports=(r,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(r).concat(Kve)),i={};for(let n of t)n in e||(i[n]={get(){let o=r[n];return typeof o=="function"?o.bind(r):o},set(o){r[n]=o},enumerable:!0,configurable:!1});return Object.defineProperties(e,i),r.once("aborted",()=>{e.destroy(),e.emit("aborted")}),r.once("close",()=>{r.complete&&e.readable?e.once("end",()=>{e.emit("close")}):e.emit("close")}),e}});var k5=g((dLe,R5)=>{"use strict";var{Transform:Jve,PassThrough:Yve}=require("stream"),dE=require("zlib"),Xve=T5();R5.exports=r=>{let e=(r.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(e))return r;let t=e==="br";if(t&&typeof dE.createBrotliDecompress!="function")return r.destroy(new Error("Brotli is not supported on Node.js < 12")),r;let i=!0,n=new Jve({transform(a,l,u){i=!1,u(null,a)},flush(a){a()}}),o=new Yve({autoDestroy:!1,destroy(a,l){r.destroy(),l(a)}}),s=t?dE.createBrotliDecompress():dE.createUnzip();return s.once("error",a=>{if(i&&!r.readable){o.end();return}o.destroy(a)}),Xve(r,o),r.pipe(n).pipe(s).pipe(o),o}});var Uz=g(Uye=>{fo(Uye,{BaseLanguageClient:()=>yv,BasicList:()=>Mt,Buffer:()=>Ou.Buffer,CancellationToken:()=>ie.CancellationToken,CancellationTokenSource:()=>ie.CancellationTokenSource,ClientState:()=>be,CloseAction:()=>ro,CodeActionKind:()=>ie.CodeActionKind,CompletionItemKind:()=>ie.CompletionItemKind,CompletionTriggerKind:()=>ie.CompletionTriggerKind,ConfigurationTarget:()=>pt,Diagnostic:()=>ie.Diagnostic,DiagnosticSeverity:()=>ie.DiagnosticSeverity,DiagnosticTag:()=>ie.DiagnosticTag,Disposable:()=>ie.Disposable,Document:()=>Zm,DocumentHighlightKind:()=>ie.DocumentHighlightKind,Emitter:()=>ie.Emitter,ErrorAction:()=>Tu,Event:()=>ie.Event,ExtensionType:()=>Jr,FileChangeType:()=>ie.FileChangeType,FileSystemWatcher:()=>tg,FloatFactory:()=>mn,Highligher:()=>ss,InsertTextFormat:()=>ie.InsertTextFormat,LanguageClient:()=>Cv,Location:()=>ie.Location,LocationLink:()=>ie.LocationLink,MarkupKind:()=>ie.MarkupKind,MessageLevel:()=>gn,MessageTransports:()=>Hp,Mru:()=>Gl,Mutex:()=>ar,Neovim:()=>Ou.Neovim,NotificationType:()=>ie.NotificationType,NotificationType0:()=>ie.NotificationType0,NullLogger:()=>tH,PatternType:()=>Kr,Position:()=>ie.Position,ProgressType:()=>jz.ProgressType,ProposedFeatures:()=>_v,Range:()=>ie.Range,RequestType:()=>ie.RequestType,RequestType0:()=>ie.RequestType0,RevealOutputChannelOn:()=>ii,ServiceStat:()=>ye,SettingMonitor:()=>$H,SignatureHelpTriggerKind:()=>ie.SignatureHelpTriggerKind,SourceType:()=>Yr,State:()=>ni,SymbolKind:()=>ie.SymbolKind,TextDocumentFeature:()=>Ge,TextEdit:()=>ie.TextEdit,TransportKind:()=>Gt,Uri:()=>$,Watchman:()=>ta,Window:()=>Ou.Window,ansiparse:()=>Nf,commands:()=>me,concurrent:()=>vf,diagnosticManager:()=>St,disposeAll:()=>z,download:()=>Bp,events:()=>A,executable:()=>gf,extensions:()=>ge,fetch:()=>Cu,isRunning:()=>cq,languages:()=>U,listManager:()=>Kt,runCommand:()=>hn,services:()=>Vt,snippetManager:()=>Ft,sources:()=>Ze,wait:()=>He,watchFile:()=>Pl,window:()=>C,workspace:()=>b});var Ou=S(Lw()),ie=S(W()),jz=S(bi())});var t9=g(Kye=>{fo(Kye,{default:()=>Jye,regist:()=>Yye});var e9=S(W()),nHe=j()("source-around"),Nv=class extends Tn{constructor(){super({name:"around",filepath:__filename})}doComplete(e){let{bufnr:t,input:i}=e;if(i.length===0)return null;let n=b.getDocument(t);if(!n)return null;let o=n.words,s=n.getMoreWords();return o.push(...s),o=this.filterWords(o,e),Promise.resolve({items:o.map(a=>({word:a,menu:this.menu}))})}},Jye=Nv;function Yye(r){return r.set("around",new Nv),e9.Disposable.create(()=>{r.delete("around")})}});var i9=g(Xye=>{fo(Xye,{default:()=>Zye,regist:()=>Qye});var r9=S(W()),lHe=j()("source-buffer"),qv=class extends Tn{constructor(){super({name:"buffer",filepath:__filename})}get ignoreGitignore(){return this.getConfig("ignoreGitignore",!0)}getWords(e){let{ignoreGitignore:t}=this,i=[];return b.documents.forEach(n=>{if(n.bufnr!=e&&!(t&&n.isIgnored))for(let o of n.words)i.includes(o)||i.push(o)}),i}doComplete(e){let{bufnr:t,input:i}=e;if(i.length==0)return null;let n=this.getWords(t);return n=this.filterWords(n,e),Promise.resolve({items:n.map(o=>({word:o,menu:this.menu}))})}},Zye=qv;function Qye(r){return r.set("buffer",new qv),r9.Disposable.create(()=>{r.delete("buffer")})}});var a9=g(ebe=>{fo(ebe,{default:()=>ibe,regist:()=>nbe});var $v=S(require("fs")),n9=S(Qs()),oi=S(require("path")),o9=S(require("util")),s9=S(W()),tbe=j()("source-file"),rbe=/(?:\.{0,2}|~|\$HOME|([\w]+)|)\/(?:[\w.@()-]+\/)*(?:[\w.@()-])*$/,Bv=class extends Tn{constructor(){super({name:"file",filepath:__filename})}resolveEnvVariables(e){let t=e;return t=t.replace(/%([^%]+)%/g,(i,n)=>process.env[n]),t=t.replace(/\$([A-Z_]+[A-Z0-9_]*)|\${([A-Z0-9_]*)}/gi,(i,n,o)=>process.env[n||o]),t}getPathOption(e){let{line:t,colnr:i}=e,n=Rt(t,0,i-1);if(n=this.resolveEnvVariables(n),!n||n.endsWith("//"))return null;let o=n.match(rbe);if(o&&o.length){let s=b.expand(o[0]),a=o[0].match(/[^/]*$/)[0];return{pathstr:s,part:o[1],startcol:i-a.length-1,input:a}}return null}async getFileItem(e,t){let i=oi.default.join(e,t),n=await Ht(i);if(n){let o=n.isDirectory()?t+"/":t;return{word:t,abbr:o}}return null}filterFiles(e){let t=this.getConfig("ignoreHidden",!0),i=this.getConfig("ignorePatterns",[]);return e.filter(n=>{if(n==null||t&&n.startsWith("."))return!1;for(let o of i)if(n9.default(n,o,{dot:!0}))return!1;return!0})}async getItemsFromRoot(e,t){let i=[],n=e.endsWith("/")?e:oi.default.dirname(e),o=oi.default.isAbsolute(e)?n:oi.default.join(t,n);try{let s=await Ht(o);if(s&&s.isDirectory()){let a=await o9.default.promisify($v.default.readdir)(o);a=this.filterFiles(a);let l=await Promise.all(a.map(u=>this.getFileItem(o,u)));i=i.concat(l)}return i=i.filter(a=>a!=null),i}catch(s){return tbe.error("Error on list files:",s),i}}get trimSameExts(){return this.getConfig("trimSameExts",[])}async doComplete(e){let{col:t,filepath:i}=e,n=this.getPathOption(e);if(!n)return null;let{pathstr:o,part:s,startcol:a,input:l}=n;if(a<e.col)return null;let u=e.col==a?"":Rt(e.line,e.col,a),c=oi.default.dirname(i),f=oi.default.extname(oi.default.basename(i)),p=await this.nvim.call("getcwd",[]),d;if(o.startsWith(".")?d=i?oi.default.dirname(i):p:o.startsWith("/")?d=o.endsWith("/")?o:oi.default.dirname(o):s?$v.default.existsSync(oi.default.join(c,s))?d=c:$v.default.existsSync(oi.default.join(p,s))&&(d=p):d=p,!d)return null;let h=await this.getItemsFromRoot(o,d),m=this.trimSameExts.includes(f),y=l[0];return y&&t==a&&(h=h.filter(v=>v.word[0]===y)),{items:h.map(v=>{let x=oi.default.extname(v.word);return v.word=m&&x===f?v.word.replace(f,""):v.word,{word:`${u}${v.word}`,abbr:`${u}${v.abbr}`,menu:this.menu}})}}},ibe=Bv;function nbe(r){return r.set("file",new Bv),s9.Disposable.create(()=>{r.delete("file")})}});var so=g((R9e,R9)=>{"use strict";var cbe=un();R9.exports=cbe.call(Function.call,Object.prototype.hasOwnProperty)});var Vv=g((k9e,k9)=>{"use strict";var we,id=SyntaxError,fbe=Function,Bu=TypeError,ZC=function(r){try{return Function('"use strict"; return ('+r+").constructor;")()}catch(e){}},Pa=Object.getOwnPropertyDescriptor;if(Pa)try{Pa({},"")}catch(r){Pa=null}var QC=function(){throw new Bu},pbe=Pa?function(){try{return arguments.callee,QC}catch(r){try{return Pa(arguments,"callee").get}catch(e){return QC}}}():QC,ju=Li()(),fs=Object.getPrototypeOf||function(r){return r.__proto__},e_=ZC("async function* () {}"),t_=e_?e_.prototype:we,I9=t_?t_.prototype:we,dbe=typeof Uint8Array=="undefined"?we:fs(Uint8Array),nd={"%AggregateError%":typeof AggregateError=="undefined"?we:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?we:ArrayBuffer,"%ArrayIteratorPrototype%":ju?fs([][Symbol.iterator]()):we,"%AsyncFromSyncIteratorPrototype%":we,"%AsyncFunction%":ZC("async function () {}"),"%AsyncGenerator%":t_,"%AsyncGeneratorFunction%":e_,"%AsyncIteratorPrototype%":I9?fs(I9):we,"%Atomics%":typeof Atomics=="undefined"?we:Atomics,"%BigInt%":typeof BigInt=="undefined"?we:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?we:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?we:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?we:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?we:FinalizationRegistry,"%Function%":fbe,"%GeneratorFunction%":ZC("function* () {}"),"%Int8Array%":typeof Int8Array=="undefined"?we:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?we:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?we:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ju?fs(fs([][Symbol.iterator]())):we,"%JSON%":typeof JSON=="object"?JSON:we,"%Map%":typeof Map=="undefined"?we:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!ju?we:fs(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?we:Promise,"%Proxy%":typeof Proxy=="undefined"?we:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?we:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?we:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!ju?we:fs(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?we:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ju?fs(""[Symbol.iterator]()):we,"%Symbol%":ju?Symbol:we,"%SyntaxError%":id,"%ThrowTypeError%":pbe,"%TypedArray%":dbe,"%TypeError%":Bu,"%Uint8Array%":typeof Uint8Array=="undefined"?we:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?we:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?we:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?we:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?we:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?we:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?we:WeakSet},F9={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Hv=un(),zv=so(),hbe=Hv.call(Function.call,Array.prototype.concat),mbe=Hv.call(Function.apply,Array.prototype.splice),A9=Hv.call(Function.call,String.prototype.replace),Gv=Hv.call(Function.call,String.prototype.slice),gbe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,vbe=/\\(\\)?/g,ybe=function(e){var t=Gv(e,0,1),i=Gv(e,-1);if(t==="%"&&i!=="%")throw new id("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&t!=="%")throw new id("invalid intrinsic syntax, expected opening `%`");var n=[];return A9(e,gbe,function(o,s,a,l){n[n.length]=a?A9(l,vbe,"$1"):s||o}),n},bbe=function(e,t){var i=e,n;if(zv(F9,i)&&(n=F9[i],i="%"+n[0]+"%"),zv(nd,i)){var o=nd[i];if(typeof o=="undefined"&&!t)throw new Bu("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new id("intrinsic "+e+" does not exist!")};k9.exports=function(e,t){if(typeof e!="string"||e.length===0)throw new Bu("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Bu('"allowMissing" argument must be a boolean');var i=ybe(e),n=i.length>0?i[0]:"",o=bbe("%"+n+"%",t),s=o.name,a=o.value,l=!1,u=o.alias;u&&(n=u[0],mbe(i,hbe([0,1],u)));for(var c=1,f=!0;c<i.length;c+=1){var p=i[c],d=Gv(p,0,1),h=Gv(p,-1);if((d==='"'||d==="'"||d==="`"||h==='"'||h==="'"||h==="`")&&d!==h)throw new id("property names with quotes must have matching quotes");if((p==="constructor"||!f)&&(l=!0),n+="."+p,s="%"+n+"%",zv(nd,s))a=nd[s];else if(a!=null){if(!(p in a)){if(!t)throw new Bu("base intrinsic for "+e+" exists, but the property is not available.");return}if(Pa&&c+1>=i.length){var m=Pa(a,p);f=!!m,f&&"get"in m&&!("originalValue"in m.get)?a=m.get:a=a[p]}else f=zv(a,p),a=a[p];f&&!l&&(nd[s]=a)}}return a}});var i_=g((I9e,Kv)=>{"use strict";var r_=un(),Jv=Vv(),O9=Jv("%Function.prototype.apply%"),L9=Jv("%Function.prototype.call%"),M9=Jv("%Reflect.apply%",!0)||r_.call(L9,O9),od=Jv("%Object.defineProperty%",!0);if(od)try{od({},"a",{value:1})}catch(r){od=null}Kv.exports=function(){return M9(r_,L9,arguments)};var N9=function(){return M9(r_,O9,arguments)};od?od(Kv.exports,"apply",{value:N9}):Kv.exports.apply=N9});var Ae=g((F9e,q9)=>{"use strict";var De,$9=SyntaxError,wbe=Function,Uu=TypeError,n_=function(r){try{return Function('"use strict"; return ('+r+").constructor;")()}catch(e){}},Ta=Object.getOwnPropertyDescriptor;if(Ta)try{Ta({},"")}catch(r){Ta=null}var o_=function(){throw new Uu},xbe=Ta?function(){try{return arguments.callee,o_}catch(r){try{return Ta(arguments,"callee").get}catch(e){return o_}}}():o_,Wu=Li()(),ps=Object.getPrototypeOf||function(r){return r.__proto__},s_=n_("async function* () {}"),a_=s_?s_.prototype:De,B9=a_?a_.prototype:De,Dbe=typeof Uint8Array=="undefined"?De:ps(Uint8Array),sd={"%AggregateError%":typeof AggregateError=="undefined"?De:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?De:ArrayBuffer,"%ArrayIteratorPrototype%":Wu?ps([][Symbol.iterator]()):De,"%AsyncFromSyncIteratorPrototype%":De,"%AsyncFunction%":n_("async function () {}"),"%AsyncGenerator%":a_,"%AsyncGeneratorFunction%":s_,"%AsyncIteratorPrototype%":B9?ps(B9):De,"%Atomics%":typeof Atomics=="undefined"?De:Atomics,"%BigInt%":typeof BigInt=="undefined"?De:BigInt,"%Boolean%":Boolean,"%DataView%":typeof DataView=="undefined"?De:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array=="undefined"?De:Float32Array,"%Float64Array%":typeof Float64Array=="undefined"?De:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry=="undefined"?De:FinalizationRegistry,"%Function%":wbe,"%GeneratorFunction%":n_("function* () {}"),"%Int8Array%":typeof Int8Array=="undefined"?De:Int8Array,"%Int16Array%":typeof Int16Array=="undefined"?De:Int16Array,"%Int32Array%":typeof Int32Array=="undefined"?De:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Wu?ps(ps([][Symbol.iterator]())):De,"%JSON%":typeof JSON=="object"?JSON:De,"%Map%":typeof Map=="undefined"?De:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!Wu?De:ps(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?De:Promise,"%Proxy%":typeof Proxy=="undefined"?De:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect=="undefined"?De:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set=="undefined"?De:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!Wu?De:ps(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?De:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Wu?ps(""[Symbol.iterator]()):De,"%Symbol%":Wu?Symbol:De,"%SyntaxError%":$9,"%ThrowTypeError%":xbe,"%TypedArray%":Dbe,"%TypeError%":Uu,"%Uint8Array%":typeof Uint8Array=="undefined"?De:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?De:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array=="undefined"?De:Uint16Array,"%Uint32Array%":typeof Uint32Array=="undefined"?De:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap=="undefined"?De:WeakMap,"%WeakRef%":typeof WeakRef=="undefined"?De:WeakRef,"%WeakSet%":typeof WeakSet=="undefined"?De:WeakSet},j9={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},l_=un(),Yv=so(),Sbe=l_.call(Function.call,Array.prototype.concat),Ebe=l_.call(Function.apply,Array.prototype.splice),U9=l_.call(Function.call,String.prototype.replace),Cbe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,_be=/\\(\\)?/g,Pbe=function(e){var t=[];return U9(e,Cbe,function(i,n,o,s){t[t.length]=o?U9(s,_be,"$1"):n||i}),t},Tbe=function(e,t){var i=e,n;if(Yv(j9,i)&&(n=j9[i],i="%"+n[0]+"%"),Yv(sd,i)){var o=sd[i];if(typeof o=="undefined"&&!t)throw new Uu("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new $9("intrinsic "+e+" does not exist!")};q9.exports=function(e,t){if(typeof e!="string"||e.length===0)throw new Uu("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new Uu('"allowMissing" argument must be a boolean');var i=Pbe(e),n=i.length>0?i[0]:"",o=Tbe("%"+n+"%",t),s=o.name,a=o.value,l=!1,u=o.alias;u&&(n=u[0],Ebe(i,Sbe([0,1],u)));for(var c=1,f=!0;c<i.length;c+=1){var p=i[c];if((p==="constructor"||!f)&&(l=!0),n+="."+p,s="%"+n+"%",Yv(sd,s))a=sd[s];else if(a!=null){if(Ta&&c+1>=i.length){var d=Ta(a,p);if(f=!!d,!t&&!(p in a))throw new Uu("base intrinsic for "+e+" exists, but the property is not available.");f&&"get"in d&&!("originalValue"in d.get)?a=d.get:a=a[p]}else f=Yv(a,p),a=a[p];f&&!l&&(sd[s]=a)}}return a}});var c_=g((A9e,Xv)=>{"use strict";var u_=un(),Zv=Ae(),W9=Zv("%Function.prototype.apply%"),H9=Zv("%Function.prototype.call%"),z9=Zv("%Reflect.apply%",!0)||u_.call(H9,W9),ad=Zv("%Object.defineProperty%",!0);if(ad)try{ad({},"a",{value:1})}catch(r){ad=null}Xv.exports=function(){return z9(u_,H9,arguments)};var G9=function(){return z9(u_,W9,arguments)};ad?ad(Xv.exports,"apply",{value:G9}):Xv.exports.apply=G9});var Ra=g((O9e,V9)=>{"use strict";var K9=Ae(),J9=c_(),Rbe=J9(K9("String.prototype.indexOf"));V9.exports=function(e,t){var i=K9(e,!!t);return typeof i=="function"&&Rbe(e,".prototype.")?J9(i):i}});var f_=g((L9e,Y9)=>{"use strict";var kbe=Ae(),Ibe=Ra(),Fbe=kbe("%Reflect.apply%",!0)||Ibe("%Function.prototype.apply%");Y9.exports=function(e,t){var i=arguments.length>2?arguments[2]:[];return Fbe(e,t,i)}});var Z9=g((M9e,X9)=>{X9.exports=require("util").inspect});var w_=g((N9e,Q9)=>{var p_=typeof Map=="function"&&Map.prototype,d_=Object.getOwnPropertyDescriptor&&p_?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Qv=p_&&d_&&typeof d_.get=="function"?d_.get:null,Abe=p_&&Map.prototype.forEach,h_=typeof Set=="function"&&Set.prototype,m_=Object.getOwnPropertyDescriptor&&h_?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ey=h_&&m_&&typeof m_.get=="function"?m_.get:null,Obe=h_&&Set.prototype.forEach,Lbe=typeof WeakMap=="function"&&WeakMap.prototype,ld=Lbe?WeakMap.prototype.has:null,Mbe=typeof WeakSet=="function"&&WeakSet.prototype,ud=Mbe?WeakSet.prototype.has:null,Nbe=Boolean.prototype.valueOf,qbe=Object.prototype.toString,$be=Function.prototype.toString,Bbe=String.prototype.match,jbe=typeof BigInt=="function"?BigInt.prototype.valueOf:null,e7=Object.getOwnPropertySymbols,Ube=typeof Symbol=="function"?Symbol.prototype.toString:null,Wbe=Object.prototype.propertyIsEnumerable,g_=Z9().custom,v_=g_&&t7(g_)?g_:null;Q9.exports=function r(e,t,i,n){var o=t||{};if(ka(o,"quoteStyle")&&o.quoteStyle!=="single"&&o.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ka(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==Infinity:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=ka(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean")throw new TypeError('option "customInspect", if provided, must be `true` or `false`');if(ka(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('options "indent" must be "\\t", an integer > 0, or `null`');if(typeof e=="undefined")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return n7(e,o);if(typeof e=="number")return e===0?Infinity/e>0?"0":"-0":String(e);if(typeof e=="bigint")return String(e)+"n";var a=typeof o.depth=="undefined"?5:o.depth;if(typeof i=="undefined"&&(i=0),i>=a&&a>0&&typeof e=="object")return y_(e)?"[Array]":"[Object]";var l=owe(o,i);if(typeof n=="undefined")n=[];else if(i7(n,e)>=0)return"[Circular]";function u(P,k,_){if(k&&(n=n.slice(),n.push(k)),_){var O={depth:o.depth};return ka(o,"quoteStyle")&&(O.quoteStyle=o.quoteStyle),r(P,O,i+1,n)}return r(P,o,i+1,n)}if(typeof e=="function"){var c=Zbe(e),f=ty(e,u);return"[Function"+(c?": "+c:" (anonymous)")+"]"+(f.length>0?" { "+f.join(", ")+" }":"")}if(t7(e)){var p=Ube.call(e);return typeof e=="object"?cd(p):p}if(iwe(e)){for(var d="<"+String(e.nodeName).toLowerCase(),h=e.attributes||[],m=0;m<h.length;m++)d+=" "+h[m].name+"="+r7(Hbe(h[m].value),"double",o);return d+=">",e.childNodes&&e.childNodes.length&&(d+="..."),d+="</"+String(e.nodeName).toLowerCase()+">",d}if(y_(e)){if(e.length===0)return"[]";var y=ty(e,u);return l&&!nwe(y)?"["+b_(y,l)+"]":"[ "+y.join(", ")+" ]"}if(Vbe(e)){var v=ty(e,u);return v.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+v.join(", ")+" }"}if(typeof e=="object"&&s){if(v_&&typeof e[v_]=="function")return e[v_]();if(typeof e.inspect=="function")return e.inspect()}if(Qbe(e)){var x=[];return Abe.call(e,function(P,k){x.push(u(k,e,!0)+" => "+u(P,e))}),s7("Map",Qv.call(e),x,l)}if(twe(e)){var w=[];return Obe.call(e,function(P){w.push(u(P,e))}),s7("Set",ey.call(e),w,l)}if(ewe(e))return o7("WeakMap");if(rwe(e))return o7("WeakSet");if(Jbe(e))return cd(u(Number(e)));if(Ybe(e))return cd(u(jbe.call(e)));if(Xbe(e))return cd(Nbe.call(e));if(Kbe(e))return cd(u(String(e)));if(!zbe(e)&&!Gbe(e)){var E=ty(e,u);return E.length===0?"{}":l?"{"+b_(E,l)+"}":"{ "+E.join(", ")+" }"}return String(e)};function r7(r,e,t){var i=(t.quoteStyle||e)==="double"?'"':"'";return i+r+i}function Hbe(r){return String(r).replace(/"/g,""")}function y_(r){return ao(r)==="[object Array]"}function zbe(r){return ao(r)==="[object Date]"}function Gbe(r){return ao(r)==="[object RegExp]"}function Vbe(r){return ao(r)==="[object Error]"}function t7(r){return ao(r)==="[object Symbol]"}function Kbe(r){return ao(r)==="[object String]"}function Jbe(r){return ao(r)==="[object Number]"}function Ybe(r){return ao(r)==="[object BigInt]"}function Xbe(r){return ao(r)==="[object Boolean]"}var swe=Object.prototype.hasOwnProperty||function(r){return r in this};function ka(r,e){return swe.call(r,e)}function ao(r){return qbe.call(r)}function Zbe(r){if(r.name)return r.name;var e=Bbe.call($be.call(r),/^function\s*([\w$]+)/);return e?e[1]:null}function i7(r,e){if(r.indexOf)return r.indexOf(e);for(var t=0,i=r.length;t<i;t++)if(r[t]===e)return t;return-1}function Qbe(r){if(!Qv||!r||typeof r!="object")return!1;try{Qv.call(r);try{ey.call(r)}catch(e){return!0}return r instanceof Map}catch(e){}return!1}function ewe(r){if(!ld||!r||typeof r!="object")return!1;try{ld.call(r,ld);try{ud.call(r,ud)}catch(e){return!0}return r instanceof WeakMap}catch(e){}return!1}function twe(r){if(!ey||!r||typeof r!="object")return!1;try{ey.call(r);try{Qv.call(r)}catch(e){return!0}return r instanceof Set}catch(e){}return!1}function rwe(r){if(!ud||!r||typeof r!="object")return!1;try{ud.call(r,ud);try{ld.call(r,ld)}catch(e){return!0}return r instanceof WeakSet}catch(e){}return!1}function iwe(r){return!r||typeof r!="object"?!1:typeof HTMLElement!="undefined"&&r instanceof HTMLElement?!0:typeof r.nodeName=="string"&&typeof r.getAttribute=="function"}function n7(r,e){if(r.length>e.maxStringLength){var t=r.length-e.maxStringLength,i="... "+t+" more character"+(t>1?"s":"");return n7(r.slice(0,e.maxStringLength),e)+i}var n=r.replace(/(['\\])/g,"\\$1").replace(/[\x00-\x1f]/g,awe);return r7(n,"single",e)}function awe(r){var e=r.charCodeAt(0),t={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return t?"\\"+t:"\\x"+(e<16?"0":"")+e.toString(16).toUpperCase()}function cd(r){return"Object("+r+")"}function o7(r){return r+" { ? }"}function s7(r,e,t,i){var n=i?b_(t,i):t.join(", ");return r+" ("+e+") {"+n+"}"}function nwe(r){for(var e=0;e<r.length;e++)if(i7(r[e],`
|
||
`)>=0)return!1;return!0}function owe(r,e){var t;if(r.indent===" ")t=" ";else if(typeof r.indent=="number"&&r.indent>0)t=Array(r.indent+1).join(" ");else return null;return{base:t,prev:Array(e+1).join(t)}}function b_(r,e){if(r.length===0)return"";var t=`
|
||
`+e.prev+e.base;return t+r.join(","+t)+`
|
||
`+e.prev}function ty(r,e){var t=y_(r),i=[];if(t){i.length=r.length;for(var n=0;n<r.length;n++)i[n]=ka(r,n)?e(r[n],r):""}for(var o in r)!ka(r,o)||t&&String(Number(o))===o&&o<r.length||(/[^\w$]/.test(o)?i.push(e(o,r)+": "+e(r[o],r)):i.push(o+": "+e(r[o],r)));if(typeof e7=="function")for(var s=e7(r),a=0;a<s.length;a++)Wbe.call(r,s[a])&&i.push("["+e(s[a])+"]: "+e(r[s[a]],r));return i}});var Hu=g((q9e,a7)=>{"use strict";a7.exports=function(e){return typeof e=="string"||typeof e=="symbol"}});var u7=g(($9e,l7)=>{"use strict";l7.exports=function(e){if(e===null)return"Null";if(typeof e=="undefined")return"Undefined";if(typeof e=="function"||typeof e=="object")return"Object";if(typeof e=="number")return"Number";if(typeof e=="boolean")return"Boolean";if(typeof e=="string")return"String"}});var pr=g((B9e,c7)=>{"use strict";var lwe=u7();c7.exports=function(e){return typeof e=="symbol"?"Symbol":typeof e=="bigint"?"BigInt":lwe(e)}});var fd=g((j9e,f7)=>{"use strict";var uwe=Ae(),p7=uwe("%TypeError%"),cwe=w_(),fwe=Hu(),pwe=pr();f7.exports=function(e,t){if(pwe(e)!=="Object")throw new p7("Assertion failed: Type(O) is not Object");if(!fwe(t))throw new p7("Assertion failed: IsPropertyKey(P) is not true, got "+cwe(t));return e[t]}});var h7=g((U9e,d7)=>{"use strict";var dwe=Ae(),hwe=dwe("%TypeError%");d7.exports=function(e,t){if(e==null)throw new hwe(t||"Cannot call method on "+e);return e}});var x_=g((W9e,m7)=>{"use strict";m7.exports=h7()});var v7=g((H9e,g7)=>{"use strict";var mwe=Ae(),gwe=mwe("%Object%"),vwe=x_();g7.exports=function(e){return vwe(e),gwe(e)}});var b7=g((z9e,y7)=>{"use strict";var ywe=Ae(),bwe=ywe("%TypeError%"),wwe=Hu(),xwe=v7();y7.exports=function(e,t){if(!wwe(t))throw new bwe("Assertion failed: IsPropertyKey(P) is not true");var i=xwe(e);return i[t]}});var D7=g((G9e,w7)=>{"use strict";var x7=Function.prototype.toString,zu=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,D_,ry;if(typeof zu=="function"&&typeof Object.defineProperty=="function")try{D_=Object.defineProperty({},"length",{get:function(){throw ry}}),ry={},zu(function(){throw 42},null,D_)}catch(r){r!==ry&&(zu=null)}else zu=null;var Dwe=/^\s*class\b/,S_=function(e){try{var t=x7.call(e);return Dwe.test(t)}catch(i){return!1}},Swe=function(e){try{return S_(e)?!1:(x7.call(e),!0)}catch(t){return!1}},Ewe=Object.prototype.toString,Cwe="[object Function]",_we="[object GeneratorFunction]",Pwe=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";w7.exports=zu?function(e){if(!e||typeof e!="function"&&typeof e!="object")return!1;if(typeof e=="function"&&!e.prototype)return!0;try{zu(e,null,D_)}catch(t){if(t!==ry)return!1}return!S_(e)}:function(e){if(!e||typeof e!="function"&&typeof e!="object")return!1;if(typeof e=="function"&&!e.prototype)return!0;if(Pwe)return Swe(e);if(S_(e))return!1;var t=Ewe.call(e);return t===Cwe||t===_we}});var iy=g((V9e,S7)=>{"use strict";S7.exports=D7()});var _7=g((K9e,E7)=>{"use strict";var Twe=Ae(),C7=Twe("%TypeError%"),Rwe=b7(),kwe=iy(),Iwe=Hu();E7.exports=function(e,t){if(!Iwe(t))throw new C7("Assertion failed: IsPropertyKey(P) is not true");var i=Rwe(e,t);if(i!=null){if(!kwe(i))throw new C7(t+"is not a function");return i}}});var I7=g((J9e,P7)=>{"use strict";var Fwe=Li()(),T7=Fwe&&typeof Symbol.toStringTag=="symbol",R7,k7,E_,C_;T7&&(R7=Function.call.bind(Object.prototype.hasOwnProperty),k7=Function.call.bind(RegExp.prototype.exec),E_={},ny=function(){throw E_},C_={toString:ny,valueOf:ny},typeof Symbol.toPrimitive=="symbol"&&(C_[Symbol.toPrimitive]=ny));var ny,Awe=Object.prototype.toString,Owe=Object.getOwnPropertyDescriptor,Lwe="[object RegExp]";P7.exports=T7?function(e){if(!e||typeof e!="object")return!1;var t=Owe(e,"lastIndex"),i=t&&R7(t,"value");if(!i)return!1;try{k7(e,C_)}catch(n){return n===E_}}:function(e){return!e||typeof e!="object"&&typeof e!="function"?!1:Awe.call(e)===Lwe}});var __=g((Y9e,F7)=>{"use strict";F7.exports=function(e){return!!e}});var L7=g((X9e,A7)=>{"use strict";var Mwe=Ae(),O7=Mwe("%Symbol.match%",!0),Nwe=I7(),qwe=__();A7.exports=function(e){if(!e||typeof e!="object")return!1;if(O7){var t=e[O7];if(typeof t!="undefined")return qwe(t)}return Nwe(e)}});var oy=g((Z9e,M7)=>{"use strict";var N7=Ae(),$we=N7("%String%"),Bwe=N7("%TypeError%");M7.exports=function(e){if(typeof e=="symbol")throw new Bwe("Cannot convert a Symbol value to a string");return $we(e)}});var P_=g((Q9e,q7)=>{"use strict";var $7=Vv(),B7=i_(),jwe=B7($7("String.prototype.indexOf"));q7.exports=function(e,t){var i=$7(e,!!t);return typeof i=="function"&&jwe(e,".prototype.")>-1?B7(i):i}});var L_=g((e7e,j7)=>{"use strict";var Z,pd=TypeError,Ia=Object.getOwnPropertyDescriptor;if(Ia)try{Ia({},"")}catch(r){Ia=null}var T_=function(){throw new pd},Uwe=Ia?function(){try{return arguments.callee,T_}catch(r){try{return Ia(arguments,"callee").get}catch(e){return T_}}}():T_,ds=Li()(),on=Object.getPrototypeOf||function(r){return r.__proto__},sy,R_=sy?on(sy):Z,U7,k_=U7?U7.constructor:Z,dd,I_=dd?on(dd):Z,F_=dd?dd():Z,A_=typeof Uint8Array=="undefined"?Z:on(Uint8Array),O_={"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer=="undefined"?Z:ArrayBuffer,"%ArrayBufferPrototype%":typeof ArrayBuffer=="undefined"?Z:ArrayBuffer.prototype,"%ArrayIteratorPrototype%":ds?on([][Symbol.iterator]()):Z,"%ArrayPrototype%":Array.prototype,"%ArrayProto_entries%":Array.prototype.entries,"%ArrayProto_forEach%":Array.prototype.forEach,"%ArrayProto_keys%":Array.prototype.keys,"%ArrayProto_values%":Array.prototype.values,"%AsyncFromSyncIteratorPrototype%":Z,"%AsyncFunction%":k_,"%AsyncFunctionPrototype%":k_?k_.prototype:Z,"%AsyncGenerator%":dd?on(F_):Z,"%AsyncGeneratorFunction%":I_,"%AsyncGeneratorPrototype%":I_?I_.prototype:Z,"%AsyncIteratorPrototype%":F_&&ds&&Symbol.asyncIterator?F_[Symbol.asyncIterator]():Z,"%Atomics%":typeof Atomics=="undefined"?Z:Atomics,"%Boolean%":Boolean,"%BooleanPrototype%":Boolean.prototype,"%DataView%":typeof DataView=="undefined"?Z:DataView,"%DataViewPrototype%":typeof DataView=="undefined"?Z:DataView.prototype,"%Date%":Date,"%DatePrototype%":Date.prototype,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%ErrorPrototype%":Error.prototype,"%eval%":eval,"%EvalError%":EvalError,"%EvalErrorPrototype%":EvalError.prototype,"%Float32Array%":typeof Float32Array=="undefined"?Z:Float32Array,"%Float32ArrayPrototype%":typeof Float32Array=="undefined"?Z:Float32Array.prototype,"%Float64Array%":typeof Float64Array=="undefined"?Z:Float64Array,"%Float64ArrayPrototype%":typeof Float64Array=="undefined"?Z:Float64Array.prototype,"%Function%":Function,"%FunctionPrototype%":Function.prototype,"%Generator%":sy?on(sy()):Z,"%GeneratorFunction%":R_,"%GeneratorPrototype%":R_?R_.prototype:Z,"%Int8Array%":typeof Int8Array=="undefined"?Z:Int8Array,"%Int8ArrayPrototype%":typeof Int8Array=="undefined"?Z:Int8Array.prototype,"%Int16Array%":typeof Int16Array=="undefined"?Z:Int16Array,"%Int16ArrayPrototype%":typeof Int16Array=="undefined"?Z:Int8Array.prototype,"%Int32Array%":typeof Int32Array=="undefined"?Z:Int32Array,"%Int32ArrayPrototype%":typeof Int32Array=="undefined"?Z:Int32Array.prototype,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ds?on(on([][Symbol.iterator]())):Z,"%JSON%":typeof JSON=="object"?JSON:Z,"%JSONParse%":typeof JSON=="object"?JSON.parse:Z,"%Map%":typeof Map=="undefined"?Z:Map,"%MapIteratorPrototype%":typeof Map=="undefined"||!ds?Z:on(new Map()[Symbol.iterator]()),"%MapPrototype%":typeof Map=="undefined"?Z:Map.prototype,"%Math%":Math,"%Number%":Number,"%NumberPrototype%":Number.prototype,"%Object%":Object,"%ObjectPrototype%":Object.prototype,"%ObjProto_toString%":Object.prototype.toString,"%ObjProto_valueOf%":Object.prototype.valueOf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise=="undefined"?Z:Promise,"%PromisePrototype%":typeof Promise=="undefined"?Z:Promise.prototype,"%PromiseProto_then%":typeof Promise=="undefined"?Z:Promise.prototype.then,"%Promise_all%":typeof Promise=="undefined"?Z:Promise.all,"%Promise_reject%":typeof Promise=="undefined"?Z:Promise.reject,"%Promise_resolve%":typeof Promise=="undefined"?Z:Promise.resolve,"%Proxy%":typeof Proxy=="undefined"?Z:Proxy,"%RangeError%":RangeError,"%RangeErrorPrototype%":RangeError.prototype,"%ReferenceError%":ReferenceError,"%ReferenceErrorPrototype%":ReferenceError.prototype,"%Reflect%":typeof Reflect=="undefined"?Z:Reflect,"%RegExp%":RegExp,"%RegExpPrototype%":RegExp.prototype,"%Set%":typeof Set=="undefined"?Z:Set,"%SetIteratorPrototype%":typeof Set=="undefined"||!ds?Z:on(new Set()[Symbol.iterator]()),"%SetPrototype%":typeof Set=="undefined"?Z:Set.prototype,"%SharedArrayBuffer%":typeof SharedArrayBuffer=="undefined"?Z:SharedArrayBuffer,"%SharedArrayBufferPrototype%":typeof SharedArrayBuffer=="undefined"?Z:SharedArrayBuffer.prototype,"%String%":String,"%StringIteratorPrototype%":ds?on(""[Symbol.iterator]()):Z,"%StringPrototype%":String.prototype,"%Symbol%":ds?Symbol:Z,"%SymbolPrototype%":ds?Symbol.prototype:Z,"%SyntaxError%":SyntaxError,"%SyntaxErrorPrototype%":SyntaxError.prototype,"%ThrowTypeError%":Uwe,"%TypedArray%":A_,"%TypedArrayPrototype%":A_?A_.prototype:Z,"%TypeError%":pd,"%TypeErrorPrototype%":pd.prototype,"%Uint8Array%":typeof Uint8Array=="undefined"?Z:Uint8Array,"%Uint8ArrayPrototype%":typeof Uint8Array=="undefined"?Z:Uint8Array.prototype,"%Uint8ClampedArray%":typeof Uint8ClampedArray=="undefined"?Z:Uint8ClampedArray,"%Uint8ClampedArrayPrototype%":typeof Uint8ClampedArray=="undefined"?Z:Uint8ClampedArray.prototype,"%Uint16Array%":typeof Uint16Array=="undefined"?Z:Uint16Array,"%Uint16ArrayPrototype%":typeof Uint16Array=="undefined"?Z:Uint16Array.prototype,"%Uint32Array%":typeof Uint32Array=="undefined"?Z:Uint32Array,"%Uint32ArrayPrototype%":typeof Uint32Array=="undefined"?Z:Uint32Array.prototype,"%URIError%":URIError,"%URIErrorPrototype%":URIError.prototype,"%WeakMap%":typeof WeakMap=="undefined"?Z:WeakMap,"%WeakMapPrototype%":typeof WeakMap=="undefined"?Z:WeakMap.prototype,"%WeakSet%":typeof WeakSet=="undefined"?Z:WeakSet,"%WeakSetPrototype%":typeof WeakSet=="undefined"?Z:WeakSet.prototype},Wwe=un(),W7=Wwe.call(Function.call,String.prototype.replace),Hwe=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,zwe=/\\(\\)?/g,Gwe=function(e){var t=[];return W7(e,Hwe,function(i,n,o,s){t[t.length]=o?W7(s,zwe,"$1"):n||i}),t},Vwe=function(e,t){if(!(e in O_))throw new SyntaxError("intrinsic "+e+" does not exist!");if(typeof O_[e]=="undefined"&&!t)throw new pd("intrinsic "+e+" exists, but is not available. Please file an issue!");return O_[e]};j7.exports=function(e,t){if(typeof e!="string"||e.length===0)throw new TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!="boolean")throw new TypeError('"allowMissing" argument must be a boolean');for(var i=Gwe(e),n=Vwe("%"+(i.length>0?i[0]:"")+"%",t),o=1;o<i.length;o+=1)if(n!=null)if(Ia&&o+1>=i.length){var s=Ia(n,i[o]);if(!t&&!(i[o]in n))throw new pd("base intrinsic for "+e+" exists, but the property is not available.");n=s&&"get"in s&&!("originalValue"in s.get)?s.get:n[i[o]]}else n=n[i[o]];return n}});var K7=g((t7e,ay)=>{"use strict";var M_=un(),ly=L_(),H7=ly("%Function.prototype.apply%"),z7=ly("%Function.prototype.call%"),G7=ly("%Reflect.apply%",!0)||M_.call(z7,H7),hd=ly("%Object.defineProperty%",!0);if(hd)try{hd({},"a",{value:1})}catch(r){hd=null}ay.exports=function(){return G7(M_,z7,arguments)};var V7=function(){return G7(M_,H7,arguments)};hd?hd(ay.exports,"apply",{value:V7}):ay.exports.apply=V7});var N_=g((r7e,J7)=>{"use strict";var Kwe=Object,Jwe=TypeError;J7.exports=function(){if(this!=null&&this!==Kwe(this))throw new Jwe("RegExp.prototype.flags getter called on non-object");var e="";return this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.sticky&&(e+="y"),e}});var q_=g((i7e,Y7)=>{"use strict";var Ywe=N_(),Xwe=Fn().supportsDescriptors,Zwe=Object.getOwnPropertyDescriptor,Qwe=TypeError;Y7.exports=function(){if(!Xwe)throw new Qwe("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");if(/a/mig.flags==="gim"){var e=Zwe(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof/a/.dotAll=="boolean")return e.get}return Ywe}});var Q7=g((n7e,X7)=>{"use strict";var exe=Fn().supportsDescriptors,txe=q_(),rxe=Object.getOwnPropertyDescriptor,ixe=Object.defineProperty,nxe=TypeError,Z7=Object.getPrototypeOf,oxe=/a/;X7.exports=function(){if(!exe||!Z7)throw new nxe("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=txe(),t=Z7(oxe),i=rxe(t,"flags");return(!i||i.get!==e)&&ixe(t,"flags",{configurable:!0,enumerable:!1,get:e}),e}});var $_=g((o7e,eG)=>{"use strict";var sxe=Fn(),axe=K7(),tG=N_(),lxe=q_(),uxe=Q7(),rG=axe(tG);sxe(rG,{getPolyfill:lxe,implementation:tG,shim:uxe});eG.exports=rG});var uy=g((s7e,iG)=>{"use strict";iG.exports=Number.isNaN||function(e){return e!==e}});var B_=g((a7e,nG)=>{"use strict";var oG=uy();nG.exports=function(e,t){return e===t?e===0?1/e==1/t:!0:oG(e)&&oG(t)}});var j_=g((l7e,sG)=>{"use strict";var cxe=Ae(),cy=cxe("%TypeError%"),fxe=Hu(),aG=B_(),lG=pr(),uG=function(){try{return delete[].length,!0}catch(r){return!1}}();sG.exports=function(e,t,i,n){if(lG(e)!=="Object")throw new cy("Assertion failed: `O` must be an Object");if(!fxe(t))throw new cy("Assertion failed: `P` must be a Property Key");if(lG(n)!=="Boolean")throw new cy("Assertion failed: `Throw` must be a Boolean");if(n){if(e[t]=i,uG&&!aG(e[t],i))throw new cy("Attempted to assign to readonly property.");return!0}else try{return e[t]=i,uG?aG(e[t],i):!0}catch(o){return!1}}});var fG=g((u7e,cG)=>{"use strict";var pxe=Ae(),dxe=so(),hxe=pxe("%TypeError%");cG.exports=function(e,t){if(e.Type(t)!=="Object")return!1;var i={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in t)if(dxe(t,n)&&!i[n])return!1;if(e.IsDataDescriptor(t)&&e.IsAccessorDescriptor(t))throw new hxe("Property Descriptors may not be both accessor and data descriptors");return!0}});var dG=g((c7e,pG)=>{"use strict";var mxe=Ae(),md=mxe("%Object.defineProperty%",!0);if(md)try{md({},"a",{value:1})}catch(r){md=null}var gxe=Ra(),vxe=gxe("Object.prototype.propertyIsEnumerable");pG.exports=function(e,t,i,n,o,s){if(!md){if(!e(s)||!s["[[Configurable]]"]||!s["[[Writable]]"]||o in n&&vxe(n,o)!==!!s["[[Enumerable]]"])return!1;var a=s["[[Value]]"];return n[o]=a,t(n[o],a)}return md(n,o,i(s)),!0}});var py=g((f7e,hG)=>{"use strict";var mG=Ae(),gG=mG("%TypeError%"),yxe=mG("%SyntaxError%"),fy=so(),bxe={"Property Descriptor":function(e,t){if(e(t)!=="Object")return!1;var i={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var n in t)if(fy(t,n)&&!i[n])return!1;var o=fy(t,"[[Value]]"),s=fy(t,"[[Get]]")||fy(t,"[[Set]]");if(o&&s)throw new gG("Property Descriptors may not be both accessor and data descriptors");return!0}};hG.exports=function(e,t,i,n){var o=bxe[t];if(typeof o!="function")throw new yxe("unknown record type: "+t);if(!o(e,n))throw new gG(i+" must be a "+t)}});var yG=g((p7e,vG)=>{"use strict";var wxe=py(),xxe=pr();vG.exports=function(e){if(typeof e=="undefined")return e;wxe(xxe,"Property Descriptor","Desc",e);var t={};return"[[Value]]"in e&&(t.value=e["[[Value]]"]),"[[Writable]]"in e&&(t.writable=e["[[Writable]]"]),"[[Get]]"in e&&(t.get=e["[[Get]]"]),"[[Set]]"in e&&(t.set=e["[[Set]]"]),"[[Enumerable]]"in e&&(t.enumerable=e["[[Enumerable]]"]),"[[Configurable]]"in e&&(t.configurable=e["[[Configurable]]"]),t}});var xG=g((d7e,bG)=>{"use strict";var wG=so(),Dxe=py(),Sxe=pr();bG.exports=function(e){return!(typeof e=="undefined"||(Dxe(Sxe,"Property Descriptor","Desc",e),!wG(e,"[[Get]]")&&!wG(e,"[[Set]]")))}});var EG=g((h7e,DG)=>{"use strict";var SG=so(),Exe=py(),Cxe=pr();DG.exports=function(e){return!(typeof e=="undefined"||(Exe(Cxe,"Property Descriptor","Desc",e),!SG(e,"[[Value]]")&&!SG(e,"[[Writable]]")))}});var PG=g((m7e,CG)=>{"use strict";var Rn=so(),_xe=Ae(),dy=_xe("%TypeError%"),Pxe=pr(),U_=__(),_G=iy();CG.exports=function(e){if(Pxe(e)!=="Object")throw new dy("ToPropertyDescriptor requires an object");var t={};if(Rn(e,"enumerable")&&(t["[[Enumerable]]"]=U_(e.enumerable)),Rn(e,"configurable")&&(t["[[Configurable]]"]=U_(e.configurable)),Rn(e,"value")&&(t["[[Value]]"]=e.value),Rn(e,"writable")&&(t["[[Writable]]"]=U_(e.writable)),Rn(e,"get")){var i=e.get;if(typeof i!="undefined"&&!_G(i))throw new dy("getter must be a function");t["[[Get]]"]=i}if(Rn(e,"set")){var n=e.set;if(typeof n!="undefined"&&!_G(n))throw new dy("setter must be a function");t["[[Set]]"]=n}if((Rn(t,"[[Get]]")||Rn(t,"[[Set]]"))&&(Rn(t,"[[Value]]")||Rn(t,"[[Writable]]")))throw new dy("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t}});var IG=g((g7e,TG)=>{"use strict";var Txe=Ae(),W_=Txe("%TypeError%"),RG=fG(),Rxe=dG(),kxe=yG(),kG=xG(),H_=EG(),Ixe=Hu(),Fxe=B_(),Axe=PG(),z_=pr();TG.exports=function(e,t,i){if(z_(e)!=="Object")throw new W_("Assertion failed: Type(O) is not Object");if(!Ixe(t))throw new W_("Assertion failed: IsPropertyKey(P) is not true");var n=RG({Type:z_,IsDataDescriptor:H_,IsAccessorDescriptor:kG},i)?i:Axe(i);if(!RG({Type:z_,IsDataDescriptor:H_,IsAccessorDescriptor:kG},n))throw new W_("Assertion failed: Desc is not a valid Property Descriptor");return Rxe(H_,Fxe,kxe,e,t,n)}});var AG=g((v7e,G_)=>{"use strict";var Oxe=Ae(),FG=Oxe("%Reflect.construct%",!0),hy=IG();try{hy({},"",{"[[Get]]":function(){}})}catch(r){hy=null}hy&&FG?(V_={},K_={},hy(K_,"length",{"[[Get]]":function(){throw V_},"[[Enumerable]]":!0}),G_.exports=function(e){try{FG(e,K_)}catch(t){return t===V_}}):G_.exports=function(e){return typeof e=="function"&&!!e.prototype};var V_,K_});var qG=g((y7e,OG)=>{"use strict";var LG=Ae(),MG=LG("%Symbol.species%",!0),J_=LG("%TypeError%"),Lxe=AG(),NG=pr();OG.exports=function(e,t){if(NG(e)!=="Object")throw new J_("Assertion failed: Type(O) is not Object");var i=e.constructor;if(typeof i=="undefined")return t;if(NG(i)!=="Object")throw new J_("O.constructor is not an Object");var n=MG?i[MG]:void 0;if(n==null)return t;if(Lxe(n))return n;throw new J_("no constructor found")}});var Y_=g((b7e,$G)=>{"use strict";var BG=Ae(),Mxe=BG("%Math%"),Nxe=BG("%Number%");$G.exports=Nxe.MAX_SAFE_INTEGER||Mxe.pow(2,53)-1});var UG=g((w7e,jG)=>{"use strict";var qxe=Ae(),$xe=qxe("%Math.abs%");jG.exports=function(e){return $xe(e)}});var HG=g((x7e,WG)=>{"use strict";var Bxe=Math.floor;WG.exports=function(e){return Bxe(e)}});var GG=g((D7e,zG)=>{"use strict";zG.exports=function(e){return+e}});var X_=g((S7e,VG)=>{"use strict";var jxe=Number.isNaN||function(r){return r!==r};VG.exports=Number.isFinite||function(r){return typeof r=="number"&&!jxe(r)&&r!==Infinity&&r!==-Infinity}});var JG=g((E7e,KG)=>{"use strict";KG.exports=function(e){return e>=0?1:-1}});var XG=g((C7e,YG)=>{"use strict";var Uxe=UG(),Wxe=HG(),Hxe=GG(),zxe=uy(),Gxe=X_(),Vxe=JG();YG.exports=function(e){var t=Hxe(e);return zxe(t)?0:t===0||!Gxe(t)?t:Vxe(t)*Wxe(Uxe(t))}});var QG=g((_7e,ZG)=>{"use strict";var Kxe=Ae(),Jxe=Kxe("RegExp.prototype.test"),Yxe=c_();ZG.exports=function(e){return Yxe(Jxe,e)}});var tV=g((P7e,eV)=>{"use strict";eV.exports=function(e){return e===null||typeof e!="function"&&typeof e!="object"}});var iV=g((T7e,rV)=>{"use strict";rV.exports=function(e){return e===null||typeof e!="function"&&typeof e!="object"}});var oV=g((R7e,nV)=>{"use strict";var Xxe=Date.prototype.getDay,Zxe=function(e){try{return Xxe.call(e),!0}catch(t){return!1}},Qxe=Object.prototype.toString,eDe="[object Date]",tDe=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol";nV.exports=function(e){return typeof e!="object"||e===null?!1:tDe?Zxe(e):Qxe.call(e)===eDe}});var uV=g((k7e,Z_)=>{"use strict";var rDe=Object.prototype.toString,iDe=Li()();iDe?(sV=Symbol.prototype.toString,aV=/^Symbol\(.*\)$/,lV=function(e){return typeof e.valueOf()!="symbol"?!1:aV.test(sV.call(e))},Z_.exports=function(e){if(typeof e=="symbol")return!0;if(rDe.call(e)!=="[object Symbol]")return!1;try{return lV(e)}catch(t){return!1}}):Z_.exports=function(e){return!1};var sV,aV,lV});var dV=g((I7e,cV)=>{"use strict";var nDe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol",Q_=iV(),fV=Oy(),oDe=oV(),pV=uV(),sDe=function(e,t){if(typeof e=="undefined"||e===null)throw new TypeError("Cannot call method on "+e);if(typeof t!="string"||t!=="number"&&t!=="string")throw new TypeError('hint must be "string" or "number"');var i=t==="string"?["toString","valueOf"]:["valueOf","toString"],n,o,s;for(s=0;s<i.length;++s)if(n=e[i[s]],fV(n)&&(o=n.call(e),Q_(o)))return o;throw new TypeError("No default value")},aDe=function(e,t){var i=e[t];if(i!==null&&typeof i!="undefined"){if(!fV(i))throw new TypeError(i+" returned for property "+t+" of object "+e+" is not a function");return i}};cV.exports=function(e){if(Q_(e))return e;var t="default";arguments.length>1&&(arguments[1]===String?t="string":arguments[1]===Number&&(t="number"));var i;if(nDe&&(Symbol.toPrimitive?i=aDe(e,Symbol.toPrimitive):pV(e)&&(i=Symbol.prototype.valueOf)),typeof i!="undefined"){var n=i.call(e,t);if(Q_(n))return n;throw new TypeError("unable to convert exotic object to primitive")}return t==="default"&&(oDe(e)||pV(e))&&(t="string"),sDe(e,t==="default"?"number":t)}});var gV=g((F7e,hV)=>{"use strict";var mV=dV();hV.exports=function(e){return arguments.length>1?mV(e,arguments[1]):mV(e)}});var SV=g((A7e,vV)=>{"use strict";var my=Ae(),lDe=my("%TypeError%"),yV=my("%Number%"),uDe=my("%RegExp%"),bV=my("%parseInt%"),wV=Ra(),gy=QG(),cDe=tV(),xV=wV("String.prototype.slice"),fDe=gy(/^0b[01]+$/i),pDe=gy(/^0o[0-7]+$/i),dDe=gy(/^[-+]0x[0-9a-f]+$/i),hDe=["\x85","\u200B","\uFFFE"].join(""),mDe=new uDe("["+hDe+"]","g"),gDe=gy(mDe),DV=[`
|
||
\v\f\r \xA0\u1680\u180E\u2000\u2001\u2002\u2003`,"\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028","\u2029\uFEFF"].join(""),vDe=new RegExp("(^["+DV+"]+)|(["+DV+"]+$)","g"),yDe=wV("String.prototype.replace"),bDe=function(r){return yDe(r,vDe,"")},wDe=gV();vV.exports=function r(e){var t=cDe(e)?e:wDe(e,yV);if(typeof t=="symbol")throw new lDe("Cannot convert a Symbol value to a number");if(typeof t=="string"){if(fDe(t))return r(bV(xV(t,2),2));if(pDe(t))return r(bV(xV(t,2),8));if(gDe(t)||dDe(t))return NaN;var i=bDe(t);if(i!==t)return r(i)}return yV(t)}});var CV=g((O7e,EV)=>{"use strict";var xDe=XG(),DDe=SV();EV.exports=function(e){var t=DDe(e);return t!==0&&(t=xDe(t)),t===0?0:t}});var eP=g((L7e,_V)=>{"use strict";var PV=Y_(),SDe=CV();_V.exports=function(e){var t=SDe(e);return t<=0?0:t>PV?PV:t}});var tP=g((M7e,TV)=>{"use strict";TV.exports=function(e){return typeof e=="number"&&e>=55296&&e<=56319}});var rP=g((N7e,RV)=>{"use strict";RV.exports=function(e){return typeof e=="number"&&e>=56320&&e<=57343}});var AV=g((q7e,kV)=>{"use strict";var IV=Ae(),EDe=IV("%TypeError%"),FV=IV("%String.fromCharCode%"),CDe=tP(),_De=rP();kV.exports=function(e,t){if(!CDe(e)||!_De(t))throw new EDe("Assertion failed: `lead` must be a leading surrogate char code, and `trail` must be a trailing surrogate char code");return FV(e)+FV(t)}});var $V=g(($7e,OV)=>{"use strict";var PDe=Ae(),LV=PDe("%TypeError%"),MV=Ra(),TDe=tP(),NV=rP(),RDe=pr(),kDe=AV(),IDe=MV("String.prototype.charAt"),qV=MV("String.prototype.charCodeAt");OV.exports=function(e,t){if(RDe(e)!=="String")throw new LV("Assertion failed: `string` must be a String");var i=e.length;if(t<0||t>=i)throw new LV("Assertion failed: `position` must be >= 0, and < the length of `string`");var n=qV(e,t),o=IDe(e,t),s=TDe(n),a=NV(n);if(!s&&!a)return{"[[CodePoint]]":o,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!1};if(a||t+1===i)return{"[[CodePoint]]":o,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0};var l=qV(e,t+1);return NV(l)?{"[[CodePoint]]":kDe(n,l),"[[CodeUnitCount]]":2,"[[IsUnpairedSurrogate]]":!1}:{"[[CodePoint]]":o,"[[CodeUnitCount]]":1,"[[IsUnpairedSurrogate]]":!0}}});var jV=g((B7e,BV)=>{"use strict";var FDe=Ae(),ADe=FDe("%Math.abs%");BV.exports=function(e){return ADe(e)}});var WV=g((j7e,UV)=>{"use strict";var ODe=Math.floor;UV.exports=function(e){return ODe(e)}});var zV=g((U7e,HV)=>{"use strict";var LDe=jV(),MDe=WV(),NDe=uy(),qDe=X_();HV.exports=function(e){if(typeof e!="number"||NDe(e)||!qDe(e))return!1;var t=LDe(e);return MDe(t)===t}});var KV=g((W7e,GV)=>{"use strict";var $De=Ae(),BDe=$V(),jDe=zV(),VV=pr(),UDe=Y_(),iP=$De("%TypeError%");GV.exports=function(e,t,i){if(VV(e)!=="String")throw new iP("Assertion failed: `S` must be a String");if(!jDe(t)||t<0||t>UDe)throw new iP("Assertion failed: `length` must be an integer >= 0 and <= 2**53");if(VV(i)!=="Boolean")throw new iP("Assertion failed: `unicode` must be a Boolean");if(!i)return t+1;var n=e.length;if(t+1>=n)return t+1;var o=BDe(e,t);return t+o["[[CodeUnitCount]]"]}});var YV=g((H7e,JV)=>{"use strict";var WDe=Ae(),HDe=WDe("%TypeError%"),zDe=pr();JV.exports=function(e,t){if(zDe(t)!=="Boolean")throw new HDe("Assertion failed: Type(done) is not Boolean");return{value:e,done:t}}});var QV=g((z7e,XV)=>{"use strict";var GDe=Ae(),ZV=GDe("%Array%"),VDe=!ZV.isArray&&Ra()("Object.prototype.toString");XV.exports=ZV.isArray||function(e){return VDe(e)==="[object Array]"}});var nK=g((G7e,eK)=>{"use strict";var nP=Ae(),tK=nP("%Object.create%",!0),rK=nP("%TypeError%"),iK=nP("%SyntaxError%"),KDe=QV(),JDe=pr(),YDe=!({__proto__:null}instanceof Object);eK.exports=function(e){if(e!==null&&JDe(e)!=="Object")throw new rK("Assertion failed: `proto` must be null or an object");var t=arguments.length<2?[]:arguments[1];if(!KDe(t))throw new rK("Assertion failed: `additionalInternalSlotsList` must be an Array");if(t.length>0)throw new iK("es-abstract does not yet support internal slots");if(tK)return tK(e);if(YDe)return{__proto__:e};if(e===null)throw new iK("native Object.create support is required to create null objects");var i=function(){};return i.prototype=e,new i}});var sK=g((V7e,oK)=>{"use strict";var XDe=Ae(),oP=XDe("%TypeError%"),ZDe=Ra()("RegExp.prototype.exec"),QDe=f_(),e0e=fd(),t0e=iy(),sP=pr();oK.exports=function(e,t){if(sP(e)!=="Object")throw new oP("Assertion failed: `R` must be an Object");if(sP(t)!=="String")throw new oP("Assertion failed: `S` must be a String");var i=e0e(e,"exec");if(t0e(i)){var n=QDe(i,e,[t]);if(n===null||sP(n)==="Object")return n;throw new oP('"exec" method must return `null` or an Object')}return ZDe(e,t)}});var lK=g((K7e,aK)=>{"use strict";var aP=Vv(),Gu=P_(),r0e=w_(),i0e=aP("%TypeError%"),vy=aP("%WeakMap%",!0),yy=aP("%Map%",!0),n0e=Gu("WeakMap.prototype.get",!0),o0e=Gu("WeakMap.prototype.set",!0),s0e=Gu("WeakMap.prototype.has",!0),a0e=Gu("Map.prototype.get",!0),l0e=Gu("Map.prototype.set",!0),u0e=Gu("Map.prototype.has",!0),lP=function(r,e){for(var t=r,i;(i=t.next)!==null;t=i)if(i.key===e)return t.next=i.next,i.next=r.next,r.next=i,i},c0e=function(r,e){var t=lP(r,e);return t&&t.value},f0e=function(r,e,t){var i=lP(r,e);i?i.value=t:r.next={key:e,next:r.next,value:t}},p0e=function(r,e){return!!lP(r,e)};aK.exports=function(){var e,t,i,n={assert:function(o){if(!n.has(o))throw new i0e("Side channel does not contain "+r0e(o))},get:function(o){if(vy&&o&&(typeof o=="object"||typeof o=="function")){if(e)return n0e(e,o)}else if(yy){if(t)return a0e(t,o)}else if(i)return c0e(i,o)},has:function(o){if(vy&&o&&(typeof o=="object"||typeof o=="function")){if(e)return s0e(e,o)}else if(yy){if(t)return u0e(t,o)}else if(i)return p0e(i,o);return!1},set:function(o,s){vy&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new vy),o0e(e,o,s)):yy?(t||(t=new yy),l0e(t,o,s)):(i||(i={key:{},next:null}),f0e(i,o,s))}};return n}});var fK=g((J7e,uK)=>{"use strict";var d0e=L_(),h0e=so(),gd=lK()(),hs=d0e("%TypeError%"),cK={assert:function(r,e){if(!r||typeof r!="object"&&typeof r!="function")throw new hs("`O` is not an object");if(typeof e!="string")throw new hs("`slot` must be a string");gd.assert(r)},get:function(r,e){if(!r||typeof r!="object"&&typeof r!="function")throw new hs("`O` is not an object");if(typeof e!="string")throw new hs("`slot` must be a string");var t=gd.get(r);return t&&t["$"+e]},has:function(r,e){if(!r||typeof r!="object"&&typeof r!="function")throw new hs("`O` is not an object");if(typeof e!="string")throw new hs("`slot` must be a string");var t=gd.get(r);return!!t&&h0e(t,"$"+e)},set:function(r,e,t){if(!r||typeof r!="object"&&typeof r!="function")throw new hs("`O` is not an object");if(typeof e!="string")throw new hs("`slot` must be a string");var i=gd.get(r);i||(i={},gd.set(r,i)),i["$"+e]=t}};Object.freeze&&Object.freeze(cK);uK.exports=cK});var gK=g((Y7e,pK)=>{"use strict";var dK=Fn(),m0e=KV(),by=YV(),hK=fd(),g0e=Ae(),v0e=nK(),y0e=sK(),b0e=j_(),w0e=eP(),x0e=oy(),wy=pr(),D0e=Li()(),Jt=fK(),mK,lo=function(e,t,i,n){if(wy(t)!=="String")throw new TypeError("S must be a string");if(wy(i)!=="Boolean")throw new TypeError("global must be a boolean");if(wy(n)!=="Boolean")throw new TypeError("fullUnicode must be a boolean");Jt.set(this,"[[IteratingRegExp]]",e),Jt.set(this,"[[IteratedString]]",t),Jt.set(this,"[[Global]]",i),Jt.set(this,"[[Unicode]]",n),Jt.set(this,"[[Done]]",!1)},uP=g0e("%IteratorPrototype%",!0);uP&&(lo.prototype=v0e(uP));dK(lo.prototype,{next:function(){var e=this;if(wy(e)!=="Object")throw new TypeError("receiver must be an object");if(!(e instanceof lo)||!Jt.has(e,"[[IteratingRegExp]]")||!Jt.has(e,"[[IteratedString]]")||!Jt.has(e,"[[Global]]")||!Jt.has(e,"[[Unicode]]")||!Jt.has(e,"[[Done]]"))throw new TypeError('"this" value must be a RegExpStringIterator instance');if(Jt.get(e,"[[Done]]"))return by(mK,!0);var t=Jt.get(e,"[[IteratingRegExp]]"),i=Jt.get(e,"[[IteratedString]]"),n=Jt.get(e,"[[Global]]"),o=Jt.get(e,"[[Unicode]]"),s=y0e(t,i);if(s===null)return Jt.set(e,"[[Done]]",!0),by(mK,!0);if(n){var a=x0e(hK(s,"0"));if(a===""){var l=w0e(hK(t,"lastIndex")),u=m0e(i,l,o);b0e(t,"lastIndex",u,!0)}return by(s,!1)}return Jt.set(e,"[[Done]]",!0),by(s,!1)}});D0e&&(cP=Object.defineProperty,Symbol.toStringTag&&(cP?cP(lo.prototype,Symbol.toStringTag,{configurable:!0,enumerable:!1,value:"RegExp String Iterator",writable:!1}):lo.prototype[Symbol.toStringTag]="RegExp String Iterator"),!uP&&Symbol.iterator&&(xy={},xy[Symbol.iterator]=lo.prototype[Symbol.iterator]||function(){return this},fP={},fP[Symbol.iterator]=function(){return lo.prototype[Symbol.iterator]!==xy[Symbol.iterator]},dK(lo.prototype,xy,fP)));var cP,xy,fP;pK.exports=lo});var SK=g((X7e,vK)=>{"use strict";var yK=fd(),S0e=j_(),E0e=qG(),C0e=eP(),bK=oy(),Dy=pr(),_0e=$_(),P0e=gK(),wK=RegExp,T0e=function(e,t,i,n){if(Dy(t)!=="String")throw new TypeError('"S" value must be a String');if(Dy(i)!=="Boolean")throw new TypeError('"global" value must be a Boolean');if(Dy(n)!=="Boolean")throw new TypeError('"fullUnicode" value must be a Boolean');var o=new P0e(e,t,i,n);return o},R0e="flags"in RegExp.prototype,k0e=function(e,t){var i,n="flags"in t?yK(t,"flags"):bK(_0e(t));return R0e&&typeof n=="string"?i=new e(t,n):e===wK?i=new e(t.source,n):i=new e(t,n),{flags:n,matcher:i}},pP=function(e){var t=this;if(Dy(t)!=="Object")throw new TypeError('"this" value must be an Object');var i=bK(e),n=E0e(t,wK),o=k0e(n,t),s=o.flags,a=o.matcher,l=C0e(yK(t,"lastIndex"));S0e(a,"lastIndex",l,!0);var u=s.indexOf("g")>-1,c=s.indexOf("u")>-1;return T0e(a,i,u,c)},xK=Object.defineProperty,DK=Object.getOwnPropertyDescriptor;xK&&DK&&(dP=DK(pP,"name"),dP&&dP.configurable&&xK(pP,"name",{value:"[Symbol.matchAll]"}));var dP;vK.exports=pP});var hP=g((Z7e,EK)=>{"use strict";var I0e=Li()(),F0e=SK();EK.exports=function(){return!I0e||typeof Symbol.matchAll!="symbol"||typeof RegExp.prototype[Symbol.matchAll]!="function"?F0e:RegExp.prototype[Symbol.matchAll]}});var mP=g((Q7e,CK)=>{"use strict";var _K=f_(),A0e=fd(),O0e=_7(),PK=L7(),TK=oy(),RK=x_(),L0e=P_(),M0e=Li()(),N0e=$_(),q0e=L0e("String.prototype.indexOf"),$0e=hP(),kK=function(e){var t=$0e();if(M0e&&typeof Symbol.matchAll=="symbol"){var i=O0e(e,Symbol.matchAll);return i===RegExp.prototype[Symbol.matchAll]&&i!==t?t:i}if(PK(e))return t};CK.exports=function(e){var t=RK(this);if(typeof e!="undefined"&&e!==null){var i=PK(e);if(i){var n="flags"in e?A0e(e,"flags"):N0e(e);if(RK(n),q0e(TK(n),"g")<0)throw new TypeError("matchAll requires a global regular expression")}var o=kK(e);if(typeof o!="undefined")return _K(o,e,[t])}var s=TK(t),a=new RegExp(e,"g");return _K(kK(a),a,[s])}});var gP=g((eGe,IK)=>{"use strict";var B0e=mP();IK.exports=function(){if(String.prototype.matchAll)try{"".matchAll(RegExp.prototype)}catch(e){return String.prototype.matchAll}return B0e}});var LK=g((tGe,FK)=>{"use strict";var vP=Fn(),j0e=Li()(),U0e=gP(),W0e=hP(),AK=Object.defineProperty,OK=Object.getOwnPropertyDescriptor;FK.exports=function(){var e=U0e();if(vP(String.prototype,{matchAll:e},{matchAll:function(){return String.prototype.matchAll!==e}}),j0e){var t=Symbol.matchAll||(Symbol.for?Symbol.for("Symbol.matchAll"):Symbol("Symbol.matchAll"));if(vP(Symbol,{matchAll:t},{matchAll:function(){return Symbol.matchAll!==t}}),AK&&OK){var i=OK(Symbol,t);(!i||i.configurable)&&AK(Symbol,t,{configurable:!1,enumerable:!1,value:t,writable:!1})}var n=W0e(),o={};o[t]=n;var s={};s[t]=function(){return RegExp.prototype[t]!==n},vP(RegExp.prototype,o,s)}return e}});var $K=g((rGe,MK)=>{"use strict";var H0e=i_(),z0e=Fn(),NK=mP(),G0e=gP(),V0e=LK(),qK=H0e(NK);z0e(qK,{getPolyfill:G0e,implementation:NK,shim:V0e});MK.exports=qK});var CJ=g(nSe=>{fo(nSe,{default:()=>sSe});var DJ=S(Lw()),SJ=S(Ab()),EJ=S(Pf()),co=j()("attach"),oSe=global.hasOwnProperty("__TEST__"),sSe=(r,e=!0)=>{let t=DJ.attach(r,SJ.default.getLogger("node-client"),e);global.hasOwnProperty("__TEST__")||t.call("coc#util#path_replace_patterns").then(s=>{if(wt(s)){let a=$.file;$.file=l=>(l=l.replace(/\\/g,"/"),Object.keys(s).forEach(u=>l=l.replace(new RegExp("^"+u),s[u])),a(l))}}).logError(),t.setVar("coc_process_pid",process.pid,!0);let i=new xJ(t),n=!1,o=!1;return t.on("notification",async(s,a)=>{switch(s){case"VimEnter":{!o&&n&&(o=!0,await i.init());break}case"TaskExit":case"TaskStderr":case"TaskStdout":case"GlobalChange":case"PromptInsert":case"InputChar":case"MenuInput":case"OptionSet":case"FloatBtnClick":await A.fire(s,a);break;case"CocAutocmd":co.debug("Notification autocmd:",...a),await A.fire(a[0],a.slice(1));break;default:{if(!i.hasAction(s)){if(global.hasOwnProperty("__TEST__"))return;console.error(`action "${s}" not registered`);return}try{i.isReady?co.info("receive notification:",s,a):co.warn(`Plugin not ready when received "${s}"`,a),await i.ready,await i.cocAction(s,...a)}catch(u){console.error(`Error on notification "${s}": ${u.message||u.toString()}`),co.error("Notification error:",s,a,u)}}}}),t.on("request",async(s,a,l)=>{s!="redraw"&&co.info("receive request:",s,a);let u=setTimeout(()=>{co.error("Request cost more than 3s",s,a)},3e3);try{if(s=="CocAutocmd")co.debug("Request autocmd:",...a),await A.fire(a[0],a.slice(1)),l.send();else{i.isReady||co.warn(`Plugin not ready when received "${s}"`,a);let c=await i.cocAction(s,...a);l.send(c)}clearTimeout(u)}catch(c){clearTimeout(u),l.send(c.message||c.toString(),!0),co.error("Request error:",s,a,c)}}),t.channelId.then(async s=>{n=!0,oSe&&t.command(`let g:coc_node_channel_id = ${s}`,!0);let{major:a,minor:l,patch:u}=EJ.default.parse(ug);t.setClientInfo("coc",{major:a,minor:l,patch:u},"remote",{},{}),await t.getVvar("vim_did_enter")&&!o&&(o=!0,await i.init())}).catch(s=>{console.error(`Channel create error: ${s.message}`)}),i}});var aSe=qT();gh();Object.defineProperty(console,"log",{value(){LP.info(...arguments)}});aSe.shim();var LP=j()("server");var Ox=S(W());var nq=S(require("child_process")),oq=S(Gr()),sq=S(require("fs")),aq=S(Ex()),kx=S(require("path")),Ix=S(W());"use strict";var Ile=function(){var r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var o in n)n.hasOwnProperty(o)&&(i[o]=n[o])},r(e,t)};return function(e,t){r(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}}(),ct,mf;typeof process=="object"?mf=process.platform==="win32":typeof navigator=="object"&&(AN=navigator.userAgent,mf=AN.indexOf("Windows")>=0);var AN;var Fle=/^\w[\w\d+.-]*$/,Ale=/^\//,Ole=/^\/\//;function Lle(r,e){if(!r.scheme&&e)throw new Error('[UriError]: Scheme is missing: {scheme: "", authority: "'+r.authority+'", path: "'+r.path+'", query: "'+r.query+'", fragment: "'+r.fragment+'"}');if(r.scheme&&!Fle.test(r.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(r.path){if(r.authority){if(!Ale.test(r.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(Ole.test(r.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}function Mle(r,e){return!r&&!e?"file":r}function Nle(r,e){switch(r){case"https":case"http":case"file":e?e[0]!==zi&&(e=zi+e):e=zi;break}return e}var Ke="",zi="/",qle=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/,$=function(){function r(e,t,i,n,o,s){s===void 0&&(s=!1),typeof e=="object"?(this.scheme=e.scheme||Ke,this.authority=e.authority||Ke,this.path=e.path||Ke,this.query=e.query||Ke,this.fragment=e.fragment||Ke):(this.scheme=Mle(e,s),this.authority=t||Ke,this.path=Nle(this.scheme,i||Ke),this.query=n||Ke,this.fragment=o||Ke,Lle(this,s))}return r.isUri=function(e){return e instanceof r?!0:e?typeof e.authority=="string"&&typeof e.fragment=="string"&&typeof e.path=="string"&&typeof e.query=="string"&&typeof e.scheme=="string"&&typeof e.fsPath=="function"&&typeof e.with=="function"&&typeof e.toString=="function":!1},Object.defineProperty(r.prototype,"fsPath",{get:function(){return LN(this,!1)},enumerable:!0,configurable:!0}),r.prototype.with=function(e){if(!e)return this;var t=e.scheme,i=e.authority,n=e.path,o=e.query,s=e.fragment;return t===void 0?t=this.scheme:t===null&&(t=Ke),i===void 0?i=this.authority:i===null&&(i=Ke),n===void 0?n=this.path:n===null&&(n=Ke),o===void 0?o=this.query:o===null&&(o=Ke),s===void 0?s=this.fragment:s===null&&(s=Ke),t===this.scheme&&i===this.authority&&n===this.path&&o===this.query&&s===this.fragment?this:new Dl(t,i,n,o,s)},r.parse=function(e,t){t===void 0&&(t=!1);var i=qle.exec(e);return i?new Dl(i[2]||Ke,om(i[4]||Ke),om(i[5]||Ke),om(i[7]||Ke),om(i[9]||Ke),t):new Dl(Ke,Ke,Ke,Ke,Ke)},r.file=function(e){var t=Ke;if(mf&&(e=e.replace(/\\/g,zi)),e[0]===zi&&e[1]===zi){var i=e.indexOf(zi,2);i===-1?(t=e.substring(2),e=zi):(t=e.substring(2,i),e=e.substring(i)||zi)}return new Dl("file",t,e,Ke,Ke)},r.from=function(e){return new Dl(e.scheme,e.authority,e.path,e.query,e.fragment)},r.prototype.toString=function(e){return e===void 0&&(e=!1),Cx(this,e)},r.prototype.toJSON=function(){return this},r.revive=function(e){if(e){if(e instanceof r)return e;var t=new Dl(e);return t._formatted=e.external,t._fsPath=e._sep===ON?e.fsPath:null,t}else return e},r}();var ON=mf?1:void 0,Dl=function(r){Ile(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t._formatted=null,t._fsPath=null,t}return Object.defineProperty(e.prototype,"fsPath",{get:function(){return this._fsPath||(this._fsPath=LN(this,!1)),this._fsPath},enumerable:!0,configurable:!0}),e.prototype.toString=function(t){return t===void 0&&(t=!1),t?Cx(this,!0):(this._formatted||(this._formatted=Cx(this,!1)),this._formatted)},e.prototype.toJSON=function(){var t={$mid:1};return this._fsPath&&(t.fsPath=this._fsPath,t._sep=ON),this._formatted&&(t.external=this._formatted),this.path&&(t.path=this.path),this.scheme&&(t.scheme=this.scheme),this.authority&&(t.authority=this.authority),this.query&&(t.query=this.query),this.fragment&&(t.fragment=this.fragment),t},e}($),MN=(ct={},ct[58]="%3A",ct[47]="%2F",ct[63]="%3F",ct[35]="%23",ct[91]="%5B",ct[93]="%5D",ct[64]="%40",ct[33]="%21",ct[36]="%24",ct[38]="%26",ct[39]="%27",ct[40]="%28",ct[41]="%29",ct[42]="%2A",ct[43]="%2B",ct[44]="%2C",ct[59]="%3B",ct[61]="%3D",ct[32]="%20",ct);function NN(r,e){for(var t=void 0,i=-1,n=0;n<r.length;n++){var o=r.charCodeAt(n);if(o>=97&&o<=122||o>=65&&o<=90||o>=48&&o<=57||o===45||o===46||o===95||o===126||e&&o===47)i!==-1&&(t+=encodeURIComponent(r.substring(i,n)),i=-1),t!==void 0&&(t+=r.charAt(n));else{t===void 0&&(t=r.substr(0,n));var s=MN[o];s!==void 0?(i!==-1&&(t+=encodeURIComponent(r.substring(i,n)),i=-1),t+=s):i===-1&&(i=n)}}return i!==-1&&(t+=encodeURIComponent(r.substring(i))),t!==void 0?t:r}function $le(r){for(var e=void 0,t=0;t<r.length;t++){var i=r.charCodeAt(t);i===35||i===63?(e===void 0&&(e=r.substr(0,t)),e+=MN[i]):e!==void 0&&(e+=r[t])}return e!==void 0?e:r}function LN(r,e){var t;return r.authority&&r.path.length>1&&r.scheme==="file"?t="//"+r.authority+r.path:r.path.charCodeAt(0)===47&&(r.path.charCodeAt(1)>=65&&r.path.charCodeAt(1)<=90||r.path.charCodeAt(1)>=97&&r.path.charCodeAt(1)<=122)&&r.path.charCodeAt(2)===58?e?t=r.path.substr(1):t=r.path[1].toLowerCase()+r.path.substr(2):t=r.path,mf&&(t=t.replace(/\//g,"\\")),t}function Cx(r,e){var t=e?$le:NN,i="",n=r.scheme,o=r.authority,s=r.path,a=r.query,l=r.fragment;if(n&&(i+=n,i+=":"),(o||n==="file")&&(i+=zi,i+=zi),o){var u=o.indexOf("@");if(u!==-1){var c=o.substr(0,u);o=o.substr(u+1),u=c.indexOf(":"),u===-1?i+=t(c,!1):(i+=t(c.substr(0,u),!1),i+=":",i+=t(c.substr(u+1),!1)),i+="@"}o=o.toLowerCase(),u=o.indexOf(":"),u===-1?i+=t(o,!1):(i+=t(o.substr(0,u),!1),i+=o.substr(u))}if(s){if(s.length>=3&&s.charCodeAt(0)===47&&s.charCodeAt(2)===58){var f=s.charCodeAt(1);f>=65&&f<=90&&(s="/"+String.fromCharCode(f+32)+":"+s.substr(3))}else if(s.length>=2&&s.charCodeAt(1)===58){var f=s.charCodeAt(0);f>=65&&f<=90&&(s=String.fromCharCode(f+32)+":"+s.substr(2))}i+=t(s,!0)}return a&&(i+="?",i+=t(a,!1)),l&&(i+="#",i+=e?l:NN(l,!1)),i}function qN(r){try{return decodeURIComponent(r)}catch(e){return r.length>3?r.substr(0,3)+qN(r.substr(3)):r}}var $N=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function om(r){return r.match($N)?r.replace($N,function(e){return qN(e)}):r}var lq=S(El());var Cl={};fo(Cl,{OS:()=>tue,OperatingSystem:()=>_l,Platform:()=>Hs,globals:()=>eue,isLinux:()=>Jle,isMacintosh:()=>Rx,isNative:()=>Yle,isWeb:()=>Xle,isWindows:()=>Hn,language:()=>Kle,platform:()=>Zle});var am=!1,lm=!1,Px=!1,Tx=!1,Vle=!1,Kle="en";typeof process=="object"&&typeof process.nextTick=="function"&&typeof process.platform=="string"&&(am=process.platform==="win32",lm=process.platform==="darwin",Px=process.platform==="linux",Tx=!0);var Hs;(function(r){r[r.Web=0]="Web",r[r.Mac=1]="Mac",r[r.Linux=2]="Linux",r[r.Windows=3]="Windows"})(Hs||(Hs={}));var um=0;Tx&&(lm?um=1:am?um=3:Px&&(um=2));var Hn=am,Rx=lm,Jle=Px,Yle=Tx,Xle=Vle,Zle=um,Qle=typeof self=="object"?self:typeof global=="object"?global:{},eue=Qle,_l;(function(r){r[r.Windows=1]="Windows",r[r.Macintosh=2]="Macintosh",r[r.Linux=3]="Linux"})(_l||(_l={}));var tue=lm?2:am?1:3;var pPe=j()("util-index"),Gi="coc-settings.json";function He(r){return new Promise(e=>{setTimeout(()=>{e(void 0)},r)})}function uq(r,e,t,i){return r?(Hn&&!i&&!r.startsWith("jdt://")&&(r=kx.default.win32.normalize(r)),kx.default.isAbsolute(r)?$.file(r).toString():aq.default.isValid(r)?$.parse(r).toString():t!=""?`${t}:${e}`:`unknown:${e}`):`untitled:${e}`}function z(r){for(;r.length;){let e=r.pop();e&&e.dispose()}}function gf(r){try{lq.default.sync(r)}catch(e){return!1}return!0}function hn(r,e={},t){return Hn||(e.shell=e.shell||process.env.SHELL),e.maxBuffer=500*1024,new Promise((i,n)=>{let o;t&&(o=setTimeout(()=>{n(new Error(`timeout after ${t}s`))},t*1e3)),nq.exec(r,e,(s,a,l)=>{if(o&&clearTimeout(o),s){n(new Error(`exited with ${s.code}
|
||
${s}
|
||
${l}`));return}i(a)})})}function Pl(r,e){let t=oq.default(e,100);try{let i=sq.default.watch(r,{persistent:!0,recursive:!1,encoding:"utf8"},()=>{t()});return Ix.Disposable.create(()=>{t.clear(),i.close()})}catch(i){return Ix.Disposable.create(()=>{t.clear()})}}function cq(r){try{return process.kill(r,0)==!0}catch(e){return e.code==="EPERM"}}function Fx(r){return r=="n"||r=="o"||r=="x"||r=="v"?"<C-U>":r=="i"?"<C-o>":r=="s"?"<Esc>":""}function vf(r,e,t=3){if(r.length==0)return Promise.resolve();let i=0,n=r.length,o=r.slice();return new Promise(s=>{let a=l=>{let u=()=>{if(i=i+1,i==n)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 rue=Object.prototype.hasOwnProperty;function Tl(r){return typeof r=="boolean"}function bt(r){return typeof r=="string"}function cm(r){return typeof r=="number"}function Lo(r){return typeof r=="function"}function wt(r){return r!=null&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}function fm(r){if(!wt(r))return!1;for(let e in r)if(rue.call(r,e))return!1;return!0}function zn(r){if(!r||typeof r!="object"||r instanceof RegExp)return r;let e=Array.isArray(r)?[]:{};return Object.keys(r).forEach(t=>{r[t]&&typeof r[t]=="object"?e[t]=zn(r[t]):e[t]=r[t]}),e}var iue=Object.prototype.hasOwnProperty;function fq(r){if(!r||typeof r!="object")return r;let e=[r];for(;e.length>0;){let t=e.shift();Object.freeze(t);for(let i in t)if(iue.call(t,i)){let n=t[i];typeof n=="object"&&!Object.isFrozen(n)&&e.push(n)}}return r}function Ax(r,e,t=!0){return wt(r)?(wt(e)&&Object.keys(e).forEach(i=>{i in r?t&&(wt(r[i])&&wt(e[i])?Ax(r[i],e[i],t):r[i]=e[i]):r[i]=e[i]}),r):e}function Ne(r,e){if(r===e)return!0;if(r==null||e===null||e===void 0||typeof r!=typeof e||typeof r!="object"||Array.isArray(r)!==Array.isArray(e))return!1;let t,i;if(Array.isArray(r)){if(r.length!==e.length)return!1;for(t=0;t<r.length;t++)if(!Ne(r[t],e[t]))return!1}else{let n=[];for(i in r)n.push(i);n.sort();let o=[];for(i in e)o.push(i);if(o.sort(),!Ne(n,o))return!1;for(t=0;t<n.length;t++)if(!Ne(r[n[t]],e[n[t]]))return!1}return!0}var pq=j()("events"),dq=class{constructor(){this.handlers=new Map;this.insertMode=!1}get cursor(){return this._cursor}async fire(e,t){let i=this.handlers.get(e);if(e=="InsertEnter"?this.insertMode=!0:e=="InsertLeave"?this.insertMode=!1:!this.insertMode&&(e=="CursorHoldI"||e=="CursorMovedI")?(this.insertMode=!0,await this.fire("InsertEnter",[t[0]])):this.insertMode&&(e=="CursorHold"||e=="CursorMoved")&&(this.insertMode=!1,await this.fire("InsertLeave",[t[0]])),e=="CursorMoved"||e=="CursorMovedI"){let n={bufnr:t[0],lnum:t[1][0],col:t[1][1],insert:e=="CursorMovedI"};if(this._cursor&&Ne(this._cursor,n))return;this._cursor=n}if(i)try{await Promise.all(i.map(n=>n(t)))}catch(n){n.message&&n.message.indexOf("transport disconnected")==-1&&console.error(`Error on ${e}: ${n.message}${n.stack?`
|
||
`+n.stack:""} `),pq.error(`Handler Error on ${e}`,n.stack)}}on(e,t,i,n){if(Array.isArray(e)){let o=n||[];for(let s of e)this.on(s,t,i,o);return Ox.Disposable.create(()=>{z(o)})}else{let o=this.handlers.get(e)||[],s=Error().stack,a=u=>new Promise((c,f)=>{let p;try{Promise.resolve(t.apply(i||null,u)).then(()=>{p&&clearTimeout(p),c(void 0)},d=>{p&&clearTimeout(p),f(d)}),p=setTimeout(()=>{pq.warn(`Handler of ${e} blocked more than 2s:`,s)},2e3)}catch(d){f(d)}});o.push(a),this.handlers.set(e,o);let l=Ox.Disposable.create(()=>{let u=o.indexOf(a);u!==-1&&o.splice(u,1)});return n&&n.push(l),l}}},A=new dq;var bJ=S(require("events")),wJ=S(require("path")),AP=S(require("fs")),xd=S(W());var Wv=S(W());var Xj=S(Gr()),Zj=S(Pf()),dt=S(W());var LB=S(Gr()),Lm=S(W());var hD=S(x$());var bB=S(uB());var wr=S(hB());function mB(r){return`${wr.default.gray.open}${r}${wr.default.gray.close}`}function lD(r){return`${wr.default.magenta.open}${r}${wr.default.magenta.close}`}function gB(r){return`${wr.default.bold.open}${r}${wr.default.bold.close}`}function Am(r){return`${wr.default.underline.open}${r}${wr.default.underline.close}`}function vB(r){return`${wr.default.italic.open}${r}${wr.default.italic.close}`}function yB(r){return`${wr.default.yellow.open}${r}${wr.default.yellow.close}`}function uD(r){return`${wr.default.blue.open}${r}${wr.default.blue.close}`}var HTe=j()("markdown-renderer"),wB="^*||*^",cD="*|*|*|*",wpe=new RegExp(xB(cD),"g"),DB="*#COLON|*",xpe=new RegExp(xB(DB),"g"),Dpe=[" "],Spe="\r",SB={code:Ki,blockquote:Ki,html:mB,heading:lD,firstHeading:lD,hr:Ki,listitem:Ki,list:Epe,table:Ki,paragraph:Ki,strong:gB,em:vB,codespan:yB,del:Am,link:Am,href:Am,text:Ki,unescape:!0,emoji:!1,width:80,showSectionPrefix:!0,tab:2,tableOptions:{}};function EB(r,e){return e?r.replace(Spe,/\n/g):r}function _pe(r,e){return typeof r=="number"?new Array(r+1).join(" "):typeof r=="string"&&Cpe(r)?r:new Array(e+1).join(" ")}function Cpe(r){return Dpe.some(function(e){return r.match("^("+e+")+$")})}function Ppe(r,e){return e.replace(/(^|\n)(.+)/g,"$1"+r+"$2")}function Tpe(r,e){return e&&r+e.split(`
|
||
`).join(`
|
||
`+r)}var Rpe="\\*",kpe="\\d+\\.",CB="(?:"+[Rpe,kpe].join("|")+")";function Ipe(r,e){let t=new RegExp("(\\S(?: | )?)((?:"+e+")+)("+CB+"(?:.*)+)$","gm");return r.replace(t,`$1
|
||
`+e+"$2$3")}var _B=function(r,e){return r.match("^(?:"+e+")*"+CB)};function PB(r){return" ".repeat(r.length)}var fD="* ";function Fpe(r,e){return _B(e,r)?e:PB(fD)+e}function Ape(r,e){let t=Fpe.bind(null,e);return r.split(`
|
||
`).filter(Ki).map(t).join(`
|
||
`)}var TB=function(r){return r+". "};function Ope(r,e,t){return _B(e,r)?{num:t+1,line:e.replace(fD,TB(t+1))}:{num:t,line:PB(TB(t))+e}}function Lpe(r,e){let t=Ope.bind(null,e),i=0;return r.split(`
|
||
`).filter(Ki).map(n=>{let o=t(n,i);return i=o.num,o.line}).join(`
|
||
`)}function Epe(r,e,t){return r=r.trim(),r=e?Lpe(r,t):Ape(r,t),r}function Lf(r){return r+`
|
||
|
||
`}function Mpe(r){return r.replace(xpe,":")}function RB(r,e=null){if(!r)return[];e=e||Ki;let t=e(r).split(`
|
||
`),i=[];return t.forEach(function(n){if(!n)return;let o=n.replace(wpe,"").split(wB);i.push(o.splice(0,o.length-1))}),i}function xB(r){return r.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}function Npe(r){return r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function Ki(r){return r}var pD=new Map,kB=class{constructor(e={},t={}){this.options=e;this.highlightOptions=t;this.o=Object.assign({},SB,e),this.tab=_pe(this.o.tab,SB.tab),this.tableSettings=this.o.tableOptions,this.unescape=this.o.unescape?Npe:Ki,this.highlightOptions=t||{},this.transform=this.compose(Mpe,this.unescape)}textLength(e){return e.replace(/\u001b\[(?:\d{1,3})(?:;\d{1,3})*m/g,"").length}text(e){return this.o.text(e)}code(e,t,i){return"``` "+t+`
|
||
`+e+"\n```\n"}blockquote(e){return Lf(this.o.blockquote(Tpe(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,Lf(t===1?this.o.firstHeading(e):this.o.heading(e))}hr(){return`---
|
||
|
||
`}list(e,t){return e=this.o.list(e,t,this.tab),Lf(Ipe(Ppe(this.tab,e),this.tab))}listitem(e){let t=this.compose(this.o.listitem,this.transform);return e.indexOf(`
|
||
`)!==-1&&(e=e.trim()),`
|
||
`+fD+t(e)}checkbox(e){return"["+(e?"X":" ")+"] "}paragraph(e){return e=this.compose(this.o.paragraph,this.transform)(e),Lf(e)}table(e,t){let i=new bB.default(Object.assign({},{head:RB(e)[0]},this.tableSettings));return RB(t,this.transform).forEach(function(n){i.push(n)}),Lf(this.o.table(i.toString()))}tablerow(e){return cD+e+cD+`
|
||
`}tablecell(e,t){return e+wB}strong(e){return this.o.strong(e)}em(e){return e=EB(e,this.o.reflowText),this.o.em(e)}codespan(e){return e=EB(e,this.o.reflowText),this.o.codespan(e.replace(/:/g,DB))}br(){return`
|
||
`}del(e){return this.o.del(e)}link(e,t,i){let n;if(this.options.sanitize){try{n=decodeURIComponent(unescape(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(s){return""}if(n.startsWith("javascript:"))return""}if(i&&e&&i!=e&&pD.set(i,e),i&&i!=e)return uD(i);let o=this.o.href(e);return this.o.link(o)}image(e,t,i){if(typeof this.o.image=="function")return this.o.image(e,t,i);let n="!["+i;return t&&(n+=" \u2013 "+t),n+"]("+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 pD.entries())e.push(`${uD(t)}: ${i}`);return pD.clear(),e}},dD=kB;function ue(r){return Buffer.byteLength(r)}function Ml(r){return r?r[0].toUpperCase()+r.slice(1):""}function Vr(r,e){let t=r.slice(0,e);return Buffer.byteLength(t)}function Mf(r,e){return Buffer.from(r,"utf8").slice(0,e).toString("utf8").length}function Rt(r,e,t){return Buffer.from(r,"utf8").slice(e,t).toString("utf8")}function IB(r){let e=r.charCodeAt(0);return e>128?!1:e==95||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}var FB={30:"black",31:"red",32:"green",33:"yellow",34:"blue",35:"magenta",36:"cyan",37:"white",90:"grey"},AB={40:"black",41:"red",42:"green",43:"yellow",44:"blue",45:"magenta",46:"cyan",47:"white"},OB={1:"bold",3:"italic",4:"underline"};function Nl(r,e=!1){let t=Nf(r),i=[],n="";for(let o of t){if(!o.text)continue;let{foreground:s,background:a,bold:l,italic:u,underline:c}=o,f=ue(n);if(s||a||l||u||c){let p=[f,f+ue(o.text)],d="";s&&a?d=`CocList${Ml(s)}${Ml(a)}`:s?e?s=="yellow"?d="CocMarkdownCode":s=="blue"?d="CocMarkdownLink":s=="magenta"?d="CocMarkdownHeader":d=`CocListFg${Ml(s)}`:d=`CocListFg${Ml(s)}`:a?d=`CocListBg${Ml(a)}`:l?d="CocBold":u?d="CocItalic":c&&(d="CocUnderline"),i.push({span:p,hlGroup:d})}n=n+o.text}return{line:n,highlights:i}}function Nf(r){let e=null,t=null,i="",n=[],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<r.length;l++){if(e!=null){e==""&&r[l]=="["?(i&&(s.text=i,o.push(s),s={},i=""),i==""&&(r[l+1]=="m"||r[l+1]=="K")&&((s.foreground||s.background)&&(s.text="",o.push(s)),s={}),e=null,t=""):(i+=e+r[l],e=null);continue}else if(t!=null){r[l]==";"?(n.push(t),t=""):r[l]=="m"||r[l]=="K"?(n.push(t),t=null,i="",n.forEach(u=>{FB[u]?s.foreground=FB[u]:AB[u]?s.background=AB[u]:u==39?delete s.foreground:u==49?delete s.background:OB[u]?s[OB[u]]=!0:u==22?s.bold=!1:u==23?s.italic=!1:u==24&&(s.underline=!1)}),n=[]):t+=r[l];continue}r[l]==""?e=r[l]:r[l]=="\b"?a():i+=r[l]}return i&&(s.text=i+(e||""),o.push(s)),o}var qpe=["Error","Warning","Info","Hint"],ZTe=j()("markdown-index");hD.default.setOptions({renderer:new dD});function Om(r){let e=[],t=[],i=[],n=0;for(let o of r){let s=e.length,{content:a,filetype:l}=o;if(l=="markdown"){let u=Bpe(a);i.push(...u.codes.map(c=>(c.startLine=c.startLine+s,c.endLine=c.endLine+s,c))),t.push(...u.highlights.map(c=>(c.lnum=c.lnum+s,c))),e.push(...u.lines)}else{let u=a.trim().split(/\r?\n/);qpe.includes(o.filetype)?i.push({hlGroup:`Coc${l}Float`,startLine:s,endLine:s+u.length}):i.push({filetype:o.filetype,startLine:s,endLine:s+u.length}),e.push(...u)}if(o.active){let u=$pe(a,s,o.active);u.length&&t.push(...u)}n!=r.length-1&&e.push("\u2014"),n=n+1}return{lines:e,highlights:t,codes:i}}function $pe(r,e,t){let i=[],[n,o]=t,s=r.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 f=ue(c.slice(0,o-a));i.push({colStart:0,colEnd:f,lnum:u+e,hlGroup:"CocUnderline"}),l=!1;break}else{let f=ue(c);i.push({colStart:0,colEnd:f,lnum:u+e,hlGroup:"CocUnderline"})}else if(a+c.length>n){l=!0;let f=ue(c.slice(0,n-a));if(a+c.length>o){let p=ue(c.slice(0,o-a));l=!1,i.push({colStart:f,colEnd:p,lnum:u+e,hlGroup:"CocUnderline"});break}else{let p=ue(c);i.push({colStart:f,colEnd:p,lnum:u+e,hlGroup:"CocUnderline"})}}a=a+c.length+1}return i}function Bpe(r){let e=[],t=[],i=[],n=0,o=!1,s,a=0,l=hD.default(r),u=dD.getLinks();u.length&&(l=l+`
|
||
|
||
`+u.join(`
|
||
`));for(let c of l.replace(/\s*$/,"").split(/\n/)){if(!c.length){let p=e[e.length-1];p&&p.length&&(e.push(c),n++);continue}if(/\s*```\s*([A-Za-z0-9_,]+)?$/.test(c)){let p=e[e.length-1];o?(o=!1,i.push({filetype:s,startLine:a,endLine:n})):(o=!0,s=c.replace(/^\s*```\s*/,""),s=="js"&&(s="javascript"),s=="ts"&&(s="typescript"),s=="bash"&&(s="sh"),a=n),p&&p.length&&(e.push(""),n++);continue}if(o){e.push(c),n++;continue}let f=Nl(c,!0);if(f.highlights)for(let p of f.highlights){let{hlGroup:d,span:h}=p;t.push({hlGroup:d,lnum:n,colStart:h[0],colEnd:h[1]})}e.push(f.line),n++}return{lines:e,highlights:t,codes:i}}var ar=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 MB=process.env.VIM_NODE_RPC=="1",NB=j()("model-float"),mD=class{constructor(e){this.nvim=e;this.winid=0;this._bufnr=0;this.mutex=new ar;this.disposables=[];this.alignTop=!1;this.pumAlignTop=!1;this.autoHide=!0;this.mutex=new ar,A.on("BufEnter",t=>{t==this._bufnr||t==this.targetBufnr||this.close()},null,this.disposables),A.on("InsertEnter",t=>{t==this._bufnr||!this.autoHide||this.close()},null,this.disposables),A.on("InsertLeave",()=>{this.close()},null,this.disposables),A.on("MenuPopupChanged",(t,i)=>{(this.pumAlignTop=i>t.row)==this.alignTop&&this.close()},null,this.disposables),this.onCursorMoved=LB.default(this._onCursorMoved.bind(this),300),A.on("CursorMoved",this.onCursorMoved.bind(this,!1),null,this.disposables),A.on("CursorMovedI",this.onCursorMoved.bind(this,!0),null,this.disposables),this.disposables.push(Lm.Disposable.create(()=>{this.onCursorMoved.clear(),this.cancel()}))}_onCursorMoved(e,t,i){if(t!=this._bufnr&&!(t==this.targetBufnr&&Ne(i,this.cursor))){if(this.autoHide){this.close();return}if(!e||t!=this.targetBufnr){this.close();return}}}async create(e,t=!1,i=0){if(this.onCursorMoved.clear(),e.length==0||e.every(o=>o.content.length==0)){this.close();return}let n=await this.mutex.acquire();try{await this.createPopup(e,{offsetX:i}),n()}catch(o){n(),NB.error("Error on create popup:",o.message),this.close()}}async show(e,t={}){if(this.onCursorMoved.clear(),e.length==0||e.every(n=>n.content.length==0)){this.close();return}let i=await this.mutex.acquire();try{await this.createPopup(e,t),i()}catch(n){i(),NB.error("Error on create popup:",n.message),this.close()}}async createPopup(e,t){let n=(this.tokenSource=new Lm.CancellationTokenSource).token;e=e.filter(m=>m.content.trim().length>0);let{lines:o,codes:s,highlights:a}=Om(e),l={pumAlignTop:this.pumAlignTop,preferTop:typeof t.preferTop=="boolean"?t.preferTop:!1,offsetX:t.offsetX||0,title:t.title||"",close:t.close?1:0,codes:s,highlights:a,modes:t.modes||["n","i","ic","s"]};t.maxHeight&&(l.maxHeight=t.maxHeight),t.maxWidth&&(l.maxWidth=t.maxWidth),t.border&&!t.border.every(m=>m==0)&&(l.border=t.border),t.title&&!l.border&&(l.border=[1,1,1,1]),t.highlight&&(l.highlight=t.highlight),t.borderhighlight&&(l.borderhighlight=[t.borderhighlight]),t.cursorline&&(l.cursorline=1),this.autoHide=t.autoHide!=!1,this.autoHide&&(l.autohide=1);let u=await this.nvim.call("coc#float#create_cursor_float",[this.winid,this._bufnr,o,l]);if(MB&&this.nvim.command("redraw",!0),!u||u.length==0){this.winid=null;return}let[c,f,p,d]=u;if(this.winid=p,n.isCancellationRequested){this.close();return}let h=await this.nvim.call("coc#float#cursor_relative",[p]);h&&(this.alignTop=h.row<0),this._bufnr=d,this.tokenSource.dispose(),this.tokenSource=null,this.targetBufnr=c,this.cursor=f,this.onCursorMoved.clear()}close(){let{winid:e,nvim:t}=this;this.cancel(),e&&(this.winid=0,t.pauseNotification(),t.call("coc#float#close",[e],!0),MB&&this.nvim.command("redraw",!0),t.resumeNotification(!1,!0))}cancel(){let{tokenSource:e}=this;e&&(e.cancel(),this.tokenSource=null)}dispose(){z(this.disposables)}get bufnr(){return this._bufnr}get buffer(){return this.bufnr?this.nvim.createBuffer(this.bufnr):null}get window(){return this.winid?this.nvim.createWindow(this.winid):null}async activated(){return this.winid?await this.nvim.call("coc#float#valid",[this.winid])!=0:!1}},mn=mD;function Ji(r,e){return Wt(r.start,e)===0&&Wt(r.end,e)===0}function Mm(r,e){let{start:t,end:i}=r;return!(Me(i,e.start)<=0||Me(t,e.end)>=0)}function ql(r,e){return!!(Wt(r.start,e)==0||Wt(r.end,e)==0||Ji(e,r))}function qB(r,e){let{start:t,end:i}=e;return r>=t.line&&r<=i.line}function Gn(r){let{start:e,end:t}=r;return e.line==t.line&&e.character==t.character}function Wt(r,e){let{start:t,end:i}=e;return Me(r,t)<0?-1:Me(r,i)>0?1:0}function Me(r,e){return r.line>e.line||e.line==r.line&&r.character>e.character?1:e.line==r.line&&r.character==e.character?0:-1}function jpe(r){return r.start.line==r.end.line}function gD(r,e){let{range:t,newText:i}=e;if(Me(t.end,r)<=0){let n=i.split(`
|
||
`),o=n.length-(t.end.line-t.start.line)-1,s=0;if(t.end.line==r.line){let a=jpe(t)&&o==0,l=a?t.end.character-t.start.character:t.end.character;s=(a?i.length:n[n.length-1].length)-l}return{line:o,character:s}}return{line:0,character:0}}function $B(r,e){let{range:t,newText:i}=e;if(Me(t.start,r)>1)return r;let{start:n,end:o}=t,s=i.split(`
|
||
`),a=o.line-n.line-s.length+1,l=s[s.length-1],u=r.line-a;if(r.line!=o.line)return{line:u,character:r.character};let c=s.length==1&&n.line!=o.line?n.character:0,f=n.line==o.line&&s.length==1?o.character-n.character:o.character,p=c+r.character+l.length-f;return{line:u,character:p}}function BB(r,e,t){let i=0;for(let n=0;n<=e;n++)n==e?i+=t:i+=r[n].length+1;return i}function jB(r,e,t){if(!Ji(t.range,r))return e;let{start:i,end:n}=t.range,o=e.split(`
|
||
`),s=i.line==r.start.line?i.character-r.start.character:i.character,a=BB(o,i.line-r.start.line,s);s=n.line==r.start.line?n.character-r.start.character:n.character;let l=BB(o,n.line-r.start.line,s);return`${e.slice(0,a)}${t.newText}${e.slice(l,e.length)}`}function $l(r,e){let t={line:0,character:0};for(let i of e){let n=gD(r,i);t={line:t.line+n.line,character:t.character+n.character}}return t.line==0&&t.character==0?null:t}var x0=S(require("fs")),Wj=S(require("os")),D0=S(require("path")),Hj=S(W());var uRe=j()("outpubChannel"),vD=class{constructor(e,t){this.name=e;this.nvim=t;this._disposed=!1;this.lines=[""];this.disposables=[]}get content(){return this.lines.join(`
|
||
`)}_append(e){let{nvim:t}=this,i=this.lines.length-1,n=e.split(/\r?\n/),o=this.lines[i]+n[0];this.lines[i]=o;let s=n.slice(1);this.lines=this.lines.concat(s),t.pauseNotification(),t.call("setbufline",[this.bufname,"$",o],!0),s.length&&t.call("appendbufline",[this.bufname,"$",s],!0),t.resumeNotification(!1,!0)}append(e){!this.validate()||this._append(e)}appendLine(e){!this.validate()||this._append(e+`
|
||
`)}clear(e){if(!this.validate())return;let{nvim:t}=this;this.lines=e?this.lines.slice(-e):[],t.pauseNotification(),t.call("deletebufline",[this.bufname,1,"$"],!0),this.lines.length&&t.call("appendbufline",[this.bufname,"$",this.lines],!0),t.resumeNotification(!1,!0)}hide(){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.command("redraw",!0),t.resumeNotification(!1,!0)}validate(){return!this._disposed}dispose(){this._disposed||(this._disposed=!0,this.hide(),this.lines=[],z(this.disposables))}},UB=vD;var No=new Map,WB=class{getProvider(e){return{onDidChange:null,provideTextDocumentContent:async i=>{let n=this.get(i.path.slice(1));return n?(e.pauseNotification(),e.command("setlocal nospell nofoldenable nowrap noswapfile",!0),e.command("setlocal buftype=nofile bufhidden=hide",!0),e.command("setfiletype log",!0),await e.resumeNotification(),n.content):""}}}get names(){return Array.from(No.keys())}get(e){return No.get(e)}create(e,t){if(No.has(e))return No.get(e);if(!/^[\w\s-.]+$/.test(e))throw new Error(`Invalid channel name "${e}", only word characters and white space allowed.`);let i=new UB(e,t);return No.set(e,i),i}show(e,t){let i=No.get(e);!i||i.show(t)}dispose(){for(let e of No.values())e.dispose();No.clear()}},Xs=new WB;var mRe=j()("model-dialog"),yD=class{constructor(e,t){this.nvim=e;this.config=t;this.disposables=[];A.on("BufWinLeave",i=>{i==this.bufnr&&(this.dispose(),t.callback&&t.callback(-1))},null,this.disposables),A.on("FloatBtnClick",(i,n)=>{if(i==this.bufnr){this.dispose();let o=t==null?void 0:t.buttons.filter(s=>s.disabled!=!0);t.callback&&t.callback(o[n].index)}},null,this.disposables)}get lines(){return[...this.config.content.split(/\r?\n/)]}async show(e){let{nvim:t}=this,{title:i,close:n,buttons:o}=this.config,s=this.config.borderhighlight||e.floatBorderHighlight,a=this.config.highlight||e.floatHighlight,l={maxwidth:e.maxWidth||80};i&&(l.title=i),(n||typeof n=="undefined")&&(l.close=1),e.maxHeight&&(l.maxHeight=e.maxHeight),e.maxWidth&&(l.maxWidth=e.maxWidth),a&&(l.highlight=a),s&&(l.borderhighlight=[s]),o&&(l.buttons=o.filter(c=>!c.disabled).map(c=>c.text));let u=await t.call("coc#float#create_dialog",[this.lines,l]);!u[1]||(this.bufnr=u[1],t.command("redraw",!0))}get winid(){return this.bufnr?this.nvim.call("bufwinid",[this.bufnr]):Promise.resolve(null)}dispose(){this.bufnr=void 0,z(this.disposables),this.disposables=[]}},HB=yD;var zB=S(W());var Nm=process.env.VIM_NODE_RPC=="1",bD=class{constructor(e,t,i){this.nvim=e;this.winid=t;this.bufnr=i}get valid(){return this.nvim.call("coc#float#valid",[this.winid]).then(e=>!!e)}close(){this.nvim.call("coc#float#close",[this.winid],!0)}refreshScrollbar(){Nm||this.nvim.call("coc#float#nvim_scrollbar",[this.winid],!0)}execute(e){this.nvim.call("coc#float#execute",[this.winid,e],!0)}click(e,t){let{nvim:i}=this;i.call("win_gotoid",[this.winid],!0),i.call("cursor",[e,t],!0),i.call("coc#float#nvim_float_click",[],!0)}async scrollForward(){let{nvim:e,bufnr:t,winid:i}=this,o=await e.createBuffer(t).length,s;if(Nm)s=await e.eval(`get(popup_getpos(${i}), 'lastline', 0)`);else{let a=await e.call("getwininfo",[i]);if(!a||!a.length)return;s=a[0].botline}s>=o||s==0||(e.pauseNotification(),this.setCursor(s-1),this.execute(`normal! ${s}Gzt`),this.refreshScrollbar(),e.command("redraw",!0),e.resumeNotification(!1,!0))}async scrollBackward(){let{nvim:e,winid:t}=this,i;if(Nm)i=await e.eval(`get(popup_getpos(${t}), 'firstline', 0)`);else{let n=await e.call("getwininfo",[t]);if(!n||!n.length)return;i=n[0].topline}i!=1&&(e.pauseNotification(),this.setCursor(i-1),this.execute(`normal! ${i}Gzb`),this.refreshScrollbar(),e.command("redraw",!0),e.resumeNotification(!1,!0))}setCursor(e){let{nvim:t,bufnr:i,winid:n}=this;Nm?t.call("win_execute",[n,`exe ${e+1}`],!0):(t.createWindow(n).notify("nvim_win_set_cursor",[[e+1,0]]),t.command(`sign unplace 6 buffer=${i}`,!0),t.command(`sign place 6 line=${e+1} name=CocCurrentLine buffer=${i}`,!0))}},qm=bD;var Upe=j()("model-menu"),wD=class{constructor(e,t,i){this.nvim=e;this.config=t;this.currIndex=0;this.disposables=[];this.keyMappings=new Map;this._onDidClose=new zB.Emitter;this.onDidClose=this._onDidClose.event;this.total=t.items.length,i&&i.onCancellationRequested(()=>{var n;(n=this.win)==null||n.close()}),this.disposables.push(this._onDidClose),this.addKeymappings()}attachEvents(){A.on("InputChar",this.onInputChar.bind(this),null,this.disposables),A.on("BufWinLeave",e=>{e==this.bufnr&&(this._onDidClose.fire(-1),this.bufnr=void 0,this.win=void 0,this.dispose())},null,this.disposables)}addKeymappings(){let{nvim:e}=this;this.addKeys(["<esc>","<C-c>"],()=>{this._onDidClose.fire(-1),this.dispose()}),this.addKeys(["\r","<cr>"],()=>{this._onDidClose.fire(this.currIndex),this.dispose()});let t=o=>{var s;!this.win||(e.pauseNotification(),this.setCursor(o),(s=this.win)==null||s.refreshScrollbar(),e.command("redraw",!0),e.resumeNotification(!1,!0))};this.addKeys("<C-f>",async()=>{var o;await((o=this.win)==null?void 0:o.scrollForward())}),this.addKeys("<C-b>",async()=>{var o;await((o=this.win)==null?void 0:o.scrollBackward())}),this.addKeys(["j","<down>","<tab>","<C-n>"],()=>{let o=this.currIndex==this.total-1?0:this.currIndex+1;t(o)}),this.addKeys(["k","<up>","<s-tab>","<C-p>"],()=>{let o=this.currIndex==0?this.total-1:this.currIndex-1;t(o)}),this.addKeys(["g"],()=>{t(0)}),this.addKeys(["G"],()=>{t(this.total-1)});let i,n;this.addKeys(["0","1","2","3","4","5","6","7","8","9"],o=>{i&&clearTimeout(i);let s=parseInt(o,10);if(!(isNaN(s)||s>this.total)&&!(n==null&&s==0)){if(n){let a=n*10+s;n=void 0,this._onDidClose.fire(a-1),this.dispose();return}if(this.total<10||s*10>this.total){this._onDidClose.fire(s-1),this.dispose();return}i=setTimeout(async()=>{this._onDidClose.fire(s-1),this.dispose()},200),n=s}})}async show(e={}){let{nvim:t}=this,{title:i,items:n}=this.config,o={};i&&(o.title=i),e.maxHeight&&(o.maxHeight=e.maxHeight),e.maxWidth&&(o.maxWidth=e.maxWidth),e.floatHighlight&&(o.highlight=e.floatHighlight),e.floatBorderHighlight&&(o.borderhighlight=[e.floatBorderHighlight]);let s=n.map((l,u)=>u<99?`${u+1}. ${l}`:l);e.confirmKey&&e.confirmKey!="<cr>"&&this.addKeys(e.confirmKey,()=>{this._onDidClose.fire(this.currIndex),this.dispose()});let a=await t.call("coc#float#create_menu",[s,o]);return this.win=new qm(t,a[0],a[1]),this.bufnr=a[1],this.attachEvents(),t.call("coc#prompt#start_prompt",["menu"],!0),a[0]}get buffer(){return this.bufnr?this.nvim.createBuffer(this.bufnr):void 0}dispose(){var e;z(this.disposables),this.disposables=[],this.nvim.call("coc#prompt#stop_prompt",["menu"],!0),(e=this.win)==null||e.close(),this.win=void 0}async onInputChar(e,t){if(e!="menu"||!this.win)return;let i=this.keyMappings.get(t);i?await Promise.resolve(i(t)):Upe.warn(`Ignored key press: ${t}`)}setCursor(e){!this.win||(this.currIndex=e,this.win.setCursor(e))}addKeys(e,t){if(Array.isArray(e))for(let i of e)this.keyMappings.set(i,t);else this.keyMappings.set(e,t)}},GB=wD;var VB=process.env.VIM_NODE_RPC=="1",PRe=j()("model-notification"),xD=class{constructor(e,t,i=!0){this.nvim=e;this.config=t;this.disposables=[];this._disposed=!1;i&&(A.on("BufWinLeave",n=>{n==this.bufnr&&(this.dispose(),t.callback&&t.callback(-1))},null,this.disposables),A.on("FloatBtnClick",(n,o)=>{if(n==this.bufnr){this.dispose();let s=t==null?void 0:t.buttons.filter(a=>a.disabled!=!0);t.callback&&t.callback(s[o].index)}},null,this.disposables))}get lines(){return this.config.content.split(/\r?\n/)}async show(e){let{nvim:t}=this,{title:i,close:n,timeout:o,buttons:s,borderhighlight:a}=this.config,l=Object.assign({},e);l.close=n?1:0,i&&(l.title=i),a&&(l.borderhighlight=a),s&&(l.buttons=s.filter(c=>!c.disabled).map(c=>c.text)),o&&(l.timeout=o);let u=await t.call("coc#float#create_notification",[this.lines,l]);return u?(this._disposed?(this.nvim.call("coc#float#close",[u[0]],!0),VB&&this.nvim.command("redraw",!0)):(this._winid=u[0],this.bufnr=u[1]),this._winid!=null):!1}get winid(){return this._winid}dispose(){if(this._disposed)return;this._disposed=!0;let{winid:e}=this;e&&(this.nvim.call("coc#float#close",[e],!0),VB&&this.nvim.command("redraw",!0)),this.bufnr=void 0,this._winid=void 0,z(this.disposables),this.disposables=[]}},qf=xD;var KB=S(W());var Wpe=j()("model-dialog"),JB=process.env.VIM_NODE_RPC=="1",DD=class{constructor(e,t,i){this.nvim=e;this.config=t;this.picked=new Set;this.currIndex=0;this.disposables=[];this.keyMappings=new Map;this._onDidClose=new KB.Emitter;this.onDidClose=this._onDidClose.event;for(let n=0;n<t.items.length;n++)t.items[n].picked&&this.picked.add(n);this.total=t.items.length,i&&i.onCancellationRequested(()=>{var n;(n=this.win)==null||n.close()}),this.disposables.push(this._onDidClose),this.addKeymappings()}attachEvents(){A.on("InputChar",this.onInputChar.bind(this),null,this.disposables),A.on("BufWinLeave",e=>{e==this.bufnr&&(this._onDidClose.fire(void 0),this.bufnr=void 0,this.win=void 0,this.dispose())},null,this.disposables),A.on("FloatBtnClick",(e,t)=>{if(e==this.bufnr){if(t==0){let i=Array.from(this.picked);this._onDidClose.fire(i.length?i:void 0)}else this._onDidClose.fire(void 0);this.dispose()}},null,this.disposables)}addKeymappings(){let{nvim:e}=this,t=n=>{this.picked.has(n)?this.picked.delete(n):this.picked.add(n)};this.addKeys("<LeftRelease>",async()=>{if(JB||!this.win)return;let[n,o,s]=await e.eval("[v:mouse_winid,v:mouse_lnum,v:mouse_col]");if(global.hasOwnProperty("__TEST__")){let a=await e.getVar("mouse_position");n=a[0],o=a[1],s=a[2]}e.pauseNotification(),n==this.win.winid&&(s<=3?(t(o-1),this.changeLine(o-1)):this.setCursor(o-1)),e.call("win_gotoid",[n],!0),e.call("cursor",[o,s],!0),e.call("coc#float#nvim_float_click",[],!0),e.command("redraw",!0),await e.resumeNotification()}),this.addKeys(["<esc>","<C-c>"],()=>{this._onDidClose.fire(void 0),this.dispose()}),this.addKeys("<cr>",()=>{if(this.picked.size==0)this._onDidClose.fire(void 0);else{let n=Array.from(this.picked);this._onDidClose.fire(n)}this.dispose()});let i=n=>{e.pauseNotification(),this.setCursor(n),this.win.refreshScrollbar(),e.command("redraw",!0),e.resumeNotification(!1,!0)};this.addKeys(["j","<down>","<tab>","<C-n>"],()=>{let n=this.currIndex==this.total-1?0:this.currIndex+1;i(n)}),this.addKeys(["k","<up>","<s-tab>","<C-p>"],()=>{let n=this.currIndex==0?this.total-1:this.currIndex-1;i(n)}),this.addKeys(["g"],()=>{i(0)}),this.addKeys(["G"],()=>{i(this.total-1)}),this.addKeys(" ",async()=>{let n=this.currIndex;t(n),e.pauseNotification(),this.changeLine(n),this.currIndex!=this.total-1&&this.setCursor(this.currIndex+1),e.command("redraw",!0),await e.resumeNotification()}),this.addKeys("<C-f>",async()=>{var n;await((n=this.win)==null?void 0:n.scrollForward())}),this.addKeys("<C-b>",async()=>{var n;await((n=this.win)==null?void 0:n.scrollBackward())})}async show(e={}){let{nvim:t}=this,{title:i,items:n}=this.config,o={close:1,cursorline:1};if(e.maxHeight&&(o.maxHeight=e.maxHeight),e.maxWidth&&(o.maxWidth=e.maxWidth),i&&(o.title=i),o.close=1,o.cursorline=1,e.floatHighlight&&(o.highlight=e.floatHighlight),e.floatBorderHighlight&&(o.borderhighlight=[e.floatBorderHighlight]),e.pickerButtons){let c=e.pickerButtonShortcut;o.buttons=["Submit"+(c?" <cr>":""),"Cancel"+(c?" <esc>":"")]}e.confirmKey&&e.confirmKey!="<cr>"&&this.addKeys(e.confirmKey,()=>{this._onDidClose.fire(void 0),this.dispose()});let s=[],a=[];for(let c=0;c<n.length;c++){let f=n[c],p=`[${f.picked?"x":" "}] ${f.label}`;a.push([c,ue(p)]),f.description&&(p=p+` ${f.description}`),s.push(p)}let l=await t.call("coc#float#create_dialog",[s,o]);this.win=new qm(t,l[0],l[1]),this.bufnr=l[1],this.attachEvents();let u=t.createBuffer(this.bufnr);t.pauseNotification();for(let c of a)u.addHighlight({hlGroup:"Comment",line:c[0],srcId:1,colStart:c[1],colEnd:-1});return t.command("redraw",!0),t.resumeNotification(!1,!0),t.call("coc#prompt#start_prompt",["picker"],!0),l[0]}get buffer(){return this.bufnr?this.nvim.createBuffer(this.bufnr):void 0}dispose(){var e;z(this.disposables),this.disposables=[],this.nvim.call("coc#prompt#stop_prompt",["picker"],!0),(e=this.win)==null||e.close(),this.win=void 0}async onInputChar(e,t){if(e!="picker"||!this.win)return;let i=this.keyMappings.get(t);i?await Promise.resolve(i(t)):Wpe.warn(`Ignored key press: ${t}`)}changeLine(e){let{nvim:t}=this,i=this.config.items[e];if(!i)return;let n=`[${this.picked.has(e)?"x":" "}] ${i.label}`,o=ue(n);i.description&&(n=n+` ${i.description}`),t.call("setbufline",[this.bufnr,e+1,n],!0),JB||t.createBuffer(this.bufnr).addHighlight({hlGroup:"Comment",line:e,srcId:1,colStart:o,colEnd:-1})}setCursor(e){!this.win||(this.currIndex=e,this.win.setCursor(e))}addKeys(e,t){if(Array.isArray(e))for(let i of e)this.keyMappings.set(i,t);else this.keyMappings.set(e,t)}},YB=DD;var XB=S(W());var SD=class extends qf{constructor(e,t){super(e,{content:`
|
||
`,close:t.cancellable==!0,title:t.title},!1);this.option=t;A.on("BufWinLeave",i=>{i==this.bufnr&&(this.tokenSource&&this.tokenSource.cancel(),this.dispose())},null,this.disposables)}async show(e){let{task:t}=this.option,i=this.tokenSource=new XB.CancellationTokenSource;this.disposables.push(i);let n=0;return await new Promise((s,a)=>{i.token.onCancellationRequested(()=>{s(void 0)}),super.show(Object.assign({minWidth:e.minProgressWidth||30,progress:1},e)).then(l=>{l||a(new Error("Failed to create float window"))}).catch(a),t({report:l=>{if(!this.bufnr)return;let u="";l.message&&(u+=l.message.replace(/\r?\n/g," ")),l.increment&&(n+=l.increment,u=u+(u.length?` ${n}%`:`${n}%`)),this.nvim.call("setbufline",[this.bufnr,2,u],!0)}},i.token).then(l=>{this._disposed||(setTimeout(()=>{this.dispose()},100),s(l))},l=>{this._disposed||(this.dispose(),l instanceof Error?a(l):s(void 0))})})}dispose(){super.dispose(),this.tokenSource=void 0}},ZB=SD;var QB=S(require("crypto"));function $f(){return QB.default.randomBytes(16)}var e3=[];for(var $m=0;$m<256;++$m)e3[$m]=($m+256).toString(16).substr(1);function Hpe(r,e){var t=e||0,i=e3;return[i[r[t++]],i[r[t++]],i[r[t++]],i[r[t++]],"-",i[r[t++]],i[r[t++]],"-",i[r[t++]],i[r[t++]],"-",i[r[t++]],i[r[t++]],"-",i[r[t++]],i[r[t++]],i[r[t++]],i[r[t++]],i[r[t++]],i[r[t++]]].join("")}var Bm=Hpe;var t3,ED,CD=0,_D=0;function zpe(r,e,t){var i=e&&t||0,n=e||[];r=r||{};var o=r.node||t3,s=r.clockseq!==void 0?r.clockseq:ED;if(o==null||s==null){var a=r.random||(r.rng||$f)();o==null&&(o=t3=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]),s==null&&(s=ED=(a[6]<<8|a[7])&16383)}var l=r.msecs!==void 0?r.msecs:new Date().getTime(),u=r.nsecs!==void 0?r.nsecs:_D+1,c=l-CD+(u-_D)/1e4;if(c<0&&r.clockseq===void 0&&(s=s+1&16383),(c<0||l>CD)&&r.nsecs===void 0&&(u=0),u>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");CD=l,_D=u,ED=s,l+=122192928e5;var f=((l&268435455)*1e4+u)%4294967296;n[i++]=f>>>24&255,n[i++]=f>>>16&255,n[i++]=f>>>8&255,n[i++]=f&255;var p=l/4294967296*1e4&268435455;n[i++]=p>>>8&255,n[i++]=p&255,n[i++]=p>>>24&15|16,n[i++]=p>>>16&255,n[i++]=s>>>8|128,n[i++]=s&255;for(var d=0;d<6;++d)n[i+d]=o[d];return e||Bm(n)}var qo=zpe;function Gpe(r,e,t){var i=e&&t||0;typeof r=="string"&&(e=r==="binary"?new Array(16):null,r=null),r=r||{};var n=r.random||(r.rng||$f)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e)for(var o=0;o<16;++o)e[i+o]=n[o];return e||Bm(n)}var he=Gpe;var YRe=j()("model-status"),PD=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],TD=class{constructor(e){this.nvim=e;this.items=new Map;this.shownIds=new Set;this._text="";this.interval=setInterval(()=>{this.setStatusText().logError()},100)}dispose(){clearInterval(this.interval)}createStatusBarItem(e=0,t=!1){let i=qo(),n={text:"",priority:e,isProgress:t,show:()=>{this.shownIds.add(i)},hide:()=>{this.shownIds.delete(i)},dispose:()=>{this.shownIds.delete(i),this.items.delete(i)}};return this.items.set(i,n),n}getText(){if(this.shownIds.size==0)return"";let e=new Date,t=Math.floor(e.getMilliseconds()/100),i="",n=[];for(let[o,s]of this.items)this.shownIds.has(o)&&n.push(s);n.sort((o,s)=>o.priority-s.priority);for(let o of n)o.isProgress?i=`${i} ${PD[t]} ${o.text}`:i=`${i} ${o.text}`;return i}async setStatusText(){let e=this.getText(),{nvim:t}=this;e!=this._text&&(this._text=e,t.pauseNotification(),this.nvim.setVar("coc_status",e,!0),this.nvim.call("coc#util#do_autocmd",["CocStatusChange"],!0),await t.resumeNotification(!1,!0))}},r3=TD;var Kr;(function(r){r[r.Buffer=0]="Buffer",r[r.LanguageServer=1]="LanguageServer",r[r.Global=2]="Global"})(Kr||(Kr={}));var Jr;(function(r){r[r.Global=0]="Global",r[r.Local=1]="Local",r[r.SingleFile=2]="SingleFile",r[r.Internal=3]="Internal"})(Jr||(Jr={}));var Yr;(function(r){r[r.Native=0]="Native",r[r.Remote=1]="Remote",r[r.Service=2]="Service"})(Yr||(Yr={}));var gn;(function(r){r[r.More=0]="More",r[r.Warning=1]="Warning",r[r.Error=2]="Error"})(gn||(gn={}));var pt;(function(r){r[r.Global=0]="Global",r[r.User=1]="User",r[r.Workspace=2]="Workspace"})(pt||(pt={}));var ye;(function(r){r[r.Initial=0]="Initial",r[r.Starting=1]="Starting",r[r.StartFailed=2]="StartFailed",r[r.Running=3]="Running",r[r.Stopping=4]="Stopping",r[r.Stopped=5]="Stopped"})(ye||(ye={}));var qj=S(o3()),$j=S(Bl()),Dt=S($i()),Qi=S(require("os")),ke=S(require("path"));var le=S(W());var Bj=S(El());var GD=S(require("os")),jo=S(require("fs")),Xi=S(require("path")),VD=S(W());var w3=S(W());"use strict";var m3=function(){function r(e,t,i,n){this._uri=e,this._languageId=t,this._version=i,this._content=n,this._lineOffsets=void 0}return Object.defineProperty(r.prototype,"uri",{get:function(){return this._uri},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"languageId",{get:function(){return this._languageId},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"version",{get:function(){return this._version},enumerable:!0,configurable:!0}),r.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},r.prototype.update=function(e,t){for(var i=0,n=e;i<n.length;i++){var o=n[i];if(r.isIncremental(o)){var s=h3(o.range),a=this.offsetAt(s.start),l=this.offsetAt(s.end);this._content=this._content.substring(0,a)+o.text+this._content.substring(l,this._content.length);var u=Math.max(s.start.line,0),c=Math.max(s.end.line,0),f=this._lineOffsets,p=d3(o.text,!1,a);if(c-u===p.length)for(var d=0,h=p.length;d<h;d++)f[d+u+1]=p[d];else p.length<1e4?f.splice.apply(f,[u+1,c-u].concat(p)):this._lineOffsets=f=f.slice(0,u+1).concat(p,f.slice(c+1));var m=o.text.length-(l-a);if(m!==0)for(var d=u+1+p.length,h=f.length;d<h;d++)f[d]=f[d]+m}else if(r.isFull(o))this._content=o.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received")}this._version=t},r.prototype.getLineOffsets=function(){return this._lineOffsets===void 0&&(this._lineOffsets=d3(this._content,!0)),this._lineOffsets},r.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),i=0,n=t.length;if(n===0)return{line:0,character:e};for(;i<n;){var o=Math.floor((i+n)/2);t[o]>e?n=o:i=o+1}var s=i-1;return{line:s,character:e-t[s]}},r.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],n=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(i+e.character,n),i)},Object.defineProperty(r.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!0,configurable:!0}),r.isIncremental=function(e){var t=e;return t!=null&&typeof t.text=="string"&&t.range!==void 0&&(t.rangeLength===void 0||typeof t.rangeLength=="number")},r.isFull=function(e){var t=e;return t!=null&&typeof t.text=="string"&&t.range===void 0&&t.rangeLength===void 0},r}(),kt;(function(r){function e(n,o,s,a){return new m3(n,o,s,a)}r.create=e;function t(n,o,s){if(n instanceof m3)return n.update(o,s),n;throw new Error("TextDocument.update: document must be created by TextDocument.create")}r.update=t;function i(n,o){for(var s=n.getText(),a=FD(o.map(rde),function(h,m){var y=h.range.start.line-m.range.start.line;return y===0?h.range.start.character-m.range.start.character:y}),l=0,u=[],c=0,f=a;c<f.length;c++){var p=f[c],d=n.offsetAt(p.range.start);if(d<l)throw new Error("Overlapping edit");d>l&&u.push(s.substring(l,d)),p.newText.length&&u.push(p.newText),l=n.offsetAt(p.range.end)}return u.push(s.substr(l)),u.join("")}r.applyEdits=i})(kt||(kt={}));function FD(r,e){if(r.length<=1)return r;var t=r.length/2|0,i=r.slice(0,t),n=r.slice(t);FD(i,e),FD(n,e);for(var o=0,s=0,a=0;o<i.length&&s<n.length;){var l=e(i[o],n[s]);l<=0?r[a++]=i[o++]:r[a++]=n[s++]}for(;o<i.length;)r[a++]=i[o++];for(;s<n.length;)r[a++]=n[s++];return r}function d3(r,e,t){t===void 0&&(t=0);for(var i=e?[t]:[],n=0;n<r.length;n++){var o=r.charCodeAt(n);(o===13||o===10)&&(o===13&&n+1<r.length&&r.charCodeAt(n+1)===10&&n++,i.push(t+n+1))}return i}function h3(r){var e=r.start,t=r.end;return e.line>t.line||e.line===t.line&&e.character>t.character?{start:t,end:e}:r}function rde(r){var e=h3(r.range);return e!==r.range?{newText:r.newText,range:e}:r}"use strict";function Uf(r,e){e===void 0&&(e=!1);var t=r.length,i=0,n="",o=0,s=16,a=0,l=0,u=0,c=0,f=0;function p(w,E){for(var P=0,k=0;P<w||!E;){var _=r.charCodeAt(i);if(_>=48&&_<=57)k=k*16+_-48;else if(_>=65&&_<=70)k=k*16+_-65+10;else if(_>=97&&_<=102)k=k*16+_-97+10;else break;i++,P++}return P<w&&(k=-1),k}function d(w){i=w,n="",o=0,s=16,f=0}function h(){var w=i;if(r.charCodeAt(i)===48)i++;else for(i++;i<r.length&&jl(r.charCodeAt(i));)i++;if(i<r.length&&r.charCodeAt(i)===46)if(i++,i<r.length&&jl(r.charCodeAt(i)))for(i++;i<r.length&&jl(r.charCodeAt(i));)i++;else return f=3,r.substring(w,i);var E=i;if(i<r.length&&(r.charCodeAt(i)===69||r.charCodeAt(i)===101))if(i++,(i<r.length&&r.charCodeAt(i)===43||r.charCodeAt(i)===45)&&i++,i<r.length&&jl(r.charCodeAt(i))){for(i++;i<r.length&&jl(r.charCodeAt(i));)i++;E=i}else f=3;return r.substring(w,E)}function m(){for(var w="",E=i;;){if(i>=t){w+=r.substring(E,i),f=2;break}var P=r.charCodeAt(i);if(P===34){w+=r.substring(E,i),i++;break}if(P===92){if(w+=r.substring(E,i),i++,i>=t){f=2;break}var k=r.charCodeAt(i++);switch(k){case 34:w+='"';break;case 92:w+="\\";break;case 47:w+="/";break;case 98:w+="\b";break;case 102:w+="\f";break;case 110:w+=`
|
||
`;break;case 114:w+="\r";break;case 116:w+=" ";break;case 117:var _=p(4,!0);_>=0?w+=String.fromCharCode(_):f=4;break;default:f=5}E=i;continue}if(P>=0&&P<=31)if(jf(P)){w+=r.substring(E,i),f=2;break}else f=6;i++}return w}function y(){if(n="",f=0,o=i,l=a,c=u,i>=t)return o=t,s=17;var w=r.charCodeAt(i);if(AD(w)){do i++,n+=String.fromCharCode(w),w=r.charCodeAt(i);while(AD(w));return s=15}if(jf(w))return i++,n+=String.fromCharCode(w),w===13&&r.charCodeAt(i)===10&&(i++,n+=`
|
||
`),a++,u=i,s=14;switch(w){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++,n=m(),s=10;case 47:var E=i-1;if(r.charCodeAt(i+1)===47){for(i+=2;i<t&&!jf(r.charCodeAt(i));)i++;return n=r.substring(E,i),s=12}if(r.charCodeAt(i+1)===42){i+=2;for(var P=t-1,k=!1;i<P;){var _=r.charCodeAt(i);if(_===42&&r.charCodeAt(i+1)===47){i+=2,k=!0;break}i++,jf(_)&&(_===13&&r.charCodeAt(i)===10&&i++,a++,u=i)}return k||(i++,f=1),n=r.substring(E,i),s=13}return n+=String.fromCharCode(w),i++,s=16;case 45:if(n+=String.fromCharCode(w),i++,i===t||!jl(r.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 n+=h(),s=11;default:for(;i<t&&v(w);)i++,w=r.charCodeAt(i);if(o!==i){switch(n=r.substring(o,i),n){case"true":return s=8;case"false":return s=9;case"null":return s=7}return s=16}return n+=String.fromCharCode(w),i++,s=16}}function v(w){if(AD(w)||jf(w))return!1;switch(w){case 125:case 93:case 123:case 91:case 34:case 58:case 44:case 47:return!1}return!0}function x(){var w;do w=y();while(w>=12&&w<=15);return w}return{setPosition:d,getPosition:function(){return i},scan:e?x:y,getToken:function(){return s},getTokenValue:function(){return n},getTokenOffset:function(){return o},getTokenLength:function(){return i-o},getTokenStartLine:function(){return l},getTokenStartCharacter:function(){return o-c},getTokenError:function(){return f}}}function AD(r){return r===32||r===9||r===11||r===12||r===160||r===5760||r>=8192&&r<=8203||r===8239||r===8287||r===12288||r===65279}function jf(r){return r===10||r===13||r===8232||r===8233}function jl(r){return r>=48&&r<=57}"use strict";function LD(r,e,t){var i,n,o,s,a;if(e){for(s=e.offset,a=s+e.length,o=s;o>0&&!Wf(r,o-1);)o--;for(var l=a;l<r.length&&!Wf(r,l);)l++;n=r.substring(o,l),i=ide(n,t)}else n=r,i=0,o=0,s=0,a=r.length;var u=nde(t,r),c=!1,f=0,p;t.insertSpaces?p=OD(" ",t.tabSize||4):p=" ";var d=Uf(n,!1),h=!1;function m(){return u+OD(p,i+f)}function y(){var R=d.scan();for(c=!1;R===15||R===14;)c=c||R===14,R=d.scan();return h=R===16||d.getTokenError()!==0,R}var v=[];function x(R,F,q){!h&&F<a&&q>s&&r.substring(F,q)!==R&&v.push({offset:F,length:q-F,content:R})}var w=y();if(w!==17){var E=d.getTokenOffset()+o,P=OD(p,i);x(P,o,E)}for(;w!==17;){for(var k=d.getTokenOffset()+d.getTokenLength()+o,_=y(),O="";!c&&(_===12||_===13);){var I=d.getTokenOffset()+o;x(" ",k,I),k=d.getTokenOffset()+d.getTokenLength()+o,O=_===12?m():"",_=y()}if(_===2)w!==1&&(f--,O=m());else if(_===4)w!==3&&(f--,O=m());else{switch(w){case 3:case 1:f++,O=m();break;case 5:case 12:O=m();break;case 13:c?O=m():O=" ";break;case 6:O=" ";break;case 10:if(_===6){O="";break}case 7:case 8:case 9:case 11:case 2:case 4:_===12||_===13?O=" ":_!==5&&_!==17&&(h=!0);break;case 16:h=!0;break}c&&(_===12||_===13)&&(O=m())}var L=d.getTokenOffset()+o;x(O,k,L),w=_}return v}function OD(r,e){for(var t="",i=0;i<e;i++)t+=r;return t}function ide(r,e){for(var t=0,i=0,n=e.tabSize||4;t<r.length;){var o=r.charAt(t);if(o===" ")i++;else if(o===" ")i+=n;else break;t++}return Math.floor(i/n)}function nde(r,e){for(var t=0;t<e.length;t++){var i=e.charAt(t);if(i==="\r")return t+1<e.length&&e.charAt(t+1)===`
|
||
`?`\r
|
||
`:"\r";if(i===`
|
||
`)return`
|
||
`}return r&&r.eol||`
|
||
`}function Wf(r,e){return`\r
|
||
`.indexOf(r.charAt(e))!==-1}"use strict";var Hf;(function(r){r.DEFAULT={allowTrailingComma:!1}})(Hf||(Hf={}));function g3(r,e,t){e===void 0&&(e=[]),t===void 0&&(t=Hf.DEFAULT);var i=null,n=[],o=[];function s(l){Array.isArray(n)?n.push(l):i!==null&&(n[i]=l)}var a={onObjectBegin:function(){var l={};s(l),o.push(n),n=l,i=null},onObjectProperty:function(l){i=l},onObjectEnd:function(){n=o.pop()},onArrayBegin:function(){var l=[];s(l),o.push(n),n=l,i=null},onArrayEnd:function(){n=o.pop()},onLiteralValue:s,onError:function(l,u,c){e.push({error:l,offset:u,length:c})}};return MD(r,a,t),n[0]}function ND(r,e,t){e===void 0&&(e=[]),t===void 0&&(t=Hf.DEFAULT);var i={type:"array",offset:-1,length:-1,children:[],parent:void 0};function n(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){n(l+u),i.length=l+u-i.offset,i=i.parent,n(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,n(l+u)},onLiteralValue:function(l,u,c){o({type:ode(l),offset:u,length:c,parent:i,value:l}),n(u+c)},onSeparator:function(l,u,c){i.type==="property"&&(l===":"?i.colonOffset=u:l===","&&n(u))},onError:function(l,u,c){e.push({error:l,offset:u,length:c})}};MD(r,s,t);var a=i.children[0];return a&&delete a.parent,a}function Wm(r,e){if(!!r){for(var t=r,i=0,n=e;i<n.length;i++){var o=n[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 MD(r,e,t){t===void 0&&(t=Hf.DEFAULT);var i=Uf(r,!1);function n(I){return I?function(){return I(i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter())}:function(){return!0}}function o(I){return I?function(L){return I(L,i.getTokenOffset(),i.getTokenLength(),i.getTokenStartLine(),i.getTokenStartCharacter())}:function(){return!0}}var s=n(e.onObjectBegin),a=o(e.onObjectProperty),l=n(e.onObjectEnd),u=n(e.onArrayBegin),c=n(e.onArrayEnd),f=o(e.onLiteralValue),p=o(e.onSeparator),d=n(e.onComment),h=o(e.onError),m=t&&t.disallowComments,y=t&&t.allowTrailingComma;function v(){for(;;){var I=i.scan();switch(i.getTokenError()){case 4:x(14);break;case 5:x(15);break;case 3:x(13);break;case 1:m||x(11);break;case 2:x(12);break;case 6:x(16);break}switch(I){case 12:case 13:m?x(10):d();break;case 16:x(1);break;case 15:case 14:break;default:return I}}}function x(I,L,R){if(L===void 0&&(L=[]),R===void 0&&(R=[]),h(I),L.length+R.length>0)for(var F=i.getToken();F!==17;){if(L.indexOf(F)!==-1){v();break}else if(R.indexOf(F)!==-1)break;F=v()}}function w(I){var L=i.getTokenValue();return I?f(L):a(L),v(),!0}function E(){switch(i.getToken()){case 11:var I=i.getTokenValue(),L=Number(I);isNaN(L)&&(x(2),L=0),f(L);break;case 7:f(null);break;case 8:f(!0);break;case 9:f(!1);break;default:return!1}return v(),!0}function P(){return i.getToken()!==10?(x(3,[],[2,5]),!1):(w(!1),i.getToken()===6?(p(":"),v(),O()||x(4,[],[2,5])):x(5,[],[2,5]),!0)}function k(){s(),v();for(var I=!1;i.getToken()!==2&&i.getToken()!==17;){if(i.getToken()===5){if(I||x(4,[],[]),p(","),v(),i.getToken()===2&&y)break}else I&&x(6,[],[]);P()||x(4,[],[2,5]),I=!0}return l(),i.getToken()!==2?x(7,[2],[]):v(),!0}function _(){u(),v();for(var I=!1;i.getToken()!==4&&i.getToken()!==17;){if(i.getToken()===5){if(I||x(4,[],[]),p(","),v(),i.getToken()===4&&y)break}else I&&x(6,[],[]);O()||x(4,[],[4,5]),I=!0}return c(),i.getToken()!==4?x(8,[4],[]):v(),!0}function O(){switch(i.getToken()){case 3:return _();case 1:return k();case 10:return w(!0);default:return E()}}return v(),i.getToken()===17?t.allowEmptyContent?!0:(x(4,[],[]),!1):O()?(i.getToken()!==17&&x(9,[],[]),!0):(x(4,[],[]),!1)}function ode(r){switch(typeof r){case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"object":{if(r){if(Array.isArray(r))return"array"}else return"null";return"object"}default:return"null"}}"use strict";function v3(r,e,t,i){for(var n,o=e.slice(),s=[],a=ND(r,s),l=void 0,u=void 0;o.length>0&&(u=o.pop(),l=Wm(a,o),l===void 0&&t!==void 0);)typeof u=="string"?t=(n={},n[u]=t,n):t=[t];if(l)if(l.type==="object"&&typeof u=="string"&&Array.isArray(l.children)){var c=Wm(l,[u]);if(c!==void 0)if(t===void 0){if(!c.parent)throw new Error("Malformed AST");var f=l.children.indexOf(c.parent),p=void 0,d=c.parent.offset+c.parent.length;if(f>0){var h=l.children[f-1];p=h.offset+h.length}else if(p=l.offset+1,l.children.length>1){var m=l.children[1];d=m.offset}return Zs(r,{offset:p,length:d-p,content:""},i)}else return Zs(r,{offset:c.offset,length:c.length,content:JSON.stringify(t)},i);else{if(t===void 0)return[];var y=JSON.stringify(u)+": "+JSON.stringify(t),v=i.getInsertionIndex?i.getInsertionIndex(l.children.map(function(I){return I.children[0].value})):l.children.length,x=void 0;if(v>0){var h=l.children[v-1];x={offset:h.offset+h.length,length:0,content:","+y}}else l.children.length===0?x={offset:l.offset+1,length:0,content:y}:x={offset:l.offset+1,length:0,content:y+","};return Zs(r,x,i)}}else if(l.type==="array"&&typeof u=="number"&&Array.isArray(l.children)){var w=u;if(w===-1){var y=""+JSON.stringify(t),x=void 0;if(l.children.length===0)x={offset:l.offset+1,length:0,content:y};else{var h=l.children[l.children.length-1];x={offset:h.offset+h.length,length:0,content:","+y}}return Zs(r,x,i)}else if(t===void 0&&l.children.length>=0){var E=u,P=l.children[E],x=void 0;if(l.children.length===1)x={offset:l.offset+1,length:l.length-2,content:""};else if(l.children.length-1===E){var h=l.children[E-1],k=h.offset+h.length,_=l.offset+l.length;x={offset:k,length:_-2-k,content:""}}else x={offset:P.offset,length:l.children[E+1].offset-P.offset,content:""};return Zs(r,x,i)}else if(t!==void 0){var x=void 0,y=""+JSON.stringify(t);if(!i.isArrayInsertion&&l.children.length>u){var O=l.children[u];x={offset:O.offset,length:O.length,content:y}}else if(l.children.length===0||u===0)x={offset:l.offset+1,length:0,content:l.children.length===0?y:y+","};else{var v=u>l.children.length?l.children.length:u,h=l.children[v-1];x={offset:h.offset+h.length,length:0,content:","+y}}return Zs(r,x,i)}else throw new Error("Can not "+(t===void 0?"remove":i.isArrayInsertion?"insert":"modify")+" Array index "+w+" as length is not sufficient")}else throw new Error("Can not add "+(typeof u!="number"?"index":"property")+" to parent of type "+l.type);else{if(t===void 0)throw new Error("Can not delete in empty document");return Zs(r,{offset:a?a.offset:0,length:a?a.length:0,content:JSON.stringify(t)},i)}}function Zs(r,e,t){if(!t.formattingOptions)return[e];var i=Hm(r,e),n=e.offset,o=e.offset+e.content.length;if(e.length===0||e.content.length===0){for(;n>0&&!Wf(i,n-1);)n--;for(;o<i.length&&!Wf(i,o);)o++}for(var s=LD(i,{offset:n,length:o-n},t.formattingOptions),a=s.length-1;a>=0;a--){var l=s[a];i=Hm(i,l),n=Math.min(n,l.offset),o=Math.max(o,l.offset+l.length),o+=l.content.length-l.length}var u=r.length-(i.length-o)-n;return[{offset:n,length:u,content:i.substring(n,o)}]}function Hm(r,e){return r.substring(0,e.offset)+e.content+r.substring(e.offset+e.length)}"use strict";var Ul=g3;function y3(r,e,t,i){return v3(r,e,t,i)}function b3(r,e){for(var t=e.length-1;t>=0;t--)r=Hm(r,e[t]);return r}var zf=S(require("fs"));var zm=S(require("path")),sde=j()("configuration-util"),ade=zm.dirname(__dirname);function x3(r,e){if(!r||!zf.default.existsSync(r))return{contents:{}};let t,i=$.file(r).toString();try{t=zf.default.readFileSync(r,"utf8")}catch(s){t=""}let[n,o]=lde(t);return n&&n.length&&e(ude(i,t,n)),{contents:o}}function lde(r){if(r.length==0)return[[],{}];let e=[],t=Ul(r,e,{allowTrailingComma:!0});function i(o,s,a,l){if(a.length==0)o[s]=n(l);else{o[s]||(o[s]={});let u=o[s],c=a.shift();i(u,c,a,l)}}function n(o,s=!1){if(!wt(o))return o;if(fm(o))return{};let a={};for(let l of Object.keys(o))if(s&&l.includes(".")){let u=l.split("."),c=u.shift();i(a,c,u,o[l])}else a[l]=n(o[l]);return a}return[e,n(t,!0)]}function ude(r,e,t){let i=[],n=kt.create(r,"json",0,e);for(let o of t){let s="parse error";switch(o.error){case 2:s="invalid number";break;case 8:s="close brace expected";break;case 5:s="colon expected";break;case 6:s="comma expected";break;case 9:s="end of file expected";break;case 16:s="invaliad character";break;case 10:s="invalid commment token";break;case 15:s="invalid escape character";break;case 1:s="invalid symbol";break;case 14:s="invalid unicode";break;case 3:s="property name expected";break;case 13:s="unexpected end of number";break;case 12:s="unexpected end of string";break;case 11:s="unexpected end of comment";break;case 4:s="value expected";break;default:s="Unknwn error";break}let a={start:n.positionAt(o.offset),end:n.positionAt(o.offset+o.length)},l=w3.Location.create(r,a);i.push({location:l,message:s})}return i}function Gf(r,e,t,i){let n=e.split("."),o=n.pop(),s=r;for(let a=0;a<n.length;a++){let l=n[a],u=s[l];switch(typeof u){case"function":{u=s[l]={};break}case"undefined":{u=s[l]={};break}case"object":break;default:i(`Ignoring ${e} as ${n.slice(0,a+1).join(".")} is ${JSON.stringify(u)}`);return}s=u}typeof s=="object"?s[o]=t:i(`Ignoring ${e} as ${n.join(".")} is ${JSON.stringify(s)}`)}function S3(r,e){let t=e.split(".");D3(r,t)}function D3(r,e){let t=e.shift();if(e.length===0){delete r[t];return}if(Object.keys(r).includes(t)){let i=r[t];typeof i=="object"&&!Array.isArray(i)&&(D3(i,e),Object.keys(i).length===0&&delete r[t])}}function Gm(r,e,t){function i(s,a){let l=s;for(let u=0;u<a.length;u++){if(typeof l!="object"||l===null)return;l=l[a[u]]}return l}let n=e.split("."),o=i(r,n);return typeof o=="undefined"?t:o}function E3(){let r=zm.default.join(ade,"data/schema.json");if(!zf.default.existsSync(r))return console.error("schema.json not found, reinstall coc.nvim to fix this!"),{contents:{}};let e=zf.default.readFileSync(r,"utf8"),{properties:t}=JSON.parse(e),i={};return Object.keys(t).forEach(n=>{let o=t[n].default;o!==void 0&&Gf(i,n,o,s=>{sde.error(s)})}),{contents:i}}function qD(r,e){let t=[];for(let i of Object.keys(r)){let n=r[i],o=e?`${e}.${i}`:i;t.push(o),wt(n)&&t.push(...qD(n,o))}return t}function C3(r,e){let t=[],i=qD(r),n=qD(e),o=n.filter(a=>!i.includes(a)),s=i.filter(a=>!n.includes(a));t.push(...o),t.push(...s);for(let a of i){if(!n.includes(a))continue;let l=Gm(r,a),u=Gm(e,a);Ne(l,u)||t.push(a)}return t}var Fr=class{constructor(e={}){this._contents=e}get contents(){return this._contents}clone(){return new Fr(zn(this._contents))}getValue(e){return e?Gm(this.contents,e):this.contents}merge(...e){let t=zn(this.contents);for(let i of e)this.mergeContents(t,i.contents);return new Fr(t)}freeze(){return Object.isFrozen(this._contents)||Object.freeze(this._contents),this}mergeContents(e,t){for(let i of Object.keys(t)){if(i in e&&wt(e[i])&&wt(t[i])){this.mergeContents(e[i],t[i]);continue}e[i]=zn(t[i])}}setValue(e,t){Gf(this.contents,e,t,i=>{console.error(i)})}removeValue(e){S3(this.contents,e)}};var Vm=class{constructor(e,t,i,n=new Fr){this._defaultConfiguration=e;this._userConfiguration=t;this._workspaceConfiguration=i;this._memoryConfiguration=n}getConsolidateConfiguration(){return this._consolidateConfiguration||(this._consolidateConfiguration=this._defaultConfiguration.merge(this._userConfiguration,this._workspaceConfiguration,this._memoryConfiguration),this._consolidateConfiguration=this._consolidateConfiguration.freeze()),this._consolidateConfiguration}getValue(e){return this.getConsolidateConfiguration().getValue(e)}inspect(e){let t=this.getConsolidateConfiguration(),{_workspaceConfiguration:i,_memoryConfiguration:n}=this;return{default:this._defaultConfiguration.freeze().getValue(e),user:this._userConfiguration.freeze().getValue(e),workspace:i.freeze().getValue(e),memory:n.freeze().getValue(e),value:t.getValue(e)}}get defaults(){return this._defaultConfiguration}get user(){return this._userConfiguration}get workspace(){return this._workspaceConfiguration}toData(){return{defaults:{contents:this._defaultConfiguration.contents},user:{contents:this._userConfiguration.contents},workspace:{contents:this._workspaceConfiguration.contents}}}};var Ide=S(require("child_process")),Ci=S($i()),Fde=S(require("net")),HD=S(require("os")),Xr=S(require("path")),zD=S(require("readline")),Ade=S(require("util")),V3=S(Qs()),$1e=j()("util-fs");async function Ht(r){let e=null;try{e=await Ci.default.stat(r)}catch(t){}return e}function K3(r,e){return new Promise((t,i)=>{Ci.default.rename(r,e,n=>{if(n)return i(n);t()})})}function Jf(r,e,t,i=!1,n=!0){let o=HD.default.homedir(),s=Kf(r);if(Ye(s,o,!0))return null;if(n&&t&&Ye(t,s,!0)&&Bo(t,e))return t;let a=s.split(Xr.default.sep);if(i){for(;a.length>0;){let l=a.join(Xr.default.sep);if(l==o)break;if(l!=o&&Bo(l,e))return l;a.pop()}return null}else{let l=[a.shift()];for(let u of a){l.push(u);let c=l.join(Xr.default.sep);if(c!=o&&Bo(c,e))return c}return null}}function Bo(r,e){try{let t=Ci.default.readdirSync(r);for(let i of e)if(i.includes("*")?V3.default.match(t,i,{nobrace:!0,noext:!0,nocomment:!0,nonegate:!0,dot:!0}).length!==0:t.includes(i))return!0}catch(t){}return!1}function Hl(r,e){let t=Xr.default.parse(e).root,i=Array.isArray(r)?r:[r];for(;e&&e!==t;){if(Bo(e,i))for(let o of i){let s=Xr.default.join(e,o);if(Ci.default.existsSync(s))return s}e=Xr.default.dirname(e)}return null}function Yf(r,e){return new Promise((t,i)=>{Ci.default.readFile(r,e,(n,o)=>{n&&i(n),t(o)})})}function J3(r){let e,t=0;return new Promise((i,n)=>{Ci.default.createReadStream(r).on("error",o=>n(o)).on("data",o=>{for(e=0;e<o.length;++e)o[e]==10&&t++}).on("end",()=>i(t))})}function Y3(r,e,t){if(!Ci.default.existsSync(r))return Promise.reject(new Error(`file does not exist: ${r}`));let i=[],n=zD.default.createInterface({input:Ci.default.createReadStream(r,{encoding:"utf8"}),crlfDelay:Infinity,terminal:!1}),o=0;return new Promise((s,a)=>{n.on("line",l=>{o==0&&l.startsWith("\uFEFF")&&(l=l.slice(1)),o>=e&&o<=t&&i.push(l),o==t&&n.close(),o=o+1}),n.on("close",()=>{s(i)}),n.on("error",a)})}function X3(r,e){if(!Ci.default.existsSync(r))return Promise.reject(new Error(`file does not exist: ${r}`));let t=zD.default.createInterface({input:Ci.default.createReadStream(r,{encoding:"utf8"}),crlfDelay:Infinity,terminal:!1}),i=0;return new Promise((n,o)=>{t.on("line",s=>{if(i==e){i==0&&s.startsWith("\uFEFF")&&(s=s.slice(1)),t.close(),n(s);return}i=i+1}),t.on("error",o)})}async function Z3(r,e){await Ci.default.writeFile(r,e,{encoding:"utf8"})}function Jm(r){return r.startsWith("file:")}function Ye(r,e,t=!1){let i=Kf(Xr.default.resolve(Xr.default.normalize(r))),n=Kf(Xr.default.resolve(Xr.default.normalize(e)));return i=="//"&&(i="/"),i==n?!!t:i.endsWith(Xr.default.sep)?n.startsWith(i):n.startsWith(i)&&n[i.length]==Xr.default.sep}function Kf(r){return HD.default.platform()!="win32"||r[1]!=":"?r:r[0].toUpperCase()+r.slice(1)}var Ode=j()("configurations");function KD(r,e){if(e){if(r&&r.hasOwnProperty(e))return r[e];let t=e.split("."),i=r;for(let n=0;i&&n<t.length;n++)i=i[t[n]];return i}return r}var ea=class{constructor(e,t){this.userConfigFile=e;this._proxy=t;this._errorItems=[];this._folderConfigurations=new Map;this._onError=new VD.Emitter;this._onChange=new VD.Emitter;this.disposables=[];this.onError=this._onError.event;this.onDidChange=this._onChange.event;let i=this.parseContentFromFile(e),n={defaults:E3(),user:i,workspace:{contents:{}}};this._configuration=ea.parse(n),this.watchFile(e,pt.User);let o=Xi.default.join(process.cwd(),`.vim/${Gi}`);o!=e&&jo.default.existsSync(o)&&this.addFolderFile(o)}parseContentFromFile(e){if(!e)return{contents:{}};let t=$.file(e).toString();this._errorItems=this._errorItems.filter(n=>n.location.uri!=t);let i=x3(e,n=>{this._errorItems.push(...n)});return this._onError.fire(this._errorItems),i}get errorItems(){return this._errorItems}get foldConfigurations(){return this._folderConfigurations}extendsDefaults(e){let{defaults:t}=this._configuration,{contents:i}=t;i=zn(i),Object.keys(e).forEach(o=>{Gf(i,o,e[o],s=>{Ode.error(s)})});let n={defaults:{contents:i},user:this._configuration.user,workspace:this._configuration.workspace};this._configuration=ea.parse(n)}updateUserConfig(e){if(!e||Object.keys(e).length==0)return;let{user:t}=this._configuration,i=t.clone();Object.keys(e).forEach(n=>{let o=e[n];if(o===void 0)i.removeValue(n);else if(wt(o))for(let s of Object.keys(o))i.setValue(`${n}.${s}`,o[s]);else i.setValue(n,o)}),this.changeConfiguration(pt.User,i)}get defaults(){return this._configuration.defaults}get user(){return this._configuration.user}get workspace(){return this._configuration.workspace}addFolderFile(e){let{_folderConfigurations:t}=this;if(t.has(e)||Xi.default.resolve(e,"../..")==GD.default.homedir())return;let i=this.parseContentFromFile(e);this.watchFile(e,pt.Workspace),this.changeConfiguration(pt.Workspace,i,e)}watchFile(e,t){if(!jo.default.existsSync(e)||global.hasOwnProperty("__TEST__"))return;let i=Pl(e,()=>{let n=this.parseContentFromFile(e);this.changeConfiguration(t,n,e)});this.disposables.push(i)}changeConfiguration(e,t,i){let{defaults:n,user:o,workspace:s}=this._configuration,{workspaceConfigFile:a}=this,l={defaults:e==pt.Global?t:n,user:e==pt.User?t:o,workspace:e==pt.Workspace?t:s},u=ea.parse(l),c=C3(this._configuration.getValue(),u.getValue());e==pt.Workspace&&i&&(this._folderConfigurations.set(i,new Fr(t.contents)),this.workspaceConfigFile=i),c.length!=0&&(this._configuration=u,this._onChange.fire({affectsConfiguration:(f,p)=>{if(!p||e!=pt.Workspace)return c.includes(f);let d=$.parse(p);if(d.scheme!=="file")return c.includes(f);let h=d.fsPath,m=a?Xi.default.resolve(a,"../.."):"";return i&&!Ye(m,h,!0)&&!Ye(Xi.default.resolve(i,"../.."),h)?!1:c.includes(f)}}))}setFolderConfiguration(e){let t=$.parse(e);if(t.scheme!="file")return;let i=t.fsPath;for(let[n,o]of this.foldConfigurations){let s=Xi.default.resolve(n,"../..");if(Ye(s,i,!0)&&this.workspaceConfigFile!=n){this.changeConfiguration(pt.Workspace,o,n);break}}}hasFolderConfiguration(e){let{folders:t}=this;return t.findIndex(i=>Ye(i,e,!0))!==-1}getConfigFile(e){return e==pt.Global?null:e==pt.User?this.userConfigFile:this.workspaceConfigFile}get folders(){let e=[],{_folderConfigurations:t}=this;for(let i of t.keys())e.push(Xi.default.resolve(i,"../.."));return e}get configuration(){return this._configuration}getConfiguration(e,t){let i;if(t){let{defaults:s,user:a}=this._configuration;i=new Vm(s,a,this.getFolderConfiguration(t))}else i=this._configuration;let n=Object.freeze(KD(i.getValue(null),e)),o={has(s){return typeof KD(n,s)!="undefined"},get:(s,a)=>{let l=KD(n,s);return l==null?a:l},update:(s,a,l=!1)=>{let u=e?`${e}.${s}`:s,c=l?pt.User:pt.Workspace,f=c==pt.User?this.user.clone():this.workspace.clone();if(a==null?f.removeValue(u):f.setValue(u,a),c==pt.Workspace&&!this.workspaceConfigFile&&this._proxy){let p=this.workspaceConfigFile=this._proxy.workspaceConfigFile;if(!jo.default.existsSync(p)){let d=Xi.default.dirname(p);jo.default.existsSync(d)||jo.default.mkdirSync(d),jo.default.writeFileSync(p,"{}",{encoding:"utf8"})}}this.changeConfiguration(c,f,c==pt.Workspace?this.workspaceConfigFile:this.userConfigFile),this._proxy&&!global.hasOwnProperty("__TEST__")&&(a==null?this._proxy.$removeConfigurationOption(c,u):this._proxy.$updateConfigurationOption(c,u,a))},inspect:s=>{s=e?`${e}.${s}`:s;let a=this._configuration.inspect(s);if(a)return{key:s,defaultValue:a.default,globalValue:a.user,workspaceValue:a.workspace}}};return Object.defineProperty(o,"has",{enumerable:!1}),Object.defineProperty(o,"get",{enumerable:!1}),Object.defineProperty(o,"update",{enumerable:!1}),Object.defineProperty(o,"inspect",{enumerable:!1}),typeof n=="object"&&Ax(o,n,!1),fq(o)}getFolderConfiguration(e){let t=$.parse(e);if(t.scheme!="file")return new Fr;let i=t.fsPath;for(let[n,o]of this.foldConfigurations){let s=Xi.default.resolve(n,"../..");if(Ye(s,i,!0))return o}return new Fr}checkFolderConfiguration(e){let t=$.parse(e);if(t.scheme!="file")return;let i=Xi.default.dirname(t.fsPath);if(this.hasFolderConfiguration(i))this.setFolderConfiguration(e);else{let n=Hl(".vim",i);if(n&&n!=GD.default.homedir()){let o=Xi.default.join(n,Gi);jo.default.existsSync(o)&&this.addFolderFile(o)}}}static parse(e){let t=new Fr(e.defaults.contents),i=new Fr(e.user.contents),n=new Fr(e.workspace.contents);return new Vm(t,i,n,new Fr)}dispose(){z(this.disposables)}},Q3=ea;var JD=S(require("fs"));var YD=S(require("path"));var uke=j()("configuration-shape"),XD=class{constructor(e){this.workspace=e}get nvim(){return this.workspace.nvim}async modifyConfiguration(e,t,i){let{nvim:n,workspace:o}=this,s=o.getConfigFile(e);if(!s)return;let a={tabSize:2,insertSpaces:!0},l=JD.default.readFileSync(s,"utf8");i=i==null?void 0:i;let u=y3(l,[t],i,{formattingOptions:a});l=b3(l,u),JD.default.writeFileSync(s,l,"utf8"),o.getDocument($.file(s).toString())&&n.command("checktime",!0)}get workspaceConfigFile(){let e=YD.default.join(this.workspace.root,".vim");return YD.default.join(e,Gi)}$updateConfigurationOption(e,t,i){this.modifyConfiguration(e,t,i).logError()}$removeConfigurationOption(e,t){this.modifyConfiguration(e,t).logError()}},ej=XD;var Zr=S($i()),ZD=S(require("path")),QD=class{constructor(e){this.filepath=e}fetch(e){let t=this.load();if(!e)return t;let i=e.split(".");for(let n of i){if(typeof t[n]=="undefined")return;t=t[n]}return t}exists(e){let t=this.load(),i=e.split(".");for(let n of i){if(typeof t[n]=="undefined")return!1;t=t[n]}return!0}delete(e){let t=this.load(),i=t,n=e.split("."),o=n.length;for(let s=0;s<o&&typeof t[n[s]]!="undefined";s++){if(s==o-1){delete t[n[s]],Zr.default.writeFileSync(this.filepath,JSON.stringify(i,null,2),"utf8");break}t=t[n[s]]}}push(e,t){let i=this.load()||{},n=i,o=e.split("."),s=o.length;if(n==null){let a=ZD.default.dirname(this.filepath);Zr.default.mkdirpSync(a),n=i}for(let a=0;a<s;a++){let l=o[a];if(a==s-1){n[l]=t,Zr.default.writeFileSync(this.filepath,JSON.stringify(i,null,2));break}typeof n[l]=="undefined"&&(n[l]={}),n=n[l]}}load(){let e=ZD.default.dirname(this.filepath),t=Zr.default.statSync(e);if(!t||!t.isDirectory())return Zr.default.mkdirpSync(e),Zr.default.writeFileSync(this.filepath,"{}","utf8"),{};try{let i=Zr.default.readFileSync(this.filepath,"utf8");return JSON.parse(i.trim())}catch(i){return Zr.default.writeFileSync(this.filepath,"{}","utf8"),{}}}clear(){let e=Zr.default.statSync(this.filepath);!e||!e.isFile()||Zr.default.writeFileSync(this.filepath,"{}","utf8")}destroy(){Zr.default.existsSync(this.filepath)&&Zr.default.unlinkSync(this.filepath)}},Ym=QD;var t0=S(Gr()),Zi=S(W());var Xm=S(Bl());var dke=j()("util-diff");function tj(r,e){let t=0,i=r.length,n=i,o=e.length;for(let s=0;s<=i;s++){if(e[s]!==r[s]){t=s;break}s==i&&(t=i)}if(t!=e.length){let s=Math.min(i-t,o-t);for(let a=0;a<s&&r[n-a-1]==e[o-a-1];a++)i=i-1}return{start:t,end:i,replacement:e.slice(t,o-(n-i))}}function rj(r,e,t){let i=r.length,n=e.length,o=Math.min(i,n),s="",a=0,l=-1,u=!1;for(let p=0;p<=o;p++){if(t!=null&&p==t){l=p,u=!0;break}if(r[i-p-1]!=e[n-p-1]){l=p;break}}if(l==-1)return null;let c=o-l;if(c==0)a=0;else for(let p=0;p<=c;p++)if(r[p]!=e[p]||p==c){a=p;break}if(c=c-a,u&&c>0){let p=l;for(let d=0;d<c;d++){let h=r[i-p-1-d],m=e[n-p-1-d];if(h==m)l=l+1;else break}}let f=i-l;if(i==n&&a==f)return null;if(s=e.slice(a,n-l),a==f){let p=a==0?"":e[a-1];if(p&&p!=`
|
||
`&&r[a]==`
|
||
`&&s.startsWith(`
|
||
`))return{start:a+1,end:f+1,newText:s.slice(1)+`
|
||
`}}return{start:a,end:f,newText:s}}function ij(r,e,t=" "){if(r==e)return e;let i=e.indexOf(r);if(i!==-1)return t.repeat(i)+r;let n=Xm.default(r,e),o="";for(let s of n){if(s[0]==Xm.default.DELETE)return e;s[0]==Xm.default.INSERT?o=o+t.repeat(ue(s[1])):o=o+s[1]}return o}var mke=j()("model-chars"),_i=class{constructor(e,t){this.start=e,this.end=t||e}static fromKeywordOption(e){let t=e.split(","),i=[];for(let n of t)if(n=="@")i.push(new _i(65,90)),i.push(new _i(97,122));else if(n=="@-@")i.push(new _i(64));else if(/^([A-Za-z])-([A-Za-z])$/.test(n)){let o=n.match(/^([A-Za-z])-([A-Za-z])$/);i.push(new _i(o[1].charCodeAt(0),o[2].charCodeAt(0)))}else if(/^\d+-\d+$/.test(n)){let o=n.match(/^(\d+)-(\d+)$/);i.push(new _i(Number(o[1]),Number(o[2])))}else if(/^\d+$/.test(n))i.push(new _i(Number(n)));else{let o=n.charCodeAt(0);i.some(s=>s.contains(o))||i.push(new _i(o))}return i}contains(e){return e>=this.start&&e<=this.end}},Xf=class{constructor(e){this.ranges=[];e&&(this.ranges=_i.fromKeywordOption(e))}addKeyword(e){let t=e.charCodeAt(0),{ranges:i}=this;i.some(n=>n.contains(t))||i.push(new _i(t))}clone(){let e=new Xf;return e.ranges=this.ranges.slice(),e}setKeywordOption(e){this.ranges=_i.fromKeywordOption(e)}matchKeywords(e,t=3){let i=e.length;if(i==0)return[];let n=new Set,o="",s=0;for(let a=0;a<i;a++){let l=e[a],u=l.codePointAt(0);if(s==0&&u==45)continue;if(this.isKeywordCode(u)){if(s==48)continue;o=o+l,s=s+1}else s>=t&&s<48&&n.add(o),o="",s=0}return s!=0&&n.add(o),Array.from(n)}isKeywordCode(e){return e>255?!0:e<33?!1:this.ranges.some(t=>t.contains(e))}isKeywordChar(e){let{ranges:t}=this,i=e.charCodeAt(0);return i>255?!0:i<33?!1:t.some(n=>n.contains(i))}isKeyword(e){let{ranges:t}=this;for(let i=0,n=e.length;i<n;i++){let o=e.charCodeAt(i);if(o>255)return!1;if(!t.some(s=>s.contains(o)))return!1}return!0}};function Lde(r,e,t=0){let i=e?[t]:[];for(let n=0;n<r.length;n++){let o=r.charCodeAt(n);(o===13||o===10)&&(o===13&&n+1<r.length&&r.charCodeAt(n+1)===10&&n++,i.push(t+n+1))}return i}var e0=class{constructor(e,t,i,n,o){this.uri=e;this.languageId=t;this.version=i;this.lines=n;this.eol=o}get _content(){return this.lines.join(`
|
||
`)+(this.eol?`
|
||
`:"")}get lineCount(){return this.lines.length+(this.eol?1:0)}getText(e){if(e){let t=this.offsetAt(e.start),i=this.offsetAt(e.end);return this._content.substring(t,i)}return this._content}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let t=this.getLineOffsets(),i=0,n=t.length;if(n===0)return{line:0,character:e};for(;i<n;){let s=Math.floor((i+n)/2);t[s]>e?n=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],n=e.line+1<t.length?t[e.line+1]:this._content.length;return Math.max(Math.min(i+e.character,n),i)}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=Lde(this._content,!0)),this._lineOffsets}};var nj=j()("model-document"),r0=class{constructor(e,t,i){this.buffer=e;this.env=t;this.maxFileSize=i;this.isIgnored=!1;this.mutex=new ar;this._version=1;this.size=0;this.eol=!0;this.lines=[];this.syncLines=[];this._attached=!1;this._previewwindow=!1;this._winid=-1;this._words=[];this._onDocumentChange=new Zi.Emitter;this._onDocumentDetach=new Zi.Emitter;this.disposables=[];this.onDocumentChange=this._onDocumentChange.event;this.onDocumentDetach=this._onDocumentDetach.event;this.fireContentChanges=t0.default(()=>{this._fireContentChanges()},100),this.fetchContent=t0.default(()=>{this._fetchContent().logError()},100)}get content(){return this.syncLines.join(`
|
||
`)+(this.eol?`
|
||
`:"")}get version(){return this._version}get bufnr(){return this.buffer.id}get filetype(){return this._filetype}get uri(){return this._uri}get shouldAttach(){let{buftype:e,maxFileSize:t}=this;return this.getVar("enabled",!0)?this.uri.endsWith("%5BCommand%20Line%5D")?!0:this.size==-2||t&&this.size>t?!1:e==""||e=="acwrite":!1}get isCommandLine(){return this.uri&&this.uri.endsWith("%5BCommand%20Line%5D")}get enabled(){return this.getVar("enabled",!0)}get words(){return this._words}convertFiletype(e){let t=this.env.filetypeMap;return e=="javascript.jsx"?"javascriptreact":e=="typescript.jsx"||e=="typescript.tsx"?"typescriptreact":t[e]||e}get changedtick(){return this._changedtick}get schema(){return $.parse(this.uri).scheme}get lineCount(){return this.lines.length}get winid(){return this._winid}get previewwindow(){return this._previewwindow}async init(e,t){this.nvim=e;let i=await e.call("coc#util#get_bufoptions",[this.bufnr,this.maxFileSize]);if(i==null)return!1;let n=this.buftype=i.buftype;if(this._previewwindow=i.previewwindow,this._winid=i.winid,this.size=typeof i.size=="number"?i.size:0,this.variables=i.variables||{},this._changedtick=i.changedtick,this.eol=i.eol==1,this._uri=uq(i.fullpath,this.bufnr,n,this.env.isCygwin),t.isCancellationRequested)return!1;if(this.shouldAttach){if(this.lines=i.lines,this.syncLines=this.lines,!await this.attach())return!1;this._attached=!0}return this._filetype=this.convertFiletype(i.filetype),this.setIskeyword(i.iskeyword),t.isCancellationRequested?(this.detach(),!1):!0}async attach(){return await this.buffer.attach(!0)?(this.buffer.listen("lines",this.onChange.bind(this),this.disposables),this.buffer.listen("detach",async t=>{this._onDocumentDetach.fire(t.id)},this.disposables),!0):!1}async onChange(e,t,i,n,o){e.id!==this.bufnr||!this._attached||t==null||this.mutex.busy||t>this._changedtick&&(this._changedtick=t,this.lines=[...this.lines.slice(0,i),...o,...this.lines.slice(n)],this.fireContentChanges())}async checkDocument(){let{buffer:e}=this,t=await this.mutex.acquire();this.fireContentChanges.clear(),this._changedtick=await e.changedtick,this.lines=await e.lines,this._fireContentChanges()&&await He(30),t()}get dirty(){return this.lines===this.syncLines?!1:!Ne(this.lines,this.syncLines)}_fireContentChanges(){let{cursor:e}=A,{textDocument:t}=this;try{let i=null;e&&e.bufnr==this.bufnr&&(i=this.getEndOffset(e.lnum,e.col,e.insert));let n=this.getDocumentContent(),o=rj(t.getText(),n,i);if(o==null)return;let s=t.positionAt(o.start),a=t.positionAt(o.end),l=t.getText(Zi.Range.create(s,a));this._version=this._version+1,this.syncLines=this.lines;let u=[{range:{start:s,end:a},rangeLength:o.end-o.start,text:o.newText}];return this._onDocumentChange.fire({bufnr:this.bufnr,original:l,textDocument:{version:this.version,uri:this.uri},contentChanges:u}),this._words=this.chars.matchKeywords(n),!0}catch(i){nj.error(i.message)}return!1}async applyEdits(e){if(!Array.isArray(arguments[0])&&Array.isArray(arguments[1])&&(e=arguments[1]),e.length==0)return;let t=this.getDocumentContent(),i=kt.create(this.uri,this.filetype,1,t),n=kt.applyEdits(i,e);if(Hn&&(n=n.replace(/\r\n/g,`
|
||
`)),t!==n){let o=(this.eol&&n.endsWith(`
|
||
`)?n.slice(0,-1):n).split(`
|
||
`),s=tj(this.lines,o),a=await this.mutex.acquire();try{let l=await this.nvim.call("coc#util#set_lines",[this.bufnr,s.replacement,s.start,s.end]);this._changedtick=l.changedtick,this.lines=o,this.fireContentChanges.clear(),this._fireContentChanges(),Ne(o,l.lines)||process.nextTick(()=>{this.lines=l.lines,this.fireContentChanges.clear(),this._fireContentChanges()}),a()}catch(l){nj.error("Error on applyEdits: ",l),a()}}}async changeLines(e){let t=[],i=this.lines.slice();for(let[o,s]of e)i[o]!=s&&(t.push([o,s]),i[o]=s);if(!t.length)return;let n=await this.mutex.acquire();try{let o=await this.nvim.call("coc#util#change_lines",[this.bufnr,t]);o!=null&&(this.lines=i,this._changedtick=o.changedtick,this.fireContentChanges.clear(),this._fireContentChanges(),Ne(i,o.lines)||process.nextTick(()=>{this.lines=o.lines,this.fireContentChanges.clear(),this._fireContentChanges()})),n()}catch(o){n()}}forceSync(){this.mutex.busy||(this.fireContentChanges.clear(),this._fireContentChanges())}getOffset(e,t){return this.textDocument.offsetAt({line:e-1,character:t})}isWord(e){return this.chars.isKeyword(e)}getMoreWords(){let e=[],{words:t,chars:i}=this;if(!i.isKeywordChar("-"))return e;for(let n of t)if(n=n.replace(/^-+/,""),n.includes("-")){let o=n.split("-");for(let s of o)s.length>2&&!e.includes(s)&&!t.includes(s)&&e.push(s)}return e}getWordRangeAtPosition(e,t,i=!0){let n=this.chars.clone();if(t&&t.length)for(let l of t)n.addKeyword(l);let o=this.getline(e.line,i);if(o.length==0||e.character>=o.length||!n.isKeywordChar(o[e.character]))return null;let s=e.character,a=e.character+1;if(!n.isKeywordChar(o[s]))return Zi.Range.create(e,{line:e.line,character:e.character+1});for(;s>=0;){let l=o[s-1];if(!l||!n.isKeyword(l))break;s=s-1}for(;a<=o.length;){let l=o[a];if(!l||!n.isKeywordChar(l))break;a=a+1}return Zi.Range.create(e.line,s,e.line,a)}get textDocument(){let{version:e,filetype:t,uri:i}=this;return new e0(i,t,e,this.syncLines,this.eol)}async _fetchContent(){if(!this.env.isVim||!this._attached)return;let{nvim:e,bufnr:t,changedtick:i}=this,n=await this.mutex.acquire(),o=await e.call("coc#util#get_buf_lines",[t,i]);o&&o.changedtick>=this._changedtick&&(this._changedtick=o.changedtick,this.lines=o.lines,this.fireContentChanges.clear(),this._fireContentChanges()),n()}async patchChange(e){if(!!this._attached)if(this.env.isVim)if(e){let t=await this.nvim.call("coc#util#get_changeinfo",[]);if(t.changedtick<this._changedtick)return;let{lnum:i,line:n,changedtick:o}=t,s=this.lines.slice();if(this._changedtick=o,s[i-1]==n)return;s[i-1]=n,this.lines=s,this.forceSync()}else this.fetchContent.clear(),await this._fetchContent();else this.forceSync()}getSymbolRanges(e){this.forceSync();let t=[],{textDocument:i}=this,n=i.getText(),o="";for(let s=0,a=n.length;s<a;s++){let l=n[s];if(l=="-"&&o.length==0)continue;let u=this.chars.isKeywordChar(l);u&&(o=o+l),o.length>0&&!u&&o==e&&t.push(Zi.Range.create(i.positionAt(s-o.length),i.positionAt(s))),u||(o="")}return t}fixStartcol(e,t){let i=this.getline(e.line);if(!i)return null;let{character:n}=e,o=i.slice(0,n),s=ue(o),{chars:a}=this;for(let l=o.length-1;l>=0;l--){let u=o[l];if(u==" "||!a.isKeywordChar(u)&&!t.includes(u))break;s=s-ue(u)}return s}getline(e,t=!0){return t?this.lines[e]||"":this.syncLines[e]||""}getLines(e,t){return this.lines.slice(e,t)}getDocumentContent(){let e=this.lines.join(`
|
||
`);return this.eol?e+`
|
||
`:e}getVar(e,t){let i=this.variables[`coc_${e}`];return i===void 0?t:i}getPosition(e,t){let i=this.getline(e-1);if(!i||t==0)return{line:e-1,character:0};let n=Rt(i,0,t-1);return{line:e-1,character:n.length}}getEndOffset(e,t,i){let n=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||(n=n+u.slice(t-1,u.length).toString("utf8").length,i||(n=n-1))}else n=n+l;if(!this.eol&&s==o-1)break;n=n+1}return n}setFiletype(e){this._filetype=this.convertFiletype(e),this._version=this._version+1}setIskeyword(e){let t=this.chars=new Xf(e),i=this.getVar("additional_keywords",[]);if(i&&Array.isArray(i))for(let o of i)t.addKeyword(o);let n=this.lines.length>3e4?this.lines.slice(0,3e4):this.lines;this._words=this.chars.matchKeywords(n.join(`
|
||
`))}get attached(){return this._attached}detach(){this._attached=!1,z(this.disposables),this.disposables=[],this.fetchContent.clear(),this.fireContentChanges.clear(),this._onDocumentChange.dispose(),this._onDocumentDetach.dispose()}getLocalifyBonus(e,t){let i=new Map,{chars:n}=this,o=Math.max(0,e.line-100),s=Math.min(this.lineCount,e.line+100),a=this.lines.slice(o,s).join(`
|
||
`);e=Zi.Position.create(e.line-o,e.character),t=Zi.Position.create(t.line-o,t.character);let l=kt.create(this.uri,this.filetype,1,a),u=l.offsetAt(e),c=a.length,f=c-l.offsetAt(t),p=0,d=!1;for(let h=0;h<u;h++){let m=n.isKeyword(a[h]);if(!d&&m)p=h;else if(d&&(!m||h==u-1)&&h-p>1){let y=a.slice(p,h);i.set(y,h/u)}d=m}p=c-f,d=!1;for(let h=p;h<a.length;h++){let m=n.isKeyword(a[h]);if(!d&&m)p=h;else if(d&&(!m||h==c-1)&&h-p>1){let y=h==c-1?h+1:h,v=a.slice(p,y),x=i.get(v)||0;i.set(v,Math.max(x,(c-h+(y-p))/f))}d=m}return i}},Zm=r0;var Zf=S(W());var sj=S(Qs()),zl=S(require("path"));function Qm(r,e){let t=[[],[]];for(let i of r)e(i)?t[0].push(i):t[1].push(i);return t}function oj(r,e){let t=r.length,i=[];for(let n=0;n<Math.ceil(t/e);n++)i.push(r.slice(n*e,(n+1)*e));return i}function eg(r,e){if(!e)return r.filter((i,n)=>r.indexOf(i)===n);let t=Object.create(null);return r.filter(i=>{let n=e(i);return t[n]?!1:(t[n]=!0,!0)})}var aj=j()("filesystem-watcher"),i0=class{constructor(e,t,i,n,o){this.globPattern=t;this.ignoreCreateEvents=i;this.ignoreChangeEvents=n;this.ignoreDeleteEvents=o;this._onDidCreate=new Zf.Emitter;this._onDidChange=new Zf.Emitter;this._onDidDelete=new Zf.Emitter;this._onDidRename=new Zf.Emitter;this.onDidCreate=this._onDidCreate.event;this.onDidChange=this._onDidChange.event;this.onDidDelete=this._onDidDelete.event;this.onDidRename=this._onDidRename.event;this.disposables=[];!e||e.then(s=>{if(s)return this.listen(s)}).catch(s=>{aj.error("watchman initialize failed"),aj.error(s.stack)})}async listen(e){let{globPattern:t,ignoreCreateEvents:i,ignoreChangeEvents:n,ignoreDeleteEvents:o}=this,s=await e.subscribe(t,a=>{let{root:l,files:u}=a;u=u.filter(c=>c.type=="f"&&sj.default(c.name,t,{dot:!0}));for(let c of u){let f=$.file(zl.default.join(l,c.name));c.exists?c.new===!0?i||this._onDidCreate.fire(f):n||this._onDidChange.fire(f):o||this._onDidDelete.fire(f)}if(u.length==2&&!u[0].exists&&u[1].exists){let c=u[0],f=u[1];c.size==f.size&&this._onDidRename.fire({oldUri:$.file(zl.default.join(l,c.name)),newUri:$.file(zl.default.join(l,f.name))})}if(u.length>=2){let[c,f]=Qm(u,p=>p.exists===!1);if(c.length==f.length)for(let p of c){let d=f.find(h=>h.size==p.size&&h.mtime_ms==p.mtime_ms);d&&this._onDidRename.fire({oldUri:$.file(zl.default.join(l,p.name)),newUri:$.file(zl.default.join(l,d.name))})}}});return this.disposables.push(s),s}dispose(){z(this.disposables)}},tg=i0;var n0=S(require("path")),Uo=S($i()),o0=class{constructor(e,t){this.name=e;this.file=n0.default.join(t||process.env.COC_DATA_HOME,e)}async load(){let e=n0.default.dirname(this.file);try{Uo.default.mkdirpSync(e),Uo.default.existsSync(this.file)||Uo.default.writeFileSync(this.file,"","utf8");let t=await Uo.default.readFile(this.file,"utf8");return t=t.trim(),t.length?t.trim().split(`
|
||
`):[]}catch(t){return[]}}async add(e){let t=await this.load(),i=t.indexOf(e);i!==-1&&t.splice(i,1),t.unshift(e),Uo.default.writeFileSync(this.file,t.join(`
|
||
`),"utf8")}async remove(e){let t=await this.load(),i=t.indexOf(e);i!==-1&&(t.splice(i,1),Uo.default.writeFileSync(this.file,t.join(`
|
||
`),"utf8"))}async clean(){try{await Uo.default.unlink(this.file)}catch(e){}}},Gl=o0;var Vl=S(require("path")),lj=S(require("fs"));var Uke=j()("util-decorator");function s0(r,e,t){let i=t.value;if(typeof i!="function")return;let n="$"+e;t.value=function(...o){return this.hasOwnProperty(n)?Promise.resolve(this[n]):new Promise((s,a)=>{Promise.resolve(i.apply(this,o)).then(l=>{this[n]=l,s(l)},l=>{a(l)})})}}var a0=S(iD()),Vke=j()("model-resolver"),Qf=class{get nodeFolder(){return gf("npm")?hn("npm --loglevel silent root -g",{},3e3).then(e=>a0.default(e).trim()):Promise.resolve("")}get yarnFolder(){return gf("yarnpkg")?hn("yarnpkg global dir",{},3e3).then(e=>{let t=Vl.default.join(a0.default(e).trim(),"node_modules");return lj.default.existsSync(t)?t:""}):Promise.resolve("")}async resolveModule(e){let t=await this.nodeFolder,i=await this.yarnFolder;if(i){let n=await Ht(Vl.default.join(i,e,"package.json"));if(n&&n.isFile())return Vl.default.join(i,e)}if(t){let n=await Ht(Vl.default.join(t,e,"package.json"));if(n&&n.isFile())return Vl.default.join(t,e)}return null}};Ty([s0],Qf.prototype,"nodeFolder",1),Ty([s0],Qf.prototype,"yarnFolder",1);var uj=Qf;var rg=S(W());var l0=class{constructor(e,t){this.nvim=e;this.id=t;this.disposables=[];this._onExit=new rg.Emitter;this._onStderr=new rg.Emitter;this._onStdout=new rg.Emitter;this.onExit=this._onExit.event;this.onStdout=this._onStdout.event;this.onStderr=this._onStderr.event;A.on("TaskExit",(o,s)=>{o==this.id&&this._onExit.fire(s)},null,this.disposables),A.on("TaskStderr",(o,s)=>{o==this.id&&this._onStderr.fire(s)},null,this.disposables);let i=[],n;A.on("TaskStdout",(o,s)=>{o==this.id&&(n&&clearTimeout(n),i.push(...s),n=setTimeout(()=>{this._onStdout.fire(i),i=[]},100))},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(),z(this.disposables)}},cj=l0;var eIe=j()("model-terminal"),u0=class{constructor(e,t,i,n){this.cmd=e;this.args=t;this.nvim=i;this._name=n;this.pid=0}async start(e,t){let{nvim:i}=this,n=[this.cmd,...this.args],[o,s]=await i.call("coc#terminal#start",[n,e,t||{}]);this.bufnr=o,this.pid=s}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[n,o,s]=await i.eval(`[bufloaded(${t}),bufwinid(${t}),win_getid()]`);return n?(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;if(!e)return;let i=await t.call("bufwinnr",e);i!=-1&&await t.command(`${i}close!`)}dispose(){let{bufnr:e,nvim:t}=this;!e||t.call("coc#terminal#close",[e],!0)}},fj=u0;var c0=class{constructor(e,t){this._create=e;this.workspace=t;this.disposables=[];this.itemsMap=new Map;let{disposables:i}=this;for(let n of t.documents)this.create(n);t.onDidOpenTextDocument(n=>{let o=t.getDocument(n.bufnr);o&&this.create(o)},null,i),t.onDidChangeTextDocument(n=>{this.onChange(n)},null,i),t.onDidCloseTextDocument(n=>{this.delete(n.bufnr)},null,i)}get items(){return Array.from(this.itemsMap.values()).map(e=>e.item)}getItem(e){var i;if(typeof e=="number")return(i=this.itemsMap.get(e))==null?void 0:i.item;let t=Array.from(this.itemsMap.values()).find(n=>n.uri==e);return t?t.item:void 0}create(e){if(!e||e.isCommandLine||!e.attached)return;let t=this.itemsMap.get(e.bufnr);t&&t.item.dispose();let i=this._create(e);i&&this.itemsMap.set(e.bufnr,{uri:e.uri,item:i})}onChange(e){let t=this.itemsMap.get(e.bufnr);t&&typeof t.item.onChange=="function"&&t.item.onChange(e)}delete(e){let t=this.itemsMap.get(e);t&&(this.itemsMap.delete(e),t.item.dispose())}reset(){for(let e of this.itemsMap.values())e.item.dispose();this.itemsMap.clear()}dispose(){z(this.disposables);for(let e of this.itemsMap.values())e.item.dispose();this.itemsMap.clear()}},pj=c0;var dj=S(Qs());function f0(r,e,t){if(Array.isArray(r)){let i=0;for(let n of r){let o=f0(n,e,t);if(o===10)return o;o>i&&(i=o)}return i}else{if(typeof r=="string")return r==="*"?5:r===t?10:0;if(r){let i=$.parse(e),{language:n,pattern:o,scheme:s}=r,a=0;if(s)if(s===i.scheme)a=5;else if(s==="*")a=3;else return 0;if(n)if(n===t)a=10;else if(n==="*")a=Math.max(a,5);else return 0;if(o){let l=Hn||Rx,u=l?o.toLowerCase():o,c=l?i.fsPath.toLowerCase():i.fsPath;if(u===c||dj.default(c,u,{dot:!0}))a=5;else return 0}return a}else return 0}}var Lj=S(Oj()),b0=S(require("os")),ag=S(require("path"));var Mj=S(W()),Nj=S(Qs());var lg=j()("watchman"),Kde=["relative_root","cmd-watch-project","wildmatch","field-new"],w0=new Map,np=class{constructor(e,t){this.channel=t;this._disposed=!1;this.client=new Lj.default.Client({watchmanBinaryPath:e}),this.client.setMaxListeners(300)}checkCapability(){let{client:e}=this;return new Promise((t,i)=>{e.capabilityCheck({optional:[],required:Kde},(n,o)=>{if(n)return i(n);let{capabilities:s}=o;for(let a of Object.keys(s))if(!s[a])return t(!1);t(!0)})})}async watchProject(e){try{let t=await this.command(["watch-project",e]),{watch:i,warning:n,relative_path:o}=t;n&&lg.warn(n),this.watch=i,this.relative_path=o,lg.info(`watchman watching project: ${e}`),this.appendOutput(`watchman watching project: ${e}`)}catch(t){return lg.error(t),!1}return!0}command(e){return new Promise((t,i)=>{this.client.command(e,(n,o)=>{if(n)return i(n);t(o)})})}async subscribe(e,t){let{watch:i,relative_path:n}=this;if(!i)return this.appendOutput(`watchman not watching: ${i}`,"Error"),null;let{clock:o}=await this.command(["clock",i]),s=qo(),a={expression:["allof",["match","**/*","wholename"]],fields:["name","size","new","exists","type","mtime_ms","ctime_ms"],since:o},l=i;n&&(a.relative_root=n,l=ag.default.join(i,n));let{subscribe:u}=await this.command(["subscribe",i,s,a]);return global.hasOwnProperty("__TEST__")&&(global.subscribe=u),this.appendOutput(`subscribing "${e}" in ${l}`),this.client.on("subscription",c=>{if(!c||c.subscription!=s)return;let{files:f}=c;if(!f||(f=f.filter(d=>d.type=="f"&&Nj.default(d.name,e,{dot:!0})),!f.length))return;let p=Object.assign({},c);this.relative_path&&(p.root=ag.default.resolve(c.root,this.relative_path)),this.appendOutput(`file change detected: ${JSON.stringify(p,null,2)}`),t(p)}),Mj.Disposable.create(()=>this.unsubscribe(u))}unsubscribe(e){if(this._disposed)return Promise.resolve();let{watch:t}=this;if(!!t)return this.appendOutput(`unsubscribe "${e}" in: ${t}`),this.command(["unsubscribe",t,e]).catch(i=>{lg.error(i)})}dispose(){this._disposed||(this._disposed=!0,this.client.removeAllListeners(),this.client.end())}appendOutput(e,t="Info"){this.channel&&this.channel.appendLine(`[${t} - ${new Date().toLocaleTimeString()}] ${e}`)}static dispose(){for(let e of w0.values())e.then(t=>{t.dispose()},t=>{})}static createClient(e,t,i){if(!Jde(t))return null;let n=w0.get(t);if(n)return n;let o=new Promise(async(s,a)=>{try{let l=new np(e,i);if(!await l.checkCapability()||!await l.watchProject(t))return s(null);s(l)}catch(l){a(l)}});return w0.set(t,o),o}},ta=np;function Jde(r){return!(r=="/"||r=="/tmp"||r=="/private/tmp"||r.toLowerCase()===b0.default.homedir().toLowerCase()||ag.default.parse(r).base==r||r.startsWith("/tmp/")||r.startsWith("/private/tmp/")||Ye(b0.default.tmpdir(),r,!0))}var ug="0.0.80";var jj=8,op=j()("workspace"),cg=2e3,Yde=["showMessage","runTerminalCommand","openTerminal","showQuickpick","menuPick","openLocalConfig","showPrompt","createStatusBarItem","createOutputChannel","showOutputChannel","requestInput","echoLines","getCursorPosition","moveTo","getOffset"],Uj=class{constructor(){this.keymaps=new Map;this.resolver=new uj;this.rootPatterns=new Map;this._workspaceFolders=[];this._insertMode=!1;this._cwd=process.cwd();this._initialized=!1;this._attached=!1;this.buffers=new Map;this.autocmdMaxId=0;this.autocmds=new Map;this.terminals=new Map;this.creatingSources=new Map;this.schemeProviderMap=new Map;this.namespaceMap=new Map;this.disposables=[];this.watchedOptions=new Set;this._dynAutocmd=!1;this._disposed=!1;this._onDidOpenDocument=new le.Emitter;this._onDidCloseDocument=new le.Emitter;this._onDidChangeDocument=new le.Emitter;this._onWillSaveDocument=new le.Emitter;this._onDidSaveDocument=new le.Emitter;this._onDidChangeWorkspaceFolders=new le.Emitter;this._onDidChangeConfiguration=new le.Emitter;this._onDidWorkspaceInitialized=new le.Emitter;this._onDidOpenTerminal=new le.Emitter;this._onDidCloseTerminal=new le.Emitter;this._onDidRuntimePathChange=new le.Emitter;this.onDidCloseTerminal=this._onDidCloseTerminal.event;this.onDidOpenTerminal=this._onDidOpenTerminal.event;this.onDidChangeWorkspaceFolders=this._onDidChangeWorkspaceFolders.event;this.onDidOpenTextDocument=this._onDidOpenDocument.event;this.onDidCloseTextDocument=this._onDidCloseDocument.event;this.onDidChangeTextDocument=this._onDidChangeDocument.event;this.onWillSaveTextDocument=this._onWillSaveDocument.event;this.onDidSaveTextDocument=this._onDidSaveDocument.event;this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;this.onDidWorkspaceInitialized=this._onDidWorkspaceInitialized.event;this.onDidRuntimePathChange=this._onDidRuntimePathChange.event;this.version=ug,this.configurations=this.createConfigurations();let e=process.cwd();e!=Qi.default.homedir()&&Bo(e,[".vim"])&&this._workspaceFolders.push({uri:$.file(e).toString(),name:ke.default.basename(e)})}async init(){let{nvim:e}=this;for(let o of Yde)Object.defineProperty(this,o,{get:()=>(...s)=>C[o].apply(C,s)});this._env=await e.call("coc#util#vim_info"),this._env.apiversion!=jj&&(console.error(`API version ${this._env.apiversion} is not ${jj}, please build coc.nvim by 'yarn install' after pull source code.`),process.exit()),this._insertMode=this._env.mode.startsWith("insert");let i=this.getConfiguration("coc.preferences").get("maxFileSize","10MB");this.maxFileSize=qj.default.parse(i),this._env.workspaceFolders&&(this._workspaceFolders=this._env.workspaceFolders.map(o=>({uri:$.file(o).toString(),name:ke.default.dirname(o)}))),this.configurations.updateUserConfig(this._env.config),A.on(["InsertEnter","CursorMovedI"],()=>{this._insertMode=!0},null,this.disposables),A.on(["InsertLeave","CursorMoved"],()=>{this._insertMode=!1},null,this.disposables);let n=async o=>{let s=this.getDocument(o);s&&s.forceSync()};A.on("InsertLeave",n,null,this.disposables),A.on("CursorHold",n,null,this.disposables),A.on("BufEnter",this.onBufEnter,this,this.disposables),A.on("CursorMoved",this.checkCurrentBuffer,this,this.disposables),A.on("CursorMovedI",this.checkCurrentBuffer,this,this.disposables),A.on("DirChanged",this.onDirChanged,this,this.disposables),A.on("BufCreate",this.onBufCreate,this,this.disposables),A.on("BufUnload",this.onBufUnload,this,this.disposables),A.on("TermOpen",this.onBufCreate,this,this.disposables),A.on("TermClose",this.onBufUnload,this,this.disposables),A.on("BufWritePost",this.onBufWritePost,this,this.disposables),A.on("BufWritePre",this.onBufWritePre,this,this.disposables),A.on("FileType",this.onFileTypeChange,this,this.disposables),A.on("CursorHold",this.checkCurrentBuffer,this,this.disposables),A.on("TextChanged",this.checkBuffer,this,this.disposables),A.on("BufReadCmd",this.onBufReadCmd,this,this.disposables),A.on("VimResized",(o,s)=>{Object.assign(this._env,{columns:o,lines:s})},null,this.disposables),await this.attach(),this.attachChangedEvents(),this.configurations.onDidChange(o=>{this._onDidChangeConfiguration.fire(o)},null,this.disposables),this.watchOption("runtimepath",(o,s)=>{let a=$j.default(o,s);for(let[l,u]of a)if(l==1){let c=u.replace(/,$/,"").split(",");this._onDidRuntimePathChange.fire(c)}this._env.runtimepath=s},this.disposables),this.watchOption("completeopt",async(o,s)=>{if(this.env.completeOpt=s,!!this._attached&&this.insertMode&&this.getConfiguration("suggest").get("autoTrigger")=="always"){let u=(await this.nvim.call("execute",["verbose set completeopt"])).split(/\r?\n/);console.error(`Some plugin change completeopt on insert mode: ${u[u.length-1].trim()}!`)}},this.disposables),this.watchGlobal("coc_sources_disable_map",async(o,s)=>{this.env.disabledSources=s}),this.disposables.push(this.registerTextDocumentContentProvider("output",Xs.getProvider(e)))}getConfigFile(e){return this.configurations.getConfigFile(e)}registerAutocmd(e){this.autocmdMaxId+=1;let t=this.autocmdMaxId;return this.autocmds.set(t,e),this.setupDynamicAutocmd(),le.Disposable.create(()=>{this.autocmds.delete(t),this.setupDynamicAutocmd()})}watchOption(e,t,i){let n=this.watchedOptions.has(e);n||(this.watchedOptions.add(e),this.setupDynamicAutocmd());let o=A.on("OptionSet",async(s,a,l)=>{s==e&&t&&await Promise.resolve(t(a,l))});i&&i.push(le.Disposable.create(()=>{o.dispose(),!n&&(this.watchedOptions.delete(e),this.setupDynamicAutocmd())}))}watchGlobal(e,t,i){let{nvim:n}=this;n.call("coc#_watch",e,!0);let o=A.on("GlobalChange",async(s,a,l)=>{s==e&&t&&await Promise.resolve(t(a,l))});i&&i.push(le.Disposable.create(()=>{o.dispose(),n.call("coc#_unwatch",e,!0)}))}get cwd(){return this._cwd}get env(){return this._env}get root(){return this._root||this.cwd}get rootPath(){return this.root}get workspaceFolders(){return this._workspaceFolders}get uri(){let{bufnr:e}=this;if(e){let t=this.getDocument(e);if(t&&t.schema=="file")return t.uri}return null}get workspaceFolder(){let{rootPath:e}=this;return e==Qi.default.homedir()?null:{uri:$.file(e).toString(),name:ke.default.basename(e)}}get textDocuments(){let e=[];for(let t of this.buffers.values())e.push(t.textDocument);return e}get documents(){return Array.from(this.buffers.values())}createNameSpace(e=""){return this.namespaceMap.has(e)?this.namespaceMap.get(e):(cg=cg+1,this.namespaceMap.set(e,cg),cg)}get channelNames(){return Xs.names}get pluginRoot(){return ke.default.dirname(__dirname)}get isVim(){return this._env.isVim}get isNvim(){return!this._env.isVim}get completeOpt(){return this._env.completeOpt}get initialized(){return this._initialized}get ready(){return this._initialized?Promise.resolve():new Promise(e=>{let t=this.onDidWorkspaceInitialized(()=>{t.dispose(),e()})})}get filetypes(){let e=new Set;for(let t of this.documents)e.add(t.filetype);return e}match(e,t){return f0(e,t.uri,t.languageId)}async findUp(e){let{cwd:t}=this,i=await this.nvim.call("expand","%:p");i=ke.default.normalize(i);let n=i&&ke.default.isAbsolute(i);if(n&&!Ye(t,i,!0))return Hl(e,ke.default.dirname(i));let o=Hl(e,t);return o&&o!=Qi.default.homedir()?o:n?Hl(e,ke.default.dirname(i)):null}async resolveRootFolder(e,t){let{cwd:i}=this;if(e.scheme!="file")return i;let n=ke.default.normalize(e.fsPath),o=ke.default.dirname(n);return Jf(o,t)||o}createFileSystemWatcher(e,t,i,n){let o=global.hasOwnProperty("__TEST__")?null:this.getWatchmanPath(),s=o?C.createOutputChannel("watchman"):null,a=o?ta.createClient(o,this.root,s):Promise.resolve(null);return new tg(a,e,!!t,!!i,!!n)}getWatchmanPath(){let t=this.getConfiguration("coc.preferences").get("watchmanPath","watchman");try{return Bj.default.sync(t)}catch(i){return null}}getConfiguration(e,t){return this.configurations.getConfiguration(e,t)}getDocument(e){if(typeof e=="number")return this.buffers.get(e);let t=Cl.isWindows||Cl.isMacintosh;e=$.parse(e).toString();for(let i of this.buffers.values())if(!!i&&(i.uri===e||t&&i.uri.toLowerCase()===e.toLowerCase()))return i;return null}async applyEdit(e){let{nvim:t}=this,{documentChanges:i,changes:n}=e,[o,s]=await t.eval('[bufnr("%"),coc#util#cursor()]'),a=this.getDocument(o),l=a?a.uri:null,u=null,c=[],f=0,p=this.getConfiguration("coc.preferences"),d=!global.hasOwnProperty("__TEST__")&&p.get("promptWorkspaceEdit",!0),h=p.get("listOfWorkspaceEdit","quickfix");try{if(i&&i.length){let m=this.getChangedUris(i);if(f=m.length,d){let x=m.reduce((w,E)=>w+(this.getDocument(E)==null?1:0),0);if(x&&!await C.showPrompt(`${x} documents on disk would be loaded for change, confirm?`))return}let y=new Map,v=[];for(let x=0;x<i.length;x++){let w=i[x];if(le.TextDocumentEdit.is(w)){let{textDocument:E,edits:P}=w,k=i[x+1];if(v.push(...P),k&&le.TextDocumentEdit.is(k)&&Ne(k.textDocument,E))continue;let _=await this.loadFile(E.uri);E.uri==l&&(u=v),await _.applyEdits(v);for(let O of v)c.push({uri:_.uri,range:O.range});v=[]}else if(le.CreateFile.is(w)){let E=$.parse(w.uri).fsPath;await this.createFile(E,w.options)}else le.RenameFile.is(w)?(y.set(w.oldUri,w.newUri),await this.renameFile($.parse(w.oldUri).fsPath,$.parse(w.newUri).fsPath,w.options)):le.DeleteFile.is(w)&&await this.deleteFile($.parse(w.uri).fsPath,w.options)}y.size&&c.forEach(x=>{let w=y.get(x.uri);w&&(x.uri=w)})}else if(n){let m=Object.keys(n),y=m.filter(v=>this.getDocument(v)==null);if(y.length){if(d&&!await C.showPrompt(`${y.length} documents on disk would be loaded for change, confirm?`))return;await this.loadFiles(y)}for(let v of Object.keys(n)){let x=this.getDocument(v);$.parse(v).toString()==v&&(u=n[v]);let w=n[v];for(let E of w)c.push({uri:x.uri,range:E.range});await x.applyEdits(w)}f=m.length}if(u){let m=$l({line:s[0],character:s[1]},u);m&&await C.moveTo({line:s[0]+m.line,character:s[1]+m.character})}if(c.length){let m=await Promise.all(c.map(v=>this.getQuickfixItem(v))),y=c.every(v=>v.uri==l);h=="quickfix"?(await this.nvim.call("setqflist",[m]),y||C.showMessage(`changed ${f} buffers, use :wa to save changes to disk and :copen to open quickfix list`,"more")):h=="location"&&(await t.setVar("coc_jump_locations",m),y||C.showMessage(`changed ${f} buffers, use :wa to save changes to disk and :CocList location to manage changed locations`,"more"))}}catch(m){return op.error(m),C.showMessage(`Error on applyEdits: ${m.message}`,"error"),!1}return await He(50),!0}async getQuickfixItem(e,t,i="",n){le.LocationLink.is(e)&&(e=le.Location.create(e.targetUri,e.targetRange));let o=this.getDocument(e.uri),{uri:s,range:a}=e,{line:l,character:u}=a.start,c=$.parse(s),f=o?o.bufnr:-1;!t&&c.scheme=="file"&&(t=await this.getLine(s,l),u=Vr(t,u));let p={uri:s,filename:c.scheme=="file"?c.fsPath:s,lnum:l+1,col:u+1,text:t||"",range:a};return n&&(p.module=n),i&&(p.type=i),f!=-1&&(p.bufnr=f),p}createMru(e){return new Gl(e)}async getSelectedRange(e,t){let{nvim:i}=this;if(e==="line"){let c=await i.call("line",["."]),f=t.getline(c-1);return f.length?le.Range.create(c-1,0,c-1,f.length):null}if(e==="cursor"){let[c,f]=await i.eval("coc#util#cursor()");return le.Range.create(c,f,c,f)}if(!["v","V","char","line",""].includes(e))throw new Error(`Mode '${e}' not supported`);let n=["v","V",""].includes(e),[,o,s]=await i.call("getpos",n?"'<":"'["),[,a,l]=await i.call("getpos",n?"'>":"']"),u=le.Range.create(t.getPosition(o,s),t.getPosition(a,l));return(e=="v"||e=="")&&(u.end.character=u.end.character+1),u}async selectRange(e){let{nvim:t}=this,{start:i,end:n}=e,[o,s,a]=await t.eval("[bufnr('%'), &virtualedit, &selection, mode()]"),l=this.getDocument(o);if(!l)return;let u=l.getline(i.line),c=u?ue(u.slice(0,i.character)):0,f=l.getline(n.line),p=f?ue(f.slice(0,n.character)):0,d="",h=!1;d+="v",p=await t.eval(`virtcol([${n.line+1}, ${p}])`),a=="inclusive"?n.character==0?d+=`${n.line}G`:d+=`${n.line+1}G${p}|`:a=="old"?d+=`${n.line+1}G${p}|`:d+=`${n.line+1}G${p+1}|`,c=await t.eval(`virtcol([${i.line+1}, ${c}])`),d+=`o${i.line+1}G${c+1}|o`,t.pauseNotification(),s!="onemore"&&(h=!0,t.setOption("virtualedit","onemore",!0)),t.command(`noa call cursor(${i.line+1},${c+(d=="a"?0:1)})`,!0),t.command(`normal! ${d}`,!0),h&&t.setOption("virtualedit",s,!0),this.isVim&&t.command("redraw",!0),await t.resumeNotification()}async showLocations(e){let t=await Promise.all(e.map(o=>this.getQuickfixItem(o))),{nvim:i}=this;if(this.getConfiguration("coc.preferences").get("useQuickfixForLocations",!1)){let o=await i.getVar("coc_quickfix_open_command");typeof o!="string"&&(o=t.length<10?`copen ${t.length}`:"copen"),i.pauseNotification(),i.call("setqflist",[t],!0),i.command(o,!0),i.resumeNotification(!1,!0)}else await i.setVar("coc_jump_locations",t),this.env.locationlist?i.command("CocList --normal --auto-preview location",!0):i.call("coc#util#do_autocmd",["CocLocationsChange"],!0)}async getLine(e,t){let i=this.getDocument(e);if(i)return i.getline(t)||"";if(!e.startsWith("file:"))return"";let n=$.parse(e).fsPath;return Dt.default.existsSync(n)?await X3(n,t):""}getWorkspaceFolder(e){this.workspaceFolders.sort((i,n)=>n.uri.length-i.uri.length);let t=$.parse(e).fsPath;return this.workspaceFolders.find(i=>Ye($.parse(i.uri).fsPath,t,!0))}async readFile(e){let t=this.getDocument(e);if(t)return await t.patchChange(),t.content;let i=$.parse(e);return i.scheme!="file"?"":(await this.nvim.call("readfile",[i.fsPath])).join(`
|
||
`)+`
|
||
`}get document(){return new Promise((e,t)=>{this.nvim.buffer.then(i=>{let n=i.id;if(this.bufnr=n,this.buffers.has(n)){e(this.buffers.get(n));return}this.onBufCreate(n).catch(t);let o=this.onDidOpenTextDocument(s=>{o.dispose(),e(this.getDocument(s.uri))})},t)})}async getCurrentState(){let e=await this.document,t=await C.getCursorPosition();return{document:e.textDocument,position:t}}async getFormatOptions(e){let t;e&&(t=this.getDocument(e));let i=t?t.bufnr:0,[n,o]=await this.nvim.call("coc#util#get_format_opts",[i]);return{tabSize:n,insertSpaces:o==1}}async jumpTo(e,t,i){let n=this.getConfiguration("coc.preferences"),o=i||n.get("jumpCommand","edit"),{nvim:s}=this,a=this.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),t){let u=a.getline(t.line),c=ue(u.slice(0,t.character))+1;s.call("cursor",[t.line+1,c],!0)}this.isVim&&s.command("redraw",!0),await s.resumeNotification()}else{let{fsPath:u,scheme:c}=$.parse(e),f=t==null?null:[t.line,t.character];if(c=="file"){let p=Kf(ke.default.normalize(u));await this.nvim.call("coc#util#jump",[o,p,f])}else Qi.default.platform()=="win32"&&(e=e.replace(/\/?/,"?")),await this.nvim.call("coc#util#jump",[o,e,f])}}async createFile(e,t={}){let i=await Ht(e);if(i&&!t.overwrite&&!t.ignoreIfExists){C.showMessage(`${e} already exists!`,"error");return}if(!i||t.overwrite)if(e.endsWith("/"))try{e=this.expand(e),await Dt.default.mkdirp(e)}catch(n){C.showMessage(`Can't create ${e}: ${n.message}`,"error")}else{let n=$.file(e).toString();if(this.getDocument(n))return;Dt.default.existsSync(ke.default.dirname(e))||Dt.default.mkdirpSync(ke.default.dirname(e)),Dt.default.writeFileSync(e,"","utf8"),await this.loadFile(n)}}async loadFile(e){let t=this.getDocument(e);if(t)return t;let{nvim:i}=this,n=e.startsWith("file")?$.parse(e).fsPath:e;return i.call("coc#util#open_files",[[n]],!0),await new Promise((o,s)=>{let a=this.onDidOpenTextDocument(u=>{let c=$.parse(u.uri).fsPath;(u.uri==e||c==n)&&(clearTimeout(l),a.dispose(),o(this.getDocument(e)))}),l=setTimeout(()=>{a.dispose(),s(new Error(`Create document ${e} timeout after 1s.`))},1e3)})}async loadFiles(e){if(e=e.filter(n=>this.getDocument(n)==null),!(!e.length||!(await this.nvim.call("coc#util#open_files",[e.map(n=>$.parse(n).fsPath)])).filter(n=>this.getDocument(n)==null).length))return new Promise((n,o)=>{let s=setTimeout(()=>{a.dispose(),o(new Error("Create document timeout after 2s."))},2e3),a=this.onDidOpenTextDocument(()=>{e.every(l=>this.getDocument(l)!=null)&&(clearTimeout(s),a.dispose(),n())})})}async renameFile(e,t,i={}){let{overwrite:n,ignoreIfExists:o}=i,{nvim:s}=this;try{let a=await Ht(t);if(a&&!n&&!o)throw new Error(`${t} already exists`);if(!a||n){let l=$.file(e).toString(),u=$.file(t).toString(),c=this.getDocument(l);if(c!=null){let f=c.bufnr==this.bufnr,p=this.getDocument(u);p&&await this.nvim.command(`silent ${p.bufnr}bwipeout!`);let d=c.getDocumentContent();if(await Dt.default.writeFile(t,d,"utf8"),!f)await s.call("coc#util#open_files",[[t]]),await s.command(`silent ${c.bufnr}bwipeout!`);else{let h=await s.call("winsaveview");s.pauseNotification(),s.call("coc#util#open_file",["keepalt edit",t],!0),s.command(`silent ${c.bufnr}bwipeout!`,!0),s.call("winrestview",[h],!0),await s.resumeNotification()}await Dt.default.unlink(e)}else await K3(e,t)}}catch(a){C.showMessage(`Rename error: ${a.message}`,"error")}}async deleteFile(e,t={}){let{ignoreIfNotExists:i,recursive:n}=t,o=await Ht(e.replace(/\/$/,"")),s=o&&o.isDirectory();if(e.endsWith("/")&&!s){C.showMessage(`${e} is not directory`,"error");return}if(!o&&!i){C.showMessage(`${e} not exists`,"error");return}if(o!=null){if(s&&!n){C.showMessage("Can't remove directory, recursive not set","error");return}try{if(s&&n?await Dt.default.remove(e):s?await Dt.default.rmdir(e):await Dt.default.unlink(e),!s){let a=$.file(e).toString(),l=this.getDocument(a);l&&await this.nvim.command(`silent! bwipeout! ${l.bufnr}`)}}catch(a){C.showMessage(`Error on delete ${e}: ${a.message}`,"error")}}}async openResource(e){let{nvim:t}=this;if(e.startsWith("http")){await t.call("coc#util#open_url",e);return}let i=await t.getOption("wildignore");await t.setOption("wildignore",""),await this.jumpTo(e),await t.setOption("wildignore",i)}async resolveModule(e){return await this.resolver.resolveModule(e)}async runCommand(e,t,i){return t=t||this.cwd,hn(e,{cwd:t},i)}expand(e){if(!e)return e;if(e.startsWith("~")&&(e=Qi.default.homedir()+e.slice(1)),e.includes("$")){let t=this.getDocument(this.bufnr),i=t?$.parse(t.uri).fsPath:"";e=e.replace(/\$\{(.*?)\}/g,(n,o)=>{if(o.startsWith("env:")){let s=o.split(":")[1];return s?process.env[s]:""}switch(o){case"workspace":case"workspaceRoot":case"workspaceFolder":return this.root;case"workspaceFolderBasename":return ke.default.dirname(this.root);case"cwd":return this.cwd;case"file":return i;case"fileDirname":return i?ke.default.dirname(i):"";case"fileExtname":return i?ke.default.extname(i):"";case"fileBasename":return i?ke.default.basename(i):"";case"fileBasenameNoExtension":{let s=i?ke.default.basename(i):"";return s?s.slice(0,s.length-ke.default.extname(s).length):""}default:return n}}),e=e.replace(/\$[\w]+/g,n=>n=="$HOME"?Qi.default.homedir():process.env[n.slice(1)]||n)}return e}async createTerminal(e){let t=e.shellPath,i=e.shellArgs;t||(t=await this.nvim.getOption("shell"));let n=new fj(t,i||[],this.nvim,e.name);return await n.start(e.cwd||this.cwd,e.env),this.terminals.set(n.bufnr,n),this._onDidOpenTerminal.fire(n),n}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){this.schemeProviderMap.set(e,t),this.setupDynamicAutocmd();let i=[];return t.onDidChange&&t.onDidChange(async n=>{let o=this.getDocument(n.toString());if(o){let{buffer:s}=o,a=new le.CancellationTokenSource,l=await Promise.resolve(t.provideTextDocumentContent(n,a.token));await s.setLines(l.split(/\r?\n/),{start:0,end:-1,strictIndexing:!1})}},null,i),le.Disposable.create(()=>{this.schemeProviderMap.delete(e),z(i),this.setupDynamicAutocmd()})}registerKeymap(e,t,i,n={}){if(!t)throw new Error(`Invalid key ${t} of registerKeymap`);if(this.keymaps.has(t))throw new Error(`${t} already exists.`);n=Object.assign({sync:!0,cancel:!0,silent:!0,repeat:!1},n);let{nvim:o}=this;this.keymaps.set(t,[i,!!n.repeat]);let s=n.sync?"request":"notify",a=n.silent?"<silent>":"";for(let l of e)if(l=="i")o.command(`inoremap ${a}<expr> <Plug>(coc-${t}) coc#_insert_key('${s}', '${t}', ${n.cancel?1:0})`,!0);else{let u=Fx(l);o.command(`${l}noremap ${a} <Plug>(coc-${t}) :${u}call coc#rpc#${s}('doKeymap', ['${t}'])<cr>`,!0)}return le.Disposable.create(()=>{this.keymaps.delete(t);for(let l of e)o.command(`${l}unmap <Plug>(coc-${t})`,!0)})}registerExprKeymap(e,t,i,n=!1){if(!t)return;let o=`${e}${global.Buffer.from(t).toString("base64")}${n?"1":"0"}`,{nvim:s}=this;return this.keymaps.set(o,[i,!1]),e=="i"?s.command(`inoremap <silent><expr>${n?"<nowait><buffer>":""} ${t} coc#_insert_key('request', '${o}')`,!0):s.command(`${e}noremap <silent><expr>${n?"<nowait><buffer>":""} ${t} coc#rpc#request('doKeymap', ['${o}'])`,!0),le.Disposable.create(()=>{this.keymaps.delete(o),s.command(`${e}unmap ${n?"<buffer>":""} ${t}`,!0)})}registerLocalKeymap(e,t,i,n=!1){let o=qo(),{nvim:s}=this;this.keymaps.set(o,[i,!1]);let a=this.nvim.createBuffer(this.bufnr),l=n?"notify":"request",u=Fx(e),c=t.startsWith("<")&&t.endsWith(">")?`{${t.slice(1,-1)}}`:t;if(this.isNvim&&!global.hasOwnProperty("__TEST__"))a.notify("nvim_buf_set_keymap",[e,t,`:${u}call coc#rpc#${l}('doKeymap', ['${o}', '', '${c}'])<CR>`,{silent:!0,nowait:!0}]);else{let f=`${e}noremap <silent><nowait><buffer> ${t} :${u}call coc#rpc#${l}('doKeymap', ['${o}', '', '${c}'])<CR>`;s.command(f,!0)}return le.Disposable.create(()=>{this.keymaps.delete(o),s.call("coc#compat#buf_del_keymap",[a.id,e,t],!0)})}createDatabase(e){let t;global.hasOwnProperty("__TEST__")?(t=ke.default.join(Qi.default.tmpdir(),`coc-${process.pid}`),Dt.default.mkdirpSync(t)):t=ke.default.dirname(this.env.extensionRoot);let i=ke.default.join(t,e+".json");return new Ym(i)}createTask(e){return new cj(this.nvim,e)}registerBufferSync(e){return new pj(e,this)}setupDynamicAutocmd(e=!1){if(!e&&!this._dynAutocmd)return;this._dynAutocmd=!0;let t=this.schemeProviderMap.keys(),i=[];for(let o of t)i.push(`autocmd BufReadCmd,FileReadCmd,SourceCmd ${o}:/* call coc#rpc#request('CocAutocmd', ['BufReadCmd','${o}', expand('<amatch>')])`);for(let[o,s]of this.autocmds.entries()){let a=s.arglist&&s.arglist.length?", "+s.arglist.join(", "):"",l=Array.isArray(s.event)?s.event.join(","):s.event,u=s.pattern!=null?s.pattern:"*";/\buser\b/i.test(l)&&(u=""),i.push(`autocmd ${l} ${u} call coc#rpc#${s.request?"request":"notify"}('doAutocmd', [${o}${a}])`)}for(let o of this.watchedOptions)i.push(`autocmd OptionSet ${o} call coc#rpc#notify('OptionSet',[expand('<amatch>'), v:option_old, v:option_new])`);let n=`
|
||
augroup coc_dynamic_autocmd
|
||
autocmd!
|
||
${i.join(`
|
||
`)}
|
||
augroup end`;try{let o=ke.default.join(process.env.TMPDIR,`coc.nvim-${process.pid}`);Dt.default.existsSync(o)||Dt.default.mkdirpSync(o);let s=ke.default.join(o,`coc-${process.pid}.vim`);Dt.default.writeFileSync(s,n,"utf8");let a=`source ${s}`;this.env.isCygwin&&Cl.isWindows&&(a=`execute "source" . substitute(system('cygpath ${s.replace(/\\/g,"/")}'), '\\n', '', 'g')`),this.nvim.command(a).logError()}catch(o){C.showMessage(`Can't create tmp file: ${o.message}`,"error")}}async onBufReadCmd(e,t){let i=this.schemeProviderMap.get(e);if(!i){C.showMessage(`Provider for ${e} not found`,"error");return}let n=new le.CancellationTokenSource,o=await Promise.resolve(i.provideTextDocumentContent($.parse(t),n.token)),s=await this.nvim.buffer;await s.setLines(o.split(/\r?\n/),{start:0,end:-1,strictIndexing:!1}),setTimeout(async()=>{await A.fire("BufCreate",[s.id])},30)}async attach(){if(this._attached)return;this._attached=!0;let[e,t,i]=await this.nvim.eval(`[map(getbufinfo({'bufloaded': 1}),'v:val["bufnr"]'),bufnr('%'),win_getid()]`);this.bufnr=t,await Promise.all(e.map(n=>this.onBufCreate(n))),this._initialized||(this._onDidWorkspaceInitialized.fire(void 0),this._initialized=!0),await A.fire("BufEnter",[t]),await A.fire("BufWinEnter",[t,i])}getChangedUris(e){let t=new Set,i=new Set;for(let n of e)if(le.TextDocumentEdit.is(n)){let{textDocument:o}=n,{uri:s,version:a}=o;if(t.add(s),a!=null&&a>0){let l=this.getDocument(s);if(!l)throw new Error(`${s} not loaded`);if(l.version!=a)throw new Error(`${s} changed before apply edit`)}}else if(le.CreateFile.is(n)||le.DeleteFile.is(n)){if(!Jm(n.uri))throw new Error(`change of scheme ${n.uri} not supported`);i.add(n.uri),t.add(n.uri)}else if(le.RenameFile.is(n)){if(!Jm(n.oldUri)||!Jm(n.newUri))throw new Error(`change of scheme ${n.oldUri} not supported`);let o=$.parse(n.newUri).fsPath;if(Dt.default.existsSync(o))throw new Error(`file "${o}" already exists for rename`);t.add(n.oldUri)}else throw new Error(`Invalid document change: ${JSON.stringify(n,null,2)}`);return Array.from(t)}createConfigurations(){let e=ke.default.normalize(process.env.COC_VIMCONFIG)||ke.default.join(Qi.default.homedir(),".vim"),t=ke.default.join(e,Gi);return new Q3(t,new ej(this))}attachChangedEvents(){if(this.isVim){let e=t=>{let i=this.getDocument(t);i&&i.attached&&i.fetchContent()};A.on("TextChangedI",e,null,this.disposables),A.on("TextChanged",e,null,this.disposables)}}async onBufCreate(e){let t=typeof e=="number"?this.nvim.createBuffer(e):e,i=t.id;if(this.creatingSources.has(i))return;let n=this.getDocument(i),o=new le.CancellationTokenSource;try{n&&this.onBufUnload(i,!0),n=new Zm(t,this._env,this.maxFileSize);let s=o.token;this.creatingSources.set(i,o),await n.init(this.nvim,s)||(n=null)}catch(s){op.error("Error on create buffer:",s),n=null}if(this.creatingSources.get(i)==o&&(o.dispose(),this.creatingSources.delete(i)),!(!n||!n.textDocument)){if(this.buffers.set(i,n),n.attached&&n.onDocumentDetach(s=>{let a=this.getDocument(s);a&&this.onBufUnload(a.bufnr)}),n.buftype==""&&n.schema=="file"&&(this.configurations.checkFolderConfiguration(n.uri),!this.getConfiguration("workspace").get("ignoredFiletypes",[]).includes(n.filetype))){let l=this.resolveRoot(n);l&&(this.addWorkspaceFolder(l),this.bufnr==t.id&&(this._root=l))}if(n.enabled){let s=Object.assign(n.textDocument,{bufnr:i});this._onDidOpenDocument.fire(s),n.onDocumentChange(a=>this._onDidChangeDocument.fire(a))}op.debug("buffer created",t.id)}}onBufEnter(e){this.bufnr=e;let t=this.getDocument(e);if(t){this.configurations.setFolderConfiguration(t.uri);let i=this.getWorkspaceFolder(t.uri);i&&(this._root=$.parse(i.uri).fsPath)}}async checkCurrentBuffer(e){this.bufnr=e,await this.checkBuffer(e)}onBufWritePost(e){let t=this.buffers.get(e);!t||this._onDidSaveDocument.fire(t.textDocument)}onBufUnload(e,t=!1){if(op.debug("buffer unload",e),!t){let n=this.creatingSources.get(e);n&&(n.cancel(),this.creatingSources.delete(e))}if(this.terminals.has(e)){let n=this.terminals.get(e);this._onDidCloseTerminal.fire(n),this.terminals.delete(e)}let i=this.buffers.get(e);if(i){let n=Object.assign(i.textDocument,{bufnr:e});this._onDidCloseDocument.fire(n),this.buffers.delete(e),i.detach()}}async onBufWritePre(e){let t=this.buffers.get(e);if(!t||!t.attached)return;await t.checkDocument();let i=!0,n=[],o={document:t.textDocument,reason:le.TextDocumentSaveReason.Manual,waitUntil:a=>{i?n.push(a):(op.error("Can't call waitUntil in async manner:",Error().stack),C.showMessage("waitUntil can't be used in async manner, check log for details","error"))}};this._onWillSaveDocument.fire(o),i=!1;let s=n.length;if(s){let l=await new Promise(u=>{let c=setTimeout(()=>{C.showMessage("Will save handler timeout after 0.5s","warning"),u(void 0)},500),f=0,p=!1;for(let d of n){let h=m=>{p||(p=!0,clearTimeout(c),u(m))};d.then(m=>{if(Array.isArray(m)&&m.length&&le.TextEdit.is(m[0]))return h(m);f=f+1,f==s&&h(void 0)},()=>{f=f+1,f==s&&h(void 0)})}});l&&await t.applyEdits(l)}}onDirChanged(e){e!=this._cwd&&(this._cwd=e)}onFileTypeChange(e,t){let i=this.getDocument(t);if(!i||i.convertFiletype(e)==i.filetype)return;let o=Object.assign(i.textDocument,{bufnr:t});this._onDidCloseDocument.fire(o),i.setFiletype(e),this._onDidOpenDocument.fire(Object.assign(i.textDocument,{bufnr:t}))}async checkBuffer(e){if(this._disposed||!e)return;!this.getDocument(e)&&!this.creatingSources.has(e)&&await this.onBufCreate(e)}resolveRoot(e){let t=[Kr.Buffer,Kr.LanguageServer,Kr.Global],i=$.parse(e.uri),n=ke.default.dirname(i.fsPath),{cwd:o}=this,s=this.getConfiguration("workspace"),a=s.get("bottomUpFiletypes",[]),l=s.get("workspaceFolderCheckCwd",!0);for(let u of t){let c=this.getRootPatterns(e,u);if(c&&c.length){let f=a.includes(e.filetype),p=Jf(n,c,o,f,l);if(p)return p}}return this.cwd!=Qi.default.homedir()&&Ye(this.cwd,n,!0)?this.cwd:null}getRootPatterns(e,t){let{uri:i}=e;return t==Kr.Buffer?e.getVar("root_patterns",[])||[]:t==Kr.LanguageServer?this.getServerRootPatterns(e.filetype):this.getConfiguration("coc.preferences",i).get("rootPatterns",[".git",".hg",".projections.json"]).slice()}async renameCurrent(){let{nvim:e}=this,t=await e.call("bufnr","%"),i=await e.call("getcwd"),n=this.getDocument(t);if(!n||n.buftype!=""||n.schema!="file"){e.errWriteLine("current buffer is not file.");return}let o=$.parse(n.uri).fsPath,s=await e.callAsync("coc#util#with_callback",["input",["New path: ",o,"file"]]);if(s=s?s.trim():null,s==o||!s)return;let a=await n.buffer.lines,l=Dt.default.existsSync(o);if(l){if(await e.eval("&modified")&&await e.command("noa w"),o.toLowerCase()!=s.toLowerCase()&&Dt.default.existsSync(s)){if(!await C.showPrompt(`${s} exists, overwrite?`))return;Dt.default.unlinkSync(s)}Dt.default.renameSync(o,s)}let u=Ye(i,s)?ke.default.relative(i,s):s,c=await e.call("winsaveview");e.pauseNotification(),o.toLowerCase()==s.toLowerCase()?(e.command(`keepalt ${t}bwipeout!`,!0),e.call("coc#util#open_file",["keepalt edit",u],!0)):(e.call("coc#util#open_file",["keepalt edit",u],!0),e.command(`${t}bwipeout!`,!0)),!l&&a.join(`
|
||
`)!=`
|
||
`&&(e.call("append",[0,a],!0),e.command("normal! Gdd",!0)),e.call("winrestview",[c],!0),await e.resumeNotification()}get folderPaths(){return this.workspaceFolders.map(e=>$.parse(e.uri).fsPath)}get floatSupported(){let{env:e}=this;return e.floating||e.textprop}removeWorkspaceFolder(e){let t=this._workspaceFolders.findIndex(i=>$.parse(i.uri).fsPath==e);if(t!=-1){let i=this._workspaceFolders[t];this._workspaceFolders.splice(t,1),this._onDidChangeWorkspaceFolders.fire({removed:[i],added:[]})}}renameWorkspaceFolder(e,t){let i=this._workspaceFolders.findIndex(s=>$.parse(s.uri).fsPath==e);if(i==-1)return;let n=this._workspaceFolders[i],o={uri:$.file(t).toString(),name:ke.default.dirname(t)};this._workspaceFolders.splice(i,1),this._workspaceFolders.push(o),this._onDidChangeWorkspaceFolders.fire({removed:[n],added:[o]})}addRootPattern(e,t){let i=this.rootPatterns.get(e)||[];for(let n of t)i.includes(n)||i.push(n);this.rootPatterns.set(e,i)}get insertMode(){return this._insertMode}async detach(){if(!!this._attached){this._attached=!1,Xs.dispose();for(let e of this.buffers.keys())await A.fire("BufUnload",[e])}}dispose(){this._disposed=!0;for(let e of this.documents)e.detach();z(this.disposables),ta.dispose(),this.configurations.dispose(),this.buffers.clear()}addWorkspaceFolder(e){if(e==Qi.default.homedir())return;let{_workspaceFolders:t}=this,i=$.file(e).toString(),n={uri:i,name:ke.default.basename(e)};return t.findIndex(o=>o.uri==i)==-1&&(t.push(n),this._initialized&&this._onDidChangeWorkspaceFolders.fire({added:[n],removed:[]})),n}getServerRootPatterns(e){let t=this.getConfiguration().get("languageserver",{}),i=[];for(let n of Object.keys(t)){let o=t[n],{filetypes:s,rootPatterns:a}=o;s&&a&&s.includes(e)&&i.push(...a)}return i=i.concat(this.rootPatterns.get(e)||[]),i.length?eg(i):null}},b=new Uj;var Kl=j()("window"),zj=class{constructor(){this.mutex=new ar}get nvim(){return b.nvim}dispose(){var e;(e=this.statusLine)==null||e.dispose()}showMessage(e,t="more"){if(this.mutex.busy||!this.nvim)return;let{messageLevel:i}=this,n=process.env.VIM_NODE_RPC=="1"?"callTimer":"call";global.hasOwnProperty("__TEST__")&&Kl.info(e);let o="Error",s=gn.Error;switch(t){case"more":s=gn.More,o="MoreMsg";break;case"warning":s=gn.Warning,o="WarningMsg";break}s>=i&&this.nvim[n]("coc#util#echo_messages",[o,("[coc.nvim] "+e).split(`
|
||
`)],!0)}async runTerminalCommand(e,t,i=!1){return t=t||b.cwd,await this.nvim.callAsync("coc#util#run_terminal",{cmd:e,cwd:t,keepfocus:i?1:0})}async openTerminal(e,t={}){return await this.nvim.call("coc#util#open_terminal",{cmd:e,...t})}async showQuickpick(e,t="Choose by number"){let i=await this.mutex.acquire();try{let n=t+":";e=e.map((a,l)=>`${l+1}. ${a}`);let o=await this.nvim.callAsync("coc#util#quickpick",[n,e.map(a=>a.trim())]);i();let s=parseInt(o,10);return isNaN(s)||s<=0||s>e.length?-1:s-1}catch(n){return i(),-1}}async showMenuPicker(e,t,i){if(b.env.dialog){let n=await this.mutex.acquire();if(i&&i.isCancellationRequested){n();return}try{let o=new GB(this.nvim,{items:e.map(l=>l.trim()),title:t},i),s=new Promise(l=>{o.onDidClose(u=>{l(u)})});await o.show(this.dialogPreference);let a=await s;return n(),a}catch(o){Kl.error("Error on showMenuPicker:",o),n()}}return await this.showQuickpick(e)}async openLocalConfig(){let{root:e}=b;if(e==Wj.default.homedir()){this.showMessage("Can't create local config in home directory","warning");return}let t=D0.default.join(e,".vim");if(!x0.default.existsSync(t)){if(!await this.showPrompt(`Would you like to create folder'${e}/.vim'?`))return;x0.default.mkdirSync(t)}await b.jumpTo($.file(D0.default.join(t,Gi)).toString())}async showPrompt(e){let t=await this.mutex.acquire();try{let i=await this.nvim.callAsync("coc#float#prompt_confirm",[e]);return t(),i==1}catch(i){return t(),!1}}async showDialog(e){if(!this.checkDialog())return null;let t=new HB(this.nvim,e);return await t.show(this.dialogPreference),t}async requestInput(e,t){let{nvim:i}=this,n=b.getConfiguration("coc.preferences");if(b.env.dialog&&n.get("promptInput",!0)&&!Hn){let o=await this.mutex.acquire(),s=this.dialogPreference;try{let a={};s.floatHighlight&&(a.highlight=s.floatHighlight),s.floatBorderHighlight&&(a.borderhighlight=s.floatBorderHighlight);let l=await i.call("coc#float#create_prompt_win",[e,t||"",a]),[u,c]=l,f=await new Promise(p=>{let d=[];A.on("BufWinLeave",h=>{h==u&&(z(d),p(null))},null,d),A.on("PromptInsert",async h=>{z(d),await i.call("coc#float#close",[c]),h?p(h):(this.showMessage("Empty word, canceled","warning"),p(null))},null,d)});return o(),f}catch(a){Kl.error("Error on requestInput:",a),o()}}else{let o=await b.callAsync("input",[e+": ",t||""]);return i.command("normal! :<C-u>",!0),o||(this.showMessage("Empty word, canceled","warning"),null)}}createStatusBarItem(e=0,t={}){if(!b.env){let i=()=>{};return{text:"",show:i,dispose:i,hide:i,priority:0,isProgress:!1}}return this.statusLine||(this.statusLine=new r3(this.nvim)),this.statusLine.createStatusBarItem(e,t.progress||!1)}createOutputChannel(e){return Xs.create(e,this.nvim)}showOutputChannel(e,t){Xs.show(e,t)}async echoLines(e,t=!1){let{nvim:i}=this,n=b.env.cmdheight;e.length>n&&t&&(e=e.slice(0,n));let o=b.env.columns-12;if(e=e.map(s=>(s=s.replace(/\n/g," "),t&&(s=s.slice(0,o)),s)),t&&e.length==n){let s=e[e.length-1];e[n-1]=`${s.length==o?s.slice(0,-4):s} ...`}await i.call("coc#util#echo_lines",[e])}async getCursorPosition(){let[e,t]=await this.nvim.eval("[line('.')-1, strpart(getline('.'), 0, col('.') - 1)]");return Hj.Position.create(e,t.length)}async moveTo(e){await this.nvim.call("coc#util#jumpTo",[e.line,e.character]),b.env.isVim&&this.nvim.command("redraw",!0)}async getOffset(){return await this.nvim.call("coc#util#get_offset")}async getCursorScreenPosition(){let[e,t]=await this.nvim.call("coc#util#cursor_pos");return{row:e,col:t}}async showPickerDialog(e,t,i){if(!this.checkDialog())return;let n=await this.mutex.acquire();if(i&&i.isCancellationRequested){n();return}try{let o=typeof e[0]=="string",s=new YB(this.nvim,{title:t,items:o?e.map(c=>({label:c})):e},i),a=new Promise(c=>{s.onDidClose(f=>{c(f)})});await s.show(this.dialogPreference);let l=await a,u=l==null?void 0:e.filter((c,f)=>l.includes(f));return n(),u}catch(o){Kl.error("Error on showPickerDialog:",o),n()}}async showInformationMessage(e,...t){if(!this.enableMessageDialog)return await this.showConfirm(e,t,"Info");let i=typeof t[0]=="string"?t:t.map(o=>o.title),n=await this.createNotification("CocInfoFloat",e,i);return n==-1?void 0:t[n]}async showWarningMessage(e,...t){if(!this.enableMessageDialog)return await this.showConfirm(e,t,"Warning");let i=typeof t[0]=="string"?t:t.map(o=>o.title),n=await this.createNotification("CocWarningFloat",e,i);return n==-1?void 0:t[n]}async showErrorMessage(e,...t){if(!this.enableMessageDialog)return await this.showConfirm(e,t,"Error");let i=typeof t[0]=="string"?t:t.map(o=>o.title),n=await this.createNotification("CocErrorFloat",e,i);return n==-1?void 0:t[n]}async showNotification(e){return this.checkDialog()?await new qf(this.nvim,e).show(this.notificationPreference):!1}async showConfirm(e,t,i){if(!t||t.length==0){let a=i=="Info"?"more":i=="Error"?"error":"warning";this.showMessage(e,a);return}let o=(typeof t[0]=="string"?t.slice():t.map(a=>a.title)).map((a,l)=>`${l+1}${a}`),s=await this.nvim.callAsync("coc#util#with_callback",["confirm",[e,o.join(`
|
||
`),0,i]]);return t[s-1]}async withProgress(e,t){return this.checkDialog()?await new ZB(this.nvim,{task:t,title:e.title,cancellable:e.cancellable}).show(this.notificationPreference):void 0}createNotification(e,t,i){return new Promise(n=>{let o={content:t,borderhighlight:e,close:!0,buttons:i.map((a,l)=>({text:a,index:l})),callback:a=>{n(a)}};new qf(this.nvim,o).show(this.notificationPreference).then(a=>{a||(Kl.error("Unable to open notification window"),n(-1)),i.length||n(-1)},a=>{Kl.error("Unable to open notification window",a),n(-1)})})}get dialogPreference(){let e=b.getConfiguration("dialog");return{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")}}get notificationPreference(){let e=b.getConfiguration("notification");return{top:e.get("marginTop"),right:e.get("marginRight"),maxWidth:e.get("maxWidth"),maxHeight:e.get("maxHeight"),highlight:e.get("highlightGroup"),minProgressWidth:e.get("minProgressWidth")}}checkDialog(){return b.env.dialog?!0:(this.showMessage("Dialog requires vim >= 8.2.0750 or neovim >= 0.4.0, please upgrade your vim","warning"),!1)}get enableMessageDialog(){return b.env.dialog?b.getConfiguration("coc.preferences").get("enableMessageDialog",!1):!1}get messageLevel(){switch(b.getConfiguration("coc.preferences").get("messageLevel","more")){case"error":return gn.Error;case"warning":return gn.Warning;default:return gn.More}}},C=new zj;var Vj=S(Gr()),Qr=S(W());var Lt=S(W());function sp(r){switch(r){case Lt.DiagnosticSeverity.Error:return"Error";case Lt.DiagnosticSeverity.Warning:return"Warning";case Lt.DiagnosticSeverity.Information:return"Information";case Lt.DiagnosticSeverity.Hint:return"Hint";default:return"Error"}}function Gj(r){switch(r){case Lt.DiagnosticSeverity.Error:return"E";case Lt.DiagnosticSeverity.Warning:return"W";case Lt.DiagnosticSeverity.Information:return"I";case Lt.DiagnosticSeverity.Hint:return"I";default:return"Error"}}function S0(r){switch(r){case"hint":return Lt.DiagnosticSeverity.Hint;case"information":return Lt.DiagnosticSeverity.Information;case"warning":return Lt.DiagnosticSeverity.Warning;case"error":return Lt.DiagnosticSeverity.Error;default:return Lt.DiagnosticSeverity.Hint}}function fg(r){switch(r){case Lt.DiagnosticSeverity.Error:return"CocError";case Lt.DiagnosticSeverity.Warning:return"CocWarning";case Lt.DiagnosticSeverity.Information:return"CocInfo";case Lt.DiagnosticSeverity.Hint:return"CocHint";default:return"CocError"}}function pg(r,e){let{start:t}=e.range,i=e.source||"coc.nvim",n=e.message.split(`
|
||
`)[0],o=sp(e.severity).slice(0,1).toUpperCase();return{bufnr:r,lnum:t.line+1,col:t.character+1,text:`[${i}${e.code?" "+e.code:""}] ${n} [${o}]`,type:o}}var Xde=j()("diagnostic-buffer"),Kj="CocDiagnostic",Zde=Symbol("CocError"),Qde=Symbol("CocWarning"),ehe=Symbol("CocInformation"),the=Symbol("CocHint"),E0=class{constructor(e,t,i,n,o){this.nvim=e;this.bufnr=t;this.uri=i;this.config=n;this.onRefresh=o;this.diagnostics=[];this._disposed=!1;this.refresh=Vj.default(s=>{this._refresh(s).logError()},300)}get displayByAle(){return this.config.displayByAle}onChange(){this.refresh.clear()}forceRefresh(e){this.refresh.clear(),this._refresh(e).logError()}refreshAle(e){let t=Jj(this.diagnostics);this.diagnostics=e;let i=new Map;e.forEach(n=>{let o=i.get(n.collection)||[];o.push(n),i.set(n.collection,o)});for(let n of t)i.has(n)||i.set(n,[]);this.nvim.pauseNotification();for(let[n,o]of i.entries()){let s=o.map(l=>{let u=l.range||Qr.Range.create(0,0,1,0);return{text:l.message,code:l.code,lnum:u.start.line+1,col:u.start.character+1,end_lnum:u.end.line+1,end_col:u.end.character,type:Gj(l.severity)}}),a=global.hasOwnProperty("__TEST__")?"MockAleResults":"ale#other_source#ShowResults";this.nvim.call(a,[this.bufnr,n,s],!0)}this.nvim.resumeNotification().then(n=>{Array.isArray(n)&&n[1]!=null&&Xde.error("Error on displayByAle:",n[1][2])}).logError()}async _refresh(e){if(Ne(this.diagnostics,e))return;let{refreshOnInsertMode:t}=this.config,{nvim:i}=this,n=await i.eval(`[coc#util#check_refresh(${this.bufnr}),mode(),line("."),getloclist(bufwinid(${this.bufnr}),{'title':1})]`);if(n[0]==0||this._disposed)return;let o=n[1];if(!(!t&&o.startsWith("i")&&e.length)){if(this.displayByAle)this.refreshAle(e);else{this.diagnostics=e;let s=n[2];i.pauseNotification(),this.setDiagnosticInfo(e),this.addSigns(e),this.addHighlight(e),this.updateLocationList(n[3],e),this.showVirtualText(e,s),this.nvim.command("redraw",!0);let a=await this.nvim.resumeNotification();if(Array.isArray(a)&&a[1])throw new Error(a[1])}this.onRefresh(e)}}updateLocationList(e,t){if(!this.config.locationlistUpdate||!e||e.title!=="Diagnostics of coc")return;let i=[];for(let n of t){let o=pg(this.bufnr,n);i.push(o)}this.nvim.call("setloclist",[0,[],"r",{title:"Diagnostics of coc",items:i}],!0)}addSigns(e){if(!this.config.enableSign)return;this.clearSigns();let{nvim:t,bufnr:i}=this,n=new Map;for(let o of e){let{range:s,severity:a}=o,l=s.start.line,u=fg(a),c=n.get(l)||[],f=rhe(a);c.includes(f)||(c.push(f),n.set(l,c),t.call("sign_place",[0,Kj,u,i,{lnum:l+1,priority:14-(a||0)}],!0))}}clearSigns(){let{nvim:e,bufnr:t}=this;e.call("sign_unplace",[Kj,{buffer:t}],!0)}setDiagnosticInfo(e){let t=[0,0,0,0],i={error:0,warning:0,information:0,hint:0,lnums:t};for(let n of e)switch(n.severity){case Qr.DiagnosticSeverity.Warning:i.warning=i.warning+1,t[1]=t[1]||n.range.start.line+1;break;case Qr.DiagnosticSeverity.Information:i.information=i.information+1,t[2]=t[2]||n.range.start.line+1;break;case Qr.DiagnosticSeverity.Hint:i.hint=i.hint+1,t[3]=t[3]||n.range.start.line+1;break;default:t[0]=t[0]||n.range.start.line+1,i.error=i.error+1}this.nvim.call("coc#util#set_buf_var",[this.bufnr,"coc_diagnostic_info",i],!0),this.nvim.call("coc#util#do_autocmd",["CocDiagnosticChange"],!0)}showVirtualText(e,t){let{buffer:i,config:n}=this;if(!n.virtualText)return;let o=this.config.virtualTextSrcId,s=this.config.virtualTextPrefix;this.config.virtualTextCurrentLineOnly&&(e=e.filter(a=>{let{start:l,end:u}=a.range;return l.line<=t-1&&u.line>=t-1})),i.clearNamespace(o);for(let a of[...e].reverse()){let{line:l}=a.range.start,u=fg(a.severity)+"VirtualText",c=a.message.split(/\n/).map(f=>f.trim()).filter(f=>f.length>0).slice(0,this.config.virtualTextLines).join(this.config.virtualTextLineSeparator);i.setVirtualText(o,l,[[s+c,u]],{}).logError()}}addHighlight(e){if(this.clearHighlight(),e.length==0)return;let t=new Map;for(let i of e){let{range:n,severity:o}=i,s=t.get(o)||[];s.push(n),t.set(o,s)}for(let i of[Qr.DiagnosticSeverity.Hint,Qr.DiagnosticSeverity.Information,Qr.DiagnosticSeverity.Warning,Qr.DiagnosticSeverity.Error]){let n=t.get(i)||[],o=fg(i)+"Highlight";this.buffer.highlightRanges("diagnostic",o,n)}}clearHighlight(){this.buffer.clearNamespace("diagnostic")}get buffer(){return this.nvim.createBuffer(this.bufnr)}clear(){this.refresh.clear();let{nvim:e}=this;if(this.displayByAle){let t=Jj(this.diagnostics);if(this.diagnostics=[],t.size>0)for(let i of t){let n=global.hasOwnProperty("__TEST__")?"MockAleResults":"ale#other_source#ShowResults";this.nvim.call(n,[this.bufnr,i,[]],!0)}}else this.diagnostics=[],e.pauseNotification(),this.clearHighlight(),this.config.enableSign&&this.clearSigns(),this.config.virtualText&&this.buffer.clearNamespace(this.config.virtualTextSrcId),this.setDiagnosticInfo([]),e.resumeNotification(!1,!0)}getDiagnosticsAt(e,t){let i=this.diagnostics.slice();return t?i=i.filter(n=>qB(e.line,n.range)):i=i.filter(n=>Wt(e,n.range)==0),i.sort((n,o)=>n.severity-o.severity),i}dispose(){this._disposed=!0,this.clear()}};function Jj(r){let e=new Set;return r.forEach(t=>{e.add(t.collection)}),e}function rhe(r){return r==Qr.DiagnosticSeverity.Error?Zde:r==Qr.DiagnosticSeverity.Warning?Qde:r==Qr.DiagnosticSeverity.Information?ehe:the}var Jl=S(W());var lAe=j()("diagnostic-collection"),C0=class{constructor(e){this.diagnosticsMap=new Map;this._onDispose=new Jl.Emitter;this._onDidDiagnosticsChange=new Jl.Emitter;this._onDidDiagnosticsClear=new Jl.Emitter;this.onDispose=this._onDispose.event;this.onDidDiagnosticsChange=this._onDidDiagnosticsChange.event;this.onDidDiagnosticsClear=this._onDidDiagnosticsClear.event;this.name=e}set(e,t){let i=new Map;if(Array.isArray(e))for(let n of e){let[o,s]=n,a=b.getDocument(o);o=a?a.uri:o,s==null?s=[]:s=(i.get(o)||[]).concat(s),i.set(o,s)}else{let n=b.getDocument(e),o=n?n.uri:e;i.set(o,t||[])}for(let n of i){let[o,s]=n;o=$.parse(o).toString(),s.forEach(a=>{a.range=a.range||Jl.Range.create(0,0,1,0),a.message=a.message||"Empty error message",Gn(a.range)&&(a.range.end={line:a.range.end.line,character:a.range.end.character+1});let{start:l,end:u}=a.range;if(u.character==0&&u.line-l.line==1&&l.character>0){let c=b.getDocument(o);if(c){let f=c.getline(l.line);l.character==f.length&&(a.range.start.character=l.character-1)}}a.source=a.source||this.name}),this.diagnosticsMap.set(o,s),this._onDidDiagnosticsChange.fire(o)}}delete(e){this.diagnosticsMap.delete(e)}clear(){let e=Array.from(this.diagnosticsMap.keys());this.diagnosticsMap.clear(),this._onDidDiagnosticsClear.fire(e)}forEach(e,t){for(let i of this.diagnosticsMap.keys()){let n=this.diagnosticsMap.get(i);e.call(t,i,n,this)}}get(e){let t=this.diagnosticsMap.get(e);return t==null?[]:t}has(e){return this.diagnosticsMap.has(e)}dispose(){this.clear(),this._onDispose.fire(void 0),this._onDispose.dispose(),this._onDidDiagnosticsClear.dispose(),this._onDidDiagnosticsChange.dispose()}},Yj=C0;var DAe=j()("diagnostic-manager"),Qj=class{constructor(){this.enabled=!0;this._onDidRefresh=new dt.Emitter;this.onDidRefresh=this._onDidRefresh.event;this.lastMessage="";this.collections=[];this.disposables=[]}init(){this.setConfiguration(),b.onDidChangeConfiguration(t=>{this.setConfiguration(t)},null,this.disposables),this.floatFactory=new mn(this.nvim),this.buffers=b.registerBufferSync(t=>{if(t.buftype!=="")return;let i=new E0(this.nvim,t.bufnr,t.uri,this.config,o=>{this._onDidRefresh.fire({diagnostics:o,uri:i.uri,bufnr:i.bufnr}),!["never","jump"].includes(this.config.enableMessage)&&this.echoMessage(!0).logError()}),n=this.getDiagnostics(t.uri);return this.enabled&&i.forceRefresh(n),i}),A.on("CursorMoved",t=>{this.config.enableMessage=="always"&&(this.timer&&clearTimeout(this.timer),t!=this.floatFactory.bufnr&&(this.timer=setTimeout(async()=>{await this.echoMessage(!0)},this.config.messageDelay)))},null,this.disposables);let e=Xj.default((t,i)=>{if(!this.config.virtualText||!this.config.virtualTextCurrentLineOnly)return;let n=this.buffers.getItem(t);if(n){let o=this.getDiagnostics(n.uri);n.showVirtualText(o,i[0])}},100);A.on("CursorMoved",e,null,this.disposables),this.disposables.push(dt.Disposable.create(()=>{e.clear()})),A.on("InsertLeave",async t=>{this.config.refreshOnInsertMode||this.refreshBuffer(t)},null,this.disposables),A.on("BufEnter",async()=>{this.timer&&clearTimeout(this.timer)},null,this.disposables),this.setConfigurationErrors(!0),b.configurations.onError(()=>{this.setConfigurationErrors()},null,this.disposables)}defineSigns(){let{nvim:e}=this,{enableHighlightLineNumber:t,enableSign:i}=this.config;if(!!i){e.pauseNotification();for(let n of["Error","Warning","Info","Hint"]){let o=this.config[n.toLowerCase()+"Sign"],s=`sign define Coc${n} linehl=Coc${n}Line`;o&&(s+=` texthl=Coc${n}Sign text=${o}`),t&&(s+=` numhl=Coc${n}Sign`),e.command(s,!0)}e.resumeNotification(!1,!0)}}async setLocationlist(e){let t=this.buffers.getItem(e),i=t?this.getDiagnostics(t.uri):[],n=[];for(let a of i){let l=pg(e,a);n.push(l)}let o=await this.nvim.call("getloclist",[0,{title:1}]),s=o.title&&o.title.indexOf("Diagnostics of coc")!=-1?"r":" ";await this.nvim.call("setloclist",[0,[],s,{title:"Diagnostics of coc",items:n}])}setConfigurationErrors(e){let i=this.collections.find(o=>o.name=="config");i?i.clear():i=this.create("config");let{errorItems:n}=b.configurations;if(n&&n.length){e&&C.showMessage("settings file parse error, run ':CocList diagnostics'","error");let o=new Map;for(let s of n){let{uri:a}=s.location,l=o.get(a)||[];l.push(dt.Diagnostic.create(s.location.range,s.message,dt.DiagnosticSeverity.Error)),o.set(a,l)}i.set(Array.from(o))}}create(e){let t=this.getCollectionByName(e);return t||(t=new Yj(e),this.collections.push(t),t.onDidDiagnosticsChange(i=>{this.refreshBuffer(i)}),t.onDidDiagnosticsClear(i=>{for(let n of i)this.refreshBuffer(n,!0)}),t.onDispose(()=>{let i=this.collections.findIndex(n=>n==t);i!==-1&&this.collections.splice(i,1)}),t)}getSortedRanges(e,t){let i=this.getCollections(e),n=[],o=t?S0(t):0;for(let s of i){let a=s.get(e);o&&(a=a.filter(u=>u.severity==o));let l=a.map(u=>u.range);n.push(...l)}return n.sort((s,a)=>s.start.line!=a.start.line?s.start.line-a.start.line:s.start.character-a.start.character),n}getDiagnostics(e){let t=this.getCollections(e),{level:i,showUnused:n,showDeprecated:o}=this.config,s=[];for(let a of t){let l=a.get(e);!l||(l=l.filter(u=>{var c,f;return!(i&&i<dt.DiagnosticSeverity.Hint&&u.severity&&u.severity>i||!n&&((c=u.tags)==null?void 0:c.includes(dt.DiagnosticTag.Unnecessary))||!o&&((f=u.tags)==null?void 0:f.includes(dt.DiagnosticTag.Deprecated)))}),l.forEach(u=>{s.push(Object.assign({collection:a.name},u))}))}return s.sort((a,l)=>{if(a.severity==l.severity){let u=Me(a.range.start,l.range.start);return u!=0?u:a.source==l.source?a.message>l.message?1:-1:a.source>l.source?1:-1}return a.severity-l.severity}),s}getDiagnosticsInRange(e,t){let i=this.getCollections(e.uri),n=[];for(let o of i){let s=o.get(e.uri);if(!!s)for(let a of s)ql(a.range,t)&&n.push(a)}return n}async preview(){let[e,t]=await this.nvim.eval('[bufnr("%"),coc#util#cursor()]'),{nvim:i}=this,n=this.getDiagnosticsAt(e,t);if(n.length==0){i.command("pclose",!0),C.showMessage("Empty diagnostics","warning");return}let o=[];for(let s of n){let{source:a,code:l,severity:u,message:c}=s,f=sp(u)[0];o.push(`[${a}${l?" "+l:""}] [${f}]`),o.push(...c.split(/\r?\n/)),o.push("")}i.call("coc#util#preview_info",[o,"txt"],!0)}async jumpPrevious(e){let t=await this.nvim.buffer,i=b.getDocument(t.id);if(!i)return;let n=await C.getCursorPosition(),o=this.getSortedRanges(i.uri,e);if(o.length==0){C.showMessage("Empty diagnostics","warning");return}let s;for(let a=o.length-1;a>=0;a--){let l=o[a].end;if(Me(l,n)<0){s=o[a].start;break}else a==0&&await this.nvim.getOption("wrapscan")&&(s=o[o.length-1].start)}if(s){if(await C.moveTo(s),this.config.enableMessage=="never")return;await this.echoMessage(!1)}}async jumpNext(e){let t=await this.nvim.buffer,i=b.getDocument(t.id),n=await C.getCursorPosition(),o=this.getSortedRanges(i.uri,e);if(o.length==0){C.showMessage("Empty diagnostics","warning");return}let s;for(let a=0;a<=o.length-1;a++){let l=o[a].start;if(Me(l,n)>0){s=o[a].start;break}else a==o.length-1&&await this.nvim.getOption("wrapscan")&&(s=o[0].start)}if(s){if(await C.moveTo(s),this.config.enableMessage=="never")return;await this.echoMessage(!1)}}getDiagnosticList(){let e=[],{level:t,showUnused:i,showDeprecated:n}=this.config;for(let o of this.collections)o.forEach((s,a)=>{var u,c;let l=$.parse(s).fsPath;for(let f of a){if(f.severity&&f.severity>t||!i&&((u=f.tags)==null?void 0:u.includes(dt.DiagnosticTag.Unnecessary))||!n&&((c=f.tags)==null?void 0:c.includes(dt.DiagnosticTag.Deprecated)))continue;let{start:p}=f.range,d={file:l,lnum:p.line+1,col:p.character+1,code:f.code,source:f.source||o.name,message:f.message,severity:sp(f.severity),level:f.severity||0,location:dt.Location.create(s,f.range)};e.push(d)}});return e.sort((o,s)=>o.level!==s.level?o.level-s.level:o.file!==s.file?o.file>s.file?1:-1:o.lnum!=s.lnum?o.lnum-s.lnum:o.col-s.col),e}getDiagnosticsAt(e,t){let i=this.buffers.getItem(e);if(!i)return[];let n=dt.Position.create(t[0],t[1]);return i.getDiagnosticsAt(n,this.config.checkCurrentLine)}async getCurrentDiagnostics(){let[e,t]=await this.nvim.eval('[bufnr("%"),coc#util#cursor()]');return this.getDiagnosticsAt(e,t)}async echoMessage(e=!1){let t=this.config;if(!this.enabled||t.displayByAle)return;this.timer&&clearTimeout(this.timer);let i=t.messageTarget=="float",[n,o,s,a]=await this.nvim.eval('[bufnr("%"),coc#util#cursor(),&filetype,mode()]');if(a!="n")return;let l=this.getDiagnosticsAt(n,o);if(l.length==0){if(i)this.floatFactory.close();else{let f=await this.nvim.call("coc#util#echo_line");this.lastMessage&&f.startsWith(this.lastMessage)&&this.nvim.command('echo ""',!0)}return}if(e&&b.insertMode)return;let u=[],c="";if(Object.keys(t.filetypeMap).length>0){let f=t.filetypeMap.default||"";c=t.filetypeMap[s]||(f=="bufferType"?s:f)}if(l.forEach(f=>{let{source:p,code:d,severity:h,message:m}=f,y=sp(h)[0],v=d?" "+d:"",x=t.format.replace("%source",p).replace("%code",v).replace("%severity",y).replace("%message",m),w="Error";if(c==="")switch(h){case dt.DiagnosticSeverity.Hint:w="Hint";break;case dt.DiagnosticSeverity.Warning:w="Warning";break;case dt.DiagnosticSeverity.Information:w="Info";break}else w=c;u.push({filetype:w,content:x})}),i){let{maxWindowHeight:f,maxWindowWidth:p}=this.config;await this.floatFactory.show(u,{maxWidth:p,maxHeight:f,modes:["n"]})}else{let f=u.map(p=>p.content).join(`
|
||
`).split(/\r?\n/);f.length&&(await this.nvim.command('echo ""'),this.lastMessage=f[0].slice(0,30),await C.echoLines(f,e))}}async jumpRelated(){let e=await this.getCurrentDiagnostics();if(!e)return;let t=e.find(n=>n.relatedInformation!=null);if(!t)return;let i=t.relatedInformation.map(n=>n.location);i.length==1?await b.jumpTo(i[0].uri,i[0].range.start):i.length>1&&await b.showLocations(i)}reset(){this.timer&&clearTimeout(this.timer),this.buffers.reset();for(let e of this.collections)e.dispose();this.collections=[]}dispose(){var e;this.buffers.dispose(),this.timer&&clearTimeout(this.timer);for(let t of this.collections)t.dispose();(e=this.floatFactory)==null||e.close(),this.collections=[],z(this.disposables)}get nvim(){return b.nvim}setConfiguration(e){if(e&&!e.affectsConfiguration("diagnostic"))return;let t=b.getConfiguration("diagnostic"),i=t.get("messageTarget","float");i=="float"&&!b.env.floating&&!b.env.textprop&&(i="echo");let n=t.get("enableHighlightLineNumber",!0);(!b.isNvim||Zj.default.lt(b.env.version,"v0.3.2"))&&(n=!1),this.config={messageTarget:i,enableHighlightLineNumber:n,virtualTextSrcId:b.createNameSpace("diagnostic-virtualText"),checkCurrentLine:t.get("checkCurrentLine",!1),enableSign:b.env.sign&&t.get("enableSign",!0),locationlistUpdate:t.get("locationlistUpdate",!0),maxWindowHeight:t.get("maxWindowHeight",10),maxWindowWidth:t.get("maxWindowWidth",80),enableMessage:t.get("enableMessage","always"),messageDelay:t.get("messageDelay",200),virtualText:t.get("virtualText",!1)&&this.nvim.hasFunction("nvim_buf_set_virtual_text"),virtualTextCurrentLineOnly:t.get("virtualTextCurrentLineOnly",!0),virtualTextPrefix:t.get("virtualTextPrefix"," "),virtualTextLineSeparator:t.get("virtualTextLineSeparator"," \\ "),virtualTextLines:t.get("virtualTextLines",3),displayByAle:t.get("displayByAle",!1),level:S0(t.get("level","hint")),signPriority:t.get("signPriority",10),errorSign:t.get("errorSign",">>"),warningSign:t.get("warningSign",">>"),infoSign:t.get("infoSign",">>"),hintSign:t.get("hintSign",">>"),refreshOnInsertMode:t.get("refreshOnInsertMode",!1),filetypeMap:t.get("filetypeMap",{}),showUnused:t.get("showUnused",!0),showDeprecated:t.get("showDeprecated",!0),format:t.get("format","[%source%code] [%severity] %message")},this.enabled=t.get("enable",!0),this.defineSigns()}getCollectionByName(e){return this.collections.find(t=>t.name==e)}getCollections(e){return this.collections.filter(t=>t.has(e))}toggleDiagnostic(){let{enabled:e}=this;this.enabled=!e;for(let t of this.buffers.items)if(this.enabled){let i=this.getDiagnostics(t.uri);t.forceRefresh(i)}else t.clear()}refreshBuffer(e,t=!1){if(!this.enabled)return!1;let i=this.buffers.getItem(e);if(!i)return!1;let n=this.getDiagnostics(i.uri);return t?i.forceRefresh(n):i.refresh(n),!0}},St=new Qj;var ht;(function(r){r[r.Null=0]="Null",r[r.Backspace=8]="Backspace",r[r.Tab=9]="Tab",r[r.LineFeed=10]="LineFeed",r[r.CarriageReturn=13]="CarriageReturn",r[r.Space=32]="Space",r[r.ExclamationMark=33]="ExclamationMark",r[r.DoubleQuote=34]="DoubleQuote",r[r.Hash=35]="Hash",r[r.DollarSign=36]="DollarSign",r[r.PercentSign=37]="PercentSign",r[r.Ampersand=38]="Ampersand",r[r.SingleQuote=39]="SingleQuote",r[r.OpenParen=40]="OpenParen",r[r.CloseParen=41]="CloseParen",r[r.Asterisk=42]="Asterisk",r[r.Plus=43]="Plus",r[r.Comma=44]="Comma",r[r.Dash=45]="Dash",r[r.Period=46]="Period",r[r.Slash=47]="Slash",r[r.Digit0=48]="Digit0",r[r.Digit1=49]="Digit1",r[r.Digit2=50]="Digit2",r[r.Digit3=51]="Digit3",r[r.Digit4=52]="Digit4",r[r.Digit5=53]="Digit5",r[r.Digit6=54]="Digit6",r[r.Digit7=55]="Digit7",r[r.Digit8=56]="Digit8",r[r.Digit9=57]="Digit9",r[r.Colon=58]="Colon",r[r.Semicolon=59]="Semicolon",r[r.LessThan=60]="LessThan",r[r.Equals=61]="Equals",r[r.GreaterThan=62]="GreaterThan",r[r.QuestionMark=63]="QuestionMark",r[r.AtSign=64]="AtSign",r[r.A=65]="A",r[r.B=66]="B",r[r.C=67]="C",r[r.D=68]="D",r[r.E=69]="E",r[r.F=70]="F",r[r.G=71]="G",r[r.H=72]="H",r[r.I=73]="I",r[r.J=74]="J",r[r.K=75]="K",r[r.L=76]="L",r[r.M=77]="M",r[r.N=78]="N",r[r.O=79]="O",r[r.P=80]="P",r[r.Q=81]="Q",r[r.R=82]="R",r[r.S=83]="S",r[r.T=84]="T",r[r.U=85]="U",r[r.V=86]="V",r[r.W=87]="W",r[r.X=88]="X",r[r.Y=89]="Y",r[r.Z=90]="Z",r[r.OpenSquareBracket=91]="OpenSquareBracket",r[r.Backslash=92]="Backslash",r[r.CloseSquareBracket=93]="CloseSquareBracket",r[r.Caret=94]="Caret",r[r.Underline=95]="Underline",r[r.BackTick=96]="BackTick",r[r.a=97]="a",r[r.b=98]="b",r[r.c=99]="c",r[r.d=100]="d",r[r.e=101]="e",r[r.f=102]="f",r[r.g=103]="g",r[r.h=104]="h",r[r.i=105]="i",r[r.j=106]="j",r[r.k=107]="k",r[r.l=108]="l",r[r.m=109]="m",r[r.n=110]="n",r[r.o=111]="o",r[r.p=112]="p",r[r.q=113]="q",r[r.r=114]="r",r[r.s=115]="s",r[r.t=116]="t",r[r.u=117]="u",r[r.v=118]="v",r[r.w=119]="w",r[r.x=120]="x",r[r.y=121]="y",r[r.z=122]="z",r[r.OpenCurlyBrace=123]="OpenCurlyBrace",r[r.Pipe=124]="Pipe",r[r.CloseCurlyBrace=125]="CloseCurlyBrace",r[r.Tilde=126]="Tilde",r[r.U_Combining_Grave_Accent=768]="U_Combining_Grave_Accent",r[r.U_Combining_Acute_Accent=769]="U_Combining_Acute_Accent",r[r.U_Combining_Circumflex_Accent=770]="U_Combining_Circumflex_Accent",r[r.U_Combining_Tilde=771]="U_Combining_Tilde",r[r.U_Combining_Macron=772]="U_Combining_Macron",r[r.U_Combining_Overline=773]="U_Combining_Overline",r[r.U_Combining_Breve=774]="U_Combining_Breve",r[r.U_Combining_Dot_Above=775]="U_Combining_Dot_Above",r[r.U_Combining_Diaeresis=776]="U_Combining_Diaeresis",r[r.U_Combining_Hook_Above=777]="U_Combining_Hook_Above",r[r.U_Combining_Ring_Above=778]="U_Combining_Ring_Above",r[r.U_Combining_Double_Acute_Accent=779]="U_Combining_Double_Acute_Accent",r[r.U_Combining_Caron=780]="U_Combining_Caron",r[r.U_Combining_Vertical_Line_Above=781]="U_Combining_Vertical_Line_Above",r[r.U_Combining_Double_Vertical_Line_Above=782]="U_Combining_Double_Vertical_Line_Above",r[r.U_Combining_Double_Grave_Accent=783]="U_Combining_Double_Grave_Accent",r[r.U_Combining_Candrabindu=784]="U_Combining_Candrabindu",r[r.U_Combining_Inverted_Breve=785]="U_Combining_Inverted_Breve",r[r.U_Combining_Turned_Comma_Above=786]="U_Combining_Turned_Comma_Above",r[r.U_Combining_Comma_Above=787]="U_Combining_Comma_Above",r[r.U_Combining_Reversed_Comma_Above=788]="U_Combining_Reversed_Comma_Above",r[r.U_Combining_Comma_Above_Right=789]="U_Combining_Comma_Above_Right",r[r.U_Combining_Grave_Accent_Below=790]="U_Combining_Grave_Accent_Below",r[r.U_Combining_Acute_Accent_Below=791]="U_Combining_Acute_Accent_Below",r[r.U_Combining_Left_Tack_Below=792]="U_Combining_Left_Tack_Below",r[r.U_Combining_Right_Tack_Below=793]="U_Combining_Right_Tack_Below",r[r.U_Combining_Left_Angle_Above=794]="U_Combining_Left_Angle_Above",r[r.U_Combining_Horn=795]="U_Combining_Horn",r[r.U_Combining_Left_Half_Ring_Below=796]="U_Combining_Left_Half_Ring_Below",r[r.U_Combining_Up_Tack_Below=797]="U_Combining_Up_Tack_Below",r[r.U_Combining_Down_Tack_Below=798]="U_Combining_Down_Tack_Below",r[r.U_Combining_Plus_Sign_Below=799]="U_Combining_Plus_Sign_Below",r[r.U_Combining_Minus_Sign_Below=800]="U_Combining_Minus_Sign_Below",r[r.U_Combining_Palatalized_Hook_Below=801]="U_Combining_Palatalized_Hook_Below",r[r.U_Combining_Retroflex_Hook_Below=802]="U_Combining_Retroflex_Hook_Below",r[r.U_Combining_Dot_Below=803]="U_Combining_Dot_Below",r[r.U_Combining_Diaeresis_Below=804]="U_Combining_Diaeresis_Below",r[r.U_Combining_Ring_Below=805]="U_Combining_Ring_Below",r[r.U_Combining_Comma_Below=806]="U_Combining_Comma_Below",r[r.U_Combining_Cedilla=807]="U_Combining_Cedilla",r[r.U_Combining_Ogonek=808]="U_Combining_Ogonek",r[r.U_Combining_Vertical_Line_Below=809]="U_Combining_Vertical_Line_Below",r[r.U_Combining_Bridge_Below=810]="U_Combining_Bridge_Below",r[r.U_Combining_Inverted_Double_Arch_Below=811]="U_Combining_Inverted_Double_Arch_Below",r[r.U_Combining_Caron_Below=812]="U_Combining_Caron_Below",r[r.U_Combining_Circumflex_Accent_Below=813]="U_Combining_Circumflex_Accent_Below",r[r.U_Combining_Breve_Below=814]="U_Combining_Breve_Below",r[r.U_Combining_Inverted_Breve_Below=815]="U_Combining_Inverted_Breve_Below",r[r.U_Combining_Tilde_Below=816]="U_Combining_Tilde_Below",r[r.U_Combining_Macron_Below=817]="U_Combining_Macron_Below",r[r.U_Combining_Low_Line=818]="U_Combining_Low_Line",r[r.U_Combining_Double_Low_Line=819]="U_Combining_Double_Low_Line",r[r.U_Combining_Tilde_Overlay=820]="U_Combining_Tilde_Overlay",r[r.U_Combining_Short_Stroke_Overlay=821]="U_Combining_Short_Stroke_Overlay",r[r.U_Combining_Long_Stroke_Overlay=822]="U_Combining_Long_Stroke_Overlay",r[r.U_Combining_Short_Solidus_Overlay=823]="U_Combining_Short_Solidus_Overlay",r[r.U_Combining_Long_Solidus_Overlay=824]="U_Combining_Long_Solidus_Overlay",r[r.U_Combining_Right_Half_Ring_Below=825]="U_Combining_Right_Half_Ring_Below",r[r.U_Combining_Inverted_Bridge_Below=826]="U_Combining_Inverted_Bridge_Below",r[r.U_Combining_Square_Below=827]="U_Combining_Square_Below",r[r.U_Combining_Seagull_Below=828]="U_Combining_Seagull_Below",r[r.U_Combining_X_Above=829]="U_Combining_X_Above",r[r.U_Combining_Vertical_Tilde=830]="U_Combining_Vertical_Tilde",r[r.U_Combining_Double_Overline=831]="U_Combining_Double_Overline",r[r.U_Combining_Grave_Tone_Mark=832]="U_Combining_Grave_Tone_Mark",r[r.U_Combining_Acute_Tone_Mark=833]="U_Combining_Acute_Tone_Mark",r[r.U_Combining_Greek_Perispomeni=834]="U_Combining_Greek_Perispomeni",r[r.U_Combining_Greek_Koronis=835]="U_Combining_Greek_Koronis",r[r.U_Combining_Greek_Dialytika_Tonos=836]="U_Combining_Greek_Dialytika_Tonos",r[r.U_Combining_Greek_Ypogegrammeni=837]="U_Combining_Greek_Ypogegrammeni",r[r.U_Combining_Bridge_Above=838]="U_Combining_Bridge_Above",r[r.U_Combining_Equals_Sign_Below=839]="U_Combining_Equals_Sign_Below",r[r.U_Combining_Double_Vertical_Line_Below=840]="U_Combining_Double_Vertical_Line_Below",r[r.U_Combining_Left_Angle_Below=841]="U_Combining_Left_Angle_Below",r[r.U_Combining_Not_Tilde_Above=842]="U_Combining_Not_Tilde_Above",r[r.U_Combining_Homothetic_Above=843]="U_Combining_Homothetic_Above",r[r.U_Combining_Almost_Equal_To_Above=844]="U_Combining_Almost_Equal_To_Above",r[r.U_Combining_Left_Right_Arrow_Below=845]="U_Combining_Left_Right_Arrow_Below",r[r.U_Combining_Upwards_Arrow_Below=846]="U_Combining_Upwards_Arrow_Below",r[r.U_Combining_Grapheme_Joiner=847]="U_Combining_Grapheme_Joiner",r[r.U_Combining_Right_Arrowhead_Above=848]="U_Combining_Right_Arrowhead_Above",r[r.U_Combining_Left_Half_Ring_Above=849]="U_Combining_Left_Half_Ring_Above",r[r.U_Combining_Fermata=850]="U_Combining_Fermata",r[r.U_Combining_X_Below=851]="U_Combining_X_Below",r[r.U_Combining_Left_Arrowhead_Below=852]="U_Combining_Left_Arrowhead_Below",r[r.U_Combining_Right_Arrowhead_Below=853]="U_Combining_Right_Arrowhead_Below",r[r.U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below=854]="U_Combining_Right_Arrowhead_And_Up_Arrowhead_Below",r[r.U_Combining_Right_Half_Ring_Above=855]="U_Combining_Right_Half_Ring_Above",r[r.U_Combining_Dot_Above_Right=856]="U_Combining_Dot_Above_Right",r[r.U_Combining_Asterisk_Below=857]="U_Combining_Asterisk_Below",r[r.U_Combining_Double_Ring_Below=858]="U_Combining_Double_Ring_Below",r[r.U_Combining_Zigzag_Above=859]="U_Combining_Zigzag_Above",r[r.U_Combining_Double_Breve_Below=860]="U_Combining_Double_Breve_Below",r[r.U_Combining_Double_Breve=861]="U_Combining_Double_Breve",r[r.U_Combining_Double_Macron=862]="U_Combining_Double_Macron",r[r.U_Combining_Double_Macron_Below=863]="U_Combining_Double_Macron_Below",r[r.U_Combining_Double_Tilde=864]="U_Combining_Double_Tilde",r[r.U_Combining_Double_Inverted_Breve=865]="U_Combining_Double_Inverted_Breve",r[r.U_Combining_Double_Rightwards_Arrow_Below=866]="U_Combining_Double_Rightwards_Arrow_Below",r[r.U_Combining_Latin_Small_Letter_A=867]="U_Combining_Latin_Small_Letter_A",r[r.U_Combining_Latin_Small_Letter_E=868]="U_Combining_Latin_Small_Letter_E",r[r.U_Combining_Latin_Small_Letter_I=869]="U_Combining_Latin_Small_Letter_I",r[r.U_Combining_Latin_Small_Letter_O=870]="U_Combining_Latin_Small_Letter_O",r[r.U_Combining_Latin_Small_Letter_U=871]="U_Combining_Latin_Small_Letter_U",r[r.U_Combining_Latin_Small_Letter_C=872]="U_Combining_Latin_Small_Letter_C",r[r.U_Combining_Latin_Small_Letter_D=873]="U_Combining_Latin_Small_Letter_D",r[r.U_Combining_Latin_Small_Letter_H=874]="U_Combining_Latin_Small_Letter_H",r[r.U_Combining_Latin_Small_Letter_M=875]="U_Combining_Latin_Small_Letter_M",r[r.U_Combining_Latin_Small_Letter_R=876]="U_Combining_Latin_Small_Letter_R",r[r.U_Combining_Latin_Small_Letter_T=877]="U_Combining_Latin_Small_Letter_T",r[r.U_Combining_Latin_Small_Letter_V=878]="U_Combining_Latin_Small_Letter_V",r[r.U_Combining_Latin_Small_Letter_X=879]="U_Combining_Latin_Small_Letter_X",r[r.LINE_SEPARATOR_2028=8232]="LINE_SEPARATOR_2028",r[r.U_CIRCUMFLEX=94]="U_CIRCUMFLEX",r[r.U_GRAVE_ACCENT=96]="U_GRAVE_ACCENT",r[r.U_DIAERESIS=168]="U_DIAERESIS",r[r.U_MACRON=175]="U_MACRON",r[r.U_ACUTE_ACCENT=180]="U_ACUTE_ACCENT",r[r.U_CEDILLA=184]="U_CEDILLA",r[r.U_MODIFIER_LETTER_LEFT_ARROWHEAD=706]="U_MODIFIER_LETTER_LEFT_ARROWHEAD",r[r.U_MODIFIER_LETTER_RIGHT_ARROWHEAD=707]="U_MODIFIER_LETTER_RIGHT_ARROWHEAD",r[r.U_MODIFIER_LETTER_UP_ARROWHEAD=708]="U_MODIFIER_LETTER_UP_ARROWHEAD",r[r.U_MODIFIER_LETTER_DOWN_ARROWHEAD=709]="U_MODIFIER_LETTER_DOWN_ARROWHEAD",r[r.U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING=722]="U_MODIFIER_LETTER_CENTRED_RIGHT_HALF_RING",r[r.U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING=723]="U_MODIFIER_LETTER_CENTRED_LEFT_HALF_RING",r[r.U_MODIFIER_LETTER_UP_TACK=724]="U_MODIFIER_LETTER_UP_TACK",r[r.U_MODIFIER_LETTER_DOWN_TACK=725]="U_MODIFIER_LETTER_DOWN_TACK",r[r.U_MODIFIER_LETTER_PLUS_SIGN=726]="U_MODIFIER_LETTER_PLUS_SIGN",r[r.U_MODIFIER_LETTER_MINUS_SIGN=727]="U_MODIFIER_LETTER_MINUS_SIGN",r[r.U_BREVE=728]="U_BREVE",r[r.U_DOT_ABOVE=729]="U_DOT_ABOVE",r[r.U_RING_ABOVE=730]="U_RING_ABOVE",r[r.U_OGONEK=731]="U_OGONEK",r[r.U_SMALL_TILDE=732]="U_SMALL_TILDE",r[r.U_DOUBLE_ACUTE_ACCENT=733]="U_DOUBLE_ACUTE_ACCENT",r[r.U_MODIFIER_LETTER_RHOTIC_HOOK=734]="U_MODIFIER_LETTER_RHOTIC_HOOK",r[r.U_MODIFIER_LETTER_CROSS_ACCENT=735]="U_MODIFIER_LETTER_CROSS_ACCENT",r[r.U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR=741]="U_MODIFIER_LETTER_EXTRA_HIGH_TONE_BAR",r[r.U_MODIFIER_LETTER_HIGH_TONE_BAR=742]="U_MODIFIER_LETTER_HIGH_TONE_BAR",r[r.U_MODIFIER_LETTER_MID_TONE_BAR=743]="U_MODIFIER_LETTER_MID_TONE_BAR",r[r.U_MODIFIER_LETTER_LOW_TONE_BAR=744]="U_MODIFIER_LETTER_LOW_TONE_BAR",r[r.U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR=745]="U_MODIFIER_LETTER_EXTRA_LOW_TONE_BAR",r[r.U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK=746]="U_MODIFIER_LETTER_YIN_DEPARTING_TONE_MARK",r[r.U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK=747]="U_MODIFIER_LETTER_YANG_DEPARTING_TONE_MARK",r[r.U_MODIFIER_LETTER_UNASPIRATED=749]="U_MODIFIER_LETTER_UNASPIRATED",r[r.U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD=751]="U_MODIFIER_LETTER_LOW_DOWN_ARROWHEAD",r[r.U_MODIFIER_LETTER_LOW_UP_ARROWHEAD=752]="U_MODIFIER_LETTER_LOW_UP_ARROWHEAD",r[r.U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD=753]="U_MODIFIER_LETTER_LOW_LEFT_ARROWHEAD",r[r.U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD=754]="U_MODIFIER_LETTER_LOW_RIGHT_ARROWHEAD",r[r.U_MODIFIER_LETTER_LOW_RING=755]="U_MODIFIER_LETTER_LOW_RING",r[r.U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT=756]="U_MODIFIER_LETTER_MIDDLE_GRAVE_ACCENT",r[r.U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT=757]="U_MODIFIER_LETTER_MIDDLE_DOUBLE_GRAVE_ACCENT",r[r.U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT=758]="U_MODIFIER_LETTER_MIDDLE_DOUBLE_ACUTE_ACCENT",r[r.U_MODIFIER_LETTER_LOW_TILDE=759]="U_MODIFIER_LETTER_LOW_TILDE",r[r.U_MODIFIER_LETTER_RAISED_COLON=760]="U_MODIFIER_LETTER_RAISED_COLON",r[r.U_MODIFIER_LETTER_BEGIN_HIGH_TONE=761]="U_MODIFIER_LETTER_BEGIN_HIGH_TONE",r[r.U_MODIFIER_LETTER_END_HIGH_TONE=762]="U_MODIFIER_LETTER_END_HIGH_TONE",r[r.U_MODIFIER_LETTER_BEGIN_LOW_TONE=763]="U_MODIFIER_LETTER_BEGIN_LOW_TONE",r[r.U_MODIFIER_LETTER_END_LOW_TONE=764]="U_MODIFIER_LETTER_END_LOW_TONE",r[r.U_MODIFIER_LETTER_SHELF=765]="U_MODIFIER_LETTER_SHELF",r[r.U_MODIFIER_LETTER_OPEN_SHELF=766]="U_MODIFIER_LETTER_OPEN_SHELF",r[r.U_MODIFIER_LETTER_LOW_LEFT_ARROW=767]="U_MODIFIER_LETTER_LOW_LEFT_ARROW",r[r.U_GREEK_LOWER_NUMERAL_SIGN=885]="U_GREEK_LOWER_NUMERAL_SIGN",r[r.U_GREEK_TONOS=900]="U_GREEK_TONOS",r[r.U_GREEK_DIALYTIKA_TONOS=901]="U_GREEK_DIALYTIKA_TONOS",r[r.U_GREEK_KORONIS=8125]="U_GREEK_KORONIS",r[r.U_GREEK_PSILI=8127]="U_GREEK_PSILI",r[r.U_GREEK_PERISPOMENI=8128]="U_GREEK_PERISPOMENI",r[r.U_GREEK_DIALYTIKA_AND_PERISPOMENI=8129]="U_GREEK_DIALYTIKA_AND_PERISPOMENI",r[r.U_GREEK_PSILI_AND_VARIA=8141]="U_GREEK_PSILI_AND_VARIA",r[r.U_GREEK_PSILI_AND_OXIA=8142]="U_GREEK_PSILI_AND_OXIA",r[r.U_GREEK_PSILI_AND_PERISPOMENI=8143]="U_GREEK_PSILI_AND_PERISPOMENI",r[r.U_GREEK_DASIA_AND_VARIA=8157]="U_GREEK_DASIA_AND_VARIA",r[r.U_GREEK_DASIA_AND_OXIA=8158]="U_GREEK_DASIA_AND_OXIA",r[r.U_GREEK_DASIA_AND_PERISPOMENI=8159]="U_GREEK_DASIA_AND_PERISPOMENI",r[r.U_GREEK_DIALYTIKA_AND_VARIA=8173]="U_GREEK_DIALYTIKA_AND_VARIA",r[r.U_GREEK_DIALYTIKA_AND_OXIA=8174]="U_GREEK_DIALYTIKA_AND_OXIA",r[r.U_GREEK_VARIA=8175]="U_GREEK_VARIA",r[r.U_GREEK_OXIA=8189]="U_GREEK_OXIA",r[r.U_GREEK_DASIA=8190]="U_GREEK_DASIA",r[r.U_OVERLINE=8254]="U_OVERLINE",r[r.UTF8_BOM=65279]="UTF8_BOM"})(ht||(ht={}));var PAe=j()("snippets-parser"),G;(function(r){r[r.Dollar=0]="Dollar",r[r.Colon=1]="Colon",r[r.Comma=2]="Comma",r[r.CurlyOpen=3]="CurlyOpen",r[r.CurlyClose=4]="CurlyClose",r[r.Backslash=5]="Backslash",r[r.Forwardslash=6]="Forwardslash",r[r.Pipe=7]="Pipe",r[r.Int=8]="Int",r[r.VariableName=9]="VariableName",r[r.Format=10]="Format",r[r.Plus=11]="Plus",r[r.Dash=12]="Dash",r[r.QuestionMark=13]="QuestionMark",r[r.EOF=14]="EOF"})(G||(G={}));var en=class{static isDigitCharacter(e){return e>=ht.Digit0&&e<=ht.Digit9}static isVariableCharacter(e){return e===ht.Underline||e>=ht.a&&e<=ht.z||e>=ht.A&&e<=ht.Z}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),n;if(n=en._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(en.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(en.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(en.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(en.isVariableCharacter(i)||en.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof en._table[i]=="undefined"&&!en.isDigitCharacter(i)&&!en.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}},_0=en;_0._table={[ht.DollarSign]:0,[ht.Colon]:1,[ht.Comma]:2,[ht.OpenCurlyBrace]:3,[ht.CloseCurlyBrace]:4,[ht.Backslash]:5,[ht.Slash]:6,[ht.Pipe]:7,[ht.Plus]:11,[ht.Dash]:12,[ht.QuestionMark]:13};var ra=class{constructor(){this._children=[]}appendChild(e){return e instanceof ut&&this._children[this._children.length-1]instanceof ut?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]}replace(e,t){let{parent:i}=e,n=i.children.indexOf(e),o=i.children.slice(0);o.splice(n,1,...t),i._children=o,function s(a,l){for(let u of a)u.parent=l,s(u.children,u)}(t,i)}get children(){return this._children}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof ap)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}get next(){let{parent:e}=this,{children:t}=e,i=t.indexOf(this);return t[i+1]}},ut=class extends ra{constructor(e){super();this.value=e}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}toString(){return this.value}toTextmateString(){return ut.escape(this.value)}len(){return this.value.length}clone(){return new ut(this.value)}},P0=class extends ra{},ei=class extends P0{constructor(e){super();this.index=e}static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof lp?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 ei(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}},lp=class extends ra{constructor(){super(...arguments);this.options=[]}appendChild(e){return e instanceof ut&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}toTextmateString(){return this.options.map(e=>e.value.replace(/\||,/g,"\\$&")).join(",")}len(){return this.options[0].len()}clone(){let e=new lp;for(let t of this.options)e.appendChild(t);return e}},dg=class extends ra{resolve(e){let t=!1,i=e.replace(this.regexp,(...n)=>(t=!0,this._replace(n.slice(0,-2))));return!t&&this._children.some(n=>n instanceof Pi&&Boolean(n.elseValue))&&(i=this._replace([])),i}_replace(e){let t="";for(let i of this._children)if(i instanceof Pi){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}toTextmateString(){return`/${this.regexp.source}/${this.children.map(e=>e.toTextmateString())}/${(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")}`}clone(){let e=new dg;return e.regexp=new RegExp(this.regexp.source,""+(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}},Pi=class extends ra{constructor(e,t,i,n){super();this.index=e;this.shorthandName=t;this.ifValue=i;this.elseValue=n}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":Boolean(e)&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){let t=e.match(/[a-z]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1).toLowerCase()).join(""):e}toTextmateString(){let e="${";return e+=this.index,this.shorthandName?e+=`:/${this.shorthandName}`:this.ifValue&&this.elseValue?e+=`:?${this.ifValue}:${this.elseValue}`:this.ifValue?e+=`:+${this.ifValue}`:this.elseValue&&(e+=`:-${this.elseValue}`),e+="}",e}clone(){return new Pi(this.index,this.shorthandName,this.ifValue,this.elseValue)}},yn=class extends P0{constructor(e){super();this.name=e}async resolve(e){let t=await e.resolve(this);if(t&&t.includes(`
|
||
`)){let i="";this.snippet.walk(l=>{if(l==this)return!1;if(l instanceof ut){let u=l.toString().split(/\r?\n/);i=u[u.length-1].match(/^\s*/)[0]}return!0});let n=t.split(`
|
||
`),o=n.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=n.map((l,u)=>u==0||l.length==0||!l.startsWith(s)?l:i+l.slice(s.length)).join(`
|
||
`)}return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new ut(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 yn(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}};function eU(r,e){let t=[...r];for(;t.length>0;){let i=t.shift();if(!e(i))break;t.unshift(...i.children)}}var ap=class extends ra{get placeholderInfo(){if(!this._placeholders){this._variables=[];let e=[],t;this.walk(i=>{if(i instanceof ei)e.push(i),t=!t||t.index<i.index?i:t;else if(i instanceof yn){let n=i.name.charCodeAt(0);(n<65||n>90)&&this._variables.push(i)}return!0}),this._placeholders={all:e,last:t}}return this._placeholders}get variables(){return this._variables}get placeholders(){let{all:e}=this.placeholderInfo;return e}get maxIndexNumber(){let{placeholders:e}=this;return e.reduce((t,i)=>Math.max(t,i.index),0)}get minIndexNumber(){let{placeholders:e}=this,t=e.map(i=>i.index);return t.sort((i,n)=>i-n),t.length>1&&t[0]==0?t[1]:t[0]||0}insertSnippet(e,t,i){let n=this.placeholders[t];if(!n)return;let{index:o}=n,s=kt.create("untitled:/1","snippet",0,n.toString());e=kt.applyEdits(s,[{range:i,newText:e}]);let a=new Ho().parse(e,!0),l=a.maxIndexNumber+1,u=[];for(let c of a.placeholders)c.isFinalTabstop?c.index=l+o:c.index=c.index+o,u.push(c.index);return this.walk(c=>(c instanceof ei&&c.index>o&&(c.index=c.index+l),!0)),this.replace(n,a.children),Math.min.apply(null,u)}updatePlaceholder(e,t){let i=this.placeholders[e];for(let n of this.placeholders)if(n.index==i.index){let o=n.children[0],s=n.transform?n.transform.resolve(t):t;o?n.setOnlyChild(new ut(s)):n.appendChild(new ut(s))}this._placeholders=void 0}updateVariable(e,t){let i=this.variables[e-this.maxIndexNumber-1];if(i){let n=this.variables.filter(o=>o.name==i.name);for(let o of n){let s=o.transform?o.transform.resolve(t):t;o.setOnlyChild(new ut(s))}}}getPlaceholderText(e,t){let i=this.placeholders[e];return i&&i.transform?i.transform.resolve(t):t}offset(e){let t=0,i=!1;return this.walk(n=>n===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return eU([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){let t=[],{parent:i}=e;for(;i;)i instanceof ei&&t.push(i),i=i.parent;return t}async resolveVariables(e){let t=[];this.walk(i=>(i instanceof yn&&t.push(i),!0)),await Promise.all(t.map(i=>i.resolve(e)))}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}toTextmateString(){return this.children.reduce((e,t)=>e+t.toTextmateString(),"")}clone(){let e=new ap;return this._children=this.children.map(t=>t.clone()),e}walk(e){eU(this.children,e)}},Ho=class{constructor(){this._scanner=new _0}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}text(e){return this.parse(e).toString()}parse(e,t){this._scanner.text(e),this._token=this._scanner.next();let i=new ap;for(;this._parse(i););let n=new Map,o=[];i.walk(s=>(s instanceof ei&&(s.isFinalTabstop?n.set(0,void 0):!n.has(s.index)&&s.children.length>0?n.set(s.index,s.children):o.push(s)),!0));for(let s of o)if(n.has(s.index)){let a=new ei(s.index);a.transform=s.transform;for(let l of n.get(s.index)){let u=l.clone();if(a.transform){if(u instanceof ut)u=new ut(a.transform.resolve(u.value));else for(let c of u.children)if(c instanceof ut){u.replace(c,[new ut(a.transform.resolve(c.value))]);break}}a.appendChild(u)}i.replace(s,[a])}return!n.has(0)&&t&&i.appendChild(new ei(0)),i}_accept(e,t){if(e===void 0||this._token.type===e){let i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){if(this._token.type===14)return!1;let t=this._token;for(;this._token.type!==e;)if(this._token=this._scanner.next(),this._token.type===14)return!1;let i=this._scanner.value.substring(t.pos,this._token.pos);return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new ut(t)),!0):!1}_parseTabstopOrVariableName(e){let t,i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new ei(Number(t)):new yn(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t,i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);let o=new ei(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new ut("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else if(o.index>0&&this._accept(7)){let s=new lp;for(;;){if(this._parseChoiceElement(s)){if(this._accept(2))continue;if(this._accept(7)&&(o.appendChild(s),this._accept(4)))return e.appendChild(o),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseChoiceElement(e){let t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let n;if((n=this._accept(5,!0))?n=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new ut(i.join(""))),!0)}_parseComplexVariable(e){let t,i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);let o=new yn(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(o),!0;if(!this._parse(o))return e.appendChild(new ut("${"+t+":")),o.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(o)?(e.appendChild(o),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(o),!0):this._backTo(i)}_parseTransform(e){let t=new dg,i="",n="";for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,i+=o;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let o;if(o=this._accept(5,!0)){o=this._accept(6,!0)||o,t.appendChild(new ut(o));continue}if(this._parseFormatString(t)||this._parseAnything(t)){let s=t.children[0];s&&s.value&&s.value.includes("\\n")&&(s.value=s.value.replace(/\\n/g,`
|
||
`));continue}return!1}for(;!this._accept(4);){if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch(o){return!1}return e.transform=t,!0}_parseFormatString(e){let t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);let n=this._accept(8,!0);if(n)if(i){if(this._accept(4))return e.appendChild(new Pi(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Pi(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){let o=this._accept(9,!0);return!o||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Pi(Number(n),o)),!0)}else if(this._accept(11)){let o=this._until(4);if(o)return e.appendChild(new Pi(Number(n),void 0,o,void 0)),!0}else if(this._accept(12)){let o=this._until(4);if(o)return e.appendChild(new Pi(Number(n),void 0,void 0,o)),!0}else if(this._accept(13)){let o=this._until(1);if(o){let s=this._until(4);if(s)return e.appendChild(new Pi(Number(n),void 0,o,s)),!0}}else{let o=this._until(4);if(o)return e.appendChild(new Pi(Number(n),void 0,void 0,o)),!0}return this._backTo(t),!1}_parseAnything(e){if(this._token.type!==14){let t=this._scanner.tokenText(this._token);return e.appendChild(new ut(t)),this._accept(void 0),!0}return!1}};var Lu=S(W());var $C=S(W());var l9=S(Bl()),u9=S(require("fs")),jv=S(require("path")),c9=S(require("util")),f9=S(W());var Vz=S(Gr());var st=S($i()),Kz=S(Ex()),Fe=S(require("path")),Jz=S(Pf()),Mv=S(W());var Yz=S(El());var tU=S(require("events"));var kAe=j()("model-installBuffer"),tn;(function(r){r[r.Waiting=0]="Waiting",r[r.Faild=1]="Faild",r[r.Progressing=2]="Progressing",r[r.Success=3]="Success"})(tn||(tn={}));var T0=class extends tU.EventEmitter{constructor(e=!1,t=!1,i=void 0){super();this.isUpdate=e;this.isSync=t;this.channel=i;this.statMap=new Map;this.messagesMap=new Map;this.names=[]}setExtensions(e){this.statMap.clear(),this.names=e;for(let t of e)this.statMap.set(t,0)}addMessage(e,t,i=!1){if(i&&this.channel)return;let n=this.messagesMap.get(e)||[];this.messagesMap.set(e,n.concat(t.trim().split(/\r?\n/))),this.channel&&this.channel.appendLine(`[${e}] ${t}`)}startProgress(e){for(let t of e)this.statMap.set(t,2)}finishProgress(e,t=!0){this.channel&&(t?this.channel.appendLine(`[${e}] install succeed!`):this.channel.appendLine(`[${e}] install failed!`)),this.statMap.set(e,t?3:1)}get remains(){let e=0;for(let t of this.names){let i=this.statMap.get(t);[3,1].includes(i)||(e=e+1)}return e}getLines(){let e=[];for(let t of this.names){let i=this.statMap.get(t),n="*";switch(i){case 2:{let s=new Date,a=Math.floor(s.getMilliseconds()/100);n=PD[a];break}case 1:n="\u2717";break;case 3:n="\u2713";break}let o=this.messagesMap.get(t)||[];e.push(`- ${n} ${t} ${o.length?o[o.length-1]:""}`)}return e}getMessages(e){if(e<=1)return[];let t=this.names[e-2];return t?this.messagesMap.get(t):[]}draw(e,t){let{remains:i}=this,o=[i==0?`${this.isUpdate?"Update":"Install"} finished`:`Installing, ${i} remains...`,"",...this.getLines()];t.setLines(o,{start:0,end:-1,strictIndexing:!1},!0),i==0&&this.interval&&(clearInterval(this.interval),this.interval=null),process.env.VIM_NODE_RPC&&e.command("redraw",!0)}highlight(e){e.call("matchadd",["CocListFgCyan","^\\-\\s\\zs\\*"],!0),e.call("matchadd",["CocListFgGreen","^\\-\\s\\zs\u2713"],!0),e.call("matchadd",["CocListFgRed","^\\-\\s\\zs\u2717"],!0),e.call("matchadd",["CocListFgYellow","^-.\\{3\\}\\zs\\S\\+"],!0)}async show(e){let{isSync:t}=this;if(this.channel)return;e.pauseNotification(),e.command(t?"enew":"vs +enew",!0),e.call("bufnr",["%"],!0),e.command("setl buftype=nofile bufhidden=wipe noswapfile nobuflisted wrap undolevels=-1",!0),t||e.command("nnoremap <silent><nowait><buffer> q :q<CR>",!0),this.highlight(e);let i=await e.resumeNotification(),n=i&&i[1]==null?i[0][1]:null;if(!n)return;this.bufnr=n;let o=e.createBuffer(n);this.interval=setInterval(()=>{this.draw(e,o)},100)}dispose(){this.interval&&clearInterval(this.interval)}},R0=T0;var B5=S(require("events")),j5=S(require("child_process"));var U5=S(require("readline")),fr=S($i()),W5=S(require("os")),Sn=S(require("path")),H5=S(SU()),pv=S(Pf());var N5=S(FU()),cv=S(B0()),fv=S($i()),$p=S(require("path")),q5=S(kW()),$5=S(c5());var uv=S(B0()),hE=S(require("url")),I5=S(require("fs"));var F5=S(require("querystring")),A5=S(b5()),O5=S(_5()),L5=S(k5()),M5=j()("model-fetch");function Zve(r){let e;r.protocol==="http:"?e=process.env.HTTP_PROXY||process.env.http_proxy||null:r.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=r.hostname.replace(/^\.*/,".").toLowerCase(),n=r.port||r.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(/^\.*/,"."),f=u[1];if(n===f&&i.endsWith(c)){e=null;break}}else if(l=l.replace(/^\.*/,"."),i.endsWith(l)){e=null;break}}}return e}function Qve(r,e){let t=e.proxyUrl||Zve(r);if(t){let i=hE.parse(t);if(!/^https?:$/.test(i.protocol))return null;let n={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 M5.info(`Using proxy ${t} from ${e.proxyUrl?"configuration":"system environment"} for ${r.hostname}:`),r.protocol==="http:"?A5.default(n):O5.default(n)}return null}function mE(r,e={}){let t=b.getConfiguration("http"),{data:i}=e,n=eye(i),o={proxyUrl:t.get("proxy",""),strictSSL:t.get("proxyStrictSSL",!0),proxyAuthorization:t.get("proxyAuthorization",null),proxyCA:t.get("proxyCA",null)};e.query&&!r.includes("?")&&(r=`${r}?${F5.stringify(e.query)}`);let s=Object.assign(e.headers||{},{"Proxy-Authorization":o.proxyAuthorization}),a=hE.parse(r),l=Qve(a,o),u={method:e.method||"GET",hostname:a.hostname,port:a.port?parseInt(a.port,10):a.protocol==="https:"?443:80,path:a.path,agent:l,rejectUnauthorized:o.strictSSL,maxRedirects:3,headers:Object.assign({"User-Agent":"Mozilla/5.0 (X11; Linux x86_64)","Accept-Encoding":"gzip, deflate"},s)};return o.proxyCA&&(u.ca=I5.default.readFileSync(o.proxyCA)),n=="object"?u.headers["Content-Type"]="application/json":n=="string"&&(u.headers["Content-Type"]="text/plain"),e.user&&e.password&&(u.auth=e.user+":"+e.password),e.timeout&&(u.timeout=e.timeout),e.buffer&&(u.buffer=!0),u}function tye(r,e,t,i){let n=r.startsWith("https:")?uv.https:uv.http;return new Promise((o,s)=>{if(i){let l=i.onCancellationRequested(()=>{l.dispose(),a.destroy(new Error("request aborted"))})}let a=n.request(t,l=>{let u=l;if(l.statusCode>=200&&l.statusCode<300||l.statusCode===1223){let c=l.headers||{},f=[],p=c["content-type"]||"";u=L5.default(l),u.on("data",d=>{f.push(d)}),u.on("end",()=>{let d=Buffer.concat(f);if(!t.buffer&&(p.startsWith("application/json")||p.startsWith("text/"))){let h=p.match(/charset=(\S+)/),m=h?h[1]:"utf8",y=d.toString(m);if(!p.includes("application/json"))o(y);else try{let v=JSON.parse(y);o(v)}catch(v){s(new Error(`Parse response error: ${v}`))}}else o(d)}),u.on("error",d=>{s(new Error(`Unable to connect ${r}: ${d.message}`))})}else s(new Error(`Bad response from ${r}: ${l.statusCode}`))});a.on("error",s),a.on("timeout",()=>{a.destroy(new Error(`Request timeout after ${t.timeout}ms`))}),e&&(typeof e=="string"||Buffer.isBuffer(e)?a.write(e):a.write(JSON.stringify(e))),t.timeout&&a.setTimeout(t.timeout),a.end()})}function eye(r){return r===null?"null":r===void 0?"undefined":typeof r=="string"?"string":Buffer.isBuffer(r)?"buffer":Array.isArray(r)||wt(r)?"object":"unknown"}function Cu(r,e={},t){let i=mE(r,e);return tye(r,e.data,i,t).catch(n=>{if(M5.error(`Fetch error for ${r}:`,i,n),i.agent&&i.agent.proxy){let{proxy:o}=i.agent;throw new Error(`Request failed using proxy ${o.host}: ${n.message}`)}else throw n})}var gE=j()("model-download");function Bp(r,e,t){let{dest:i,onProgress:n,extract:o}=e;if(!i||!$p.default.isAbsolute(i))throw new Error("Expect absolute file path for dest option.");let s;try{s=fv.default.statSync(i)}catch(c){fv.default.mkdirpSync(i)}if(s&&!s.isDirectory())throw new Error(`${i} exists, but not directory!`);let a=r.startsWith("https")?cv.https:cv.http,l=mE(r,e),u=$p.default.extname(r);return new Promise((c,f)=>{if(t){let d=t.onCancellationRequested(()=>{d.dispose(),p.destroy(new Error("request aborted"))})}let p=a.request(l,d=>{var h,m;if(d.statusCode>=200&&d.statusCode<300||d.statusCode===1223){let y=d.headers||{},v=y["content-disposition"];if(!u&&v){let P=N5.default.parse(v);((h=P.parameters)==null?void 0:h.filename)&&(u=$p.default.extname(P.parameters.filename))}if(o===!0)if(u===".zip"||y["content-type"]=="application/zip")o="unzip";else if(u==".tgz")o="untar";else{f(new Error(`Unable to extract for ${r}`));return}let x=Number(y["content-length"]),w=0;isNaN(x)||d.on("data",P=>{w+=P.length;let k=(w/x*100).toFixed(1);n?n(k):gE.info(`Download ${r} progress ${k}%`)}),d.on("error",P=>{f(new Error(`Unable to connect ${r}: ${P.message}`))}),d.on("end",()=>{gE.info("Download completed:",r)});let E;o==="untar"?E=d.pipe(q5.default.x({strip:(m=e.strip)!=null?m:1,C:i})):o==="unzip"?E=d.pipe($5.default.Extract({path:i})):(i=$p.default.join(i,`${qo()}${u}`),E=d.pipe(fv.default.createWriteStream(i))),E.on("finish",()=>{gE.info(`Downloaded ${r} => ${i}`),setTimeout(()=>{c(i)},100)}),E.on("error",f)}else f(new Error(`Invalid response from ${r}: ${d.statusCode}`))});p.on("error",f),p.on("timeout",()=>{p.destroy(new Error(`request timeout after ${e.timeout}ms`))}),e.timeout&&p.setTimeout(e.timeout),p.end()})}var z5=j()("model-installer");function rye(r="coc.nvim"){let e=H5.default("npm",{registry:"https://registry.npmjs.org/"}),t=e[`${r}:registry`]||e.config_registry||e.registry;return t.endsWith("/")?t:t+"/"}var G5=class extends B5.EventEmitter{constructor(e,t,i){super();this.root=e;this.npm=t;this.def=i;if(fr.default.existsSync(e)||fr.default.mkdirpSync(e),/^https?:/.test(i))this.url=i;else if(i.startsWith("@")){let n=i.indexOf("@",1);n>1?(this.name=i.substring(0,n),this.version=i.substring(n+1)):this.name=i}else if(i.includes("@")){let[n,o]=i.split("@",2);this.name=n,this.version=o}else this.name=i}get info(){return{name:this.name,version:this.version}}async install(){this.log(`Using npm from: ${this.npm}`);let e=await this.getInfo();z5.info(`Fetched info of ${this.def}`,e);let{name:t}=e,i=e["engines.coc"]?e["engines.coc"].replace(/^\^/,">="):"";if(i&&!pv.default.satisfies(b.version,i))throw new Error(`${t} ${e.version} requires coc.nvim >= ${i}, please update coc.nvim.`);return await this.doInstall(e),t}async update(e){this.url=e;let t=Sn.default.join(this.root,this.name);if((await fr.default.lstat(t)).isSymbolicLink()){this.log("Skipped update for symbol link");return}let n;if(fr.default.existsSync(Sn.default.join(t,"package.json"))){let l=await fr.default.readFile(Sn.default.join(t,"package.json"),"utf8");n=JSON.parse(l).version}this.log(`Using npm from: ${this.npm}`);let o=await this.getInfo();if(n&&o.version&&pv.default.gte(n,o.version)){this.log(`Current version ${n} is up to date.`);return}let s=o["engines.coc"]?o["engines.coc"].replace(/^\^/,">="):"";if(s&&!pv.default.satisfies(b.version,s))throw new Error(`${o.version} requires coc.nvim ${s}, please update coc.nvim.`);await this.doInstall(o);let a=Sn.default.join(this.root,o.name,"package.json");if(fr.default.existsSync(a))return this.log(`Updated to v${o.version}`),Sn.default.dirname(a);throw new Error(`Package.json not found: ${a}`)}async doInstall(e){let t=Sn.default.join(this.root,e.name);if(fr.default.existsSync(t)&&!fr.default.statSync(t).isDirectory()){this.log(`${t} is not directory skipped install`);return}let i=await fr.default.mkdtemp(Sn.default.join(W5.default.tmpdir(),`${e.name.replace("/","-")}-`)),n=e["dist.tarball"];this.log(`Downloading from ${n}`),await Bp(n,{dest:i,onProgress:p=>this.log(`Download progress ${p}%`,!0),extract:"untar"}),this.log(`Extension download at ${i}`);let o=await fr.default.readFile(Sn.default.join(i,"package.json"),"utf8"),{dependencies:s}=JSON.parse(o);s&&Object.keys(s).length&&await new Promise((d,h)=>{let m=["install","--ignore-scripts","--no-lockfile","--production"];n.startsWith("https://github.com")&&(m=["install"]),(this.npm.endsWith("npm")||this.npm.endsWith("npm.CMD"))&&!this.npm.endsWith("pnpm")&&m.push("--legacy-peer-deps"),this.npm.endsWith("yarn")&&m.push("--ignore-engines"),this.log(`Installing dependencies by: ${this.npm} ${m.join(" ")}.`);let y=j5.spawn(this.npm,m,{cwd:i});U5.default.createInterface({input:y.stdout}).on("line",w=>{this.log(`[npm] ${w}`,!0)}),y.stderr.setEncoding("utf8"),y.stdout.setEncoding("utf8"),y.on("error",h);let x="";y.stderr.on("data",w=>{x+=w}),y.on("exit",w=>{if(w){x&&this.log(x),h(new Error(`${this.npm} install exited with ${w}`));return}d()})});let a=Sn.default.resolve(this.root,global.hasOwnProperty("__TEST__")?"":"..","package.json"),l=[],u=Ul(fr.default.readFileSync(a,"utf8"),l,{allowTrailingComma:!0});if(l&&l.length>0)throw new Error(`Error on load ${a}`);u.dependencies=u.dependencies||{},this.url?u.dependencies[e.name]=this.url:u.dependencies[e.name]=">="+e.version;let c={dependencies:{}};Object.keys(u.dependencies).sort().forEach(p=>{c.dependencies[p]=u.dependencies[p]});let f=await Ht(t);f&&(f.isDirectory()?fr.default.removeSync(t):fr.default.unlinkSync(t)),await fr.default.move(i,t,{overwrite:!0}),await fr.default.writeFile(a,JSON.stringify(c,null,2),{encoding:"utf8"}),this.log(`Update package.json at ${a}`),this.log(`Installed extension ${this.name}@${e.version} at ${t}`)}async getInfo(){if(this.url)return await this.getInfoFromUri();let e=rye();this.log(`Get info from ${e}`);let t=await Cu(e+this.name,{timeout:1e4,buffer:!0}),i=JSON.parse(t.toString());this.version||(this.version=i["dist-tags"].latest);let n=i.versions[this.version];if(!n)throw new Error(`${this.def} doesn't exists in ${e}.`);let o=n.engines&&n.engines.coc;if(!o)throw new Error(`${this.def} is not valid coc extension, "engines" field with coc property required.`);return{"dist.tarball":n.dist.tarball,"engines.coc":o,version:n.version,name:i.name}}async getInfoFromUri(){let{url:e}=this;if(!e.includes("github.com"))throw new Error(`"${e}" is not supported, coc.nvim support github.com only`);e=e.replace(/\/$/,"");let t=e.replace("github.com","raw.githubusercontent.com")+"/master/package.json";this.log(`Get info from ${t}`);let i=await Cu(t,{timeout:1e4}),n=typeof i=="string"?JSON.parse(i):i;return this.name=n.name,{"dist.tarball":`${e}/archive/master.tar.gz`,"engines.coc":n.engines?n.engines.coc:null,name:n.name,version:n.version}}log(e,t=!1){z5.info(e),this.emit("message",e,t)}};function dv(r,e){return t=>new G5(e,r,t)}var _u=S(require("fs"));var iye=j()("model-memos"),vE=class{constructor(e){this.filepath=e;_u.default.existsSync(e)||_u.default.writeFileSync(e,"{}","utf8")}fetchContent(e,t){try{let i=_u.default.readFileSync(this.filepath,"utf8"),o=JSON.parse(i)[e];return o?o[t]:void 0}catch(i){return}}async update(e,t,i){let{filepath:n}=this;try{let o=_u.default.readFileSync(n,"utf8"),s=o?JSON.parse(o):{};s[e]=s[e]||{},i!==void 0?s[e][t]=zn(i):delete s[e][t],o=JSON.stringify(s,null,2),_u.default.writeFileSync(n,o,"utf8")}catch(o){iye.error("Error on update memos:",o)}}createMemento(e){return{get:(t,i)=>{let n=this.fetchContent(e,t);return n===void 0?i:n},update:async(t,i)=>{await this.update(e,t,i)}}}},V5=vE;var I4e=S(gh());var Wz=S(require("fs")),Hz=S(require("path")),Lv=S(require("vm"));var K5=Object.prototype,nye=K5.hasOwnProperty;function J5(r,...e){return r=Object(r),e.forEach(t=>{if(t!=null){t=Object(t);for(let i in t){let n=r[i];(n===void 0||n===K5[i]&&!nye.call(r,i))&&(r[i]=t[i])}}}),r}function xa(r,e){let t={};for(let i of Object.keys(r))e.includes(i)||(t[i]=r[i]);return t}var zz=j(),u4e=zz("util-factoroy"),Pn=require("module"),Wye=["reallyExit","abort","umask","setuid","setgid","setgroups","_fatalException","exit","kill"];function Hye(r){return()=>{throw new Error(`process.${r}() is not allowed in extension sandbox`)}}var ce=S(W());var hv=S(W());var Pu=S(W());var $Le=j()("provider-manager"),yE=class{constructor(){this.providers=new Set}hasProvider(e){return this.getProvider(e)!=null}getProvider(e){let t=0,i;for(let n of this.providers){let{selector:o,priority:s}=n,a=b.match(o,e);a!=0&&(typeof s=="number"&&(a=s),!(a<t)&&(t=a,i=n))}return i}poviderById(e){let t=Array.from(this.providers).find(i=>i.id==e);return t?t.provider:null}getProviders(e){let t=Array.from(this.providers);return t=t.filter(i=>b.match(i.selector,e)>0),t.sort((i,n)=>b.match(n.selector,e)-b.match(i.selector,e))}toLocations(e){let t=[];for(let i of e)if(!!i)if(Pu.Location.is(i))t.push(i);else if(Array.isArray(i)){for(let n of i)if(Pu.Location.is(n))t.push(n);else if(Pu.LocationLink.is(n)){let{targetUri:o,targetSelectionRange:s}=n;t.push(Pu.Location.create(o,s))}}else C.showMessage(`Bad definition ${JSON.stringify(i)}`,"error");return t}},xe=yE;var JLe=j()("codeActionManager"),bE=class extends xe{register(e,t,i,n){let o={id:he(),selector:e,provider:t,kinds:n,clientId:i};return this.providers.add(o),hv.Disposable.create(()=>{this.providers.delete(o)})}async provideCodeActions(e,t,i,n){let o=this.getProviders(e);if(!o.length)return null;if(i.only){let{only:a}=i;o=o.filter(l=>!(l.kinds&&!l.kinds.some(u=>a.includes(u))))}let s=[];return await Promise.all(o.map(a=>{let{provider:l,clientId:u}=a;return Promise.resolve(l.provideCodeActions(e,t,i,n)).then(c=>{if(!(!c||c.length==0))for(let f of c)if(hv.Command.is(f)){let p={title:f.title,command:f,clientId:u};s.push(p)}else{if(i.only){if(!f.kind)continue;let d=!1;for(let h of i.only)if(f.kind.startsWith(h)){d=!0;break}if(!d)continue}s.findIndex(d=>d.title==f.title)==-1&&s.push(Object.assign({clientId:u},f))}})})),s}dispose(){this.providers=new Set}},Y5=bE;var X5=S(W());var wE=class extends xe{register(e,t){let i={id:he(),selector:e,provider:t};return this.providers.add(i),X5.Disposable.create(()=>{this.providers.delete(i)})}async provideCodeLenses(e,t){let i=this.getProviders(e);if(!i.length)return null;let n=await Promise.all(i.map(o=>{let{provider:s,id:a}=o;return Promise.resolve(s.provideCodeLenses(e,t)).then(l=>{if(Array.isArray(l))for(let u of l)u.source=a;return l||[]})}));return[].concat(...n)}async resolveCodeLens(e,t){if(e.command)return e;let{source:i}=e,n=this.poviderById(i);if(!n||typeof n.resolveCodeLens!="function")return e;let o=await Promise.resolve(n.resolveCodeLens(xa(e,["source"]),t));return Object.assign(e,o),e}dispose(){this.providers=new Set}},Z5=wE;var Q5=S(W());var dMe=j()("definitionManager"),xE=class extends xe{register(e,t){let i={id:he(),selector:e,provider:t};return this.providers.add(i),Q5.Disposable.create(()=>{this.providers.delete(i)})}async provideDeclaration(e,t,i){let n=this.getProvider(e);if(!n)return null;let{provider:o}=n;return await Promise.resolve(o.provideDeclaration(e,t,i))}dispose(){this.providers=new Set}},e4=xE;var t4=S(W());var DMe=j()("definitionManager"),DE=class extends xe{register(e,t){let i={id:he(),selector:e,provider:t};return this.providers.add(i),t4.Disposable.create(()=>{this.providers.delete(i)})}async provideDefinition(e,t,i){let n=this.getProviders(e);if(!n.length)return null;let o=await Promise.all(n.map(s=>{let{provider:a}=s;return Promise.resolve(a.provideDefinition(e,t,i))}));return this.toLocations(o)}dispose(){this.providers=new Set}},r4=DE;var i4=S(W());var SE=class extends xe{register(e,t){let i={id:he(),selector:e,provider:t};return this.providers.add(i),i4.Disposable.create(()=>{this.providers.delete(i)})}async provideDocumentColors(e,t){let i=this.getProvider(e);if(!i)return null;let{provider:n}=i;return await Promise.resolve(n.provideDocumentColors(e,t))}async provideColorPresentations(e,t,i){let{range:n,color:o}=e,s=this.getProvider(t);if(!s)return null;let{provider:a}=s;return await Promise.resolve(a.provideColorPresentations(o,{document:t,range:n},i))}dispose(){this.providers=new Set}},n4=SE;var o4=S(W());var EE=class extends xe{register(e,t){let i={id:he(),selector:e,provider:t};return this.providers.add(i),o4.Disposable.create(()=>{this.providers.delete(i)})}async provideDocumentHighlights(e,t,i){let n=this.getProvider(e);if(!n)return null;let{provider:o}=n;return await Promise.resolve(o.provideDocumentHighlights(e,t,i))}dispose(){this.providers=new Set}},s4=EE;var a4=S(W());var CE=class extends xe{register(e,t){let i={id:he(),selector:e,provider:t};return this.providers.add(i),a4.Disposable.create(()=>{this.providers.delete(i)})}async _provideDocumentLinks(e,t,i){let{provider:n,id:o}=e,s=await Promise.resolve(n.provideDocumentLinks(t,i));return!s||!s.length?[]:(s.forEach(a=>{a.data=a.data||{},a.data.source=o}),s)}async provideDocumentLinks(e,t){let i=this.getProviders(e);if(i.length==0)return[];let n=await Promise.all(i.map(o=>this._provideDocumentLinks(o,e,t)));return[].concat(...n)}async resolveDocumentLink(e,t){let{data:i}=e;if(!i||!i.source)return null;for(let n of this.providers)if(n.id==i.source){let{provider:o}=n;return e=await Promise.resolve(o.resolveDocumentLink(e,t)),e}return null}dispose(){this.providers=new Set}},l4=CE;var u4=S(W());var _E=class extends xe{register(e,t){let i={id:he(),selector:e,provider:t};return this.providers.add(i),u4.Disposable.create(()=>{this.providers.delete(i)})}async provideDocumentSymbols(e,t){let i=this.getProvider(e);if(!i)return null;let{provider:n}=i;return await Promise.resolve(n.provideDocumentSymbols(e,t))||[]}dispose(){this.providers=new Set}},c4=_E;var f4=S(W());var PE=class extends xe{register(e,t){let i={id:he(),selector:e,provider:t};return this.providers.add(i),f4.Disposable.create(()=>{this.providers.delete(i)})}async provideFoldingRanges(e,t,i){let n=this.getProvider(e);if(!n)return null;let{provider:o}=n;return await Promise.resolve(o.provideFoldingRanges(e,t,i))||[]}dispose(){this.providers=new Set}},p4=PE;var d4=S(W());var TE=class extends xe{register(e,t,i=0){let n={id:he(),selector:e,priority:i,provider:t};return this.providers.add(n),d4.Disposable.create(()=>{this.providers.delete(n)})}handles(e){return this.getProvider(e)!=null}async provideDocumentFormattingEdits(e,t,i){let n=this.getProvider(e);if(!n)return null;let{provider:o}=n;return await Promise.resolve(o.provideDocumentFormattingEdits(e,t,i))}dispose(){this.providers=new Set}},h4=TE;var m4=S(W());var RE=class extends xe{register(e,t,i=0){let n={id:he(),selector:e,provider:t,priority:i};return this.providers.add(n),m4.Disposable.create(()=>{this.providers.delete(n)})}async provideDocumentRangeFormattingEdits(e,t,i,n){let o=this.getProvider(e);if(!o)return null;let{provider:s}=o;return await Promise.resolve(s.provideDocumentRangeFormattingEdits(e,t,i,n))}dispose(){this.providers=new Set}},g4=RE;var v4=S(W());var kE=class extends xe{register(e,t){let i={id:he(),selector:e,provider:t};return this.providers.add(i),v4.Disposable.create(()=>{this.providers.delete(i)})}async provideHover(e,t,i){let n=this.getProviders(e);if(n.length===0)return null;let o=[];for(let s=0,a=n.length;s<a;s+=1){let l=n[s],u=await Promise.resolve(l.provider.provideHover(e,t,i));u&&u.contents!=""&&o.push(u)}return o}dispose(){this.providers=new Set}},y4=kE;var b4=S(W());var IE=class extends xe{register(e,t){let i={id:he(),selector:e,provider:t};return this.providers.add(i),b4.Disposable.create(()=>{this.providers.delete(i)})}async provideReferences(e,t,i){let n=this.getProviders(e);if(!n.length)return null;let o=await Promise.all(n.map(s=>{let{provider:a}=s;return Promise.resolve(a.provideImplementation(e,t,i))}));return this.toLocations(o)}dispose(){this.providers=new Set}},w4=IE;var x4=S(W());var GNe=j()("onTypeFormatManager"),FE=class{constructor(){this.providers=new Set}register(e,t,i){let n={triggerCharacters:i,selector:e,provider:t};return this.providers.add(n),x4.Disposable.create(()=>{this.providers.delete(n)})}hasProvider(e){for(let t of this.providers){let{selector:i}=t;if(b.match(i,e)>0)return!0}return!1}getProvider(e,t){for(let i of this.providers){let{triggerCharacters:n,selector:o}=i;if(b.match(o,e)>0&&n.includes(t))return i.provider}return null}async onCharacterType(e,t,i,n){let o=this.getProvider(t,e);if(!o)return;let s=await b.getFormatOptions(t.uri);return await Promise.resolve(o.provideOnTypeFormattingEdits(t,i,e,s,n))}dispose(){this.providers=new Set}},D4=FE;var S4=S(W());var AE=class extends xe{register(e,t){let i={id:he(),selector:e,provider:t};return this.providers.add(i),S4.Disposable.create(()=>{this.providers.delete(i)})}async provideSelectionRanges(e,t,i){let n=this.getProvider(e);if(!n)return null;let{provider:o}=n;return await Promise.resolve(o.provideSelectionRanges(e,t,i))||[]}dispose(){this.providers=new Set}},E4=AE;var C4=S(W());var OE=class extends xe{register(e,t){let i={id:he(),selector:e,provider:t};return this.providers.add(i),C4.Disposable.create(()=>{this.providers.delete(i)})}async provideReferences(e,t,i,n){let o=this.getProviders(e);if(!o.length)return null;let s=await Promise.all(o.map(a=>{let{provider:l}=a;return Promise.resolve(l.provideReferences(e,t,i,n))}));return this.toLocations(s)}dispose(){this.providers=new Set}},_4=OE;var P4=S(W());var LE=class extends xe{register(e,t){let i={id:he(),selector:e,provider:t};return this.providers.add(i),P4.Disposable.create(()=>{this.providers.delete(i)})}async provideRenameEdits(e,t,i,n){let o=this.getProvider(e);if(!o)return null;let{provider:s}=o;return await Promise.resolve(s.provideRenameEdits(e,t,i,n))}async prepareRename(e,t,i){let n=this.getProvider(e);if(!n)return null;let{provider:o}=n;if(o.prepareRename==null)return null;let s=await Promise.resolve(o.prepareRename(e,t,i));return s==null?!1:s}dispose(){this.providers=new Set}},T4=LE;var R4=S(W());var ME=class extends xe{register(e,t,i){let n=i.reduce((s,a)=>s.concat(a.split(/\s*/g)),[]),o={id:he(),selector:e,provider:t,triggerCharacters:n};return this.providers.add(o),R4.Disposable.create(()=>{this.providers.delete(o)})}shouldTrigger(e,t){let i=this.getProvider(e);if(!i)return!1;let{triggerCharacters:n}=i;return n&&n.indexOf(t)!=-1}async provideSignatureHelp(e,t,i,n){let o=this.getProvider(e);if(!o)return null;let s=await Promise.resolve(o.provider.provideSignatureHelp(e,t,i,n));return s&&s.signatures&&s.signatures.length?s:null}dispose(){this.providers=new Set}},k4=ME;var I4=S(W());var NE=class extends xe{register(e,t){let i={id:he(),selector:e,provider:t};return this.providers.add(i),I4.Disposable.create(()=>{this.providers.delete(i)})}async provideTypeDefinition(e,t,i){let n=this.getProviders(e);if(!n.length)return null;let o=await Promise.all(n.map(s=>{let{provider:a}=s;return Promise.resolve(a.provideTypeDefinition(e,t,i))}));return this.toLocations(o)}dispose(){this.providers=new Set}},F4=NE;var A4=S(W()),qE=class{constructor(){this.providers=new Map}register(e){let t=he();return this.providers.set(t,e),A4.Disposable.create(()=>{this.providers.delete(t)})}async provideWorkspaceSymbols(e,t){let i=Array.from(this.providers.entries());if(!i.length)return[];let n=[];return await Promise.all(i.map(o=>{let[s,a]=o;return Promise.resolve(a.provideWorkspaceSymbols(e,t)).then(l=>{l&&(l.source=s,n.push(...l))})})),n}async resolveWorkspaceSymbol(e,t){let i=this.providers.get(e.source);if(!!i)return typeof i.resolveWorkspaceSymbol!="function"?Promise.resolve(e):await Promise.resolve(i.resolveWorkspaceSymbol(e,t))}hasProvider(){return this.providers.size>0}dispose(){this.providers=new Map}},O4=qE;var L4=S(W());var zqe=j()("util-complete");function M4(r){let{line:e,linenr:t,colnr:i}=r,n=Rt(e,0,i-1);return{line:t-1,character:n.length}}function q4(r,e,t){let{label:i,data:n,insertTextFormat:o,insertText:s,textEdit:a}=r,l,u;if(n&&typeof n.word=="string")return n.word;if(a){let{range:c}=a;if(u=a.newText,c&&c.start.line==c.end.line){let{line:f,col:p,colnr:d}=e,h=Mf(f,p);if(c.start.character>h)u=f.slice(h,c.start.character)+u;else{let m=f.slice(c.start.character,h);m.length&&u.startsWith(m)&&(u=u.slice(m.length))}if(h=Mf(f,d-1),c.end.character>h){let m=f.slice(h,c.end.character);u.endsWith(m)&&(u=u.slice(0,-m.length))}}}else u=s;if(o==L4.InsertTextFormat.Snippet&&u&&u.includes("$")){let f=new Ho().text(u);l=f?N4(f,t):i}else l=N4(u,t)||i;return l||""}function $4(r,e,t=""){return e.get(r)||t}function N4(r,e){if(!r)return"";for(let t=0;t<r.length;t++){let i=r[t];if(e.includes(i))return r.slice(0,t)}return r}var mv=j()("languages"),B4=class{constructor(){this.onTypeFormatManager=new D4;this.documentLinkManager=new l4;this.documentColorManager=new n4;this.foldingRangeManager=new p4;this.renameManager=new T4;this.formatManager=new h4;this.codeActionManager=new Y5;this.workspaceSymbolsManager=new O4;this.formatRangeManager=new g4;this.hoverManager=new y4;this.signatureManager=new k4;this.documentSymbolManager=new c4;this.documentHighlightManager=new s4;this.definitionManager=new r4;this.declarationManager=new e4;this.typeDefinitionManager=new F4;this.referenceManager=new _4;this.implementationManager=new w4;this.codeLensManager=new Z5;this.selectionRangeManager=new E4;this.cancelTokenSource=new ce.CancellationTokenSource}init(){this.loadCompleteConfig(),b.onDidChangeConfiguration(e=>{e.affectsConfiguration("suggest")&&this.loadCompleteConfig()},this)}get nvim(){return b.nvim}get detailField(){let{detailField:e,floatEnable:t}=this.completeConfig;return e=="preview"&&(!t||!b.floatSupported)?"menu":"preview"}loadCompleteConfig(){let e=b.getConfiguration("suggest"),t=e.get("completionItemKindLabels",{});this.completionItemKindMap=new Map([[ce.CompletionItemKind.Text,t.text||"v"],[ce.CompletionItemKind.Method,t.method||"f"],[ce.CompletionItemKind.Function,t.function||"f"],[ce.CompletionItemKind.Constructor,typeof t.constructor=="function"?"f":t["constructor"]],[ce.CompletionItemKind.Field,t.field||"m"],[ce.CompletionItemKind.Variable,t.variable||"v"],[ce.CompletionItemKind.Class,t.class||"C"],[ce.CompletionItemKind.Interface,t.interface||"I"],[ce.CompletionItemKind.Module,t.module||"M"],[ce.CompletionItemKind.Property,t.property||"m"],[ce.CompletionItemKind.Unit,t.unit||"U"],[ce.CompletionItemKind.Value,t.value||"v"],[ce.CompletionItemKind.Enum,t.enum||"E"],[ce.CompletionItemKind.Keyword,t.keyword||"k"],[ce.CompletionItemKind.Snippet,t.snippet||"S"],[ce.CompletionItemKind.Color,t.color||"v"],[ce.CompletionItemKind.File,t.file||"F"],[ce.CompletionItemKind.Reference,t.reference||"r"],[ce.CompletionItemKind.Folder,t.folder||"F"],[ce.CompletionItemKind.EnumMember,t.enumMember||"m"],[ce.CompletionItemKind.Constant,t.constant||"v"],[ce.CompletionItemKind.Struct,t.struct||"S"],[ce.CompletionItemKind.Event,t.event||"E"],[ce.CompletionItemKind.Operator,t.operator||"O"],[ce.CompletionItemKind.TypeParameter,t.typeParameter||"T"]]),this.completeConfig={defaultKindText:t.default||"",priority:e.get("languageSourcePriority",99),echodocSupport:e.get("echodocSupport",!1),detailField:e.get("detailField","preview"),detailMaxLength:e.get("detailMaxLength",100),floatEnable:e.get("floatEnable",!0),invalidInsertCharacters:e.get("invalidInsertCharacters",["(","<","{","[","\r",`
|
||
`])}}hasFormatProvider(e){return!!(this.formatManager.hasProvider(e)||this.formatRangeManager.hasProvider(e))}registerOnTypeFormattingEditProvider(e,t,i){return this.onTypeFormatManager.register(e,t,i)}registerCompletionItemProvider(e,t,i,n,o=[],s,a){i=typeof i=="string"?[i]:i;let l=this.createCompleteSource(e,t,n,i,o,a||[],s);return Ze.addSource(l),mv.debug("created service source",e),{dispose:()=>{Ze.removeSource(l)}}}registerCodeActionProvider(e,t,i,n){return this.codeActionManager.register(e,t,i,n)}registerHoverProvider(e,t){return this.hoverManager.register(e,t)}registerSelectionRangeProvider(e,t){return this.selectionRangeManager.register(e,t)}registerSignatureHelpProvider(e,t,i){return this.signatureManager.register(e,t,i)}registerDocumentSymbolProvider(e,t){return this.documentSymbolManager.register(e,t)}registerFoldingRangeProvider(e,t){return this.foldingRangeManager.register(e,t)}registerDocumentHighlightProvider(e,t){return this.documentHighlightManager.register(e,t)}registerCodeLensProvider(e,t){return this.codeLensManager.register(e,t)}registerDocumentLinkProvider(e,t){return this.documentLinkManager.register(e,t)}registerDocumentColorProvider(e,t){return this.documentColorManager.register(e,t)}registerDefinitionProvider(e,t){return this.definitionManager.register(e,t)}registerDeclarationProvider(e,t){return this.declarationManager.register(e,t)}registerTypeDefinitionProvider(e,t){return this.typeDefinitionManager.register(e,t)}registerImplementationProvider(e,t){return this.implementationManager.register(e,t)}registerReferencesProvider(e,t){return this.referenceManager.register(e,t)}registerRenameProvider(e,t){return this.renameManager.register(e,t)}registerWorkspaceSymbolProvider(e){return arguments.length>1&&typeof arguments[1].provideWorkspaceSymbols=="function"&&(e=arguments[1]),this.workspaceSymbolsManager.register(e)}registerDocumentFormatProvider(e,t,i=0){return this.formatManager.register(e,t,i)}registerDocumentRangeFormatProvider(e,t,i=0){return this.formatRangeManager.register(e,t,i)}shouldTriggerSignatureHelp(e,t){return this.signatureManager.shouldTrigger(e,t)}async getHover(e,t,i){return await this.hoverManager.provideHover(e,t,i)}async getSignatureHelp(e,t,i,n){return await this.signatureManager.provideSignatureHelp(e,t,i,n)}async getDefinition(e,t,i){return this.definitionManager.hasProvider(e)?await this.definitionManager.provideDefinition(e,t,i):null}async getDeclaration(e,t,i){return this.declarationManager.hasProvider(e)?await this.declarationManager.provideDeclaration(e,t,i):null}async getTypeDefinition(e,t,i){return this.typeDefinitionManager.hasProvider(e)?await this.typeDefinitionManager.provideTypeDefinition(e,t,i):null}async getImplementation(e,t,i){return this.implementationManager.hasProvider(e)?await this.implementationManager.provideReferences(e,t,i):null}async getReferences(e,t,i,n){return this.referenceManager.hasProvider(e)?await this.referenceManager.provideReferences(e,i,t,n):null}async getDocumentSymbol(e,t){return await this.documentSymbolManager.provideDocumentSymbols(e,t)}async getSelectionRanges(e,t,i){return await this.selectionRangeManager.provideSelectionRanges(e,t,i)}async getWorkspaceSymbols(e,t){return e=e||"",await this.workspaceSymbolsManager.provideWorkspaceSymbols(e,t)}async resolveWorkspaceSymbol(e,t){return await this.workspaceSymbolsManager.resolveWorkspaceSymbol(e,t)}async prepareRename(e,t,i){return await this.renameManager.prepareRename(e,t,i)}async provideRenameEdits(e,t,i,n){return await this.renameManager.provideRenameEdits(e,t,i,n)}async provideDocumentFormattingEdits(e,t,i){if(!this.formatManager.hasProvider(e)){if(!this.formatRangeManager.hasProvider(e))return null;let o=e.positionAt(e.getText().length),s=ce.Range.create(ce.Position.create(0,0),o);return await this.provideDocumentRangeFormattingEdits(e,s,t,i)}return await this.formatManager.provideDocumentFormattingEdits(e,t,i)}async provideDocumentRangeFormattingEdits(e,t,i,n){return this.formatRangeManager.hasProvider(e)?await this.formatRangeManager.provideDocumentRangeFormattingEdits(e,t,i,n):null}async getCodeActions(e,t,i,n){return await this.codeActionManager.provideCodeActions(e,t,i,n)}async getDocumentHighLight(e,t,i){return await this.documentHighlightManager.provideDocumentHighlights(e,t,i)}async getDocumentLinks(e,t){return this.documentLinkManager.hasProvider(e)?await this.documentLinkManager.provideDocumentLinks(e,t)||[]:null}async resolveDocumentLink(e){return await this.documentLinkManager.resolveDocumentLink(e,this.token)}async provideDocumentColors(e,t){return await this.documentColorManager.provideDocumentColors(e,t)}async provideFoldingRanges(e,t,i){return this.foldingRangeManager.hasProvider(e)?await this.foldingRangeManager.provideFoldingRanges(e,t,i):null}async provideColorPresentations(e,t,i){return await this.documentColorManager.provideColorPresentations(e,t,i)}async getCodeLens(e,t){return await this.codeLensManager.provideCodeLenses(e,t)}async resolveCodeLens(e,t){return await this.codeLensManager.resolveCodeLens(e,t)}async provideDocumentOnTypeEdits(e,t,i,n){return this.onTypeFormatManager.onCharacterType(e,t,i,n)}hasOnTypeProvider(e,t){return this.onTypeFormatManager.getProvider(t,e)!=null}hasProvider(e,t){switch(e){case"rename":return this.renameManager.hasProvider(t);case"onTypeEdit":return this.onTypeFormatManager.hasProvider(t);case"documentLink":return this.documentLinkManager.hasProvider(t);case"documentColor":return this.documentColorManager.hasProvider(t);case"foldingRange":return this.foldingRangeManager.hasProvider(t);case"format":return this.formatManager.hasProvider(t)||this.formatRangeManager.hasProvider(t);case"codeAction":return this.codeActionManager.hasProvider(t);case"workspaceSymbols":return this.workspaceSymbolsManager.hasProvider();case"formatRange":return this.formatRangeManager.hasProvider(t);case"hover":return this.hoverManager.hasProvider(t);case"signature":return this.signatureManager.hasProvider(t);case"documentSymbol":return this.documentSymbolManager.hasProvider(t);case"documentHighlight":return this.documentHighlightManager.hasProvider(t);case"definition":return this.definitionManager.hasProvider(t);case"declaration":return this.declarationManager.hasProvider(t);case"typeDefinition":return this.typeDefinitionManager.hasProvider(t);case"reference":return this.referenceManager.hasProvider(t);case"implementation":return this.implementationManager.hasProvider(t);case"codeLens":return this.codeLensManager.hasProvider(t);case"selectionRange":return this.selectionRangeManager.hasProvider(t);default:throw new Error(`${e} not supported.`)}}dispose(){}createDiagnosticCollection(e){return St.create(e)}createCompleteSource(e,t,i,n,o,s,a){let l=[],u=typeof i.resolveCompletionItem=="function";a=a==null?this.completeConfig.priority:a;let c=new Set,f={name:e,priority:a,shortcut:t,enable:!0,sourceType:Yr.Service,filetypes:n,triggerCharacters:o||[],toggle:()=>{f.enable=!f.enable},doComplete:async(p,d)=>{let{triggerCharacter:h,bufnr:m}=p;c=new Set;let y=o&&o.includes(h),v=ce.CompletionTriggerKind.Invoked;if(p.triggerForInComplete?v=ce.CompletionTriggerKind.TriggerForIncompleteCompletions:y&&(v=ce.CompletionTriggerKind.TriggerCharacter),d.isCancellationRequested)return null;let x=M4(p),w={triggerKind:v,option:p};y&&(w.triggerCharacter=h);let E;try{let I=b.getDocument(m);E=await Promise.resolve(i.provideCompletionItems(I.textDocument,x,d,w))}catch(I){return mv.error(`Complete "${e}" error:`,I),null}if(!E||d.isCancellationRequested||(l=Array.isArray(E)?E:E.items,!l||l.length==0))return null;let P=this.getStartColumn(p.line,l),k=Object.assign({},p),_;P!=null&&(P<k.col&&(_=Rt(p.line,P,k.col)),k.col=P);let O=l.map((I,L)=>{let R=this.convertVimCompleteItem(I,t,k,_);return R.index=L,R});return{startcol:P,isIncomplete:!!E.isIncomplete,items:O}},onCompleteResolve:async(p,d)=>{let h=l[p.index];if(!!h){if(u&&!c.has(p.index)){let m=await Promise.resolve(i.resolveCompletionItem(h,d));if(d.isCancellationRequested)return;c.add(p.index),m&&Object.assign(h,m)}if(p.documentation==null){let{documentation:m,detail:y}=h;if(!m&&!y)return;let v=[];if(y&&!p.detailShown&&y!=p.word&&(y=y.replace(/\n\s*/g," "),y.length)){let x=/^[\w-\s.,\t]+$/.test(y),w=x?"txt":await b.nvim.eval("&filetype");v.push({filetype:x?"txt":w,content:y})}m&&(typeof m=="string"?v.push({filetype:"markdown",content:m}):m.value&&v.push({filetype:m.kind=="markdown"?"markdown":"txt",content:m.value})),p.documentation=v}}},onCompleteDone:async(p,d)=>{let h=l[p.index];if(!h)return;let m=d.linenr-1;h.insertText!=null&&!h.textEdit&&(h.textEdit={range:ce.Range.create(m,d.col,m,d.colnr-1),newText:h.insertText}),p.line&&Object.assign(d,{line:p.line});try{let y=await this.applyTextEdit(h,d),{additionalTextEdits:v}=h;if(v&&h.textEdit){let x=h.textEdit.range;v=v.filter(w=>Mm(x,w.range)?(mv.error("Filtered overlap additionalTextEdit:",w),!1):!0)}await this.applyAdditionalEdits(v,d.bufnr,y),y&&await Ft.selectCurrentPlaceholder(),h.command&&me.has(h.command.command)&&me.execute(h.command)}catch(y){mv.error("Error on CompleteDone:",y)}},shouldCommit:(p,d)=>{let h=l[p.index];return h?(h.commitCharacters||s).includes(d):!1}};return f}get token(){return this.cancelTokenSource=new ce.CancellationTokenSource,this.cancelTokenSource.token}async applyTextEdit(e,t){let{nvim:i}=this,{textEdit:n}=e;if(!n)return!1;let{line:o,bufnr:s,linenr:a}=t,l=b.getDocument(s);if(!l)return!1;let{range:u,newText:c}=n,f=e.insertTextFormat===ce.InsertTextFormat.Snippet,p=o.substr(0,u.start.character),d=o.substr(u.end.character);if(f){let y=l.getline(a-1).length-d.length,v=ce.Range.create(a-1,u.start.character,a-1,y);return await Ft.insertSnippet(c,!1,v)}let h=`${p}${c}${d}`.split(/\r?\n/);if(h.length==1)await i.call("coc#util#setline",[a,h[0]]),await C.moveTo(ce.Position.create(a-1,(p+c).length));else{await i.createBuffer(s).setLines(h,{start:a-1,end:a,strictIndexing:!1});let y=a-1+h.length-1,v=h[h.length-1].length-d.length;await C.moveTo({line:y,character:v})}return!1}async applyAdditionalEdits(e,t,i){if(!e||e.length==0)return;let n=b.getDocument(t);if(!n)return;await n.patchChange(!0);let o=null,s=await C.getCursorPosition();i||(o=$l(s,e)),await n.applyEdits(e),o&&await C.moveTo(ce.Position.create(s.line+o.line,s.character+o.character))}getStartColumn(e,t){let i=t[0];if(!i.textEdit)return null;let{range:n,newText:o}=i.textEdit,{character:s}=n.start;if(o.length<n.end.character-s)return null;for(let a=0;a<10;a++){let l=t[a];if(!l)break;if(!l.textEdit||l.textEdit.range.start.character!==s)return null}return Vr(e,s)}convertVimCompleteItem(e,t,i,n){var d;let{echodocSupport:o,detailMaxLength:s,invalidInsertCharacters:a}=this.completeConfig,{detailField:l}=this,u=e.additionalTextEdits&&e.additionalTextEdits.length>0,c=e.insertTextFormat===ce.InsertTextFormat.Snippet||u,f=e.label.trim(),p={word:q4(e,i,a),abbr:f,menu:`[${t}]`,kind:$4(e.kind,this.completionItemKindMap,this.completeConfig.defaultKindText),sortText:e.sortText||null,sourceScore:e.score||null,filterText:e.filterText||f,isSnippet:c,dup:e.data&&e.data.dup==0?0:1};if(n&&(p.filterText.startsWith(n)||(e.textEdit&&e.textEdit.newText.startsWith(n)?p.filterText=e.textEdit.newText.split(/\r?\n/)[0]:p.filterText=`${n}${p.filterText}`),!e.textEdit&&!p.word.startsWith(n)&&(p.word=`${n}${p.word}`)),e&&e.detail&&l!="preview"){let h=e.detail.replace(/\n\s*/g," ");ue(h)<s&&(l=="menu"?p.menu=`${h} ${p.menu}`:l=="abbr"&&(p.abbr=`${p.abbr} - ${h}`),p.detailShown=1)}if(e.documentation?p.info=typeof e.documentation=="string"?e.documentation:e.documentation.value:p.info="",p.word==""&&(p.empty=1),e.textEdit&&(p.line=i.line),e.kind==ce.CompletionItemKind.Folder&&!p.abbr.endsWith("/")&&(p.abbr=p.abbr+"/"),o&&e.kind>=2&&e.kind<=4){let h=[e.detail||"",p.abbr,p.word];for(let m of h)if(m.includes("(")){p.signature=m;break}}return e.preselect&&(p.preselect=!0),((d=e.data)==null?void 0:d.optional)&&(p.abbr=p.abbr+"?"),p}},U=new B4;var $E=class{constructor(e=-1){this.srcId=e;this.lines=[];this.highlights=[]}addLine(e,t){if(e.includes(`
|
||
`)){for(let i of e.split(/\r?\n/))this.addLine(i,t);return}if(t&&this.highlights.push({line:this.lines.length,colStart:e.match(/^\s*/)[0].length,colEnd:ue(e),hlGroup:t}),e.includes("")){let i=Nl(e);for(let n of i.highlights){let{span:o,hlGroup:s}=n;o[0]!=o[1]&&this.highlights.push({line: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)}addText(e,t){let{lines:i}=this,n=i[i.length-1]||"";if(t){let o=ue(n);this.highlights.push({line:i.length?i.length-1:0,colStart:o,colEnd:o+ue(e),hlGroup:t})}i.length?i[i.length-1]=`${n}${e}`:i.push(e)}get length(){return this.lines.length}getline(e){return this.lines[e]||""}render(e,t=0,i=-1){e.setLines(this.lines,{start:t,end:i,strictIndexing:!1},!0);for(let n of this.highlights)e.addHighlight({hlGroup:n.hlGroup,colStart:n.colStart,colEnd:n.colEnd==null?-1:n.colEnd,line:t+n.line,srcId:this.srcId}).logError()}},ss=$E;var BH=S(require("events")),jH=S(require("fs")),UH=S(require("net")),Ru=S(W());var Sa=S(require("child_process")),qH=S(require("fs")),nC=S(require("path")),Et=S(W());var jp=S(require("child_process")),gv=S(require("path")),j4=S(require("fs"));var oye=process.platform==="win32",sye=process.platform==="darwin",aye=process.platform==="linux",lye=gv.dirname(__dirname);function U4(r,e){if(!r.killed)if(oye)try{let t={stdio:["pipe","pipe","ignore"]};return e&&(t.cwd=e),jp.execFileSync("taskkill",["/T","/F","/PID",r.pid.toString()],t),!0}catch(t){return!1}else if(aye||sye)try{let t=gv.join(lye,"bin/terminateProcess.sh");return j4.default.existsSync(t)?!jp.spawnSync(t,[r.pid.toString()]).error:(console.error(`"${t}" not found`),!1)}catch(t){return!1}else return r.kill("SIGKILL"),!0}var WE=S(require("path")),D=S(W());var W4=S(W());"use strict";var g$e=j()("language-client-progressPart"),Up=class{constructor(e,t,i){this.client=e;this.token=t;this.disposables=[];this._cancelled=!1;this.statusBarItem=C.createStatusBarItem(99,{progress:!0}),this.disposables.push(e.onProgress(W4.WorkDoneProgress.type,this.token,n=>{switch(n.kind){case"begin":this.begin(n);break;case"report":this.report(n);break;case"end":this.done(n.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,z(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 BE=class{constructor(e){this.defaultDelay=e;this.timeout=null,this.completionPromise=null,this.doResolve=null,this.task=null}trigger(e,t=this.defaultDelay){return this.task=e,this.cancelTimeout(),this.completionPromise||(this.completionPromise=new Promise((i,n)=>{this.doResolve=i,this.doReject=n}).then(()=>{this.completionPromise=null,this.doResolve=null;let i=this.task;return this.task=null,i()})),this.timeout=setTimeout(()=>{this.timeout=null,this.doResolve(null)},t),this.completionPromise}isTriggered(){return this.timeout!==null}cancel(){this.cancelTimeout(),this.completionPromise&&(this.doReject(new Error("Canceled")),this.completionPromise=null)}cancelTimeout(){this.timeout!==null&&(clearTimeout(this.timeout),this.timeout=null)}dispose(){this.cancelTimeout()}};function H4(r){let e=r.map(t=>typeof t=="string"?t:t.language);return e=e.filter(t=>t!=null),e.length==0?null:e}function z4(r){return{uri:r.uri,languageId:r.languageId,version:r.version,text:r.getText()}}function G4(r){return{textDocument:{uri:r.uri}}}function V4(r){return{textDocument:{uri:r.uri,version:r.version},contentChanges:[{text:r.getText()}]}}function jE(r){return{textDocument:vv(r.document),reason:r.reason}}function vv(r){return{uri:r.uri,version:r.version}}function K4(r,e){let t={textDocument:vv(r)};return e&&(t.text=r.getText()),t}function Wp(r){return r.toString()}function J4(r,e,t){return{textDocument:{uri:r.uri},position:e,context:xa(t,["option"])}}function En(r,e){return{textDocument:{uri:r.uri},position:e}}function Y4(r,e,t){return{textDocument:UE(r),position:e,context:t}}function UE(r){return{uri:r.uri}}function X4(r,e,t){return{textDocument:{uri:r.uri},position:e,context:{includeDeclaration:t.includeDeclaration}}}function Z4(r){return{textDocument:{uri:r.uri}}}function Q4(r){return{textDocument:{uri:r.uri}}}function $e(){return he()}var as=j()("language-client-client"),eH=class{error(e){as.error(e)}warn(e){as.warn(e)}info(e){as.info(e)}log(e){as.log(e)}},tH=class{error(e){}warn(e){}info(e){}log(e){}};function uye(r,e,t,i){let n=new eH,o=D.createProtocolConnection(r,e,n);return o.onError(a=>{t(a[0],a[1],a[2])}),o.onClose(i),{listen:()=>o.listen(),sendRequest:(a,...l)=>o.sendRequest(bt(a)?a:a.method,...l),onRequest:(a,l)=>o.onRequest(bt(a)?a:a.method,l),sendNotification:(a,l)=>o.sendNotification(bt(a)?a:a.method,l),onNotification:(a,l)=>o.onNotification(bt(a)?a:a.method,l),onProgress:o.onProgress,sendProgress:o.sendProgress,trace:(a,l,u)=>{let c={sendNotification:!1,traceFormat:D.TraceFormat.Text};u===void 0?o.trace(a,l,c):(Tl(u),o.trace(a,l,u))},initialize:a=>o.sendRequest(D.InitializeRequest.type,a),shutdown:()=>o.sendRequest(D.ShutdownRequest.type,void 0),exit:()=>o.sendNotification(D.ExitNotification.type),onLogMessage:a=>o.onNotification(D.LogMessageNotification.type,a),onShowMessage:a=>o.onNotification(D.ShowMessageNotification.type,a),onTelemetry:a=>o.onNotification(D.TelemetryEventNotification.type,a),didChangeConfiguration:a=>o.sendNotification(D.DidChangeConfigurationNotification.type,a),didChangeWatchedFiles:a=>o.sendNotification(D.DidChangeWatchedFilesNotification.type,a),didOpenTextDocument:a=>o.sendNotification(D.DidOpenTextDocumentNotification.type,a),didChangeTextDocument:a=>o.sendNotification(D.DidChangeTextDocumentNotification.type,a),didCloseTextDocument:a=>o.sendNotification(D.DidCloseTextDocumentNotification.type,a),didSaveTextDocument:a=>o.sendNotification(D.DidSaveTextDocumentNotification.type,a),onDiagnostics:a=>o.onNotification(D.PublishDiagnosticsNotification.type,a),dispose:()=>o.dispose()}}var Tu;(function(r){r[r.Continue=1]="Continue",r[r.Shutdown=2]="Shutdown"})(Tu||(Tu={}));var ro;(function(r){r[r.DoNotRestart=1]="DoNotRestart",r[r.Restart=2]="Restart"})(ro||(ro={}));var HE=class{constructor(e){this.name=e;this.restarts=[]}error(e,t,i){return i&&i<=3?1:2}closed(){return this.restarts.push(Date.now()),this.restarts.length<5?2:this.restarts[this.restarts.length-1]-this.restarts[0]<=3*60*1e3?(C.showMessage(`The "${this.name}" server crashed 5 times in the last 3 minutes. The server will not be restarted.`,"error"),1):(this.restarts.shift(),2)}},ii;(function(r){r[r.Info=1]="Info",r[r.Warn=2]="Warn",r[r.Error=3]="Error",r[r.Never=4]="Never"})(ii||(ii={}));var ni;(function(r){r[r.Stopped=1]="Stopped",r[r.Running=2]="Running",r[r.Starting=3]="Starting"})(ni||(ni={}));var be;(function(r){r[r.Initial=0]="Initial",r[r.Starting=1]="Starting",r[r.StartFailed=2]="StartFailed",r[r.Running=3]="Running",r[r.Stopping=4]="Stopping",r[r.Stopped=5]="Stopped"})(be||(be={}));var rH=[D.SymbolKind.File,D.SymbolKind.Module,D.SymbolKind.Namespace,D.SymbolKind.Package,D.SymbolKind.Class,D.SymbolKind.Method,D.SymbolKind.Property,D.SymbolKind.Field,D.SymbolKind.Constructor,D.SymbolKind.Enum,D.SymbolKind.Interface,D.SymbolKind.Function,D.SymbolKind.Variable,D.SymbolKind.Constant,D.SymbolKind.String,D.SymbolKind.Number,D.SymbolKind.Boolean,D.SymbolKind.Array,D.SymbolKind.Object,D.SymbolKind.Key,D.SymbolKind.Null,D.SymbolKind.EnumMember,D.SymbolKind.Struct,D.SymbolKind.Event,D.SymbolKind.Operator,D.SymbolKind.TypeParameter],cye=[D.CompletionItemKind.Text,D.CompletionItemKind.Method,D.CompletionItemKind.Function,D.CompletionItemKind.Constructor,D.CompletionItemKind.Field,D.CompletionItemKind.Variable,D.CompletionItemKind.Class,D.CompletionItemKind.Interface,D.CompletionItemKind.Module,D.CompletionItemKind.Property,D.CompletionItemKind.Unit,D.CompletionItemKind.Value,D.CompletionItemKind.Enum,D.CompletionItemKind.Keyword,D.CompletionItemKind.Snippet,D.CompletionItemKind.Color,D.CompletionItemKind.File,D.CompletionItemKind.Reference,D.CompletionItemKind.Folder,D.CompletionItemKind.EnumMember,D.CompletionItemKind.Constant,D.CompletionItemKind.Struct,D.CompletionItemKind.Event,D.CompletionItemKind.Operator,D.CompletionItemKind.TypeParameter],iH=[D.SymbolTag.Deprecated];function re(r,e){return r[e]==null&&(r[e]={}),r[e]}var zE;(function(e){function r(t){let i=t;return i&&Lo(i.register)&&Lo(i.unregister)&&Lo(i.dispose)&&i.messages!==void 0}e.is=r})(zE||(zE={}));var Cn=class{constructor(e,t,i,n,o,s){this._client=e;this._event=t;this._type=i;this._middleware=n;this._createParams=o;this._selectorFilter=s;this._selectors=new Map}static textDocumentFilter(e,t){for(let i of e)if(b.match(i,t)>0)return!0;return!1}register(e,t){!t.registerOptions.documentSelector||(this._listener||(this._listener=this._event(this.callback,this)),this._selectors.set(t.id,t.registerOptions.documentSelector))}callback(e){(!this._selectorFilter||this._selectorFilter(this._selectors.values(),e))&&(this._middleware?this._middleware(e,t=>this._client.sendNotification(this._type,this._createParams(t))):this._client.sendNotification(this._type,this._createParams(e)),this.notificationSent(e))}notificationSent(e){}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}dispose(){this._selectors.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}getProvider(e){for(let t of this._selectors.values())if(b.match(t,e))return{send:i=>{this.callback(i)}};throw new Error("No provider available for the given text document")}},nH=class extends Cn{constructor(e,t){super(e,b.onDidOpenTextDocument,D.DidOpenTextDocumentNotification.type,e.clientOptions.middleware.didOpen,i=>({textDocument:z4(i)}),Cn.textDocumentFilter);this._syncedDocuments=t}get messages(){return D.DidOpenTextDocumentNotification.type}fillClientCapabilities(e){re(re(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register(this.messages,{id:$e(),registerOptions:{documentSelector:t}})}register(e,t){if(super.register(e,t),!t.registerOptions.documentSelector)return;let i=t.registerOptions.documentSelector;b.textDocuments.forEach(n=>{let o=n.uri.toString();if(!this._syncedDocuments.has(o)&&b.match(i,n)>0){let s=this._client.clientOptions.middleware,a=l=>{this._client.sendNotification(this._type,this._createParams(l))};s.didOpen?s.didOpen(n,a):a(n),this._syncedDocuments.set(o,n)}})}notificationSent(e){super.notificationSent(e),this._syncedDocuments.set(e.uri.toString(),e)}},oH=class extends Cn{constructor(e,t){super(e,b.onDidCloseTextDocument,D.DidCloseTextDocumentNotification.type,e.clientOptions.middleware.didClose,i=>G4(i),Cn.textDocumentFilter);this._syncedDocuments=t}get messages(){return D.DidCloseTextDocumentNotification.type}fillClientCapabilities(e){re(re(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.openClose&&this.register(this.messages,{id:$e(),registerOptions:{documentSelector:t}})}notificationSent(e){super.notificationSent(e),this._syncedDocuments.delete(e.uri.toString())}unregister(e){let t=this._selectors.get(e);super.unregister(e);let i=this._selectors.values();this._syncedDocuments.forEach(n=>{if(b.match(t,n)>0&&!this._selectorFilter(i,n)){let o=this._client.clientOptions.middleware,s=a=>{this._client.sendNotification(this._type,this._createParams(a))};this._syncedDocuments.delete(n.uri.toString()),o.didClose?o.didClose(n,s):s(n)}})}},sH=class{constructor(e){this._client=e;this._changeData=new Map}get messages(){return D.DidChangeTextDocumentNotification.type}fillClientCapabilities(e){re(re(e,"textDocument"),"synchronization").dynamicRegistration=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.change!==void 0&&i.change!==D.TextDocumentSyncKind.None&&this.register(this.messages,{id:$e(),registerOptions:Object.assign({},{documentSelector:t},{syncKind:i.change})})}register(e,t){!t.registerOptions.documentSelector||(this._listener||(this._listener=b.onDidChangeTextDocument(this.callback,this)),this._changeData.set(t.id,{documentSelector:t.registerOptions.documentSelector,syncKind:t.registerOptions.syncKind}))}callback(e){if(e.contentChanges.length===0)return;let t=b.getDocument(e.textDocument.uri);if(!t)return;let{textDocument:i}=t;for(let n of this._changeData.values())if(b.match(n.documentSelector,i)>0){let o=this._client.clientOptions.middleware;if(n.syncKind===D.TextDocumentSyncKind.Incremental)o.didChange?o.didChange(e,()=>this._client.sendNotification(D.DidChangeTextDocumentNotification.type,xa(e,["bufnr","original"]))):this._client.sendNotification(D.DidChangeTextDocumentNotification.type,xa(e,["bufnr","original"]));else if(n.syncKind===D.TextDocumentSyncKind.Full){let s=a=>{let{textDocument:l}=b.getDocument(a.textDocument.uri);this._client.sendNotification(D.DidChangeTextDocumentNotification.type,V4(l))};o.didChange?o.didChange(e,s):s(e)}}}unregister(e){this._changeData.delete(e),this._changeData.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}dispose(){this._changeData.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}getProvider(e){for(let t of this._changeData.values())if(b.match(t.documentSelector,e))return{send:i=>{this.callback(i)}};throw new Error("No provider available for the given text document")}},aH=class extends Cn{constructor(e){super(e,b.onWillSaveTextDocument,D.WillSaveTextDocumentNotification.type,e.clientOptions.middleware.willSave,t=>jE(t),(t,i)=>Cn.textDocumentFilter(t,i.document))}get messages(){return D.WillSaveTextDocumentNotification.type}fillClientCapabilities(e){let t=re(re(e,"textDocument"),"synchronization");t.willSave=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSave&&this.register(this.messages,{id:$e(),registerOptions:{documentSelector:t}})}},lH=class{constructor(e){this._client=e;this._selectors=new Map}get messages(){return D.WillSaveTextDocumentWaitUntilRequest.type}fillClientCapabilities(e){let t=re(re(e,"textDocument"),"synchronization");t.willSaveWaitUntil=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.willSaveWaitUntil&&this.register(this.messages,{id:$e(),registerOptions:{documentSelector:t}})}register(e,t){!t.registerOptions.documentSelector||(this._listener||(this._listener=b.onWillSaveTextDocument(this.callback,this)),this._selectors.set(t.id,t.registerOptions.documentSelector))}callback(e){if(Cn.textDocumentFilter(this._selectors.values(),e.document)){let t=this._client.clientOptions.middleware,i=n=>this._client.sendRequest(D.WillSaveTextDocumentWaitUntilRequest.type,jE(n)).then(o=>o||[],o=>(C.showMessage(`Error on willSaveWaitUntil: ${o}`,"error"),as.error(o),[]));e.waitUntil(t.willSaveWaitUntil?t.willSaveWaitUntil(e,i):i(e))}}unregister(e){this._selectors.delete(e),this._selectors.size===0&&this._listener&&(this._listener.dispose(),this._listener=void 0)}dispose(){this._selectors.clear(),this._listener&&(this._listener.dispose(),this._listener=void 0)}},uH=class extends Cn{constructor(e){super(e,b.onDidSaveTextDocument,D.DidSaveTextDocumentNotification.type,e.clientOptions.middleware.didSave,t=>K4(t,this._includeText),Cn.textDocumentFilter)}get messages(){return D.DidSaveTextDocumentNotification.type}fillClientCapabilities(e){re(re(e,"textDocument"),"synchronization").didSave=!0}initialize(e,t){let i=e.resolvedTextDocumentSync;t&&i&&i.save&&this.register(this.messages,{id:$e(),registerOptions:Object.assign({},{documentSelector:t},{includeText:!!i.save.includeText})})}register(e,t){this._includeText=!!t.registerOptions.includeText,super.register(e,t)}},cH=class{constructor(e,t){this._notifyFileEvent=t;this._watchers=new Map}get messages(){return D.DidChangeWatchedFilesNotification.type}fillClientCapabilities(e){re(re(e,"workspace"),"didChangeWatchedFiles").dynamicRegistration=!0}initialize(e,t){}register(e,t){if(!Array.isArray(t.registerOptions.watchers))return;let i=[];for(let n of t.registerOptions.watchers){if(!bt(n.globPattern))continue;let o=!0,s=!0,a=!0;n.kind!=null&&(o=(n.kind&D.WatchKind.Create)!=0,s=(n.kind&D.WatchKind.Change)!=0,a=(n.kind&D.WatchKind.Delete)!=0);let l=b.createFileSystemWatcher(n.globPattern,!o,!s,!a);this.hookListeners(l,o,s,a,i),i.push(l)}this._watchers.set(t.id,i)}registerRaw(e,t){let i=[];for(let n of t)i.push(n),this.hookListeners(n,!0,!0,!0,i);this._watchers.set(e,i)}hookListeners(e,t,i,n,o){t&&e.onDidCreate(s=>this._notifyFileEvent({uri:Wp(s),type:D.FileChangeType.Created}),null,o),i&&e.onDidChange(s=>this._notifyFileEvent({uri:Wp(s),type:D.FileChangeType.Changed}),null,o),n&&e.onDidDelete(s=>this._notifyFileEvent({uri:Wp(s),type:D.FileChangeType.Deleted}),null,o)}unregister(e){let t=this._watchers.get(e);if(t)for(let i of t)i.dispose()}dispose(){this._watchers.forEach(e=>{for(let t of e)t.dispose()}),this._watchers.clear()}},Ge=class{constructor(e,t){this._client=e;this._message=t;this._registrations=new Map}get messages(){return this._message}register(e,t){if(e.method!==this.messages.method)throw new Error(`Register called on wrong feature. Requested ${e.method} but reached feature ${this.messages.method}`);if(!t.registerOptions.documentSelector)return;let i=this.registerLanguageProvider(t.registerOptions);this._registrations.set(t.id,{disposable:i[0],data:t,provider:i[1]})}unregister(e){let t=this._registrations.get(e);t&&t.disposable.dispose()}dispose(){this._registrations.forEach(e=>{e.disposable.dispose()}),this._registrations.clear()}getRegistration(e,t){if(t){if(D.TextDocumentRegistrationOptions.is(t)){let i=D.StaticRegistrationOptions.hasId(t)?t.id:$e(),n=t.documentSelector||e;if(n)return[i,Object.assign({},t,{documentSelector:n})]}else if(Tl(t)&&t===!0||D.WorkDoneProgressOptions.is(t)){if(!e)return[void 0,void 0];let i=Tl(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e});return[$e(),i]}}else return[void 0,void 0];return[void 0,void 0]}getRegistrationOptions(e,t){if(!(!e||!t))return Tl(t)&&t===!0?{documentSelector:e}:Object.assign({},t,{documentSelector:e})}getProvider(e){for(let t of this._registrations.values()){let i=t.data.registerOptions.documentSelector;if(i!==null&&b.match(i,e)>0)return t.provider}throw new Error(`The feature has no registration for the provided text document ${e.uri.toString()}`)}},fH=class{constructor(e,t){this._client=e;this._message=t;this._registrations=new Map}get messages(){return this._message}register(e,t){if(e.method!==this.messages.method)throw new Error(`Register called on wrong feature. Requested ${e.method} but reached feature ${this.messages.method}`);let i=this.registerLanguageProvider(t.registerOptions);this._registrations.set(t.id,i)}unregister(e){let t=this._registrations.get(e);t&&t.dispose()}dispose(){this._registrations.forEach(e=>{e.dispose()}),this._registrations.clear()}},pH=class extends Ge{constructor(e){super(e,D.CompletionRequest.type)}fillClientCapabilities(e){let t=this._client.clientOptions.disableSnippetCompletion!==!0,i=re(re(e,"textDocument"),"completion");i.dynamicRegistration=!0,i.contextSupport=!0,i.completionItem={snippetSupport:t,commitCharactersSupport:!0,documentationFormat:this._client.supporedMarkupKind,deprecatedSupport:!0,preselectSupport:!0,tagSupport:{valueSet:[D.CompletionItemTag.Deprecated]}},i.completionItemKind={valueSet:cye}}initialize(e,t){this.index=0;let i=this.getRegistrationOptions(t,e.completionProvider);!i||this.register(this.messages,{id:$e(),registerOptions:i})}registerLanguageProvider(e){let t=e.triggerCharacters||[],i=e.allCommitCharacters||[],n=e.priority;this.index=this.index+1;let o={provideCompletionItems:(l,u,c,f)=>{let p=this._client,d=this._client.clientOptions.middleware,h=(m,y,v,x)=>p.sendRequest(D.CompletionRequest.type,J4(m,y,v),x).then(w=>w,w=>(p.logFailedRequest(D.CompletionRequest.type,w),Promise.resolve([])));return d.provideCompletionItem?d.provideCompletionItem(l,u,f,c,h):h(l,u,f,c)},resolveCompletionItem:e.resolveProvider?(l,u)=>{let c=this._client,f=this._client.clientOptions.middleware,p=(d,h)=>c.sendRequest(D.CompletionResolveRequest.type,d,h).then(m=>m,m=>(c.logFailedRequest(D.CompletionResolveRequest.type,m),Promise.resolve(d)));return f.resolveCompletionItem?f.resolveCompletionItem(l,u,p):p(l,u)}:void 0},s=H4(e.documentSelector);return[U.registerCompletionItemProvider(this._client.id+"-"+this.index,"LS",s,o,t,n,i),o]}},dH=class extends Ge{constructor(e){super(e,D.HoverRequest.type)}fillClientCapabilities(e){let t=re(re(e,"textDocument"),"hover");t.dynamicRegistration=!0,t.contentFormat=this._client.supporedMarkupKind}initialize(e,t){let i=this.getRegistrationOptions(t,e.hoverProvider);!i||this.register(this.messages,{id:$e(),registerOptions:i})}registerLanguageProvider(e){let t={provideHover:(i,n,o)=>{let s=this._client,a=(u,c,f)=>s.sendRequest(D.HoverRequest.type,En(u,c),f).then(p=>p,p=>(s.logFailedRequest(D.HoverRequest.type,p),Promise.resolve(null))),l=s.clientOptions.middleware;return l.provideHover?l.provideHover(i,n,o,a):a(i,n,o)}};return[U.registerHoverProvider(e.documentSelector,t),t]}},hH=class extends Ge{constructor(e){super(e,D.SignatureHelpRequest.type)}fillClientCapabilities(e){let t=re(re(e,"textDocument"),"signatureHelp");t.dynamicRegistration=!0,t.contextSupport=!0,t.signatureInformation={documentationFormat:this._client.supporedMarkupKind,activeParameterSupport:!0,parameterInformation:{labelOffsetSupport:!0}}}initialize(e,t){let i=this.getRegistrationOptions(t,e.signatureHelpProvider);!i||this.register(this.messages,{id:$e(),registerOptions:i})}registerLanguageProvider(e){let t={provideSignatureHelp:(o,s,a,l)=>{let u=this._client,c=(p,d,h,m)=>u.sendRequest(D.SignatureHelpRequest.type,Y4(p,d,h),m).then(y=>y,y=>(u.logFailedRequest(D.SignatureHelpRequest.type,y),Promise.resolve(null))),f=u.clientOptions.middleware;return f.provideSignatureHelp?f.provideSignatureHelp(o,s,l,a,c):c(o,s,l,a)}},i=e.triggerCharacters||[];return[U.registerSignatureHelpProvider(e.documentSelector,t,i),t]}},mH=class extends Ge{constructor(e){super(e,D.DefinitionRequest.type)}fillClientCapabilities(e){let t=re(re(e,"textDocument"),"definition");t.dynamicRegistration=!0}initialize(e,t){let i=this.getRegistrationOptions(t,e.definitionProvider);!i||this.register(this.messages,{id:$e(),registerOptions:i})}registerLanguageProvider(e){let t={provideDefinition:(i,n,o)=>{let s=this._client,a=(u,c,f)=>s.sendRequest(D.DefinitionRequest.type,En(u,c),f).then(p=>p,p=>(s.logFailedRequest(D.DefinitionRequest.type,p),Promise.resolve(null))),l=s.clientOptions.middleware;return l.provideDefinition?l.provideDefinition(i,n,o,a):a(i,n,o)}};return[U.registerDefinitionProvider(e.documentSelector,t),t]}},gH=class extends Ge{constructor(e){super(e,D.ReferencesRequest.type)}fillClientCapabilities(e){re(re(e,"textDocument"),"references").dynamicRegistration=!0}initialize(e,t){let i=this.getRegistrationOptions(t,e.referencesProvider);!i||this.register(this.messages,{id:$e(),registerOptions:i})}registerLanguageProvider(e){let t={provideReferences:(i,n,o,s)=>{let a=this._client,l=(c,f,p,d)=>a.sendRequest(D.ReferencesRequest.type,X4(c,f,p),d).then(h=>h,h=>(a.logFailedRequest(D.ReferencesRequest.type,h),Promise.resolve([]))),u=a.clientOptions.middleware;return u.provideReferences?u.provideReferences(i,n,o,s,l):l(i,n,o,s)}};return[U.registerReferencesProvider(e.documentSelector,t),t]}},vH=class extends Ge{constructor(e){super(e,D.DocumentHighlightRequest.type)}fillClientCapabilities(e){re(re(e,"textDocument"),"documentHighlight").dynamicRegistration=!0}initialize(e,t){let i=this.getRegistrationOptions(t,e.documentHighlightProvider);!i||this.register(this.messages,{id:$e(),registerOptions:i})}registerLanguageProvider(e){let t={provideDocumentHighlights:(i,n,o)=>{let s=this._client,a=(u,c,f)=>s.sendRequest(D.DocumentHighlightRequest.type,En(u,c),f).then(p=>p,p=>(s.logFailedRequest(D.DocumentHighlightRequest.type,p),Promise.resolve([]))),l=s.clientOptions.middleware;return l.provideDocumentHighlights?l.provideDocumentHighlights(i,n,o,a):a(i,n,o)}};return[U.registerDocumentHighlightProvider(e.documentSelector,t),t]}},yH=class extends Ge{constructor(e){super(e,D.DocumentSymbolRequest.type)}fillClientCapabilities(e){let t=re(re(e,"textDocument"),"documentSymbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:rH},t.hierarchicalDocumentSymbolSupport=!0,t.tagSupport={valueSet:iH}}initialize(e,t){let i=this.getRegistrationOptions(t,e.documentSymbolProvider);!i||this.register(this.messages,{id:$e(),registerOptions:i})}registerLanguageProvider(e){let t={provideDocumentSymbols:(i,n)=>{let o=this._client,s=(l,u)=>o.sendRequest(D.DocumentSymbolRequest.type,Z4(l),u).then(c=>{if(c!==null){if(c.length===0)return[];{let f=c[0];return D.DocumentSymbol.is(f),c}}},c=>(o.logFailedRequest(D.DocumentSymbolRequest.type,c),Promise.resolve([]))),a=o.clientOptions.middleware;return a.provideDocumentSymbols?a.provideDocumentSymbols(i,n,s):s(i,n)}};return[U.registerDocumentSymbolProvider(e.documentSelector,t),t]}},bH=class extends fH{constructor(e){super(e,D.WorkspaceSymbolRequest.type)}fillClientCapabilities(e){let t=re(re(e,"workspace"),"symbol");t.dynamicRegistration=!0,t.symbolKind={valueSet:rH},t.tagSupport={valueSet:iH}}initialize(e){!e.workspaceSymbolProvider||this.register(this.messages,{id:$e(),registerOptions:e.workspaceSymbolProvider===!0?{workDoneProgress:!1}:e.workspaceSymbolProvider})}registerLanguageProvider(e){let t={provideWorkspaceSymbols:(i,n)=>{let o=this._client,s=(l,u)=>o.sendRequest(D.WorkspaceSymbolRequest.type,{query:l},u).then(c=>c,c=>(o.logFailedRequest(D.WorkspaceSymbolRequest.type,c),Promise.resolve([]))),a=o.clientOptions.middleware;return a.provideWorkspaceSymbols?a.provideWorkspaceSymbols(i,n,s):s(i,n)}};return U.registerWorkspaceSymbolProvider(t)}},wH=class extends Ge{constructor(e){super(e,D.CodeActionRequest.type)}fillClientCapabilities(e){let t=re(re(e,"textDocument"),"codeAction");t.dynamicRegistration=!0,t.isPreferredSupport=!0,t.codeActionLiteralSupport={codeActionKind:{valueSet:[D.CodeActionKind.Empty,D.CodeActionKind.QuickFix,D.CodeActionKind.Refactor,D.CodeActionKind.RefactorExtract,D.CodeActionKind.RefactorInline,D.CodeActionKind.RefactorRewrite,D.CodeActionKind.Source,D.CodeActionKind.SourceOrganizeImports]}}}initialize(e,t){let i=this.getRegistrationOptions(t,e.codeActionProvider);!i||this.register(this.messages,{id:$e(),registerOptions:i})}registerLanguageProvider(e){let t={provideCodeActions:(i,n,o,s)=>{let a=this._client,l=(c,f,p,d)=>{let h={textDocument:{uri:c.uri},range:f,context:p};return a.sendRequest(D.CodeActionRequest.type,h,d).then(m=>{if(m!==null)return m},m=>(a.logFailedRequest(D.CodeActionRequest.type,m),Promise.resolve([])))},u=a.clientOptions.middleware;return u.provideCodeActions?u.provideCodeActions(i,n,o,s,l):l(i,n,o,s)}};return[U.registerCodeActionProvider(e.documentSelector,t,this._client.id,e.codeActionKinds),t]}},xH=class extends Ge{constructor(e){super(e,D.CodeLensRequest.type)}fillClientCapabilities(e){re(re(e,"textDocument"),"codeLens").dynamicRegistration=!0}initialize(e,t){let i=this.getRegistrationOptions(t,e.codeLensProvider);!i||this.register(this.messages,{id:$e(),registerOptions:i})}registerLanguageProvider(e){let t={provideCodeLenses:(i,n)=>{let o=this._client,s=(l,u)=>o.sendRequest(D.CodeLensRequest.type,Q4(l),u).then(c=>c,c=>(o.logFailedRequest(D.CodeLensRequest.type,c),Promise.resolve([]))),a=o.clientOptions.middleware;return a.provideCodeLenses?a.provideCodeLenses(i,n,s):s(i,n)},resolveCodeLens:e.resolveProvider?(i,n)=>{let o=this._client,s=(l,u)=>o.sendRequest(D.CodeLensResolveRequest.type,l,u).then(c=>c,c=>(o.logFailedRequest(D.CodeLensResolveRequest.type,c),l)),a=o.clientOptions.middleware;return a.resolveCodeLens?a.resolveCodeLens(i,n,s):s(i,n)}:void 0};return[U.registerCodeLensProvider(e.documentSelector,t),t]}},DH=class extends Ge{constructor(e){super(e,D.DocumentFormattingRequest.type)}fillClientCapabilities(e){re(re(e,"textDocument"),"formatting").dynamicRegistration=!0}initialize(e,t){let i=this.getRegistrationOptions(t,e.documentFormattingProvider);!i||this.register(this.messages,{id:$e(),registerOptions:i})}registerLanguageProvider(e){let t={provideDocumentFormattingEdits:(i,n,o)=>{let s=this._client,a=(u,c,f)=>{let p={textDocument:{uri:u.uri},options:c};return s.sendRequest(D.DocumentFormattingRequest.type,p,f).then(d=>d,d=>(s.logFailedRequest(D.DocumentFormattingRequest.type,d),Promise.resolve([])))},l=s.clientOptions.middleware;return l.provideDocumentFormattingEdits?l.provideDocumentFormattingEdits(i,n,o,a):a(i,n,o)}};return[U.registerDocumentFormatProvider(e.documentSelector,t,this._client.clientOptions.formatterPriority),t]}},SH=class extends Ge{constructor(e){super(e,D.DocumentRangeFormattingRequest.type)}fillClientCapabilities(e){re(re(e,"textDocument"),"rangeFormatting").dynamicRegistration=!0}initialize(e,t){let i=this.getRegistrationOptions(t,e.documentRangeFormattingProvider);!i||this.register(this.messages,{id:$e(),registerOptions:i})}registerLanguageProvider(e){let t={provideDocumentRangeFormattingEdits:(i,n,o,s)=>{let a=this._client,l=(c,f,p,d)=>{let h={textDocument:{uri:c.uri},range:f,options:p};return a.sendRequest(D.DocumentRangeFormattingRequest.type,h,d).then(m=>m,m=>(a.logFailedRequest(D.DocumentRangeFormattingRequest.type,m),Promise.resolve([])))},u=a.clientOptions.middleware;return u.provideDocumentRangeFormattingEdits?u.provideDocumentRangeFormattingEdits(i,n,o,s,l):l(i,n,o,s)}};return[U.registerDocumentRangeFormatProvider(e.documentSelector,t),t]}},EH=class extends Ge{constructor(e){super(e,D.DocumentOnTypeFormattingRequest.type)}fillClientCapabilities(e){re(re(e,"textDocument"),"onTypeFormatting").dynamicRegistration=!0}initialize(e,t){let i=this.getRegistrationOptions(t,e.documentOnTypeFormattingProvider);!i||this.register(this.messages,{id:$e(),registerOptions:i})}registerLanguageProvider(e){let t={provideOnTypeFormattingEdits:(o,s,a,l,u)=>{let c=this._client,f=(d,h,m,y,v)=>{let x={textDocument:vv(d),position:h,ch:m,options:y};return c.sendRequest(D.DocumentOnTypeFormattingRequest.type,x,v).then(w=>w,w=>(c.logFailedRequest(D.DocumentOnTypeFormattingRequest.type,w),Promise.resolve([])))},p=c.clientOptions.middleware;return p.provideOnTypeFormattingEdits?p.provideOnTypeFormattingEdits(o,s,a,l,u,f):f(o,s,a,l,u)}},i=e.moreTriggerCharacter||[],n=[e.firstTriggerCharacter,...i];return[U.registerOnTypeFormattingEditProvider(e.documentSelector,t,n),t]}},CH=class extends Ge{constructor(e){super(e,D.RenameRequest.type)}fillClientCapabilities(e){let t=re(re(e,"textDocument"),"rename");t.dynamicRegistration=!0,t.prepareSupport=!0}initialize(e,t){let i=this.getRegistrationOptions(t,e.renameProvider);!i||(Tl(e.renameProvider)&&(i.prepareProvider=!1),this.register(this.messages,{id:$e(),registerOptions:i}))}registerLanguageProvider(e){let t={provideRenameEdits:(i,n,o,s)=>{let a=this._client,l=(c,f,p,d)=>{let h={textDocument:{uri:c.uri},position:f,newName:p};return a.sendRequest(D.RenameRequest.type,h,d).then(m=>m,m=>(a.logFailedRequest(D.RenameRequest.type,m),Promise.reject(new Error(m.message))))},u=a.clientOptions.middleware;return u.provideRenameEdits?u.provideRenameEdits(i,n,o,s,l):l(i,n,o,s)},prepareRename:e.prepareProvider?(i,n,o)=>{let s=this._client,a=(u,c,f)=>{let p={textDocument:UE(u),position:c};return s.sendRequest(D.PrepareRenameRequest.type,p,f).then(d=>D.Range.is(d)?d:d&&D.Range.is(d.range)?{range:d.range,placeholder:d.placeholder}:Promise.reject(new Error("The element can't be renamed.")),d=>(s.logFailedRequest(D.PrepareRenameRequest.type,d),Promise.reject(new Error(d.message))))},l=s.clientOptions.middleware;return l.prepareRename?l.prepareRename(i,n,o,a):a(i,n,o)}:void 0};return[U.registerRenameProvider(e.documentSelector,t),t]}},_H=class extends Ge{constructor(e){super(e,D.DocumentLinkRequest.type)}fillClientCapabilities(e){let t=re(re(e,"textDocument"),"documentLink");t.dynamicRegistration=!0,t.tooltipSupport=!0}initialize(e,t){let i=this.getRegistrationOptions(t,e.documentLinkProvider);!i||this.register(this.messages,{id:$e(),registerOptions:i})}registerLanguageProvider(e){let t={provideDocumentLinks:(i,n)=>{let o=this._client,s=(l,u)=>o.sendRequest(D.DocumentLinkRequest.type,{textDocument:{uri:l.uri}},u).then(c=>c,c=>(o.logFailedRequest(D.DocumentLinkRequest.type,c),Promise.resolve([]))),a=o.clientOptions.middleware;return a.provideDocumentLinks?a.provideDocumentLinks(i,n,s):s(i,n)},resolveDocumentLink:e.resolveProvider?(i,n)=>{let o=this._client,s=(l,u)=>o.sendRequest(D.DocumentLinkResolveRequest.type,l,u).then(c=>c,c=>(o.logFailedRequest(D.DocumentLinkResolveRequest.type,c),Promise.resolve(l))),a=o.clientOptions.middleware;return a.resolveDocumentLink?a.resolveDocumentLink(i,n,s):s(i,n)}:void 0};return[U.registerDocumentLinkProvider(e.documentSelector,t),t]}},PH=class{constructor(e){this._client=e;this._listeners=new Map}get messages(){return D.DidChangeConfigurationNotification.type}fillClientCapabilities(e){re(re(e,"workspace"),"didChangeConfiguration").dynamicRegistration=!0}initialize(){var t;let e=(t=this._client.clientOptions.synchronize)==null?void 0:t.configurationSection;e!==void 0&&this.register(this.messages,{id:$e(),registerOptions:{section:e}})}register(e,t){let{section:i}=t.registerOptions,n=b.onDidChangeConfiguration(o=>{typeof i=="string"&&!o.affectsConfiguration(i)||Array.isArray(i)&&!i.some(s=>o.affectsConfiguration(s))||i!=null&&this.onDidChangeConfiguration(t.registerOptions.section)});if(this._listeners.set(t.id,n),bt(i)&&i.endsWith(".settings")){let o=this.getConfiguredSettings(i);if(!o||fm(o))return}i!=null&&this.onDidChangeConfiguration(t.registerOptions.section)}unregister(e){let t=this._listeners.get(e);t&&(this._listeners.delete(e),t.dispose())}dispose(){for(let e of this._listeners.values())e.dispose();this._listeners.clear()}onDidChangeConfiguration(e){let t=typeof e=="string"&&e.startsWith("languageserver."),i;bt(e)?i=[e]:i=e;let n=s=>{if(s===void 0){this._client.sendNotification(D.DidChangeConfigurationNotification.type,{settings:null});return}this._client.sendNotification(D.DidChangeConfigurationNotification.type,{settings:t?this.getConfiguredSettings(s[0]):this.extractSettingsInformation(s)})},o=this.getMiddleware();o?o(i,n):n(i)}getConfiguredSettings(e){let t=".settings".length;return b.getConfiguration(e.slice(0,-t)).get("settings",{})}extractSettingsInformation(e){function t(n,o){let s=n;for(let a=0;a<o.length-1;a++){let l=s[o[a]];l||(l=Object.create(null),s[o[a]]=l),s=l}return s}let i=Object.create(null);for(let n=0;n<e.length;n++){let o=e[n],s=o.indexOf("."),a=null;if(s>=0?a=b.getConfiguration(o.substr(0,s)).get(o.substr(s+1)):a=b.getConfiguration(o),a){let l=e[n].split(".");t(i,l)[l[l.length-1]]=a}}return i}getMiddleware(){let e=this._client.clientOptions.middleware;if(e.workspace&&e.workspace.didChangeConfiguration)return e.workspace.didChangeConfiguration}},TH=class{constructor(e){this._client=e;this._commands=new Map}get messages(){return D.ExecuteCommandRequest.type}fillClientCapabilities(e){re(re(e,"workspace"),"executeCommand").dynamicRegistration=!0}initialize(e){!e.executeCommandProvider||this.register(this.messages,{id:$e(),registerOptions:Object.assign({},e.executeCommandProvider)})}register(e,t){let i=this._client,n=i.clientOptions.middleware,o=(s,a)=>{let l={command:s,arguments:a};return i.sendRequest(D.ExecuteCommandRequest.type,l).then(void 0,u=>{throw i.logFailedRequest(D.ExecuteCommandRequest.type,u),u})};if(t.registerOptions.commands){let s=[];for(let a of t.registerOptions.commands)s.push(me.registerCommand(a,(...l)=>n.executeCommand?n.executeCommand(a,l,o):o(a,l),null,!0));this._commands.set(t.id,s)}}unregister(e){let t=this._commands.get(e);t&&t.forEach(i=>i.dispose())}dispose(){this._commands.forEach(e=>{e.forEach(t=>t.dispose())}),this._commands.clear()}},Hp;(function(e){function r(t){return t&&D.MessageReader.is(t.reader)&&D.MessageWriter.is(t.writer)}e.is=r})(Hp||(Hp={}));var GE=class{constructor(e,t){this._resolve=e;this._reject=t;this._used=!1}get isUsed(){return this._used}resolve(){this._used=!0,this._resolve()}reject(e){this._used=!0,this._reject(e)}},yv=class{constructor(e,t,i){this._features=[];this._method2Message=new Map;this._dynamicFeatures=new Map;this._id=e,this._name=t,i.outputChannel?this._outputChannel=i.outputChannel:this._outputChannel=void 0,this._clientOptions={disableWorkspaceFolders:i.disableWorkspaceFolders,disableSnippetCompletion:i.disableSnippetCompletion,disableDynamicRegister:i.disableDynamicRegister,disableDiagnostics:i.disableDiagnostics,disableCompletion:i.disableCompletion,formatterPriority:i.formatterPriority,ignoredRootPaths:i.ignoredRootPaths,documentSelector:i.documentSelector||[],synchronize:i.synchronize||{},diagnosticCollectionName:i.diagnosticCollectionName,outputChannelName:i.outputChannelName||this._id,revealOutputChannelOn:i.revealOutputChannelOn||4,stdioEncoding:i.stdioEncoding||"utf8",initializationOptions:i.initializationOptions,initializationFailedHandler:i.initializationFailedHandler,progressOnInitialization:!!i.progressOnInitialization,errorHandler:i.errorHandler||new HE(this._id),middleware:i.middleware||{},workspaceFolder:i.workspaceFolder},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 BE(250),this._onReady=new Promise((o,s)=>{this._onReadyCallbacks=new GE(o,s)}),this._onStop=void 0,this._stateChangeEmitter=new D.Emitter,this._tracer={log:(o,s)=>{bt(o)?this.logTrace(o,s):this.logObjectTrace(o)}},this._syncedDocuments=new Map;let n=b.getConfiguration("coc.preferences");this._markdownSupport=n.get("enableMarkdown",!0),this.registerBuiltinFeatures()}get supporedMarkupKind(){return this._markdownSupport?[D.MarkupKind.Markdown,D.MarkupKind.PlainText]:[D.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}async 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 ${bt(e)?e:e.method} failed.`,i),i}}onRequest(e,t){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");try{this._resolvedConnection.onRequest(e,t)}catch(i){throw this.error(`Registering request handler ${bt(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 ${bt(e)?e:e.method} failed.`,i),i}}onNotification(e,t){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");try{this._resolvedConnection.onNotification(e,t)}catch(i){throw this.error(`Registering notification handler ${bt(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==D.WorkDoneProgress.type){let n=this._clientOptions.middleware.handleWorkDoneProgress;if(n!==void 0)return this._resolvedConnection.onProgress(e,t,o=>{n(t,o,()=>i(o))})}return this._resolvedConnection.onProgress(e,t,i)}catch(n){throw this.error(`Registering progress handler for token ${t} failed.`,n),n}}sendProgress(e,t,i){if(!this.isConnectionActive())throw new Error("Language client is not ready yet");try{this._resolvedConnection.sendProgress(e,t,i)}catch(n){throw this.error(`Sending progress for token ${t} failed.`,n),n}}get clientOptions(){return this._clientOptions}get onDidChangeState(){return this._stateChangeEmitter.event}get outputChannel(){if(!this._outputChannel){let{outputChannelName:e}=this._clientOptions;this._outputChannel=C.createOutputChannel(e||this._name)}return this._outputChannel}get diagnostics(){return this._diagnostics}createDefaultErrorHandler(){return new HE(this._id)}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 D.ResponseError){let t=e;return` Message: ${t.message}
|
||
Code: ${t.code} ${t.data?`
|
||
`+t.data.toString():""}`}return e instanceof Error?bt(e.stack)?e.stack:e.message:bt(e)?e:e.toString()}_appendOutput(e,t,i){let n=3;switch(e){case"Info":n=1;break;case"Warn":n=2;break}this.outputChannel.appendLine(`[${e} - ${new Date().toLocaleTimeString()}] ${t}`);let o;i&&(o=this.data2String(i),this.outputChannel.appendLine(o)),this._clientOptions.revealOutputChannelOn<=n&&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._onReadyCallbacks.isUsed&&(this._onReady=new Promise((e,t)=>{this._onReadyCallbacks=new GE(e,t)})),this._listeners=[],this._providers=[],!this._diagnostics){let e=this._clientOptions,t=e.diagnosticCollectionName?e.diagnosticCollectionName:this._id;this._diagnostics=U.createDiagnosticCollection(t)}return this.state=1,this.resolveConnection().then(e=>(e.onLogMessage(t=>{let i;switch(t.type){case D.MessageType.Error:i="error",this.error(t.message);break;case D.MessageType.Warning:i="warning",this.warn(t.message);break;case D.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 D.MessageType.Error:C.showErrorMessage(t.message);break;case D.MessageType.Warning:C.showWarningMessage(t.message);break;case D.MessageType.Info:C.showInformationMessage(t.message);break;default:C.showInformationMessage(t.message)}}),e.onRequest(D.ShowMessageRequest.type,t=>{let i;switch(t.type){case D.MessageType.Error:i=C.showErrorMessage.bind(C);break;case D.MessageType.Warning:i=C.showWarningMessage.bind(C);break;case D.MessageType.Info:i=C.showInformationMessage.bind(C);break;default:i=C.showInformationMessage.bind(C)}let n=t.actions||[];return i(t.message,...n)}),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)}),D.Disposable.create(()=>{this.needsStop()&&this.stop()})}resolveConnection(){return this._connectionPromise||(this._connectionPromise=this.createConnection()),this._connectionPromise}resolveRootPath(){if(this._clientOptions.workspaceFolder)return $.parse(this._clientOptions.workspaceFolder.uri).fsPath;let{ignoredRootPaths:e}=this._clientOptions,t=b.getConfiguration(this.id),i=t.get("rootPatterns",[]),n=t.get("requireRootPattern",!1),o;if(i&&i.length){let a=b.getDocument(b.bufnr);if(a&&a.schema=="file"){let l=WE.default.dirname($.parse(a.uri).fsPath);o=Jf(l,i,b.cwd)}}if(n&&!o)return null;let s=o||b.rootPath||b.cwd;return e&&e.indexOf(s)!==-1?(C.showMessage(`Ignored rootPath ${s} of client "${this._id}"`,"warning"),null):s}initialize(e){this.refreshTrace(e,!1);let{initializationOptions:t,progressOnInitialization:i}=this._clientOptions,n=this.resolveRootPath();if(!n)return;let o={processId:process.pid,rootPath:n||null,rootUri:n?Wp($.file(n)):null,capabilities:this.computeClientCapabilities(),initializationOptions:Lo(t)?t():t,trace:D.Trace.toString(this._trace),workspaceFolders:null,clientInfo:{name:"coc.nvim",version:b.version}};if(this.fillInitializeParams(o),i){let s=$e();o.workDoneToken=s;let a=new Up(e,s);return a.begin({title:`initializing ${this.id}`,kind:"begin"}),this.doInitialize(e,o).then(l=>(a.done(),l),l=>{throw a.cancel(),l})}else return this.doInitialize(e,o)}doInitialize(e,t){return e.initialize(t).then(i=>{this._resolvedConnection=e,this._initializeResult=i,this.state=3;let n;return cm(i.capabilities.textDocumentSync)?i.capabilities.textDocumentSync===D.TextDocumentSyncKind.None?n={openClose:!1,change:D.TextDocumentSyncKind.None,save:void 0}:n={openClose:!0,change:i.capabilities.textDocumentSync,save:{includeText:!1}}:i.capabilities.textDocumentSync!=null&&(n=i.capabilities.textDocumentSync),this._capabilities=Object.assign({},i.capabilities,{resolvedTextDocumentSync:n}),this._clientOptions.disableDiagnostics||e.onDiagnostics(o=>this.handleDiagnostics(o)),e.onRequest(D.RegistrationRequest.type,o=>this.handleRegistrationRequest(o)),e.onRequest("client/registerFeature",o=>this.handleRegistrationRequest(o)),e.onRequest(D.UnregistrationRequest.type,o=>this.handleUnregistrationRequest(o)),e.onRequest("client/unregisterFeature",o=>this.handleUnregistrationRequest(o)),e.onRequest(D.ApplyWorkspaceEditRequest.type,o=>this.handleApplyWorkspaceEdit(o)),e.sendNotification(D.InitializedNotification.type,{}),this.hookFileEvents(e),this.hookConfigurationChanged(e),this.initializeFeatures(e),this._onReadyCallbacks.resolve(),i}).then(void 0,i=>{throw this._clientOptions.initializationFailedHandler?this._clientOptions.initializationFailedHandler(i)?this.initialize(e):(this.stop(),this._onReadyCallbacks.reject(i)):i instanceof D.ResponseError&&i.data&&i.data.retry?C.showPrompt(i.message+" Retry?").then(n=>{n?this.initialize(e):(this.stop(),this._onReadyCallbacks.reject(i))}):(i&&i.message&&C.showMessage(i.message,"error"),this.error("Server initialization failed.",i),this.stop(),this._onReadyCallbacks.reject(i)),i})}stop(){return this._initializeResult=void 0,this._connectionPromise?this.state===4&&this._onStop?this._onStop:(this.state=4,this.cleanUp(),this._onStop=this.resolveConnection().then(e=>e.shutdown().then(()=>{e.exit(),e.dispose(),this.state=5,this.cleanUpChannel(),this._onStop=void 0,this._connectionPromise=void 0,this._resolvedConnection=void 0})).catch(e=>{as.error("Error on stop languageserver:",e),this.state=5,this.cleanUpChannel(),this._onStop=void 0,this._connectionPromise=void 0,this._resolvedConnection=void 0})):(this.state=5,Promise.resolve())}cleanUp(e=!0,t=!0){this._listeners&&(this._listeners.forEach(i=>i.dispose()),this._listeners=void 0),this._providers&&(this._providers.forEach(i=>i.dispose()),this._providers=void 0);for(let i of this._features.values())typeof i.dispose=="function"?i.dispose():as.error("Feature can't be disposed",i);this._syncedDocuments&&this._syncedDocuments.clear(),e&&this.cleanUpChannel(),this._diagnostics&&(t?(this._diagnostics.dispose(),this._diagnostics=void 0):this._diagnostics.clear())}cleanUpChannel(){this._outputChannel&&(this._outputChannel.dispose(),this._outputChannel=void 0)}notifyFileEvent(e){var o;let t=this;function i(s){t._fileEvents.push(s),t._fileEventDelayer.trigger(()=>{t.onReady().then(()=>{t.resolveConnection().then(a=>{t.isConnectionActive()&&a.didChangeWatchedFiles({changes:t._fileEvents}),t._fileEvents=[]})},a=>{t.error("Notify file events failed.",a)})})}let n=(o=this.clientOptions.middleware)==null?void 0:o.workspace;(n==null?void 0:n.didChangeWatchedFile)?n.didChangeWatchedFile(e,i):i(e)}handleDiagnostics(e){if(!this._diagnostics)return;let{uri:t,diagnostics:i}=e,n=this.clientOptions.middleware.handleDiagnostics;n?n(t,i,(o,s)=>this.setDiagnostics(o,s)):this.setDiagnostics(t,i)}setDiagnostics(e,t){var n;if(!this._diagnostics)return;if(b.getConfiguration("diagnostic").get("separateRelatedInformationAsDiagnostics")&&t.length>0){let o=new Map;o.set(e,t);for(let s of t){if((n=s.relatedInformation)==null?void 0:n.length){let a=`${s.message}
|
||
|
||
Related diagnostics:
|
||
`;for(let l of s.relatedInformation){let u=WE.default.basename($.parse(l.location.uri).fsPath),c=l.location.range.start.line;a=`${a}
|
||
${u}(line ${c+1}): ${l.message}`;let f=o.get(l.location.uri)||[];f.push(D.Diagnostic.create(l.location.range,l.message,D.DiagnosticSeverity.Hint,s.code,s.source)),o.set(l.location.uri,f)}s.message=a}this._diagnostics.set(Array.from(o))}}else this._diagnostics.set(e,t)}createConnection(){let e=(i,n,o)=>{as.error("connection error:",i,n),this.handleConnectionError(i,n,o)},t=()=>{this.handleConnectionClosed()};return this.createMessageTransports(this._clientOptions.stdioEncoding||"utf8").then(i=>uye(i.reader,i.writer,e,t))}handleConnectionClosed(){if(this.state===4||this.state===5)return;try{this._resolvedConnection&&this._resolvedConnection.dispose()}catch(t){}let e=1;try{e=this._clientOptions.errorHandler.closed()}catch(t){}this._connectionPromise=void 0,this._resolvedConnection=void 0,e===1?(this.error("Connection to server got closed. Server will not be restarted."),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){b.onDidChangeConfiguration(()=>{this.refreshTrace(e,!0)})}refreshTrace(e,t=!1){let i=b.getConfiguration(this._id),n=D.Trace.Off,o=D.TraceFormat.Text;if(i){let s=i.get("trace.server","off");typeof s=="string"?n=D.Trace.fromString(s):(n=D.Trace.fromString(i.get("trace.server.verbosity","off")),o=D.TraceFormat.fromString(i.get("trace.server.format","text")))}this._trace=n,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(D.DidChangeWatchedFilesNotification.type.method).registerRaw($e(),i)}registerFeatures(e){for(let t of e)this.registerFeature(t)}registerFeature(e){if(this._features.push(e),zE.is(e)){let t=e.messages;if(Array.isArray(t))for(let i of t)this._method2Message.set(i.method,i),this._dynamicFeatures.set(i.method,e);else this._method2Message.set(t.method,t),this._dynamicFeatures.set(t.method,e)}}getFeature(e){return this._dynamicFeatures.get(e)}registerBuiltinFeatures(){this.registerFeature(new PH(this)),this.registerFeature(new nH(this,this._syncedDocuments)),this.registerFeature(new sH(this)),this.registerFeature(new aH(this)),this.registerFeature(new lH(this)),this.registerFeature(new uH(this)),this.registerFeature(new oH(this,this._syncedDocuments)),this.registerFeature(new cH(this,e=>this.notifyFileEvent(e))),this._clientOptions.disableCompletion||this.registerFeature(new pH(this)),this.registerFeature(new dH(this)),this.registerFeature(new hH(this)),this.registerFeature(new mH(this)),this.registerFeature(new gH(this)),this.registerFeature(new vH(this)),this.registerFeature(new yH(this)),this.registerFeature(new bH(this)),this.registerFeature(new wH(this)),this.registerFeature(new xH(this)),this.registerFeature(new DH(this)),this.registerFeature(new SH(this)),this.registerFeature(new EH(this)),this.registerFeature(new CH(this)),this.registerFeature(new _H(this)),this.registerFeature(new TH(this))}fillInitializeParams(e){for(let t of this._features)Lo(t.fillInitializeParams)&&t.fillInitializeParams(e)}computeClientCapabilities(){let e={};re(e,"workspace").applyEdit=!0;let t=re(re(e,"workspace"),"workspaceEdit");t.documentChanges=!0,t.resourceOperations=[D.ResourceOperationKind.Create,D.ResourceOperationKind.Rename,D.ResourceOperationKind.Delete],t.failureHandling=D.FailureHandlingKind.TextOnlyTransactional;let i=re(re(e,"textDocument"),"publishDiagnostics");i.relatedInformation=!0,i.versionSupport=!1,i.tagSupport={valueSet:[D.DiagnosticTag.Unnecessary,D.DiagnosticTag.Deprecated]};for(let n of this._features)n.fillClientCapabilities(e);return e}initializeFeatures(e){let t=this._clientOptions.documentSelector;for(let i of this._features)i.initialize(this._capabilities,t)}handleRegistrationRequest(e){return this.clientOptions.disableDynamicRegister?Promise.resolve():new Promise((t,i)=>{for(let n of e.registrations){let o=this._dynamicFeatures.get(n.method);if(!o){i(new Error(`No feature implementation for ${n.method} found. Registration failed.`));return}let s=n.registerOptions||{};s.documentSelector=s.documentSelector||this._clientOptions.documentSelector;let a={id:n.id,registerOptions:s};o.register(this._method2Message.get(n.method),a)}t()})}handleUnregistrationRequest(e){return new Promise((t,i)=>{for(let n of e.unregisterations){let o=this._dynamicFeatures.get(n.method);if(!o){i(new Error(`No feature implementation for ${n.method} found. Unregistration failed.`));return}o.unregister(n.id)}t()})}handleApplyWorkspaceEdit(e){let t=e.edit,i=new Map;b.textDocuments.forEach(o=>i.set(o.uri.toString(),o));let n=!1;if(t.documentChanges){for(let o of t.documentChanges)if(D.TextDocumentEdit.is(o)&&o.textDocument.version&&o.textDocument.version>=0){let s=i.get(o.textDocument.uri);if(s&&s.version!==o.textDocument.version){n=!0;break}}}return n?Promise.resolve({applied:!1}):b.applyEdit(e.edit).then(o=>({applied:o}))}logFailedRequest(e,t){t instanceof D.ResponseError&&t.code===D.ErrorCodes.RequestCancelled||this.error(`Request ${e.method} failed.`,t)}};var Da=S(W());"use strict";function RH(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var VE=class extends Ge{constructor(e){super(e,Da.DocumentColorRequest.type)}fillClientCapabilities(e){RH(RH(e,"textDocument"),"colorProvider").dynamicRegistration=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.colorProvider);!i||!n||this.register(this.messages,{id:i,registerOptions:n})}registerLanguageProvider(e){let t={provideColorPresentations:(i,n,o)=>{let s=this._client,a=(u,c,f)=>{let p={color:u,textDocument:{uri:c.document.uri},range:c.range};return s.sendRequest(Da.ColorPresentationRequest.type,p,f).then(d=>d,d=>(s.logFailedRequest(Da.ColorPresentationRequest.type,d),Promise.resolve(null)))},l=s.clientOptions.middleware;return l.provideColorPresentations?l.provideColorPresentations(i,n,o,a):a(i,n,o)},provideDocumentColors:(i,n)=>{let o=this._client,s=(l,u)=>{let c={textDocument:{uri:l.uri}};return o.sendRequest(Da.DocumentColorRequest.type,c,u).then(f=>f,f=>(o.logFailedRequest(Da.ColorPresentationRequest.type,f),Promise.resolve(null)))},a=o.clientOptions.middleware;return a.provideDocumentColors?a.provideDocumentColors(i,n,s):s(i,n)}};return[U.registerDocumentColorProvider(e.documentSelector,t),t]}};var kH=S(W());var ije=j()("languageclient-configuration"),KE=class{constructor(e){this._client=e;var i;let t=(i=this._client.clientOptions.synchronize)==null?void 0:i.configurationSection;typeof t=="string"&&t.startsWith("languageserver.")&&(this.languageserverSection=t)}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.configuration=!0}initialize(){let e=this._client;e.onRequest(kH.ConfigurationRequest.type,(t,i)=>{let n=s=>{let a=[];for(let l of s.items)a.push(this.getConfiguration(l.scopeUri,l.section));return a},o=e.clientOptions.middleware.workspace;return o&&o.configuration?o.configuration(t,i,n):n(t,i)})}getConfiguration(e,t){let i=null;if(t){this.languageserverSection&&(t=`${this.languageserverSection}.${t}`);let n=t.lastIndexOf(".");if(n===-1)i=b.getConfiguration(void 0,e).get(t,{});else{let o=b.getConfiguration(t.substr(0,n),e);o&&(i=o.get(t.substr(n+1)))}}else{let n=b.getConfiguration(this.languageserverSection,e);i={};for(let o of Object.keys(n))n.has(o)&&(i[o]=JE(n.get(o)))}return i}dispose(){}};function JE(r){if(r){if(Array.isArray(r))return r.map(JE);if(typeof r=="object"){let e=Object.create(null);for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(e[t]=JE(r[t]));return e}}return r}var bv=S(W());"use strict";function IH(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var YE=class extends Ge{constructor(e){super(e,bv.DeclarationRequest.type)}fillClientCapabilities(e){let t=IH(IH(e,"textDocument"),"declaration");t.dynamicRegistration=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.declarationProvider);!i||!n||this.register(this.messages,{id:i,registerOptions:n})}registerLanguageProvider(e){let t={provideDeclaration:(i,n,o)=>{let s=this._client,a=(u,c,f)=>s.sendRequest(bv.DeclarationRequest.type,En(u,c),f).then(p=>p,p=>(s.logFailedRequest(bv.DeclarationRequest.type,p),Promise.resolve(null))),l=s.clientOptions.middleware;return l.provideDeclaration?l.provideDeclaration(i,n,o,a):a(i,n,o)}};return[U.registerDeclarationProvider(e.documentSelector,t),t]}};var wv=S(W());"use strict";function FH(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var XE=class extends Ge{constructor(e){super(e,wv.FoldingRangeRequest.type)}fillClientCapabilities(e){let t=FH(FH(e,"textDocument"),"foldingRange");t.dynamicRegistration=!0,t.rangeLimit=5e3,t.lineFoldingOnly=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.foldingRangeProvider);!i||!n||this.register(this.messages,{id:i,registerOptions:n})}registerLanguageProvider(e){let t={provideFoldingRanges:(i,n,o)=>{let s=this._client,a=(u,c,f)=>{let p={textDocument:{uri:u.uri}};return s.sendRequest(wv.FoldingRangeRequest.type,p,f).then(d=>d,d=>(s.logFailedRequest(wv.FoldingRangeRequest.type,d),Promise.resolve(null)))},l=s.clientOptions.middleware;return l.provideFoldingRanges?l.provideFoldingRanges(i,n,o,a):a(i,n,o)}};return[U.registerFoldingRangeProvider(e.documentSelector,t),t]}};var xv=S(W());function AH(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var ZE=class extends Ge{constructor(e){super(e,xv.ImplementationRequest.type)}fillClientCapabilities(e){let t=AH(AH(e,"textDocument"),"implementation");t.dynamicRegistration=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.implementationProvider);!i||!n||this.register(this.messages,{id:i,registerOptions:n})}registerLanguageProvider(e){let t={provideImplementation:(i,n,o)=>{let s=this._client,a=(u,c,f)=>s.sendRequest(xv.ImplementationRequest.type,En(u,c),f).then(p=>p,p=>(s.logFailedRequest(xv.ImplementationRequest.type,p),Promise.resolve(null))),l=s.clientOptions.middleware;return l.provideImplementation?l.provideImplementation(i,n,o,a):a(i,n,o)}};return[U.registerImplementationProvider(e.documentSelector,t),t]}};var OH=S(W());"use strict";function fye(r,e){return r[e]===void 0&&(r[e]=Object.create(null)),r[e]}var QE=class{constructor(e){this._client=e;this.activeParts=new Set}fillClientCapabilities(e){fye(e,"window").workDoneProgress=!0}initialize(){let e=this._client,t=n=>{this.activeParts.delete(n)},i=n=>{this.activeParts.add(new Up(this._client,n.token,t))};e.onRequest(OH.WorkDoneProgressCreateRequest.type,i)}dispose(){for(let e of this.activeParts)e.done();this.activeParts.clear()}};var Dv=S(W());function LH(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var eC=class extends Ge{constructor(e){super(e,Dv.TypeDefinitionRequest.type)}fillClientCapabilities(e){let t=LH(LH(e,"textDocument"),"typeDefinition");t.dynamicRegistration=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.typeDefinitionProvider);!i||!n||this.register(this.messages,{id:i,registerOptions:n})}registerLanguageProvider(e){let t={provideTypeDefinition:(i,n,o)=>{let s=this._client,a=(u,c,f)=>s.sendRequest(Dv.TypeDefinitionRequest.type,En(u,c),f).then(p=>p,p=>(s.logFailedRequest(Dv.TypeDefinitionRequest.type,p),Promise.resolve(null))),l=s.clientOptions.middleware;return l.provideTypeDefinition?l.provideTypeDefinition(i,n,o,a):a(i,n,o)}};return[U.registerTypeDefinitionProvider(e.documentSelector,t),t]}};var zp=S(W());"use strict";var EUe=j()("language-client-workspaceFolder");function tC(r,e){if(r!==void 0)return r[e]}function MH(r,e){return r.filter(t=>!e.includes(t))}var rC=class{constructor(e){this._client=e;this._listeners=new Map}get messages(){return zp.DidChangeWorkspaceFoldersNotification.type}asProtocol(e){return e===void 0?null:{uri:e.uri,name:e.name}}fillInitializeParams(e){let t=b.workspaceFolders;this._initialFolders=t,t===void 0?e.workspaceFolders=null:e.workspaceFolders=t.map(i=>this.asProtocol(i)),e.workspaceFolders=b.workspaceFolders}fillClientCapabilities(e){e.workspace=e.workspace||{},e.workspace.workspaceFolders=!0}initialize(e){let t=this._client;t.onRequest(zp.WorkspaceFoldersRequest.type,o=>{let s=()=>{let l=b.workspaceFolders;return l===void 0?null:l.map(c=>this.asProtocol(c))},a=t.clientOptions.middleware.workspace;return a&&a.workspaceFolders?a.workspaceFolders(o,s):s(o)});let i=tC(tC(tC(e,"workspace"),"workspaceFolders"),"changeNotifications"),n;typeof i=="string"?n=i:i===!0&&(n=$e()),n&&this.register(this.messages,{id:n,registerOptions:void 0})}doSendEvent(e,t){let i={event:{added:e.map(n=>this.asProtocol(n)),removed:t.map(n=>this.asProtocol(n))}};this._client.sendNotification(zp.DidChangeWorkspaceFoldersNotification.type,i)}sendInitialEvent(e){if(this._initialFolders&&e){let t=MH(this._initialFolders,e),i=MH(e,this._initialFolders);(i.length>0||t.length>0)&&this.doSendEvent(i,t)}else this._initialFolders?this.doSendEvent([],this._initialFolders):e&&this.doSendEvent(e,[])}register(e,t){let i=t.id,n=this._client,o=b.onDidChangeWorkspaceFolders(s=>{let a=u=>{this.doSendEvent(u.added,u.removed)},l=n.clientOptions.middleware.workspace;l&&l.didChangeWorkspaceFolders?l.didChangeWorkspaceFolders(s,a):a(s)});this._listeners.set(i,o),this.sendInitialEvent(b.workspaceFolders)}unregister(e){let t=this._listeners.get(e);t!==void 0&&(this._listeners.delete(e),t.dispose())}dispose(){for(let e of this._listeners.values())e.dispose();this._listeners.clear()}};var Sv=S(W());"use strict";function NH(r,e){return r[e]===void 0&&(r[e]={}),r[e]}var iC=class extends Ge{constructor(e){super(e,Sv.SelectionRangeRequest.type)}fillClientCapabilities(e){let t=NH(NH(e,"textDocument"),"selectionRange");t.dynamicRegistration=!0}initialize(e,t){let[i,n]=this.getRegistration(t,e.selectionRangeProvider);!i||!n||this.register(this.messages,{id:i,registerOptions:n})}registerLanguageProvider(e){let t={provideSelectionRanges:(i,n,o)=>{let s=this._client,a=(u,c,f)=>{let p={textDocument:{uri:u.uri},positions:c};return s.sendRequest(Sv.SelectionRangeRequest.type,p,f).then(d=>d,d=>(s.logFailedRequest(Sv.SelectionRangeRequest.type,d),Promise.resolve(null)))},l=s.clientOptions.middleware;return l.provideSelectionRanges?l.provideSelectionRanges(i,n,o,a):a(i,n,o)}};return[U.registerSelectionRangeProvider(e.documentSelector,t),t]}};var l6e=Sa.default.ChildProcess,io=j()("language-client-index"),oC;(function(e){function r(t){return bt(t.command)}e.is=r})(oC||(oC={}));var Gt;(function(r){r[r.stdio=0]="stdio",r[r.ipc=1]="ipc",r[r.pipe=2]="pipe",r[r.socket=3]="socket"})(Gt||(Gt={}));var Ev;(function(e){function r(t){let i=t;return i&&i.kind===3&&cm(i.port)}e.isSocket=r})(Ev||(Ev={}));var sC;(function(e){function r(t){return bt(t.module)}e.is=r})(sC||(sC={}));var aC;(function(e){function r(t){let i=t;return i&&i.writer!==void 0&&i.reader!==void 0}e.is=r})(aC||(aC={}));var lC;(function(e){function r(t){let i=t;return i&&i.process!==void 0&&typeof i.detached=="boolean"}e.is=r})(lC||(lC={}));var Cv=class extends yv{constructor(e,t,i,n,o){let s,a,l,u,c;bt(t)?(s=e,a=t,l=i,u=n,c=!!o):(s=e.toLowerCase(),a=e,l=t,u=i,c=n),c===void 0&&(c=!1),super(s,a,u),this._serverOptions=l,this._forceDebug=c,this.registerProposedFeatures()}stop(){return super.stop().then(()=>{if(this._serverProcess){let e=this._serverProcess;this._serverProcess=void 0,(this._isDetached===void 0||!this._isDetached)&&this.checkProcessDied(e),this._isDetached=void 0}})}get serviceState(){let e=this._state;switch(e){case be.Initial:return ye.Initial;case be.Running:return ye.Running;case be.StartFailed:return ye.StartFailed;case be.Starting:return ye.Starting;case be.Stopped:return ye.Stopped;case be.Stopping:return ye.Stopping;default:return io.error(`Unknown state: ${e}`),ye.Stopped}}static stateName(e){switch(e){case be.Initial:return"Initial";case be.Running:return"Running";case be.StartFailed:return"StartFailed";case be.Starting:return"Starting";case be.Stopped:return"Stopped";case be.Stopping:return"Stopping";default:return"Unknonw"}}checkProcessDied(e){if(!(!e||global.hasOwnProperty("__TEST__"))){if(global.hasOwnProperty("__TEST__")){process.kill(e.pid,0);return}setTimeout(()=>{try{process.kill(e.pid,0),U4(e)}catch(t){}},2e3)}}handleConnectionClosed(){this._serverProcess=void 0,super.handleConnectionClosed()}createMessageTransports(e){function t(a){return a?Object.assign({},process.env,a):process.env}function i(){let a=process.execArgv;return a?a.some(l=>/^--debug=?/.test(l)||/^--debug-brk=?/.test(l)||/^--inspect=?/.test(l)||/^--inspect-brk=?/.test(l)):!1}let n=this._serverOptions;if(Lo(n))return n().then(a=>{if(Hp.is(a))return this._isDetached=!!a.detached,a;if(aC.is(a))return this._isDetached=!!a.detached,{reader:new Et.StreamMessageReader(a.reader),writer:new Et.StreamMessageWriter(a.writer)};{let l;return lC.is(a)?(l=a.process,this._isDetached=a.detached):(l=a,this._isDetached=!1),l.stderr.on("data",u=>this.appendOutput(u,e)),{reader:new Et.StreamMessageReader(l.stdout),writer:new Et.StreamMessageWriter(l.stdin)}}});let o=n,s=n;return s.run||s.debug?typeof v8debug=="object"||this._forceDebug||i()?o=s.debug:o=s.run:o=n,this._getServerWorkingDir(o.options).then(a=>{if(sC.is(o)&&o.module){let l=o,u=l.transport||0,c=[],f=l.options||Object.create(null),p=l.runtime||process.execPath;f.execArgv&&f.execArgv.forEach(m=>c.push(m)),u!=1&&c.push(l.module),l.args&&l.args.forEach(m=>c.push(m));let d=Object.create(null);d.cwd=a,d.env=t(f.env);let h;if(u===1?(d.stdio=[null,null,null],c.push("--node-ipc")):u===0?c.push("--stdio"):u===2?(h=Et.generateRandomPipeName(),c.push(`--pipe=${h}`)):Ev.isSocket(u)&&c.push(`--socket=${u.port}`),c.push(`--clientProcessId=${process.pid.toString()}`),u===1){let m={cwd:a,env:t(f.env),stdio:[null,null,null,"ipc"],execPath:p,execArgv:f.execArgv||[]},y=Sa.default.fork(l.module,c,m);return!y||!y.pid?Promise.reject(`Launching server module "${l.module}" failed.`):(y.on("error",v=>{io.error(v)}),io.info(`${this.id} started with ${y.pid}`),this._serverProcess=y,y.stdout.on("data",v=>this.appendOutput(v,e)),y.stderr.on("data",v=>this.appendOutput(v,e)),{reader:new Et.IPCMessageReader(y),writer:new Et.IPCMessageWriter(y)})}else if(u===0){let m=Sa.default.spawn(p,c,d);return!m||!m.pid?Promise.reject(`Launching server module "${l.module}" failed.`):(io.info(`${this.id} started with ${m.pid}`),m.on("error",y=>{io.error(`Process ${p} error: `,y)}),this._serverProcess=m,m.stderr.on("data",y=>this.appendOutput(y,e)),{reader:new Et.StreamMessageReader(m.stdout),writer:new Et.StreamMessageWriter(m.stdin)})}else{if(u==2)return Promise.resolve(Et.createClientPipeTransport(h)).then(m=>{let y=Sa.default.spawn(p,c,d);return!y||!y.pid?Promise.reject(`Launching server module "${l.module}" failed.`):(io.info(`Language server ${this.id} started with ${y.pid}`),this._serverProcess=y,y.stderr.on("data",v=>this.appendOutput(v,e)),y.stdout.on("data",v=>this.appendOutput(v,e)),Promise.resolve(m.onConnected()).then(v=>({reader:v[0],writer:v[1]})))});if(Ev.isSocket(l.transport))return Promise.resolve(Et.createClientSocketTransport(l.transport.port)).then(m=>{let y=Sa.default.spawn(p,c,d);return!y||!y.pid?Promise.reject(`Launching server ${l.module} failed.`):(y.on("exit",v=>{v!=0&&this.error(`command "${p} ${c.join(" ")}" exited with code: ${v}`)}),io.info(`Language server ${this.id} started with ${y.pid}`),this._serverProcess=y,y.stderr.on("data",v=>this.appendOutput(v,e)),y.stdout.on("data",v=>this.appendOutput(v,e)),Promise.resolve(m.onConnected()).then(v=>({reader:v[0],writer:v[1]})))})}}else if(oC.is(o)&&o.command){let l=o,u=l.args||[],c=Object.assign({},l.options);c.env=c.env?Object.assign({},process.env,c.env):process.env,c.cwd=a;let f=b.expand(o.command),p=Sa.default.spawn(f,u,c);return p.on("error",d=>{this.error(d.message),io.error(d)}),!p||!p.pid?Promise.reject(`Launching server "${this.id}" using command ${l.command} failed.`):(io.info(`Language server "${this.id}" started with ${p.pid}`),p.on("exit",d=>{d!=0&&this.error(`${l.command} exited with code: ${d}`)}),p.stderr.on("data",d=>this.appendOutput(d,e)),this._serverProcess=p,this._isDetached=!!c.detached,{reader:new Et.StreamMessageReader(p.stdout),writer:new Et.StreamMessageWriter(p.stdin)})}return Promise.reject(`Unsupported server configuration ${JSON.stringify(n,null,2)}`)})}registerProposedFeatures(){this.registerFeatures(_v.createAll(this))}registerBuiltinFeatures(){super.registerBuiltinFeatures(),this.registerFeature(new KE(this)),this.registerFeature(new eC(this)),this.registerFeature(new ZE(this)),this.registerFeature(new YE(this)),this.registerFeature(new VE(this)),this.registerFeature(new XE(this)),this.registerFeature(new iC(this)),this.registerFeature(new QE(this)),this.clientOptions.disableWorkspaceFolders||this.registerFeature(new rC(this))}_getServerWorkingDir(e){let t=e&&e.cwd;return t&&!nC.default.isAbsolute(t)&&(t=nC.default.join(b.cwd,t)),t||(t=b.cwd),t?new Promise(i=>{qH.default.lstat(t,(n,o)=>{i(!n&&o.isDirectory()?t:void 0)})}):Promise.resolve(void 0)}appendOutput(e,t){let i=bt(e)?e:e.toString(t);this.outputChannel.append(i.endsWith(`
|
||
`)?i:i+`
|
||
`)}},$H=class{constructor(e,t){this._client=e;this._setting=t;this._listeners=[]}start(){return b.onDidChangeConfiguration(e=>{e.affectsConfiguration(this._setting)&&this.onDidChangeConfiguration()},null,this._listeners),this.onDidChangeConfiguration(),{dispose:()=>{z(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,n=i?b.getConfiguration(t).get(i,!0):b.getConfiguration(t);n&&this._client.needsStart()?this._client.start():!n&&this._client.needsStop()&&this._client.stop()}},_v;(function(e){function r(t){return[]}e.createAll=r})(_v||(_v={}));var Ea=j()("services");function pye(r){switch(r){case ye.Initial:return"init";case ye.Running:return"running";case ye.Starting:return"starting";case ye.StartFailed:return"startFailed";case ye.Stopping:return"stopping";case ye.Stopped:return"stopped";default:return"unknown"}}var WH=class extends BH.EventEmitter{constructor(){super(...arguments);this.registered=new Map;this.disposables=[]}init(){b.onDidOpenTextDocument(e=>{this.start(e)},null,this.disposables),b.onDidChangeConfiguration(e=>{e.affectsConfiguration("languageserver")&&this.createCustomServices()},null,this.disposables),this.createCustomServices()}dispose(){this.removeAllListeners(),z(this.disposables);for(let e of this.registered.values())e.dispose()}regist(e){let{id:t}=e;if(t||Ea.error("invalid service configuration. ",e.name),!this.registered.get(t))return this.registered.set(t,e),Ea.info(`registered service "${t}"`),this.shouldStart(e)&&e.start(),e.state==ye.Running&&this.emit("ready",t),e.onServiceReady(()=>{Ea.info(`service ${t} started`),this.emit("ready",t)},null,this.disposables),Ru.Disposable.create(()=>{e.stop(),e.dispose(),this.registered.delete(t)})}getService(e){let t=this.registered.get(e);return t||(t=this.registered.get(`languageserver.${e}`)),t}shouldStart(e){if(e.state!=ye.Initial)return!1;let t=e.selector;for(let i of b.documents)if(b.match(t,i.textDocument))return!0;return!1}start(e){let t=this.getServices(e);for(let i of t)i.state==ye.Initial&&i.start()}getServices(e){let t=[];for(let i of this.registered.values())b.match(i.selector,e)>0&&t.push(i);return t}stop(e){let t=this.registered.get(e);if(!t){C.showMessage(`Service ${e} not found`,"error");return}return Promise.resolve(t.stop())}stopAll(){for(let e of this.registered.values())e.stop()}async toggle(e){let t=this.registered.get(e);if(!t){C.showMessage(`Service ${e} not found`,"error");return}let{state:i}=t;try{i==ye.Running?await Promise.resolve(t.stop()):i==ye.Initial?await t.start():i==ye.Stopped&&await t.restart()}catch(n){C.showMessage(`Service error: ${n.message}`,"error")}}getServiceStats(){let e=[];for(let[t,i]of this.registered)e.push({id:t,languageIds:dye(i.selector),state:pye(i.state)});return e}createCustomServices(){let e=b.getConfiguration().get("languageserver",{});for(let t of Object.keys(e)){let i=e[t];this.registLanguageClient(t,i)}}waitClient(e){let t=this.getService(e);return t&&t.state==ye.Running?Promise.resolve():t?new Promise(i=>{t.onServiceReady(()=>{i()})}):new Promise(i=>{let n=o=>{(o==e||o==`languageserver.${e}`)&&(this.off("ready",n),i())};this.on("ready",n)})}async registNotification(e,t){await this.waitClient(e);let i=this.getService(e);if(!i.client){C.showMessage(`Not a language client: ${e}`,"error");return}i.client.onNotification(t,async o=>{await b.nvim.call("coc#do_notify",[e,t,o])})}async sendNotification(e,t,i){if(!t)throw new Error("method required for ontification");let n=this.getService(e);if(!n||!n.client)throw new Error(`Language server ${e} not found`);if(n.state==ye.Starting&&await n.client.onReady(),n.state!=ye.Running)throw new Error(`Language server ${e} not running`);await Promise.resolve(n.client.sendNotification(t,i))}async sendRequest(e,t,i,n){if(!t)throw new Error("method required for sendRequest");let o=this.getService(e);if(o||await He(100),o=this.getService(e),!o||!o.client)throw new Error(`Language server ${e} not found`);if(o.state==ye.Starting&&await o.client.onReady(),o.state!=ye.Running)throw new Error(`Language server ${e} not running`);return n||(n=new Ru.CancellationTokenSource().token),await Promise.resolve(o.client.sendRequest(t,i,n))}registLanguageClient(e,t){let i=typeof e=="string"?`languageserver.${e}`:e.id,n=[],o=new Ru.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"?HH(t.filetypes,t.additionalSchemes):e.clientOptions.documentSelector,state:ye.Initial,onServiceReady:o.event,start:()=>{if(l.state==ye.Starting||l.state==ye.Running||s&&!s.needsStart())return;if(a&&s)return s.restart(),Promise.resolve();if(!a){if(typeof e=="string"&&!s){let c=b.getConfiguration().get("languageserver",{})[e];if(!c||c.enable===!1)return;let f=hye(i,e,c);if(!f)return;s=new Cv(i,e,f[1],f[0]),l.selector=f[0].documentSelector,l.client=s}s.onDidChangeState(c=>{let{oldState:f,newState:p}=c;p==ni.Starting?l.state=ye.Starting:p==ni.Running?l.state=ye.Running:p==ni.Stopped&&(l.state=ye.Stopped);let d=zH(f),h=zH(p);Ea.info(`${s.name} state change: ${d} => ${h}`)},null,n),a=!0}l.state=ye.Starting,Ea.debug(`starting service: ${i}`);let u=s.start();return n.push(u),new Promise(c=>{s.onReady().then(()=>{o.fire(void 0),c()},f=>{C.showMessage(`Server ${i} failed to start: ${f}`,"error"),Ea.error(`Server ${i} failed to start:`,f),l.state=ye.StartFailed,c()})})},dispose:async()=>{o.dispose(),z(n)},stop:async()=>{!s||!s.needsStop()||await Promise.resolve(s.stop())},restart:async()=>{s?(l.state=ye.Starting,s.restart()):await l.start()}};return this.regist(l)}};function dye(r){let e=r.map(t=>typeof t=="string"?t:t.language);return e=e.filter(t=>typeof t=="string"),Array.from(new Set(e))}function hye(r,e,t){let{command:i,module:n,port:o,args:s,filetypes:a}=t;if(s=s||[],!a)return C.showMessage(`Wrong configuration of LS "${e}", filetypes not found`,"error"),null;if(!i&&!n&&!o)return C.showMessage(`Wrong configuration of LS "${e}", no command or module specified.`,"error"),null;let l;if(n){if(n=b.expand(n),!jH.default.existsSync(n))return C.showMessage(`Module file "${n}" not found for LS "${e}"`,"error"),null;l={module:n,runtime:t.runtime||process.execPath,args:s,transport:gye(t),options:vye(t)}}else i?l={command:i,args:s,options:yye(t)}:o&&(l=()=>new Promise((d,h)=>{let m=new UH.default.Socket,y=t.host||"127.0.0.1";Ea.info(`languageserver "${r}" connecting to ${y}:${o}`),m.connect(o,y,()=>{d({reader:m,writer:m})}),m.on("error",v=>{h(new Error(`Connection error for ${r}: ${v.message}`))})}));let u=!!t.disableWorkspaceFolders,c=!!t.disableSnippetCompletion;return[{ignoredRootPaths:(t.ignoredRootPaths||[]).map(d=>b.expand(d)),disableWorkspaceFolders:u,disableSnippetCompletion:c,disableDynamicRegister:!!t.disableDynamicRegister,disableCompletion:!!t.disableCompletion,disableDiagnostics:!!t.disableDiagnostics,formatterPriority:t.formatterPriority||0,documentSelector:HH(t.filetypes,t.additionalSchemes),revealOutputChannelOn:mye(t.revealOutputChannelOn),synchronize:{configurationSection:`${r}.settings`},diagnosticCollectionName:e,outputChannelName:r,stdioEncoding:t.stdioEncoding||"utf8",progressOnInitialization:t.progressOnInitialization!==!1,initializationOptions:t.initializationOptions||{}},l]}function mye(r){switch(r){case"info":return ii.Info;case"warn":return ii.Warn;case"error":return ii.Error;case"never":return ii.Never;default:return ii.Never}}function HH(r,e){let t=[],i=["file","untitled"].concat(e||[]);return r?(r.forEach(n=>{t.push(...i.map(o=>({language:n,scheme:o})))}),t):i.map(n=>({scheme:n}))}function gye(r){let{transport:e,transportPort:t}=r;return!e||e=="ipc"?Gt.ipc:e=="stdio"?Gt.stdio:e=="pipe"?Gt.pipe:{kind:Gt.socket,port:t}}function vye(r){return{cwd:r.cwd,execArgv:r.execArgv||[],env:r.env||void 0}}function yye(r){return{cwd:r.cwd,detached:!!r.detached,shell:!!r.shell,env:r.env||void 0}}function zH(r){switch(r){case ni.Running:return"running";case ni.Starting:return"starting";case ni.Stopped:return"stopped";default:return"unknown"}}var Vt=new WH;var Nz=S(Gr()),Xp=S(W());var GH=S(require("events")),Ca=["<esc>","<space>","<tab>","<s-tab>","<bs>","<right>","<left>","<up>","<down>","<home>","<end>","<cr>","<FocusGained>","<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>"],uC=class extends GH.EventEmitter{constructor(){super();this.configuration=b.getConfiguration("list"),this.disposable=b.onDidChangeConfiguration(e=>{e.affectsConfiguration("list")&&(this.configuration=b.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(Ca.includes(e))return e;let t=Ca.find(i=>i.toLowerCase()==e.toLowerCase());return t||(C.showMessage(`Configured key "${e}" not supported.`,"error"),null)}},Pv=uC;var T6e=S(gh());var F6e=j()("list-mappings"),cC=class{constructor(e,t,i){this.manager=e;this.nvim=t;this.config=i;this.insertMappings=new Map;this.normalMappings=new Map;this.userInsertMappings=new Map;this.userNormalMappings=new Map;let{prompt:n}=e;this.add("insert","<C-k>",()=>{n.removeTail()}),this.add("insert","<C-n>",()=>{var o;(o=e.session)==null||o.history.next()}),this.add("insert","<C-p>",()=>{var o;(o=e.session)==null||o.history.previous()}),this.add("insert","<C-v>",async()=>{await n.paste()}),this.add("insert","<C-s>",()=>e.switchMatcher()),this.add("insert",["<C-m>","<cr>"],async()=>{await e.doAction()}),this.add("insert",["<tab>","<C-i>"," "],()=>e.chooseAction()),this.add("insert","<C-o>",()=>{e.toggleMode()}),this.add("insert","<C-c>",()=>{e.stop()}),this.add("insert","<esc>",()=>e.cancel()),this.add("insert","<C-l>",async()=>{var o;await((o=e.session)==null?void 0:o.reloadItems())}),this.add("insert","<left>",()=>{n.moveLeft()}),this.add("insert","<right>",()=>{n.moveRight()}),this.add("insert",["<end>","<C-e>"],()=>{n.moveToEnd()}),this.add("insert",["<home>","<C-a>"],()=>{n.moveToStart()}),this.add("insert",["<C-h>","<bs>","<backspace>"],()=>{n.onBackspace()}),this.add("insert","<C-w>",()=>{n.removeWord()}),this.add("insert","<C-u>",()=>{n.removeAhead()}),this.add("insert","<C-r>",()=>n.insertRegister()),this.add("insert","<C-d>",()=>e.feedkeys("<C-d>",!1)),this.add("insert","<PageUp>",()=>e.feedkeys("<PageUp>",!1)),this.add("insert","<PageDown>",()=>e.feedkeys("<PageDown>",!1)),this.add("insert","<down>",()=>e.normal("j")),this.add("insert","<up>",()=>e.normal("k")),this.add("insert",["<ScrollWheelUp>"],this.doScroll.bind(this,"<ScrollWheelUp>")),this.add("insert",["<ScrollWheelDown>"],this.doScroll.bind(this,"<ScrollWheelDown>")),this.add("insert",["<C-f>"],this.doScroll.bind(this,"<C-f>")),this.add("insert",["<C-b>"],this.doScroll.bind(this,"<C-b>")),this.add("normal","<C-o>",()=>{}),this.add("normal","t",()=>e.doAction("tabe")),this.add("normal","s",()=>e.doAction("split")),this.add("normal","d",()=>e.doAction("drop")),this.add("normal",["<cr>","<C-m>","\r"],()=>e.doAction()),this.add("normal","<C-a>",()=>{var o;return(o=e.session)==null?void 0:o.ui.selectAll()}),this.add("normal"," ",()=>{var o;return(o=e.session)==null?void 0:o.ui.toggleSelection()}),this.add("normal","p",()=>e.togglePreview()),this.add("normal",["<tab>"," ","<C-i>"],()=>e.chooseAction()),this.add("normal","<C-c>",()=>{e.stop()}),this.add("normal","<esc>",()=>e.cancel()),this.add("normal","<C-l>",()=>{var o;return(o=e.session)==null?void 0:o.reloadItems()}),this.add("normal","<C-o>",()=>{var o;return(o=e.session)==null?void 0:o.jumpBack()}),this.add("normal","<C-e>",()=>this.scrollPreview("down")),this.add("normal","<C-y>",()=>this.scrollPreview("up")),this.add("normal",["i","I","o","O","a","A"],()=>e.toggleMode()),this.add("normal","?",()=>{var o;return(o=e.session)==null?void 0:o.showHelp()}),this.add("normal",":",async()=>{await e.cancel(!1),await t.eval('feedkeys(":")')}),this.add("normal",["<ScrollWheelUp>"],this.doScroll.bind(this,"<ScrollWheelUp>")),this.add("normal",["<ScrollWheelDown>"],this.doScroll.bind(this,"<ScrollWheelDown>")),this.createMappings(),i.on("change",()=>{this.createMappings()})}createMappings(){let e=this.config.get("insertMappings",{});this.userInsertMappings=this.fixUserMappings(e);let t=this.config.get("normalMappings",{});this.userNormalMappings=this.fixUserMappings(t)}fixUserMappings(e){let t=new Map;for(let[i,n]of Object.entries(e))if(i.length==1)t.set(i,n);else if(i.startsWith("<")&&i.endsWith(">"))if(i.toLowerCase()=="<space>")t.set(" ",n);else if(i.toLowerCase()=="<backspace>")t.set("<bs>",n);else if(Ca.includes(i))t.set(i,n);else{let o=!1;for(let s=0;s<Ca.length;s++)if(Ca[s].toLowerCase()==i.toLowerCase()){o=!0,t.set(Ca[s],n);break}o||C.showMessage(`Invalid list mappings key configuration: "${i}"`,"warning")}else C.showMessage(`Invalid list mappings key configuration: "${i}"`,"warning");return t}async doInsertKeymap(e){let t=this.config.nextKey,i=this.config.previousKey,{session:n}=this.manager;if(!n)return;if(e==t)return n.ui.index=n.ui.index+1,!0;if(e==i)return n.ui.index=n.ui.index-1,!0;let o=this.userInsertMappings.get(e);if(o)return await this.evalExpression(o,"insert"),!0;if(this.insertMappings.has(e)){let s=this.insertMappings.get(e);return await Promise.resolve(s()),!0}return!1}async doNormalKeymap(e){let t=this.userNormalMappings.get(e);if(t)return await this.evalExpression(t,"normal"),!0;if(this.normalMappings.has(e)){let i=this.normalMappings.get(e);return await Promise.resolve(i()),!0}return!1}add(e,t,i){let n=e=="insert"?this.insertMappings:this.normalMappings;if(Array.isArray(t))for(let o of t)n.set(o,i);else n.set(t,i)}async onError(e){let{nvim:t}=this;await t.call("coc#prompt#stop_prompt",["list"]),C.showMessage(e,"error"),this.manager.prompt.start()}async evalExpression(e,t){var a,l,u,c,f,p,d;if(typeof e!="string"||!e.includes(":")){await this.onError(`Invalid list mapping expression: ${e}`);return}let{manager:i}=this,{prompt:n}=i,[o,s]=e.split(":",2);if(o=="do")switch(s.toLowerCase()){case"switch":i.switchMatcher();return;case"selectall":await((a=i.session)==null?void 0:a.ui.selectAll());return;case"help":await((l=i.session)==null?void 0:l.showHelp());return;case"refresh":await((u=i.session)==null?void 0:u.reloadItems());return;case"exit":await i.cancel();return;case"stop":i.stop();return;case"cancel":await i.cancel(!1);return;case"toggle":await((c=i.session)==null?void 0:c.ui.toggleSelection());return;case"jumpback":(f=i.session)==null||f.jumpBack();return;case"previous":await i.normal("k");return;case"next":await i.normal("j");return;case"defaultaction":await i.doAction();return;case"togglemode":return i.toggleMode();case"previewtoggle":return i.togglePreview();case"previewup":return this.scrollPreview("up");case"previewdown":return this.scrollPreview("down");default:await this.onError(`'${s}' not supported`)}else if(o=="prompt")switch(s){case"previous":(p=i.session)==null||p.history.previous();return;case"next":(d=i.session)==null||d.history.next();return;case"start":return n.moveToStart();case"end":return n.moveToEnd();case"left":return n.moveLeft();case"right":return n.moveRight();case"deleteforward":return n.onBackspace();case"deletebackward":return n.removeNext();case"removetail":return n.removeTail();case"removeahead":return n.removeAhead();case"insertregister":n.insertRegister();return;case"paste":await n.paste();return;default:await this.onError(`prompt '${s}' not supported`)}else if(o=="eval")await n.eval(s);else if(o=="command")await i.command(s);else if(o=="action")await i.doAction(s);else if(o=="feedkeys")await i.feedkeys(s);else if(o=="normal")await i.normal(s,!1);else if(o=="normal!")await i.normal(s,!0);else if(o=="call")await i.call(s);else if(o=="expr"){let h=await i.call(s);h&&await i.doAction(h)}else await this.onError(`Invalid expression ${e}`)}async doScroll(e){await this.manager.feedkeys(e)}scrollPreview(e){let{nvim:t}=this;t.pauseNotification(),t.call("coc#list#scroll_preview",[e],!0),t.command("redraw",!0),t.resumeNotification(!1,!0)}},VH=cC;var KH=S(W()),L6e=j()("list-prompt"),fC=class{constructor(e,t){this.nvim=e;this.config=t;this.cusorIndex=0;this._input="";this._mode="insert";this.interactive=!1;this.requestInput=!1;this._onDidChangeInput=new KH.Emitter;this.onDidChangeInput=this._onDidChangeInput.event}get input(){return this._input}set input(e){this._input!=e&&(this.cusorIndex=e.length,this._input=e,this.drawPrompt(),this._onDidChangeInput.fire(this._input))}get mode(){return this._mode}set mode(e){e!=this._mode&&(this._mode=e,this.drawPrompt())}set matcher(e){this._matcher=e,this.drawPrompt()}start(e){e&&(this.interactive=e.interactive,this.cusorIndex=e.input.length,this._input=e.input,this._mode=e.mode,this._matcher=e.interactive?"":e.matcher),this.nvim.call("coc#prompt#start_prompt",["list"],!0),this.drawPrompt()}cancel(){let{nvim:e}=this;e.call("coc#prompt#stop_prompt",["list"],!0)}reset(){this._input="",this.cusorIndex=0}drawPrompt(){let e=this.config.get("indicator",">"),{cusorIndex:t,interactive:i,input:n,_matcher:o}=this,s=['echo ""'];if(this.mode=="insert")if(i?s.push("echohl MoreMsg | echon 'INTERACTIVE ' | echohl None"):o&&s.push(`echohl MoreMsg | echon '${o.toUpperCase()} ' | echohl None`),s.push(`echohl Special | echon '${e} ' | echohl None`),t==n.length)s.push(`echon '${n.replace(/'/g,"''")}'`),s.push("echohl Cursor | echon ' ' | echohl None");else{let l=n.slice(0,t);l&&s.push(`echon '${l.replace(/'/g,"''")}'`),s.push(`echohl Cursor | echon '${n[t].replace(/'/,"''")}' | echohl None`);let u=n.slice(t+1);s.push(`echon '${u.replace(/'/g,"''")}'`)}else s.push('echohl MoreMsg | echo "" | echohl None');s.push("redraw");let a=s.join("|");this.nvim.command(a,!0)}moveLeft(){this.cusorIndex!=0&&(this.cusorIndex=this.cusorIndex-1,this.drawPrompt())}moveRight(){this.cusorIndex!=this._input.length&&(this.cusorIndex=this.cusorIndex+1,this.drawPrompt())}moveToEnd(){this.cusorIndex!=this._input.length&&(this.cusorIndex=this._input.length,this.drawPrompt())}moveToStart(){this.cusorIndex!=0&&(this.cusorIndex=0,this.drawPrompt())}onBackspace(){let{cusorIndex:e,input:t}=this;if(e==0)return;let i=t.slice(0,e),n=t.slice(e);this.cusorIndex=e-1,this._input=`${i.slice(0,i.length-1)}${n}`,this.drawPrompt(),this._onDidChangeInput.fire(this._input)}removeNext(){let{cusorIndex:e,input:t}=this;if(e==t.length-1)return;let i=t.slice(0,e),n=t.slice(e+1);this._input=`${i}${n}`,this.drawPrompt(),this._onDidChangeInput.fire(this._input)}removeWord(){let{cusorIndex:e,input:t}=this;if(e==0)return;let i=t.slice(0,e),n=t.slice(e),o=i.replace(/[\w$]+([^\w$]+)?$/,"");this.cusorIndex=e-(i.length-o.length),this._input=`${o}${n}`,this.drawPrompt(),this._onDidChangeInput.fire(this._input)}removeTail(){let{cusorIndex:e,input:t}=this;if(e==t.length)return;let i=t.slice(0,e);this._input=i,this.drawPrompt(),this._onDidChangeInput.fire(this._input)}removeAhead(){let{cusorIndex:e,input:t}=this;if(e==0)return;let i=t.slice(e);this.cusorIndex=0,this._input=i,this.drawPrompt(),this._onDidChangeInput.fire(this._input)}async acceptCharacter(e){if(this.requestInput){if(this.requestInput=!1,/^[0-9a-z"%#*+/:\-.]$/.test(e)){let t=await this.nvim.call("getreg",e);t=t.replace(/\n/g," "),this.addText(t)}}else this.addText(e)}insertRegister(){this.requestInput=!0}async paste(){let e=await this.nvim.eval("@*");e=e.replace(/\n/g,""),!!e&&this.addText(e)}async eval(e){let t=await this.nvim.call("eval",[e]);t=t.replace(/\n/g,""),this.addText(t)}addText(e){let{cusorIndex:t,input:i}=this;this.cusorIndex=t+e.length;let n=i.slice(0,t),o=i.slice(t);this._input=`${n}${e}${o}`,this.drawPrompt(),this._onDidChangeInput.fire(this._input)}},JH=fC;var gC=S(Gr()),sz=S(W());function no(r){let e=[];for(let t=0,i=r.length;t<i;t++)e.push(r.charCodeAt(t));return e}function Gp(r){return r>=97&&r<=122||r>=65&&r<=90}function nn(r,e){return r==e||r>=97&&r<=122&&e+32===r}function Vp(r,e){let t=r.charCodeAt(0),i=e.charCodeAt(0);return t===i||t>=97&&t<=122&&i+32===t}function ku(r,e){let t=r.length;if(r.length>e.length)return!1;let i=0;for(let n=0;n<e.length&&i!==t;n++){let o=e.charCodeAt(n),s=r[i];if(o===s){i=i+1;continue}if(s>=97&&s<=122&&o+32===s){i=i+1;continue}}return i===t}var B6e=j()("list-history"),pC=class{constructor(e,t){this.prompt=e;this.name=t;this.index=-1;this.loaded=[];this.current=[];this.db=b.createDatabase(`list-${t}-history`),this.key=Buffer.from(b.cwd).toString("base64")}filter(){let{input:e}=this.prompt;if(e==this.curr)return;this.historyInput="";let t=no(e);this.current=this.loaded.filter(i=>ku(t,i)),this.index=-1}get curr(){return this.index==-1?null:this.current[this.index]}load(e){let{db:t}=this;e=e||"";let i=t.fetch(this.key);!i||!Array.isArray(i)?this.loaded=[]:this.loaded=i,this.index=-1,this.current=this.loaded.filter(n=>n.startsWith(e))}add(){let{loaded:e,db:t,prompt:i}=this,{input:n}=i;if(!n||n.length<2||n==this.historyInput)return;let o=e.indexOf(n);o!=-1&&e.splice(o,1),e.push(n),e.length>200&&(e=e.slice(-200)),t.push(this.key,e)}previous(){let{current:e,index:t}=this;!e||!e.length||(t<=0?this.index=e.length-1:this.index=t-1,this.historyInput=this.prompt.input=e[this.index]||"")}next(){let{current:e,index:t}=this;!e||!e.length||(t==e.length-1?this.index=0:this.index=t+1,this.historyInput=this.prompt.input=e[this.index]||"")}},YH=pC;var XH=S(Gr()),Iu=S(W());var Y6e=j()("list-ui"),dC=class{constructor(e,t,i,n){this.nvim=e;this.name=t;this.listOptions=i;this.config=n;this.newTab=!1;this.currIndex=0;this.drawCount=0;this.items=[];this.disposables=[];this.selected=new Set;this.mutex=new ar;this._onDidChangeLine=new Iu.Emitter;this._onDidOpen=new Iu.Emitter;this._onDidClose=new Iu.Emitter;this._onDidLineChange=new Iu.Emitter;this._onDoubleClick=new Iu.Emitter;this.onDidChangeLine=this._onDidChangeLine.event;this.onDidLineChange=this._onDidLineChange.event;this.onDidOpen=this._onDidOpen.event;this.onDidClose=this._onDidClose.event;this.onDidDoubleClick=this._onDoubleClick.event;this.signOffset=n.get("signOffset"),this.matchHighlightGroup=n.get("matchHighlightGroup","Search"),this.newTab=i.position=="tab",A.on("BufWinLeave",async s=>{s!=this.bufnr||this.window==null||(this.window=null,this._onDidClose.fire(s))},null,this.disposables),A.on("CursorMoved",async(s,a)=>{s==this.bufnr&&this.onLineChange(a[0]-1)},null,this.disposables);let o=XH.default(async s=>{if(s!=this.bufnr)return;let[a,l,u]=await e.eval('[win_getid(),line("w0"),line("w$")]');u<300||!this.window||a!=this.window.id||(e.pauseNotification(),this.doHighlight(l-1,u),e.command("redraw",!0),e.resumeNotification(!1,!0))},100);this.disposables.push({dispose:()=>{o.clear()}}),A.on("CursorMoved",o,null,this.disposables)}get limitLines(){return this.config.get("limitLines",3e4)}onLineChange(e){this.currIndex!=e&&(this.currIndex=e,this._onDidChangeLine.fire(e))}set index(e){if(e<0||e>=this.items.length)return;let{nvim:t}=this;t.pauseNotification(),this.setCursor(e+1,0),t.command("redraw",!0),t.resumeNotification(!1,!0).logError()}get index(){return this.currIndex}get firstItem(){return this.items[0]}get lastItem(){return this.items[this.items.length-1]}getItem(e){return this.items[e]}get item(){let{window:e}=this;return e?e.cursor.then(t=>(this.currIndex=t[0]-1,this.items[this.currIndex]),t=>null):Promise.resolve(null)}async echoMessage(e){if(this.bufnr)return;let{items:t}=this,n=`[${t.indexOf(e)+1}/${t.length}] ${e.label||""}`;this.nvim.callTimer("coc#util#echo_lines",[[n]],!0)}async updateItem(e,t){if(!this.bufnr||b.bufnr!=this.bufnr)return;let i=Object.assign({resolved:!0},e);if(t<this.length){this.items[t]=i;let{nvim:n}=this;n.pauseNotification(),n.command("setl modifiable",!0),n.call("setline",[t+1,i.label],!0),n.command("setl nomodifiable",!0),await n.resumeNotification()}}async getItems(){if(this.length==0||!this.window)return[];let e=await this.nvim.call("mode");if(e=="v"||e=="V"){let[n,o]=await this.getSelectedRange(),s=[];for(let a=n;a<=o;a++){let l=this.items[a-1];l&&s.push(l)}return s}let{selectedItems:t}=this;if(t.length)return t;let i=await this.item;return i==null?[]:[i]}async onMouse(e){let{nvim:t,window:i}=this;if(!i)return;let n=await t.getVvar("mouse_winid"),o=await t.getVvar("mouse_lnum"),s=await t.getVvar("mouse_col");if(e=="mouseDown"){this.mouseDown={winid:n,lnum:o,col:s,current:n==i.id};return}let a=n==i.id;a&&e=="doubleClick"&&(this.setCursor(o,0),this._onDoubleClick.fire()),!(!this.mouseDown||this.mouseDown.winid!=this.mouseDown.winid)&&(a&&e=="mouseDrag"?await this.selectLines(this.mouseDown.lnum,o):a&&e=="mouseUp"?this.mouseDown.lnum==o?(t.pauseNotification(),this.clearSelection(),this.setCursor(o,0),t.command("redraw",!0),await t.resumeNotification()):await this.selectLines(this.mouseDown.lnum,o):!a&&e=="mouseUp"&&(t.pauseNotification(),t.call("win_gotoid",n,!0),t.call("cursor",[o,s],!0),await t.resumeNotification()))}async resume(){let{items:e,selected:t,nvim:i,signOffset:n}=this;if(await this.drawItems(e,this.height,!0),t.size>0&&this.bufnr){i.pauseNotification();for(let o of t)i.command(`sign place ${n+o} line=${o} name=CocSelected buffer=${this.bufnr}`,!0);await i.resumeNotification()}}async toggleSelection(){let{nvim:e,selected:t,signOffset:i,bufnr:n}=this;if(b.bufnr!=n)return;let o=await e.call("line","."),s=await e.call("mode");if(s=="v"||s=="V"){let[l,u]=await this.getSelectedRange(),c=t.has(l);l>u&&([l,u]=[u,l]);for(let p=l;p<=u;p++)c?(t.delete(p),e.command(`sign unplace ${i+p} buffer=${n}`,!0)):(t.add(p),e.command(`sign place ${i+p} line=${p} name=CocSelected buffer=${n}`,!0));this.setCursor(u,0),e.command("redraw",!0),await e.resumeNotification();return}let a=t.has(o);e.pauseNotification(),a?(t.delete(o),e.command(`sign unplace ${i+o} buffer=${n}`,!0)):(t.add(o),e.command(`sign place ${i+o} line=${o} name=CocSelected buffer=${n}`,!0)),this.setCursor(o+1,0),e.command("redraw",!0),await e.resumeNotification()}async selectLines(e,t){let{nvim:i,signOffset:n,bufnr:o,length:s}=this;this.clearSelection();let{selected:a}=this;i.pauseNotification(),e>t&&([e,t]=[t,e]);for(let u=e;u<=t&&!(u>s);u++)a.add(u),i.command(`sign place ${n+u} line=${u} name=CocSelected buffer=${o}`,!0);this.setCursor(t,0),i.command("redraw",!0),await i.resumeNotification()}async selectAll(){let{length:e}=this;e!=0&&await this.selectLines(1,e)}clearSelection(){let{selected:e,nvim:t,signOffset:i,bufnr:n}=this;if(!!n&&e.size>0){let o=[];for(let s of e)o.push(i+s);t.call("coc#util#unplace_signs",[n,o],!0),this.selected=new Set}}get shown(){return this.window!=null}get bufnr(){var e;return(e=this.buffer)==null?void 0:e.id}get winid(){var e;return(e=this.window)==null?void 0:e.id}get ready(){return this.window?Promise.resolve():new Promise((e,t)=>{let i=setTimeout(()=>{t(new Error("window create timeout"))},3e3),n=this.onDidLineChange(()=>{n.dispose(),clearTimeout(i),e()})})}async drawItems(e,t,i=!1,n){let o=this.drawCount=this.drawCount+1,{nvim:s,name:a,listOptions:l}=this,u=await this.mutex.acquire();if(this.items=e.length>this.limitLines?e.slice(0,this.limitLines):e,this.window==null&&!(n&&n.isCancellationRequested))try{let{position:d,numberSelect:h}=l,[m,y]=await s.call("coc#list#create",[d,t,a,h]);n&&n.isCancellationRequested?s.call("coc#list#clean_up",[],!0):(this.height=t,this.buffer=s.createBuffer(m),this.window=s.createWindow(y),this._onDidOpen.fire(this.bufnr))}catch(d){s.call("coc#prompt#stop_prompt",["list"],!0),s.call("coc#list#clean_up",[],!0),u(),C.showMessage(`Error on list create: ${d.message}`,"error");return}if(u(),n&&n.isCancellationRequested||o!==this.drawCount)return;let f=this.items.map(d=>d.label);this.clearSelection();let p=i?this.currIndex:0;await this.setLines(f,!1,p),this._onDidLineChange.fire(this.currIndex+1)}async appendItems(e){if(!this.window)return;let t=this.items.length;if(t>=this.limitLines)return;let i=this.limitLines-t,n=e.slice(0,i);this.items=this.items.concat(n),await this.setLines(n.map(o=>o.label),t>0,this.currIndex)}async setLines(e,t=!1,i){let{nvim:n,buffer:o,window:s}=this;if(!o||!s)return;if(n.pauseNotification(),!t){let l=this.config.get("statusLineSegments");l&&s.notify("nvim_win_set_option",["statusline",l.join(" ")]),n.call("coc#compat#clear_matches",[s.id],!0),e.length||(e=["No results, press ? on normal mode to get help."],n.call("coc#compat#matchaddpos",["Comment",[[1]],99,this.window.id],!0))}if(o.setOption("modifiable",!0,!0),b.isVim?n.call("coc#list#setlines",[o.id,e,t],!0):o.setLines(e,{start:t?-1:0,end:-1,strictIndexing:!1},!0),o.setOption("modifiable",!1,!0),!t&&i==0)this.doHighlight(0,300);else{let l=this.newTab?b.env.lines:this.height;this.doHighlight(Math.max(0,i-l),Math.min(i+l+1,this.length-1))}t||(this.currIndex=i,s.notify("nvim_win_set_cursor",[[i+1,0]])),n.command("redraws",!0);let a=await n.resumeNotification();Array.isArray(a[1])&&a[1][0]==0&&(this.window=null)}restoreWindow(){if(this.newTab)return;let{winid:e,height:t}=this;e&&t&&this.nvim.call("coc#list#restore",[e,t],!0)}reset(){this.window&&(this.window=null,this.buffer=null)}dispose(){z(this.disposables),this.window=null,this._onDidChangeLine.dispose(),this._onDidOpen.dispose(),this._onDidClose.dispose(),this._onDidLineChange.dispose(),this._onDoubleClick.dispose()}get length(){return this.items.length}get selectedItems(){let{selected:e,items:t}=this,i=[];for(let n of e)t[n-1]&&i.push(t[n-1]);return i}doHighlight(e,t){let{nvim:i}=b,{items:n}=this,o=[];for(let s=e;s<=Math.min(t,n.length-1);s++){let{ansiHighlights:a,highlights:l}=n[s];if(a)for(let u of a){let{span:c,hlGroup:f}=u;o.push({hlGroup:f,priority:9,pos:[s+1,c[0]+1,c[1]-c[0]]})}if(l&&Array.isArray(l.spans)){let{spans:u,hlGroup:c}=l;for(let f of u)o.push({hlGroup:c||this.matchHighlightGroup,priority:11,pos:[s+1,f[0]+1,f[1]-f[0]]})}}i.call("coc#compat#matchaddgroups",[this.window.id,o],!0)}setCursor(e,t){let{window:i,items:n}=this,o=n.length==0?1:n.length;e>o||(this.onLineChange(e-1),i&&i.notify("nvim_win_set_cursor",[[e,t]]))}async getSelectedRange(){let{nvim:e}=this;await e.call("coc#prompt#stop_prompt",["list"]),await e.eval('feedkeys("\\<esc>", "in")');let[,t]=await e.call("getpos","'<"),[,i]=await e.call("getpos","'>");return t>i&&([t,i]=[i,t]),this.nvim.call("coc#prompt#start_prompt",["list"],!0),[t,i]}},ZH=dC;var Kp=S(W());var Fu=-Infinity,bye=Infinity,wye=-.005,xye=-.005,Dye=-.01,QH=1,Sye=.9,Eye=.8,Cye=.7,_ye=.6;function Pye(r){return r.toLowerCase()===r}function Tye(r){return r.toUpperCase()===r}function Rye(r){let e=r.length,t=new Array(e),i="/";for(let n=0;n<e;n++){let o=r[n];i==="/"?t[n]=Sye:i==="-"||i==="_"||i===" "?t[n]=Eye:i==="."?t[n]=_ye:Pye(i)&&Tye(o)?t[n]=Cye:t[n]=0,i=o}return t}function ez(r,e,t,i){let n=r.length,o=e.length,s=r.toLowerCase(),a=e.toLowerCase(),l=Rye(e);for(let u=0;u<n;u++){t[u]=new Array(o),i[u]=new Array(o);let c=Fu,f=u===n-1?xye:Dye;for(let p=0;p<o;p++)if(s[u]===a[p]){let d=Fu;u?p&&(d=Math.max(i[u-1][p-1]+l[p],t[u-1][p-1]+QH)):d=p*wye+l[p],t[u][p]=d,i[u][p]=c=Math.max(d,c+f)}else t[u][p]=Fu,i[u][p]=c=c+f}}function Tv(r,e){let t=r.length,i=e.length;if(!t||!i)return Fu;if(t===i)return bye;if(i>1024)return Fu;let n=new Array(t),o=new Array(t);return ez(r,e,n,o),o[t-1][i-1]}function tz(r,e){let t=r.length,i=e.length,n=new Array(t);if(!t||!i)return n;if(t===i){for(let l=0;l<t;l++)n[l]=l;return n}if(i>1024)return n;let o=new Array(t),s=new Array(t);ez(r,e,o,s);let a=!1;for(let l=t-1,u=i-1;l>=0;l--)for(;u>=0;u--)if(o[l][u]!==Fu&&(a||o[l][u]===s[l][u])){a=l&&u&&s[l][u]===o[l-1][u-1]+QH,n[l]=u--;break}return n}function rz(r,e){r=r.toLowerCase(),e=e.toLowerCase();let t=r.length;for(let i=0,n=0;i<t;i+=1)if(n=e.indexOf(r[i],n)+1,n===0)return!1;return!0}var hC=S(require("path"));function nz(r,e,t=""){if(!e)return{score:1};let i=[],n=no(e),o=t?r.indexOf(t):-1,s=o!=-1&&ku(n,t),a=0,l=e[0],u=0;if(s){if(t.startsWith(l))a=a+2,u=o+1,i.push(o);else if(t[0].toLowerCase()==l)a=a+1.5,u=o+1,i.push(o);else for(let c=1;c<t.length;c++)if(Vp(l,t[c])){a=a+1,u=o+c+1,i.push(o+c);break}}else if(r.startsWith(l))a=a+1,i.push(0),u=1;else{for(let c=1;c<r.length;c++)if(r[c-1]==hC.sep&&r[c]==l){a=a+1,i.push(c),u=c+1;break}if(u==0){for(let c=0;c<r.length;c++)if(Vp(l,r[c])){a=a+.5,i.push(c),u=c+1;break}}}return u==0?{score:0}:n.length==1?{score:a,matches:i}:iz(n.slice(1),r,u,{score:a,matches:i})}function iz(r,e,t,i){let{score:n,matches:o}=i,s=[],a=r[0],l=r.slice(1),u;function c(p){if(!!u){if(l.length==0)s.push(u);else if(u){let d=iz(l,e,p,u);d&&s.push(d)}}}let f=t<e.length?e[t].charCodeAt(0):null;if(!f)return null;if(f==a?(u={score:n+1,matches:o.concat([t])},c(t+1)):nn(a,f)&&(u={score:n+.5,matches:o.concat([t])},c(t+1)),t+1<e.length){for(let p=t+1;p<e.length;p++){let d=e[p].charCodeAt(0);if(e[p-1]==hC.sep&&nn(a,d)){let h=a==d?1:.5;u={score:n+h,matches:o.concat([p])},c(p+1);break}}for(let p=t+1;p<e.length;p++){let d=e[p].charCodeAt(0);if(nn(a,d)){let h=a==d?.5:.2;u={score:n+h,matches:o.concat([p])},c(p+1);break}}}return s.length?kye(s):null}function kye(r){let e=r[0];for(let t=1;t<r.length;t++)r[t].score>e.score&&(e=r[t]);return e}var Iye=j()("list-worker"),Fye="",mC=class{constructor(e,t,i,n,o){this.nvim=e;this.list=t;this.prompt=i;this.listOptions=n;this.config=o;this._loading=!1;this.totalItems=[];this._onDidChangeItems=new Kp.Emitter;this._onDidChangeLoading=new Kp.Emitter;this.onDidChangeItems=this._onDidChangeItems.event;this.onDidChangeLoading=this._onDidChangeLoading.event}set loading(e){this._loading!=e&&(this._loading=e,this._onDidChangeLoading.fire(e))}get isLoading(){return this._loading}async loadItems(e,t=!1){let{list:i,listOptions:n}=this;this.loading=!0;let{interactive:o}=n;this.tokenSource=new Kp.CancellationTokenSource;let s=this.tokenSource.token,a=await i.loadItems(e,s);if(!s.isCancellationRequested)if(!a||Array.isArray(a)){this.tokenSource=null,a=a||[],this.totalItems=a.map(u=>(u.label=this.fixLabel(u.label),this.parseListItemAnsi(u),u)),this.loading=!1;let l;o?l=this.convertToHighlightItems(a):l=this.filterItems(a),this._onDidChangeItems.fire({items:l,reload:t,finished:!0})}else{let l=a,u=this.totalItems=[],c=0,f=e.input,p,d,h=v=>{if(d=Date.now(),c>=u.length)return;let x=this.input!=f;if(!(o&&x))if(c==0||x){f=this.input,c=u.length;let w;o?w=this.convertToHighlightItems(u):w=this.filterItems(u),this._onDidChangeItems.fire({items:w,reload:t,append:!1,finished:v})}else{let w=u.slice(c);c=u.length;let E;o?E=this.convertToHighlightItems(w):E=this.filterItems(w),this._onDidChangeItems.fire({items:E,append:!0,finished:v})}};l.on("data",v=>{p&&clearTimeout(p),!s.isCancellationRequested&&(o&&this.input!=f||(v.label=this.fixLabel(v.label),this.parseListItemAnsi(v),u.push(v),!d&&u.length==500||Date.now()-d>200?h():p=setTimeout(()=>h(),50)))});let m=()=>{l!=null&&(this.tokenSource=null,l=null,this.loading=!1,y.dispose(),p&&clearTimeout(p),u.length==0?this._onDidChangeItems.fire({items:[],finished:!0}):h(!0))},y=s.onCancellationRequested(()=>{l&&(l.dispose(),m())});l.on("error",async v=>{l!=null&&(l=null,this.tokenSource=null,this.loading=!1,y.dispose(),p&&clearTimeout(p),this.nvim.call("coc#prompt#stop_prompt",["list"],!0),C.showMessage(`Task error: ${v.toString()}`,"error"),Iye.error(v))}),l.on("end",m)}}drawItems(){let{totalItems:e,listOptions:t}=this,i;t.interactive?i=this.convertToHighlightItems(e):i=this.filterItems(e),this._onDidChangeItems.fire({items:i,finished:!0})}stop(){this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource=null),this.loading=!1}get length(){return this.totalItems.length}get input(){return this.prompt.input}convertToHighlightItems(e){let{input:t}=this;return t?e.map(i=>{let n=Rv(i);if(n=="")return i;let o=nz(n,t);if(!o||!o.score)return i;let s=this.getHighlights(n,o.matches);return Object.assign({},i,{highlights:s})}):[]}filterItems(e){let{input:t}=this,{sort:i,matcher:n,ignorecase:o}=this.listOptions,s=this.config.extendedSearchMode?Aye(t):[t];if(t.length==0||s.length==0)return e;if(n=="strict"){let u=[];for(let c of e){let f=[],p=Rv(c),d=!0;for(let h of s){let m=o?p.toLowerCase().indexOf(h.toLowerCase()):p.indexOf(h);if(m==-1){d=!1;break}f.push([Vr(p,m),Vr(p,m+ue(h))])}d&&u.push(Object.assign({},c,{highlights:{spans:f}}))}return u}if(n=="regex"){let u=[],c=o?"iu":"u",f=s.reduce((p,d)=>{try{let h=new RegExp(d,c);p.push(h)}catch(h){}return p},[]);for(let p of e){let d=[],h=Rv(p),m=!0;for(let y of f){let v=h.match(y);if(v==null){m=!1;break}d.push([Vr(h,v.index),Vr(h,v.index+ue(v[0]))])}m&&u.push(Object.assign({},p,{highlights:{spans:d}}))}return u}let a=[],l=0;for(let u of e){let c=u.filterText||u.label,f=0,p=[],d=Rv(u),h=!0;for(let y of s){if(!rz(y,c)){h=!1;break}p.push(...tz(y,d)),i&&(f+=Tv(y,c))}if(!h)continue;let m=Object.assign({},u,{sortText:typeof u.sortText=="string"?u.sortText:String.fromCharCode(l),score:f,highlights:this.getHighlights(d,p)});a.push(m),l=l+1}return i&&a.length&&a.sort((u,c)=>u.score!=c.score?c.score-u.score:u.sortText>c.sortText?1:-1),a}getHighlights(e,t){let i=[];if(t&&t.length){let n=t.shift(),o=t.shift(),s=n;for(;o;){if(o==s+1){s=o,o=t.shift();continue}i.push([Vr(e,n),Vr(e,s)+1]),n=o,s=n,o=t.shift()}i.push([Vr(e,n),Vr(e,s)+1])}return{spans:i}}parseListItemAnsi(e){let{label:t}=e;if(e.ansiHighlights||!t.includes(Fye))return;let{line:i,highlights:n}=Nl(t);e.label=i,e.ansiHighlights=n}fixLabel(e){let{columns:t}=b.env;return e=e.split(`
|
||
`).join(" "),e.slice(0,t*2)}dispose(){this.stop()}},oz=mC;function Rv(r){return r.filterText!=null?ij(r.filterText,r.label):r.label}function Aye(r){let e=[],t=0,i=0,n="";for(;i<r.length;i++){let o=r[i];o.charCodeAt(0)===32&&n&&n!="\\"&&t!=i&&(e.push(r.slice(t,i)),t=i+1),n=o}return t!=r.length&&e.push(r.slice(t,r.length)),e.map(o=>o.replace(/\\\s/g," ").trim()).filter(o=>o.length>0)}var Oye=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],az=j()("list-session"),vC=class{constructor(e,t,i,n,o=[],s){this.nvim=e;this.prompt=t;this.list=i;this.listOptions=n;this.listArgs=o;this.config=s;this.loadingFrame="";this.hidden=!1;this.disposables=[];this.args=[];this.ui=new ZH(e,i.name,n,s),this.history=new YH(t,i.name),this.worker=new oz(e,i,t,n,{interactiveDebounceTime:s.get("interactiveDebounceTime",100),extendedSearchMode:s.get("extendedSearchMode",!0)}),this.interactiveDebounceTime=s.get("interactiveDebounceTime",100);let a=gC.default(async()=>{let[u,c,f]=await e.eval('[coc#list#has_preview(),win_getid(),line(".")]');u&&c==this.winid&&await this.doPreview(f-1)},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=gC.default(async()=>{let{autoPreview:u}=this.listOptions;if(!u){let[c,f]=await e.eval("[coc#list#has_preview(),mode()]");if(!c||f!="n")return}await this.doAction("preview")},50);this.disposables.push({dispose:()=>{l.clear()}}),this.ui.onDidLineChange(l,null,this.disposables),this.ui.onDidLineChange(()=>{this.updateStatus()},null,this.disposables),this.ui.onDidOpen(async()=>{typeof this.list.doHighlight=="function"&&this.list.doHighlight(),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:u,reload:c,append:f,finished:p})=>{if(!this.hidden)if(f)await this.ui.appendItems(u);else{let d=this.config.get("height",10);p&&!n.interactive&&n.input.length==0&&(d=Math.min(u.length,d));let h=this.uiTokenSource=new sz.CancellationTokenSource;await this.ui.drawItems(u,Math.max(1,d),c,h.token)}},null,this.disposables),this.worker.onDidChangeLoading(u=>{this.hidden||(u?this.interval=setInterval(()=>{let c=Math.floor(new Date().getMilliseconds()/100);this.loadingFrame=Oye[c],this.updateStatus()},100):(this.interval&&(this.loadingFrame="",clearInterval(this.interval),this.interval=null),this.updateStatus()))},null,this.disposables)}async start(e){this.args=e,this.cwd=b.cwd,this.hidden=!1;let{listOptions:t,listArgs:i}=this,n=await this.nvim.eval('[win_getid(),bufnr("%"),winheight("%")]');this.listArgs=i,this.history.load(t.input||""),this.window=this.nvim.createWindow(n[0]),this.buffer=this.nvim.createBuffer(n[1]),this.savedHeight=n[2],await this.worker.loadItems(this.context)}async reloadItems(){if(!this.window)return;let e=await this.nvim.call("winbufnr",[this.window.id]);e!=-1&&(this.buffer=this.nvim.createBuffer(e),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},n=await this.nvim.call(e,[i]);return this.prompt.start(),n}async chooseAction(){let{nvim:e}=this,{actions:t,defaultAction:i}=this.list,n=t.map(c=>c.name),o=n.indexOf(i);o!=-1&&(n.splice(o,1),n.unshift(i));let s=new Set,a=[],l=[];for(let c of n){let f=0;for(let p of c){if(!s.has(p)){s.add(p),a.push(`${c.slice(0,f)}&${c.slice(f)}`);break}f++}f==c.length&&l.push(c)}l.length&&(az.error(`Can't create shortcut for actions: ${l.join(",")} of "${this.name}" list`),n=n.filter(c=>!l.includes(c))),await e.call("coc#prompt#stop_prompt",["list"]);let u=await e.call("confirm",["Choose action:",a.join(`
|
||
`)]);await He(10),this.prompt.start(),u&&await this.doAction(n[u-1])}async doAction(e){let{list:t}=this;e=e||t.defaultAction;let i=t.actions.find(o=>o.name==e);if(!i){C.showMessage(`Action ${e} not found`,"error");return}let n;if(e=="preview"){let o=await this.ui.item;n=o?[o]:[]}else n=await this.ui.getItems();n.length&&await this.doItemAction(n,i)}async doPreview(e){let t=this.ui.getItem(e),i=this.list.actions.find(n=>n.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}=this.list,i=t.find(n=>n.name==e);if(!i)throw new Error(`default action "${e}" not found`);return i}async hide(){if(this.hidden)return;this.uiTokenSource&&(this.uiTokenSource.cancel(),this.uiTokenSource.dispose(),this.uiTokenSource=null);let{nvim:e,interval:t}=this;t&&clearInterval(t),this.hidden=!0,this.worker.stop(),this.history.add();let{winid:i}=this.ui;this.ui.reset(),this.window&&i&&(await e.call("coc#list#hide",[this.window.id,this.savedHeight,i]),b.isVim&&(e.command("redraw",!0),await He(10))),e.call("coc#prompt#stop_prompt",["list"],!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 n=await Promise.resolve(i.resolveItem(t));n&&e==this.ui.index&&await this.ui.updateItem(n,e)}}async showHelp(){await this.hide();let{list:e,nvim:t}=this;if(!e)return;t.pauseNotification(),t.command("tabe +setl\\ previewwindow [LIST HELP]",!0),t.command("setl nobuflisted noswapfile buftype=nofile bufhidden=wipe",!0),await t.resumeNotification();let i=e.options&&e.options.length,n=await t.buffer,o=new ss;if(o.addLine("NAME","Label"),o.addLine(` ${e.name} - ${e.description||""}
|
||
`),o.addLine("SYNOPSIS","Label"),o.addLine(` :CocList [LIST OPTIONS] ${e.name}${i?" [ARGUMENTS]":""}
|
||
`),e.detail){o.addLine("DESCRIPTION","Label");let a=e.detail.split(`
|
||
`).map(l=>" "+l);o.addLine(a.join(`
|
||
`)+`
|
||
`)}if(i){o.addLine("ARGUMENTS","Label"),o.addLine("");for(let a of e.options)o.addLine(a.name,"Special"),o.addLine(` ${a.description}`),o.addLine("");o.addLine("")}let s=b.getConfiguration(`list.source.${e.name}`);if(Object.keys(s).length){o.addLine("CONFIGURATIONS","Label"),o.addLine("");let a={};ge.all.forEach(l=>{let{packageJSON:u}=l,{contributes:c}=u;if(!c)return;let{configuration:f}=c;if(f){let{properties:p}=f;if(p)for(let d of Object.keys(p))a[d]=p[d]}});for(let l of Object.keys(s)){let u=s[l],c=`list.source.${e.name}.${l}`,f=a[c]&&a[c].description?a[c].description:l;o.addLine(` "${c}"`,"MoreMsg"),o.addText(` - ${f}, 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(n,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()}switchMatcher(){let{matcher:e,interactive:t}=this.listOptions;if(t)return;let i=["fuzzy","strict","regex"],n=i.indexOf(e)+1;n>=i.length&&(n=0),this.listOptions.matcher=i[n],this.prompt.matcher=i[n],this.worker.drawItems()}updateStatus(){let{ui:e,list:t,nvim:i}=this;if(!e.winid)return;let n=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};i.pauseNotification(),n.setVar("list_status",o,!0),i.command("redraws",!0),i.resumeNotification(!1,!0).logError()}get context(){let{winid:e}=this.ui;return{options:this.listOptions,args:this.listArgs,input:this.prompt.input,cwd:b.cwd,window:this.window,buffer:this.buffer,listWindow:e?this.nvim.createWindow(e):void 0}}redrawItems(){this.worker.drawItems()}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);return i==0&&(i=10),this.ui.length>=i&&(this.nvim.pauseNotification(),this.ui.setCursor(Number(e),0),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).logError())}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}=this.listOptions,{nvim:n}=this,o=t.persist===!0||t.name=="preview",s=this.winid&&(o||i);try{if(s?o||(n.pauseNotification(),n.call("coc#prompt#stop_prompt",["list"],!0),n.call("win_gotoid",[this.context.window.id],!0),await n.resumeNotification()):await this.hide(),t.multiple)await Promise.resolve(t.execute(e,this.context));else if(t.parallel)await Promise.all(e.map(a=>Promise.resolve(t.execute(a,this.context))));else for(let a of e)await Promise.resolve(t.execute(a,this.context));s&&this.ui.restoreWindow(),t.reload&&s&&await this.worker.loadItems(this.context,!0)}catch(a){C.showMessage(a.message,"error"),az.error(`Error on action "${t.name}"`,a)}}onInputChange(){this.timer&&clearTimeout(this.timer);let e=this.worker.length;if(this.listOptions.input=this.prompt.input,this.listOptions.interactive)this.worker.stop(),this.timer=setTimeout(async()=>{await this.worker.loadItems(this.context)},this.interactiveDebounceTime);else if(e){let t=Math.max(Math.min(Math.floor(e/200),300),50);this.timer=setTimeout(()=>{this.worker.drawItems()},t)}}dispose(){if(!this.hidden){this.hidden=!0,this.uiTokenSource&&(this.uiTokenSource.cancel(),this.uiTokenSource.dispose(),this.uiTokenSource=null);let{winid:e}=this.ui;this.ui.reset(),this.window&&e&&this.nvim.call("coc#list#hide",[this.window.id,this.savedHeight,e],!0)}this.interval&&clearInterval(this.interval),this.timer&&clearTimeout(this.timer),z(this.disposables),this.worker.dispose(),this.ui.dispose()}},lz=vC;var dz=S(require("fs")),bC=S(require("path")),hz=S(require("readline")),qr=S(W());var uz=S(require("child_process")),cz=S(require("events")),fz=S(require("readline"));var Lye=j()("list-commandTask"),yC=class extends cz.EventEmitter{constructor(e){super();this.opt=e;this.disposables=[];this.start()}start(){let{cmd:e,args:t,cwd:i,onLine:n}=this.opt,o=uz.spawn(e,t,{cwd:i,windowsHide:!0});this.disposables.push({dispose:()=>{o.kill()}}),o.on("error",a=>{this.emit("error",a.message)}),o.stderr.on("data",a=>{Lye.error(`[${e} Error]`,a.toString("utf8"))});let s=fz.default.createInterface(o.stdout);s.on("line",a=>{let l=n(a);l&&this.emit("data",l)}),s.on("close",()=>{this.emit("end")})}dispose(){z(this.disposables)}},pz=yC;var Mye=j()("list-basic"),wC=class{constructor(e){this.nvim=e;this.defaultAction="open";this.actions=[];this.options=[];this.disposables=[];this.config=new Pv}get alignColumns(){return this.config.get("alignColumns",!1)}get hlGroup(){return this.config.get("previewHighlightGroup","Search")}get previewHeight(){return this.config.get("maxPreviewHeight",12)}get splitRight(){return this.config.get("previewSplitRight",!1)}parseArguments(e){if(!this.optionMap){this.optionMap=new Map;for(let i of this.options){let n=i.name.split(/,\s*/g).map(s=>s.replace(/\s+.*/g,"")),o=i.key?i.key:n[n.length-1].replace(/^-/,"");for(let s of n)this.optionMap.set(s,{name:o,hasValue:i.hasValue})}}let t={};for(let i=0;i<e.length;i++){let n=e[i],o=this.optionMap.get(n);if(!o){Mye.error(`Option "${n}" of "${this.name}" not found`);continue}let s=!0;o.hasValue&&(s=e[i+1]||"",i=i+1),t[o.name]=s}return t}getConfig(){return b.getConfiguration(`list.source.${this.name}`)}addAction(e,t,i){this.createAction(Object.assign({name:e,execute:t},i||{}))}addMultipleAction(e,t,i){this.createAction(Object.assign({name:e,multiple:!0,execute:t},i||{}))}createCommandTask(e){return new pz(e)}addLocationActions(){this.createAction({name:"preview",execute:async(t,i)=>{let n=await this.convertLocation(t.location);await this.previewLocation(n,i)}});let{nvim:e}=this;this.createAction({name:"quickfix",multiple:!0,execute:async t=>{let i=await Promise.all(t.map(o=>this.convertLocation(o.location).then(s=>b.getQuickfixItem(s))));await e.call("setqflist",[i]);let n=await e.getVar("coc_quickfix_open_command");e.command(typeof n=="string"?n:"copen",!0)}});for(let t of["open","tabe","drop","vsplit","split"])this.createAction({name:t,execute:async i=>{await this.jumpTo(i.location,t=="open"?null:t)}})}async convertLocation(e){if(typeof e=="string")return qr.Location.create(e,qr.Range.create(0,0,0,0));if(qr.Location.is(e))return e;let t=$.parse(e.uri);if(t.scheme!="file")return qr.Location.create(e.uri,qr.Range.create(0,0,0,0));let i=hz.default.createInterface({input:dz.default.createReadStream(t.fsPath,{encoding:"utf8"})}),n=e.line,o=0,s=!1,a=await new Promise(l=>{i.on("line",u=>{if(!s){if(u.includes(n)){i.removeAllListeners(),i.close(),s=!0,l(u);return}o=o+1}}),i.on("error",u=>{this.nvim.errWriteLine(`Read ${t.fsPath} error: ${u.message}`),l(null)})});if(a!=null){let l=e.text?a.indexOf(e.text):0;l==0&&(l=a.match(/^\s*/)[0].length);let u=qr.Position.create(o,l+(e.text?e.text.length:0));return qr.Location.create(e.uri,qr.Range.create(qr.Position.create(o,l),u))}return qr.Location.create(e.uri,qr.Range.create(0,0,0,0))}async jumpTo(e,t){if(typeof e=="string"){await b.jumpTo(e,null,t);return}let{range:i,uri:n}=await this.convertLocation(e),o=i.start;o.line==0&&o.character==0&&Me(o,i.end)==0&&(o=null),await b.jumpTo(n,o,t)}createAction(e){let{name:t}=e,i=this.actions.findIndex(n=>n.name==t);i!==-1&&this.actions.splice(i,1),this.actions.push(e)}async previewLocation(e,t){if(!t.listWindow)return;let{nvim:i}=this,{uri:n,range:o}=e,s=b.getDocument(e.uri),a=$.parse(n),l=[];if(s)l=s.getLines();else if(a.scheme=="file")try{l=(await Yf(a.fsPath,"utf8")).split(/\r?\n/)}catch(c){""+a.fsPath,c.message}let u={winid:t.window.id,range:Gn(o)?null:o,lnum:o.start.line+1,name:a.scheme=="file"?a.fsPath:n,filetype:s?s.filetype:this.getFiletype(a.fsPath),position:t.options.position,maxHeight:this.previewHeight,splitRight:this.splitRight,hlGroup:this.hlGroup,scheme:a.scheme};await i.call("coc#list#preview",[l,u]),b.isVim&&i.command("redraw",!0)}async preview(e,t){let{nvim:i}=this,{bufname:n,filetype:o,range:s,lines:a,lnum:l}=e,u={winid:t.window.id,lnum:s?s.start.line+1:l||1,filetype:o||"txt",position:t.options.position,maxHeight:this.previewHeight,splitRight:this.splitRight,hlGroup:this.hlGroup};n&&(u.name=n),s&&(u.range=s),await i.call("coc#list#preview",[a,u]),b.isVim&&i.command("redraw",!0)}doHighlight(){}dispose(){z(this.disposables)}getFiletype(e){let t=bC.default.extname(e);if(!t)return"";for(let i of b.documents){let n=$.parse(i.uri).fsPath;if(bC.default.extname(n)==t){let{filetype:o}=i;return o=="javascriptreact"?"javascript":o=="typescriptreact"?"typescript":o.indexOf(".")!==-1?o.split(".")[0]:o}}return""}},Mt=wC;var kv=S(require("path"));function $r(r,e){if(e.length===0)return[];let t=[];if(r){let i=Array(Math.min(...e.map(n=>n.label.length))).fill(0);for(let n of e)for(let o=0;o<i.length;o++)i[o]=Math.max(i[o],n.label[o].length);t=e.map(n=>({...n,label:n.label.map((o,s)=>o.padEnd(i[s])).join(" ")}))}else t=e.map(i=>({...i,label:i.label.join(" ")}));return t}function mz(r,e){var t;if(r==="hidden")return"";if(r==="full")return e;if(r==="short"){let i=e.split(kv.default.sep);return i.length<2?e:[...i.slice(0,i.length-2).filter(o=>o.length>0).map(o=>o[0]),i[i.length-1]].join(kv.default.sep)}else{let i=e.split(kv.default.sep);return(t=i[i.length-1])!=null?t:""}}var xC=class extends Mt{constructor(e){super(e);this.defaultAction="run";this.description="registered commands of coc.nvim";this.name="commands";this.mru=b.createMru("commands"),this.addAction("run",async t=>{let{cmd:i}=t.data;await A.fire("Command",[i]),me.executeCommand(i).logError(),await me.addRecent(i)}),this.addAction("append",async t=>{let{cmd:i}=t.data;await e.feedKeys(`:CocCommand ${i} `,"n",!1)})}async loadItems(e){let t=[],i=await this.mru.load(),{commandList:n,onCommandList:o,titles:s}=me,a=n.map(l=>l.id).concat(o);for(let l of[...new Set(a)])t.push({label:[l,...s.get(l)?[s.get(l)]:[]],filterText:l,data:{cmd:l,score:Nye(i,l)}});return t.sort((l,u)=>u.data.score-l.data.score),$r(this.alignColumns,t)}doHighlight(){let{nvim:e}=this;e.pauseNotification(),e.command("syntax match CocCommandsTitle /\\t.*$/ contained containedin=CocCommandsLine",!0),e.command("highlight default link CocCommandsTitle Comment",!0),e.resumeNotification().catch(t=>{})}},gz=xC;function Nye(r,e){let t=r.indexOf(e);return t==-1?-1:r.length-t}var vz=S(require("path"));var Iv=S(jn()),Jp=S(require("path"));var G8e=j()("list-location"),DC=class extends Mt{constructor(e){super(e);this.defaultAction="open";this.description="show locations saved by g:coc_jump_locations variable";this.name="location";this.addLocationActions()}async loadItems(e,t){let i=await this.nvim.getVar("coc_jump_locations");if(t.isCancellationRequested)return[];i=i||[],i.forEach(a=>{if(!a.uri){let l=Jp.default.isAbsolute(a.filename)?a.filename:Jp.default.join(e.cwd,a.filename);a.uri=$.file(l).toString()}if(!a.bufnr&&b.getDocument(a.uri)!=null&&(a.bufnr=b.getDocument(a.uri).bufnr),a.range)a.lnum=a.lnum||a.range.start.line+1,a.col=a.col||a.range.start.character+1;else{let{lnum:l,col:u}=a;a.range=Iv.Range.create(l-1,u-1,l-1,u-1)}});let n=await this.nvim.call("bufnr","%"),o=i.every(a=>a.bufnr&&n&&a.bufnr==n);return i.map(a=>{let l=o?"":a.filename,u=`${l}${a.text.trim()}`;Jp.default.isAbsolute(l)&&(l=Ye(e.cwd,l)?Jp.default.relative(e.cwd,l):l);let c=`${l} |${a.type?a.type+" ":""}${a.lnum} col ${a.col}| `,f;if(a.range&&a.range.start.line==a.range.end.line){let d=ue(c)+ue(a.text.slice(0,a.range.start.character)),h=ue(c)+ue(a.text.slice(0,a.range.end.character));f={hlGroup:"Search",span:[d,h]}}return{label:c+a.text,location:Iv.Location.create(a.uri,a.range),filterText:u,ansiHighlights:f?[f]:void 0}})}doHighlight(){let{nvim:e}=this;e.pauseNotification(),e.command("syntax match CocLocationName /\\v^[^|]+/ contained containedin=CocLocationLine",!0),e.command("syntax match CocLocationPosition /\\v\\|\\w*\\s?\\d+\\scol\\s\\d+\\|/ contained containedin=CocLocationLine",!0),e.command("syntax match CocLocationError /Error/ contained containedin=CocLocationPosition",!0),e.command("syntax match CocLocationWarning /Warning/ contained containedin=CocLocationPosition",!0),e.command("highlight default link CocLocationName Directory",!0),e.command("highlight default link CocLocationPosition LineNr",!0),e.command("highlight default link CocLocationError Error",!0),e.command("highlight default link CocLocationWarning WarningMsg",!0),e.resumeNotification().catch(t=>{})}},ls=DC;var eWe=j()("list-symbols"),SC=class extends ls{constructor(){super(...arguments);this.defaultAction="open";this.description="diagnostics of current workspace";this.name="diagnostics"}async loadItems(e){let t=St.getDiagnosticList(),{cwd:i}=e,n=this.getConfig().get("includeCode",!0),o=this.getConfig().get("pathFormat","full"),s=t.map(a=>{let l=Ye(i,a.file)?vz.default.relative(i,a.file):a.file,u=mz(o,l),c=o!=="hidden"?[`${u}:${a.lnum}`]:[],f=n?[`[${a.source}${a.code?"":"]"}`,a.code?`${a.code}]`:""]:[];return{label:[...c,...f,a.severity,a.message],location:a.location}});return $r(this.alignColumns,s)}doHighlight(){let{nvim:e}=this;e.pauseNotification(),e.command("syntax match CocDiagnosticsFile /\\v^\\s*\\S+/ contained containedin=CocDiagnosticsLine",!0),e.command("syntax match CocDiagnosticsError /\\tError\\s*\\t/ contained containedin=CocDiagnosticsLine",!0),e.command("syntax match CocDiagnosticsWarning /\\tWarning\\s*\\t/ contained containedin=CocDiagnosticsLine",!0),e.command("syntax match CocDiagnosticsInfo /\\tInformation\\s*\\t/ contained containedin=CocDiagnosticsLine",!0),e.command("syntax match CocDiagnosticsHint /\\tHint\\s*\\t/ contained containedin=CocDiagnosticsLine",!0),e.command("highlight default link CocDiagnosticsFile Comment",!0),e.command("highlight default link CocDiagnosticsError CocErrorSign",!0),e.command("highlight default link CocDiagnosticsWarning CocWarningSign",!0),e.command("highlight default link CocDiagnosticsInfo CocInfoSign",!0),e.command("highlight default link CocDiagnosticsHint CocHintSign",!0),e.resumeNotification().catch(t=>{})}},yz=SC;var Au=S($i()),bz=S(require("os")),Fv=S(require("path"));var qye=j()("list-extensions"),EC=class extends Mt{constructor(e){super(e);this.defaultAction="toggle";this.description="manage coc extensions";this.name="extensions";this.addAction("toggle",async t=>{let{id:i,state:n}=t.data;n!="disabled"&&(n=="activated"?await ge.deactivate(i):await ge.activate(i),await He(100))},{persist:!0,reload:!0,parallel:!0}),this.addAction("configuration",async t=>{let{root:i}=t.data,n=Fv.default.join(i,"package.json");if(Au.default.existsSync(n)){let s=Au.default.readFileSync(n,"utf8").split(/\r?\n/).findIndex(a=>a.includes('"contributes"'));await b.jumpTo($.file(n).toString(),{line:s==-1?0:s,character:0})}}),this.addAction("open",async t=>{let{root:i}=t.data;b.env.isiTerm?e.call("coc#util#iterm_open",[i],!0):e.call("coc#util#open_url",[i],!0)}),this.addAction("disable",async t=>{let{id:i,state:n}=t.data;n!=="disabled"&&await ge.toggleExtension(i)},{persist:!0,reload:!0,parallel:!0}),this.addAction("enable",async t=>{let{id:i,state:n}=t.data;n=="disabled"&&await ge.toggleExtension(i)},{persist:!0,reload:!0,parallel:!0}),this.addAction("lock",async t=>{let{id:i}=t.data;await ge.toggleLock(i)},{persist:!0,reload:!0}),this.addAction("help",async t=>{let{root:i}=t.data,o=(await Au.default.readdir(i)).find(s=>/^readme/i.test(s));if(o){let s=await e.call("fnameescape",[Fv.default.join(i,o)]);await b.callAsync("coc#util#execute",[`edit ${s}`])}}),this.addAction("reload",async t=>{let{id:i}=t.data;await ge.reloadExtension(i)},{persist:!0,reload:!0}),this.addAction("fix",async t=>{let{root:i,isLocal:n}=t.data,{npm:o}=ge;if(n){C.showMessage("Can't fix for local extension.","warning");return}if(!o)return;let s=Fv.default.join(i,"node_modules");Au.default.existsSync(s)&&Au.default.removeSync(s);let a=await b.createTerminal({cwd:i});!await a.show(!1)||(b.nvim.command("startinsert",!0),a.sendText(`${o} install --production --ignore-scripts --no-lockfile`,!0))}),this.addMultipleAction("uninstall",async t=>{let i=[];for(let n of t)n.data.isLocal||i.push(n.data.id);ge.uninstallExtension(i).catch(n=>{qye.error(n)})})}async loadItems(e){let t=[],i=await ge.getExtensionStates(),n=await ge.getLockedList();for(let o of i){let s="+";o.state=="disabled"?s="-":o.state=="activated"?s="*":o.state=="unknown"&&(s="?");let a=await this.nvim.call("resolve",o.root),l=n.includes(o.id);t.push({label:[`${s} ${o.id}${l?" \uE0A2":""}`,...o.isLocal?["[RTP]"]:[],o.version,a.replace(bz.default.homedir(),"~")],filterText:o.id,data:{id:o.id,root:a,state:o.state,isLocal:o.isLocal,priority:$ye(o.state)}})}return t.sort((o,s)=>o.data.priority!=s.data.priority?s.data.priority-o.data.priority:s.data.id-o.data.id?1:-1),$r(this.alignColumns,t)}doHighlight(){let{nvim:e}=this;e.pauseNotification(),e.command("syntax match CocExtensionsActivited /\\v^\\*/ contained containedin=CocExtensionsLine",!0),e.command("syntax match CocExtensionsLoaded /\\v^\\+/ contained containedin=CocExtensionsLine",!0),e.command("syntax match CocExtensionsDisabled /\\v^-/ contained containedin=CocExtensionsLine",!0),e.command("syntax match CocExtensionsName /\\v%3c\\S+/ contained containedin=CocExtensionsLine",!0),e.command("syntax match CocExtensionsRoot /\\v\\t[^\\t]*$/ contained containedin=CocExtensionsLine",!0),e.command("syntax match CocExtensionsLocal /\\v\\[RTP\\]/ contained containedin=CocExtensionsLine",!0),e.command("highlight default link CocExtensionsActivited Special",!0),e.command("highlight default link CocExtensionsLoaded Normal",!0),e.command("highlight default link CocExtensionsDisabled Comment",!0),e.command("highlight default link CocExtensionsName String",!0),e.command("highlight default link CocExtensionsLocal MoreMsg",!0),e.command("highlight default link CocExtensionsRoot Comment",!0),e.resumeNotification().catch(t=>{})}},wz=EC;function $ye(r){switch(r){case"unknown":return 2;case"activated":return 1;case"disabled":return-1;default:return 0}}var xz=S(require("path"));var Dz=S($i());var CC=class extends Mt{constructor(e){super(e);this.defaultAction="edit";this.description="list of current workspace folders";this.name="folders";this.addAction("edit",async t=>{let i=await e.call("input",["Folder: ",t.label,"dir"]),n=await Ht(i);if(!n||!n.isDirectory()){C.showMessage(`invalid path: ${i}`,"error");return}b.renameWorkspaceFolder(t.label,i)}),this.addAction("delete",async t=>{b.removeWorkspaceFolder(t.label)},{reload:!0,persist:!0}),this.addAction("newfile",async t=>{let i=await C.requestInput("File name",t.label+"/"),n=xz.default.dirname(i),o=await Ht(n);(!o||!o.isDirectory())&&Dz.default.mkdirpSync(n),await b.createFile(i,{overwrite:!1,ignoreIfExists:!0}),await this.jumpTo($.file(i).toString())})}async loadItems(e){return b.folderPaths.map(t=>({label:t}))}},Sz=CC;var Ez=S(require("path"));var _C=S(jn());var PC=class extends Mt{constructor(e){super(e);this.defaultAction="open";this.description="links of current buffer";this.name="links";this.addAction("open",async t=>{let{target:i}=t.data;$.parse(i).scheme.startsWith("http")?await e.call("coc#util#open_url",i):await b.jumpTo(i)}),this.addAction("jump",async t=>{let{location:i}=t.data;await b.jumpTo(i.uri,i.range.start)})}async loadItems(e,t){let i=await e.window.buffer,n=b.getDocument(i.id);if(!n)return null;let o=[],s=await U.getDocumentLinks(n.textDocument,t);if(s==null)throw new Error("Links provider not found.");let a=[];for(let l of s)l.target?o.push({label:Cz(l.target),data:{target:l.target,location:_C.Location.create(n.uri,l.range)}}):(l=await U.resolveDocumentLink(l),l.target&&o.push({label:Cz(l.target),data:{target:l.target,location:_C.Location.create(n.uri,l.range)}}),a.push(l));return o}},_z=PC;function Cz(r){if(!r.startsWith("file:"))return r;let e=$.parse(r).fsPath;return Ye(b.cwd,e)?Ez.default.relative(b.cwd,e):e}var TC=class extends Mt{constructor(e,t){super(e);this.listMap=t;this.name="lists";this.defaultAction="open";this.description="registered lists of coc.nvim";this.mru=new Gl("lists");this.addAction("open",async i=>{let{name:n}=i.data;await this.mru.add(n),await e.command(`CocList ${n}`)})}async loadItems(e){let t=[],i=await this.mru.load();for(let n of this.listMap.values())n.name!="lists"&&t.push({label:[n.name,...n.description?[n.description]:[]],data:{name:n.name,interactive:n.interactive,score:Bye(i,n.name)}});return t.sort((n,o)=>o.data.score-n.data.score),$r(this.alignColumns,t)}doHighlight(){let{nvim:e}=this;e.pauseNotification(),e.command("syntax match CocListsDesc /\\t.*$/ contained containedin=CocListsLine",!0),e.command("highlight default link CocListsDesc Comment",!0),e.resumeNotification().catch(t=>{})}},Pz=TC;function Bye(r,e){let t=r.indexOf(e);return t==-1?-1:r.length-t}var Tz=S(require("path")),Yp=S(jn());var Rz=S(El());var Je=S(W());function _n(r){switch(r){case Je.SymbolKind.File:return"File";case Je.SymbolKind.Module:return"Module";case Je.SymbolKind.Namespace:return"Namespace";case Je.SymbolKind.Package:return"Package";case Je.SymbolKind.Class:return"Class";case Je.SymbolKind.Method:return"Method";case Je.SymbolKind.Property:return"Property";case Je.SymbolKind.Field:return"Field";case Je.SymbolKind.Constructor:return"Constructor";case Je.SymbolKind.Enum:return"Enum";case Je.SymbolKind.Interface:return"Interface";case Je.SymbolKind.Function:return"Function";case Je.SymbolKind.Variable:return"Variable";case Je.SymbolKind.Constant:return"Constant";case Je.SymbolKind.String:return"String";case Je.SymbolKind.Number:return"Number";case Je.SymbolKind.Boolean:return"Boolean";case Je.SymbolKind.Array:return"Array";case Je.SymbolKind.Object:return"Object";case Je.SymbolKind.Key:return"Key";case Je.SymbolKind.Null:return"Null";case Je.SymbolKind.EnumMember:return"EnumMember";case Je.SymbolKind.Struct:return"Struct";case Je.SymbolKind.Event:return"Event";case Je.SymbolKind.Operator:return"Operator";case Je.SymbolKind.TypeParameter:return"TypeParameter";default:return"Unknown"}}var jWe=j()("list-symbols");function kz(r,e){return`${r.name}${e?` ${e}`:""}`}var RC=class extends ls{constructor(){super(...arguments);this.description="symbols of current document";this.name="outline";this.options=[{name:"-k, -kind KIND",hasValue:!0,description:"filters also by kind"}]}async loadItems(e,t){let i=await e.window.buffer,n=b.getDocument(i.id);if(!n)return null;let s=this.getConfig().get("ctagsFilestypes",[]),a,l=this.parseArguments(e.args);if(s.includes(n.filetype)||(a=await U.getDocumentSymbol(n.textDocument,t)),t.isCancellationRequested)return[];if(!a)return await this.loadCtagsSymbols(n);if(a.length==0)return[];let u=l.kind?l.kind.toLowerCase():null,c=[];if(!a[0].hasOwnProperty("location")){function p(d,h=0){d.sort(jye);for(let m of d){let y=_n(m.kind),v=Yp.Location.create(n.uri,m.selectionRange);c.push({label:[`${"| ".repeat(h)}${m.name}`,`[${y}]`,`${m.range.start.line+1}`],filterText:kz(m,l.kind==""?y:null),location:v,data:{kind:y}}),m.children&&m.children.length&&p(m.children,h+1)}}p(a),u&&(c=c.filter(d=>d.data.kind.toLowerCase().indexOf(u)==0))}else{a.sort((d,h)=>{let m=d.location.range.start,y=h.location.range.start,v=m.line-y.line;return v==0?m.character-y.character:v});for(let d of a){let h=_n(d.kind);d.name.endsWith(") callback")||u&&!h.toLowerCase().startsWith(u)||(d.location.uri===void 0&&(d.location.uri=n.uri),c.push({label:[d.name,`[${h}]`,`${d.location.range.start.line+1}`],filterText:kz(d,l.kind==""?h:null),location:d.location}))}}return $r(this.alignColumns,c)}doHighlight(){let{nvim:e}=this;e.pauseNotification(),e.command("syntax match CocOutlineName /\\v\\s?[^\\t]+\\s/ contained containedin=CocOutlineLine",!0),e.command("syntax match CocOutlineIndentLine /\\v\\|/ contained containedin=CocOutlineLine,CocOutlineName",!0),e.command("syntax match CocOutlineKind /\\[\\w\\+\\]/ contained containedin=CocOutlineLine",!0),e.command("syntax match CocOutlineLine /\\d\\+$/ contained containedin=CocOutlineLine",!0),e.command("highlight default link CocOutlineName Normal",!0),e.command("highlight default link CocOutlineIndentLine Comment",!0),e.command("highlight default link CocOutlineKind Typedef",!0),e.command("highlight default link CocOutlineLine Comment",!0),e.resumeNotification(!1,!0).logError()}async loadCtagsSymbols(e){if(!Rz.default.sync("ctags",{nothrow:!0}))return[];let t=$.parse(e.uri),i=Tz.default.extname(t.fsPath),n="",s=`${await this.nvim.call("tempname")}.${i}`,a=await this.nvim.call("fnameescape",s);await Z3(a,e.getDocumentContent());try{n=await hn(`ctags -f - --excmd=number --language-force=${e.filetype} ${a}`)}catch(c){}if(n.trim().length||(n=await hn(`ctags -f - --excmd=number ${a}`)),n=n.trim(),!n)return[];let l=n.split(/\r?\n/),u=[];for(let c of l){let f=c.split(" ");if(f.length<4)continue;let p=Number(f[2].replace(/;"$/,"")),d=e.getline(p-1);if(!d)continue;let h=d.indexOf(f[0]),m=h==-1?0:h,y=Yp.Range.create(p-1,m,p-1,m+f[0].length);u.push({label:`${f[0]} [${f[3]}] ${p}`,filterText:f[0],location:Yp.Location.create(e.uri,y),data:{line:p}})}return u.sort((c,f)=>c.data.line-f.data.line),u}},Iz=RC;function jye(r,e){let t=r.selectionRange,i=e.selectionRange;return t.start.line!=i.start.line?t.start.line-i.start.line:t.start.character-i.start.character}var kC=class extends Mt{constructor(e){super(e);this.defaultAction="toggle";this.description="registered services of coc.nvim";this.name="services";this.addAction("toggle",async t=>{let{id:i}=t.data;await Vt.toggle(i),await He(100)},{persist:!0,reload:!0})}async loadItems(e){let t=Vt.getServiceStats();return t.sort((i,n)=>i.id>n.id?-1:1),$r(this.alignColumns,t.map(i=>({label:[i.state=="running"?"*":" ",i.id,`[${i.state}]`,i.languageIds.join(", ")],data:{id:i.id}})))}doHighlight(){let{nvim:e}=this;e.pauseNotification(),e.command("syntax match CocServicesPrefix /\\v^./ contained containedin=CocServicesLine",!0),e.command("syntax match CocServicesName /\\v%3c\\S+/ contained containedin=CocServicesLine",!0),e.command("syntax match CocServicesStat /\\v\\t\\[\\w+\\]/ contained containedin=CocServicesLine",!0),e.command("syntax match CocServicesLanguages /\\v(\\])@<=.*$/ contained containedin=CocServicesLine",!0),e.command("highlight default link CocServicesPrefix Special",!0),e.command("highlight default link CocServicesName Type",!0),e.command("highlight default link CocServicesStat Statement",!0),e.command("highlight default link CocServicesLanguages Comment",!0),e.resumeNotification().catch(t=>{})}},Fz=kC;var Av=S(jn());var ZWe=j()("list-sources"),IC=class extends Mt{constructor(e){super(e);this.defaultAction="toggle";this.description="registered completion sources";this.name="sources";this.addAction("toggle",async t=>{let{name:i}=t.data;Ze.toggleSource(i)},{persist:!0,reload:!0}),this.addAction("refresh",async t=>{let{name:i}=t.data;await Ze.refresh(i)},{persist:!0,reload:!0}),this.addAction("open",async t=>{let{location:i}=t;i&&await this.jumpTo(i)})}async loadItems(e){let t=Ze.sourceStats(),i=await e.buffer.getOption("filetype"),n=b.env.disabledSources,o=n?n[i]||[]:[];return t.sort((s,a)=>s.type!=a.type?s.type<a.type?1:-1:s.name>a.name?-1:1),t.map(s=>{let a=s.disabled?" ":"*";o&&o.includes(s.name)&&(a="-");let l;return s.filepath&&(l=Av.Location.create($.file(s.filepath).toString(),Av.Range.create(0,0,0,0))),{label:`${a} ${Ov(s.name,22)} ${Ov("["+s.shortcut+"]",10)} ${Ov(s.triggerCharacters.join(""),10)} ${Ov(s.priority.toString(),3)} ${s.filetypes.join(",")}`,location:l,data:{name:s.name}}})}doHighlight(){let{nvim:e}=this;e.pauseNotification(),e.command("syntax match CocSourcesPrefix /\\v^./ contained containedin=CocSourcesLine",!0),e.command("syntax match CocSourcesName /\\v%3c\\S+/ contained containedin=CocSourcesLine",!0),e.command("syntax match CocSourcesType /\\v%25v.*%36v/ contained containedin=CocSourcesLine",!0),e.command("syntax match CocSourcesPriority /\\v%46v.*%50v/ contained containedin=CocSourcesLine",!0),e.command("syntax match CocSourcesFileTypes /\\v\\S+$/ contained containedin=CocSourcesLine",!0),e.command("highlight default link CocSourcesPrefix Special",!0),e.command("highlight default link CocSourcesName Type",!0),e.command("highlight default link CocSourcesPriority Number",!0),e.command("highlight default link CocSourcesFileTypes Comment",!0),e.command("highlight default link CocSourcesType Statement",!0),e.resumeNotification(!1,!0)}},Az=IC;function Ov(r,e){return r.length>e?r.slice(0,e-1)+".":r+" ".repeat(e-r.length)}var FC=S(require("path")),Oz=S(Qs());var Lz=S(W());var f5e=j()("list-symbols"),AC=class extends ls{constructor(){super(...arguments);this.interactive=!0;this.description="search workspace symbols";this.detail="Symbols list is provided by server, it works on interactive mode only.";this.name="symbols";this.options=[{name:"-k, -kind KIND",description:"Filter symbols by kind.",hasValue:!0}]}async loadItems(e,t){let{input:i}=e,n=this.parseArguments(e.args),o=n.kind?n.kind.toLowerCase():"";if(!e.options.interactive)throw new Error("Symbols only works on interactive mode");let s=await U.getWorkspaceSymbols(i,t);if(!s)throw new Error("No workspace symbols provider registed");let l=this.getConfig().get("excludes",[]),u=[];for(let c of s){let f=_n(c.kind);if(o&&f.toLowerCase()!=o)continue;let p=$.parse(c.location.uri).fsPath;Ye(b.cwd,p)&&(p=FC.default.relative(b.cwd,p)),!l.some(d=>Oz.default(p,d))&&u.push({label:[c.name,`[${f}]`,p],filterText:`${c.name}`,location:c.location,data:{original:c,kind:c.kind,file:p,score:Tv(i,c.name)}})}return u.sort((c,f)=>c.data.score!=f.data.score?f.data.score-c.data.score:c.data.kind!=f.data.kind?c.data.kind-f.data.kind:c.data.file.length-f.data.file.length),$r(this.alignColumns,u)}async resolveItem(e){let t=e.data.original;if(!t)return null;let i=new Lz.CancellationTokenSource,n=await U.resolveWorkspaceSymbol(t,i.token);if(!n)return null;let o=_n(n.kind),s=$.parse(n.location.uri).fsPath;return Ye(b.cwd,s)&&(s=FC.default.relative(b.cwd,s)),{label:`${t.name} [${o}] ${s}`,filterText:`${t.name}`,location:t.location}}doHighlight(){let{nvim:e}=this;e.pauseNotification(),e.command("syntax match CocSymbolsName /\\v^\\s*\\S+/ contained containedin=CocSymbolsLine",!0),e.command("syntax match CocSymbolsKind /\\[\\w\\+\\]\\s*\\t/ contained containedin=CocSymbolsLine",!0),e.command("syntax match CocSymbolsFile /\\S\\+$/ contained containedin=CocSymbolsLine",!0),e.command("highlight default link CocSymbolsName Normal",!0),e.command("highlight default link CocSymbolsKind Typedef",!0),e.command("highlight default link CocSymbolsFile Comment",!0),e.resumeNotification().catch(t=>{})}},Mz=AC;var qz=j()("list-manager"),$z=["<LeftMouse>","<LeftDrag>","<LeftRelease>","<2-LeftMouse>"],Bz=class{constructor(){this.plugTs=0;this.sessionsMap=new Map;this.disposables=[];this.listMap=new Map}init(e){this.nvim=e,this.config=new Pv,this.prompt=new JH(e,this.config),this.mappings=new VH(this,e,this.config);let t=this.config.get("selectedSignText","*");e.command(`sign define CocSelected text=${t} texthl=CocSelectedText linehl=CocSelectedLine`,!0),A.on("InputChar",this.onInputChar,this,this.disposables),A.on("FocusGained",Nz.default(async()=>{await this.getCurrentSession()&&this.prompt.drawPrompt()},100),null,this.disposables);let i;A.on("WinEnter",n=>{let o=this.getSessionByWinid(n);o&&this.prompt.start(o.listOptions)},null,this.disposables),A.on("WinLeave",n=>{this.getSessionByWinid(n)&&this.prompt.cancel()}),this.disposables.push(Xp.Disposable.create(()=>{i&&clearTimeout(i)})),this.prompt.onDidChangeInput(()=>{let{session:n}=this;!n||(n.onInputChange(),n.history.filter())}),this.registerList(new _z(e)),this.registerList(new ls(e)),this.registerList(new Mz(e)),this.registerList(new Iz(e)),this.registerList(new gz(e)),this.registerList(new wz(e)),this.registerList(new yz(e)),this.registerList(new Az(e)),this.registerList(new Fz(e)),this.registerList(new Pz(e,this.listMap)),this.registerList(new Sz(e))}async start(e){let t=this.parseArgs(e);if(!t)return;let{name:i}=t.list,n=this.sessionsMap.get(i);n&&n.dispose(),this.prompt.start(t.options);let o=new lz(this.nvim,this.prompt,t.list,t.options,t.listArgs,this.config);this.sessionsMap.set(i,o),this.lastSession=o;try{await o.start(e)}catch(s){this.nvim.call("coc#prompt#stop_prompt",["list"],!0);let a=s instanceof Error?s.message:s.toString();C.showMessage(`Error on "CocList ${i}": ${a}`,"error"),qz.error(s)}}getSessionByWinid(e){for(let t of this.sessionsMap.values())if(t&&t.winid==e)return this.lastSession=t,t;return null}async getCurrentSession(){let{id:e}=await this.nvim.window;for(let t of this.sessionsMap.values())if(t&&t.winid==e)return this.lastSession=t,t;return null}async resume(e){var t;if(!e)await((t=this.session)==null?void 0:t.resume());else{let i=this.sessionsMap.get(e);if(!i){C.showMessage(`Can't find exists ${e} list`);return}await i.resume()}}async doAction(e){let t=this.lastSession;!t||await t.doAction(e)}async first(e){let t=this.getSession(e);t&&await t.first()}async last(e){let t=this.getSession(e);t&&await t.last()}async previous(e){let t=this.getSession(e);t&&await t.previous()}async next(e){let t=this.getSession(e);t&&await t.next()}getSession(e){return e?this.sessionsMap.get(e):this.session}async cancel(e=!0){this.prompt.cancel(),!!e&&this.session&&await this.session.hide()}reset(){this.prompt.cancel(),this.lastSession=void 0;for(let e of this.sessionsMap.values())e.dispose();this.sessionsMap.clear(),this.nvim.call("coc#prompt#stop_prompt",["list"],!0)}switchMatcher(){var e;(e=this.session)==null||e.switchMatcher()}async togglePreview(){let{nvim:e}=this,t=await e.call("coc#list#get_preview",[0]);t!=-1?(await e.createWindow(t).close(!0),await e.command("redraw")):await this.doAction("preview")}async chooseAction(){let{lastSession:e}=this;e&&await e.chooseAction()}parseArgs(e){let t=[],i=!1,n=!1,o=!1,s=!1,a=!1,l,u="",c="fuzzy",f="bottom",p=[],d=[];for(let y of e)if(!l&&y.startsWith("-"))d.push(y);else if(l)p.push(y);else{if(!/^\w+$/.test(y))return C.showMessage(`Invalid list option: "${y}"`,"error"),null;l=y}l=l||"lists";let h=b.getConfiguration(`list.source.${l}`);!d.length&&!p.length&&(d=h.get("defaultOptions",[])),p.length||(p=h.get("defaultArgs",[]));for(let y of d)if(y.startsWith("--input"))u=y.slice(8);else if(y=="--number-select"||y=="-N")o=!0;else if(y=="--auto-preview"||y=="-A")n=!0;else if(y=="--regex"||y=="-R")c="regex";else if(y=="--strict"||y=="-S")c="strict";else if(y=="--interactive"||y=="-I")i=!0;else if(y=="--top")f="top";else if(y=="--tab")f="tab";else if(y=="--ignore-case"||y=="--normal"||y=="--no-sort")t.push(y.slice(2));else if(y=="--first")a=!0;else if(y=="--no-quit")s=!0;else return C.showMessage(`Invalid option "${y}" of list`,"error"),null;let m=this.listMap.get(l);return m?i&&!m.interactive?(C.showMessage(`Interactive mode of "${l}" list not supported`,"error"),null):{list:m,listArgs:p,options:{numberSelect:o,autoPreview:n,noQuit:s,first:a,input:u,interactive:i,matcher:c,position:f,ignorecase:!!t.includes("ignore-case"),mode:t.includes("normal")?"normal":"insert",sort:!t.includes("no-sort")}}:(C.showMessage(`List ${l} not found`,"error"),null)}async onInputChar(e,t,i){if(e!="list")return;let{mode:n}=this.prompt,o=Date.now();if(t=="<plug>"||this.plugTs&&o-this.plugTs<20){this.plugTs=o;return}if(!!t){if(t=="<esc>"){await this.cancel();return}try{n=="insert"?await this.onInsertInput(t,i):await this.onNormalInput(t,i)}catch(s){C.showMessage(`Error on input ${t}: ${s}`),qz.error(s)}}}async onInsertInput(e,t){let{session:i}=this;if(!i)return;if($z.includes(e)){await this.onMouseEvent(e);return}if(!(await i.doNumberSelect(e)||await this.mappings.doInsertKeymap(e)||t)&&!(e.startsWith("<")&&e.endsWith(">")))for(let s of e){let a=s.codePointAt(0);if(a==65533||a<32||a>=127&&a<=159)return;await this.prompt.acceptCharacter(s)}}async onNormalInput(e,t){if($z.includes(e)){await this.onMouseEvent(e);return}await this.mappings.doNormalKeymap(e)||await this.feedkeys(e)}onMouseEvent(e){if(this.session)return this.session.onMouseEvent(e)}async feedkeys(e,t=!0){let{nvim:i}=this;e=e.startsWith("<")&&e.endsWith(">")?`\\${e}`:e,await i.call("coc#prompt#stop_prompt",["list"]),await i.call("eval",[`feedkeys("${e}", "${t?"i":"in"}")`]),this.prompt.start()}async command(e){let{nvim:t}=this;await t.call("coc#prompt#stop_prompt",["list"]),await t.command(e),this.prompt.start()}async normal(e,t=!0){let{nvim:i}=this;await i.call("coc#prompt#stop_prompt",["list"]),await i.command(`normal${t?"!":""} ${e}`),this.prompt.start()}async call(e){if(this.session)return await this.session.call(e)}get session(){return this.lastSession}registerList(e){let{name:t}=e,i=this.listMap.get(t);return this.listMap.has(t)&&(i&&(typeof i.dispose=="function"&&i.dispose(),this.listMap.delete(t)),C.showMessage(`list "${t}" recreated.`)),this.listMap.set(t,e),ge.addSchemeProperty(`list.source.${t}.defaultOptions`,{type:"array",default:e.interactive?["--interactive"]:[],description:`Default list options of "${t}" list, only used when both list option and argument are empty.`,uniqueItems:!0,items:{type:"string",enum:["--top","--normal","--no-sort","--input","--tab","--strict","--regex","--ignore-case","--number-select","--interactive","--auto-preview","--first","--no-quit"]}}),ge.addSchemeProperty(`list.source.${t}.defaultArgs`,{type:"array",default:[],description:`Default argument list of "${t}" list, only used when list argument is empty.`,uniqueItems:!0,items:{type:"string"}}),Xp.Disposable.create(()=>{typeof e.dispose=="function"&&e.dispose(),this.listMap.delete(t)})}get names(){return Array.from(this.listMap.keys())}get descriptions(){let e={};for(let t of this.listMap.keys()){let i=this.listMap.get(t);e[t]=i.description}return e}async loadItems(e){let t=[e],i=this.parseArgs(t);if(!i)return;let{list:n,options:o,listArgs:s}=i,l=new Xp.CancellationTokenSource().token,u=await this.nvim.eval('[win_getid(),bufnr("%")]');return await n.loadItems({options:o,args:s,input:"",cwd:b.cwd,window:this.nvim.createWindow(u[0]),buffer:this.nvim.createBuffer(u[1]),listWindow:null},l)}toggleMode(){let e=this.lastSession;e&&e.toggleMode()}get isActivated(){var e;return((e=this.session)==null?void 0:e.winid)!=null}stop(){let e=this.lastSession;e&&e.stop()}dispose(){for(let e of this.sessionsMap.values())e.dispose();this.sessionsMap.clear(),this.config&&this.config.dispose(),this.lastSession=void 0,z(this.disposables)}},Kt=new Bz;function zye(){let r=e=>e==="coc.nvim"?Uz():this.require(e);return r.resolve=e=>Pn._resolveFilename(e,this),r.main=process.mainModule,r.extensions=Pn._extensions,r.cache=Pn._cache,r}function Gye(r){return function(e,t){let i=zye.call(this),n=Hz.dirname(t),o=e.replace(/^\#\!.*/,""),s=Pn.wrap(o),a=Lv.runInContext(s,r,{filename:t}),l=[this.exports,i,this,t,n];return a.apply(this.exports,l)}}function Vye(r,e){let t=new Pn(r);t.paths=Pn._nodeModulePaths(r);let i=Lv.createContext({module:t,Buffer,console:{debug:(...n)=>{e.debug.apply(e,n)},log:(...n)=>{e.debug.apply(e,n)},error:(...n)=>{e.error.apply(e,n)},info:(...n)=>{e.info.apply(e,n)},warn:(...n)=>{e.warn.apply(e,n)}}});J5(i,global),i.Reflect=Reflect,i.require=function(o){let s=Pn.prototype._compile;Pn.prototype._compile=Gye(i);let a=i.module.require(o);return Pn.prototype._compile=s,a},i.process=new process.constructor;for(let n of Object.keys(process))i.process[n]=process[n];return Wye.forEach(n=>{i.process[n]=Hye(n)}),i.process.chdir=()=>{},i.process.umask=n=>{if(typeof n!="undefined")throw new Error("Cannot use process.umask() to change mask (read-only)");return process.umask()},i}function Gz(r,e,t=!1){if(t||!Wz.default.existsSync(e))return{activate:()=>{},deactivate:null};let i=Vye(e,zz(`extension:${r}`));delete Pn._cache[require.resolve(e)];let n=i.require(e),o=n&&n.activate||n;return typeof o!="function"?{activate:()=>{},deactivate:null}:{activate:o,deactivate:typeof n.deactivate=="function"?n.deactivate:null}}var Xz=j(),Sr=Xz("extensions"),Zz=class{constructor(){this.extensions=new Map;this.disabled=new Set;this._onDidLoadExtension=new Mv.Emitter;this._onDidActiveExtension=new Mv.Emitter;this._onDidUnloadExtension=new Mv.Emitter;this._additionalSchemes={};this.activated=!1;this.disposables=[];this.ready=!0;this.onDidLoadExtension=this._onDidLoadExtension.event;this.onDidActiveExtension=this._onDidActiveExtension.event;this.onDidUnloadExtension=this._onDidUnloadExtension.event;let e=global.hasOwnProperty("__TEST__")?Fe.default.join(__dirname,"__tests__"):process.env.COC_DATA_HOME,t=this.root=Fe.default.join(e,"extensions");st.default.existsSync(t)||st.default.mkdirpSync(t);let i=Fe.default.join(t,"package.json");st.default.existsSync(i)||st.default.writeFileSync(i,'{"dependencies":{}}',"utf8");let n=Fe.default.join(t,"db.json");this.db=new Ym(n)}get outputChannel(){return this._outputChannel?this._outputChannel:(this._outputChannel=C.createOutputChannel("extensions"),this._outputChannel)}async init(){let e=this.db.fetch("extension")||{},t=Object.keys(e);for(let o of t)e[o].disabled==!0&&this.disabled.add(o);if(process.env.COC_NO_PLUGINS)return;let i=await this.globalExtensionStats(),n=await this.localExtensionStats(i.map(o=>o.id));i=i.concat(n),this.memos=new V5(Fe.default.resolve(this.root,"../memos.json")),i.map(o=>{let s=o.isLocal?Jr.Local:Jr.Global;try{this.createExtension(o.root,o.packageJSON,s)}catch(a){Sr.error(`Error on create ${o.root}:`,a)}}),await this.loadFileExtensions(),me.register({id:"extensions.forceUpdateAll",execute:async()=>{let o=await this.cleanExtensions();Sr.info(`Force update extensions: ${o}`),await this.installExtensions(o)}},!1,"remove all global extensions and install them"),b.onDidRuntimePathChange(async o=>{for(let s of o)s&&this.checkDirectory(s)===!0&&await this.loadExtension(s)},null,this.disposables)}async activateExtensions(){this.activated=!0;for(let o of this.extensions.values()){let{id:s,packageJSON:a}=o.extension;await this.setupActiveEvents(s,a)}let e=new mn(b.nvim);if(A.on("CursorMoved",Vz.debounce(async o=>{if(this.installBuffer&&o==this.installBuffer.bufnr){let s=await b.nvim.call("line",["."]),a=this.installBuffer.getMessages(s-1),l=a&&a.length?[{content:a.join(`
|
||
`),filetype:"txt"}]:[];await e.show(l,{modes:["n"]})}},500)),global.hasOwnProperty("__TEST__"))return;this.checkExtensions().logError();let t=b.getConfiguration("coc.preferences"),i=t.get("extensionUpdateCheck","never"),n=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,n).logError()}}async updateExtensions(e,t=!1){if(!this.npm)return;let i=await this.getLockedList(),n=await this.globalExtensionStats();n=n.filter(l=>![...i,...this.disabled].includes(l.id)),this.db.push("lastUpdate",Date.now()),t&&C.showMessage("Updating extensions, checkout output:///extensions for details.","more");let o=this.installBuffer=new R0(!0,e,t?this.outputChannel:void 0);o.setExtensions(n.map(l=>l.id)),await o.show(b.nvim);let s=dv(this.npm,this.modulesFolder);await vf(n,l=>{let{id:u}=l;o.startProgress([u]);let c=l.exotic?l.uri:null,f=s(u);return f.on("message",(p,d)=>{o.addMessage(u,p,d)}),f.update(c).then(p=>{o.finishProgress(u,!0),p&&this.loadExtension(p).logError()},p=>{o.addMessage(u,p.message),o.finishProgress(u,!1)})},t?1:3)}async checkExtensions(){let{globalExtensions:e}=b.env;if(e&&e.length){let t=this.filterGlobalExtensions(e);this.installExtensions(t).logError()}}get installer(){return dv(this.npm,this.modulesFolder)}async installExtensions(e=[]){let{npm:t}=this;if(!t||!e.length)return;e=eg(e);let i=this.installBuffer=new R0;i.setExtensions(e),await i.show(b.nvim);let n=dv(this.npm,this.modulesFolder);await vf(e,s=>{i.startProgress([s]);let a=n(s);return a.on("message",(l,u)=>{i.addMessage(s,l,u)}),a.install().then(l=>{i.finishProgress(s,!0);let u=Fe.default.join(this.modulesFolder,l);this.loadExtension(u).logError()},l=>{i.addMessage(s,l.message),i.finishProgress(s,!1),Sr.error(`Error on install ${s}`,l)})})}getMissingExtensions(){let e=this.loadJson()||{dependencies:{}},t=[];for(let i of Object.keys(e.dependencies)){let n=Fe.default.join(this.modulesFolder,i);if(!st.default.existsSync(n)){let o=e.dependencies[i];o.startsWith("http")?t.push(o):t.push(i)}}return t}get npm(){let e=b.getConfiguration("npm").get("binPath","npm");e=b.expand(e);for(let t of[e,"yarnpkg","yarn","npm"])try{return Yz.default.sync(t)}catch(i){continue}return C.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:n}=i;return n.isActive?"activated":"loaded"}async getExtensionStates(){let e=await this.localExtensionStats([]),t=await this.globalExtensionStats();return e.concat(t.filter(i=>e.find(n=>n.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 n=Fe.default.join(this.modulesFolder,e);st.default.existsSync(n)&&await this.loadExtension(n)}await He(200)}async reloadExtension(e){let t=this.extensions.get(e);if(!t){C.showMessage(`Extension ${e} not registered`,"error");return}if(t.type==Jr.Internal){C.showMessage(`Can't reload internal extension "${t.id}"`,"warning");return}t.type==Jr.SingleFile?await this.loadExtensionFile(t.filepath):t.directory?await this.loadExtension(t.directory):C.showMessage(`Can't reload extension ${t.id}`,"warning")}async cleanExtensions(){let e=this.modulesFolder;if(!st.default.existsSync(e))return[];let t=this.globalExtensions,i=[];for(let n of t){let o=Fe.default.join(e,n),s=await st.default.lstat(o);!s||s&&s.isSymbolicLink()||(await this.unloadExtension(n),await st.default.remove(o),i.push(n))}return i}async uninstallExtension(e){try{if(!e.length)return;let[t,i]=Qm(e,a=>this.globalExtensions.includes(a));i.length&&C.showMessage(`Extensions ${i} not global extensions, can't uninstall!`,"warning");let n=this.loadJson()||{dependencies:{}};for(let a of t){await this.unloadExtension(a),delete n.dependencies[a];let l=Fe.default.join(this.modulesFolder,a);st.default.existsSync(l)&&await st.default.remove(l)}let o={dependencies:{}};Object.keys(n.dependencies).sort().forEach(a=>{o.dependencies[a]=n.dependencies[a]});let s=Fe.default.join(this.root,"package.json");st.default.writeFileSync(s,JSON.stringify(o,null,2),{encoding:"utf8"}),C.showMessage(`Removed: ${t.join(" ")}`)}catch(t){C.showMessage(`Uninstall failed: ${t.message}`,"error")}}isDisabled(e){return this.disabled.has(e)}has(e){return this.extensions.has(e)}isActivated(e){let t=this.extensions.get(e);return!!(t&&t.extension.isActive)}async loadExtension(e){try{let t=Fe.default.dirname(e),i=Fe.default.normalize(t)!=Fe.default.normalize(this.modulesFolder),n=Fe.default.join(e,"package.json"),o=JSON.parse(st.default.readFileSync(n,"utf8")),{name:s}=o;return this.isDisabled(s)?!1:(await this.unloadExtension(s),this.createExtension(e,Object.freeze(o),i?Jr.Local:Jr.Global),!0)}catch(t){return C.showMessage(`Error on load extension from "${e}": ${t.message}`,"error"),Sr.error(`Error on load extension from ${e}`,t),!1}}async loadFileExtensions(){if(!process.env.COC_VIMCONFIG)return;let e=Fe.default.join(process.env.COC_VIMCONFIG,"coc-extensions");if(!st.default.existsSync(e))return;let t=await st.default.readdir(e);t=t.filter(i=>i.endsWith(".js"));for(let i of t)await this.loadExtensionFile(Fe.default.join(e,i))}loadedExtensions(){return Array.from(this.extensions.keys())}async watchExtension(e){let t=this.extensions.get(e);if(!t){C.showMessage(`extension ${e} not found`,"error");return}if(e.startsWith("single-"))C.showMessage(`watching ${t.filepath}`),this.disposables.push(Pl(t.filepath,async()=>{await this.loadExtensionFile(t.filepath),C.showMessage(`reloaded ${e}`)}));else{let i=b.getWatchmanPath();if(!i){C.showMessage("watchman not found","error");return}let n=await ta.createClient(i,t.directory);if(!n){C.showMessage("Can't create watchman client, check output:///watchman");return}C.showMessage(`watching ${t.directory}`),this.disposables.push(n),n.subscribe("**/*.js",async()=>{await this.reloadExtension(e),C.showMessage(`reloaded ${e}`)}).then(o=>{this.disposables.push(o)},o=>{Sr.error(o)})}}async loadExtensionFile(e){let t=Fe.default.basename(e),i="single-"+Fe.default.basename(e,".js");if(this.isDisabled(i))return;let n=Fe.default.dirname(e),o={name:i,main:t,engines:{coc:"^0.0.79"}};await this.unloadExtension(i),this.createExtension(n,o,Jr.SingleFile)}async activate(e){if(this.isDisabled(e))throw new Error(`Extension ${e} is disabled!`);let t=this.extensions.get(e);if(!t)throw new Error(`Extension ${e} not registered!`);let{extension:i}=t;return i.isActive?!0:(await Promise.resolve(i.activate()),i.isActive?(this._onDidActiveExtension.fire(i),!0):!1)}async deactivate(e){let t=this.extensions.get(e);return t?(await Promise.resolve(t.deactivate()),!0):!1}async call(e,t,i){let n=this.extensions.get(e);if(!n)throw new Error(`extension ${e} not registered`);let{extension:o}=n;o.isActive||await this.activate(e);let{exports:s}=o;if(!s||!s.hasOwnProperty(t))throw new Error(`method ${t} not found on extension ${e}`);return await Promise.resolve(s[t].apply(null,i))}getExtensionApi(e){let t=this.extensions.get(e);if(!t)return null;let{extension:i}=t;return i.isActive?i.exports:null}registerExtension(e,t){let{id:i,packageJSON:n}=e;this.extensions.set(i,{id:i,type:Jr.Internal,extension:e,deactivate:t,isLocal:!0});let{contributes:o}=n;if(o){let{configuration:s}=o;if(s&&s.properties){let{properties:a}=s,l={};for(let u of Object.keys(a)){let c=a[u].default;c!=null&&(l[u]=c)}b.configurations.extendsDefaults(l)}}this._onDidLoadExtension.fire(e),this.setupActiveEvents(i,n).logError()}get globalExtensions(){let e=this.loadJson();return!e||!e.dependencies?[]:Object.keys(e.dependencies)}async globalExtensionStats(){let e=this.loadJson();if(!e||!e.dependencies)return[];let{modulesFolder:t}=this;return(await Promise.all(Object.keys(e.dependencies).map(n=>new Promise(async o=>{try{let s=e.dependencies[n],a=Fe.default.join(t,n),l=this.checkDirectory(a);if(l instanceof Error)return C.showMessage(`Unable to load global extension at ${a}: ${l.message}`,"error"),Sr.error(`Error on load ${a}`,l),o(null);let u=await Yf(Fe.default.join(a,"package.json"),"utf8");a=await st.default.realpath(a);let c=JSON.parse(u),f=c&&c.version||"",p=c&&c.description||"",d=Kz.default.isValid(s)?s:"";o({id:n,isLocal:!1,version:f,description:p,exotic:/^https?:/.test(s),uri:d.replace(/\.git(#master)?$/,""),root:a,state:this.getExtensionState(n),packageJSON:Object.freeze(c)})}catch(s){Sr.error(s),o(null)}})))).filter(n=>n!=null)}async localExtensionStats(e){let i=(await b.nvim.eval("&runtimepath")).split(",");return(await Promise.all(i.map(o=>new Promise(async s=>{try{if(this.checkDirectory(o)!==!0)return s(null);let l=Fe.default.join(o,"package.json"),u=await Yf(l,"utf8"),c=JSON.parse(u),f=this.extensions.get(c.name);if(f&&!f.isLocal)return Sr.info(`Extension "${c.name}" in runtimepath already loaded.`),s(null);if(e.includes(c.name))return Sr.info(`Skipped load vim plugin from "${o}", "${c.name}" already global extension.`),s(null);let p=c&&c.version||"",d=c&&c.description||"";s({id:c.name,isLocal:!0,version:p,description:d,exotic:!1,root:o,state:this.getExtensionState(c.name),packageJSON:Object.freeze(c)})}catch(a){Sr.error(a),s(null)}})))).filter(o=>o!=null)}loadJson(){let{root:e}=this,t=Fe.default.join(e,"package.json");if(!st.default.existsSync(t))return null;let i=[],n=st.default.readFileSync(t,"utf8"),o=Ul(n,i,{allowTrailingComma:!0});return i&&i.length>0&&(C.showMessage(`Error on parse ${t}`,"error"),b.nvim.call("coc#util#open_file",["edit",t],!0)),o}get schemes(){return this._additionalSchemes}addSchemeProperty(e,t){this._additionalSchemes[e]=t,b.configurations.extendsDefaults({[e]:t.default})}async setupActiveEvents(e,t){let{activationEvents:i}=t;if(!this.canActivate(e))return;if(!i||Array.isArray(i)&&i.includes("*")){await this.activate(e).catch(s=>{C.showMessage(`Error on activate extension ${e}: ${s.message}`),this.outputChannel.appendLine(`Error on activate extension ${e}.
|
||
${s.message}
|
||
${s.stack}`)});return}let n=[],o=()=>(z(n),new Promise(s=>{if(!this.canActivate(e))return this.outputChannel.appendLine(`Extension ${e} is disabled or not loaded.`),s();let a=setTimeout(()=>{this.outputChannel.appendLine(`Extension ${e} activate cost more than 1s`),s()},1e3);this.activate(e).then(()=>{clearTimeout(a),s()},l=>{clearTimeout(a),C.showMessage(`Error on activate extension ${e}: ${l.message}`),this.outputChannel.appendLine(`Error on activate extension ${e}:${l.message}
|
||
${l.stack}`),s()})}));for(let s of i){let a=s.split(":"),l=a[0];if(l=="onLanguage"){if(b.filetypes.has(a[1])){await o();return}b.onDidOpenTextDocument(u=>{u.languageId==a[1]&&o()},null,n)}else if(l=="onCommand")me.onCommandList.push(a[1]),A.on("Command",async u=>{u==a[1]&&(await o(),await He(500))},null,n);else if(l=="workspaceContains"){let u=async()=>{let f=b.workspaceFolders.map(p=>$.parse(p.uri).fsPath);for(let p of f)if(Bo(p,a[1].split(/\s+/)))return await o(),!0};if(await u())return;b.onDidChangeWorkspaceFolders(u,null,n)}else if(l=="onFileSystem"){for(let u of b.documents)if($.parse(u.uri).scheme==a[1]){await o();return}b.onDidOpenTextDocument(u=>{$.parse(u.uri).scheme==a[1]&&o()},null,n)}else C.showMessage(`Unsupported event ${s} of ${e}`,"error")}}createExtension(e,t,i){let n=t.name,o=!1,s=null,a=Fe.default.join(e,t.main||"index.js"),l,u=[],c={activate:async()=>{if(o)return s;let p={subscriptions:u,extensionPath:e,globalState:this.memos.createMemento(`${n}|global`),workspaceState:this.memos.createMemento(`${n}|${b.rootPath}`),asAbsolutePath:d=>Fe.default.join(e,d),storagePath:Fe.default.join(this.root,`${n}-data`),logger:Xz(n)};if(o=!0,!l)try{let d=!(t.engines||{}).hasOwnProperty("coc");l=Gz(n,a,d)}catch(d){Sr.error(`Error on createExtension ${n} from ${a}`,d);return}try{s=await Promise.resolve(l.activate(p)),Sr.debug("activate:",n)}catch(d){o=!1,Sr.error(`Error on active extension ${n}: ${d.stack}`,d)}return s}};Object.defineProperties(c,{id:{get:()=>n,enumerable:!0},packageJSON:{get:()=>t,enumerable:!0},extensionPath:{get:()=>e,enumerable:!0},isActive:{get:()=>o,enumerable:!0},exports:{get:()=>s,enumerable:!0}}),this.extensions.set(n,{id:n,type:i,isLocal:i==Jr.Local,extension:c,directory:e,filepath:a,deactivate:()=>{if(!!o&&(o=!1,z(u),u.splice(0,u.length),u=[],l&&l.deactivate))try{return Promise.resolve(l.deactivate()).catch(p=>{Sr.error(`Error on ${n} deactivate: `,p)})}catch(p){Sr.error(`Error on ${n} deactivate: `,p)}}});let{contributes:f}=t;if(f){let{configuration:p,rootPatterns:d,commands:h}=f;if(p&&p.properties){let{properties:m}=p,y={};for(let v of Object.keys(m)){let x=m[v].default;x!=null&&(y[v]=x)}b.configurations.extendsDefaults(y)}if(d&&d.length)for(let m of d)b.addRootPattern(m.filetype,m.patterns);if(h&&h.length)for(let m of h)me.titles.set(m.command,m.title)}this._onDidLoadExtension.fire(c),this.activated&&this.setupActiveEvents(n,t).logError()}filterGlobalExtensions(e){e=e.map(s=>s.replace(/@.*$/,""));let t=e.filter(s=>!this.disabled.has(s));t=t.filter(s=>!this.extensions.has(s));let i=this.loadJson(),n=[],o=[];if(i&&i.dependencies)for(let s of Object.keys(i.dependencies)){let a=i.dependencies[s];typeof a=="string"&&st.default.existsSync(Fe.default.join(this.modulesFolder,s,"package.json"))&&(o.push(s),/^https?:/.test(a)&&n.push(a))}return t=t.filter(s=>/^https?:/.test(s)?!n.some(a=>a.startsWith(s)):!o.includes(s)),t}get modulesFolder(){return Fe.default.join(this.root,global.hasOwnProperty("__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=Fe.default.join(e,"package.json");if(!st.default.existsSync(t))throw new Error("package.json not found");let i=JSON.parse(st.default.readFileSync(t,"utf8")),{name:n,engines:o,main:s}=i;if(!n||!o)throw new Error("can't find name & engines in package.json");if(!o||!wt(o))throw new Error(`invalid engines in ${t}`);if(s&&!st.default.existsSync(Fe.default.join(e,s)))throw new Error(`main file ${s} not found, you may need to build the project.`);let a=Object.keys(o);if(!a.includes("coc")&&!a.includes("vscode"))throw new Error("Engines in package.json doesn't have coc or vscode");if(a.includes("coc")){let l=o.coc.replace(/^\^/,">=");if(!Jz.default.satisfies(b.version,l))throw new Error(`Please update coc.nvim, ${i.name} requires coc.nvim ${o.coc}`)}return!0}catch(t){return t}}dispose(){z(this.disposables)}},ge=new Zz;var K4e=j()("model-source"),OC=class{constructor(e){this._disabled=!1;this.nvim=b.nvim,this.name=e.name,this.filepath=e.filepath||"",this.sourceType=e.sourceType||Yr.Native,this.isSnippet=!!e.isSnippet,this.defaults=e}get priority(){return this.getConfig("priority",1)}get triggerOnly(){let e=this.defaults.triggerOnly;return typeof e=="boolean"?e:!this.triggerCharacters&&!this.triggerPatterns?!1:Array.isArray(this.triggerPatterns)&&this.triggerPatterns.length!=0}get triggerCharacters(){return this.getConfig("triggerCharacters",null)}get optionalFns(){return this.defaults.optionalFns||[]}get triggerPatterns(){let e=this.getConfig("triggerPatterns",null);return!e||e.length==0?null:e.map(t=>typeof t=="string"?new RegExp(t+"$"):t)}get shortcut(){let e=this.getConfig("shortcut","");return e||this.name.slice(0,3)}get enable(){return this._disabled?!1:this.getConfig("enable",!0)}get filetypes(){return this.getConfig("filetypes",null)}get disableSyntaxes(){return this.getConfig("disableSyntaxes",[])}getConfig(e,t){let i=b.getConfiguration(`coc.source.${this.name}`);return t=this.defaults.hasOwnProperty(e)?this.defaults[e]:t,i.get(e,t)}toggle(){this._disabled=!this._disabled}get firstMatch(){return this.getConfig("firstMatch",!0)}get menu(){let{shortcut:e}=this;return e?`[${e}]`:""}filterWords(e,t){let{firstMatch:i}=this,n=[],{input:o}=t,s=t.word;if(!o.length)return[];let a=o[0];for(let l of e)!l||l.length<3||i&&a!=l[0]||!i&&a.toLowerCase()!=l[0].toLowerCase()||l==s||l==o||n.push(l);return n}fixStartcol(e,t){let{col:i,input:n,line:o,bufnr:s}=e,a=Rt(o,0,i),l=b.getDocument(s);if(!l)return i;let{chars:u}=l;for(let c=a.length-1;c>=0;c--){let f=a[c];if(!u.isKeywordChar(f)&&!t.includes(f))break;n=`${f}${n}`,i=i-1}return e.col=i,e.input=n,i}async shouldComplete(e){let{disableSyntaxes:t}=this;if(e.synname&&t&&t.length){let n=(e.synname||"").toLowerCase();if(t.findIndex(o=>n.includes(o.toLowerCase()))!==-1)return!1}let i=this.defaults.shouldComplete;return i?await Promise.resolve(i.call(this,e)):!0}async refresh(){let e=this.defaults.refresh;e&&await Promise.resolve(e.call(this))}async onCompleteDone(e,t){let i=this.defaults.onCompleteDone;i&&await Promise.resolve(i.call(this,e,t))}async doComplete(e,t){let i=this.defaults.doComplete;return i?await Promise.resolve(i.call(this,e,t)):null}},Tn=OC;var tHe=j()("model-source-vim"),LC=class extends Tn{async callOptinalFunc(e,t){if(!this.optionalFns.includes(e))return null;let n=`coc#source#${this.name}#${e}`,o;try{o=await this.nvim.call(n,t)}catch(s){return C.showMessage(`Vim error from source ${this.name}: ${s.message}`,"error"),null}return o}async shouldComplete(e){return await super.shouldComplete(e)?this.optionalFns.includes("should_complete")?!!await this.callOptinalFunc("should_complete",[e]):!0:!1}async refresh(){await this.callOptinalFunc("refresh",[])}async onCompleteDone(e,t){await super.onCompleteDone(e,t),!!this.optionalFns.includes("on_complete")&&await this.callOptinalFunc("on_complete",[e])}onEnter(e){if(!this.optionalFns.includes("on_enter"))return;let t=b.getDocument(e);if(!t)return;let{filetypes:i}=this;i&&!i.includes(t.filetype)||this.callOptinalFunc("on_enter",[{bufnr:e,uri:t.uri,languageId:t.filetype}]).logError()}async doComplete(e,t){let{col:i,input:n,line:o,colnr:s}=e,a=await this.callOptinalFunc("get_startcol",[e]);if(t.isCancellationRequested)return;if(a){if(a<0)return null;a=Number(a),(isNaN(a)||a<0)&&(a=i),a!==i&&(n=Rt(o,a,s-1),e=Object.assign({},e,{col:a,changed:i-a,input:n}))}let l=await this.nvim.callAsync("coc#util#do_complete",[this.name,e]);if(!l||l.length==0||t.isCancellationRequested)return null;if(this.firstMatch&&n.length){let c=n[0];l=l.filter(f=>{let p=f.filterText?f.filterText[0]:f.word[0];return Vp(c,p)})}l=l.map(c=>{if(typeof c=="string")return{word:c,menu:this.menu,isSnippet:this.isSnippet};let f=c.menu?c.menu+" ":"";return c.menu=`${f}${this.menu}`,c.isSnippet=this.isSnippet,delete c.user_data,c});let u={items:l};return a&&(u.startcol=a),u}},Qz=LC;var obe=j()("sources"),p9=class{constructor(){this.sourceMap=new Map;this.disposables=[];this.remoteSourcePaths=[]}get nvim(){return b.nvim}createNativeSources(){try{this.disposables.push(t9().regist(this.sourceMap)),this.disposables.push(i9().regist(this.sourceMap)),this.disposables.push(a9().regist(this.sourceMap))}catch(e){console.error("Create source error:"+e.message)}}async createVimSourceExtension(e,t){let i=jv.default.basename(t,".vim");try{await e.command(`source ${t}`);let n=await e.call("coc#util#remote_fns",i);for(let c of["init","complete"])if(!n.includes(c))return C.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 Qz({name:i,filepath:t,sourceType:Yr.Remote,optionalFns:n.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}),ge.registerExtension(u,()=>{l=!1,this.removeSource(a)})}catch(n){C.showMessage(`Error on create vim source ${i}: ${n.message}`,"error")}}createRemoteSources(){let{runtimepath:e}=b.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=jv.default.join(e,"autoload/coc/source"),i=await Ht(t);if(i&&i.isDirectory()){let n=await c9.default.promisify(u9.default.readdir)(t);n=n.filter(s=>s.endsWith(".vim"));let o=n.map(s=>jv.default.join(t,s));if(o.length==0)return;await Promise.all(o.map(s=>this.createVimSourceExtension(this.nvim,s)))}}init(){this.createNativeSources(),this.createRemoteSources(),A.on("BufEnter",this.onDocumentEnter,this,this.disposables),b.watchOption("runtimepath",async(e,t)=>{let i=l9.default(e,t);for(let[n,o]of i)if(n==1){let s=o.replace(/,$/,"").split(",");for(let a of s)a&&await this.createVimSources(a)}},this.disposables)}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}async doCompleteResolve(e,t){let i=this.getSource(e.source);if(i&&typeof i.onCompleteResolve=="function")try{await Promise.resolve(i.onCompleteResolve(e,t))}catch(n){obe.error("Error on complete resolve:",n.stack)}}async doCompleteDone(e,t){let i=JSON.parse(e.user_data),n=this.getSource(i.source);n&&typeof n.onCompleteDone=="function"&&await Promise.resolve(n.onCompleteDone(e,t))}shouldCommit(e,t){if(!e||!e.source)return!1;let i=this.getSource(e.source);return i&&i.sourceType==Yr.Service&&typeof i.shouldCommit=="function"?i.shouldCommit(e,t):!1}getCompleteSources(e){let{filetype:t}=e,i=Rt(e.line,0,e.colnr-1);return e.input==""&&!!e.triggerCharacter?this.getTriggerSources(i,t):this.getNormalSources(e.filetype)}getNormalSources(e){return this.sources.filter(t=>{let{filetypes:i,triggerOnly:n,enable:o}=t;return!(!o||n||i&&!i.includes(e)||this.disabledByLanguageId(t,e))})}checkTrigger(e,t,i){let{triggerCharacters:n,triggerPatterns:o}=e;return!n&&!o?!1:!!(i&&n&&n.includes(i)||o&&o.findIndex(s=>s.test(t))!==-1)}shouldTrigger(e,t){return this.getTriggerSources(e,t).length>0}getTriggerSources(e,t){let i=e.length?e[e.length-1]:"";return i?this.sources.filter(n=>{let{filetypes:o,enable:s}=n;return!s||o&&!o.includes(t)||this.disabledByLanguageId(n,t)?!1:this.checkTrigger(n,e,i)}):[]}addSource(e){let{name:t}=e;return this.names.includes(t)&&C.showMessage(`Source "${t}" recreated`,"warning"),this.sourceMap.set(t,e),f9.Disposable.create(()=>{this.sourceMap.delete(t)})}removeSource(e){let t=typeof e=="string"?e:e.name;e==this.sourceMap.get(t)&&this.sourceMap.delete(t)}async refresh(e){for(let t of this.sources)(!e||t.name==e)&&typeof t.refresh=="function"&&await Promise.resolve(t.refresh())}toggleSource(e){if(!e)return;let t=this.getSource(e);!t||typeof t.toggle=="function"&&t.toggle()}sourceStats(){let e=[],t=this.sources;for(let i of t)e.push({name:i.name,priority:i.priority,triggerCharacters:i.triggerCharacters||[],shortcut:i.shortcut||"",filetypes:i.filetypes||[],filepath:i.filepath||"",type:i.sourceType==Yr.Native?"native":i.sourceType==Yr.Remote?"remote":"service",disabled:!i.enable});return e}onDocumentEnter(e){let{sources:t}=this;for(let i of t)!i.enable||typeof i.onEnter=="function"&&i.onEnter(e)}createSource(e){if(!e.name||!e.doComplete){console.error("name and doComplete required for createSource");return}let t=new Tn(Object.assign({sourceType:Yr.Service},e));return this.addSource(t)}disabledByLanguageId(e,t){let i=b.env.disabledSources,n=i?i[t]:[];return Array.isArray(n)&&n.includes(e.name)}dispose(){z(this.disposables)}},Ze=new p9;var _a=S(W());function h9(r=0,e){for(let t=r;t<e.length;t++)if(d9(t,e))return t;return-1}function m9(r){return r>=65&&r<=90}function d9(r,e){if(r==0)return!0;let t=e[r];if(!Gp(t))return!1;let i=e[r-1];return!!(!Gp(i)||m9(t)&&!m9(i))}function g9(r,e){if(e.length==0||r.length<e.length)return 0;let t=no(r),i=t[0],n=0,o=e[0],s=1,a=!0;if(nn(o,i))n=o==i?5:2.5,s=1;else{let u=h9(1,t);if(u!=-1&&nn(o,t[u])&&(n=o==t[u]?2.5:2,s=u+1),n==0)for(let c=1;c<t.length;c++)nn(o,t[c])&&(n=o==t[c]?1:.5,s=c+1,a=!1)}if(e.length==1||n==0)return n;let l=Zp(t,s,e.slice(1),a);return l==0?0:n+l}function Zp(r,e,t,i=!0){if(e>=r.length)return 0;let n=[],o=t[0],s=r.length,a=t.length==1;if(!Gp(o)){for(let c=e;c<s;c++)if(r[c]==o){if(a)return 1;let f=Zp(r,c+1,t.slice(1),i);return f==0?0:1+f}return 0}let l=r[e],u=nn(o,l);if(u){let c=o==l?1:.5;if(!a){let f=Zp(r,e+1,t.slice(1),i);c=f==0?0:c+f}n.push(c)}if(Gp(o)&&!d9(e,r)){let c=h9(e+1,r);if(c!==-1){let f=r[c];if(nn(o,f)){let p=o==f?1:.75;if(!a){let d=Zp(r,c+1,t.slice(1),i);p=d==0?0:p+d}n.push(p)}}}if(!u&&i)for(let c=e+1;c<s;c++){let f=r[c];if(nn(o,f)){let p=o==f?.1:.05;if(!a){let d=Zp(r,c+1,t.slice(1),!1);p=d==0?0:p+d}n.push(p)}}return n.length?Math.max(...n):0}var Uv=j()("completion-complete"),sbe=500,MC=class{constructor(e,t,i,n,o,s){this.option=e;this.document=t;this.config=n;this.sources=o;this.nvim=s;this.results=[];this.completing=new Set;this._canceled=!1;this.tokenSources=new Map;this._onDidComplete=new _a.Emitter;this.onDidComplete=this._onDidComplete.event;Object.defineProperty(this,"recentScores",{get:()=>i||{}})}get isCompleting(){return this.completing.size>0}get isCanceled(){return this._canceled}get isEmpty(){return this.results.length==0}get startcol(){return this.option.col||0}get input(){return this.option.input}get isIncomplete(){return this.results.findIndex(e=>e.isIncomplete)!==-1}async completeSource(e){let{col:t}=this.option,i=Object.assign({},this.option),n=this.config.timeout;n=Math.max(Math.min(n,15e3),500);try{if(typeof e.shouldComplete=="function"&&!await Promise.resolve(e.shouldComplete(i)))return null;let o=Date.now(),s=this.tokenSources.get(e.name);s&&s.cancel();let a=new _a.CancellationTokenSource;this.tokenSources.set(e.name,a),await new Promise((l,u)=>{let{name:c}=e,f=setTimeout(()=>{this.nvim.command(`echohl WarningMsg| echom 'source ${e.name} timeout after ${n}ms'|echohl None`,!0),a.cancel()},n),p=!1,d=!1,h=!1,m=setTimeout(()=>{d||(h=!0,l(void 0))},sbe),y=()=>{d||(d=!0,v.dispose(),clearTimeout(m),clearTimeout(f),this.tokenSources.delete(c))},v=a.token.onCancellationRequested(()=>{v.dispose(),this.completing.delete(c),p=!0,y(),Uv.debug(`Source "${c}" cancelled`),l(void 0)});this.completing.add(c),Promise.resolve(e.doComplete(i,a.token)).then(x=>{if(this.completing.delete(c),p)return;y();let w=Date.now()-o;if(Uv.debug(`Source "${c}" takes ${w}ms`),x&&x.items&&x.items.length){if(x.priority=e.priority,x.source=c,h&&x.startcol&&x.startcol!=t)this.results=[x];else{let{results:E}=this,P=E.findIndex(k=>k.source==c);P!=-1?E.splice(P,1,x):E.push(x)}h&&this._onDidComplete.fire(),l(void 0)}else l(void 0)},x=>{this.completing.delete(c),y(),u(x)})})}catch(o){this.nvim.command(`echoerr 'Complete ${e.name} error: ${o.message.replace(/'/g,"''")}'`,!0),Uv.error("Complete error:",e.name,o)}}async completeInComplete(e){let{results:t,document:i}=this;t.filter(f=>!f.isIncomplete).forEach(f=>{f.items.forEach(p=>delete p.user_data)});let s=t.filter(f=>f.isIncomplete).map(f=>f.source),{input:a,colnr:l,linenr:u}=this.option;Object.assign(this.option,{input:e,line:i.getline(u-1),colnr:l+(e.length-a.length),triggerCharacter:null,triggerForInComplete:!0});let c=this.sources.filter(f=>s.includes(f.name));return await Promise.all(c.map(f=>this.completeSource(f))),this.filterResults(e,Math.floor(Date.now()/1e3))}filterResults(e,t=0){let{results:i}=this;i.sort((h,m)=>h.source=="tabnine"?1:m.source=="tabnine"?-1:m.priority-h.priority);let n=Date.now(),{bufnr:o}=this.option,{snippetIndicator:s,removeDuplicateItems:a,fixInsertedWord:l,asciiCharactersOnly:u}=this.config,c=!l||t==0?"":this.getFollowPart();if(i.length==0)return[];let f=[],p=no(e),d=new Set;for(let h=0,m=i.length;h<m;h++){let y=i[h],{items:v,source:x,priority:w}=y;for(let E=0;E<v.length;E++){let P=v[E];if(!P||typeof P.word!="string")continue;let{word:k}=P;if(u&&!/^[\x00-\x7F]*$/.test(k)||!P.dup&&d.has(k)||a&&!P.isSnippet&&d.has(k)&&P.line==null)continue;let _=P.filterText||P.word;if(P.filterText=_,_.length<e.length)continue;let O=P.kind&&_==e?64:g9(_,p);if(!(e.length&&O==0)){if(c.length&&!P.isSnippet&&P.word.endsWith(c)){let{word:I}=P;P.word=P.word.slice(0,-c.length),P.abbr=P.abbr||I}if(!P.user_data){let I={cid:t,source:x};I.index=P.index||E,P.isSnippet&&((P.abbr||P.word).endsWith(s)||(P.abbr=`${P.abbr||P.word}${s}`)),P.signature&&(I.signature=P.signature),P.user_data=JSON.stringify(I),P.source=x;let L=this.recentScores[`${o}|${k}`];L&&n-L<60*1e3?P.recentScore=L:P.recentScore=0}P.priority=w,P.abbr=P.abbr||P.word,P.score=e.length?O*(P.sourceScore||1):0,P.localBonus=this.localBonus&&this.localBonus.get(_)||0,d.add(k),P.isSnippet&&P.word==e&&(P.preselect=!0),f.push(P)}}}return f.sort((h,m)=>{let y=h.sortText,v=m.sortText,x=h.filterText,w=m.filterText;if(h.score!=m.score)return m.score-h.score;if(h.priority!=m.priority)return m.priority-h.priority;if(y&&v&&y!=v)return y<v?-1:1;if(h.recentScore!=m.recentScore)return m.recentScore-h.recentScore;if(h.localBonus!=m.localBonus){if(h.localBonus&&m.localBonus&&x!=w){if(x.startsWith(w))return 1;if(w.startsWith(x))return-1}return m.localBonus-h.localBonus}switch(this.config.defaultSortMethod){case"none":return 0;case"alphabetical":return h.filterText.localeCompare(m.filterText);case"length":default:return h.filterText.length-m.filterText.length}}),this.limitCompleteItems(f.slice(0,this.config.maxItemCount))}limitCompleteItems(e){let{highPrioritySourceLimit:t,lowPrioritySourceLimit:i}=this.config;if(!t&&!i)return e;let n=new Map;return e.filter(o=>{let{priority:s,source:a}=o,l=s<90,u=n.get(a)||0;return i&&l&&u==i||t&&!l&&u==t?!1:(n.set(a,u+1),!0)})}hasMatch(e){let{results:t}=this;if(!t)return!1;let i=no(e);for(let n=0,o=t.length;n<o;n++)if(t[n].items.findIndex(l=>ku(i,l.filterText||l.word))!==-1)return!0;return!1}async doComplete(){let e=this.option,{line:t,colnr:i,linenr:n,col:o}=this.option;if(this.config.localityBonus){let l=n-1;this.localBonus=this.document.getLocalifyBonus(_a.Position.create(l,e.col-1),_a.Position.create(l,i))}else this.localBonus=new Map;await Promise.all(this.sources.map(l=>this.completeSource(l)));let{results:s}=this;if(s.length==0)return[];let a=s.find(l=>l.startcol!=null&&l.startcol!=o);if(a){let{startcol:l}=a;e.col=l,e.input=Rt(t,l,i-1),this.results=[a]}return Uv.info(`Results from: ${this.results.map(l=>l.source).join(",")}`),this.filterResults(e.input,Math.floor(Date.now()/1e3))}resolveCompletionItem(e){let{results:t}=this;if(!t)return null;try{if(e.user_data){let{source:i}=JSON.parse(e.user_data);return t.find(o=>o.source==i).items.find(o=>o.user_data==e.user_data)}for(let i of t){let n=i.items.find(o=>o.abbr==e.abbr&&o.info==e.info);if(n)return n}return null}catch(i){return null}}getFollowPart(){let{colnr:e,line:t}=this.option,i=Mf(t,e-1);return i==t.length?"":t.slice(i-t.length).match(/^\S?[\w-]*/)[0]}dispose(){if(!this._canceled){this._onDidComplete.dispose(),this._canceled=!0;for(let e of this.tokenSources.values())e.cancel();this.tokenSources.clear(),this.sources=[],this.results=[]}}},v9=MC;var jHe=j()("floating"),NC=class{constructor(e,t){this.nvim=e;this.isVim=t;this.winid=0;this.bufnr=0}async show(e,t,i,n){let{nvim:o}=this;e=e.filter(c=>c.content.trim().length>0);let{lines:s,codes:a,highlights:l}=Om(e);if(s.length==0){this.close();return}let u=await o.call("coc#float#create_pum_float",[this.winid,this.bufnr,s,{codes:a,highlights:l,maxWidth:i.maxPreviewWidth,pumbounding:t}]);if(this.isVim&&o.command("redraw",!0),!(!u||u.length==0)&&(this.winid=u[0],this.bufnr=u[1],n.isCancellationRequested)){this.close();return}}close(){let{winid:e,nvim:t}=this;this.winid=0,!!e&&(t.call("coc#float#close",[e],!0),this.isVim&&t.command("redraw",!0))}},y9=NC;function qC(r,e){let t,i,n,o=0;function s(){t=arguments;let l=Date.now()-o;return n||(o!=0&&l>=e?a():n=setTimeout(a,e-l)),i}function a(){n=0,o=Date.now(),i=r.apply(null,t),t=null}return s.clear=()=>{n&&clearTimeout(n)},s}var us=j()("completion"),abe=["abbr","menu","info","kind","icase","dup","empty","user_data"],b9=class{constructor(){this.activated=!1;this.disposables=[];this.complete=null;this.recentScores={};this.changedTick=0;this.insertCharTs=0;this.insertLeaveTs=0}init(){this.config=this.getCompleteConfig(),this.floating=new y9(b.nvim,b.env.isVim),A.on(["InsertCharPre","MenuPopupChanged","TextChangedI","CursorMovedI","InsertLeave"],()=>{this.triggerTimer&&(clearTimeout(this.triggerTimer),this.triggerTimer=null)},this,this.disposables),A.on("InsertCharPre",this.onInsertCharPre,this,this.disposables),A.on("InsertLeave",this.onInsertLeave,this,this.disposables),A.on("InsertEnter",this.onInsertEnter,this,this.disposables),A.on("TextChangedP",this.onTextChangedP,this,this.disposables),A.on("TextChangedI",this.onTextChangedI,this,this.disposables);let e=qC(this.onPumChange.bind(this),b.isVim?200:100);A.on("CompleteDone",async t=>{this.currItem=null,this.cancelResolve(),this.floating.close(),await this.onCompleteDone(t)},this,this.disposables),A.on("MenuPopupChanged",t=>{if(!this.activated||this.isCommandLine)return;let{completed_item:i}=t,n=i.hasOwnProperty("word")?i:null;Ne(n,this.currItem)||(this.cancelResolve(),this.currItem=n,e(t))},this,this.disposables),b.onDidChangeConfiguration(t=>{t.affectsConfiguration("suggest")&&(this.config=this.getCompleteConfig())},null,this.disposables)}get nvim(){return b.nvim}get option(){return this.complete?this.complete.option:null}get isCommandLine(){var e;return(e=this.document)==null?void 0:e.uri.endsWith("%5BCommand%20Line%5D")}addRecent(e,t){!e||(this.recentScores[`${t}|${e}`]=Date.now())}get isActivated(){return this.activated}get document(){return this.option?b.getDocument(this.option.bufnr):null}getCompleteConfig(){let e=b.getConfiguration("suggest");function t(a,l){return e.get(a,l)}let i=t("keepCompleteopt",!1),n=t("autoTrigger","always");if(i&&n!="none"){let{completeOpt:a}=b;!a.includes("noinsert")&&!a.includes("noselect")&&(n="none")}let o=b.floatSupported&&t("floatEnable",!0),s=b.env.pumevent&&t("acceptSuggestionOnCommitCharacter",!1);return{autoTrigger:n,floatEnable:o,keepCompleteopt:i,defaultSortMethod:t("defaultSortMethod","length"),removeDuplicateItems:t("removeDuplicateItems",!1),disableMenuShortcut:t("disableMenuShortcut",!1),acceptSuggestionOnCommitCharacter:s,disableKind:t("disableKind",!1),disableMenu:t("disableMenu",!1),previewIsKeyword:t("previewIsKeyword","@,48-57,_192-255"),enablePreview:t("enablePreview",!1),enablePreselect:t("enablePreselect",!1),maxPreviewWidth:t("maxPreviewWidth",80),triggerCompletionWait:t("triggerCompletionWait",100),labelMaxLength:t("labelMaxLength",200),triggerAfterInsertEnter:t("triggerAfterInsertEnter",!1),noselect:t("noselect",!0),numberSelect:t("numberSelect",!1),maxItemCount:t("maxCompleteItemCount",50),timeout:t("timeout",500),minTriggerInputLength:t("minTriggerInputLength",1),snippetIndicator:t("snippetIndicator","~"),fixInsertedWord:t("fixInsertedWord",!0),localityBonus:t("localityBonus",!0),highPrioritySourceLimit:t("highPrioritySourceLimit",null),lowPrioritySourceLimit:t("lowPrioritySourceLimit",null),asciiCharactersOnly:t("asciiCharactersOnly",!1)}}async startCompletion(e){this.pretext=Rt(e.line,0,e.colnr-1);try{await this._doComplete(e)}catch(t){this.stop(!1),us.error("Complete error:",t.stack)}}async resumeCompletion(e=!1){let{document:t,complete:i}=this;if(!t||i.isCanceled||!i.results||i.results.length==0)return;let n=this.getResumeInput();if(n==this.input&&!e)return;if(!n||n.endsWith(" ")||!n.startsWith(i.input)){this.stop();return}this.input=n;let o=[];if(i.isIncomplete){await t.patchChange();let{changedtick:s}=t;if(o=await i.completeInComplete(n),i.isCanceled||t.changedtick!=s)return}else o=i.filterResults(n);if(!i.isCompleting&&o.length===0){this.stop();return}await this.showCompletion(i.option.col,o)}hasSelected(){return b.env.pumevent?this.currItem!=null:!this.config.noselect}async showCompletion(e,t){let{nvim:i,document:n,option:o}=this,{numberSelect:s,disableKind:a,labelMaxLength:l,disableMenuShortcut:u,disableMenu:c}=this.config,f=this.config.enablePreselect?t.findIndex(h=>h.preselect):-1;s&&o.input.length&&!/^\d/.test(o.input)&&(t=t.map((h,m)=>{let y=m+1;return m<9?Object.assign({},h,{abbr:h.abbr?`${y} ${h.abbr}`:`${y} ${h.word}`}):h}),i.call("coc#_map",[],!0)),this.changedTick=n.changedtick;let p=abe.slice();a&&(p=p.filter(h=>h!="kind")),c&&(p=p.filter(h=>h!="menu"));let d=t.map(h=>{let m={word:h.word,equal:1};for(let y of p)h.hasOwnProperty(y)&&(u&&y=="menu"?m[y]=h[y].replace(/\[.+\]$/,""):y=="abbr"&&h[y].length>l?m[y]=h[y].slice(0,l):m[y]=h[y]);return m});i.call("coc#_do_complete",[e,d,f],!0)}async _doComplete(e){let{source:t}=e,{nvim:i,config:n}=this,o=b.getDocument(e.bufnr);if(!o||!o.attached)return;e.filetype=o.filetype,this.input=e.input;let s=[];if(t==null)s=Ze.getCompleteSources(e);else{let u=Ze.getSource(t);u&&s.push(u)}if(!s.length||(await o.patchChange(),o.changedtick!=e.changedtick))return;let a=new v9(e,o,this.recentScores,n,s,i);this.start(a);let l=await this.complete.doComplete();if(!a.isCanceled){if(l.length==0&&!a.isCompleting){this.stop();return}a.onDidComplete(async()=>{if(this.currItem!=null)return;let u=this.getResumeInput();if(a.isCanceled||u==null)return;let{input:c}=this.option;if(u==c){let f=a.filterResults(u,Math.floor(Date.now()/1e3));await this.showCompletion(e.col,f)}else await this.resumeCompletion()}),l.length&&(this.getResumeInput()==e.input?await this.showCompletion(e.col,l):await this.resumeCompletion(!0))}}async onTextChangedP(e,t){let{option:i,document:n}=this,o=this.pretext=t.pre;if(!i||i.bufnr!=e||t.changedtick==this.changedTick)return;let s=this.latestInsert!=null;if(this.lastInsert=null,t.pre.match(/^\s*/)[0]!==i.line.match(/^\s*/)[0]){us.warn("Complete stopped by indent change."),this.stop();return}!s||!o||(Ze.shouldTrigger(o,n.filetype)?await this.triggerCompletion(n,o):await this.resumeCompletion())}async onTextChangedI(e,t){let{nvim:i,latestInsertChar:n,option:o}=this,s=this.pretext==t.pre,a=this.pretext=t.pre;this.lastInsert=null;let l=b.getDocument(e);if(!!l){if(!this.activated){if(!n)return;if(Ze.getTriggerSources(a,l.filetype).length){await this.triggerCompletion(l,this.pretext);return}this.triggerTimer=setTimeout(async()=>{await this.triggerCompletion(l,a)},this.config.triggerCompletionWait);return}if(!(!o||e!=o.bufnr)){if(o.linenr!=t.lnum||o.col>=t.col-1){this.stop();return}if(s&&!n){this.stop(!1);return}if(a&&this.currItem&&this.config.acceptSuggestionOnCommitCharacter&&n){let u=this.getCompleteItem(this.currItem),c=a[a.length-1];if(Ze.shouldCommit(u,c)){let{linenr:f,col:p,line:d,colnr:h}=this.option;this.stop();let{word:m}=u,y=`${d.slice(0,p)}${m}${n}${d.slice(h-1)}`;await i.call("coc#util#setline",[f,y]);let v=p+m.length+2;await i.call("cursor",[f,v]),await l.patchChange();return}}Ze.shouldTrigger(a,l.filetype)?await this.triggerCompletion(l,a):await this.resumeCompletion()}}}async triggerCompletion(e,t){if(!e||!e.attached){us.warn("Document not attached, suggest disabled.");return}if(!this.shouldTrigger(e,t))return;if(e.getVar("suggest_disable")){us.warn("Suggest disabled by b:coc_suggest_disable");return}await e.patchChange();let[n,o]=await this.nvim.eval('[get(b:,"coc_suggest_disable",0),coc#util#get_complete_option()]');if(n==1){us.warn("Suggest disabled by b:coc_suggest_disable");return}if(o.blacklist&&o.blacklist.includes(o.input)){us.warn("Suggest disabled by b:coc_suggest_blacklist",o.blacklist);return}t.length&&(o.triggerCharacter=t.slice(-1)),us.debug("trigger completion with",o),await this.startCompletion(o)}async onCompleteDone(e){let{document:t,isActivated:i}=this;if(!i||!t||!e.hasOwnProperty("word"))return;let n=Object.assign({},this.option),o=this.getCompleteItem(e);if(this.stop(!1),!o)return;let s=this.insertCharTs,a=this.insertLeaveTs;try{if(await Ze.doCompleteResolve(o,new $C.CancellationTokenSource().token),this.addRecent(o.word,t.bufnr),await He(50),this.insertCharTs!=s||this.insertLeaveTs!=a)return;let[l,u,c]=await this.nvim.eval("[pumvisible(),line('.'),strpart(getline('.'), 0, col('.') - 1)]");if(l||u!=n.linenr||this.activated||!c.endsWith(o.word))return;await t.patchChange(),await Ze.doCompleteDone(o,n)}catch(l){us.error("error on complete done",l.stack)}}async onInsertLeave(){this.insertLeaveTs=Date.now(),this.stop(!1)}async onInsertEnter(e){if(!this.config.triggerAfterInsertEnter||this.config.autoTrigger!=="always")return;let t=b.getDocument(e);if(!t)return;let i=await this.nvim.eval("strpart(getline('.'), 0, col('.') - 1)");!i||await this.triggerCompletion(t,i)}async onInsertCharPre(e){this.lastInsert={character:e,timestamp:Date.now()},this.insertCharTs=this.lastInsert.timestamp}get latestInsert(){let{lastInsert:e}=this;return!e||Date.now()-e.timestamp>500?null:e}get latestInsertChar(){let{latestInsert:e}=this;return e?e.character:""}shouldTrigger(e,t){let i=this.config.autoTrigger;if(i=="none")return!1;if(Ze.shouldTrigger(t,e.filetype))return!0;if(i!=="always"||this.isActivated)return!1;let n=t.slice(-1);if(n&&(e.isWord(t.slice(-1))||n.codePointAt(0)>255)){let o=this.config.minTriggerInputLength;return o==1?!0:this.getInput(e,t).length>=o}return!1}async onPumChange(e){if(!this.activated)return;let{completed_item:t,col:i,row:n,height:o,width:s,scrollbar:a}=e,l={col:i,row:n,height:o,width:s,scrollbar:a},u=this.getCompleteItem(t);if(!u){this.floating.close();return}let c=this.resolveTokenSource=new $C.CancellationTokenSource,{token:f}=c;if(await Ze.doCompleteResolve(u,f),this.resolveTokenSource=null,f.isCancellationRequested)return;let p=u.documentation;if(!p&&u.info){let{info:d}=u;p=[{filetype:/^[\w-\s.,\t]+$/.test(d)?"txt":this.document.filetype,content:d}]}!this.isActivated||(!p||p.length==0?this.floating.close():(this.config.floatEnable&&await this.floating.show(p,l,{maxPreviewWidth:this.config.maxPreviewWidth},f),this.isActivated||this.floating.close()))}start(e){let{activated:t}=this;this.activated=!0,t&&this.complete.dispose(),this.complete=e,this.config.keepCompleteopt||this.nvim.command(`noa set completeopt=${this.completeOpt}`,!0)}cancelResolve(){this.resolveTokenSource&&(this.resolveTokenSource.cancel(),this.resolveTokenSource=null)}stop(e=!0){let{nvim:t}=this;!this.activated||(this.cancelResolve(),this.currItem=null,this.activated=!1,this.complete&&(this.complete.dispose(),this.complete=null),t.pauseNotification(),e&&t.call("coc#_hide",[],!0),this.floating.close(),this.config.numberSelect&&t.call("coc#_unmap",[],!0),this.config.keepCompleteopt||this.nvim.command(`noa set completeopt=${b.completeOpt}`,!0),t.command("let g:coc#_context['candidates'] = []",!0),t.call("coc#_cancel",[],!0),t.resumeNotification(!1,!0))}getInput(e,t){let i="";for(let n=t.length-1;n>=0;n--){let o=n==0?null:t[n-1];if(!o||!e.isWord(o)){i=t.slice(n,t.length);break}}return i}getResumeInput(){let{option:e,pretext:t}=this;if(!e)return null;let i=Buffer.from(t,"utf8");if(i.length<e.col)return null;let n=i.slice(e.col).toString("utf8");return e.blacklist&&e.blacklist.includes(n)?null:n}get completeOpt(){let{noselect:e,enablePreview:t}=this.config,i=t&&!b.env.pumevent?",preview":"";return e?`noselect,menuone${i}`:`noinsert,menuone${i}`}getCompleteItem(e){return!this.complete||e==null?null:this.complete.resolveCompletionItem(e)}dispose(){z(this.disposables)}},cs=new b9;var oo=S(W());var sze=j()("snippets-snipet"),BC=class{constructor(e,t,i){this._snippetString=e;this.position=t;this._variableResolver=i;this._parser=new Ho}async init(){let e=this._parser.parse(this._snippetString,!0),{_variableResolver:t}=this;t&&await e.resolveVariables(t),this.tmSnippet=e,this.update()}adjustPosition(e,t){let{line:i,character:n}=this.position;this.position={line:i+t,character:n+e},this.update()}adjustTextEdit(e){let{range:t,newText:i}=e;if(Me(this.range.start,t.end)<0||!i.includes(`
|
||
`)&&Me(t.start,t.end)==0&&Me(this.range.start,t.start)==0&&this._placeholders.findIndex(s=>Me(s.range.start,t.start)==0)!==-1)return!1;let n=gD(this.range.start,e);return n.line==0&&n.character==0||this.adjustPosition(n.character,n.line),!0}get isPlainText(){return this._placeholders.length>1?!1:this._placeholders.every(e=>e.value=="")}get finalCount(){return this._placeholders.filter(e=>e.isFinalTabstop).length}toString(){return this.tmSnippet.toString()}get range(){let{position:e}=this,t=this.tmSnippet.toString(),n=kt.create("untitled:/1","snippet",0,t).positionAt(t.length),o=n.line==0?e.character+n.character:n.character;return oo.Range.create(e,oo.Position.create(e.line+n.line,o))}get firstPlaceholder(){let e=0;for(let t of this._placeholders)t.index!=0&&(e==0||t.index<e)&&(e=t.index);return this.getPlaceholder(e)}get lastPlaceholder(){let e=0;for(let t of this._placeholders)(e==0||t.index>e)&&(e=t.index);return this.getPlaceholder(e)}getPlaceholderById(e){return this._placeholders.find(t=>t.id==e)}getPlaceholder(e){let t=this._placeholders.filter(n=>n.index==e),i=t.filter(n=>!n.transform);return i.length?i[0]:t[0]}getPrevPlaceholder(e){if(e==0)return this.lastPlaceholder;let t=this.getPlaceholder(e-1);return t||this.getPrevPlaceholder(e-1)}getNextPlaceholder(e){let t=this._placeholders.map(o=>o.index),i=Math.max.apply(null,t);if(e>=i)return this.finalPlaceholder;let n=this.getPlaceholder(e+1);return n||this.getNextPlaceholder(e+1)}get finalPlaceholder(){return this._placeholders.find(e=>e.isFinalTabstop)}getPlaceholderByRange(e){return this._placeholders.find(t=>Ji(e,t.range))}insertSnippet(e,t,i){let{start:n}=e.range,o=oo.Position.create(i.start.line-n.line,i.start.line==n.line?i.start.character-n.character:i.start.character),s=oo.Position.create(i.end.line-n.line,i.end.line==n.line?i.end.character-n.character:i.end.character),a=oo.Range.create(o,s),l=this.tmSnippet.insertSnippet(t,e.id,a);return this.update(),l}updatePlaceholder(e,t){let{start:i,end:n}=t.range,{range:o}=this,{value:s,id:a,index:l}=e,u=jB(e.range,s,t),c=0;if(!u.includes(`
|
||
`)){for(let d of this._placeholders)if(d.index==l&&d.id<a&&d.line==e.range.start.line){let h=this.tmSnippet.getPlaceholderText(d.id,u);c=c+ue(h)-ue(d.value)}}e.isVariable?this.tmSnippet.updateVariable(a,u):this.tmSnippet.updatePlaceholder(a,u);let f=$B(o.end,t),p={range:oo.Range.create(o.start,f),newText:this.tmSnippet.toString()};return this.update(),{edits:[p],delta:c}}update(){let e=this.tmSnippet,{line:t,character:i}=this.position,n=kt.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,f)=>{let p=e.offset(c),d=n.positionAt(p),h={line:t+d.line,character:d.line==0?i+d.character:d.character},m;if(c instanceof yn){let w=c.name;l.has(w)?m=l.get(w):(l.set(w,u),m=u,u=u+1)}else m=c.index;let y=c.toString(),v=y.split(/\r?\n/),x={range:oo.Range.create(h,{line:h.line+v.length-1,character:v.length==1?h.character+y.length:v[v.length-1].length}),transform:c.transform!=null,line:h.line,id:f,index:m,value:y,isVariable:c instanceof yn,isFinalTabstop:c.index===0};if(Object.defineProperty(x,"snippet",{enumerable:!1}),c instanceof ei&&c.choice){let{options:w}=c.choice;w&&w.length&&(x.choice=w.map(E=>E.value))}return x})}};var Qp=S(require("path"));var uze=j()("snippets-variable"),ed=class{constructor(){this._variableToValue={};let e=new Date;Object.assign(this._variableToValue,{CURRENT_YEAR:e.getFullYear().toString(),CURRENT_YEAR_SHORT:e.getFullYear().toString().slice(-2),CURRENT_MONTH:(e.getMonth()+1).toString(),CURRENT_DATE:e.getDate().toString(),CURRENT_HOUR:e.getHours().toString(),CURRENT_MINUTE:e.getMinutes().toString(),CURRENT_SECOND:e.getSeconds().toString(),CURRENT_DAY_NAME:e.toLocaleString("en-US",{weekday:"long"}),CURRENT_DAY_NAME_SHORT:e.toLocaleString("en-US",{weekday:"short"}),CURRENT_MONTH_NAME:e.toLocaleString("en-US",{month:"long"}),CURRENT_MONTH_NAME_SHORT:e.toLocaleString("en-US",{month:"short"}),TM_FILENAME:null,TM_FILENAME_BASE:null,TM_DIRECTORY:null,TM_FILEPATH:null,YANK:null,TM_LINE_INDEX:null,TM_LINE_NUMBER:null,TM_CURRENT_LINE:null,TM_CURRENT_WORD:null,TM_SELECTED_TEXT:null,CLIPBOARD:null})}async resovleValue(e){let{nvim:t}=C;if(["TM_FILENAME","TM_FILENAME_BASE","TM_DIRECTORY","TM_FILEPATH"].includes(e)){let i=await t.eval('expand("%:p")');if(e=="TM_FILENAME")return Qp.default.basename(i);if(e=="TM_FILENAME_BASE")return Qp.default.basename(i,Qp.default.extname(i));if(e=="TM_DIRECTORY")return Qp.default.dirname(i);if(e=="TM_FILEPATH")return i}if(e=="YANK")return await t.call("getreg",['""']);if(e=="TM_LINE_INDEX")return(await t.call("line",["."])-1).toString();if(e=="TM_LINE_NUMBER")return(await t.call("line",["."])).toString();if(e=="TM_CURRENT_LINE")return await t.call("getline",["."]);if(e=="TM_CURRENT_WORD")return await t.eval("expand('<cword>')");if(e=="TM_SELECTED_TEXT")return await t.eval("get(g:,'coc_selected_text', '')");if(e=="CLIPBOARD")return await t.eval("@*")}async resolve(e){let t=e.name,i=this._variableToValue[t];if(i!=null)return i.toString();let n=await this.resovleValue(t);return n||(e.children&&e.children.length?e.toString():this._variableToValue.hasOwnProperty(t)?"":t)}};var Mu=j()("snippets-session"),jC=class{constructor(e,t){this.nvim=e;this.bufnr=t;this._isActive=!1;this._currId=0;this.applying=!1;this.preferComplete=!1;this._snippet=null;this._onCancelEvent=new Lu.Emitter;this.onCancel=this._onCancelEvent.event;let i=b.getConfiguration("coc.preferences"),n=b.getConfiguration("suggest");this.preferComplete=i.get("preferCompleteThanJumpPlaceholder",n.get("preferCompleteThanJumpPlaceholder",!1))}async start(e,t=!0,i){let{document:n}=this;if(!n||!n.attached)return!1;if(A.fire("InsertSnippet",[]).logError(),!i){let d=await C.getCursorPosition();i=Lu.Range.create(d,d)}let o=i.start,s=await b.getFormatOptions(this.document.uri);await n.patchChange(!0);let a=n.getline(o.line),l=a.match(/^\s*/)[0],u=lbe(e,l,s),c=new ed,f=new BC(u,o,c);await f.init();let p=Lu.TextEdit.replace(i,f.toString());if(e.endsWith(`
|
||
`)&&a.slice(o.character).length&&(p.newText=p.newText+l,u=u+l),this.applying=!0,await n.applyEdits([p]),this.applying=!1,this._isActive){let d=this.findPlaceholder(i);if(d&&!d.isFinalTabstop){let h=this.snippet.insertSnippet(d,u,i),m=this.snippet.getPlaceholder(h);return this._currId=m.id,t&&await this.selectPlaceholder(m),!0}}if(f.isPlainText){this.deactivate();let d=f.finalPlaceholder;return await C.moveTo(d.range.start),!1}return this._snippet=f,this._currId=f.firstPlaceholder.id,t&&await this.selectPlaceholder(f.firstPlaceholder),this.activate(),!0}activate(){this._isActive||(this._isActive=!0,this.nvim.call("coc#snippet#enable",[],!0))}deactivate(){this._isActive&&(this._isActive=!1,this._snippet=null,this.nvim.call("coc#snippet#disable",[],!0),Mu.debug("[SnippetManager::cancel]")),this._onCancelEvent.fire(void 0),this._onCancelEvent.dispose()}get isActive(){return this._isActive}async nextPlaceholder(){if(!this.isActive)return;await this.document.patchChange();let e=this.placeholder,t=this.snippet.getNextPlaceholder(e.index);await this.selectPlaceholder(t)}async previousPlaceholder(){if(!this.isActive)return;await this.document.patchChange();let e=this.placeholder,t=this.snippet.getPrevPlaceholder(e.index);await this.selectPlaceholder(t)}async synchronizeUpdatedPlaceholders(e){if(!this.isActive||!this.document||this.applying)return;let t={range:e.range,newText:e.text},{snippet:i}=this;if(i.adjustTextEdit(t))return;if(Me(t.range.start,i.range.end)>0){if(!t.newText)return;Mu.info("Content change after snippet, cancelling snippet session"),this.deactivate();return}let o=this.findPlaceholder(t.range);if(!o){Mu.info("Change outside placeholder, cancelling snippet session"),this.deactivate();return}if(o.isFinalTabstop&&i.finalCount<=1){Mu.info("Change final placeholder, cancelling snippet session"),this.deactivate();return}this._currId=o.id;let{edits:s,delta:a}=i.updatePlaceholder(o,t);!s.length||(this.applying=!0,await this.document.applyEdits(s),this.applying=!1,a&&await this.nvim.call("coc#util#move_cursor",a))}async selectCurrentPlaceholder(e=!0){let t=this.snippet.getPlaceholderById(this._currId);t&&await this.selectPlaceholder(t,e)}async selectPlaceholder(e,t=!0){let{nvim:i,document:n}=this;if(!n||!e)return;let{start:o,end:s}=e.range,a=s.character-o.character,l=ue(n.getline(o.line).slice(0,o.character))+1;this._currId=e.id,e.choice?(await i.call("coc#snippet#show_choices",[o.line+1,l,a,e.choice]),t&&i.call("coc#util#do_autocmd",["CocJumpPlaceholder"],!0)):await this.select(e,t)}async select(e,t=!0){let{range:i,value:n,isFinalTabstop:o}=e,{document:s,nvim:a}=this,{start:l,end:u}=i,{textDocument:c}=s,f=c.offsetAt(u)-c.offsetAt(l),p=s.getline(l.line),d=p?ue(p.slice(0,l.character)):0,h=s.getline(u.line),m=h?ue(h.slice(0,u.character)):0;a.setVar("coc_last_placeholder",{current_text:n,start:{line:l.line,col:d},end:{line:u.line,col:m}},!0);let[y,v,x,w]=await a.eval("[&virtualedit, &selection, pumvisible(), mode()]"),E="";if(x&&this.preferComplete){let P=cs.hasSelected()?"":"\\<C-n>";await a.eval(`feedkeys("${P}\\<C-y>", 'in')`);return}w!="n"&&(E+="\\<Esc>"),f==0?d==0||!w.startsWith("i")&&d<ue(p)?E+="i":E+="a":(E+="v",m=await this.getVirtualCol(u.line+1,m),v=="inclusive"?u.character==0?E+=`${u.line}G`:E+=`${u.line+1}G${m}|`:v=="old"?E+=`${u.line+1}G${m}|`:E+=`${u.line+1}G${m+1}|`,d=await this.getVirtualCol(l.line+1,d),E+=`o${l.line+1}G${d+1}|o\\<c-g>`),w=="i"&&E=="\\<Esc>a"&&(E=""),a.pauseNotification(),a.setOption("virtualedit","onemore",!0),a.call("cursor",[l.line+1,d+(E=="a"?0:1)],!0),E&&a.call("eval",[`feedkeys("${E}", 'in')`],!0),w=="i"&&a.call("coc#_cancel",[],!0),a.setOption("virtualedit",y,!0),o&&(this.snippet.finalCount==1?(Mu.info("Jump to final placeholder, cancelling snippet session"),this.deactivate()):a.call("coc#snippet#disable",[],!0)),b.env.isVim&&a.command("redraw",!0),await a.resumeNotification(),t&&a.call("coc#util#do_autocmd",["CocJumpPlaceholder"],!0)}async getVirtualCol(e,t){let{nvim:i}=this;return await i.eval(`virtcol([${e}, ${t}])`)}async checkPosition(){if(!this.isActive)return;let e=await C.getCursorPosition();this.snippet&&Wt(e,this.snippet.range)!=0&&(Mu.info("Cursor insert out of range, cancelling snippet session"),this.deactivate())}findPlaceholder(e){if(!this.snippet)return null;let{placeholder:t}=this;return t&&Ji(e,t.range)?t:this.snippet.getPlaceholderByRange(e)||null}get placeholder(){return this.snippet?this.snippet.getPlaceholderById(this._currId):null}get snippet(){return this._snippet}get document(){return b.getDocument(this.bufnr)}};function lbe(r,e,t){let i=r.split(/\r?\n/),n=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=n.repeat(l.length):!c&&!t.insertSpaces&&(u=n.repeat(l.length/o)),(a==0||s.length==0?"":e)+u+s.slice(l.length)}),i.join(`
|
||
`)}var Rze=j()("snippets-manager"),w9=class{constructor(){this.sessionMap=new Map;this.disposables=[];b.onDidChangeTextDocument(async e=>{let t=this.getSession(e.bufnr);t&&await t.synchronizeUpdatedPlaceholders(e.contentChanges[0])},null,this.disposables),b.onDidCloseTextDocument(e=>{let t=b.getDocument(e.uri);if(!t)return;let i=this.getSession(t.bufnr);i&&i.deactivate()},null,this.disposables),A.on("BufEnter",async e=>{let t=this.getSession(e);!this.statusItem||(t&&t.isActive?this.statusItem.show():this.statusItem.hide())},null,this.disposables),A.on("InsertEnter",async()=>{let{session:e}=this;!e||await e.checkPosition()},null,this.disposables)}init(){let e=b.getConfiguration("coc.preferences");this.statusItem=C.createStatusBarItem(0),this.statusItem.text=e.get("snippetStatusText","SNIP")}async insertSnippet(e,t=!0,i){let{bufnr:n}=b,o=this.getSession(n);o||(o=new jC(b.nvim,n),this.sessionMap.set(n,o),o.onCancel(()=>{this.sessionMap.delete(n),b.bufnr==n&&this.statusItem.hide()}));let s=await o.start(e,t,i);return s&&this.statusItem.show(),s}async selectCurrentPlaceholder(e=!0){let{session:t}=this;if(t)return await t.selectCurrentPlaceholder(e)}async nextPlaceholder(){let{session:e}=this;if(e)return await e.nextPlaceholder();b.nvim.call("coc#snippet#disable",[],!0),this.statusItem.hide()}async previousPlaceholder(){let{session:e}=this;if(e)return await e.previousPlaceholder();b.nvim.call("coc#snippet#disable",[],!0),this.statusItem.hide()}cancel(){let e=this.getSession(b.bufnr);if(e)return e.deactivate();b.nvim.call("coc#snippet#disable",[],!0),this.statusItem&&this.statusItem.hide()}get session(){let e=this.getSession(b.bufnr);return e&&e.isActive?e:null}isActived(e){let t=this.getSession(e);return t&&t.isActive}jumpable(){let{session:e}=this;if(!e)return!1;let t=e.placeholder;return!!(t&&!t.isFinalTabstop)}getSession(e){return this.sessionMap.get(e)}async resolveSnippet(e){let i=new Ho().parse(e,!0),n=new ed;return await i.resolveVariables(n),i}dispose(){this.cancel();for(let e of this.disposables)e.dispose()}},Ft=new w9;var Wze=j()("commands"),x9=class{constructor(e,t,i,n=!1){this.id=e;this.impl=t;this.thisArg=i;this.internal=n}execute(...e){let{impl:t,thisArg:i}=this;return t.apply(i,e||[])}dispose(){this.thisArg=null,this.impl=null}},D9=class{constructor(){this.commands=new Map;this.titles=new Map;this.onCommandList=[]}init(e,t){this.mru=b.createMru("commands"),this.register({id:"vscode.open",execute:async i=>{e.call("coc#util#open_url",i.toString(),!0)}},!0),this.register({id:"workbench.action.reloadWindow",execute:async()=>{await e.command("edit")}},!0),this.register({id:"editor.action.insertSnippet",execute:async i=>(e.call("coc#_cancel",[],!0),await Ft.insertSnippet(i.newText,!0,i.range))},!0),this.register({id:"editor.action.doCodeAction",execute:async i=>{await t.cocAction("doCodeAction",i)}},!0),this.register({id:"editor.action.triggerSuggest",execute:async()=>{await He(60),e.call("coc#start",[],!0)}},!0),this.register({id:"editor.action.triggerParameterHints",execute:async()=>{await He(60),await t.cocAction("showSignatureHelp")}},!0),this.register({id:"editor.action.addRanges",execute:async i=>{await t.cocAction("addRanges",i)}},!0),this.register({id:"editor.action.restart",execute:async()=>{await He(30),e.command("CocRestart",!0)}},!0),this.register({id:"editor.action.showReferences",execute:async(i,n,o)=>{await b.showLocations(o)}},!0),this.register({id:"editor.action.rename",execute:async(i,n)=>{await b.jumpTo(i,n),await t.cocAction("rename")}},!0),this.register({id:"editor.action.format",execute:async()=>{await t.cocAction("format")}},!0),this.register({id:"workspace.diffDocument",execute:async()=>{let i=await b.document;!i||await e.call("coc#util#diff_content",[i.getLines()])}}),this.register({id:"workspace.clearWatchman",execute:async()=>{(await C.runTerminalCommand("watchman watch-del-all")).success&&C.showMessage("Cleared watchman watching directories.")}},!1,"run watch-del-all for watchman to free up memory."),this.register({id:"workspace.workspaceFolders",execute:async()=>{let n=b.workspaceFolders.map(o=>$.parse(o.uri).fsPath);await C.echoLines(n)}},!1,"show opened workspaceFolders."),this.register({id:"workspace.renameCurrentFile",execute:async()=>{await b.renameCurrent()}},!1,"change current filename to a new name and reload it."),this.register({id:"extensions.toggleAutoUpdate",execute:async()=>{let i=b.getConfiguration("coc.preferences");i.get("extensionUpdateCheck","daily")=="never"?(i.update("extensionUpdateCheck","daily",!0),C.showMessage("Extension auto update enabled.","more")):(i.update("extensionUpdateCheck","never",!0),C.showMessage("Extension auto update disabled.","more"))}},!1,"toggle auto update of extensions."),this.register({id:"workspace.diagnosticRelated",execute:()=>St.jumpRelated()},!1,"jump to related locations of current diagnostic."),this.register({id:"workspace.showOutput",execute:async i=>{if(i)C.showOutputChannel(i);else{let n=b.channelNames;if(n.length==0)return;if(n.length==1)C.showOutputChannel(n[0]);else{let o=await C.showQuickpick(n);if(o==-1)return;let s=n[o];C.showOutputChannel(s)}}}},!1,"open output buffer to show output from languageservers or extensions."),this.register({id:"document.echoFiletype",execute:async()=>{let i=await e.call("bufnr","%"),n=b.getDocument(i);!n||await C.echoLines([n.filetype])}},!1,"echo the mapped filetype of the current buffer"),this.register({id:"document.renameCurrentWord",execute:async()=>{let i=await e.call("bufnr","%"),n=b.getDocument(i);if(!n)return;let o=await t.cocAction("getWordEdit");if(!o){C.showMessage("Invalid position","warning");return}let s=[],{changes:a,documentChanges:l}=o;if(a){let u=a[n.uri];u&&(s=u.map(c=>c.range))}else if(l)for(let u of l)Wv.TextDocumentEdit.is(u)&&u.textDocument.uri==n.uri&&(s=u.edits.map(c=>c.range));s.length&&await t.cocAction("addRanges",s)}},!1,"rename word under cursor in current buffer by use multiple cursors."),this.register({id:"document.jumpToNextSymbol",execute:async()=>{let i=await b.document;if(!i)return;let n=await t.cocAction("symbolRanges");if(!n)return;let{textDocument:o}=i,s=await C.getOffset();n.sort((a,l)=>a.start.line!=l.start.line?a.start.line-l.start.line:a.start.character-l.start.character);for(let a=0;a<=n.length-1;a++)if(o.offsetAt(n[a].start)>s){await C.moveTo(n[a].start);return}await C.moveTo(n[0].start)}},!1,"Jump to next symbol highlight position."),this.register({id:"document.jumpToPrevSymbol",execute:async()=>{let i=await b.document;if(!i)return;let n=await t.cocAction("symbolRanges");if(!n)return;let{textDocument:o}=i,s=await C.getOffset();n.sort((a,l)=>a.start.line!=l.start.line?a.start.line-l.start.line:a.start.character-l.start.character);for(let a=n.length-1;a>=0;a--)if(o.offsetAt(n[a].end)<s){await C.moveTo(n[a].start);return}await C.moveTo(n[n.length-1].start)}},!1,"Jump to previous symbol highlight position.")}get commandList(){let e=[];for(let t of this.commands.values())t.internal||e.push(t);return e}dispose(){for(let e of this.commands.values())e.dispose();this.commands.clear()}execute(e){let t=[e.command],i=e.arguments;i&&t.push(...i),this.executeCommand.apply(this,t)}register(e,t=!1,i){for(let n of Array.isArray(e.id)?e.id:[e.id])this.registerCommand(n,e.execute,e,t),i&&this.titles.set(n,i);return e}has(e){return this.commands.has(e)}unregister(e){let t=this.commands.get(e);!t||(t.dispose(),this.commands.delete(e))}registerCommand(e,t,i,n=!1){return e.startsWith("_")&&(n=!0),this.commands.set(e,new x9(e,t,i,n)),Wv.Disposable.create(()=>{this.commands.delete(e)})}executeCommand(e,...t){let i=this.commands.get(e);if(!i)throw new Error(`Command: ${e} not found`);return Promise.resolve(i.execute.apply(i,t))}async addRecent(e){await this.mru.add(e),await b.nvim.command('silent! call repeat#set("\\<Plug>(coc-command-repeat)", -1)')}async repeatCommand(){let t=(await this.mru.load())[0];t&&(await this.executeCommand(t),await b.nvim.command('silent! call repeat#set("\\<Plug>(coc-command-repeat)", -1)'))}},me=new D9;var $u=S(jn());var Nu=S(Bl()),qu=S(W());var td=S(jn());var Vze=j()("cursors-range"),UC=class{constructor(e,t,i,n,o){this.line=e;this.start=t;this.end=i;this.text=n;this.preCount=o;this.currStart=t,this.currEnd=i}add(e,t){let{text:i,preCount:n}=this,o=e==0?"":i.slice(0,e),s=i.slice(e);this.text=`${o}${t}${s}`,this.currStart=this.currStart+n*t.length,this.currEnd=this.currEnd+(n+1)*t.length}replace(e,t,i=""){let{text:n,preCount:o}=this,s=e==0?"":n.slice(0,e),a=n.slice(t);this.text=s+i+a;let l=t-e-i.length;this.currStart=this.currStart-o*l,this.currEnd=this.currEnd-(o+1)*l}get range(){return td.Range.create(this.line,this.start,this.line,this.end)}get currRange(){return td.Range.create(this.line,this.currStart,this.line,this.currEnd)}applyEdit(e){let{range:t,newText:i}=e,n=t.start.character,o=t.end.character;n==o?this.add(n-this.currStart,i):this.replace(n-this.currStart,o-this.currStart,i)}adjustFromEdit(e){let{range:t,newText:i}=e;if(Me(t.start,td.Position.create(this.line,this.currEnd))>0)return;let n=i.split(`
|
||
`),o=n.length-(t.end.line-t.start.line+1);if(this.line=this.line+o,t.end.line==this.line){let s=t.start.line==t.end.line?t.end.character-t.start.character:t.end.character;n.length>1&&t.start.line==t.end.line&&(s=s+t.start.character);let a=0;n.length>1?a=n[n.length-1].length:t.start.line==t.end.line?a=i.length:a=t.start.character+i.length;let l=a-s;for(let u of["start","end","currStart","currEnd"])this[u]+=l}}sync(){this.start=this.currStart,this.end=this.currEnd}get textEdit(){return{range:this.range,newText:this.text}}},WC=UC;var rd=S(W());function HC(r,e){let t=[];for(let i=e.start.line;i<=e.end.line;i++){let n=r.getline(i)||"",o=i==e.start.line?e.start.character:0,s=i==e.end.line?e.end.character:n.length;o!=s&&t.push(rd.Range.create(i,o,i,s))}return t}function S9(r,e){let{start:t,end:i}=e;t.line>i.line&&([t,i]=[i,t]);let n=t.character<i.character?t.character:i.character,o=t.character<i.character?i.character:t.character,s=[];for(let a=t.line;a<=i.line;a++){let l=r.getline(a);s.push(rd.Range.create(a,n,a,Math.min(l.length,o)))}return s}function zC(r,e){let{line:t,character:i}=e;return rd.Position.create(r.line+t,t==0?r.character+i:i)}function E9(r,e){if(r.newText.length!=e.newText.length)return!1;let{range:t}=r;return t.end.character-t.start.character==e.range.end.character-e.range.start.character}var a9e=j()("cursors-session"),GC=class{constructor(e,t,i){this.nvim=e;this.doc=t;this.config=i;this._onDidCancel=new qu.Emitter;this.onDidCancel=this._onDidCancel.event;this.disposables=[];this.ranges=[];this.activated=!0;this.changing=!1;this.changed=!1;this.doc.forceSync(),this.textDocument=this.doc.textDocument,this.buffer.setVar("coc_cursors_activated",1,!0);let{cancelKey:n,nextKey:o,previousKey:s}=this.config;this.disposables.push(b.registerLocalKeymap("n",n,()=>{this.cancel()},!0)),this.disposables.push(b.registerLocalKeymap("n",o,async()=>{if(!this.activated)return;let a=this.ranges.map(u=>u.currRange),l=await C.getCursorPosition();for(let u of a)if(Me(u.start,l)>0){await C.moveTo(u.start);return}a.length&&await C.moveTo(a[0].start)},!0)),this.disposables.push(b.registerLocalKeymap("n",s,async()=>{if(!this.activated)return;let a=this.ranges.map(u=>u.currRange);a.reverse();let l=await C.getCursorPosition();for(let u of a)if(Me(u.end,l)<0){await C.moveTo(u.start);return}a.length&&await C.moveTo(a[a.length-1].start)},!0)),this.doc.onDocumentChange(this.onChange,this,this.disposables)}async onChange(e){if(!this.activated||this.ranges.length==0||this.changing)return;let t=e.contentChanges[0],{text:i,range:n}=t,o=this.ranges.some(l=>ql(n,l.currRange)),s=this.ranges[0].currRange.start;if(i.endsWith(`
|
||
`)&&Me(s,n.end)==0&&(o=!1),!o){this.ranges.forEach(l=>{l.adjustFromEdit({range:n,newText:i})}),this.doHighlights(),this.textDocument=this.doc.textDocument;return}this.changed=!0;let a=this.getTextRange(n,i);a?await this.applySingleEdit(a,{range:n,newText:i}):(this.applyComposedEdit(e.original,{range:n,newText:i}),this.activated&&(this.ranges.forEach(l=>{l.sync()}),this.textDocument=this.doc.textDocument))}doHighlights(){let{nvim:e,buffer:t,ranges:i}=this;t.clearNamespace("cursors");let n=i.map(o=>o.currRange);t.highlightRanges("cursors","CocCursorRange",n),e.command("redraw",!0)}addRanges(e){let{nvim:t,doc:i}=this;if(this.changed)return C.showMessage("Can't add ranges after range change."),!1;this.ranges=this.ranges.filter(a=>{let{currRange:l}=a;return!e.some(u=>Mm(u,l))});let{textDocument:n}=i;for(let a of e){let{line:l}=a.start,u=new WC(l,a.start.character,a.end.character,n.getText(a),0);this.ranges.push(u)}this.ranges.sort((a,l)=>Me(a.range.start,l.range.start));let o=0,s=-1;for(let a of this.ranges){let{line:l}=a;l!=s&&(o=0),a.preCount=o,o=o+1,s=l}return t.pauseNotification(),this.doHighlights(),t.resumeNotification(!1,!0),!0}cancel(){if(!this.activated)return;let{nvim:e}=this;this.activated=!1;let{cancelKey:t,nextKey:i,previousKey:n}=this.config;e.pauseNotification(),this.buffer.clearNamespace("cursors"),this.buffer.setVar("coc_cursors_activated",0,!0),e.command("redraw",!0),e.resumeNotification(!1,!0),this._onDidCancel.fire()}dispose(){if(!!this.doc){this._onDidCancel.dispose();for(let e of this.disposables)e.dispose();this.ranges=[],this.doc=null,this.textDocument=null}}get buffer(){return this.nvim.createBuffer(this.doc.bufnr)}getTextRange(e,t){let{ranges:i}=this;if(t.indexOf(`
|
||
`)!==-1||e.start.line!=e.end.line)return null;i.sort((n,o)=>n.line!=o.line?n.line-o.line:n.currRange.start.character-o.currRange.start.character);for(let n=0;n<i.length;n++){let o=i[n];if(Ji(e,o.currRange))return o;if(o.line==e.start.line&&t.length&&e.start.character==o.currRange.end.character){let s=i[n+1];return s&&Wt(s.currRange.start,e)?null:o}}return null}adjustRanges(e,t,i){let{ranges:n}=this;if(t.start.character==t.end.character)if(e.currRange.end.character==t.start.character)n.forEach(s=>{s.add(s.text.length,i)});else{let s=t.start.character-e.currRange.start.character;n.forEach(a=>{a.add(Math.min(a.text.length,s),i)})}else{let o=t.end.character-t.start.character;if(e.currRange.end.character==t.end.character)if(e.currRange.start.character==t.start.character)if(i.includes(e.text)){let a=i.indexOf(e.text),l=a==0?"":i.slice(0,a),u=i.slice(a+e.text.length);l&&n.forEach(c=>c.add(0,l)),u&&n.forEach(c=>c.add(c.text.length,u))}else if(e.text.includes(i)){let a=e.text.indexOf(i),l=e.text.length-(a+i.length);a!=0&&n.forEach(u=>u.replace(0,a)),l>0&&n.forEach(u=>u.replace(u.text.length-l,u.text.length))}else this.cancel();else n.forEach(a=>{let l=a.text.length;a.replace(Math.max(0,l-o),l,i)});else{let a=t.start.character-e.currRange.start.character;n.forEach(l=>{let u=l.text.length;l.replace(a,Math.min(a+o,u),i)})}}}addRange(e,t){if(this.changed){C.showMessage("Can't add range after range change.");return}let{ranges:i}=this,n=i.findIndex(o=>ql(o.range,e));if(n!==-1){i.splice(n,1);for(let o of i)o.line==e.start.line&&o.start>e.start.character&&(o.preCount=o.preCount-1)}else{let o=0,s=0,{line:a}=e.start;for(let u of i){if(u.line>a||u.line==a&&u.start>e.end.character)break;u.line==a&&o++,s++}let l=new WC(a,e.start.character,e.end.character,t,o);i.splice(s,0,l);for(let u of i)u.line==e.start.line&&u.start>e.start.character&&(u.preCount=u.preCount+1)}this.ranges.length==0?this.cancel():this.doHighlights()}async applySingleEdit(e,t){let{range:i,newText:n}=t,{doc:o}=this;if(this.adjustRanges(e,i,n),this.ranges.length==1){this.doHighlights();return}let s=this.ranges.map(d=>d.textEdit),l=kt.applyEdits(this.textDocument,s).split(`
|
||
`),u=new Set,c=[];for(let d of this.ranges)u.has(d.line)||(u.add(d.line),c.push([d.line,l[d.line]]));let{nvim:f}=this;this.changing=!0,await o.changeLines(c),this.changing=!1,this.activated&&(this.ranges.forEach(d=>{d.sync()}),this.textDocument=this.doc.textDocument),f.pauseNotification();let{cursor:p}=A;if(e.preCount>0&&p.bufnr==o.bufnr&&e.line+1==p.lnum){let d=e.preCount*(n.length-(i.end.character-i.start.character));f.call("cursor",[p.lnum,p.col+d],!0)}this.doHighlights(),f.resumeNotification(!1,!0)}applyComposedEdit(e,t){let{range:i,newText:n}=t,{ranges:o}=this,s=kt.create("file:///1","",0,e),a=[],l=Nu.default(e,n),u=0;for(let c=0;c<l.length;c++){let f=l[c],p=zC(i.start,s.positionAt(u));if(f[0]==Nu.default.EQUAL)u=u+f[1].length;else if(f[0]==Nu.default.DELETE){let d=zC(i.start,s.positionAt(u+f[1].length));l[c+1]&&l[c+1][0]==Nu.default.INSERT?(a.push({range:qu.Range.create(p,d),newText:l[c+1][1]}),c=c+1):a.push({range:qu.Range.create(p,d),newText:""}),u=u+f[1].length}else f[0]==Nu.default.INSERT&&a.push({range:qu.Range.create(p,p),newText:f[1]})}if(a.some(c=>c.newText.includes(`
|
||
`)||c.range.start.line!=c.range.end.line)){this.cancel();return}if(a.length==o.length){let c;for(let f=0;f<a.length;f++){let p=a[f],d=this.ranges[f];if(!ql(d.currRange,p.range)){this.cancel();return}if(c&&!E9(p,c)){this.cancel();return}d.applyEdit(p),c=p}}else if(a.length==o.length*2)for(let c=0;c<a.length-1;c=c+2){let f=a[c],p=a[c+1];if(f.newText.length==0&&p.newText.length==0){let d=this.ranges[c/2];if(Me(d.currRange.end,p.range.end)!=0){this.cancel();return}let h=f.range.start.character-d.currRange.start.character;d.replace(h,f.range.end.character-f.range.start.character,"");let m=p.range.end.character-p.range.start.character,y=d.text.length;d.replace(y-m,y)}else if(Gn(f.range)&&Gn(p.range)){let d=this.ranges[c/2];if(Me(d.currRange.end,p.range.start)!=0){this.cancel();return}let h=f.range.start.character-d.currRange.start.character;d.add(h,f.newText);let m=d.text.length;d.add(m,p.newText)}else{this.cancel();return}}else{this.cancel();return}this.doHighlights()}},C9=GC;var m9e=j()("cursors"),VC=class{constructor(e){this.nvim=e;this.sessionsMap=new Map;this.disposables=[];this.loadConfig(),b.onDidChangeConfiguration(t=>{t.affectsConfiguration("cursors")&&this.loadConfig()},null,this.disposables),A.on("BufUnload",t=>{let i=this.getSession(t);!i||(i.dispose(),this.sessionsMap.delete(t))},null,this.disposables)}loadConfig(){let e=b.getConfiguration("cursors");this.config={nextKey:e.get("nextKey","<C-n>"),previousKey:e.get("previousKey","<C-p>"),cancelKey:e.get("cancelKey","<esc>")}}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 n=b.getDocument(e);if(!n||!n.attached){C.showMessage(`buffer ${e} not attached.`);return}let{nvim:o}=this,s=this.createSession(n),a=await C.getCursorPosition(),l;if(t=="operator"){await o.command(`normal! ${i=="line"?"'[":"`["}`);let u=await C.getCursorPosition();await o.command(`normal! ${i=="line"?"']":"`]"}`);let c=await C.getCursorPosition();await C.moveTo(a);let f=Me(u,c);if(f==0)return;f>=0&&([u,c]=[c,u]);let p=n.getline(c.line);c.character<p.length&&(c.character=c.character+1);let d=HC(n,$u.Range.create(u,c));for(let h of d){let m=n.textDocument.getText(h);s.addRange(h,m)}}else if(t=="word"){if(l=n.getWordRangeAtPosition(a),!l){let f=n.getline(a.line);a.character==f.length?l=$u.Range.create(a.line,Math.max(0,f.length-1),a.line,f.length):l=$u.Range.create(a.line,a.character,a.line,a.character+1)}let c=n.getline(a.line).slice(l.start.character,l.end.character);s.addRange(l,c)}else if(t=="position"){let u=n.getline(a.line);a.character>=u.length?l=$u.Range.create(a.line,u.length-1,a.line,u.length):l=$u.Range.create(a.line,a.character,a.line,a.character+1),s.addRange(l,u.slice(l.start.character,l.end.character))}else if(t=="range"){await o.call("eval",'feedkeys("\\<esc>", "in")');let u=await b.getSelectedRange(i,n);if(!u||Me(u.start,u.end)==0)return;let c=i==""?S9(n,u):HC(n,u);for(let f of c){let p=n.textDocument.getText(f);s.addRange(f,p)}}else{C.showMessage(`${t} not supported`,"error");return}(t=="word"||t=="position")&&await o.command(`silent! call repeat#set("\\<Plug>(coc-cursors-${t})", -1)`)}createSession(e){let t=this.getSession(e.bufnr);return t||(t=new C9(this.nvim,e,this.config),this.sessionsMap.set(e.bufnr,t),t.onDidCancel(()=>{t.dispose(),this.sessionsMap.delete(e.bufnr)}),t)}async addRanges(e){let{nvim:t}=this,i=await t.call("bufnr",["%"]),n=b.getDocument(i);return!n||!n.attached?(C.showMessage("Document not attached","error"),!1):this.createSession(n).addRanges(e)}reset(){for(let e of this.sessionsMap.values())e.cancel();this.sessionsMap.clear()}dispose(){for(let e of this.sessionsMap.values())e.dispose();this.sessionsMap.clear();for(let e of this.disposables)e.dispose()}},_9=VC;var Ue=S(W());var KC=S(Gr()),JC=S(W());var ube=j()("codelens-buffer"),YC=class{constructor(e,t,i){this.nvim=e;this.bufnr=t;this.config=i;this._disposed=!1;this.fetchCodelenses=KC.default(()=>{this._fetchCodeLenses().logError()},global.hasOwnProperty("__TEST__")?10:100),this.resolveCodeLens=KC.default(()=>{this._resolveCodeLenses().logError()},global.hasOwnProperty("__TEST__")?10:100),this.forceFetch().logError()}async forceFetch(){this.fetchCodelenses.clear(),await this._fetchCodeLenses()}get textDocument(){var e;return(e=b.getDocument(this.bufnr))==null?void 0:e.textDocument}get hasProvider(){let{textDocument:e}=this;return e?U.hasProvider("codeLens",e):!1}async _fetchCodeLenses(){if(!this.config.enabled||!this.hasProvider)return;let{textDocument:e}=this,t=e.version;if(this.codeLenses&&this.codeLenses.codeLenses.length>0&&t==this.codeLenses.version){await this._resolveCodeLenses(!0)||this.clear();return}this.cancel();let n=(this.tokenSource=new JC.CancellationTokenSource).token,o=await U.getCodeLens(e,n);this.tokenSource=void 0,!n.isCancellationRequested&&(this.resolveCodeLens.clear(),Array.isArray(o)&&(this.codeLenses={version:t,codeLenses:o},await this._resolveCodeLenses(!0)||this.clear()))}async _resolveCodeLenses(e=!1){if(!this.config.enabled||!this.codeLenses||this._disposed)return!1;let{codeLenses:t,version:i}=this.codeLenses,[n,o,s]=await this.nvim.eval("[bufnr('%'),line('w0'),line('w$')]");if(!this.textDocument||this.textDocument.version!=i||n!=this.bufnr||(t=t.filter(f=>{let p=f.range.start.line+1;return p>=o&&p<=s}),e||(t=t.filter(f=>f.command==null)),!t.length))return!1;let a=new JC.CancellationTokenSource,l=a.token,u=setTimeout(()=>{a.cancel()},1e3);if(await Promise.all(t.map(f=>U.resolveCodeLens(f,l))),clearTimeout(u),this.tokenSource=void 0,l.isCancellationRequested||this._disposed)return!1;this.srcId=await this.nvim.createNamespace("coc-codelens"),this.nvim.pauseNotification(),e&&this.clear(),this.setVirtualText(t);let c=await this.nvim.resumeNotification();return Array.isArray(c)&&c[1]!=null?(ube.error("Error on resolve codeLens",c[1][2]),!1):!0}setVirtualText(e){if(e.length==0)return;let t=new Map;for(let i of e){let{range:n,command:o}=i;if(!o)continue;let{line:s}=n.start;t.has(s)?t.get(s).push(i):t.set(s,[i])}for(let i of t.keys()){let o=t.get(i).map(l=>l.command);o=o.filter(l=>l&&l.title);let s=[],a=o.length;for(let l=0;l<a;l++){let u=o[l];s.push([u.title.replace(/(\r\n|\r|\n) */g," "),"CocCodeLens"]),l!=a-1&&s.push([this.config.subseparator,"CocCodeLens"])}s.unshift([`${this.config.separator} `,"CocCodeLens"]),this.nvim.call("nvim_buf_set_virtual_text",[this.bufnr,this.srcId,i,s,{}],!0)}}clear(){if(!this.srcId)return;this.nvim.createBuffer(this.bufnr).clearNamespace(this.srcId)}getCodelenses(){var e;return(e=this.codeLenses)==null?void 0:e.codeLenses}async doAction(e){var s;let{codeLenses:t}=(s=this.codeLenses)!=null?s:{};if(!t||t.length==0){C.showMessage("No codeLenses available","warning");return}let i=new Map;for(let a of t){let{range:l,command:u}=a;if(!u)continue;let{line:c}=l.start;i.has(c)?i.get(c).push(a):i.set(c,[a])}let n=null;for(let a=e;a>=0;a--)if(i.has(a)){n=i.get(a);break}if(!n){C.showMessage("No codeLenses available","warning");return}let o=n.map(a=>a.command);if(o=o.filter(a=>a.command!=null&&a.command!=""),o.length==0)C.showMessage("CodeLenses command not found","warning");else if(o.length==1)me.execute(o[0]);else{let a=await C.showMenuPicker(o.map(l=>l.title));if(a==-1)return;me.execute(o[a])}}cancel(){this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource.dispose(),this.tokenSource=null)}onChange(){!this.config.enabled||(this.cancel(),this.resolveCodeLens.clear())}dispose(){this._disposed=!0,this.codeLenses=void 0,this.cancel(),this.fetchCodelenses.clear(),this.resolveCodeLens.clear()}},P9=YC;var T9e=j()("codelens"),XC=class{constructor(e){this.nvim=e;this.disposables=[];this.setConfiguration(),b.onDidChangeConfiguration(i=>{this.setConfiguration(i)},null,this.disposables),this.buffers=b.registerBufferSync(i=>{if(i.buftype=="")return new P9(e,i.bufnr,this.config)}),A.on("ready",()=>{this.checkProvider()},null,this.disposables),A.on("CursorMoved",i=>{let n=this.buffers.getItem(i);n&&n.resolveCodeLens()},null,this.disposables);let t=async i=>{let n=this.buffers.getItem(i);n&&await n.forceFetch()};A.on("CursorHold",t,this,this.disposables)}checkProvider(){for(let e of this.buffers.items)e.hasProvider&&e.fetchCodelenses()}setConfiguration(e){if(e&&!e.affectsConfiguration("codeLens"))return;let t=b.getConfiguration("codeLens"),i=this.nvim.hasFunction("nvim_buf_set_virtual_text")&&t.get("enable",!1);if(e&&i!=this.config.enabled)for(let n of this.buffers.items)i?n.forceFetch().logError():n.clear();this.config=Object.assign(this.config||{},{enabled:i,separator:t.get("separator","\u2023"),subseparator:t.get("subseparator"," ")})}async doAction(){let{nvim:e}=this,t=await e.call("bufnr","%"),i=await e.call("line",".")-1,n=this.buffers.getItem(t);await(n==null?void 0:n.doAction(i))}dispose(){this.buffers.dispose(),z(this.disposables)}},T9=XC;var JK=S(W());var Sy=S(W());var BK=S($K());BK.default.shim();function jK(r,e){if(!e.length)return null;let t=e.length-1,i=e[t];if(i.text==r)return i;for(;t>=0;){let n=e[t];if(n.text==r)return n;t--}return null}function yP(r,e){let t=r.selectionRange,i=e.selectionRange;return t.start.line<i.start.line?-1:t.start.line>i.start.line?1:t.start.character-i.start.character}function bP(r,e,t){let{name:i,selectionRange:n,kind:o,children:s,range:a}=e,{start:l}=n;if(r.push({col:l.character+1,lnum:l.line+1,text:i,level:t,kind:_n(o),range:a,selectionRange:n}),s&&s.length){s.sort(yP);for(let u of s)bP(r,u,t+1)}}function UK(r,e){let t=r.location.range.start,i=e.location.range.start,n=t.line-i.line;return n==0?t.character-i.character:n}function K0e(r){return r&&!r.hasOwnProperty("location")}function wP(r){return K0e(r[0])}function WK(r){return!!(Sy.MarkupContent.is(r)&&r.kind==Sy.MarkupKind.Markdown)}function Vu(r,e,t,i=!1){let n=e.trim();!n.length||(i&&t!=="markdown"&&(n="``` "+t+`
|
||
`+n+"\n```"),r.push({content:n,filetype:t}))}async function mt(r){let{changedtick:e}=r;await r.patchChange(),e!=r.changedtick&&await He(50)}function yd(r){let e=vd(r);return`${xP(e.red.toString(16))}${xP(e.green.toString(16))}${xP(e.blue.toString(16))}`}function xP(r){return r.length==1?`0${r}`:r}function vd(r){let{red:e,green:t,blue:i}=r;return{red:Math.round(e*255),green:Math.round(t*255),blue:Math.round(i*255)}}function HK(r){let e=[r.red,r.green,r.blue],t=[];for(let n=0;n<e.length;n++){let o=e[n];t[n]=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4)}return .2126*t[0]+.7152*t[1]+.0722*t[2]<=.5}var zK=S(Gr()),GK=S(W());var VK=j()("colors-buffer"),DP=class{constructor(e,t,i,n){this.nvim=e;this.bufnr=t;this.enabled=i;this.usedColors=n;this._colors=[];this.highlight=zK.default(()=>{this.doHighlight().catch(o=>{VK.error("Error on color highlight:",o.stack)})},global.hasOwnProperty("__TEST__")?10:500)}onChange(){this.cancel(),this.highlight()}get buffer(){return this.nvim.createBuffer(this.bufnr)}get colors(){return this._colors}hasColor(){return this._colors.length>0}setState(e){this.enabled=e,e?this.highlight():this.clearHighlight()}async doHighlight(){let e=b.getDocument(this.bufnr);if(!(!e||!this.enabled))try{this.tokenSource=new GK.CancellationTokenSource;let{token:t}=this.tokenSource;if(this.version&&e.version==this.version)return;let{version:i}=e,n;if(n=await U.provideDocumentColors(e.textDocument,t),n=n||[],t.isCancellationRequested)return;this.version=i,await this.addHighlight(n,t)}catch(t){VK.error("Error on highlight:",t)}}async addHighlight(e,t){if(e=e||[],Ne(this._colors,e))return;let{nvim:i}=this;this._colors=e;let n=oj(e,100);i.pauseNotification(),this.buffer.clearNamespace("color"),this.defineColors(e),i.resumeNotification(!1,!0);for(let o of n){if(t.isCancellationRequested){this._colors=[];return}i.pauseNotification();let s=this.getColorRanges(o);for(let a of s)this.highlightColor(a.ranges,a.color);i.resumeNotification(!1,!0)}b.isVim&&this.nvim.command("redraw",!0)}highlightColor(e,t){let{red:i,green:n,blue:o}=vd(t),s=`BG${yd(t)}`;this.buffer.highlightRanges("color",s,e)}defineColors(e){for(let t of e){let i=yd(t.color);this.usedColors.has(i)||(this.nvim.command(`hi BG${i} guibg=#${i} guifg=#${HK(t.color)?"ffffff":"000000"}`,!0),this.usedColors.add(i))}}getColorRanges(e){let t=[];for(let i of e){let{color:n,range:o}=i,s=t.findIndex(a=>Ne(vd(a.color),vd(n)));s==-1?t.push({color:n,ranges:[o]}):t[s].ranges.push(o)}return t}clearHighlight(){this.highlight.clear(),this._colors=[],this.version=null,this.buffer.clearNamespace("color")}hasColorAtPostion(e){let{colors:t}=this;return t.some(i=>Wt(e,i.range)==0)}cancel(){this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource=null)}dispose(){this.highlight.clear(),this.cancel()}},KK=DP;var AGe=j()("colors"),SP=class{constructor(e){this.nvim=e;this._enabled=!0;this.disposables=[];let t=b.getConfiguration("coc.preferences");this._enabled=t.get("colorSupport",!0),b.isVim&&!b.env.textprop&&(this._enabled=!1);let i=new Set;this.highlighters=b.registerBufferSync(n=>{let o=new KK(this.nvim,n.bufnr,this._enabled,i);return o.highlight(),o}),ge.onDidActiveExtension(()=>{this.highlightAll()},null,this.disposables),b.onDidChangeConfiguration(async n=>{if(!(b.isVim&&!b.env.textprop)&&n.affectsConfiguration("coc.preferences.colorSupport")){let s=b.getConfiguration("coc.preferences").get("colorSupport",!0);if(s!=this._enabled){this._enabled=s;for(let a of this.highlighters.items)a.setState(s)}}},null,this.disposables)}async pickPresentation(){let e=await this.currentColorInfomation();if(!e)return C.showMessage("Color not found at current position","warning");let t=await b.document,i=new JK.CancellationTokenSource,n=await U.provideColorPresentations(e,t.textDocument,i.token);if(!n||n.length==0)return;let o=await C.showMenuPicker(n.map(c=>c.label),"choose color:");if(o==-1)return;let s=n[o],{textEdit:a,additionalTextEdits:l,label:u}=s;a||(a={range:e.range,newText:u}),await t.applyEdits([a]),l&&await t.applyEdits(l)}async pickColor(){let e=await this.currentColorInfomation();if(!e)return C.showMessage("Color not found at current position","warning");let{color:t}=e,i=[(t.red*255).toFixed(0),(t.green*255).toFixed(0),(t.blue*255).toFixed(0)],n=await this.nvim.call("coc#util#pick_color",[i]);if(n===!1)return;if(!n||n.length!=3){C.showMessage("Failed to get color","warning");return}let o=yd({red:n[0]/65535,green:n[1]/65535,blue:n[2]/65535,alpha:1});await(await b.document).applyEdits([{range:e.range,newText:`#${o}`}])}get enabled(){return this._enabled}clearHighlight(e){let t=this.highlighters.getItem(e);!t||t.clearHighlight()}hasColor(e){let t=this.highlighters.getItem(e);return t?t.hasColor():!1}hasColorAtPostion(e,t){let i=this.highlighters.getItem(e);return i?i.hasColorAtPostion(t):!1}highlightAll(){for(let e of this.highlighters.items)e.highlight()}async doHighlight(e){let t=this.highlighters.getItem(e);!t||await t.doHighlight()}async currentColorInfomation(){let e=await this.nvim.call("bufnr","%"),t=this.highlighters.getItem(e);if(!t)return null;let i=await C.getCursorPosition();for(let n of t.colors){let{range:o}=n,{start:s,end:a}=o;if(i.line==s.line&&i.character>=s.character&&i.character<=a.character)return n}return null}dispose(){this.highlighters.dispose(),z(this.disposables)}},YK=SP;var sn=S(W());var EP=j()("handler-format"),XK=new Map([["<",">"],[">","<"],["{","}"],["[","]"],["(",")"]]),CP=class{constructor(e){this.nvim=e;this.disposables=[];this.requestStatusItem=C.createStatusBarItem(0,{progress:!0}),this.loadPreferences(),b.onDidChangeConfiguration(this.loadPreferences,this,this.disposables),b.onWillSaveTextDocument(s=>{let{languageId:a}=s.document,l=this.preferences.formatOnSaveFiletypes;if(l.includes(a)||l.some(u=>u==="*")){let u=async()=>{if(!U.hasFormatProvider(s.document)){EP.warn(`Format provider not found for ${s.document.uri}`);return}let c=await b.getFormatOptions(s.document.uri),f=new sn.CancellationTokenSource,p=setTimeout(()=>{f.cancel()},1e3),d=await U.provideDocumentFormattingEdits(s.document,c,f.token);return clearTimeout(p),d};s.waitUntil(u())}},null,this.disposables),A.on(["CursorMoved","CursorMovedI","InsertEnter","TextChangedI","TextChangedP","TextChanged"],()=>{this.requestTokenSource&&(this.requestTokenSource.cancel(),this.requestTokenSource=null)},null,this.disposables),A.on("Enter",async s=>{let{bracketEnterImprove:a}=this.preferences;if(await this.tryFormatOnType(`
|
||
`,s),a){let l=await e.call("line",".")-1,u=b.getDocument(s);if(!u)return;await u.patchChange();let c=u.getline(l-1),f=u.getline(l),p=c[c.length-1];if(p&&XK.has(p)){let d=f.trim()[0];if(d&&XK.get(p)==d){let h=[],m=await b.getFormatOptions(u.uri),y=m.insertSpaces?" ".repeat(m.tabSize):" ",v=f.match(/^\s*/)[0],x=sn.Position.create(l-1,c.length);if(u.filetype=="vim"){let w=`
|
||
`+v+y;h.push({range:sn.Range.create(l,v.length,l,v.length),newText:" \\ "}),w=w+"\\ ",h.push({range:sn.Range.create(x,x),newText:w}),await u.applyEdits(h),await C.moveTo(sn.Position.create(l,w.length-1))}else await e.eval(`feedkeys("\\<Esc>O", 'in')`)}}}},null,this.disposables);let t,i;A.on("InsertCharPre",async()=>{i=Date.now()},null,this.disposables),A.on("TextChangedI",async(s,a)=>{if(t=Date.now(),!i||t-i>300)return;i=null;let l=b.getDocument(s);if(!l)return;let u=a.pre[a.pre.length-1];!u||!U.hasProvider("onTypeEdit",l.textDocument)||await this.tryFormatOnType(u,s)},null,this.disposables);let n,o;A.on("InsertEnter",s=>{n=s,o=Date.now()}),A.on("TextChangedI",async(s,a)=>{!this.preferences.formatOnType&&!/^\s*$/.test(a.pre)||n!=s||!o||Date.now()-o>30||await this.tryFormatOnType(`
|
||
`,s,!0)})}loadPreferences(e){if(!e||e.affectsConfiguration("coc.preferences")){let t=b.getConfiguration("coc.preferences");this.preferences={formatOnType:t.get("formatOnType",!1),formatOnSaveFiletypes:t.get("formatOnSaveFiletypes",[]),formatOnTypeFiletypes:t.get("formatOnTypeFiletypes",[]),bracketEnterImprove:t.get("bracketEnterImprove",!0)}}}async withRequestToken(e,t){this.requestTokenSource&&(this.requestTokenSource.cancel(),this.requestTokenSource.dispose());let i=this.requestStatusItem;this.requestTokenSource=new sn.CancellationTokenSource;let{token:n}=this.requestTokenSource;n.onCancellationRequested(()=>{i.text=`${e} request canceled`,i.isProgress=!1,i.hide()}),i.isProgress=!0,i.text=`requesting ${e}`,i.show();let o;try{o=await Promise.resolve(t(n))}catch(s){C.showMessage(s.message,"error"),EP.error(`Error on ${e}`,s)}return this.requestTokenSource&&(this.requestTokenSource.dispose(),this.requestTokenSource=void 0),n.isCancellationRequested?null:(i.hide(),o==null&&EP.warn(`${e} provider not found!`),o)}async tryFormatOnType(e,t,i=!1){if(!e||IB(e)||!this.preferences.formatOnType||Ft.getSession(t)!=null)return;let n=b.getDocument(t);if(!n||!n.attached||n.isCommandLine)return;let o=this.preferences.formatOnTypeFiletypes;if(o.length&&!o.includes(n.filetype)||!U.hasOnTypeProvider(e,n.textDocument))return;let s,a=await this.withRequestToken("onTypeFormat ",async c=>{s=await C.getCursorPosition();let f=n.getline(s.line-1);if(i&&/^\s*$/.test(f))return;let p=i?{line:s.line-1,character:f.length}:s;return await mt(n),await U.provideDocumentOnTypeEdits(e,n.textDocument,p,c)});if(!a||!a.length)return;let l=$l(s,a);await n.applyEdits(a);let u=l?sn.Position.create(s.line+l.line,s.character+l.character):null;u&&!i&&await C.moveTo(u)}async documentFormat(e){await mt(e);let t=await b.getFormatOptions(e.uri),i=await this.withRequestToken("format",n=>U.provideDocumentFormattingEdits(e.textDocument,t,n));return i&&i.length>0?(await e.applyEdits(i),!0):!1}async documentRangeFormat(e,t){await mt(e);let i;if(t){if(i=await b.getSelectedRange(t,e),!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=sn.Range.create(s-1,0,s-1+a,0)}let n=await b.getFormatOptions(e.uri),o=await this.withRequestToken("format",s=>U.provideDocumentRangeFormattingEdits(e.textDocument,i,n,s));return o&&o.length>0?(await e.applyEdits(o),0):-1}dispose(){z(this.disposables)}},ZK=CP;var bd=S(W());var J0e=j()("documentHighlight"),_P=class{constructor(e){this.nvim=e;this.disposables=[];this.highlights=new Map;A.on(["TextChanged","TextChangedI","CursorMoved","CursorMovedI"],()=>{this.cancel(),this.clearHighlights()},null,this.disposables)}clearHighlights(){if(this.highlights.size==0)return;let{nvim:e}=b;for(let t of this.highlights.keys())e.createWindow(t).clearMatchGroup("^CocHighlight");this.highlights.clear()}async highlight(){let{nvim:e}=this;this.cancel();let[t,i,n]=await e.eval("[bufnr('%'),win_getid(),get(b:,'coc_cursors_activated',0)]"),o=b.getDocument(t);if(!o||!o.attached||!U.hasProvider("documentHighlight",o.textDocument)||n)return;let s=await C.getCursorPosition(),a=await this.getHighlights(o,s);if(!a)return;let l={};for(let f of a){if(!f.range)continue;let p=f.kind==bd.DocumentHighlightKind.Text?"CocHighlightText":f.kind==bd.DocumentHighlightKind.Read?"CocHighlightRead":"CocHighlightWrite";l[p]=l[p]||[],l[p].push(f.range)}let u=e.createWindow(i);e.pauseNotification(),u.clearMatchGroup("^CocHighlight");for(let f of Object.keys(l))u.highlightRanges(f,l[f],-1,!0);b.isVim&&e.command("redraw",!0);let c=this.nvim.resumeNotification();Array.isArray(c)&&c[1]!=null?J0e.error("Error on highlight",c[1][2]):this.highlights.set(i,a)}hasHighlights(e){return this.highlights.get(e)!=null}async getHighlights(e,t){if(!e||!e.attached||e.isCommandLine)return null;let n=e.getline(t.line)[t.character];if(!n||!e.isWord(n))return null;try{this.tokenSource=new bd.CancellationTokenSource,e.forceSync();let{token:o}=this.tokenSource,s=await U.getDocumentHighLight(e.textDocument,t,o);return this.tokenSource=null,o.isCancellationRequested?null:s}catch(o){return null}}cancel(){this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource.dispose(),this.tokenSource=null)}dispose(){this.highlights.clear(),this.cancel(),z(this.disposables)}},QK=_P;var Yu=S(W());var eJ=S(require("child_process")),tJ=S(require("events")),rJ=S(require("path")),iJ=S(require("readline")),nJ=S(jn()),oJ=S(El());var Y0e=j()("handler-search"),X0e=["--color","ansi","--colors","path:fg:black","--colors","line:fg:green","--colors","match:fg:red","--no-messages","--heading","-n"],Z0e="",sJ=class extends tJ.EventEmitter{start(e,t,i){this.process=eJ.spawn(e,t,{cwd:i}),this.process.on("error",c=>{this.emit("error",c.message)});let n=iJ.default.createInterface(this.process.stdout),o,s,a=[],l=[],u=!0;n.on("line",c=>{if(c.includes(Z0e)){let f=Nf(c);if(f[0].foreground=="black"){s={filepath:rJ.default.join(i,f[0].text),ranges:[]};return}if(f[0].foreground=="green"){let d=parseInt(f[0].text,10)-1,h=f[0].text.length+1;u&&(o=d,u=!1);let m="";for(let v of f){if(v.foreground=="red"){let x=d-o,w=m.length-h;l.push(nJ.Range.create(x,w,x,w+v.text.length))}m+=v.text}let y=m.slice(h);a.push(y)}}else{let f=c.trim().length==0;if(s&&(f||c.trim()=="--")){let p={lines:a,highlights:l,start:o,end:o+a.length};s.ranges.push(p)}f&&(this.emit("item",s),s=null),a=[],l=[],u=!0}}),n.on("close",()=>{if(s){if(a.length){let c={lines:a,highlights:l,start:o,end:o+a.length};s.ranges.push(c)}this.emit("item",s)}a=l=s=null,this.emit("end")})}dispose(){this.process&&this.process.kill()}},PP=class{constructor(e,t="rg"){this.nvim=e;this.cmd=t}run(e,t,i){let{nvim:n,cmd:o}=this,{afterContext:s,beforeContext:a}=i.config,l=["-A",s.toString(),"-B",a.toString()].concat(X0e,e);l.push("--","./");try{o=oJ.default.sync(o)}catch(m){return C.showMessage(`Please install ripgrep and make sure ${this.cmd} is in your $PATH`,"error"),Promise.reject(m)}this.task=new sJ,this.task.start(o,l,t);let u=new ar,c=0,f=0,p=Date.now(),d=[],h=async()=>{if(d.length==0)return;let m=d.slice();d=[];let y=await u.acquire();try{await i.addFileItems(m)}catch(v){Y0e.error(v)}y()};return new Promise((m,y)=>{let v=setInterval(h,300);this.task.on("item",async x=>{c++,f=f+x.ranges.reduce((w,E)=>w+E.highlights.length,0),d.push(x)}),this.task.on("error",x=>{clearInterval(v),C.showMessage(`Error on command "${o}": ${x}`,"error"),this.task=null,y(new Error(x))}),this.task.on("end",async()=>{clearInterval(v);try{await h(),(await u.acquire())(),this.task.removeAllListeners(),this.task=null;let w=i.buffer;if(w){if(n.pauseNotification(),c==0)w.setLines(["No match found"],{start:1,end:2,strictIndexing:!1},!0),w.addHighlight({line:1,srcId:-1,colEnd:-1,colStart:0,hlGroup:"Error"}).logError(),w.setOption("modified",!1,!0);else{let E=new ss;E.addText("Files","MoreMsg"),E.addText(": "),E.addText(`${c} `,"Number"),E.addText("Matches","MoreMsg"),E.addText(": "),E.addText(`${f} `,"Number"),E.addText("Duration","MoreMsg"),E.addText(": "),E.addText(`${Date.now()-p}ms`,"Number"),E.render(w,1,2)}w.setOption("modified",!1,!0),await n.resumeNotification(!1,!0)}}catch(x){y(x);return}m()})})}},aJ=PP;var Ku=S(Bl()),wd=S(require("path")),Ey=S(W());var lJ=j()("handler-refactorBuffer"),Ju="\u3000",TP=class{constructor(e,t,i,n,o){this.bufnr=e;this.srcId=t;this.nvim=i;this.config=n;this.opts=o;this.mutex=new ar;this._disposed=!1;this.disposables=[];this._fileItems=[];this.matchIds=new Set;this.changing=!1;this.disposables.push(b.registerLocalKeymap("n","<CR>",this.splitOpen.bind(this),!0)),b.onDidChangeTextDocument(this.onDocumentChange,this,this.disposables)}get fileItems(){return this._fileItems}onChange(e){if(this.changing)return;let t=this.document,{nvim:i,_fileItems:n}=this;if(!n.length)return;let o=e.contentChanges[0];if(!("range"in o))return;let{original:s}=e;if(o.range.end.line<2)return;t.buffer.setOption("modified",!0,!0);let{range:a,text:l}=o,c=l.split(`
|
||
`).length-(a.end.line-a.start.line)-1;if(c==0)return;let f=[];if(l.includes("\u3000")){let d=a.start.line,h=Ku.default(s,l),m=0,y=kt.create("file:///1","",0,s);for(let v=0;v<h.length;v++){let x=h[v],w=y.positionAt(m);if(x[0]==Ku.default.EQUAL)m=m+x[1].length;else if(x[0]==Ku.default.DELETE){let E=y.positionAt(m+x[1].length);if(h[v+1]&&h[v+1][0]==Ku.default.INSERT){let P=h[v+1][1].split(`
|
||
`).length-(E.line-w.line)-1;P!=0&&f.push({delta:P,lnum:w.line+d}),v=v+1}else{let P=-(E.line-w.line);P!=0&&f.push({delta:P,lnum:w.line+d})}m=m+x[1].length}else if(x[0]==Ku.default.INSERT){let E=x[1].split(`
|
||
`).length-1;E!=0&&f.push({delta:E,lnum:w.line+d})}}}else f=[{delta:c,lnum:a.start.line}];let p=!1;for(let d of n)for(let h of d.ranges){let m=f.filter(y=>y.lnum<h.lnum-1);if(m.length){let y=m.reduce((v,x)=>v+x.delta,0);h.lnum=h.lnum+y,p=!0}}!p||(i.pauseNotification(),this.highlightLineNr(),i.resumeNotification().then(d=>{Array.isArray(d)&&d[1]!=null&&lJ.error("Error on highlightLineNr:",d[1])}).logError())}async onDocumentChange(e){if(e.bufnr==this.bufnr||this.changing)return;let{uri:t}=e.textDocument,{range:i,text:n}=e.contentChanges[0],o=$.parse(t).fsPath,s=this._fileItems.find(u=>u.filepath==o);if(!s)return;let a=n.split(`
|
||
`).length-(i.end.line-i.start.line)-1,l=[];for(let u=0;u<s.ranges.length;u++){let c=s.ranges[u];if(!(i.start.line>=c.end))if(i.end.line<c.start){if(a==0)continue;c.start=c.start+a,c.end=c.end+a}else{let p=b.getDocument(t).getLines(c.start,c.end);p.length?(c.end=c.start+p.length,l.push({range:this.getFileRangeRange(c,!0),newText:p.join(`
|
||
`)+`
|
||
`})):(s.ranges.splice(u,1),l.push({range:this.getFileRangeRange(c,!1),newText:""}))}}this._fileItems=this._fileItems.filter(u=>u.ranges&&u.ranges.length>0),l.length&&(this.changing=!0,await this.document.applyEdits(l),this.changing=!1),this.nvim.pauseNotification(),this.highlightLineNr(),this.buffer.setOption("modified",!1,!0),await this.nvim.resumeNotification()}async getFileChanges(){if(this._disposed)return[];let e=[],t=await this.buffer.lines;t.push(Ju);let i=[],n,o;for(let s=0;s<t.length;s++){let a=t[s];if(a.startsWith(Ju)){if(n&&(e.push({filepath:n,lines:i.slice(),lnum:o}),n=void 0,i=[]),a.length>1){let l=a.match(/^\u3000(.*)/);l&&(n=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,n=await e.eval('getline(1,line("."))'),o=n.length;for(let s=0;s<o;s++){let l=n[o-s-1].match(/^\u3000(.+)/);if(l){let u=l[1].trim(),c=this.getLinesRange(o-s);if(!c)return;let f=c[0]+s-1,p=this.getAbsolutePath(u);e.pauseNotification(),i?(e.call("win_gotoid",[this.opts.fromWinid],!0),this.nvim.call("coc#util#jump",["edit",p,[f,1]],!0)):this.nvim.call("coc#util#jump",["belowright vs",p,[f,1]],!0),e.command("normal! zz",!0);let[,d]=await e.resumeNotification();d&&C.showMessage(`Error on open ${u}: ${d}`,"error"),i||(this.opts.fromWinid=await e.call("win_getid"));break}}}async addFileItems(e){if(this._disposed)return;let{cwd:t}=this.opts,{document:i}=this,n=await this.mutex.acquire();try{i.dirty&&i.forceSync();for(let f of e){let p=this._fileItems.find(d=>d.filepath==f.filepath);p?p.ranges.push(...f.ranges):this._fileItems.push(f)}let o=i.lineCount,s=new ss,a=[];for(let f of e)for(let p of f.ranges){s.addLine(Ju),s.addLine(Ju),p.lnum=o+s.length,s.addText(`${Ye(t,f.filepath)?wd.default.relative(t,f.filepath):f.filepath}`);let d=String(p.start+1).length+String(p.end).length+4;this.srcId||s.addText(" ".repeat(d));let h=0-s.length-o;p.highlights&&a.push(...p.highlights.map(y=>Q0e(y,h)));let{lines:m}=p;m||(m=await this.getLines(f.filepath,p.start,p.end),p.lines=m),s.addLines(m)}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 f=a[0].start;l.call("coc#util#jumpTo",[f.line,f.character],!0)}b.isVim&&l.command("redraw",!0);let[,c]=await l.resumeNotification();if(c)throw new Error(c[2]);await i.patchChange(),this.changing=!1,await me.executeCommand("editor.action.addRanges",a)}catch(o){this.changing=!1,lJ.error("Error on add file item:",o)}n()}async save(){let{nvim:e}=this,t=this.document,{buffer:i}=t;await t.patchChange();let n=await this.getFileChanges();if(!n)return;n.sort((l,u)=>l.lnum-u.lnum);let o=[],s=new Map;for(let l=0;l<n.length;l++){let u=n[l],{filepath:c,lnum:f}=u,p=s.get(c)||0,d=this._fileItems.find(m=>m.filepath==c),h=d?d.ranges.find(m=>m.lnum==f):null;if(!h||Ne(h.lines,u.lines)){o.push(l),p&&h&&(h.start=h.start+p,h.end=h.end+p);continue}if(u.start=h.start,u.end=h.end,p!=0&&(h.start=h.start+p),u.lines.length!=h.lines.length){let y=u.lines.length-h.lines.length+p;s.set(c,y),h.end=h.end+y}else h.end=h.end+p;h.lines=u.lines}if(o.length&&(n=n.filter((l,u)=>!o.includes(u))),n.length==0)return C.showMessage("No change.","more"),await i.setOption("modified",!1),!1;let a={};for(let l of n){let u=$.file(l.filepath).toString(),c=a[u]||[];c.push({range:Ey.Range.create(l.start,0,l.end,0),newText:l.lines.join(`
|
||
`)+`
|
||
`}),a[u]=c}return this.changing=!0,await b.applyEdit({changes:a}),this.changing=!1,e.pauseNotification(),i.setOption("modified",!1,!0),this.config.saveToFile&&e.command("silent noa wa",!0),this.highlightLineNr(),await e.resumeNotification(),!0}getFileRange(e){for(let t of this._fileItems)for(let i of t.ranges)if(i.lnum==e)return i;return null}getLinesRange(e){for(let t of this._fileItems)for(let i of t.ranges)if(i.lnum==e)return[i.start,i.end];return null}async getLines(e,t,i){let n=$.file(e).toString(),o=b.getDocument(n);return o?o.getLines(t,i):await Y3(e,t,i-1)}getAbsolutePath(e){return wd.default.isAbsolute(e)?e:wd.default.join(this.opts.cwd,e)}getFileRangeRange(e,t=!0){let{document:i}=this;if(!i)return null;let{lnum:n}=e;if(!i.getline(n-1).startsWith("\u3000"))return null;let s=t?n:n-1,a=i.lineCount;for(let l=n;l<i.lineCount;l++)if(i.getline(l).startsWith("\u3000")){a=t?l:l+1;break}return Ey.Range.create(s,0,a,0)}highlightLineNr(){let{_fileItems:e,nvim:t,srcId:i,bufnr:n}=this,{winid:o,cwd:s}=this.opts,a={};if(i){t.call("nvim_buf_clear_namespace",[n,i,0,-1],!0);for(let l of e)for(let u of l.ranges){let c=`${u.start+1}:${u.end}`;a[u.lnum]=[u.start+1,u.end],t.call("nvim_buf_set_virtual_text",[n,i,u.lnum-1,[[c,"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?wd.default.relative(s,u.filepath):u.filepath}`,f=ue(c)+1;for(let p of u.ranges){let d=`:${p.start+1}:${p.end}`;for(let h=0;h<d.length;h++){let m=d[h];this.matchIds.add(l),a[p.lnum]=[p.start+1,p.end],t.call("matchaddpos",["Conceal",[[p.lnum,f+h]],99,l,{conceal:m,window:o}],!0),l++}}}}this.buffer.setVar("line_infos",a,!0)}get valid(){return this.buffer.valid}get buffer(){return this.nvim.createBuffer(this.bufnr)}get document(){return this._disposed?null:b.getDocument(this.bufnr)}dispose(){this._disposed=!0,z(this.disposables)}},uJ=TP;function Q0e(r,e){let{start:t,end:i}=r;return Ey.Range.create(t.line-e,t.character,i.line-e,i.character)}var eSe=j()("handler-refactor"),tSe="__coc_refactor__",rSe=0;var RP=class{constructor(){this.buffers=new Map;this.disposables=[];this._onCreate=new Yu.Emitter;this.onCreate=this._onCreate.event;this.nvim=b.nvim,b.isNvim&&this.nvim.hasFunction("nvim_buf_set_virtual_text")&&(this.srcId=b.createNameSpace("coc-refactor")),this.setConfiguration(),b.onDidChangeConfiguration(this.setConfiguration,this,this.disposables),b.onDidCloseTextDocument(e=>{this.buffers.get(e.bufnr)&&this.buffers.delete(e.bufnr)},null,this.disposables),b.onDidChangeTextDocument(e=>{let t=this.buffers.get(e.bufnr);t&&t.onChange(e)},null,this.disposables)}setConfiguration(e){if(e&&!e.affectsConfiguration("refactor"))return;let t=b.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)})}getBuffer(e){return this.buffers.get(e)}async search(e){let t=await this.createRefactorBuffer();if(!t)return;let i=await this.nvim.call("getcwd",[]);await new aJ(this.nvim).run(e,i,t)}async createRefactorBuffer(e){let{nvim:t}=this,[i,n]=await t.eval("[win_getid(),getcwd()]"),{openCommand:o}=this.config;t.pauseNotification(),t.command(`${o} ${tSe}${rSe++}`,!0),t.command("setl buftype=acwrite nobuflisted bufhidden=wipe nofen wrap conceallevel=2 concealcursor=n",!0),t.command("setl undolevels=-1 nolist nospell noswapfile foldmethod=expr foldexpr=coc#util#refactor_foldlevel(v:lnum)",!0),t.command("setl foldtext=coc#util#refactor_fold_text(v:foldstart)",!0),t.call("setline",[1,["Save current buffer to make changes",Ju]],!0),t.call("matchadd",["Comment","\\%1l"],!0),t.call("matchadd",["Conceal","^\\%u3000"],!0),t.call("matchadd",["Label","^\\%u3000\\zs\\S\\+"],!0),t.command("setl nomod",!0),e&&t.command(`runtime! syntax/${e}.vim`,!0),t.call("coc#util#do_autocmd",["CocRefactorOpen"],!0);let[,s]=await t.resumeNotification();if(s){eSe.error(s),C.showMessage(`Error on open refactor window: ${s}`,"error");return}let[a,l]=await t.eval('[bufnr("%"),win_getid()]'),u={fromWinid:i,winid:l,cwd:n};await b.document;let c=new uJ(a,this.srcId,this.nvim,this.config,u);return this.buffers.set(a,c),c}async fromLines(e){let t=await this.createRefactorBuffer();return t&&await t.buffer.setLines(e,{start:0,end:-1,strictIndexing:!1}),t}async fromLocations(e,t){if(!e||e.length==0)return null;let i={},n={changes:i};for(let o of e){let s=i[o.uri]||[];s.push({range:o.range,newText:""}),i[o.uri]=s}return await this.fromWorkspaceEdit(n,t)}async fromWorkspaceEdit(e,t){if(!e||iSe(e))return;let i=[],{beforeContext:n,afterContext:o}=this.config,{changes:s,documentChanges:a}=e;if(!s){s={};for(let u of a||[])if(Yu.TextDocumentEdit.is(u)){let{textDocument:c,edits:f}=u;c.uri.startsWith("file:")&&(s[c.uri]=f)}}for(let u of Object.keys(s)){let c=await this.getLineCount(u),f=s[u],p=[],d=null,h=null,m=[];f.sort((y,v)=>y.range.start.line-v.range.start.line);for(let y of f){let{line:v}=y.range.start,x=Math.max(0,v-n);d!=null&&x<h?(h=Math.min(c,v+o+1),m.push(cJ(y.range,d))):(d!=null&&p.push({start:d,end:h,highlights:m}),d=x,h=Math.min(c,v+o+1),m=[cJ(y.range,d)])}d!=null&&p.push({start:d,end:h,highlights:m}),i.push({ranges:p,filepath:$.parse(u).fsPath})}let l=await this.createRefactorBuffer(t);return await l.addFileItems(i),l}async save(e){let t=this.buffers.get(e);if(t)return await t.save()}async getLineCount(e){let t=b.getDocument(e);return t?t.lineCount:await J3($.parse(e).fsPath)}reset(){this.timer&&clearTimeout(this.timer);for(let e of this.buffers.values())e.dispose();this.buffers.clear()}dispose(){this.timer&&clearTimeout(this.timer),this._onCreate.dispose();for(let e of this.buffers.values())e.dispose();this.buffers.clear(),z(this.disposables)}},fJ=RP;function cJ(r,e){let{start:t,end:i}=r;return Yu.Range.create(t.line-e,t.character,i.line-e,i.character)}function iSe(r){let{changes:e,documentChanges:t}=r;return!(t&&t.length||e&&Object.keys(e).length)}var an=S(W());var JVe=j()("handler-signature"),kP=class{constructor(e){this.nvim=e;this.disposables=[];this.signatureFactory=new mn(e),this.loadConfiguration(),this.disposables.push(this.signatureFactory),b.onDidChangeConfiguration(this.loadConfiguration,this,this.disposables),A.on("CursorMovedI",async(i,n)=>{if(!this.signaturePosition)return;let o=b.getDocument(i);if(!o)return;let{line:s,character:a}=this.signaturePosition;if(n[0]-1==s){let l=o.getline(n[0]-1),u=ue(l.slice(0,a))+1;if(n[1]>=u)return}this.signatureFactory.close()},null,this.disposables),A.on(["InsertLeave","BufEnter"],()=>{var i;(i=this.tokenSource)==null||i.cancel(),this.signatureFactory.close()},null,this.disposables),A.on(["TextChangedI","TextChangedP"],async()=>{this.config.hideOnChange&&this.signatureFactory.close()},null,this.disposables);let t;A.on("InsertCharPre",async()=>{t=Date.now()},null,this.disposables),A.on("TextChangedI",async(i,n)=>{if(!this.config.trigger||!t||Date.now()-t>300)return;t=null;let o=b.getDocument(i);if(!o||o.isCommandLine||!o.attached)return;let s=n.pre[n.pre.length-1];!s||U.shouldTriggerSignatureHelp(o.textDocument,s)&&await this.triggerSignatureHelp(o,{line:n.lnum-1,character:n.pre.length},!1)},null,this.disposables)}loadConfiguration(e){if(!e||e.affectsConfiguration("signature")){let t=b.getConfiguration("signature"),i=t.get("target","float");i=="float"&&!b.floatSupported&&(i="echo"),this.config={target:i,trigger:t.get("enable",!0),wait:Math.max(t.get("triggerSignatureWait",500),200),maxWindowHeight:t.get("maxWindowHeight",80),maxWindowWidth:t.get("maxWindowWidth",80),preferAbove:t.get("preferShownAbove",!0),hideOnChange:t.get("hideOnTextChange",!1)}}}async triggerSignatureHelp(e,t,i=!0){var p;(p=this.tokenSource)==null||p.cancel();let n=this.tokenSource=new an.CancellationTokenSource,o=n.token;o.onCancellationRequested(()=>{n.dispose(),this.tokenSource=void 0});let{target:s}=this.config,a=this.timer=setTimeout(()=>{n.cancel()},this.config.wait),{changedtick:l}=e;if(await e.patchChange(),l!=e.changedtick&&await He(30),o.isCancellationRequested)return!1;let u=await U.getSignatureHelp(e.textDocument,t,o,{isRetrigger:!1,triggerKind:i?an.SignatureHelpTriggerKind.Invoked:an.SignatureHelpTriggerKind.TriggerCharacter});if(clearTimeout(a),o.isCancellationRequested)return!1;if(!u||u.signatures.length==0)return this.signatureFactory.close(),!1;let{activeSignature:c,signatures:f}=u;if(c){let[d]=f.splice(c,1);d&&f.unshift(d)}s=="echo"?this.echoSignature(u):await this.showSignatureHelp(e,t,u)}async showSignatureHelp(e,t,i){let{signatures:n,activeParameter:o}=i,s=0,a=null,l=n.reduce((d,h,m)=>{var x;let y=null,v=h.label.indexOf("(");if(m==0&&o!=null){let w=(x=h.parameters)==null?void 0:x[o];if(w){let E=h.label.slice(v==-1?0:v);if(a=w.documentation,typeof w.label=="string"){let P=E.slice(0),k=P.match(new RegExp("\\b"+w.label.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b")),_=k?k.index:P.indexOf(w.label);_!=-1&&(y=[_+v,_+w.label.length+v])}else y=w.label}}if(y==null&&(y=[v+1,v+1]),s==0&&(s=y[0]+1),d.push({content:h.label,filetype:e.filetype,active:y}),a){let w=typeof a=="string"?a:a.value;w.trim().length&&d.push({content:w,filetype:pJ(h.documentation)?"markdown":"txt"})}if(m==0&&h.documentation){let{documentation:w}=h,E=typeof w=="string"?w:w.value;E.trim().length&&d.push({content:E,filetype:pJ(h.documentation)?"markdown":"txt"})}return d},[]),u=Ft.getSession(e.bufnr);if(u&&u.isActive){let{value:d}=u.placeholder;d.includes(`
|
||
`)||(s+=d.length),this.signaturePosition=an.Position.create(t.line,t.character-d.length)}else this.signaturePosition=t;let{preferAbove:c,maxWindowHeight:f,maxWindowWidth:p}=this.config;await this.signatureFactory.show(l,{maxWidth:p,maxHeight:f,preferTop:c,autoHide:!1,offsetX:s,modes:["i","ic","s"]})}echoSignature(e){var s;let{signatures:t,activeParameter:i}=e,n=b.env.columns;t=t.slice(0,b.env.cmdheight);let o=[];for(let a of t){let l=[],{label:u}=a;u=u.replace(/\n/g," "),u.length>=n-16&&(u=u.slice(0,n-16)+"...");let c=u.indexOf("(");if(c==-1)l=[{text:u,type:"Normal"}];else{l.push({text:u.slice(0,c),type:"Label"});let f=u.slice(c);if(o.length==0&&i!=null){let p=(s=a.parameters)==null?void 0:s[i];if(p){let d,h;if(typeof p.label=="string"){let m=f.slice(0),y=m.match(new RegExp("\\b"+p.label.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b")),v=y?y.index:m.indexOf(p.label);v==-1?l.push({text:f,type:"Normal"}):(d=v,h=v+p.label.length)}else[d,h]=p.label,d=d-c,h=h-c;d!=null&&h!=null&&(l.push({text:f.slice(0,d),type:"Normal"}),l.push({text:f.slice(d,h),type:"MoreMsg"}),l.push({text:f.slice(h),type:"Normal"}))}}else l.push({text:f,type:"Normal"})}o.push(l)}this.nvim.callTimer("coc#util#echo_signatures",[o],!0)}dispose(){z(this.disposables),this.timer&&clearTimeout(this.timer),this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource.dispose())}},dJ=kP;function pJ(r){return!!(an.MarkupContent.is(r)&&r.kind==an.MarkupKind.Markdown)}var hJ=S(Gr()),uo=S(W());var IP=class{constructor(e){this.nvim=e;this.disposables=[];this.buffers=b.registerBufferSync(t=>{if(t.buftype!="")return;let i=new mJ(t.bufnr);return i.onDidUpdate(async n=>{await A.fire("SymbolsUpdate",[i.bufnr,n])}),i}),A.on("CursorHold",async t=>{!this.functionUpdate||this.buffers.getItem(t)==null||await this.getCurrentFunctionSymbol(t)},null,this.disposables)}get functionUpdate(){return b.getConfiguration("coc.preferences").get("currentFunctionSymbolAutoUpdate",!1)}get labels(){return b.getConfiguration("suggest").get("completionItemKindLabels",{})}async getDocumentSymbols(e){let t=this.buffers.getItem(e);return t==null?void 0:t.getSymbols()}async getCurrentFunctionSymbol(e){e||(e=await this.nvim.call("bufnr",["%"]));let t=await C.getCursorPosition(),i=await this.getDocumentSymbols(e),n=this.nvim.createBuffer(e);if(!i||i.length===0)return n.setVar("coc_current_function","",!0),this.nvim.call("coc#util#do_autocmd",["CocStatusChange"],!0),"";i=i.filter(s=>["Class","Method","Function","Struct"].includes(s.kind));let o="";for(let s of i.reverse())if(s.range&&Wt(t,s.range)==0&&!s.text.endsWith(") callback")){o=s.text;let a=this.labels[s.kind.toLowerCase()];a&&(o=`${a} ${o}`);break}return this.functionUpdate&&(n.setVar("coc_current_function",o,!0),this.nvim.call("coc#util#do_autocmd",["CocStatusChange"],!0)),o}async selectSymbolRange(e,t,i){let n=await this.nvim.call("bufnr",["%"]),o=b.getDocument(n);if(!o||!o.attached)return;let s;if(t)s=await b.getSelectedRange(t,o);else{let c=await C.getCursorPosition();s=uo.Range.create(c,c)}let a=await this.getDocumentSymbols(n);if(!a||a.length===0){C.showMessage("No symbols found","warning");return}let l=a.filter(c=>c.kind=="Property");a=a.filter(c=>i.includes(c.kind));let u;for(let c of a.reverse())if(c.range&&!Ne(c.range,s)&&Ji(s,c.range)){u=c.range;break}if(!u){for(let c of l)if(c.range&&!Ne(c.range,s)&&Ji(s,c.range)){u=c.range;break}}if(e&&u){let{start:c,end:f}=u,p=o.getline(c.line+1),d=o.getline(f.line-1);u=uo.Range.create(c.line+1,p.match(/^\s*/)[0].length,f.line-1,d.length)}u&&await b.selectRange(u)}dispose(){this.buffers.dispose(),z(this.disposables)}},gJ=IP,mJ=class{constructor(e){this.bufnr=e;this.disposables=[];this.autoUpdate=!1;this.symbols=[];this._onDidUpdate=new uo.Emitter;this.onDidUpdate=this._onDidUpdate.event;this.fetchSymbols=hJ.default(()=>{this._fetchSymbols().logError()},global.hasOwnProperty("__TEST__")?10:500)}async getSymbols(){let e=b.getDocument(this.bufnr);return e?(e.forceSync(),this.autoUpdate=!0,e.version==this.version?this.symbols:(this.cancel(),await this._fetchSymbols(),this.symbols)):[]}onChange(){this.cancel()}get textDocument(){var e;return(e=b.getDocument(this.bufnr))==null?void 0:e.textDocument}async _fetchSymbols(){let{textDocument:e}=this;if(!e||e.version==this.version)return;let{version:t}=e,i=this.tokenSource=new uo.CancellationTokenSource,{token:n}=i,o=await U.getDocumentSymbol(e,n);if(this.tokenSource=void 0,o==null||n.isCancellationRequested)return;let s=0,a=[],l=null;if(wP(o))o.sort(yP),o.forEach(u=>bP(a,u,s));else{o.sort(UK);for(let u of o){let{name:c,kind:f,location:p,containerName:d}=u;if(!d||!l)s=0;else if(l.containerName==d)s=l.level||0;else{let y=jK(d,a);s=y?y.level+1:0}let{start:h}=p.range,m={col:h.character+1,lnum:h.line+1,text:c,level:s,kind:_n(f),range:p.range,containerName:d};a.push(m),l=m}}this.version=t,this.symbols=a,wP(o)?this._onDidUpdate.fire(o):this._onDidUpdate.fire(o.map(u=>uo.DocumentSymbol.create(u.name,"",u.kind,u.location.range,u.location.range)))}cancel(){this.fetchSymbols.clear(),this.tokenSource&&(this.tokenSource.cancel(),this.tokenSource=null)}dispose(){this.cancel(),this.symbols=void 0,this._onDidUpdate.dispose(),z(this.disposables)}};var vJ=j()("Handler"),FP=class{constructor(e){this.nvim=e;this.documentLines=[];this.selectionRange=null;this.disposables=[];this.getPreferences(),this.requestStatusItem=C.createStatusBarItem(0,{progress:!0}),b.onDidChangeConfiguration(()=>{this.getPreferences()}),this.refactor=new fJ,this.hoverFactory=new mn(e),this.signature=new dJ(e),this.format=new ZK(e),this.symbols=new gJ(e),this.codeLens=new T9(e),this.colors=new YK(e),this.documentHighlighter=new QK(e),A.on(["CursorMoved","CursorMovedI","InsertEnter","InsertSnippet","InsertLeave"],()=>{this.requestTokenSource&&this.requestTokenSource.cancel()},null,this.disposables);let 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.preferences.previewMaxHeight)}\\<cr> | endif"`,!0),await e.resumeNotification(),this.documentLines.join(`
|
||
`))};this.disposables.push(b.registerTextDocumentContentProvider("coc",t)),this.disposables.push(me.registerCommand("editor.action.pickColor",()=>this.pickColor())),me.titles.set("editor.action.pickColor","pick color from system color picker when possible."),this.disposables.push(me.registerCommand("editor.action.colorPresentation",()=>this.pickPresentation())),me.titles.set("editor.action.colorPresentation","change color presentation."),this.disposables.push(me.registerCommand("editor.action.organizeImport",async i=>{await this.organizeImport(i)})),me.titles.set("editor.action.organizeImport","run organize import code action.")}async organizeImport(e){e||(e=await this.nvim.call("bufnr",["%"]));let t=b.getDocument(e);if(!t||!t.attached)throw new Error(`buffer ${e} not attached`);await mt(t);let i=await this.getCodeActions(t,void 0,[Ue.CodeActionKind.SourceOrganizeImports]);if(i&&i.length){await this.applyCodeAction(i[0]);return}throw new Error("Organize import action not found.")}checkProvier(e,t){if(!U.hasProvider(e,t))throw new Error(`${e} provider not found for current buffer, your language server don't support it.`)}async withRequestToken(e,t,i){this.requestTokenSource&&(this.requestTokenSource.cancel(),this.requestTokenSource.dispose()),this.requestTimer&&clearTimeout(this.requestTimer);let n=this.requestStatusItem;this.requestTokenSource=new Ue.CancellationTokenSource;let{token:o}=this.requestTokenSource;o.onCancellationRequested(()=>{n.text=`${e} request canceled`,n.isProgress=!1,this.requestTimer=setTimeout(()=>{n.hide()},500)}),n.isProgress=!0,n.text=`requesting ${e}`,n.show();let s;try{s=await Promise.resolve(t(o))}catch(a){C.showMessage(a.message,"error"),vJ.error(`Error on ${e}`,a)}return this.requestTokenSource&&(this.requestTokenSource.dispose(),this.requestTokenSource=void 0),o.isCancellationRequested?null:(n.hide(),i&&(!s||Array.isArray(s)&&s.length==0)?(C.showMessage(`${e} not found`,"warning"),null):s)}async getCurrentFunctionSymbol(){let{doc:e}=await this.getCurrentState();return this.checkProvier("documentSymbol",e.textDocument),await this.symbols.getCurrentFunctionSymbol()}async selectSymbolRange(e,t,i){let{doc:n}=await this.getCurrentState();return this.checkProvier("documentSymbol",n.textDocument),await this.symbols.selectSymbolRange(e,t,i)}async getDocumentSymbols(e){let t=b.getDocument(e);if(!t||!t.attached)throw new Error(`buffer ${e} not attached`);return this.checkProvier("documentSymbol",t.textDocument),await this.symbols.getDocumentSymbols(e)}async hasProvider(e){let t=await this.nvim.call("bufnr","%"),i=b.getDocument(t);return i?U.hasProvider(e,i.textDocument):!1}async onHover(e){let{doc:t,position:i,winid:n}=await this.getCurrentState();this.checkProvier("hover",t.textDocument);let o=e!=null?e:this.preferences.hoverTarget;o=="float"&&this.hoverFactory.close(),await mt(t);let s=await this.withRequestToken("hover",l=>U.getHover(t.textDocument,i,l),!0);if(s==null)return!1;let a=s.find(l=>Ue.Range.is(l.range));if(a==null?void 0:a.range){let l=this.nvim.createWindow(n),u=await l.highlightRanges("CocHoverRange",[a.range],99);setTimeout(()=>{u.length&&l.clearMatches(u),b.isVim&&this.nvim.command("redraw",!0)},1e3)}return await this.previewHover(s,o),!0}async getHover(){let e=[],{doc:t,position:i}=await this.getCurrentState();this.checkProvier("hover",t.textDocument),await mt(t);let n=new Ue.CancellationTokenSource,o=await U.getHover(t.textDocument,i,n.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)}):Ue.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}async gotoDefinition(e){let{doc:t,position:i}=await this.getCurrentState();this.checkProvier("definition",t.textDocument),await mt(t);let n=await this.withRequestToken("definition",o=>U.getDefinition(t.textDocument,i,o),!0);return n==null?!1:(await this.handleLocations(n,e),!0)}async gotoDeclaration(e){let{doc:t,position:i}=await this.getCurrentState();this.checkProvier("declaration",t.textDocument),await mt(t);let n=await this.withRequestToken("declaration",o=>U.getDeclaration(t.textDocument,i,o),!0);return n==null?!1:(await this.handleLocations(n,e),!0)}async gotoTypeDefinition(e){let{doc:t,position:i}=await this.getCurrentState();this.checkProvier("typeDefinition",t.textDocument),await mt(t);let n=await this.withRequestToken("type definition",o=>U.getTypeDefinition(t.textDocument,i,o),!0);return n==null?!1:(await this.handleLocations(n,e),!0)}async gotoImplementation(e){let{doc:t,position:i}=await this.getCurrentState();this.checkProvier("implementation",t.textDocument),await mt(t);let n=await this.withRequestToken("implementation",o=>U.getImplementation(t.textDocument,i,o),!0);return n==null?!1:(await this.handleLocations(n,e),!0)}async gotoReferences(e,t=!0){let{doc:i,position:n}=await this.getCurrentState();this.checkProvier("reference",i.textDocument),await mt(i);let o=await this.withRequestToken("references",s=>U.getReferences(i.textDocument,{includeDeclaration:t},n,s),!0);return o==null?!1:(await this.handleLocations(o,e),!0)}async getWordEdit(){let{doc:e,position:t}=await this.getCurrentState(),i=e.getWordRangeAtPosition(t);if(!i||Gn(i))return null;let n=e.textDocument.getText(i);if(U.hasProvider("rename",e.textDocument)){await mt(e);let s=new Ue.CancellationTokenSource;if(await U.prepareRename(e.textDocument,t,s.token)===!1)return null;let l=await U.provideRenameEdits(e.textDocument,t,n,s.token);if(l)return l}C.showMessage("Rename provider not found, extract word ranges from current buffer","more");let o=e.getSymbolRanges(n);return{changes:{[e.uri]:o.map(s=>({range:s,newText:n}))}}}async rename(e){let{doc:t,position:i}=await this.getCurrentState();this.checkProvier("rename",t.textDocument),await mt(t);let n=this.requestStatusItem;try{let o=new Ue.CancellationTokenSource().token,s=await U.prepareRename(t.textDocument,i,o);if(s===!1)return n.hide(),C.showMessage("Invalid position for rename","warning"),!1;if(o.isCancellationRequested)return!1;let a;if(e||(Ue.Range.is(s)?(a=t.textDocument.getText(s),await C.moveTo(s.start)):s&&typeof s.placeholder=="string"?a=s.placeholder:a=await this.nvim.eval('expand("<cword>")'),e=await C.requestInput("New name",a)),!e)return n.hide(),!1;let l=await U.provideRenameEdits(t.textDocument,i,e,o);return o.isCancellationRequested?!1:(n.hide(),l?(await b.applyEdit(l),!0):(C.showMessage("Invalid position for rename","warning"),!1))}catch(o){return n.hide(),C.showMessage(`Error on rename: ${o.message}`,"error"),vJ.error(o),!1}}async documentFormatting(){let{doc:e}=await this.getCurrentState();return this.checkProvier("format",e.textDocument),await this.format.documentFormat(e)}async documentRangeFormatting(e){let{doc:t}=await this.getCurrentState();return this.checkProvier("formatRange",t.textDocument),await this.format.documentRangeFormat(t,e)}async getTagList(){let{doc:e,position:t}=await this.getCurrentState(),i=await this.nvim.call("expand","<cword>");if(!i||!U.hasProvider("definition",e.textDocument))return null;let n=new Ue.CancellationTokenSource,o=await U.getDefinition(e.textDocument,t,n.token);return!o||!o.length?null:o.map(s=>{let a=$.parse(s.uri),l=a.scheme=="file"?a.fsPath:a.toString();return{name:i,cmd:`keepjumps ${s.range.start.line+1} | normal ${s.range.start.character+1}|`,filename:l}})}async runCommand(e,...t){if(e){await A.fire("Command",[e]);let i=await me.executeCommand(e,...t);return t.length==0&&await me.addRecent(e),i}else await Kt.start(["commands"])}async getCodeActions(e,t,i){t=t||Ue.Range.create(0,0,e.lineCount,0);let o={diagnostics:St.getDiagnosticsInRange(e.textDocument,t)};i&&Array.isArray(i)&&(o.only=i);let s=await this.withRequestToken("code action",a=>U.getCodeActions(e.textDocument,t,o,a));return!s||s.length==0?[]:(s.sort((a,l)=>a.isPreferred&&!l.isPreferred?-1:l.isPreferred&&!a.isPreferred?1:0),s)}async doCodeAction(e,t){let{doc:i}=await this.getCurrentState(),n;e&&(n=await b.getSelectedRange(e,i)),await mt(i);let o=await this.getCodeActions(i,n,Array.isArray(t)?t:null);if(t&&typeof t=="string"&&(o=o.filter(l=>l.title==t||l.command&&l.command.title==t),o.length==1)){await this.applyCodeAction(o[0]);return}if(!o||o.length==0){C.showMessage(`No${t?" "+t:""} code action available`,"warning");return}let s=this.preferences.floatActions?await C.showMenuPicker(o.map(l=>l.title),"Choose action"):await C.showQuickpick(o.map(l=>l.title)),a=o[s];a&&await this.applyCodeAction(a)}async getCurrentCodeActions(e,t){let{doc:i}=await this.getCurrentState(),n;return e&&(n=await b.getSelectedRange(e,i)),await this.getCodeActions(i,n,t)}async doQuickfix(){let e=await this.getCurrentCodeActions("line",[Ue.CodeActionKind.QuickFix]);return!e||e.length==0?(C.showMessage("No quickfix action available","warning"),!1):(await this.applyCodeAction(e[0]),await this.nvim.command('silent! call repeat#set("\\<Plug>(coc-fix-current)", -1)'),!0)}async applyCodeAction(e){let{command:t,edit:i}=e;if(i&&await b.applyEdit(i),t)if(me.has(t.command))me.execute(t);else{let n=e.clientId,o=Vt.getService(n),s={command:t.command,arguments:t.arguments};if(o.client){let{client:a}=o;a.sendRequest(Ue.ExecuteCommandRequest.type,s).then(void 0,l=>{C.showMessage(`Execute '${t.command} error: ${l}'`,"error")})}}}async doCodeLensAction(){await this.codeLens.doAction()}async fold(e){let{doc:t,winid:i}=await this.getCurrentState();this.checkProvier("foldingRange",t.textDocument),await mt(t);let n=this.nvim.createWindow(i),[o,s]=await this.nvim.eval("[&foldmethod,&foldlevel]");if(o!="manual")return C.showMessage("foldmethod option should be manual!","warning"),!1;let a=await this.withRequestToken("folding range",l=>U.provideFoldingRanges(t.textDocument,{},l),!0);if(!a)return!1;if(e&&(a=a.filter(l=>l.kind==e)),a.length){a.sort((l,u)=>u.startLine-l.startLine),this.nvim.pauseNotification(),this.nvim.command("normal! zE",!0);for(let l of a){let{startLine:u,endLine:c}=l,f=`${u+1}, ${c+1}fold`;this.nvim.command(f,!0)}return n.setOption("foldenable",!0,!0),n.setOption("foldlevel",s,!0),b.isVim&&this.nvim.command("redraw",!0),await this.nvim.resumeNotification(),!0}return!1}async pickColor(){let{doc:e}=await this.getCurrentState();this.checkProvier("documentColor",e.textDocument),await this.colors.pickColor()}async pickPresentation(){let{doc:e}=await this.getCurrentState();this.checkProvier("documentColor",e.textDocument),await this.colors.pickPresentation()}async highlight(){await this.documentHighlighter.highlight()}async getSymbolsRanges(){let{doc:e,position:t}=await this.getCurrentState();this.checkProvier("documentHighlight",e.textDocument);let i=await this.documentHighlighter.getHighlights(e,t);return i?i.map(n=>n.range):null}async links(){let{doc:e}=await this.getCurrentState();this.checkProvier("documentLink",e.textDocument);let t=await this.withRequestToken("links",n=>U.getDocumentLinks(e.textDocument,n));t=t||[];let i=[];for(let n of t)n.target||(n=await U.resolveDocumentLink(n)),i.push(n);return t}async openLink(){let{doc:e,position:t}=await this.getCurrentState();this.checkProvier("documentLink",e.textDocument);let i=await this.withRequestToken("links",n=>U.getDocumentLinks(e.textDocument,n));if(!i||i.length==0)return!1;for(let n of i)if(Wt(t,n.range)){let{target:o}=n;return o||(n=await U.resolveDocumentLink(n),o=n.target),o?(await b.openResource(o),!0):!1}return!1}async getCommands(){let e=me.commandList,t=[],{titles:i}=me;for(let n of e)t.push({id:n.id,title:i.get(n.id)||""});return t}async showSignatureHelp(){let{doc:e,position:t}=await this.getCurrentState();return U.hasProvider("signature",e.textDocument)?await this.signature.triggerSignatureHelp(e,t):!1}async findLocations(e,t,i,n){let{doc:o,position:s}=await this.getCurrentState();i=i||{},Object.assign(i,{textDocument:{uri:o.uri},position:s});let a=await Vt.sendRequest(e,t,i);a=a||[];let l=[];if(Array.isArray(a))l=a;else if(a.hasOwnProperty("location")&&a.hasOwnProperty("children")){let u=c=>{if(l.push(c.location),c.children&&c.children.length)for(let f of c.children)u(f)};u(a)}await this.handleLocations(l,n)}async handleLocations(e,t){if(!e)return;let n=(Array.isArray(e)?e:[e]).length;if(n!=0)if(n==1&&t!==!1){let o=e[0];if(Ue.LocationLink.is(e[0])){let l=e[0];o=Ue.Location.create(l.targetUri,l.targetRange)}let{uri:s,range:a}=o;await b.jumpTo(s,a.start,t)}else await b.showLocations(e)}async getSelectionRanges(){let{doc:e,position:t}=await this.getCurrentState();this.checkProvier("selectionRange",e.textDocument),await mt(e);let i=await this.withRequestToken("selection ranges",n=>U.getSelectionRanges(e.textDocument,[t],n));return i&&i.length?i:null}async selectRange(e,t){let{nvim:i}=this,{doc:n}=await this.getCurrentState();this.checkProvier("selectionRange",n.textDocument);let o=[];if(!t&&(!this.selectionRange||!e))return;if(e){let u=await b.getSelectedRange(e,n);o.push(u.start,u.end)}else{let u=await C.getCursorPosition();o.push(u)}if(!t){let u=Ue.Range.create(o[0],o[1]),{selectionRange:c}=this;for(;c&&c.parent&&!Ne(c.parent.range,u);)c=c.parent;c&&c.parent&&await b.selectRange(c.range);return}await mt(n);let s=await this.withRequestToken("selection ranges",u=>U.getSelectionRanges(n.textDocument,o,u));if(!s||s.length==0)return;await i.eval("mode()")!="n"&&await i.eval(`feedkeys("\\<Esc>", 'in')`);let l;if(s.length==1)l=s[0];else if(o.length>1){let u=Ue.Range.create(o[0],o[1]);for(l=s[0];l;){if(Ne(u,l.range)){l=l.parent;continue}if(Wt(o[1],l.range)==0)break;l=l.parent}}!l||(this.selectionRange=s[0],await b.selectRange(l.range))}async codeActionRange(e,t,i){let{doc:n}=await this.getCurrentState();await mt(n);let o=n.getline(t-1),s=Ue.Range.create(e-1,0,t-1,o.length),a=await this.getCodeActions(n,s,i?[i]:null);if(!a||a.length==0){C.showMessage(`No${i?" "+i:""} code action available`,"warning");return}let l=await C.showMenuPicker(a.map(c=>c.title),"Choose action"),u=a[l];u&&await this.applyCodeAction(u)}async doRefactor(){let{doc:e,position:t}=await this.getCurrentState();await mt(e);let i=await this.withRequestToken("refactor",async n=>{let o=await U.prepareRename(e.textDocument,t,n);if(n.isCancellationRequested)return null;if(o===!1)return C.showMessage("Invalid position","warning"),null;let s=await U.provideRenameEdits(e.textDocument,t,"NewName",n);return n.isCancellationRequested?null:s||(C.showMessage("Empty workspaceEdit from language server","warning"),null)});i&&await this.refactor.fromWorkspaceEdit(i,e.filetype)}async saveRefactor(e){await this.refactor.save(e)}async search(e){await this.refactor.search(e)}async previewHover(e,t){let i=[],n=t==="preview";for(let s of e){let{contents:a}=s;if(Array.isArray(a))for(let l of a)typeof l=="string"?Vu(i,l,"markdown",n):Vu(i,l.value,l.language,n);else Ue.MarkedString.is(a)?typeof a=="string"?Vu(i,a,"markdown",n):Vu(i,a.value,a.language,n):Ue.MarkupContent.is(a)&&Vu(i,a.value,WK(a)?"markdown":"txt",n)}if(t=="float"){await this.hoverFactory.show(i,{modes:["n"]});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();s.length&&await this.nvim.call("coc#util#echo_hover",s)}else this.documentLines=o,await this.nvim.command("noswapfile pedit coc://document")}getPreferences(){let e=b.getConfiguration("coc.preferences"),t=e.get("hoverTarget","float");t=="float"&&!b.floatSupported&&(t="preview"),this.preferences={hoverTarget:t,previewMaxHeight:e.get("previewMaxHeight",12),previewAutoClose:e.get("previewAutoClose",!1),floatActions:e.get("floatActions",!0)}}async getCurrentState(){let{nvim:e}=this,[t,[i,n],o]=await e.eval("[bufnr('%'),coc#util#cursor(),win_getid()]"),s=b.getDocument(t);if(!s||!s.attached)throw new Error(`current buffer ${t} not attached`);return{doc:s,position:Ue.Position.create(i,n),winid:o}}dispose(){this.requestTimer&&(clearTimeout(this.requestTimer),this.requestTimer=void 0),this.refactor.dispose(),this.signature.dispose(),this.symbols.dispose(),this.hoverFactory.dispose(),this.colors.dispose(),this.format.dispose(),this.documentHighlighter.dispose(),z(this.disposables)}},yJ=FP;var Xu=j()("plugin"),OP=class extends bJ.EventEmitter{constructor(e){super();this.nvim=e;this._ready=!1;this.actions=new Map;Object.defineProperty(b,"nvim",{get:()=>this.nvim}),this.cursors=new _9(e),this.addAction("hasProvider",t=>this.handler.hasProvider(t)),this.addAction("getTagList",async()=>await this.handler.getTagList()),this.addAction("hasSelected",()=>cs.hasSelected()),this.addAction("listNames",()=>Kt.names),this.addAction("listDescriptions",()=>Kt.descriptions),this.addAction("listLoadItems",async t=>await Kt.loadItems(t)),this.addAction("search",(...t)=>this.handler.search(t)),this.addAction("cursorsSelect",(t,i,n)=>this.cursors.select(t,i,n)),this.addAction("fillDiagnostics",t=>St.setLocationlist(t)),this.addAction("getConfig",async t=>{let i=await b.document;return b.getConfiguration(t,i?i.uri:void 0)}),this.addAction("rootPatterns",t=>{let i=b.getDocument(t);return i?{buffer:b.getRootPatterns(i,Kr.Buffer),server:b.getRootPatterns(i,Kr.LanguageServer),global:b.getRootPatterns(i,Kr.Global)}:null}),this.addAction("installExtensions",async(...t)=>{await ge.installExtensions(t)}),this.addAction("saveRefactor",async t=>{await this.handler.saveRefactor(t)}),this.addAction("updateExtensions",async t=>{await ge.updateExtensions(t)}),this.addAction("commandList",()=>me.commandList.map(t=>t.id)),this.addAction("openList",async(...t)=>{await this.ready,await Kt.start(t)}),this.addAction("selectSymbolRange",(t,i,n)=>this.handler.selectSymbolRange(t,i,n)),this.addAction("listResume",t=>Kt.resume(t)),this.addAction("listCancel",()=>Kt.cancel(!0)),this.addAction("listPrev",t=>Kt.previous(t)),this.addAction("listNext",t=>Kt.next(t)),this.addAction("listFirst",t=>Kt.first(t)),this.addAction("listLast",t=>Kt.last(t)),this.addAction("sendRequest",(t,i,n)=>Vt.sendRequest(t,i,n)),this.addAction("sendNotification",(t,i,n)=>Vt.sendNotification(t,i,n)),this.addAction("registNotification",(t,i)=>Vt.registNotification(t,i)),this.addAction("doAutocmd",async(t,...i)=>{let n=b.autocmds.get(t);if(n)try{await Promise.resolve(n.callback.apply(n.thisArg,i))}catch(o){Xu.error(`Error on autocmd ${n.event}`,o),C.showMessage(`Error on autocmd ${n.event}: ${o.message}`)}}),this.addAction("updateConfig",(t,i)=>{b.configurations.updateUserConfig({[t]:i})}),this.addAction("snippetNext",async()=>(await Ft.nextPlaceholder(),"")),this.addAction("snippetPrev",async()=>(await Ft.previousPlaceholder(),"")),this.addAction("snippetCancel",()=>{Ft.cancel()}),this.addAction("openLocalConfig",async()=>{await C.openLocalConfig()}),this.addAction("openLog",async()=>{let t=Xu.getLogFile();await b.jumpTo($.file(t).toString())}),this.addAction("attach",()=>b.attach()),this.addAction("detach",()=>b.detach()),this.addAction("doKeymap",async(t,i="",n)=>{let o=b.keymaps.get(t);if(!o)return Xu.error(`keymap for ${t} not found`),this.nvim.command(`silent! unmap <buffer> ${n.startsWith("{")&&n.endsWith("}")?`<${n.slice(1,-1)}>`:n}`,!0),i;let[s,a]=o,l=await Promise.resolve(s());return a&&await e.command(`silent! call repeat#set("\\<Plug>(coc-${t})", -1)`),l!=null?l:i}),this.addAction("registExtensions",async(...t)=>{for(let i of t)await ge.loadExtension(i)}),this.addAction("snippetCheck",async(t,i)=>{if(t&&!ge.has("coc-snippets"))return console.error("coc-snippets required for check expand status!"),!1;if(i&&Ft.jumpable())return!0;if(t){let n=ge.getExtensionApi("coc-snippets");if(n&&n.hasOwnProperty("expandable")&&await Promise.resolve(n.expandable()))return!0}return!1}),this.addAction("showInfo",async()=>{this.infoChannel?this.infoChannel.clear():this.infoChannel=C.createOutputChannel("info");let t=this.infoChannel;t.appendLine("## versions"),t.appendLine("");let n=(await this.nvim.call("execute",["version"])).trim().split(/\r?\n/,2)[0].replace(/\(.*\)/,"").trim();t.appendLine("vim version: "+n+`${b.isVim?" "+b.env.version:""}`),t.appendLine("node version: "+process.version),t.appendLine("coc.nvim version: "+this.version),t.appendLine("coc.nvim directory: "+wJ.default.dirname(__dirname)),t.appendLine("term: "+(process.env.TERM_PROGRAM||process.env.TERM)),t.appendLine("platform: "+process.platform),t.appendLine(""),t.appendLine("## Log of coc.nvim"),t.appendLine("");let o=Xu.getLogFile();if(AP.default.existsSync(o)){let s=AP.default.readFileSync(o,{encoding:"utf8"});t.appendLine(s)}t.show()}),this.addAction("findLocations",(t,i,n,o)=>this.handler.findLocations(t,i,n,o)),this.addAction("links",()=>this.handler.links()),this.addAction("openLink",()=>this.handler.openLink()),this.addAction("pickColor",()=>this.handler.pickColor()),this.addAction("colorPresentation",()=>this.handler.pickPresentation()),this.addAction("highlight",async()=>{await this.handler.highlight()}),this.addAction("fold",t=>this.handler.fold(t)),this.addAction("startCompletion",async t=>{await cs.startCompletion(t)}),this.addAction("stopCompletion",()=>{cs.stop(!1)}),this.addAction("sourceStat",()=>Ze.sourceStats()),this.addAction("refreshSource",async t=>{await Ze.refresh(t)}),this.addAction("toggleSource",t=>{Ze.toggleSource(t)}),this.addAction("diagnosticInfo",async()=>{await St.echoMessage()}),this.addAction("diagnosticToggle",()=>{St.toggleDiagnostic()}),this.addAction("diagnosticNext",async t=>{await St.jumpNext(t)}),this.addAction("diagnosticPrevious",async t=>{await St.jumpPrevious(t)}),this.addAction("diagnosticPreview",async()=>{await St.preview()}),this.addAction("diagnosticList",()=>St.getDiagnosticList()),this.addAction("jumpDefinition",t=>this.handler.gotoDefinition(t)),this.addAction("jumpDeclaration",t=>this.handler.gotoDeclaration(t)),this.addAction("jumpImplementation",t=>this.handler.gotoImplementation(t)),this.addAction("jumpTypeDefinition",t=>this.handler.gotoTypeDefinition(t)),this.addAction("jumpReferences",t=>this.handler.gotoReferences(t)),this.addAction("jumpUsed",t=>this.handler.gotoReferences(t,!1)),this.addAction("doHover",t=>this.handler.onHover(t)),this.addAction("getHover",()=>this.handler.getHover()),this.addAction("showSignatureHelp",()=>this.handler.showSignatureHelp()),this.addAction("documentSymbols",async t=>(t||(t=await e.call("bufnr",["%"])),await this.handler.getDocumentSymbols(t))),this.addAction("ensureDocument",async()=>{let t=await b.document;return t&&t.attached}),this.addAction("symbolRanges",()=>this.handler.getSymbolsRanges()),this.addAction("selectionRanges",()=>this.handler.getSelectionRanges()),this.addAction("rangeSelect",(t,i)=>this.handler.selectRange(t,i)),this.addAction("rename",t=>this.handler.rename(t)),this.addAction("getWorkspaceSymbols",async t=>{let i=new xd.CancellationTokenSource;return await U.getWorkspaceSymbols(t,i.token)}),this.addAction("formatSelected",t=>this.handler.documentRangeFormatting(t)),this.addAction("format",()=>this.handler.documentFormatting()),this.addAction("commands",()=>this.handler.getCommands()),this.addAction("services",()=>Vt.getServiceStats()),this.addAction("toggleService",t=>Vt.toggle(t)),this.addAction("codeAction",(t,i)=>this.handler.doCodeAction(t,i)),this.addAction("organizeImport",()=>this.handler.organizeImport()),this.addAction("fixAll",()=>this.handler.doCodeAction(null,[xd.CodeActionKind.SourceFixAll])),this.addAction("doCodeAction",t=>this.handler.applyCodeAction(t)),this.addAction("codeActions",(t,i)=>this.handler.getCurrentCodeActions(t,i)),this.addAction("quickfixes",t=>this.handler.getCurrentCodeActions(t,[xd.CodeActionKind.QuickFix])),this.addAction("codeLensAction",()=>this.handler.doCodeLensAction()),this.addAction("runCommand",(...t)=>this.handler.runCommand(...t)),this.addAction("doQuickfix",()=>this.handler.doQuickfix()),this.addAction("refactor",()=>this.handler.doRefactor()),this.addAction("repeatCommand",()=>me.repeatCommand()),this.addAction("extensionStats",()=>ge.getExtensionStates()),this.addAction("loadedExtensions",()=>ge.loadedExtensions()),this.addAction("watchExtension",t=>ge.watchExtension(t)),this.addAction("activeExtension",t=>ge.activate(t)),this.addAction("deactivateExtension",t=>ge.deactivate(t)),this.addAction("reloadExtension",t=>ge.reloadExtension(t)),this.addAction("toggleExtension",t=>ge.toggleExtension(t)),this.addAction("uninstallExtension",(...t)=>ge.uninstallExtension(t)),this.addAction("getCurrentFunctionSymbol",()=>this.handler.getCurrentFunctionSymbol()),this.addAction("getWordEdit",()=>this.handler.getWordEdit()),this.addAction("addRanges",async t=>{await this.cursors.addRanges(t)}),this.addAction("currentWorkspacePath",()=>b.rootPath),this.addAction("addCommand",t=>{this.addCommand(t)}),this.addAction("selectCurrentPlaceholder",t=>Ft.selectCurrentPlaceholder(!!t)),this.addAction("codeActionRange",(t,i,n)=>this.handler.codeActionRange(t,i,n)),b.onDidChangeWorkspaceFolders(()=>{e.setVar("WorkspaceFolders",b.folderPaths,!0)}),me.init(e,this)}addAction(e,t){if(this.actions.has(e))throw new Error(`Action ${e} already exists`);this.actions.set(e,t)}addCommand(e){let t=`vim.${e.id}`;me.registerCommand(t,async()=>{await this.nvim.command(e.cmd)}),e.title&&me.titles.set(t,e.title)}async init(){let{nvim:e}=this,t=Date.now();try{await ge.init(),await b.init(),U.init();for(let i of b.env.vimCommands)this.addCommand(i);Ft.init(),cs.init(),St.init(),Kt.init(e),e.setVar("coc_workspace_initialized",1,!0),e.setVar("WorkspaceFolders",b.folderPaths,!0),Ze.init(),this.handler=new yJ(e),Vt.init(),await ge.activateExtensions(),b.setupDynamicAutocmd(!0),e.setVar("coc_service_initialized",1,!0),e.call("coc#util#do_autocmd",["CocNvimInit"],!0),this._ready=!0,await A.fire("ready",[]),Xu.info(`coc.nvim ${this.version} initialized with node: ${process.version} after ${Date.now()-t}ms`),this.emit("ready")}catch(i){console.error(`Error on initialize: ${i.stack}`),Xu.error(i.stack)}b.onDidOpenTextDocument(async i=>{!i.uri.endsWith(Gi)||ge.has("coc-json")||C.showMessage("Run :CocInstall coc-json for json intellisense","more")})}get isReady(){return this._ready}get ready(){return this._ready?Promise.resolve():new Promise(e=>{this.once("ready",()=>{e()})})}get version(){return b.version+"-d09f35455b"}hasAction(e){return this.actions.has(e)}async cocAction(e,...t){let i=this.actions.get(e);if(!i)throw new Error(`Action "${e}" not exists`);return await Promise.resolve(i.apply(null,t))}getHandler(){return this.handler}dispose(){this.removeAllListeners(),ge.dispose(),Kt.dispose(),b.dispose(),C.dispose(),Ze.dispose(),Vt.stopAll(),Vt.dispose(),this.handler&&this.handler.dispose(),Ft.dispose(),me.dispose(),cs.dispose(),St.dispose()}},xJ=OP;var lSe=CJ().default;lSe({reader:process.stdin,writer:process.stdout});process.on("uncaughtException",function(r){let e="Uncaught exception: "+r.message;console.error(e),LP.error("uncaughtException",r.stack)});process.on("unhandledRejection",function(r,e){r instanceof Error?console.error("UnhandledRejection: "+r.message+`
|
||
`+r.stack):console.error("UnhandledRejection: "+r),LP.error("unhandledRejection ",e,r)});
|
||
/*!
|
||
* @description Recursive object extending
|
||
* @author Viacheslav Lotsmanov <lotsmanov89@gmail.com>
|
||
* @license MIT
|
||
*
|
||
* The MIT License (MIT)
|
||
*
|
||
* Copyright (c) 2013-2018 Viacheslav Lotsmanov
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||
* this software and associated documentation files (the "Software"), to deal in
|
||
* the Software without restriction, including without limitation the rights to
|
||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||
* subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in all
|
||
* copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||
*/
|
||
/*!
|
||
* ISC License
|
||
*
|
||
* Copyright (c) 2018, Andrea Giammarchi, @WebReflection
|
||
*
|
||
* Permission to use, copy, modify, and/or distribute this software for any
|
||
* purpose with or without fee is hereby granted, provided that the above
|
||
* copyright notice and this permission notice appear in all copies.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||
* REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||
* AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
|
||
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||
* PERFORMANCE OF THIS SOFTWARE.
|
||
*/
|
||
/*!
|
||
* 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
|
||
*/
|
||
/**
|
||
* 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
|
||
*/
|