titanfiber 1.0.115 → 1.0.116
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build.pkg.js +1 -1
- package/cli.pkg.js +1 -1
- package/package.json +1 -1
package/build.pkg.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=function(e){var n,r=!1;return function(){return r||(r=!0,n=e.apply(this,arguments)),n}},n=e((function(){return process.argv.slice(2)})),r=n,u=function(e){return"string"==typeof e},i=function(e){const n=[];let r="",u="outside",i=!1;for(let o=0;o<e.length;o++){const s=e[o];switch(u){case"outside":'"'===s?i?(r+=s,i=!1):u="insideQuote":"\\"===s?i=!0:" "===s?(r.length>0&&(n.push(r),r=""),i=!1):(r+=s,i=!1);break;case"insideQuote":'"'!==s||i?"\\"!==s||i?(r+=s,i=!1):i=!0:u="outside"}}return r.length>0&&n.push(r),n},o=function(e){for(var n,o=[],s=!1,c=(n=null==(a=e)?r():u(a)?i(a):a).length,l=0;l<c;l++){var a=n[l];if(!s){var f=a[0];let e;if("-"===f)if("-"===a[1]){if(2===a.length){s=!0;continue}e=2}else e=1;else"/"===f&&(e=1);if(e){var p,d,h=a.slice(e),v=h.indexOf("=");if(-1!==v)p=h.slice(0,v),d=h.slice(v+1);else{p=h;var m=n[l+1];null==m||"-"===m[0]?d=!0:(d=m,l++)}o[p]=d;continue}}o.push(a)}return o},s=o,c=s,l=c,a=function(e){return require(e)},f=function(e){return!!e.startsWith("node:")||a("node:module").isBuiltin(e)},p=function(e){return e.startsWith(".")},d=function(e){return Array.isArray(e)},h=function(e){return class extends e{constructor(e,n){super(e,n);var r=this.constructor.name;r&&(this.name=r)}}},v=h(globalThis.Error),m=class extends v{constructor(e,n){super(e??"Unexpected value",n)}},g=e((function(){return"undefined"==typeof window})),y=function(e){return require("node:"+e)},w=function(n){return e((()=>y(n)))},b=w("util"),x=function(e,n){return n||(n={}),null==n.colors&&(n.colors=!0),b().inspect(e,n)},E=function(e,n){return null!=e&&e.constructor===n},F=function(e){return E(e,Object)},A=function(e,n){return n<0?e.length+n:n},O=A,S=function(e,n,r,u){return void 0!==n&&(null===n||0===n?n=void 0:(n=O(e,n),u&&0==u.inclusiveStart&&n++)),void 0!==r&&(null===r||r===e.length?r=void 0:(r=O(e,r),u&&u.inclusiveEnd&&r++)),[n,r]},_=function(e,n,r,u,i,o){if(r||null!=u){[r,u]=S(e,r,u,o);var s=e.slice(r,u),c=n(s);return i?i(c,r,u,s,e):c}return n(e)},I=function(e,n,r,u,i){return _(e,n,r,u,((n,r,u)=>(void 0!==r?e.slice(0,r):"")+(n||"")+(void 0!==u?e.slice(u):"")),i)},j=E,k=function(e){return j(e,RegExp)},N=function(e){return d(e)?e:[e]},q=function(e){return e instanceof Promise},T=function(e,n){var r=e;return q(r)?r.then(n):n(r)},C=function(e){return"function"==typeof e},R=function(e){return C(e)&&null==e.prototype},M=R,P=function(e){return function(){return e.apply(this,arguments)}},L=function(e,n){var r;return r=n?function(){this.super=n;var r=e.apply(this,arguments);return T(r,(()=>(delete this.super,r)))}:M(e)?P(e):e,r._isConstructor=!0,r},D=function(e,n){return e._isConstructor?e:L(e,n)},W=function(){return this},K=function(e,n,r){var u=new v(e,r);return n&&Object.assign(u,n),u},B=class extends v{constructor(e,n){super(e??"Not yet implemented",n)}},U=function(e,n,r,u){var i=e[n];if(void 0===i){var o=r;!1!==u&&C(o)&&(o=o(e,n)),e[n]=i=o}return i},Y=function(e,n,r,u){return e||(e={}),U(e,n,r,u),e},z=function(e,n){return Y(e,"fromFn",n,!1)},J=function(e,n){return new B(e,z(n,J))},G=function(e){var n=typeof e;return"object"!==n&&"function"!==n||null===e},Q=function(e){return!G(e)},V=function(e,n,r){return Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!1,configurable:!0}),r},$=V,H=function(e,n){Object.defineProperty(e,"name",{value:n,configurable:!0}),$(e,"displayName",n)},X=H,Z=function(e,n){return Object.assign(e,n)},ee=g()?require("util").inspect.custom:Symbol("Display"),ne=function(e,n){e.prototype[ee]=n},re=function(e,n,r,i,o,s){s||(s={}),u(n)&&(n=null);var c,l,a,f=r;if(f)if(d(f)){if([l,a]=f,l)if(d(l)){if(!n)throw K("Bare args array for instanceFn is only valid when extending a class.");var p=l;l=null,c=L((function(){this.super.apply(this,p)}),n)}else l=D(l)}else c=D(f,n);var h=s.bareFn;s.singleton&&(h=function(){return null==g.default&&(g.default=new g(...arguments)),g.default});var v,m=l||c||n||W;function g(){if(!new.target&&h&&!(this instanceof g))return h.apply(this,arguments);var e=this;return T(m.apply(e,arguments),(r=>{if(r&&Q(r)&&(e=r,l)){if(!new.target)throw J('Prototype repair is NYI for class instantiation without "new".');if(!n)throw J("instanceFn is not yet supported when extendsClass is null.");var u=Object.getPrototypeOf(this);Object.getPrototypeOf(e)!==u&&Object.setPrototypeOf(e,u)}return a?T(a.apply(e,arguments),(()=>e)):e}))}return e&&X(g,e),i?(v=i,n&&Object.setPrototypeOf(i,n.prototype)):v=n?Object.create(n.prototype):{},$(v,"constructor",g),g.prototype=v,o&&Z(g,o),s.display&&ne(g,s.display),s.implements&&N(s.implements).forEach((e=>e(g))),g},te=function(e,n){Object.defineProperty(e,n,{enumerable:!1})},ue=te,ie=function(e,n,r,u,i){var o=Symbol();return re(e,Function,[function(){var e=function(){return e[o].apply(this,arguments)};return e},function(){var e=n.apply(this,arguments);if(!e)throw new Error("Constructor must return a function.");this[o]=e,ue(this,o)}],r,u,i)},oe=function(e,n,r,u){return n=null==n?0:A(e,n),r=null==r?e.length:A(e,r),u&&(0==u.inclusiveStart&&n++,u.inclusiveEnd&&r++),[n,r]},se=function(e,n,r,u){var i=n;if([r,u]=oe(e,r,u),C(i))for(var o=r;o<u;o++)e[o]=i(o,e);else e.fill(i,r,u);return e},ce=function(e,n){var r=new Array(e||0);return arguments.length>1&&se(r,n),r},le=function(e,n){return ce(n.length,(r=>e[n[r]]))},ae=function(e,n){return e[n]},fe=function(e,n,r){return e[n]=r},pe=function(e,n,r){var u=e;return C(u)?u.apply(r,n):u},de=function(e,n,r,u,i){u||(u=ae);var o=u(e,n);return void 0===o&&(o=pe(r,[e,n]),i||(i=fe),i(e,n,o)),o},he=function(e,n){return e.get(n)},ve=function(e,n,r){return e.set(n,r)},me=function(e,n,r){return de(e,n,r,he,ve)},ge=class{constructor(){this.store=new Map}get(e,n){return me(this.store,e,n)}remove(e){return this.store.delete(e)}delete(e){return this.remove(e)}},ye=function(e,n){return e.push(n),e},we=ye,be=function(e){var n=e;return Array.isArray(n)?n:Array.from(n)},xe=Symbol("Value"),Ee=function(){return{}},Fe=function(e){return[e.slice(0,-1),e[e.length-1]]},Ae=Fe,Oe=function(e,n,r,u,i,o){r||(r=ae),null==u&&(u=Ee),null==i&&(i=fe),null==o&&(o=r);for(var[s,c]=Ae(n),l=e,a=s.length,f=0;f<a;f++){var p=s[f],d=r(l,p);if(void 0===d){if(!u)return;d=de(l,p,u,r,i)}l=d}if(o)return o(l,c,i)},Se=function(e,n,r,u,i,o){return Oe(e,n,u,i,o,((e,n)=>de(e,n,r,u,o)))},_e=function(){return new Map},Ie=function(e,n,r){return Se(e,n,r,he,_e,ve)},je=function(e,n){return delete e[n],e},ke=function(e,n,r,u){return Oe(e,n,r,!1,!1,u||je)},Ne=function(e,n){return e.delete(n)},qe=function(e,n){return ke(e,n,he,Ne)},Te=class{constructor(){this.store=new Map}get(e,n){return e=we(be(e),xe),Ie(this.store,e,n)}remove(e){return e=we(be(e),xe),qe(this.store,e)}delete(e){return this.remove(e)}},Ce=ie("MemoizedFunction",(function(e,n){if(this.base=e,null!=n)if(1===(n=N(n)).length){this.cache=new ge;var r=n[0];this._cacheKeyFormatter=e=>e[r]}else this.cache=new Te,this._cacheKeyFormatter=e=>le(e,n);else this.cache=new Te,this._cacheKeyFormatter=e=>e;var u=this;return function(){var n=u._cacheKeyFormatter(arguments);return u.cache.get(n,(()=>e.apply(this,arguments)))}}),{remove(e){return this.cache.remove(this._cacheKeyFormatter(e))}}),Re=function(e,n){return new Ce(e,n)},Me=function(e){return new Set(e)},Pe=function(e){var n={};if(e){var r=Me(e);r.has("g")&&(n.global=!0),r.has("i")&&(n.caseInsensitive=!0),r.has("y")&&(n.sticky=!0)}return n},Le=function(e){var n="";return e.global&&(n+="g"),(e.caseInsensitive||0==e.caseSensitive)&&(n+="i"),e.sticky&&(n+="y"),n},De=function(e,n){var r=Pe(e);return Le(Object.assign(r,n))},We=function(e,n){var r=n,i=void 0;return u(r)?i=r:F(r)&&(i=De(e.flags,r)),new RegExp(e,i)},Ke=function(e,n){return We(e,e.flags+n)},Be=function(e){return Ke(e,"g")},Ue=Re((function(e){return e.global?e:Be(e)}),0),Ye=function(e){var n=e;return null==n?void 0:u(n)?n:Le(n)},ze=function(e,n){return new RegExp(e,Ye(n))},Je=function(e){return e.replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,"\\$&")},Ge=function(e,n){return ze(Je(e),n)},Qe=function(e,n,r,i,o,s){return I(e,(function(e){return e.replaceAll?(k(n)&&(n=Ue(n)),e.replaceAll(n,r)):(n=u(n)?Ge(n,"g"):Ue(n),this.replace(n,r))}),i,o,s)},Ve=function(e,n,r){return Qe(e,n,(r??"\\")+n)},$e=function(e,n,r){return null==n&&(n='"'),!1!==r&&(e=Ve(e,n,r)),n+e+n},He=function(e){return $e(e,'"')},Xe=F,Ze=function(e){return Xe(e)?sn(e):String(e)},en=function(e,n){return n||(n=nn),"["+e.reduce((function(e,r){return e+n(r)+", "}),"").slice(0,-2)+"]"},nn=function(e){return u(e)?He(e):d(e)?en(e):Ze(e)},rn=function(e){return Reflect.ownKeys(e)},tn=function(e,n){return(n?rn:Object.keys)(e)},un=function(e,n,r){tn(e,r).forEach(((r,u,i)=>n(r,e[r],u,i)))},on=function(e,n,r,u){var i=null!=r?r:"";return un(e,(function(){i=n.call(this,i,...arguments)}),u),i},sn=function(e,n){return n||(n=nn),"{"+on(e,(function(e,r,u){return e+r+":"+n(u)+", "}),"",!0).slice(0,-2)+"}"},cn=function(e,n){return null==n&&(n=1),n<=0?"[object Object]":sn(e,(e=>an(e,n-1)))},ln=function(e,n){return null==n&&(n=1),n<=0?"[object Array]":en(e,(e=>an(e,n-1)))},an=function(e,n){return void 0===e?"undefined":null===e?"null":g()?x(e,n):F(e)?cn(e,maxNumLevels):d(e)?ln(e,maxNumLevels):Ze(e)},fn=function(e,n,r,u){if(0===arguments.length)return new m("Unexpected value received");u||(u={});var i,{expected:o}=u;return i=o?"Received "+an(e)+", expected one of "+an(o):"Unexpected value received: "+an(e),r&&(i+=' for "'+r+'"'),null!=n&&(i+=" (index "+n+")"),u.fromFn||(u.fromFn=fn),new m(i,u)},pn=h(globalThis.TypeError),dn=function(e){return null==e?e:e.constructor},hn=function(e,n,r,u){if(0===arguments.length)return new pn("Unexpected type received");u||(u={});var i,{type:o,expected:s}=u;return null==o&&(o=dn(e)),o&&o.name&&(o=o.name),s?(s.name&&(s=s.name),i="Expected "+s+", received "):i="Unexpected type received (",i+=o,null!=e&&(i+=" ("+an(e)+")"),s||(i+=")"),r&&(i+=' for "'+r+'"'),null!=n&&(i+=" (index "+n+")"),u.fromFn||(u.fromFn=hn),new pn(i,u)},vn=function(e){var n=e.stdio;if(n){if(!d(n)){if(!u(n))throw hn(n,"stdio");if("pipe"===n)n=["pipe","pipe","pipe"];else if("inherit"===n)n=["inherit","inherit","inherit"];else if("ignore"===n)n=["ignore","ignore","ignore"];else{if("overlapped"!==n)throw fn(n,"stdio");n=["overlapped","overlapped","overlapped"]}e.stdio=n}}else n=e.stdio=[null,null,null];return n},mn=function(e,n){var r=n.length;e.length=r;for(var u=0;u<r;u++)e[u]=n[u];return e},gn=function(e){return function(){return!e.apply(this,arguments)}},yn=function(e,n){return mn(e,e.filter(gn(n)))},wn=function(e){return yn(e,(e=>null==e))},bn=w("child_process"),xn=e((function(){return"win32"===process.platform})),En=function(e,n,r){if(r||(r={}),n(e))throw e;if(r.nullOnErr&&(r.err=null),void 0!==r.err)return r.err;if(r.onErr)return r.onErr(e,e.stderr);throw e},Fn=function(e,n,r){r||(r={}),r.dir&&(r.cwd=r.dir);var u=vn(r);if(null==u[0]){var i=r.allowInput,o=r.input;if(i&&o)throw K("allowInput (user) and input (programmatic) cannot be used simultaneously for synchronous child processes.");i&&(u[0]="inherit")}if(null==u[1]){var s=r.captureOutput??!1,c=r.showOutput;if(s&&c)throw K("captureOutput and showOutput cannot be used simultaneously for synchronous child processes.");s?u[1]="pipe":(null==c&&(c=!0),u[1]=c?"inherit":"ignore")}if(null==u[2]){var l=r.captureErr??!1,a=r.showErr;if(l&&a)throw K("captureErr and showErr cannot be used simultaneously for synchronous child processes.");l?u[2]="pipe":(null==a&&(a=!0),u[2]=a?"inherit":"ignore")}r.encoding||(r.encoding="utf8"),n&&wn(n);try{var f=bn().execFileSync(e,n,r);null!=f&&(f=f.trim());var p=r.map??r.mapFn;return p&&(f=p(f)),f}catch(e){if(xn())return En(e,(e=>"ENOENT"===e.code),r);throw e}},An=function(e,n){return n||(n={}),null==n.captureOutput&&(n.captureOutput=!1),n.shell=!0,n.filterExtensions=!1,Fn("npm",e,n)},On=function(e,n,r){return An(["install",e,n?"-g":null],r)},Sn=w("path"),_n=function(e,n){var r=Sn().resolve;return n?r(n,e):r(e)},In=function(e){return require(_n(e))},jn=class{constructor(){this.store={}}get(e,n){return U(this.store,e,n)}remove(e){return delete this.store[e]}delete(e){return this.remove(e)}},kn=new jn,Nn=w("module"),qn=function(e){return e.endsWith("\\node_modules")||(e+="\\node_modules"),Nn().createRequire(e)},Tn=function(e,n){return kn.get(e,(()=>qn(e)))(n)},Cn=function(e,n,r){return Object.keys(n).forEach((u=>U(e,u,n[u],r))),e},Rn=function(e,n,r){return n?Cn(e,n,r):e},Mn=function(e,n){return e.endsWith(n)?e.substring(0,e.length-n.length):e},Pn=function(e){return e[e.length-1]},Ln=A,Dn=function(e,n,r){return e=We(e,{global:!0}),null!=r&&(n=Ln(r,n)),e.lastIndex=n,e},Wn=function(e,n,r){return e=null!=r?Dn(e,r,n):Ue(e),Array.from(n.matchAll(e))},Kn=function(e,n,r){return null!=r&&(n=n.slice(0,r)),Pn(Wn(e,n))||null},Bn=function(e,n){var r=Kn(e,n);return r&&n.length===r.index+r[0].length?r:null},Un=function(e,n){var r=Bn(n,e);return r?e.slice(0,r.index):e},Yn=function(e,n){if(u(n))return Mn(e,n);if(k(n))return Un(e,n);throw hn(n,1)},zn=Yn,Jn=function(e,n){return[e.slice(0,n),e.slice(n)]},Gn=function(e){e=zn(e.trim(),";");var n=Math.max(e.lastIndexOf(";"),e.lastIndexOf("\n"));return Jn(e,n+1)},Qn=function(e,n){return e.startsWith(n)?e:n+e},Vn=function(e){var[n,r]=Gn(e);return n+Qn(r.trim(),"return ")},$n=function(e){return vt("node-repl-await").processTopLevelAwait(e)},Hn=function(e){return $n(e)??e},Xn=Qe,Zn=function(e,n){if(u(n))return e.endsWith(e);if(k(n))return!!Bn(n,e);throw hn(n,1,"matchThis")},er=/\/|\\/,nr=function(e){return Zn(e,er)?e:e+"/"},rr=function(e,n){return""===e?e:(null==n&&(n=!0),e=Xn(e,"\\","/"),n?nr(e):e)},tr=function(){return process.mainModule?.filename??null},ur=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},ir=function(e){return e.split(".")[0]},or=function(e){return Sn().win32.basename(e)},sr=function(e){return ir(or(e))},cr=function(e,n,r,u){e||(e=tr()??"_console.js");var i=ur(sr(e));return n&&(i+="_repl"),i+(r&&u?.dynamic?".dypkg.json":".pkg.js")},lr=function(e,n){return e=Sn().dirname(e),!1===n?e:nr(e)},ar=function(e,n,r,u){var i,o=cr(e,n,r,u);return i=e?lr(e):"./",_n(i+o)},fr=function(e){return'require("'+rr(ar(),!1)+'");\n'+e},pr=function(e,n){return Qe(e,n,"")},dr=function(e,n){return n.forEach((n=>e=pr(e,n))),e},hr=function(e){return dr(e,["\r","\n"])},vr=function(e,n){return vt("astring").generate(e,n)},mr=function(e,n){return e.stack=n+"\n"+e.stack,e},gr=function(e,n,r){r||(r={}),!1!==n&&(r.sourceType="module"),null==r.allowAwaitOutsideFunction&&(r.allowAwaitOutsideFunction=!0);var u=vt("acorn-node");try{return u.parse(e,r)}catch(n){throw mr(n,"Acorn parsing error: "+e)}},yr=function(e,n,r){return vr(gr(e,n,r))},wr=function(e){return hr(yr(e))},br=function(e,n,r){return(n||r)&&(n||(n={}),r&&Rn(n,r),n.ensureReturn&&(e=Vn(e)),n.topLevelAwait&&(e=Hn(e)),n.useTitan&&(e=fr(e)),n.keepAlive&&(e="\nsetInterval(()=>{}, 100000);\n"+e),(n.logErrors||n.keepAlive)&&(e="process.on('uncaughtException', console.error);\nprocess.on('unhandledRejection', console.error);\n"+e),n.inline&&(e=wr(e))),e},xr=function(e){return u(e)?e:Ze(e)},Er=function(e){var n=e.indexOf("{");return-1===n||e.slice(0,n).includes("=>")},Fr=function(e,n,r,u,i){return _(e,n,r,u,((n,r)=>null===n?null:(n.input=e,void 0!==r&&(n.index+=r),n)),i)},Ar=function(e,n){return e.splice(e.length,0,...n),n},Or=function(e,n){return Ar(e,n),e},Sr=Or,_r=class extends Array{constructor(e,n,r,u,i){if(-1===n)throw K("RegexResult index cannot be -1. For empty result, use bare null.");if(null==e)throw K("RegexResult matchString cannot be null. For empty result, use bare null.");super(),this[0]=e,u&&Sr(this,u),this.index=n,this.input=r,i&&(this.groups=i)}fromParts(e){var n=e;return new _r(n.match,n.index,n.input,n.captures,n.groups)}},Ir=function(e,n,r,u,i){return new _r(e,n,r,u,i)},jr=function(e,n,r,u,i){return-1===n||null==e?null:Ir(e,n,r,u,i)},kr=pr,Nr=function(e,n){return We(e,kr(e.flags,n))},qr=function(e){return Nr(e,"g")},Tr=Re((function(e){return e.global?qr(e):e}),0),Cr=function(e,n,r){return(e=null!=r?Dn(e,r,n):Tr(e)).exec(n)},Rr=function(e,n,r,i,o){return Fr(e,(e=>{if(u(n)){var r=e.indexOf(n);return jr(n,r,e)}return Cr(n,e)}),r,i,o)},Mr=function(e){return e.index+e[0].length},Pr=function(e,n){var r=Rr(e,n);return null===r[0]?null:e.slice(Mr(r))},Lr=function(e,n){return e.startsWith(n)?e.substring(n.length):e},Dr=function(e,n){var r=Cr(e,n);return r&&0===r.index?r:null},Wr=function(e,n){var r=Dr(n,e);return r?e.slice(r[0].length):e},Kr=function(e,n){if(u(n))return Lr(e,n);if(k(n))return Wr(e,n);throw hn(n,1)},Br=Kr,Ur=function(e){var n=Pr(e,"=>").trim();return Br(zn(n,"}"),"{")},Yr=function(e){return Pr(e,"{").slice(0,-1)},zr=function(e){var n=xr(e);return Er(n)?Ur(n):Yr(n)},Jr=function(e){return null==e?"":u(e)?e:C(e)?zr(e):String(e)},Gr=function(e,n){var r=n?.basic?null:{topLevelAwait:!0,useTitan:!0},u=br(Jr(e),n,r);return Fn("node",["-e",u],n)},Qr=function(e,n,r,u){var i="Required argument";return r&&(i+=' "'+r+'"'),null!=n&&(i+=" (index "+n+")"),i+=" missing",arguments.length>0&&(i+=" (received "+an(e)+")"),K(i,null,z(u,Qr))},Vr=function(e,n,r){if(null==e)throw Qr(e,n,r,{fromFn:Vr});return e},$r=function(e,n){return process.kill(e,Vr(n,0,"signalName"))},Hr=function(e){return $r(e,"SIGINT")},Xr=function(){return Hr(process.pid)},Zr=Xr,et=function(e){if("Y"===(e=e.toUpperCase()))return!0;if("N"===e)return!1;throw fn(e,0,"char")},nt=function(e){null==e&&(e="Are you sure? [y/n]: "),process.stdout.write(e);var n=Gr((function(){const e=process.stdin,n=process.stdout;e.setRawMode(!0),e.setEncoding("utf8"),e.on("data",(e=>{var r=e.toUpperCase();"Y"===r||"N"===r?(n.write(e),process.exit(0)):""===e&&(n.write("^C"),process.exit(0))}))}),{basic:!0,stdio:["inherit","pipe"]});if("^C"===n)throw process.stdout.write(n),Zr(),K("Prompt was cancelled via interrupt.");return console.log(n),et(n)},rt=function(e){return d(e)?e:u(e)?e.split("."):[e]},tt=function(e,n,r,u,i,o){var s=r;return Oe(e,n,u,i,o,((e,n,r)=>r(e,n,pe(s))))},ut=function(e,n){var r=n,u=globalThis.config;u||(u=globalThis.config={});var i,o=rt(e);return o.length>1?i=tt(u,o,r):(i=pe(r),u[o[0]]=i),i},it=function(e,n){return ut("node.require.customDirs",(r=>(r||(r=[]),!1!==n&&(e.endsWith("node_modules")||(e+="\\node_modules")),r.includes(e)||r.push(e),r))),e},ot=it,st=Oe,ct=function(e){var n=globalThis.config;if(n){var r=rt(e);return r.length>1?st(n,r):n[r[0]]}},lt=function(e,n,r){if(null!=e)return e;var u=ct(n);return null!=u?u:r},at=w("fs"),ft=function(e){return!!at().lstatSync(e,{throwIfNoEntry:!1})},pt=function(e){var n=lr(e,!1);return ft(n)||(n!==e&&pt(n),at().mkdirSync(n)),e},dt=function(e){return pt(e),at().mkdirSync(e),e},ht=function(e){return ft(e)?e:dt(e)},vt=function(e,n){if(f(e))return require(e);if(p(e))return In(e);try{return require(e)}catch(e){}var r=__dirname,u=process.mainModule?.path;if(u!==r)try{return Tn(u,e)}catch(e){}var i=process.cwd();if(i!==u&&i!==r)try{return Tn(i,e)}catch(e){}var o=ct("node.require.customDirs");if(o)for(var s of o)try{return Tn(s,e)}catch(e){}var c=lt(n?.autoInstall,"node.require.autoInstall"),l=lt(n?.promptInstall,"node.require.promptInstall",!0);if(c||l){var a=c||l;!0===a&&(a="./node_modules"),a=_n(a);var d=!1;if(c?(d=!0,console.log('Auto-installing "'+e+'" from npm to "'+a+'"...')):(d=nt('Npm package "'+e+'" is required. Install now? (Y/N) '))&&console.log('Installing "'+e+'" from npm to "'+a+'"...'),d){a=ht(a),On(e,!1,{cwd:a});try{return ot(a),Tn(a,e)}catch(e){console.error("Failed to load from auto-install dir: ",a)}}}throw K('Module not found: "'+e+'"',{checked:{moduleDir:r,scriptDir:u,cwd:i}})},mt=function(e,n,r){if(g()){var u=Sn().join(e,n);return r?nr(u):u}throw J()},gt=function(e){return at().readFileSync(e,"utf8")},yt=gt,wt=function(e){return JSON.parse(yt(e))},bt={env:{parseArgs:l,args:r,setConfig:ut,getConfig:ct,resolveConfig:lt},node:{parseArgs:c,args:n,pause:function(e){vt("press-any-key-sync")(e)},require:vt,_basicRequire:a,is:g,display:x,util:b,_builtInModule:w,requireBuiltIn:y,child_process:bn,requireLocal:In,path:Sn,_requireFromDir:Tn,_requireDirCache:kn,_createRequire:qn,module:Nn,promptYNSync:nt,run:Gr,getScriptPath:tr,sigint:Zr,interrupt:Xr,ensureRequireDir:ot,addRequireDir:it,fs:at,loadPackageJSON:function(e){var n=e??"./";return n.endsWith("package.json")||(n=mt(n,"package.json")),ft(n)?wt(n):{}}},shell:{parseArgs:s,_handleError:En},cli:{parseArgs:o,splitArgs:i},f:{one:e,memoize:Re,MemoizedFunction:Ce,createClass:ie,createConstructor:L,isArrowFn:M,isArrow:R,is:C,wrap:P,ensureConstructor:D,retThis:W,setName:H,not:gn,body:zr,isArrowString:Er,_getArrowFnBody:Ur,_getNormalFnBody:Yr},s:{is:u,toLiteral:He,quote:$e,escape:Ve,replaceAll:Qe,apply:I,withIndices:_,chars:Me,from:Ze,removeTrailing:zn,removeFromEnd:Yn,_removeStringFromEnd:Mn,_removeRegexFromEnd:Un,resolveIndex:Ln,splitAtIndex:Jn,ensureStartsWith:Qn,replace:Xn,endsWith:Zn,decapitalize:ur,removeLineBreaks:hr,removeMulti:dr,removeAll:pr,resolve:Jr,ensure:xr,after:Pr,match:Rr,_matchWithIndices:Fr,remove:kr,removeLeading:Br,removeFromStart:Kr,_removeStringFromStart:Lr,_removeRegexFromStart:Wr},npm:{isBuiltIn:f,isFile:p,install:On,_runCommand:An},os:{run:Fn,_resolveStdio:vn},a:{is:d,wrapIndices:S,wrapIndex:O,resolveIndex:A,ensure:N,pick:le,create:ce,fill:se,resolveIndices:oe,push:we,add:ye,splitLast:Ae,splitTail:Fe,toLiteral:en,display:ln,removeNullish:wn,removeByFilter:yn,replaceContents:mn,last:Pn,pushMulti:Sr,addMulti:Or,pushThroughMulti:Ar},err:{value:fn,ValueError:m,Error:v,Enhanced:h,create:K,nyi:J,NYIError:B,defaultFromFn:z,type:hn,TypeError:pn,prepend:mr,req:Qr},v:{display:an,constructorMatches:E,toLiteral:nn,isPrimitive:G,resolve:pe,type:dn,req:Vr},macro:{config:function(e){}},o:{is:F,display:cn,toLiteral:sn,constructorMatches:j,safeEnsure:Y,ensure:U,isAny:Q,setHidden:$,addNonEnumerable:V,hideKey:ue,makeNonEnumerable:te,ensureCustom:de,get:ae,set:fe,createEmpty:Ee,remove:je,isPure:Xe,reduce:on,each:un,keys:tn,allKeys:rn,Cache:jn,setDefaults:Rn,ensureMulti:Cn,resolveKeys:rt,diveGet:st},re:{is:k,ensureGlobal:Ue,global:Be,addFlag:Ke,copy:We,updateFlagString:De,parseFlagString:Pe,createFlagString:Le,createEscaped:Ge,create:ze,resolveFlags:Ye,escape:Je,matchEnd:Bn,matchLast:Kn,matchAll:Wn,setStartIndex:Dn,slash:er,safeCreateResult:jr,createResult:Ir,RegexResult:_r,match:Cr,ensureLocal:Tr,local:qr,removeFlag:Nr,resultEndIndex:Mr,matchStart:Dr},class:{create:re,setName:X,addStatics:Z,setDisplay:ne},p:{asyncJoint:T,is:q},sym:{display:ee,value:xe},map:{Cache:ge,ensure:me,get:he,set:ve,MultiCache:Te,diveEnsure:Ie,createEmpty:_e,diveDelete:qe,remove:Ne},args:{ensureArray:be},tree:{ensure:Se,dive:Oe,remove:ke,setCustom:tt},win:{is:xn},path:{abs:_n,fws:rr,ensureTrailingSlash:nr,baseName:sr,_removeExtsFromFile:ir,file:or,dir:lr,join:mt},js:{enhance:br,ensureReturn:Vn,splitLastExpression:Gn,enableAwait:Hn,_nodeEnableAwait:$n,useTitan:fr,inline:wr,removeComments:yr,fromAST:vr,parse:gr},titan:{getPackagePath:ar,getPackageName:cr},proc:{interrupt:Hr,signal:$r},bool:{fromYN:et},fs:{ensureDir:ht,exists:ft,mkdir:dt,ensureParent:pt,loadJSON:wt,loadText:yt,load:gt}};globalThis.t?Object.keys(bt).forEach((function(e){if(t[e]){var n=bt[e];Object.keys(n).forEach((function(r){t[e][r]=n[r]}))}else t[e]=bt[e]})):globalThis.t=Object.assign({},bt),globalThis.exports&&(exports.default=globalThis.t);
|
|
1
|
+
var e=function(e){var n,r=!1;return function(){return r||(r=!0,n=e.apply(this,arguments)),n}},n=e((function(){return process.argv.slice(2)})),r=n,u=function(e){return"string"==typeof e},i=function(e){const n=[];let r="",u="outside",i=!1;for(let o=0;o<e.length;o++){const s=e[o];switch(u){case"outside":'"'===s?i?(r+=s,i=!1):u="insideQuote":"\\"===s?i=!0:" "===s?(r.length>0&&(n.push(r),r=""),i=!1):(r+=s,i=!1);break;case"insideQuote":'"'!==s||i?"\\"!==s||i?(r+=s,i=!1):i=!0:u="outside"}}return r.length>0&&n.push(r),n},o=function(e){for(var n,o=[],s=!1,c=(n=null==(a=e)?r():u(a)?i(a):a).length,l=0;l<c;l++){var a=n[l];if(!s){var f=a[0];let e;if("-"===f)if("-"===a[1]){if(2===a.length){s=!0;continue}e=2}else e=1;else"/"===f&&(e=1);if(e){var p,d,h=a.slice(e),v=h.indexOf("=");if(-1!==v)p=h.slice(0,v),d=h.slice(v+1);else{p=h;var m=n[l+1];null==m||"-"===m[0]?d=!0:(d=m,l++)}o[p]=d;continue}}o.push(a)}return o},s=o,c=s,l=c,a=function(e){return require(e)},f=function(e){return!!e.startsWith("node:")||a("node:module").isBuiltin(e)},p=function(e){return e.startsWith(".")},d=function(e){return Array.isArray(e)},h=function(e){return class extends e{constructor(e,n){super(e,n);var r=this.constructor.name;r&&(this.name=r)}}},v=h(globalThis.Error),m=class extends v{constructor(e,n){super(e??"Unexpected value",n)}},g=e((function(){return"undefined"==typeof window})),y=function(e){return require("node:"+e)},w=function(n){return e((()=>y(n)))},b=w("util"),x=function(e,n){return n||(n={}),null==n.colors&&(n.colors=!0),b().inspect(e,n)},E=function(e,n){return null!=e&&e.constructor===n},F=function(e){return E(e,Object)},A=function(e,n){return n<0?e.length+n:n},O=A,S=function(e,n,r,u){return void 0!==n&&(null===n||0===n?n=void 0:(n=O(e,n),u&&0==u.inclusiveStart&&n++)),void 0!==r&&(null===r||r===e.length?r=void 0:(r=O(e,r),u&&u.inclusiveEnd&&r++)),[n,r]},_=function(e,n,r,u,i,o){if(r||null!=u){[r,u]=S(e,r,u,o);var s=e.slice(r,u),c=n(s);return i?i(c,r,u,s,e):c}return n(e)},I=function(e,n,r,u,i){return _(e,n,r,u,((n,r,u)=>(void 0!==r?e.slice(0,r):"")+(n||"")+(void 0!==u?e.slice(u):"")),i)},j=E,k=function(e){return j(e,RegExp)},N=function(e){return d(e)?e:[e]},q=function(e){return e instanceof Promise},T=function(e,n){var r=e;return q(r)?r.then(n):n(r)},C=function(e){return"function"==typeof e},R=function(e){return C(e)&&null==e.prototype},M=R,P=function(e){return function(){return e.apply(this,arguments)}},L=function(e,n){var r;return r=n?function(){this.super=n;var r=e.apply(this,arguments);return T(r,(()=>(delete this.super,r)))}:M(e)?P(e):e,r._isConstructor=!0,r},D=function(e,n){return e._isConstructor?e:L(e,n)},W=function(){return this},K=function(e,n,r){var u=new v(e,r);return n&&Object.assign(u,n),u},B=class extends v{constructor(e,n){super(e??"Not yet implemented",n)}},U=function(e,n,r,u){var i=e[n];if(void 0===i){var o=r;!1!==u&&C(o)&&(o=o(e,n)),e[n]=i=o}return i},Y=function(e,n,r,u){return e||(e={}),U(e,n,r,u),e},z=function(e,n){return Y(e,"fromFn",n,!1)},J=function(e,n){return new B(e,z(n,J))},G=function(e){var n=typeof e;return"object"!==n&&"function"!==n||null===e},Q=function(e){return!G(e)},V=function(e,n,r){return Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!1,configurable:!0}),r},$=V,H=function(e,n){Object.defineProperty(e,"name",{value:n,configurable:!0}),$(e,"displayName",n)},X=H,Z=function(e,n){return Object.assign(e,n)},ee=g()?require("util").inspect.custom:Symbol("Display"),ne=function(e,n){e.prototype[ee]=n},re=function(e,n,r,i,o,s){s||(s={}),u(n)&&(n=null);var c,l,a,f=r;if(f)if(d(f)){if([l,a]=f,l)if(d(l)){if(!n)throw K("Bare args array for instanceFn is only valid when extending a class.");var p=l;l=null,c=L((function(){this.super.apply(this,p)}),n)}else l=D(l)}else c=D(f,n);var h=s.bareFn;s.singleton&&(h=function(){return null==g.default&&(g.default=new g(...arguments)),g.default});var v,m=l||c||n||W;function g(){if(!new.target&&h&&!(this instanceof g))return h.apply(this,arguments);var e=this;return T(m.apply(e,arguments),(r=>{if(r&&Q(r)&&(e=r,l)){if(!new.target)throw J('Prototype repair is NYI for class instantiation without "new".');if(!n)throw J("instanceFn is not yet supported when extendsClass is null.");var u=Object.getPrototypeOf(this);Object.getPrototypeOf(e)!==u&&Object.setPrototypeOf(e,u)}return a?T(a.apply(e,arguments),(()=>e)):e}))}return e&&X(g,e),i?(v=i,n&&Object.setPrototypeOf(i,n.prototype)):v=n?Object.create(n.prototype):{},$(v,"constructor",g),g.prototype=v,o&&Z(g,o),s.display&&ne(g,s.display),s.implements&&N(s.implements).forEach((e=>e(g))),g},te=function(e,n){Object.defineProperty(e,n,{enumerable:!1})},ue=te,ie=function(e,n,r,u,i){var o=Symbol();return re(e,Function,[function(){var e=function(){return e[o].apply(this,arguments)};return e},function(){var e=n.apply(this,arguments);if(!e)throw new Error("Constructor must return a function.");this[o]=e,ue(this,o)}],r,u,i)},oe=function(e,n,r,u){return n=null==n?0:A(e,n),r=null==r?e.length:A(e,r),u&&(0==u.inclusiveStart&&n++,u.inclusiveEnd&&r++),[n,r]},se=function(e,n,r,u){var i=n;if([r,u]=oe(e,r,u),C(i))for(var o=r;o<u;o++)e[o]=i(o,e);else e.fill(i,r,u);return e},ce=function(e,n){var r=new Array(e||0);return arguments.length>1&&se(r,n),r},le=function(e,n){return ce(n.length,(r=>e[n[r]]))},ae=function(e,n){return e[n]},fe=function(e,n,r){return e[n]=r},pe=function(e,n,r){var u=e;return C(u)?u.apply(r,n):u},de=function(e,n,r,u,i){u||(u=ae);var o=u(e,n);return void 0===o&&(o=pe(r,[e,n]),i||(i=fe),i(e,n,o)),o},he=function(e,n){return e.get(n)},ve=function(e,n,r){return e.set(n,r)},me=function(e,n,r){return de(e,n,r,he,ve)},ge=class{constructor(){this.store=new Map}get(e,n){return me(this.store,e,n)}remove(e){return this.store.delete(e)}delete(e){return this.remove(e)}},ye=function(e,n){return e.push(n),e},we=ye,be=function(e){var n=e;return Array.isArray(n)?n:Array.from(n)},xe=Symbol("Value"),Ee=function(){return{}},Fe=function(e){return[e.slice(0,-1),e[e.length-1]]},Ae=Fe,Oe=function(e,n,r,u,i,o){r||(r=ae),null==u&&(u=Ee),null==i&&(i=fe),null==o&&(o=r);for(var[s,c]=Ae(n),l=e,a=s.length,f=0;f<a;f++){var p=s[f],d=r(l,p);if(void 0===d){if(!u)return;d=de(l,p,u,r,i)}l=d}if(o)return o(l,c,i)},Se=function(e,n,r,u,i,o){return Oe(e,n,u,i,o,((e,n)=>de(e,n,r,u,o)))},_e=function(){return new Map},Ie=function(e,n,r){return Se(e,n,r,he,_e,ve)},je=function(e,n){return delete e[n],e},ke=function(e,n,r,u){return Oe(e,n,r,!1,!1,u||je)},Ne=function(e,n){return e.delete(n)},qe=function(e,n){return ke(e,n,he,Ne)},Te=class{constructor(){this.store=new Map}get(e,n){return e=we(be(e),xe),Ie(this.store,e,n)}remove(e){return e=we(be(e),xe),qe(this.store,e)}delete(e){return this.remove(e)}},Ce=ie("MemoizedFunction",(function(e,n){if(this.base=e,null!=n)if(1===(n=N(n)).length){this.cache=new ge;var r=n[0];this._cacheKeyFormatter=e=>e[r]}else this.cache=new Te,this._cacheKeyFormatter=e=>le(e,n);else this.cache=new Te,this._cacheKeyFormatter=e=>e;var u=this;return function(){var n=u._cacheKeyFormatter(arguments);return u.cache.get(n,(()=>e.apply(this,arguments)))}}),{remove(e){return this.cache.remove(this._cacheKeyFormatter(e))}}),Re=function(e,n){return new Ce(e,n)},Me=function(e){return new Set(e)},Pe=function(e){var n={};if(e){var r=Me(e);r.has("g")&&(n.global=!0),r.has("i")&&(n.caseInsensitive=!0),r.has("y")&&(n.sticky=!0)}return n},Le=function(e){var n="";return e.global&&(n+="g"),(e.caseInsensitive||0==e.caseSensitive)&&(n+="i"),e.sticky&&(n+="y"),n},De=function(e,n){var r=Pe(e);return Le(Object.assign(r,n))},We=function(e,n){var r=n,i=void 0;return u(r)?i=r:F(r)&&(i=De(e.flags,r)),new RegExp(e,i)},Ke=function(e,n){return We(e,e.flags+n)},Be=function(e){return Ke(e,"g")},Ue=Re((function(e){return e.global?e:Be(e)}),0),Ye=function(e){var n=e;return null==n?void 0:u(n)?n:Le(n)},ze=function(e,n){return new RegExp(e,Ye(n))},Je=function(e){return e.replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,"\\$&")},Ge=function(e,n){return ze(Je(e),n)},Qe=function(e,n,r,i,o,s){return I(e,(function(e){return e.replaceAll?(k(n)&&(n=Ue(n)),e.replaceAll(n,r)):(n=u(n)?Ge(n,"g"):Ue(n),this.replace(n,r))}),i,o,s)},Ve=function(e,n,r){return Qe(e,n,(r??"\\")+n)},$e=function(e,n,r){return null==n&&(n='"'),!1!==r&&(e=Ve(e,n,r)),n+e+n},He=function(e){return $e(e,'"')},Xe=F,Ze=function(e){return Xe(e)?sn(e):String(e)},en=function(e,n){return n||(n=nn),"["+e.reduce((function(e,r){return e+n(r)+", "}),"").slice(0,-2)+"]"},nn=function(e){return u(e)?He(e):d(e)?en(e):Ze(e)},rn=function(e){return Reflect.ownKeys(e)},tn=function(e,n){return(n?rn:Object.keys)(e)},un=function(e,n,r){tn(e,r).forEach(((r,u,i)=>n(r,e[r],u,i)))},on=function(e,n,r,u){var i=null!=r?r:"";return un(e,(function(){i=n.call(this,i,...arguments)}),u),i},sn=function(e,n){return n||(n=nn),"{"+on(e,(function(e,r,u){return e+r+":"+n(u)+", "}),"",!0).slice(0,-2)+"}"},cn=function(e,n){return null==n&&(n=1),n<=0?"[object Object]":sn(e,(e=>an(e,n-1)))},ln=function(e,n){return null==n&&(n=1),n<=0?"[object Array]":en(e,(e=>an(e,n-1)))},an=function(e,n){return void 0===e?"undefined":null===e?"null":g()?x(e,n):F(e)?cn(e,maxNumLevels):d(e)?ln(e,maxNumLevels):Ze(e)},fn=function(e,n,r,u){if(0===arguments.length)return new m("Unexpected value received");u||(u={});var i,{expected:o}=u;return i=o?"Received "+an(e)+", expected one of "+an(o):"Unexpected value received: "+an(e),r&&(i+=' for "'+r+'"'),null!=n&&(i+=" (index "+n+")"),u.fromFn||(u.fromFn=fn),new m(i,u)},pn=h(globalThis.TypeError),dn=function(e){return null==e?e:e.constructor},hn=function(e,n,r,u){if(0===arguments.length)return new pn("Unexpected type received");u||(u={});var i,{type:o,expected:s}=u;return null==o&&(o=dn(e)),o&&o.name&&(o=o.name),s?(s.name&&(s=s.name),i="Expected "+s+", received "):i="Unexpected type received (",i+=o,null!=e&&(i+=" ("+an(e)+")"),s||(i+=")"),r&&(i+=' for "'+r+'"'),null!=n&&(i+=" (index "+n+")"),u.fromFn||(u.fromFn=hn),new pn(i,u)},vn=function(e){var n=e.stdio;if(n){if(!d(n)){if(!u(n))throw hn(n,"stdio");if("pipe"===n)n=["pipe","pipe","pipe"];else if("inherit"===n)n=["inherit","inherit","inherit"];else if("ignore"===n)n=["ignore","ignore","ignore"];else{if("overlapped"!==n)throw fn(n,"stdio");n=["overlapped","overlapped","overlapped"]}e.stdio=n}}else n=e.stdio=[null,null,null];return n},mn=function(e,n){var r=n.length;e.length=r;for(var u=0;u<r;u++)e[u]=n[u];return e},gn=function(e){return function(){return!e.apply(this,arguments)}},yn=function(e,n){return mn(e,e.filter(gn(n)))},wn=function(e){return yn(e,(e=>null==e))},bn=w("child_process"),xn=e((function(){return"win32"===process.platform})),En=function(e,n,r){if(r||(r={}),n(e))throw e;if(r.nullOnErr&&(r.err=null),void 0!==r.err)return r.err;if(r.onErr)return r.onErr(e,e.stderr);throw e},Fn=function(e,n,r){r||(r={}),r.dir&&(r.cwd=r.dir);var u=vn(r);if(null==u[0]){var i=r.allowInput,o=r.input;if(i&&o)throw K("allowInput (user) and input (programmatic) cannot be used simultaneously for synchronous child processes.");i&&(u[0]="inherit")}if(null==u[1]){var s=r.captureOutput??!1,c=r.showOutput;if(s&&c)throw K("captureOutput and showOutput cannot be used simultaneously for synchronous child processes.");s?u[1]="pipe":(null==c&&(c=!0),u[1]=c?"inherit":"ignore")}if(null==u[2]){var l=r.captureErr??!1,a=r.showErr;if(l&&a)throw K("captureErr and showErr cannot be used simultaneously for synchronous child processes.");l?u[2]="pipe":(null==a&&(a=!0),u[2]=a?"inherit":"ignore")}r.encoding||(r.encoding="utf8"),n&&wn(n);try{var f=bn().execFileSync(e,n,r);null!=f&&(f=f.trim());var p=r.map??r.mapFn;return p&&(f=p(f)),f}catch(e){if(xn())return En(e,(e=>"ENOENT"===e.code),r);throw e}},An=function(e,n){return n||(n={}),null==n.captureOutput&&(n.captureOutput=!1),n.shell=!0,n.filterExtensions=!1,Fn("npm",e,n)},On=function(e,n,r){return An(["install",e,n?"-g":null],r)},Sn=w("path"),_n=function(e,n){var r=Sn().resolve;return n?r(n,e):r(e)},In=function(e){return require(_n(e))},jn=class{constructor(){this.store={}}get(e,n){return U(this.store,e,n)}remove(e){return delete this.store[e]}delete(e){return this.remove(e)}},kn=new jn,Nn=w("module"),qn=function(e){return e.endsWith("\\node_modules")||(e+="\\node_modules"),Nn().createRequire(e)},Tn=function(e,n){return kn.get(e,(()=>qn(e)))(n)},Cn=function(e,n,r){return Object.keys(n).forEach((u=>U(e,u,n[u],r))),e},Rn=function(e,n,r){return n?Cn(e,n,r):e},Mn=function(e,n){return e.endsWith(n)?e.substring(0,e.length-n.length):e},Pn=function(e){return e[e.length-1]},Ln=A,Dn=function(e,n,r){return e=We(e,{global:!0}),null!=r&&(n=Ln(r,n)),e.lastIndex=n,e},Wn=function(e,n,r){return e=null!=r?Dn(e,r,n):Ue(e),Array.from(n.matchAll(e))},Kn=function(e,n,r){return null!=r&&(n=n.slice(0,r)),Pn(Wn(e,n))||null},Bn=function(e,n){var r=Kn(e,n);return r&&n.length===r.index+r[0].length?r:null},Un=function(e,n){var r=Bn(n,e);return r?e.slice(0,r.index):e},Yn=function(e,n){if(u(n))return Mn(e,n);if(k(n))return Un(e,n);throw hn(n,1)},zn=Yn,Jn=function(e,n){return[e.slice(0,n),e.slice(n)]},Gn=function(e){e=zn(e.trim(),";");var n=Math.max(e.lastIndexOf(";"),e.lastIndexOf("\n"));return Jn(e,n+1)},Qn=function(e,n){return e.startsWith(n)?e:n+e},Vn=function(e){var[n,r]=Gn(e);return n+Qn(r.trim(),"return ")},$n=function(e){return vt("node-repl-await").processTopLevelAwait(e)},Hn=function(e){return $n(e)??e},Xn=Qe,Zn=function(e,n){if(u(n))return e.endsWith(e);if(k(n))return!!Bn(n,e);throw hn(n,1,"matchThis")},er=/\/|\\/,nr=function(e){return Zn(e,er)?e:e+"/"},rr=function(e,n){return""===e?e:(null==n&&(n=!0),e=Xn(e,"\\","/"),n?nr(e):e)},tr=function(){return process.mainModule?.filename??null},ur=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},ir=function(e){return e.split(".")[0]},or=function(e){return Sn().win32.basename(e)},sr=function(e){return ir(or(e))},cr=function(e,n,r,u){e||(e=tr()??"_console.js");var i=ur(sr(e));return n&&(i+="_repl"),i+(r&&u?.dynamic?".dypkg.json":".pkg.js")},lr=function(e,n){return e=Sn().dirname(e),!1===n?e:nr(e)},ar=function(e,n,r,u){var i,o=cr(e,n,r,u);return i=e?lr(e):"./",_n(i+o)},fr=function(e){return'require("'+rr(ar(),!1)+'");\n'+e},pr=function(e,n){return Qe(e,n,"")},dr=function(e,n){return n.forEach((n=>e=pr(e,n))),e},hr=function(e){return dr(e,["\r","\n"])},vr=function(e,n){return vt("astring").generate(e,n)},mr=function(e,n){return e.stack=n+"\n"+e.stack,e},gr=function(e,n,r){r||(r={}),!1!==n&&(r.sourceType="module"),null==r.allowAwaitOutsideFunction&&(r.allowAwaitOutsideFunction=!0);var u=vt("acorn-node");try{return u.parse(e,r)}catch(n){throw mr(n,"Acorn parsing error: "+e)}},yr=function(e,n,r){return vr(gr(e,n,r))},wr=function(e){return hr(yr(e))},br=function(e,n,r){return(n||r)&&(n||(n={}),r&&Rn(n,r),n.ensureReturn&&(e=Vn(e)),n.topLevelAwait&&(e=Hn(e)),n.useTitan&&(e=fr(e)),n.keepAlive&&(e="\nsetInterval(()=>{}, 100000);\n"+e),(n.logErrors||n.keepAlive)&&(e="process.on('uncaughtException', console.error);\nprocess.on('unhandledRejection', console.error);\n"+e),n.inline&&(e=wr(e))),e},xr=function(e){return u(e)?e:Ze(e)},Er=function(e){var n=e.indexOf("{");return-1===n||e.slice(0,n).includes("=>")},Fr=function(e,n,r,u,i){return _(e,n,r,u,((n,r)=>null===n?null:(n.input=e,void 0!==r&&(n.index+=r),n)),i)},Ar=function(e,n){return e.splice(e.length,0,...n),n},Or=function(e,n){return Ar(e,n),e},Sr=Or,_r=class extends Array{constructor(e,n,r,u,i){if(-1===n)throw K("RegexResult index cannot be -1. For empty result, use bare null.");if(null==e)throw K("RegexResult matchString cannot be null. For empty result, use bare null.");super(),this[0]=e,u&&Sr(this,u),this.index=n,this.input=r,i&&(this.groups=i)}fromParts(e){var n=e;return new _r(n.match,n.index,n.input,n.captures,n.groups)}},Ir=function(e,n,r,u,i){return new _r(e,n,r,u,i)},jr=function(e,n,r,u,i){return-1===n||null==e?null:Ir(e,n,r,u,i)},kr=pr,Nr=function(e,n){return We(e,kr(e.flags,n))},qr=function(e){return Nr(e,"g")},Tr=Re((function(e){return e.global?qr(e):e}),0),Cr=function(e,n,r){return(e=null!=r?Dn(e,r,n):Tr(e)).exec(n)},Rr=function(e,n,r,i,o){return Fr(e,(e=>{if(u(n)){var r=e.indexOf(n);return jr(n,r,e)}return Cr(n,e)}),r,i,o)},Mr=function(e){return e.index+e[0].length},Pr=function(e,n){var r=Rr(e,n);return null===r[0]?null:e.slice(Mr(r))},Lr=function(e,n){return e.startsWith(n)?e.substring(n.length):e},Dr=function(e,n){var r=Cr(e,n);return r&&0===r.index?r:null},Wr=function(e,n){var r=Dr(n,e);return r?e.slice(r[0].length):e},Kr=function(e,n){if(u(n))return Lr(e,n);if(k(n))return Wr(e,n);throw hn(n,1)},Br=Kr,Ur=function(e){var n=Pr(e,"=>").trim();return Br(zn(n,"}"),"{")},Yr=function(e){return Pr(e,"{").slice(0,-1)},zr=function(e){var n=xr(e);return Er(n)?Ur(n):Yr(n)},Jr=function(e){return null==e?"":u(e)?e:C(e)?zr(e):String(e)},Gr=function(e,n){var r=n?.basic?null:{topLevelAwait:!0,useTitan:!0},u=br(Jr(e),n,r);return Fn("node",["-e",u],n)},Qr=function(e,n,r,u){var i="Required argument";return r&&(i+=' "'+r+'"'),null!=n&&(i+=" (index "+n+")"),i+=" missing",arguments.length>0&&(i+=" (received "+an(e)+")"),K(i,null,z(u,Qr))},Vr=function(e,n,r){if(null==e)throw Qr(e,n,r,{fromFn:Vr});return e},$r=function(e,n){return process.kill(e,Vr(n,0,"signalName"))},Hr=function(e){return $r(e,"SIGINT")},Xr=function(){return Hr(process.pid)},Zr=Xr,et=function(e){if("Y"===(e=e.toUpperCase()))return!0;if("N"===e)return!1;throw fn(e,0,"char")},nt=function(e){null==e&&(e="Are you sure? [y/n]: "),process.stdout.write(e);var n=Gr((function(){const e=process.stdin,n=process.stdout;e.setRawMode(!0),e.setEncoding("utf8"),e.on("data",(e=>{var r=e.toUpperCase();"Y"===r||"N"===r?(n.write(e),process.exit(0)):""===e&&(n.write("^C"),process.exit(0))}))}),{basic:!0,stdio:["inherit","pipe"]});if("^C"===n)throw process.stdout.write(n),Zr(),K("Prompt was cancelled via interrupt.");return console.log(n),et(n)},rt=function(e){return d(e)?e:u(e)?e.split("."):[e]},tt=function(e,n,r,u,i,o){var s=r;return Oe(e,n,u,i,o,((e,n,r)=>r(e,n,pe(s))))},ut=function(e,n){var r=n,u=globalThis.config;u||(u=globalThis.config={});var i,o=rt(e);return o.length>1?i=tt(u,o,r):(i=pe(r),u[o[0]]=i),i},it=function(e,n){return ut("node.require.customDirs",(r=>(r||(r=[]),!1!==n&&(e.endsWith("node_modules")||(e+="\\node_modules")),r.includes(e)||r.push(e),r))),e},ot=it,st=Oe,ct=function(e){var n=globalThis.config;if(n){var r=rt(e);return r.length>1?st(n,r):n[r[0]]}},lt=function(e,n,r){if(null!=e)return e;var u=ct(n);return null!=u?u:r},at=w("fs"),ft=function(e){return!!at().lstatSync(e,{throwIfNoEntry:!1})},pt=function(e){var n=lr(e,!1);return ft(n)||(n!==e&&pt(n),at().mkdirSync(n)),e},dt=function(e){return pt(e),at().mkdirSync(e),e},ht=function(e){return ft(e)?e:dt(e)},vt=function(e,n){if(f(e))return require(e);if(p(e))return In(e);try{return require(e)}catch(e){}var r=__dirname,u=process.mainModule?.path;if(u!==r)try{return Tn(u,e)}catch(e){}var i=process.cwd();if(i!==u&&i!==r)try{return Tn(i,e)}catch(e){}var o=ct("node.require.customDirs");if(o)for(var s of o)try{return Tn(s,e)}catch(e){}var c=lt(n?.autoInstall,"node.require.autoInstall"),l=lt(n?.promptInstall,"node.require.promptInstall",!0);if(c||l){var a=c||l;!0===a&&(a="./node_modules"),a=_n(a);var d=!1;if(c?(d=!0,console.log('Auto-installing "'+e+'" from npm to "'+a+'"...')):(d=nt('Npm package "'+e+'" is required. Install now? (Y/N) '))&&console.log('Installing "'+e+'" from npm to "'+a+'"...'),d){a=ht(a),On(e,!1,{cwd:a});try{return ot(a),Tn(a,e)}catch(e){console.error("Failed to load from auto-install dir: ",a)}}}throw K('Module not found: "'+e+'"',{checked:{moduleDir:r,scriptDir:u,cwd:i}})},mt=function(e,n,r){if(g()){var u=Sn().join(e,n);return r?nr(u):u}throw J()},gt=function(e){return at().readFileSync(e,"utf8")},yt=gt,wt=function(e){return JSON.parse(yt(e))},bt={env:{parseArgs:l,args:r,setConfig:ut,getConfig:ct,resolveConfig:lt},node:{parseArgs:c,args:n,pause:function(e){vt("press-any-key-sync")(String(e))},require:vt,_basicRequire:a,is:g,display:x,util:b,_builtInModule:w,requireBuiltIn:y,child_process:bn,requireLocal:In,path:Sn,_requireFromDir:Tn,_requireDirCache:kn,_createRequire:qn,module:Nn,promptYNSync:nt,run:Gr,getScriptPath:tr,sigint:Zr,interrupt:Xr,ensureRequireDir:ot,addRequireDir:it,fs:at,loadPackageJSON:function(e){var n=e??"./";return n.endsWith("package.json")||(n=mt(n,"package.json")),ft(n)?wt(n):{}}},shell:{parseArgs:s,_handleError:En},cli:{parseArgs:o,splitArgs:i},f:{one:e,memoize:Re,MemoizedFunction:Ce,createClass:ie,createConstructor:L,isArrowFn:M,isArrow:R,is:C,wrap:P,ensureConstructor:D,retThis:W,setName:H,not:gn,body:zr,isArrowString:Er,_getArrowFnBody:Ur,_getNormalFnBody:Yr},s:{is:u,toLiteral:He,quote:$e,escape:Ve,replaceAll:Qe,apply:I,withIndices:_,chars:Me,from:Ze,removeTrailing:zn,removeFromEnd:Yn,_removeStringFromEnd:Mn,_removeRegexFromEnd:Un,resolveIndex:Ln,splitAtIndex:Jn,ensureStartsWith:Qn,replace:Xn,endsWith:Zn,decapitalize:ur,removeLineBreaks:hr,removeMulti:dr,removeAll:pr,resolve:Jr,ensure:xr,after:Pr,match:Rr,_matchWithIndices:Fr,remove:kr,removeLeading:Br,removeFromStart:Kr,_removeStringFromStart:Lr,_removeRegexFromStart:Wr},npm:{isBuiltIn:f,isFile:p,install:On,_runCommand:An},os:{run:Fn,_resolveStdio:vn},a:{is:d,wrapIndices:S,wrapIndex:O,resolveIndex:A,ensure:N,pick:le,create:ce,fill:se,resolveIndices:oe,push:we,add:ye,splitLast:Ae,splitTail:Fe,toLiteral:en,display:ln,removeNullish:wn,removeByFilter:yn,replaceContents:mn,last:Pn,pushMulti:Sr,addMulti:Or,pushThroughMulti:Ar},err:{value:fn,ValueError:m,Error:v,Enhanced:h,create:K,nyi:J,NYIError:B,defaultFromFn:z,type:hn,TypeError:pn,prepend:mr,req:Qr},v:{display:an,constructorMatches:E,toLiteral:nn,isPrimitive:G,resolve:pe,type:dn,req:Vr},macro:{config:function(e){}},o:{is:F,display:cn,toLiteral:sn,constructorMatches:j,safeEnsure:Y,ensure:U,isAny:Q,setHidden:$,addNonEnumerable:V,hideKey:ue,makeNonEnumerable:te,ensureCustom:de,get:ae,set:fe,createEmpty:Ee,remove:je,isPure:Xe,reduce:on,each:un,keys:tn,allKeys:rn,Cache:jn,setDefaults:Rn,ensureMulti:Cn,resolveKeys:rt,diveGet:st},re:{is:k,ensureGlobal:Ue,global:Be,addFlag:Ke,copy:We,updateFlagString:De,parseFlagString:Pe,createFlagString:Le,createEscaped:Ge,create:ze,resolveFlags:Ye,escape:Je,matchEnd:Bn,matchLast:Kn,matchAll:Wn,setStartIndex:Dn,slash:er,safeCreateResult:jr,createResult:Ir,RegexResult:_r,match:Cr,ensureLocal:Tr,local:qr,removeFlag:Nr,resultEndIndex:Mr,matchStart:Dr},class:{create:re,setName:X,addStatics:Z,setDisplay:ne},p:{asyncJoint:T,is:q},sym:{display:ee,value:xe},map:{Cache:ge,ensure:me,get:he,set:ve,MultiCache:Te,diveEnsure:Ie,createEmpty:_e,diveDelete:qe,remove:Ne},args:{ensureArray:be},tree:{ensure:Se,dive:Oe,remove:ke,setCustom:tt},win:{is:xn},path:{abs:_n,fws:rr,ensureTrailingSlash:nr,baseName:sr,_removeExtsFromFile:ir,file:or,dir:lr,join:mt},js:{enhance:br,ensureReturn:Vn,splitLastExpression:Gn,enableAwait:Hn,_nodeEnableAwait:$n,useTitan:fr,inline:wr,removeComments:yr,fromAST:vr,parse:gr},titan:{getPackagePath:ar,getPackageName:cr},proc:{interrupt:Hr,signal:$r},bool:{fromYN:et},fs:{ensureDir:ht,exists:ft,mkdir:dt,ensureParent:pt,loadJSON:wt,loadText:yt,load:gt}};globalThis.t?Object.keys(bt).forEach((function(e){if(t[e]){var n=bt[e];Object.keys(n).forEach((function(r){t[e][r]=n[r]}))}else t[e]=bt[e]})):globalThis.t=Object.assign({},bt),globalThis.exports&&(exports.default=globalThis.t);
|
package/cli.pkg.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=function(e,n){return n(e)},n=function(e){return"string"==typeof e},r=function(e){return Array.isArray(e)},i=function(e){return r(e)?e:[e]},u=function(e){return e instanceof Promise},o=function(e,n){var r=e;return u(r)?r.then(n):n(r)},s=function(e){return"function"==typeof e},a=function(e){return s(e)&&null==e.prototype},l=a,c=function(e){return function(){return e.apply(this,arguments)}},f=function(e,n){var r;return r=n?function(){this.super=n;var r=e.apply(this,arguments);return o(r,(()=>(delete this.super,r)))}:l(e)?c(e):e,r._isConstructor=!0,r},h=function(e,n){return e._isConstructor?e:f(e,n)},p=function(){return this},d=function(e){return class extends e{constructor(e,n){super(e,n);var r=this.constructor.name;r&&(this.name=r)}}},v=d(globalThis.Error),m=function(e,n,r){var i=new v(e,r);return n&&Object.assign(i,n),i},y=class extends v{constructor(e,n){super(e??"Not yet implemented",n)}},g=function(e,n,r,i){var u=e[n];if(void 0===u){var o=r;!1!==i&&s(o)&&(o=o(e,n)),e[n]=u=o}return u},w=function(e,n,r,i){return e||(e={}),g(e,n,r,i),e},b=function(e,n){return w(e,"fromFn",n,!1)},E=function(e,n){return new y(e,b(n,E))},x=function(e){var n=typeof e;return"object"!==n&&"function"!==n||null===e},_=function(e){return!x(e)},k=function(e,n,r){return Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!1,configurable:!0}),r},L=k,F=function(e,n){Object.defineProperty(e,"name",{value:n,configurable:!0}),L(e,"displayName",n)},A=F,O=function(e,n){return Object.assign(e,n)},S=function(e){var n,r=!1;return function(){return r||(r=!0,n=e.apply(this,arguments)),n}},T=S((function(){return"undefined"==typeof window})),C=T()?require("util").inspect.custom:Symbol("Display"),I=function(e,n){e.prototype[C]=n},j=function(e,u,s,a,l,c){c||(c={}),n(u)&&(u=null);var d,v,y,g=s;if(g)if(r(g)){if([v,y]=g,v)if(r(v)){if(!u)throw m("Bare args array for instanceFn is only valid when extending a class.");var w=v;v=null,d=f((function(){this.super.apply(this,w)}),u)}else v=h(v)}else d=h(g,u);var b=c.bareFn;c.singleton&&(b=function(){return null==F.default&&(F.default=new F(...arguments)),F.default});var x,k=v||d||u||p;function F(){if(!new.target&&b&&!(this instanceof F))return b.apply(this,arguments);var e=this;return o(k.apply(e,arguments),(n=>{if(n&&_(n)&&(e=n,v)){if(!new.target)throw E('Prototype repair is NYI for class instantiation without "new".');if(!u)throw E("instanceFn is not yet supported when extendsClass is null.");var r=Object.getPrototypeOf(this);Object.getPrototypeOf(e)!==r&&Object.setPrototypeOf(e,r)}return y?o(y.apply(e,arguments),(()=>e)):e}))}return e&&A(F,e),a?(x=a,u&&Object.setPrototypeOf(a,u.prototype)):x=u?Object.create(u.prototype):{},L(x,"constructor",F),F.prototype=x,l&&O(F,l),c.display&&I(F,c.display),c.implements&&i(c.implements).forEach((e=>e(F))),F},P=function(e,n){Object.defineProperty(e,n,{enumerable:!1})},N=P,R=function(e,n,r,i,u){var o=Symbol();return j(e,Function,[function(){var e=function(){return e[o].apply(this,arguments)};return e},function(){var e=n.apply(this,arguments);if(!e)throw new Error("Constructor must return a function.");this[o]=e,N(this,o)}],r,i,u)},q=function(e){return n=>n===e},M=function(e){return Reflect.ownKeys(e)},D=function(e,n){return(n?M:Object.keys)(e)},B=function(e,n,r){var i={};for(var u of n)Object.hasOwn(e,u)&&(i[u]=e[u],!0===r&&delete e[u]);return i},W=function(e){return e instanceof Set},H=function(e){return W(e)?e:r(e)?new Set(e):new Set([e])},K=H,Y=function(e,n){var r=[],i=[];return e.forEach(((u,o)=>(n(u,o,e)?r:i).push(u))),[r,i]},U=function(e,n,r,i){var u=n;if(s(u))throw E();var o=D(e,i),a=K(u),[l,c]=Y(o,(e=>a.has(e)));return[B(e,l,r),!0===r?e:B(e,c,!1)]},z=function(e,n,r){var i=D(e,r).filter((r=>n(e[r],r,e)));return U(e,i,!1,r)},V=function(e,n){return n<e?n:e},G=function(e,n){return V(e,n)},Q=function*(e,n){null==e&&(e=0),n=null==n?this.length:G(n,this.length);for(var r=e;r<n;r++)yield this[r]},J=function(e,n,r){return null==n&&null==r?e[Symbol.iterator].call(e):Q.call(e,n,r)},$=function(e,n){return n<0?e.length+n:n},X=function(e,n,r,i){return n=null==n?0:$(e,n),r=null==r?e.length:$(e,r),i&&(0==i.inclusiveStart&&n++,i.inclusiveEnd&&r++),[n,r]},Z=function(e,n,r,i){[r,i]=X(e,r,i);for(var u=r;u<i;u++){var o=n(e[u],u,e);void 0!==o&&(e[u]=o)}return e},ee=function(e,n){return n?Z(D(e,n),(n=>[n,e[n]])):Object.entries(e)},te=function(e){return J(ee(this,e))},ne=function(e,n){var r=e[Symbol.iterator];return r?r.call(e):te.call(e,n)},re=function(e){return ne(e,!0)},ie=function(e,n){return null!=e&&e.constructor===n},ue=function(e){return ie(e,Object)},oe=ue,se=function(e,n,r){Object.defineProperty(e,n,{get:r,enumerable:!0,configurable:!0})},ae=function(e,n,r){Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!0,configurable:!0})},le=function(e,n,r){se(e,n,(function(){if(this===e)return null;var i=r.call(this);return ae(this,n,i),i}))},ce=class extends v{constructor(e,n){super(e??"Unexpected value",n)}},fe=function(e){return require("node:"+e)},he=function(e){return S((()=>fe(e)))},pe=he("util"),de=function(e,n){return n||(n={}),null==n.colors&&(n.colors=!0),pe().inspect(e,n)},ve=$,me=function(e,n,r,i){return void 0!==n&&(null===n||0===n?n=void 0:(n=ve(e,n),i&&0==i.inclusiveStart&&n++)),void 0!==r&&(null===r||r===e.length?r=void 0:(r=ve(e,r),i&&i.inclusiveEnd&&r++)),[n,r]},ye=function(e,n,r,i,u,o){if(r||null!=i){[r,i]=me(e,r,i,o);var s=e.slice(r,i),a=n(s);return u?u(a,r,i,s,e):a}return n(e)},ge=function(e,n,r,i,u){return ye(e,n,r,i,((n,r,i)=>(void 0!==r?e.slice(0,r):"")+(n||"")+(void 0!==i?e.slice(i):"")),u)},we=ie,be=function(e){return we(e,RegExp)},Ee=function(e,n,r,i){var u=n;if([r,i]=X(e,r,i),s(u))for(var o=r;o<i;o++)e[o]=u(o,e);else e.fill(u,r,i);return e},xe=function(e,n){var r=new Array(e||0);return arguments.length>1&&Ee(r,n),r},_e=function(e,n){return xe(n.length,(r=>e[n[r]]))},ke=function(e,n){return e[n]},Le=function(e,n,r){return e[n]=r},Fe=function(e,n,r){var i=e;return s(i)?i.apply(r,n):i},Ae=function(e,n,r,i,u){i||(i=ke);var o=i(e,n);return void 0===o&&(o=Fe(r,[e,n]),u||(u=Le),u(e,n,o)),o},Oe=function(e,n){return e.get(n)},Se=function(e,n,r){return e.set(n,r)},Te=function(e,n,r){return Ae(e,n,r,Oe,Se)},Ce=class{constructor(){this.store=new Map}get(e,n){return Te(this.store,e,n)}remove(e){return this.store.delete(e)}delete(e){return this.remove(e)}},Ie=function(e,n){return e.push(n),e},je=Ie,Pe=function(e){var n=e;return Array.isArray(n)?n:Array.from(n)},Ne=Symbol("Value"),Re=function(){return{}},qe=function(e){return[e.slice(0,-1),e[e.length-1]]},Me=qe,De=function(e,n,r,i,u,o){r||(r=ke),null==i&&(i=Re),null==u&&(u=Le),null==o&&(o=r);for(var[s,a]=Me(n),l=e,c=s.length,f=0;f<c;f++){var h=s[f],p=r(l,h);if(void 0===p){if(!i)return;p=Ae(l,h,i,r,u)}l=p}if(o)return o(l,a,u)},Be=function(e,n,r,i,u,o){return De(e,n,i,u,o,((e,n)=>Ae(e,n,r,i,o)))},We=function(){return new Map},He=function(e,n,r){return Be(e,n,r,Oe,We,Se)},Ke=function(e,n){return delete e[n],e},Ye=function(e,n,r,i){return De(e,n,r,!1,!1,i||Ke)},Ue=function(e,n){return e.delete(n)},ze=function(e,n){return Ye(e,n,Oe,Ue)},Ve=class{constructor(){this.store=new Map}get(e,n){return e=je(Pe(e),Ne),He(this.store,e,n)}remove(e){return e=je(Pe(e),Ne),ze(this.store,e)}delete(e){return this.remove(e)}},Ge=R("MemoizedFunction",(function(e,n){if(this.base=e,null!=n)if(1===(n=i(n)).length){this.cache=new Ce;var r=n[0];this._cacheKeyFormatter=e=>e[r]}else this.cache=new Ve,this._cacheKeyFormatter=e=>_e(e,n);else this.cache=new Ve,this._cacheKeyFormatter=e=>e;var u=this;return function(){var n=u._cacheKeyFormatter(arguments);return u.cache.get(n,(()=>e.apply(this,arguments)))}}),{remove(e){return this.cache.remove(this._cacheKeyFormatter(e))}}),Qe=function(e,n){return new Ge(e,n)},Je=function(e){return new Set(e)},$e=function(e){var n={};if(e){var r=Je(e);r.has("g")&&(n.global=!0),r.has("i")&&(n.caseInsensitive=!0),r.has("y")&&(n.sticky=!0)}return n},Xe=function(e){var n="";return e.global&&(n+="g"),(e.caseInsensitive||0==e.caseSensitive)&&(n+="i"),e.sticky&&(n+="y"),n},Ze=function(e,n){var r=$e(e);return Xe(Object.assign(r,n))},et=function(e,r){var i=r,u=void 0;return n(i)?u=i:ue(i)&&(u=Ze(e.flags,i)),new RegExp(e,u)},tt=function(e,n){return et(e,e.flags+n)},nt=function(e){return tt(e,"g")},rt=Qe((function(e){return e.global?e:nt(e)}),0),it=function(e){var r=e;return null==r?void 0:n(r)?r:Xe(r)},ut=function(e,n){return new RegExp(e,it(n))},ot=function(e){return e.replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,"\\$&")},st=function(e,n){return ut(ot(e),n)},at=function(e,r,i,u,o,s){return ge(e,(function(e){return e.replaceAll?(be(r)&&(r=rt(r)),e.replaceAll(r,i)):(r=n(r)?st(r,"g"):rt(r),this.replace(r,i))}),u,o,s)},lt=function(e,n,r){return at(e,n,(r??"\\")+n)},ct=function(e,n,r){return null==n&&(n='"'),!1!==r&&(e=lt(e,n,r)),n+e+n},ft=function(e){return ct(e,'"')},ht=function(e){return oe(e)?yt(e):String(e)},pt=function(e,n){return n||(n=dt),"["+e.reduce((function(e,r){return e+n(r)+", "}),"").slice(0,-2)+"]"},dt=function(e){return n(e)?ft(e):r(e)?pt(e):ht(e)},vt=function(e,n,r){D(e,r).forEach(((r,i,u)=>n(r,e[r],i,u)))},mt=function(e,n,r,i){var u=null!=r?r:"";return vt(e,(function(){u=n.call(this,u,...arguments)}),i),u},yt=function(e,n){return n||(n=dt),"{"+mt(e,(function(e,r,i){return e+r+":"+n(i)+", "}),"",!0).slice(0,-2)+"}"},gt=function(e,n){return null==n&&(n=1),n<=0?"[object Object]":yt(e,(e=>bt(e,n-1)))},wt=function(e,n){return null==n&&(n=1),n<=0?"[object Array]":pt(e,(e=>bt(e,n-1)))},bt=function(e,n){return void 0===e?"undefined":null===e?"null":T()?de(e,n):ue(e)?gt(e,maxNumLevels):r(e)?wt(e,maxNumLevels):ht(e)},Et=function(e,n,r,i){if(0===arguments.length)return new ce("Unexpected value received");i||(i={});var u,{expected:o}=i;return u=o?"Received "+bt(e)+", expected one of "+bt(o):"Unexpected value received: "+bt(e),r&&(u+=' for "'+r+'"'),null!=n&&(u+=" (index "+n+")"),i.fromFn||(i.fromFn=Et),new ce(u,i)},xt=function*(e,n){yield*e,yield*n},kt=function(e){return e?" "+e:""},Lt=function(e){return n(e)?e:e.toString()},Ft=R("Interface",(function(e,n,r){r||(r={}),F(this,e),n?[this.stubs,this.defaults]=z(n,q(!0),!0):(this.stubs={},this.defaults={});var u=r.implements?i(r.implements):null,o=this;return function(e){var n=e;return u&&u.forEach((e=>e(n))),o.decorate(n),o.assert(n),n}}),{decorate(e){var n,r,i=e;for(var[u,o]of(i.prototype?(n=i.prototype,r=!0):(n=i,r=!1),re(this.defaults)))if(void 0===n[u])if(oe(o))if(o.value)n[u]=o.value;else{if(!o.setup)throw Et(o,null,"defaultVal");if(!r)throw o.setup(),E("setupFn is NYI for instances");le(n,u,o.setup)}else n[u]=o;return i},assert(e){var n=e,r=null!=n.prototype,i=n.prototype||n,u=xt(re(this.stubs),re(this.defaults));for(var[o]of u){var s;if(void 0===i[o])throw s=r?"Class"+kt(n.name):"Object "+bt(n),s+=" does not satisfy interface "+this.name+' (missing key "'+Lt(o)+'")',m(s)}return n},validate(e){try{return this.assert(e),!0}catch(e){return!1}}},{is(e){return e instanceof this}}),At=function(e,n,r){return new Ft(e,n,r)},Ot=Symbol("Cleanup"),St=At("Handle",{remove:!0,[Ot](){this.remove()}}),Tt=e(class{constructor(e){this.handles=e}remove(){this.handles.forEach((e=>e.remove()))}add(e){return this.handles.push(e),this}},St),Ct=function(e){return 1===e.length&&r(e[0])?e[0]:array},It=function(...e){return new Tt(Ct(e))},jt=It,Pt=jt,Nt=function(e){var n,r,i=e;return null!=i&&(n=i.detail??i.data??i,_(i)&&(r=i)),[n,r,i]},Rt=function(e){return Ft.is(e)},qt=Rt,Mt=d(globalThis.TypeError),Dt=function(e){return null==e?e:e.constructor},Bt=function(e,n,r,i){if(0===arguments.length)return new Mt("Unexpected type received");i||(i={});var u,{type:o,expected:s}=i;return null==o&&(o=Dt(e)),o&&o.name&&(o=o.name),s?(s.name&&(s=s.name),u="Expected "+s+", received "):u="Unexpected type received (",u+=o,null!=e&&(u+=" ("+bt(e)+")"),s||(u+=")"),r&&(u+=' for "'+r+'"'),null!=n&&(u+=" (index "+n+")"),i.fromFn||(i.fromFn=Bt),new Mt(u,i)},Wt=function(e,n,r){if(!qt(n))throw Bt(n,1);return n.decorate(e),r&&r.call(e,e,n),n.assert(e),e},Ht=At,Kt=Symbol("EventTarget"),Yt=function(e){return require(e)},Ut=function(e){return!!e.startsWith("node:")||Yt("node:module").isBuiltin(e)},zt=function(e){return e.startsWith(".")},Vt=function(e){var i=e.stdio;if(i){if(!r(i)){if(!n(i))throw Bt(i,"stdio");if("pipe"===i)i=["pipe","pipe","pipe"];else if("inherit"===i)i=["inherit","inherit","inherit"];else if("ignore"===i)i=["ignore","ignore","ignore"];else{if("overlapped"!==i)throw Et(i,"stdio");i=["overlapped","overlapped","overlapped"]}e.stdio=i}}else i=e.stdio=[null,null,null];return i},Gt=function(e,n){var r=n.length;e.length=r;for(var i=0;i<r;i++)e[i]=n[i];return e},Qt=function(e){return function(){return!e.apply(this,arguments)}},Jt=function(e,n){return Gt(e,e.filter(Qt(n)))},$t=function(e){return Jt(e,(e=>null==e))},Xt=he("child_process"),Zt=S((function(){return"win32"===process.platform})),en=function(e,n,r){if(r||(r={}),n(e))throw e;if(r.nullOnErr&&(r.err=null),void 0!==r.err)return r.err;if(r.onErr)return r.onErr(e,e.stderr);throw e},tn=function(e,n,r){r||(r={}),r.dir&&(r.cwd=r.dir);var i=Vt(r);if(null==i[0]){var u=r.allowInput,o=r.input;if(u&&o)throw m("allowInput (user) and input (programmatic) cannot be used simultaneously for synchronous child processes.");u&&(i[0]="inherit")}if(null==i[1]){var s=r.captureOutput??!1,a=r.showOutput;if(s&&a)throw m("captureOutput and showOutput cannot be used simultaneously for synchronous child processes.");s?i[1]="pipe":(null==a&&(a=!0),i[1]=a?"inherit":"ignore")}if(null==i[2]){var l=r.captureErr??!1,c=r.showErr;if(l&&c)throw m("captureErr and showErr cannot be used simultaneously for synchronous child processes.");l?i[2]="pipe":(null==c&&(c=!0),i[2]=c?"inherit":"ignore")}r.encoding||(r.encoding="utf8"),n&&$t(n);try{var f=Xt().execFileSync(e,n,r);null!=f&&(f=f.trim());var h=r.map??r.mapFn;return h&&(f=h(f)),f}catch(e){if(Zt())return en(e,(e=>"ENOENT"===e.code),r);throw e}},nn=function(e,n){return n||(n={}),null==n.captureOutput&&(n.captureOutput=!1),n.shell=!0,n.filterExtensions=!1,tn("npm",e,n)},rn=function(e,n,r){return nn(["install",e,n?"-g":null],r)},un=he("path"),on=function(e,n){var r=un().resolve;return n?r(n,e):r(e)},sn=function(e){return require(on(e))},an=class{constructor(){this.store={}}get(e,n){return g(this.store,e,n)}remove(e){return delete this.store[e]}delete(e){return this.remove(e)}},ln=new an,cn=he("module"),fn=function(e){return e.endsWith("\\node_modules")||(e+="\\node_modules"),cn().createRequire(e)},hn=function(e,n){return ln.get(e,(()=>fn(e)))(n)},pn=function(e,n,r){return Object.keys(n).forEach((i=>g(e,i,n[i],r))),e},dn=function(e,n,r){return n?pn(e,n,r):e},vn=function(e,n){return e.endsWith(n)?e.substring(0,e.length-n.length):e},mn=function(e){return e[e.length-1]},yn=$,gn=function(e,n,r){return e=et(e,{global:!0}),null!=r&&(n=yn(r,n)),e.lastIndex=n,e},wn=function(e,n,r){return e=null!=r?gn(e,r,n):rt(e),Array.from(n.matchAll(e))},bn=function(e,n,r){return null!=r&&(n=n.slice(0,r)),mn(wn(e,n))||null},En=function(e,n){var r=bn(e,n);return r&&n.length===r.index+r[0].length?r:null},xn=function(e,n){var r=En(n,e);return r?e.slice(0,r.index):e},_n=function(e,r){if(n(r))return vn(e,r);if(be(r))return xn(e,r);throw Bt(r,1)},kn=_n,Ln=function(e,n){return[e.slice(0,n),e.slice(n)]},Fn=function(e){e=kn(e.trim(),";");var n=Math.max(e.lastIndexOf(";"),e.lastIndexOf("\n"));return Ln(e,n+1)},An=function(e,n){return e.startsWith(n)?e:n+e},On=function(e){var[n,r]=Fn(e);return n+An(r.trim(),"return ")},Sn=function(e){return Gr("node-repl-await").processTopLevelAwait(e)},Tn=function(e){return Sn(e)??e},Cn=at,In=function(e,r){if(n(r))return e.endsWith(e);if(be(r))return!!En(r,e);throw Bt(r,1,"matchThis")},jn=/\/|\\/,Pn=function(e){return In(e,jn)?e:e+"/"},Nn=function(e,n){return""===e?e:(null==n&&(n=!0),e=Cn(e,"\\","/"),n?Pn(e):e)},Rn=function(){return process.mainModule?.filename??null},qn=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},Mn=function(e){return e.split(".")[0]},Dn=function(e){return un().win32.basename(e)},Bn=function(e){return Mn(Dn(e))},Wn=function(e,n,r,i){e||(e=Rn()??"_console.js");var u=qn(Bn(e));return n&&(u+="_repl"),u+(r&&i?.dynamic?".dypkg.json":".pkg.js")},Hn=function(e,n){return e=un().dirname(e),!1===n?e:Pn(e)},Kn=function(e,n,r,i){var u,o=Wn(e,n,r,i);return u=e?Hn(e):"./",on(u+o)},Yn=function(e){return'require("'+Nn(Kn(),!1)+'");\n'+e},Un=function(e,n){return at(e,n,"")},zn=function(e,n){return n.forEach((n=>e=Un(e,n))),e},Vn=function(e){return zn(e,["\r","\n"])},Gn=function(e,n){return Gr("astring").generate(e,n)},Qn=function(e,n){return e.stack=n+"\n"+e.stack,e},Jn=function(e,n,r){r||(r={}),!1!==n&&(r.sourceType="module"),null==r.allowAwaitOutsideFunction&&(r.allowAwaitOutsideFunction=!0);var i=Gr("acorn-node");try{return i.parse(e,r)}catch(n){throw Qn(n,"Acorn parsing error: "+e)}},$n=function(e,n,r){return Gn(Jn(e,n,r))},Xn=function(e){return Vn($n(e))},Zn=function(e,n,r){return(n||r)&&(n||(n={}),r&&dn(n,r),n.ensureReturn&&(e=On(e)),n.topLevelAwait&&(e=Tn(e)),n.useTitan&&(e=Yn(e)),n.keepAlive&&(e="\nsetInterval(()=>{}, 100000);\n"+e),(n.logErrors||n.keepAlive)&&(e="process.on('uncaughtException', console.error);\nprocess.on('unhandledRejection', console.error);\n"+e),n.inline&&(e=Xn(e))),e},er=function(e){return n(e)?e:ht(e)},tr=function(e){var n=e.indexOf("{");return-1===n||e.slice(0,n).includes("=>")},nr=function(e,n,r,i,u){return ye(e,n,r,i,((n,r)=>null===n?null:(n.input=e,void 0!==r&&(n.index+=r),n)),u)},rr=function(e,n){return e.splice(e.length,0,...n),n},ir=function(e,n){return rr(e,n),e},ur=ir,or=class extends Array{constructor(e,n,r,i,u){if(-1===n)throw m("RegexResult index cannot be -1. For empty result, use bare null.");if(null==e)throw m("RegexResult matchString cannot be null. For empty result, use bare null.");super(),this[0]=e,i&&ur(this,i),this.index=n,this.input=r,u&&(this.groups=u)}fromParts(e){var n=e;return new or(n.match,n.index,n.input,n.captures,n.groups)}},sr=function(e,n,r,i,u){return new or(e,n,r,i,u)},ar=function(e,n,r,i,u){return-1===n||null==e?null:sr(e,n,r,i,u)},lr=Un,cr=function(e,n){return et(e,lr(e.flags,n))},fr=function(e){return cr(e,"g")},hr=Qe((function(e){return e.global?fr(e):e}),0),pr=function(e,n,r){return(e=null!=r?gn(e,r,n):hr(e)).exec(n)},dr=function(e,r,i,u,o){return nr(e,(e=>{if(n(r)){var i=e.indexOf(r);return ar(r,i,e)}return pr(r,e)}),i,u,o)},vr=function(e){return e.index+e[0].length},mr=function(e,n){var r=dr(e,n);return null===r[0]?null:e.slice(vr(r))},yr=function(e,n){return e.startsWith(n)?e.substring(n.length):e},gr=function(e,n){var r=pr(e,n);return r&&0===r.index?r:null},wr=function(e,n){var r=gr(n,e);return r?e.slice(r[0].length):e},br=function(e,r){if(n(r))return yr(e,r);if(be(r))return wr(e,r);throw Bt(r,1)},Er=br,xr=function(e){var n=mr(e,"=>").trim();return Er(kn(n,"}"),"{")},_r=function(e){return mr(e,"{").slice(0,-1)},kr=function(e){var n=er(e);return tr(n)?xr(n):_r(n)},Lr=function(e){return null==e?"":n(e)?e:s(e)?kr(e):String(e)},Fr=function(e,n){var r=n?.basic?null:{topLevelAwait:!0,useTitan:!0},i=Zn(Lr(e),n,r);return tn("node",["-e",i],n)},Ar=function(e,n,r,i){var u="Required argument";return r&&(u+=' "'+r+'"'),null!=n&&(u+=" (index "+n+")"),u+=" missing",arguments.length>0&&(u+=" (received "+bt(e)+")"),m(u,null,b(i,Ar))},Or=function(e,n,r){if(null==e)throw Ar(e,n,r,{fromFn:Or});return e},Sr=function(e,n){return process.kill(e,Or(n,0,"signalName"))},Tr=function(e){return Sr(e,"SIGINT")},Cr=function(){return Tr(process.pid)},Ir=Cr,jr=function(e){if("Y"===(e=e.toUpperCase()))return!0;if("N"===e)return!1;throw Et(e,0,"char")},Pr=function(e){null==e&&(e="Are you sure? [y/n]: "),process.stdout.write(e);var n=Fr((function(){const e=process.stdin,n=process.stdout;e.setRawMode(!0),e.setEncoding("utf8"),e.on("data",(e=>{var r=e.toUpperCase();"Y"===r||"N"===r?(n.write(e),process.exit(0)):""===e&&(n.write("^C"),process.exit(0))}))}),{basic:!0,stdio:["inherit","pipe"]});if("^C"===n)throw process.stdout.write(n),Ir(),m("Prompt was cancelled via interrupt.");return console.log(n),jr(n)},Nr=function(e){return r(e)?e:n(e)?e.split("."):[e]},Rr=function(e,n,r,i,u,o){var s=r;return De(e,n,i,u,o,((e,n,r)=>r(e,n,Fe(s))))},qr=function(e,n){var r=n,i=globalThis.config;i||(i=globalThis.config={});var u,o=Nr(e);return o.length>1?u=Rr(i,o,r):(u=Fe(r),i[o[0]]=u),u},Mr=function(e,n){return qr("node.require.customDirs",(r=>(r||(r=[]),!1!==n&&(e.endsWith("node_modules")||(e+="\\node_modules")),r.includes(e)||r.push(e),r))),e},Dr=Mr,Br=De,Wr=function(e){var n=globalThis.config;if(n){var r=Nr(e);return r.length>1?Br(n,r):n[r[0]]}},Hr=function(e,n,r){if(null!=e)return e;var i=Wr(n);return null!=i?i:r},Kr=he("fs"),Yr=function(e){return!!Kr().lstatSync(e,{throwIfNoEntry:!1})},Ur=function(e){var n=Hn(e,!1);return Yr(n)||(n!==e&&Ur(n),Kr().mkdirSync(n)),e},zr=function(e){return Ur(e),Kr().mkdirSync(e),e},Vr=function(e){return Yr(e)?e:zr(e)},Gr=function(e,n){if(Ut(e))return require(e);if(zt(e))return sn(e);try{return require(e)}catch(e){}var r=__dirname,i=process.mainModule?.path;if(i!==r)try{return hn(i,e)}catch(e){}var u=process.cwd();if(u!==i&&u!==r)try{return hn(u,e)}catch(e){}var o=Wr("node.require.customDirs");if(o)for(var s of o)try{return hn(s,e)}catch(e){}var a=Hr(n?.autoInstall,"node.require.autoInstall"),l=Hr(n?.promptInstall,"node.require.promptInstall",!0);if(a||l){var c=a||l;!0===c&&(c="./node_modules"),c=on(c);var f=!1;if(a?(f=!0,console.log('Auto-installing "'+e+'" from npm to "'+c+'"...')):(f=Pr('Npm package "'+e+'" is required. Install now? (Y/N) '))&&console.log('Installing "'+e+'" from npm to "'+c+'"...'),f){c=Vr(c),rn(e,!1,{cwd:c});try{return Dr(c),hn(c,e)}catch(e){console.error("Failed to load from auto-install dir: ",c)}}}throw m('Module not found: "'+e+'"',{checked:{moduleDir:r,scriptDir:i,cwd:u}})},Qr=S((function(){if(!globalThis.CustomEvent||!globalThis.EventTarget||!globalThis.Event){var e=Gr("event-target-shim");globalThis.Event||(globalThis.Event=e.Event),globalThis.CustomEvent||(globalThis.CustomEvent=class extends globalThis.Event{constructor(e,n){super(e,n),n?.detail&&(this.detail=n.detail)}}),globalThis.EventTarget||(globalThis.EventTarget=e.EventTarget)}return{Event:Event,CustomEvent:CustomEvent,EventTarget:EventTarget}})),Jr=Qr().EventTarget,$r=function(e){var n=Kt,r=e[n];return void 0===r&&(r=new Jr,L(e,n,r)),r},Xr=Ht("EventInterface",{addEventListener(e,n,r){$r(this).addEventListener(e,n,r)},on(e,n){this.addEventListener(e,n)},removeEventListener(e,n){$r(this).removeEventListener(e,n)},off(e,n){this.removeEventListener(e,n)},dispatchEvent(e){return $r(this).dispatchEvent(e)}}),Zr=Xr,ei=function(e){return Wt(e,Zr)},ti=function(e){return!(!e.addEventListener&&!e.on)},ni=function(e){return ti(e)||ei(e),e},ri=function(e,n,r){return e[n]=r,e},ii=function(e,n,r){return ri(e||{},n,r)},ui=function(e,n,r,i){return mi(e,n,r,ii(i,"once",!0))},oi=function(e,n){return function(){var r=n.apply(this,arguments);return e.apply(this,arguments),r}},si=oi,ai=function(e,n,r){return e[n]=si(e[n],r)},li=e(class{constructor(e){this._remover=e}remove(){this._remover()}removeOn(e,n,r){r&&ni(e);var i=ui(target,n,(()=>this.remove()));return ai(this,"remove",(()=>i.remove())),this}},St),ci=class extends li{constructor(e,n){super(e),this.handleEvent=n}},fi=function(e,n){return new ci(e,n)},hi=function(e,n,r){(e.removeEventListener||e.off).call(e,n,r)},pi=function(e,n,r){for(var i=e.length-1;i>=n;i--)e[i+1]=e[i];return e[n]=r,e.length++,e},di=function(e,n){return pi(e,0,n)},vi=di,mi=function(e,n,r,i){if(i?.valueFirst){var u=r;r=function(e){var[n,r]=Nt(e);return vi(arguments,n),arguments[1]=r,u.apply(this,arguments)}}var o=e.addEventListener;return o||(e.on?o=i?.once?e.once:e.on:(ei(e),o=e.addEventListener)),o.call(e,n,r,i),fi((()=>hi(e,n,r)),r)},yi=function(e,n,r,i){return Pt(n.map((n=>mi(e,n,r,i))))},gi=S((function(){return process.argv.slice(2)})),wi=gi,bi=function(e){const n=[];let r="",i="outside",u=!1;for(let o=0;o<e.length;o++){const s=e[o];switch(i){case"outside":'"'===s?u?(r+=s,u=!1):i="insideQuote":"\\"===s?u=!0:" "===s?(r.length>0&&(n.push(r),r=""),u=!1):(r+=s,u=!1);break;case"insideQuote":'"'!==s||u?"\\"!==s||u?(r+=s,u=!1):u=!0:i="outside"}}return r.length>0&&n.push(r),n},Ei=function(){return globalThis.repl?.repl},xi=function(e,n){return null==n&&(n=1),function(){var r=Array.from(arguments),i=r.pop(),u=e.apply(this,r);0===n?(u.then((e=>i(null,e))),u.catch(i)):(u.then(i),u.catch((e=>i.apply(null,ri([],n,e)))))}},_i=async function(){}.constructor,ki=function(e){return ie(e,_i)},Li=function(e){return ki(e)?e:async function(){return e.apply(this,arguments)}},Fi=S((function(){return Gr("node:stream")})),Ai=T()&&Fi().Writable,Oi=function(e,n){return n||(n={}),null==n.objectMode&&(n.objectMode=!0),e?n.write=xi(Li(e),0):n.write||(n.write=(e,n,r)=>r()),new Ai(n)},Si=function(){},Ti=async function(e){var n=Ei();if(n){var r,i=n.eval,u=n.output;n.output=Oi(Si),n.eval=Si;try{n.quickDisableHistory?await n.quickDisableHistory((async function(){r=await e(),n._line()})):r=await e()}finally{n.output=u,n.eval=i}return r}return e()},Ci=he("readline"),Ii=/\r?\n/,ji=function(e){return null==e||void 0!==e.length&&0===e.length},Pi=function(e,n){return Jt(e,ji)},Ni=function(e,n){return e.splice(n,1),e},Ri=function(e,n,r){for(var i={},u=e.length,o=0;o<u;o++){var s=n(e[o],o,e);if(s){var[a,l]=s;r?(i[a]||(i[a]=[]),i[a].push(l)):i[a]=l}}return i},qi=function(e,n,r,i){return[n,r]=X(e,n,r,i),e.slice(n,r)},Mi=function(e,n){return xe(n,e).join("")},Di=function(e){return e?e[0]:null},Bi=function(e,n){var r=null==n?-1:n.index;if(-1===r)return[e];var i=Ln(e,r);return i[1]=i[1].slice(n[0].length),i},Wi=function(e,n,r,i,u){return Bi(e,dr(e,n,r,i,u))},Hi=function(e){return isNaN(e)?null:e},Ki=function(e){return null==e?null:Hi(Number(e))},Yi=Ki,Ui=function(e){return Yi(e)??e},zi=function(e,n){null==n&&(n="=");var r={};return e.forEach((function(e){var[i,u]=Wi(e,n);null!=u&&(u=Ui(u.trim())),r[i.trim()]=u})),r},Vi=w,Gi=class extends Array{constructor(e){var i,u=e;null!=u&&(r(u)?i=u:n(u)&&(i=u.split(Ii))),i?(super(i.length),Object.assign(this,i)):super(...arguments)}condense(e){return this.trim().removeEmpty(),e&&this.removeComments(e),this}trim(){return this.apply((e=>e.trim()))}removeEmpty(){return Pi(this)}removeComments(e){for(var n=0;n<this.length;n++){var r=this[n],i=r.indexOf(e);-1!==i&&(""===(r=r.slice(0,i)).trim()?(Ni(this,n),n--):this[n]=r)}return this}removeFirst(){return this.shift(),this}removeLast(){return this.pop(),this}apply(e){return Z(this,e)}join(){return super.join("\n")}toObj(e){return zi(this,e)}mapToObj(e,n){return Ri(this,e,n)}between(e,n,r){return r=Vi(r,"inclusiveEnd",!0),qi(this,e,n,r)}normalize(){if(this.length>0&&(""===this[0].trim()&&this.shift(),this.length>0&&(""===mn(this).trim()&&this.pop(),this.length>0))){var e=this.find((e=>""!==e.trim())),n=Di(pr(/^\s*/,e));if(n){var r=n.length;this.apply((e=>{if(e.startsWith(n))return e.slice(r)}))}}return this}deindent(e,n,r){throw E()}indent(e,n){var r=Mi(n??"\t",e??1);return this.apply((e=>r+e))}static is(e){return ie(e,this)}static fromChunks(e){return e.map((e=>kn(e,Ii))).flatMap((e=>Ji(e,!1)))}},Qi=function(e,n){var r=new Gi(e);return n&&r.condense(),r},Ji=function(e,n,r){var i=e.split(Ii);return n?Qi(i,r):i},$i=function(e){return Kr().readFileSync(e,"utf8")},Xi=$i,Zi=function(e,n){return Ji(Xi(e),!0,n)},eu=function(e){return"number"==typeof e},tu=function(e){return e instanceof Buffer},nu=function(e){return ArrayBuffer.isView(e)},ru=nu,iu=function(e){return tu(e)||ru(e)||n(e)},uu=function(e){return e.constructor===ArrayBuffer},ou=function(e){return iu(e)?e:uu(e)?Buffer.from(e):ht(e)},su=function(e){return eu(e)?String(e):ou(e)},au=function(e,n){return Ur(e),Kr().appendFileSync(e,su(n)),e},lu=function(e,n){return au(e,"\n"+n)},cu=lu,fu=function(e){return at(e,"\n","\\n")},hu=fu,pu=function(e,n){if(0===e)return n[0];for(var r=n.length,i="";e>0;){var u=e%r;i=n.charAt(u)+i,e=Math.floor(e/r)}return i},du="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",vu=function(e){return pu(e,du)},mu=function(e,n){for(var r=er(e),i=n.length,u=0,o=0;o<r.length;o++){var s=r[o],a=n.indexOf(s);if(-1===a)throw'Error: "'+s+'" not found in base charset "'+n+'"';u=u*i+a}return u},yu=function(e){return mu(e,du)},gu=function(e,n){return Object.keys(e).map(((r,i)=>n(r,e[r],i,e)))},wu=function(e){return e.slice()},bu=function(e,n){return e.includes(n)||e.push(n),e},Eu=class{constructor(e,n,i,u){(n=r(n)?wu(n):[n]).forEach(u),e&&bu(n,e),this.members=n,this._enableFn=i,this._disableFn=u}enable(e){this.members.forEach((n=>{n!==e&&this._disableFn(n)})),this._enableFn(e)}disableAll(){this.members.forEach((e=>this._disableFn(e)))}},xu=function(e,n,r,i){return new Eu(e,n,r,i)},_u=function(e,n,r){return new Promise((function(i,u){var o=Pt([ui(e,n||"load",(e=>{o.remove(),i(e)})),ui(e,r||"error",(e=>{o.remove(),u(e)}))])}))},ku=j("CLI",T()&&Ci().Interface,[function(e){if(e||(e={}),e.input||(e.input=process.stdin),e.output||null==e.output&&(e.output=process.stdout),null==e.terminal&&(e.terminal=!0),e.historyPath){var n=Yr(e.historyPath)?Zi(e.historyPath):[];e.history=n.reverse()}var r={inputWasRaw:e.input.isRaw},i=Ci().createInterface(e);return i.options=e,i.internal=r,i},function(){var e=this.options;this.rl=Ci(),e.historyPath&&this.on("history",(n=>cu(e.historyPath,n[0]))),e.disabled&&this.disable()}],{prompt(e){this._muted||(this._isPrompt=!0,null!=e&&this.setPrompt(e),super.prompt.apply(this,arguments),delete this._isPrompt)},_refreshLine(){this._muted||(this._isRefresh=!0,super._refreshLine(...arguments),delete this._isRefresh)},_ttyWrite(e,n){(!this._blockExcept||n&&this._blockExcept.includes(n.name))&&super._ttyWrite.apply(this,arguments)},_addHistory(){return this._historyDisabled||null!=this._mask||super._addHistory(),this.line},_writeToOutput(e){if(!this._muted){var n=this._mask;if(null!=n){if(this._isRefresh){var r=this._prompt;e.startsWith(r)&&(super._writeToOutput(r),e=e.slice(r.length))}this._isPrompt||(e=Cn(e,/[^\r\n]/,n))}super._writeToOutput(e)}},async promptLine(e){return this.prompt(e),this.awaitLine()},async prefillPrompt(e,n){var r=n,i=await Fe(r);return this.prompt(e),i&&this.write(hu(er(i))),this.awaitLine()},async promptMultiline(e,r,i,u){if(null==r&&(r="... "),null==i)i=e=>""===e,u||(u=e=>(e.pop(),e));else if(n(i)){var o=i;i=e=>e.endsWith(o)}for(var s=await this.promptLine(e),a=[s];!i(s,a.length,a);)s=await this.promptLine(r),a.push(s);return u&&u(a),a.join("\n")},async promptKey(e,n){this.prompt(e);var r=await this.quickBlockExcept(n,!1,(()=>this.awaitKey(n)));return this.newLine(),r},async promptYN(e){return"y"===(await this.promptKey(e,["y","n"])).toLowerCase()},async promptSelect(e,n,i){var u=n;i||(i={});var o=0;function a(){return o++,vu(o)}if(oe(u))u=gu(u,((e,n,r)=>[a(),e,n]));else{if(!r(u))throw Bt(u);u=u.map(((e,n)=>{if(null==e)return null;if(r(e)){var i=e[0];if(null==i)i=a();else if((i=er(i)).length>1)throw m("Input key must be a single character:",e);var u=e.length;if(1===u)return[i,i,i];if(2===u){var o=e[1];return[i,o,o]}if(3===u)return[i,e[1],e[2]];throw m("Unexpected array length in choices: "+u)}return[a(),e,e]})),$t(u)}if(u.length>35)throw m("promptSelect only supports up to 35 options.");var l=i.displayFn||((e,n)=>"["+e+"] "+n);this.quickDisableHistory((()=>{for(var e=0;e<u.length;e++){var[n,r,i]=u[e];this.write(l(n,r,i,u)+"\n")}}));var c=Ri(u,(e=>[e[0],e])),f=await this.promptKey(e,Object.keys(c)),h=c[f];if(null==h)throw Et(h,"choice");var p=h[2];return s(p)&&(p=await p(h)),i.asObj?{key:f,name:h[1],value:p}:i.asIndex?yu(f)-1:p},blockExcept(e,n){e=i(e).map((e=>String(e).toLowerCase())),0!=n&&bu(e,"return"),this._blockExcept=e},unblock(){delete this._blockExcept},async quickBlockExcept(e,n,r){var i=this._blockExcept;this.blockExcept(e,n);var u=await r();return i?this.blockExcept(i):this.unblock(),u},disable(){this.pause(),this.mute()},enable(){this._mutex?this._mutex.enable(this):this._enable()},_enable(){this.resume(),this.unmute()},mutex(e){var n=xu(this,e,(e=>e._enable()),(e=>e.disable()));this.pause(),this.resume(),n.members.forEach((e=>e._mutex=n))},mask(e){this._mask=e},unmask(){delete this._mask},mute(){this._muted=!0},unmute(){delete this._muted},disableHistory(){this._historyDisabled=!0,this._historyPrev=Si,this._historyNext=Si},enableHistory(){delete this._historyDisabled,delete this._historyPrev,delete this._historyNext},async quickDisableHistory(e){var n=this._historyDisabled;this.disableHistory();try{var r=await e()}finally{return n||this.enableHistory(),r}},awaitLine(){return _u(this,"line")},newLine(){this.write("\n")},newline(){return this.newLine()},onKey(e,n,i){var u=e,o=this.input;if(this.rl.emitKeypressEvents(o),o.isTTY&&o.setRawMode(!0),u){var s=n;if(r(u)){var a=u.map((e=>String(e).toLowerCase()));n=(e,n)=>{e||(e=n.name),a.includes(e.toLowerCase())&&s.call(this,e,n)}}else{var l=String(u).toLowerCase();n=(e,n)=>{e||(e=n.name),e.toLowerCase()===l&&s.call(this,e,n)}}}return mi(o,"keypress",n,i)},async awaitKey(e){return new Promise((n=>{var r=this.onKey(e,(e=>{r.remove(),n(e)}))}))},moveCursor(e,n){return this._moveCursor(e,n)},cursorLeft(e){return this.moveCursor(-e)},cursorRight(e){return this.moveCursor(e)},cursorUp(e){return this.moveCursor(null,-e)},cursorDown(e){return this.moveCursor(null,e)},close(){super.close(),this.input.setRawMode(this.internal.inputWasRaw)}}),Lu=function(e,n){return Ti((async function(){var r=new ku(n);try{var i=await e(r)}finally{r.close()}return i}))},Fu=function(e,n){return Lu((n=>n.promptLine(e)),n)},Au=async function(e,n,r){for(var i={},u=n.length,o=0;o<u;o++){var s,a=n[o];if(a.endsWith("?")&&(a=a.slice(0,-1),s=!0),void 0===(l=e[a])){var l=e[o];if(void 0===l&&!s&&(!1!==r?.prompt&&(l=await Fu(a+": ")),!l))throw Or(void 0,o,a)}i[a]=l}return i},Ou={node:{onError:function(e){return yi(process,["uncaughtException","unhandledRejection"],e)},is:T,display:de,util:pe,_builtInModule:he,requireBuiltIn:fe,require:Gr,_basicRequire:Yt,child_process:Xt,requireLocal:sn,path:un,_requireFromDir:hn,_requireDirCache:ln,_createRequire:fn,module:cn,promptYNSync:Pr,run:Fr,getScriptPath:Rn,sigint:Ir,interrupt:Cr,ensureRequireDir:Dr,addRequireDir:Mr,fs:Kr,pause:function(e){Gr("press-any-key-sync")(e)},beforeExit:function(e){return mi(process,"beforeExit",e)},args:gi,prompt:Fu,quickCLI:Lu,quickDisableREPL:Ti,getREPL:Ei,CLI:ku,readline:Ci},ev:{onAny:yi,multiHandle:Pt,on:mi,resolveValue:Nt,enable:ei,EventInterface:Zr,Interface:Xr,_ensureHasTarget:$r,targetSym:Kt,EventTarget:Jr,polyfill:Qr,handle:fi,ListenerHandle:ci,ensureEnabled:ni,can:ti,once:ui,off:hi,promise:_u},o:{multiHandle:jt,safeEnsure:w,ensure:g,isAny:_,setHidden:L,addNonEnumerable:k,hideKey:N,makeNonEnumerable:P,filterSplit:z,keys:D,allKeys:M,split:U,pick:B,iterateAll:re,iterate:ne,iterator:te,entries:ee,isPure:oe,is:ue,setProtoLazy:le,setGetter:se,forceSet:ae,display:gt,toLiteral:yt,constructorMatches:we,ensureCustom:Ae,get:ke,set:Le,createEmpty:Re,remove:Ke,reduce:mt,each:vt,addInterface:Wt,Cache:an,setDefaults:dn,ensureMulti:pn,resolveKeys:Nr,diveGet:Br,safeSet:ii,touch:ri,fromLines:zi,safeDefault:Vi,mapArr:gu,mutex:xu,_Mutex:Eu},handle:{createMulti:It,MultiHandle:Tt,HandleInterface:St,Handle:li},class:{addInterface:e,create:j,setName:A,addStatics:O,setDisplay:I,isInterface:qt,interface:Ht},ifc:{create:At,Interface:Ft,is:Rt},f:{createClass:R,createConstructor:f,isArrowFn:l,isArrow:a,is:s,wrap:c,ensureConstructor:h,retThis:p,setName:F,one:S,eq:q,memoize:Qe,MemoizedFunction:Ge,not:Qt,body:kr,isArrowString:tr,_getArrowFnBody:xr,_getNormalFnBody:_r,hookAfterMethod:ai,hookAfter:si,injectAfter:oi,callbackify:xi,ensureAsync:Li,isAsync:ki,AsyncFunction:_i,noop:Si},s:{is:n,toLiteral:ft,quote:ct,escape:lt,replaceAll:at,apply:ge,withIndices:ye,chars:Je,from:ht,spaceBefore:kt,fromKey:Lt,removeTrailing:kn,removeFromEnd:_n,_removeStringFromEnd:vn,_removeRegexFromEnd:xn,resolveIndex:yn,splitAtIndex:Ln,ensureStartsWith:An,replace:Cn,endsWith:In,decapitalize:qn,removeLineBreaks:Vn,removeMulti:zn,removeAll:Un,resolve:Lr,ensure:er,after:mr,match:dr,_matchWithIndices:nr,remove:lr,removeLeading:Er,removeFromStart:br,_removeStringFromStart:yr,_removeRegexFromStart:wr,splitLines:Ji,lines:Qi,LinesArray:Gi,repeat:Mi,splitFirst:Wi,_splitByMatch:Bi,escapeLineBreaks:hu,escapeNewLines:fu},a:{is:r,ensure:i,filterSplit:Y,iterate:J,iterator:Q,apply:Z,resolveIndices:X,resolveIndex:$,wrapIndices:me,wrapIndex:ve,pick:_e,create:xe,fill:Ee,push:je,add:Ie,splitLast:Me,splitTail:qe,toLiteral:pt,display:wt,unboxArgs:Ct,removeNullish:$t,removeByFilter:Jt,replaceContents:Gt,last:mn,pushMulti:ur,addMulti:ir,pushThroughMulti:rr,removeEmpty:Pi,removeIndex:Ni,mapToObj:Ri,slice:qi,copy:wu,ensureContains:bu},p:{asyncJoint:o,is:u},err:{create:m,Error:v,Enhanced:d,nyi:E,NYIError:y,defaultFromFn:b,value:Et,ValueError:ce,type:Bt,TypeError:Mt,prepend:Qn,req:Ar},v:{isPrimitive:x,constructorMatches:ie,display:bt,toLiteral:dt,resolve:Fe,type:Dt,req:Or,isEmpty:ji,nullIfNaN:Hi},sym:{display:C,value:Ne,cleanup:Ot},macro:{config:function(e){}},set:{resolve:K,ensure:H,is:W},n:{cap:G,least:V,tryCoerce:Ui,tryParse:Yi,ensure:Ki,is:eu,toBase36:vu,toCustomBase:pu,_base36Digits:du,fromBase36:yu,fromCustomBase:mu},re:{is:be,ensureGlobal:rt,global:nt,addFlag:tt,copy:et,updateFlagString:Ze,parseFlagString:$e,createFlagString:Xe,createEscaped:st,create:ut,resolveFlags:it,escape:ot,matchEnd:En,matchLast:bn,matchAll:wn,setStartIndex:gn,slash:jn,safeCreateResult:ar,createResult:sr,RegexResult:or,match:pr,ensureLocal:hr,local:fr,removeFlag:cr,resultEndIndex:vr,matchStart:gr,newline:Ii,text:Di},map:{Cache:Ce,ensure:Te,get:Oe,set:Se,MultiCache:Ve,diveEnsure:He,createEmpty:We,diveDelete:ze,remove:Ue},args:{ensureArray:Pe,unshift:vi,prepend:di,insert:pi},tree:{ensure:Be,dive:De,remove:Ye,setCustom:Rr},gen:{join:xt},npm:{isBuiltIn:Ut,isFile:zt,install:rn,_runCommand:nn},os:{run:tn,_resolveStdio:Vt},win:{is:Zt},shell:{_handleError:en},path:{abs:on,fws:Nn,ensureTrailingSlash:Pn,baseName:Bn,_removeExtsFromFile:Mn,file:Dn,dir:Hn},js:{enhance:Zn,ensureReturn:On,splitLastExpression:Fn,enableAwait:Tn,_nodeEnableAwait:Sn,useTitan:Yn,inline:Xn,removeComments:$n,fromAST:Gn,parse:Jn},titan:{getPackagePath:Kn,getPackageName:Wn},proc:{interrupt:Tr,signal:Sr},bool:{fromYN:jr},env:{setConfig:qr,getConfig:Wr,resolveConfig:Hr,args:wi},fs:{ensureDir:Vr,exists:Yr,mkdir:zr,ensureParent:Ur,loadLines:Zi,loadText:Xi,load:$i,appendLine:cu,addLine:lu,append:au,formatRaw:su},cli:{parseArgs:function(e){for(var r,i=[],u=!1,o=(r=null==(a=e)?wi():n(a)?bi(a):a).length,s=0;s<o;s++){var a=r[s];if(!u){var l=a[0];let e;if("-"===l)if("-"===a[1]){if(2===a.length){u=!0;continue}e=2}else e=1;else"/"===l&&(e=1);if(e){var c,f,h=a.slice(e),p=h.indexOf("=");if(-1!==p)c=h.slice(0,p),f=h.slice(p+1);else{c=h;var d=r[s+1];null==d||"-"===d[0]?f=!0:(f=d,s++)}i[c]=f;continue}}i.push(a)}return i},splitArgs:bi,paramFn:function(e,n){return async function(...r){var i=await Au(e,r,n);Object.assign(globalThis,i)}},validateParams:Au},stream:{nodeWritable:Oi,NodeWritableStream:Ai,_useNode:Fi},bin:{ensureByteSafe:ou,isByteSafe:iu,isNodeBuffer:tu,isTA:ru},ab:{isTA:nu,is:uu}};globalThis.t?Object.keys(Ou).forEach((function(e){if(t[e]){var n=Ou[e];Object.keys(n).forEach((function(r){t[e][r]=n[r]}))}else t[e]=Ou[e]})):globalThis.t=Object.assign({},Ou),globalThis.exports&&(exports.default=globalThis.t);
|
|
1
|
+
var e=function(e,n){return n(e)},n=function(e){return"string"==typeof e},r=function(e){return Array.isArray(e)},i=function(e){return r(e)?e:[e]},u=function(e){return e instanceof Promise},o=function(e,n){var r=e;return u(r)?r.then(n):n(r)},s=function(e){return"function"==typeof e},a=function(e){return s(e)&&null==e.prototype},l=a,c=function(e){return function(){return e.apply(this,arguments)}},f=function(e,n){var r;return r=n?function(){this.super=n;var r=e.apply(this,arguments);return o(r,(()=>(delete this.super,r)))}:l(e)?c(e):e,r._isConstructor=!0,r},h=function(e,n){return e._isConstructor?e:f(e,n)},p=function(){return this},d=function(e){return class extends e{constructor(e,n){super(e,n);var r=this.constructor.name;r&&(this.name=r)}}},v=d(globalThis.Error),m=function(e,n,r){var i=new v(e,r);return n&&Object.assign(i,n),i},y=class extends v{constructor(e,n){super(e??"Not yet implemented",n)}},g=function(e,n,r,i){var u=e[n];if(void 0===u){var o=r;!1!==i&&s(o)&&(o=o(e,n)),e[n]=u=o}return u},w=function(e,n,r,i){return e||(e={}),g(e,n,r,i),e},b=function(e,n){return w(e,"fromFn",n,!1)},E=function(e,n){return new y(e,b(n,E))},x=function(e){var n=typeof e;return"object"!==n&&"function"!==n||null===e},_=function(e){return!x(e)},k=function(e,n,r){return Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!1,configurable:!0}),r},L=k,F=function(e,n){Object.defineProperty(e,"name",{value:n,configurable:!0}),L(e,"displayName",n)},S=F,A=function(e,n){return Object.assign(e,n)},O=function(e){var n,r=!1;return function(){return r||(r=!0,n=e.apply(this,arguments)),n}},T=O((function(){return"undefined"==typeof window})),C=T()?require("util").inspect.custom:Symbol("Display"),I=function(e,n){e.prototype[C]=n},j=function(e,u,s,a,l,c){c||(c={}),n(u)&&(u=null);var d,v,y,g=s;if(g)if(r(g)){if([v,y]=g,v)if(r(v)){if(!u)throw m("Bare args array for instanceFn is only valid when extending a class.");var w=v;v=null,d=f((function(){this.super.apply(this,w)}),u)}else v=h(v)}else d=h(g,u);var b=c.bareFn;c.singleton&&(b=function(){return null==F.default&&(F.default=new F(...arguments)),F.default});var x,k=v||d||u||p;function F(){if(!new.target&&b&&!(this instanceof F))return b.apply(this,arguments);var e=this;return o(k.apply(e,arguments),(n=>{if(n&&_(n)&&(e=n,v)){if(!new.target)throw E('Prototype repair is NYI for class instantiation without "new".');if(!u)throw E("instanceFn is not yet supported when extendsClass is null.");var r=Object.getPrototypeOf(this);Object.getPrototypeOf(e)!==r&&Object.setPrototypeOf(e,r)}return y?o(y.apply(e,arguments),(()=>e)):e}))}return e&&S(F,e),a?(x=a,u&&Object.setPrototypeOf(a,u.prototype)):x=u?Object.create(u.prototype):{},L(x,"constructor",F),F.prototype=x,l&&A(F,l),c.display&&I(F,c.display),c.implements&&i(c.implements).forEach((e=>e(F))),F},P=function(e,n){Object.defineProperty(e,n,{enumerable:!1})},N=P,R=function(e,n,r,i,u){var o=Symbol();return j(e,Function,[function(){var e=function(){return e[o].apply(this,arguments)};return e},function(){var e=n.apply(this,arguments);if(!e)throw new Error("Constructor must return a function.");this[o]=e,N(this,o)}],r,i,u)},q=function(e){return n=>n===e},M=function(e){return Reflect.ownKeys(e)},D=function(e,n){return(n?M:Object.keys)(e)},B=function(e,n,r){var i={};for(var u of n)Object.hasOwn(e,u)&&(i[u]=e[u],!0===r&&delete e[u]);return i},W=function(e){return e instanceof Set},H=function(e){return W(e)?e:r(e)?new Set(e):new Set([e])},K=H,Y=function(e,n){var r=[],i=[];return e.forEach(((u,o)=>(n(u,o,e)?r:i).push(u))),[r,i]},U=function(e,n,r,i){var u=n;if(s(u))throw E();var o=D(e,i),a=K(u),[l,c]=Y(o,(e=>a.has(e)));return[B(e,l,r),!0===r?e:B(e,c,!1)]},z=function(e,n,r){var i=D(e,r).filter((r=>n(e[r],r,e)));return U(e,i,!1,r)},V=function(e,n){return n<e?n:e},G=function(e,n){return V(e,n)},Q=function*(e,n){null==e&&(e=0),n=null==n?this.length:G(n,this.length);for(var r=e;r<n;r++)yield this[r]},J=function(e,n,r){return null==n&&null==r?e[Symbol.iterator].call(e):Q.call(e,n,r)},$=function(e,n){return n<0?e.length+n:n},X=function(e,n,r,i){return n=null==n?0:$(e,n),r=null==r?e.length:$(e,r),i&&(0==i.inclusiveStart&&n++,i.inclusiveEnd&&r++),[n,r]},Z=function(e,n,r,i){[r,i]=X(e,r,i);for(var u=r;u<i;u++){var o=n(e[u],u,e);void 0!==o&&(e[u]=o)}return e},ee=function(e,n){return n?Z(D(e,n),(n=>[n,e[n]])):Object.entries(e)},te=function(e){return J(ee(this,e))},ne=function(e,n){var r=e[Symbol.iterator];return r?r.call(e):te.call(e,n)},re=function(e){return ne(e,!0)},ie=function(e,n){return null!=e&&e.constructor===n},ue=function(e){return ie(e,Object)},oe=ue,se=function(e,n,r){Object.defineProperty(e,n,{get:r,enumerable:!0,configurable:!0})},ae=function(e,n,r){Object.defineProperty(e,n,{value:r,writable:!0,enumerable:!0,configurable:!0})},le=function(e,n,r){se(e,n,(function(){if(this===e)return null;var i=r.call(this);return ae(this,n,i),i}))},ce=class extends v{constructor(e,n){super(e??"Unexpected value",n)}},fe=function(e){return require("node:"+e)},he=function(e){return O((()=>fe(e)))},pe=he("util"),de=function(e,n){return n||(n={}),null==n.colors&&(n.colors=!0),pe().inspect(e,n)},ve=$,me=function(e,n,r,i){return void 0!==n&&(null===n||0===n?n=void 0:(n=ve(e,n),i&&0==i.inclusiveStart&&n++)),void 0!==r&&(null===r||r===e.length?r=void 0:(r=ve(e,r),i&&i.inclusiveEnd&&r++)),[n,r]},ye=function(e,n,r,i,u,o){if(r||null!=i){[r,i]=me(e,r,i,o);var s=e.slice(r,i),a=n(s);return u?u(a,r,i,s,e):a}return n(e)},ge=function(e,n,r,i,u){return ye(e,n,r,i,((n,r,i)=>(void 0!==r?e.slice(0,r):"")+(n||"")+(void 0!==i?e.slice(i):"")),u)},we=ie,be=function(e){return we(e,RegExp)},Ee=function(e,n,r,i){var u=n;if([r,i]=X(e,r,i),s(u))for(var o=r;o<i;o++)e[o]=u(o,e);else e.fill(u,r,i);return e},xe=function(e,n){var r=new Array(e||0);return arguments.length>1&&Ee(r,n),r},_e=function(e,n){return xe(n.length,(r=>e[n[r]]))},ke=function(e,n){return e[n]},Le=function(e,n,r){return e[n]=r},Fe=function(e,n,r){var i=e;return s(i)?i.apply(r,n):i},Se=function(e,n,r,i,u){i||(i=ke);var o=i(e,n);return void 0===o&&(o=Fe(r,[e,n]),u||(u=Le),u(e,n,o)),o},Ae=function(e,n){return e.get(n)},Oe=function(e,n,r){return e.set(n,r)},Te=function(e,n,r){return Se(e,n,r,Ae,Oe)},Ce=class{constructor(){this.store=new Map}get(e,n){return Te(this.store,e,n)}remove(e){return this.store.delete(e)}delete(e){return this.remove(e)}},Ie=function(e,n){return e.push(n),e},je=Ie,Pe=function(e){var n=e;return Array.isArray(n)?n:Array.from(n)},Ne=Symbol("Value"),Re=function(){return{}},qe=function(e){return[e.slice(0,-1),e[e.length-1]]},Me=qe,De=function(e,n,r,i,u,o){r||(r=ke),null==i&&(i=Re),null==u&&(u=Le),null==o&&(o=r);for(var[s,a]=Me(n),l=e,c=s.length,f=0;f<c;f++){var h=s[f],p=r(l,h);if(void 0===p){if(!i)return;p=Se(l,h,i,r,u)}l=p}if(o)return o(l,a,u)},Be=function(e,n,r,i,u,o){return De(e,n,i,u,o,((e,n)=>Se(e,n,r,i,o)))},We=function(){return new Map},He=function(e,n,r){return Be(e,n,r,Ae,We,Oe)},Ke=function(e,n){return delete e[n],e},Ye=function(e,n,r,i){return De(e,n,r,!1,!1,i||Ke)},Ue=function(e,n){return e.delete(n)},ze=function(e,n){return Ye(e,n,Ae,Ue)},Ve=class{constructor(){this.store=new Map}get(e,n){return e=je(Pe(e),Ne),He(this.store,e,n)}remove(e){return e=je(Pe(e),Ne),ze(this.store,e)}delete(e){return this.remove(e)}},Ge=R("MemoizedFunction",(function(e,n){if(this.base=e,null!=n)if(1===(n=i(n)).length){this.cache=new Ce;var r=n[0];this._cacheKeyFormatter=e=>e[r]}else this.cache=new Ve,this._cacheKeyFormatter=e=>_e(e,n);else this.cache=new Ve,this._cacheKeyFormatter=e=>e;var u=this;return function(){var n=u._cacheKeyFormatter(arguments);return u.cache.get(n,(()=>e.apply(this,arguments)))}}),{remove(e){return this.cache.remove(this._cacheKeyFormatter(e))}}),Qe=function(e,n){return new Ge(e,n)},Je=function(e){return new Set(e)},$e=function(e){var n={};if(e){var r=Je(e);r.has("g")&&(n.global=!0),r.has("i")&&(n.caseInsensitive=!0),r.has("y")&&(n.sticky=!0)}return n},Xe=function(e){var n="";return e.global&&(n+="g"),(e.caseInsensitive||0==e.caseSensitive)&&(n+="i"),e.sticky&&(n+="y"),n},Ze=function(e,n){var r=$e(e);return Xe(Object.assign(r,n))},et=function(e,r){var i=r,u=void 0;return n(i)?u=i:ue(i)&&(u=Ze(e.flags,i)),new RegExp(e,u)},tt=function(e,n){return et(e,e.flags+n)},nt=function(e){return tt(e,"g")},rt=Qe((function(e){return e.global?e:nt(e)}),0),it=function(e){var r=e;return null==r?void 0:n(r)?r:Xe(r)},ut=function(e,n){return new RegExp(e,it(n))},ot=function(e){return e.replace(/[-[\]{}()*+!<=:?.\/\\^$|#\s,]/g,"\\$&")},st=function(e,n){return ut(ot(e),n)},at=function(e,r,i,u,o,s){return ge(e,(function(e){return e.replaceAll?(be(r)&&(r=rt(r)),e.replaceAll(r,i)):(r=n(r)?st(r,"g"):rt(r),this.replace(r,i))}),u,o,s)},lt=function(e,n,r){return at(e,n,(r??"\\")+n)},ct=function(e,n,r){return null==n&&(n='"'),!1!==r&&(e=lt(e,n,r)),n+e+n},ft=function(e){return ct(e,'"')},ht=function(e){return oe(e)?yt(e):String(e)},pt=function(e,n){return n||(n=dt),"["+e.reduce((function(e,r){return e+n(r)+", "}),"").slice(0,-2)+"]"},dt=function(e){return n(e)?ft(e):r(e)?pt(e):ht(e)},vt=function(e,n,r){D(e,r).forEach(((r,i,u)=>n(r,e[r],i,u)))},mt=function(e,n,r,i){var u=null!=r?r:"";return vt(e,(function(){u=n.call(this,u,...arguments)}),i),u},yt=function(e,n){return n||(n=dt),"{"+mt(e,(function(e,r,i){return e+r+":"+n(i)+", "}),"",!0).slice(0,-2)+"}"},gt=function(e,n){return null==n&&(n=1),n<=0?"[object Object]":yt(e,(e=>bt(e,n-1)))},wt=function(e,n){return null==n&&(n=1),n<=0?"[object Array]":pt(e,(e=>bt(e,n-1)))},bt=function(e,n){return void 0===e?"undefined":null===e?"null":T()?de(e,n):ue(e)?gt(e,maxNumLevels):r(e)?wt(e,maxNumLevels):ht(e)},Et=function(e,n,r,i){if(0===arguments.length)return new ce("Unexpected value received");i||(i={});var u,{expected:o}=i;return u=o?"Received "+bt(e)+", expected one of "+bt(o):"Unexpected value received: "+bt(e),r&&(u+=' for "'+r+'"'),null!=n&&(u+=" (index "+n+")"),i.fromFn||(i.fromFn=Et),new ce(u,i)},xt=function*(e,n){yield*e,yield*n},kt=function(e){return e?" "+e:""},Lt=function(e){return n(e)?e:e.toString()},Ft=R("Interface",(function(e,n,r){r||(r={}),F(this,e),n?[this.stubs,this.defaults]=z(n,q(!0),!0):(this.stubs={},this.defaults={});var u=r.implements?i(r.implements):null,o=this;return function(e){var n=e;return u&&u.forEach((e=>e(n))),o.decorate(n),o.assert(n),n}}),{decorate(e){var n,r,i=e;for(var[u,o]of(i.prototype?(n=i.prototype,r=!0):(n=i,r=!1),re(this.defaults)))if(void 0===n[u])if(oe(o))if(o.value)n[u]=o.value;else{if(!o.setup)throw Et(o,null,"defaultVal");if(!r)throw o.setup(),E("setupFn is NYI for instances");le(n,u,o.setup)}else n[u]=o;return i},assert(e){var n=e,r=null!=n.prototype,i=n.prototype||n,u=xt(re(this.stubs),re(this.defaults));for(var[o]of u){var s;if(void 0===i[o])throw s=r?"Class"+kt(n.name):"Object "+bt(n),s+=" does not satisfy interface "+this.name+' (missing key "'+Lt(o)+'")',m(s)}return n},validate(e){try{return this.assert(e),!0}catch(e){return!1}}},{is(e){return e instanceof this}}),St=function(e,n,r){return new Ft(e,n,r)},At=Symbol("Cleanup"),Ot=St("Handle",{remove:!0,[At](){this.remove()}}),Tt=e(class{constructor(e){this.handles=e}remove(){this.handles.forEach((e=>e.remove()))}add(e){return this.handles.push(e),this}},Ot),Ct=function(e){return 1===e.length&&r(e[0])?e[0]:array},It=function(...e){return new Tt(Ct(e))},jt=It,Pt=jt,Nt=function(e){var n,r,i=e;return null!=i&&(n=i.detail??i.data??i,_(i)&&(r=i)),[n,r,i]},Rt=function(e){return Ft.is(e)},qt=Rt,Mt=d(globalThis.TypeError),Dt=function(e){return null==e?e:e.constructor},Bt=function(e,n,r,i){if(0===arguments.length)return new Mt("Unexpected type received");i||(i={});var u,{type:o,expected:s}=i;return null==o&&(o=Dt(e)),o&&o.name&&(o=o.name),s?(s.name&&(s=s.name),u="Expected "+s+", received "):u="Unexpected type received (",u+=o,null!=e&&(u+=" ("+bt(e)+")"),s||(u+=")"),r&&(u+=' for "'+r+'"'),null!=n&&(u+=" (index "+n+")"),i.fromFn||(i.fromFn=Bt),new Mt(u,i)},Wt=function(e,n,r){if(!qt(n))throw Bt(n,1);return n.decorate(e),r&&r.call(e,e,n),n.assert(e),e},Ht=St,Kt=Symbol("EventTarget"),Yt=function(e){return require(e)},Ut=function(e){return!!e.startsWith("node:")||Yt("node:module").isBuiltin(e)},zt=function(e){return e.startsWith(".")},Vt=function(e){var i=e.stdio;if(i){if(!r(i)){if(!n(i))throw Bt(i,"stdio");if("pipe"===i)i=["pipe","pipe","pipe"];else if("inherit"===i)i=["inherit","inherit","inherit"];else if("ignore"===i)i=["ignore","ignore","ignore"];else{if("overlapped"!==i)throw Et(i,"stdio");i=["overlapped","overlapped","overlapped"]}e.stdio=i}}else i=e.stdio=[null,null,null];return i},Gt=function(e,n){var r=n.length;e.length=r;for(var i=0;i<r;i++)e[i]=n[i];return e},Qt=function(e){return function(){return!e.apply(this,arguments)}},Jt=function(e,n){return Gt(e,e.filter(Qt(n)))},$t=function(e){return Jt(e,(e=>null==e))},Xt=he("child_process"),Zt=O((function(){return"win32"===process.platform})),en=function(e,n,r){if(r||(r={}),n(e))throw e;if(r.nullOnErr&&(r.err=null),void 0!==r.err)return r.err;if(r.onErr)return r.onErr(e,e.stderr);throw e},tn=function(e,n,r){r||(r={}),r.dir&&(r.cwd=r.dir);var i=Vt(r);if(null==i[0]){var u=r.allowInput,o=r.input;if(u&&o)throw m("allowInput (user) and input (programmatic) cannot be used simultaneously for synchronous child processes.");u&&(i[0]="inherit")}if(null==i[1]){var s=r.captureOutput??!1,a=r.showOutput;if(s&&a)throw m("captureOutput and showOutput cannot be used simultaneously for synchronous child processes.");s?i[1]="pipe":(null==a&&(a=!0),i[1]=a?"inherit":"ignore")}if(null==i[2]){var l=r.captureErr??!1,c=r.showErr;if(l&&c)throw m("captureErr and showErr cannot be used simultaneously for synchronous child processes.");l?i[2]="pipe":(null==c&&(c=!0),i[2]=c?"inherit":"ignore")}r.encoding||(r.encoding="utf8"),n&&$t(n);try{var f=Xt().execFileSync(e,n,r);null!=f&&(f=f.trim());var h=r.map??r.mapFn;return h&&(f=h(f)),f}catch(e){if(Zt())return en(e,(e=>"ENOENT"===e.code),r);throw e}},nn=function(e,n){return n||(n={}),null==n.captureOutput&&(n.captureOutput=!1),n.shell=!0,n.filterExtensions=!1,tn("npm",e,n)},rn=function(e,n,r){return nn(["install",e,n?"-g":null],r)},un=he("path"),on=function(e,n){var r=un().resolve;return n?r(n,e):r(e)},sn=function(e){return require(on(e))},an=class{constructor(){this.store={}}get(e,n){return g(this.store,e,n)}remove(e){return delete this.store[e]}delete(e){return this.remove(e)}},ln=new an,cn=he("module"),fn=function(e){return e.endsWith("\\node_modules")||(e+="\\node_modules"),cn().createRequire(e)},hn=function(e,n){return ln.get(e,(()=>fn(e)))(n)},pn=function(e,n,r){return Object.keys(n).forEach((i=>g(e,i,n[i],r))),e},dn=function(e,n,r){return n?pn(e,n,r):e},vn=function(e,n){return e.endsWith(n)?e.substring(0,e.length-n.length):e},mn=function(e){return e[e.length-1]},yn=$,gn=function(e,n,r){return e=et(e,{global:!0}),null!=r&&(n=yn(r,n)),e.lastIndex=n,e},wn=function(e,n,r){return e=null!=r?gn(e,r,n):rt(e),Array.from(n.matchAll(e))},bn=function(e,n,r){return null!=r&&(n=n.slice(0,r)),mn(wn(e,n))||null},En=function(e,n){var r=bn(e,n);return r&&n.length===r.index+r[0].length?r:null},xn=function(e,n){var r=En(n,e);return r?e.slice(0,r.index):e},_n=function(e,r){if(n(r))return vn(e,r);if(be(r))return xn(e,r);throw Bt(r,1)},kn=_n,Ln=function(e,n){return[e.slice(0,n),e.slice(n)]},Fn=function(e){e=kn(e.trim(),";");var n=Math.max(e.lastIndexOf(";"),e.lastIndexOf("\n"));return Ln(e,n+1)},Sn=function(e,n){return e.startsWith(n)?e:n+e},An=function(e){var[n,r]=Fn(e);return n+Sn(r.trim(),"return ")},On=function(e){return Gr("node-repl-await").processTopLevelAwait(e)},Tn=function(e){return On(e)??e},Cn=at,In=function(e,r){if(n(r))return e.endsWith(e);if(be(r))return!!En(r,e);throw Bt(r,1,"matchThis")},jn=/\/|\\/,Pn=function(e){return In(e,jn)?e:e+"/"},Nn=function(e,n){return""===e?e:(null==n&&(n=!0),e=Cn(e,"\\","/"),n?Pn(e):e)},Rn=function(){return process.mainModule?.filename??null},qn=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},Mn=function(e){return e.split(".")[0]},Dn=function(e){return un().win32.basename(e)},Bn=function(e){return Mn(Dn(e))},Wn=function(e,n,r,i){e||(e=Rn()??"_console.js");var u=qn(Bn(e));return n&&(u+="_repl"),u+(r&&i?.dynamic?".dypkg.json":".pkg.js")},Hn=function(e,n){return e=un().dirname(e),!1===n?e:Pn(e)},Kn=function(e,n,r,i){var u,o=Wn(e,n,r,i);return u=e?Hn(e):"./",on(u+o)},Yn=function(e){return'require("'+Nn(Kn(),!1)+'");\n'+e},Un=function(e,n){return at(e,n,"")},zn=function(e,n){return n.forEach((n=>e=Un(e,n))),e},Vn=function(e){return zn(e,["\r","\n"])},Gn=function(e,n){return Gr("astring").generate(e,n)},Qn=function(e,n){return e.stack=n+"\n"+e.stack,e},Jn=function(e,n,r){r||(r={}),!1!==n&&(r.sourceType="module"),null==r.allowAwaitOutsideFunction&&(r.allowAwaitOutsideFunction=!0);var i=Gr("acorn-node");try{return i.parse(e,r)}catch(n){throw Qn(n,"Acorn parsing error: "+e)}},$n=function(e,n,r){return Gn(Jn(e,n,r))},Xn=function(e){return Vn($n(e))},Zn=function(e,n,r){return(n||r)&&(n||(n={}),r&&dn(n,r),n.ensureReturn&&(e=An(e)),n.topLevelAwait&&(e=Tn(e)),n.useTitan&&(e=Yn(e)),n.keepAlive&&(e="\nsetInterval(()=>{}, 100000);\n"+e),(n.logErrors||n.keepAlive)&&(e="process.on('uncaughtException', console.error);\nprocess.on('unhandledRejection', console.error);\n"+e),n.inline&&(e=Xn(e))),e},er=function(e){return n(e)?e:ht(e)},tr=function(e){var n=e.indexOf("{");return-1===n||e.slice(0,n).includes("=>")},nr=function(e,n,r,i,u){return ye(e,n,r,i,((n,r)=>null===n?null:(n.input=e,void 0!==r&&(n.index+=r),n)),u)},rr=function(e,n){return e.splice(e.length,0,...n),n},ir=function(e,n){return rr(e,n),e},ur=ir,or=class extends Array{constructor(e,n,r,i,u){if(-1===n)throw m("RegexResult index cannot be -1. For empty result, use bare null.");if(null==e)throw m("RegexResult matchString cannot be null. For empty result, use bare null.");super(),this[0]=e,i&&ur(this,i),this.index=n,this.input=r,u&&(this.groups=u)}fromParts(e){var n=e;return new or(n.match,n.index,n.input,n.captures,n.groups)}},sr=function(e,n,r,i,u){return new or(e,n,r,i,u)},ar=function(e,n,r,i,u){return-1===n||null==e?null:sr(e,n,r,i,u)},lr=Un,cr=function(e,n){return et(e,lr(e.flags,n))},fr=function(e){return cr(e,"g")},hr=Qe((function(e){return e.global?fr(e):e}),0),pr=function(e,n,r){return(e=null!=r?gn(e,r,n):hr(e)).exec(n)},dr=function(e,r,i,u,o){return nr(e,(e=>{if(n(r)){var i=e.indexOf(r);return ar(r,i,e)}return pr(r,e)}),i,u,o)},vr=function(e){return e.index+e[0].length},mr=function(e,n){var r=dr(e,n);return null===r[0]?null:e.slice(vr(r))},yr=function(e,n){return e.startsWith(n)?e.substring(n.length):e},gr=function(e,n){var r=pr(e,n);return r&&0===r.index?r:null},wr=function(e,n){var r=gr(n,e);return r?e.slice(r[0].length):e},br=function(e,r){if(n(r))return yr(e,r);if(be(r))return wr(e,r);throw Bt(r,1)},Er=br,xr=function(e){var n=mr(e,"=>").trim();return Er(kn(n,"}"),"{")},_r=function(e){return mr(e,"{").slice(0,-1)},kr=function(e){var n=er(e);return tr(n)?xr(n):_r(n)},Lr=function(e){return null==e?"":n(e)?e:s(e)?kr(e):String(e)},Fr=function(e,n){var r=n?.basic?null:{topLevelAwait:!0,useTitan:!0},i=Zn(Lr(e),n,r);return tn("node",["-e",i],n)},Sr=function(e,n,r,i){var u="Required argument";return r&&(u+=' "'+r+'"'),null!=n&&(u+=" (index "+n+")"),u+=" missing",arguments.length>0&&(u+=" (received "+bt(e)+")"),m(u,null,b(i,Sr))},Ar=function(e,n,r){if(null==e)throw Sr(e,n,r,{fromFn:Ar});return e},Or=function(e,n){return process.kill(e,Ar(n,0,"signalName"))},Tr=function(e){return Or(e,"SIGINT")},Cr=function(){return Tr(process.pid)},Ir=Cr,jr=function(e){if("Y"===(e=e.toUpperCase()))return!0;if("N"===e)return!1;throw Et(e,0,"char")},Pr=function(e){null==e&&(e="Are you sure? [y/n]: "),process.stdout.write(e);var n=Fr((function(){const e=process.stdin,n=process.stdout;e.setRawMode(!0),e.setEncoding("utf8"),e.on("data",(e=>{var r=e.toUpperCase();"Y"===r||"N"===r?(n.write(e),process.exit(0)):""===e&&(n.write("^C"),process.exit(0))}))}),{basic:!0,stdio:["inherit","pipe"]});if("^C"===n)throw process.stdout.write(n),Ir(),m("Prompt was cancelled via interrupt.");return console.log(n),jr(n)},Nr=function(e){return r(e)?e:n(e)?e.split("."):[e]},Rr=function(e,n,r,i,u,o){var s=r;return De(e,n,i,u,o,((e,n,r)=>r(e,n,Fe(s))))},qr=function(e,n){var r=n,i=globalThis.config;i||(i=globalThis.config={});var u,o=Nr(e);return o.length>1?u=Rr(i,o,r):(u=Fe(r),i[o[0]]=u),u},Mr=function(e,n){return qr("node.require.customDirs",(r=>(r||(r=[]),!1!==n&&(e.endsWith("node_modules")||(e+="\\node_modules")),r.includes(e)||r.push(e),r))),e},Dr=Mr,Br=De,Wr=function(e){var n=globalThis.config;if(n){var r=Nr(e);return r.length>1?Br(n,r):n[r[0]]}},Hr=function(e,n,r){if(null!=e)return e;var i=Wr(n);return null!=i?i:r},Kr=he("fs"),Yr=function(e){return!!Kr().lstatSync(e,{throwIfNoEntry:!1})},Ur=function(e){var n=Hn(e,!1);return Yr(n)||(n!==e&&Ur(n),Kr().mkdirSync(n)),e},zr=function(e){return Ur(e),Kr().mkdirSync(e),e},Vr=function(e){return Yr(e)?e:zr(e)},Gr=function(e,n){if(Ut(e))return require(e);if(zt(e))return sn(e);try{return require(e)}catch(e){}var r=__dirname,i=process.mainModule?.path;if(i!==r)try{return hn(i,e)}catch(e){}var u=process.cwd();if(u!==i&&u!==r)try{return hn(u,e)}catch(e){}var o=Wr("node.require.customDirs");if(o)for(var s of o)try{return hn(s,e)}catch(e){}var a=Hr(n?.autoInstall,"node.require.autoInstall"),l=Hr(n?.promptInstall,"node.require.promptInstall",!0);if(a||l){var c=a||l;!0===c&&(c="./node_modules"),c=on(c);var f=!1;if(a?(f=!0,console.log('Auto-installing "'+e+'" from npm to "'+c+'"...')):(f=Pr('Npm package "'+e+'" is required. Install now? (Y/N) '))&&console.log('Installing "'+e+'" from npm to "'+c+'"...'),f){c=Vr(c),rn(e,!1,{cwd:c});try{return Dr(c),hn(c,e)}catch(e){console.error("Failed to load from auto-install dir: ",c)}}}throw m('Module not found: "'+e+'"',{checked:{moduleDir:r,scriptDir:i,cwd:u}})},Qr=O((function(){if(!globalThis.CustomEvent||!globalThis.EventTarget||!globalThis.Event){var e=Gr("event-target-shim");globalThis.Event||(globalThis.Event=e.Event),globalThis.CustomEvent||(globalThis.CustomEvent=class extends globalThis.Event{constructor(e,n){super(e,n),n?.detail&&(this.detail=n.detail)}}),globalThis.EventTarget||(globalThis.EventTarget=e.EventTarget)}return{Event:Event,CustomEvent:CustomEvent,EventTarget:EventTarget}})),Jr=Qr().EventTarget,$r=function(e){var n=Kt,r=e[n];return void 0===r&&(r=new Jr,L(e,n,r)),r},Xr=Ht("EventInterface",{addEventListener(e,n,r){$r(this).addEventListener(e,n,r)},on(e,n){this.addEventListener(e,n)},removeEventListener(e,n){$r(this).removeEventListener(e,n)},off(e,n){this.removeEventListener(e,n)},dispatchEvent(e){return $r(this).dispatchEvent(e)}}),Zr=Xr,ei=function(e){return Wt(e,Zr)},ti=function(e){return!(!e.addEventListener&&!e.on)},ni=function(e){return ti(e)||ei(e),e},ri=function(e,n,r){return e[n]=r,e},ii=function(e,n,r){return ri(e||{},n,r)},ui=function(e,n,r,i){return mi(e,n,r,ii(i,"once",!0))},oi=function(e,n){return function(){var r=n.apply(this,arguments);return e.apply(this,arguments),r}},si=oi,ai=function(e,n,r){return e[n]=si(e[n],r)},li=e(class{constructor(e){this._remover=e}remove(){this._remover()}removeOn(e,n,r){r&&ni(e);var i=ui(target,n,(()=>this.remove()));return ai(this,"remove",(()=>i.remove())),this}},Ot),ci=class extends li{constructor(e,n){super(e),this.handleEvent=n}},fi=function(e,n){return new ci(e,n)},hi=function(e,n,r){(e.removeEventListener||e.off).call(e,n,r)},pi=function(e,n,r){for(var i=e.length-1;i>=n;i--)e[i+1]=e[i];return e[n]=r,e.length++,e},di=function(e,n){return pi(e,0,n)},vi=di,mi=function(e,n,r,i){if(i?.valueFirst){var u=r;r=function(e){var[n,r]=Nt(e);return vi(arguments,n),arguments[1]=r,u.apply(this,arguments)}}var o=e.addEventListener;return o||(e.on?o=i?.once?e.once:e.on:(ei(e),o=e.addEventListener)),o.call(e,n,r,i),fi((()=>hi(e,n,r)),r)},yi=function(e,n,r,i){return Pt(n.map((n=>mi(e,n,r,i))))},gi=O((function(){return process.argv.slice(2)})),wi=gi,bi=function(e){const n=[];let r="",i="outside",u=!1;for(let o=0;o<e.length;o++){const s=e[o];switch(i){case"outside":'"'===s?u?(r+=s,u=!1):i="insideQuote":"\\"===s?u=!0:" "===s?(r.length>0&&(n.push(r),r=""),u=!1):(r+=s,u=!1);break;case"insideQuote":'"'!==s||u?"\\"!==s||u?(r+=s,u=!1):u=!0:i="outside"}}return r.length>0&&n.push(r),n},Ei=function(){return globalThis.repl?.repl},xi=function(e,n){return null==n&&(n=1),function(){var r=Array.from(arguments),i=r.pop(),u=e.apply(this,r);0===n?(u.then((e=>i(null,e))),u.catch(i)):(u.then(i),u.catch((e=>i.apply(null,ri([],n,e)))))}},_i=async function(){}.constructor,ki=function(e){return ie(e,_i)},Li=function(e){return ki(e)?e:async function(){return e.apply(this,arguments)}},Fi=O((function(){return Gr("node:stream")})),Si=T()&&Fi().Writable,Ai=function(e,n){return n||(n={}),null==n.objectMode&&(n.objectMode=!0),e?n.write=xi(Li(e),0):n.write||(n.write=(e,n,r)=>r()),new Si(n)},Oi=function(){},Ti=async function(e){var n=Ei();if(n){var r,i=n.eval,u=n.output;n.output=Ai(Oi),n.eval=Oi;try{n.quickDisableHistory?await n.quickDisableHistory((async function(){r=await e(),n._line()})):r=await e()}finally{n.output=u,n.eval=i}return r}return e()},Ci=he("readline"),Ii=/\r?\n/,ji=function(e){return null==e||void 0!==e.length&&0===e.length},Pi=function(e,n){return Jt(e,ji)},Ni=function(e,n){return e.splice(n,1),e},Ri=function(e,n,r){for(var i={},u=e.length,o=0;o<u;o++){var s=n(e[o],o,e);if(s){var[a,l]=s;r?(i[a]||(i[a]=[]),i[a].push(l)):i[a]=l}}return i},qi=function(e,n,r,i){return[n,r]=X(e,n,r,i),e.slice(n,r)},Mi=function(e,n){return xe(n,e).join("")},Di=function(e){return e?e[0]:null},Bi=function(e,n){var r=null==n?-1:n.index;if(-1===r)return[e];var i=Ln(e,r);return i[1]=i[1].slice(n[0].length),i},Wi=function(e,n,r,i,u){return Bi(e,dr(e,n,r,i,u))},Hi=function(e){return isNaN(e)?null:e},Ki=function(e){return null==e?null:Hi(Number(e))},Yi=Ki,Ui=function(e){return Yi(e)??e},zi=function(e,n){null==n&&(n="=");var r={};return e.forEach((function(e){var[i,u]=Wi(e,n);null!=u&&(u=Ui(u.trim())),r[i.trim()]=u})),r},Vi=w,Gi=class extends Array{constructor(e){var i,u=e;null!=u&&(r(u)?i=u:n(u)&&(i=u.split(Ii))),i?(super(i.length),Object.assign(this,i)):super(...arguments)}condense(e){return this.trim().removeEmpty(),e&&this.removeComments(e),this}trim(){return this.apply((e=>e.trim()))}removeEmpty(){return Pi(this)}removeComments(e){for(var n=0;n<this.length;n++){var r=this[n],i=r.indexOf(e);-1!==i&&(""===(r=r.slice(0,i)).trim()?(Ni(this,n),n--):this[n]=r)}return this}removeFirst(){return this.shift(),this}removeLast(){return this.pop(),this}apply(e){return Z(this,e)}join(){return super.join("\n")}toObj(e){return zi(this,e)}mapToObj(e,n){return Ri(this,e,n)}between(e,n,r){return r=Vi(r,"inclusiveEnd",!0),qi(this,e,n,r)}normalize(){if(this.length>0&&(""===this[0].trim()&&this.shift(),this.length>0&&(""===mn(this).trim()&&this.pop(),this.length>0))){var e=this.find((e=>""!==e.trim())),n=Di(pr(/^\s*/,e));if(n){var r=n.length;this.apply((e=>{if(e.startsWith(n))return e.slice(r)}))}}return this}deindent(e,n,r){throw E()}indent(e,n){var r=Mi(n??"\t",e??1);return this.apply((e=>r+e))}static is(e){return ie(e,this)}static fromChunks(e){return e.map((e=>kn(e,Ii))).flatMap((e=>Ji(e,!1)))}},Qi=function(e,n){var r=new Gi(e);return n&&r.condense(),r},Ji=function(e,n,r){var i=e.split(Ii);return n?Qi(i,r):i},$i=function(e){return Kr().readFileSync(e,"utf8")},Xi=$i,Zi=function(e,n){return Ji(Xi(e),!0,n)},eu=function(e){return"number"==typeof e},tu=function(e){return e instanceof Buffer},nu=function(e){return ArrayBuffer.isView(e)},ru=nu,iu=function(e){return tu(e)||ru(e)||n(e)},uu=function(e){return e.constructor===ArrayBuffer},ou=function(e){return iu(e)?e:uu(e)?Buffer.from(e):ht(e)},su=function(e){return eu(e)?String(e):ou(e)},au=function(e,n){return Ur(e),Kr().appendFileSync(e,su(n)),e},lu=function(e,n){return au(e,"\n"+n)},cu=lu,fu=function(e){return at(e,"\n","\\n")},hu=fu,pu=function(e,n){if(0===e)return n[0];for(var r=n.length,i="";e>0;){var u=e%r;i=n.charAt(u)+i,e=Math.floor(e/r)}return i},du="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",vu=function(e){return pu(e,du)},mu=function(e,n){for(var r=er(e),i=n.length,u=0,o=0;o<r.length;o++){var s=r[o],a=n.indexOf(s);if(-1===a)throw'Error: "'+s+'" not found in base charset "'+n+'"';u=u*i+a}return u},yu=function(e){return mu(e,du)},gu=function(e,n){return Object.keys(e).map(((r,i)=>n(r,e[r],i,e)))},wu=function(e){return e.slice()},bu=function(e,n){return e.includes(n)||e.push(n),e},Eu=class{constructor(e,n,i,u){(n=r(n)?wu(n):[n]).forEach(u),e&&bu(n,e),this.members=n,this._enableFn=i,this._disableFn=u}enable(e){this.members.forEach((n=>{n!==e&&this._disableFn(n)})),this._enableFn(e)}disableAll(){this.members.forEach((e=>this._disableFn(e)))}},xu=function(e,n,r,i){return new Eu(e,n,r,i)},_u=function(e,n,r){return new Promise((function(i,u){var o=Pt([ui(e,n||"load",(e=>{o.remove(),i(e)})),ui(e,r||"error",(e=>{o.remove(),u(e)}))])}))},ku=j("CLI",T()&&Ci().Interface,[function(e){if(e||(e={}),e.input||(e.input=process.stdin),e.output||null==e.output&&(e.output=process.stdout),null==e.terminal&&(e.terminal=!0),e.historyPath){var n=Yr(e.historyPath)?Zi(e.historyPath):[];e.history=n.reverse()}var r={inputWasRaw:e.input.isRaw},i=Ci().createInterface(e);return i.options=e,i.internal=r,i},function(){var e=this.options;this.rl=Ci(),e.historyPath&&this.on("history",(n=>cu(e.historyPath,n[0]))),e.disabled&&this.disable()}],{prompt(e){this._muted||(this._isPrompt=!0,null!=e&&this.setPrompt(e),super.prompt.apply(this,arguments),delete this._isPrompt)},_refreshLine(){this._muted||(this._isRefresh=!0,super._refreshLine(...arguments),delete this._isRefresh)},_ttyWrite(e,n){(!this._blockExcept||n&&this._blockExcept.includes(n.name))&&super._ttyWrite.apply(this,arguments)},_addHistory(){return this._historyDisabled||null!=this._mask||super._addHistory(),this.line},_writeToOutput(e){if(!this._muted){var n=this._mask;if(null!=n){if(this._isRefresh){var r=this._prompt;e.startsWith(r)&&(super._writeToOutput(r),e=e.slice(r.length))}this._isPrompt||(e=Cn(e,/[^\r\n]/,n))}super._writeToOutput(e)}},async promptLine(e){return this.prompt(e),this.awaitLine()},async prefillPrompt(e,n){var r=n,i=await Fe(r);return this.prompt(e),i&&this.write(hu(er(i))),this.awaitLine()},async promptMultiline(e,r,i,u){if(null==r&&(r="... "),null==i)i=e=>""===e,u||(u=e=>(e.pop(),e));else if(n(i)){var o=i;i=e=>e.endsWith(o)}for(var s=await this.promptLine(e),a=[s];!i(s,a.length,a);)s=await this.promptLine(r),a.push(s);return u&&u(a),a.join("\n")},async promptKey(e,n){this.prompt(e);var r=await this.quickBlockExcept(n,!1,(()=>this.awaitKey(n)));return this.newLine(),r},async promptYN(e){return"y"===(await this.promptKey(e,["y","n"])).toLowerCase()},async promptSelect(e,n,i){var u=n;i||(i={});var o=0;function a(){return o++,vu(o)}if(oe(u))u=gu(u,((e,n,r)=>[a(),e,n]));else{if(!r(u))throw Bt(u);u=u.map(((e,n)=>{if(null==e)return null;if(r(e)){var i=e[0];if(null==i)i=a();else if((i=er(i)).length>1)throw m("Input key must be a single character:",e);var u=e.length;if(1===u)return[i,i,i];if(2===u){var o=e[1];return[i,o,o]}if(3===u)return[i,e[1],e[2]];throw m("Unexpected array length in choices: "+u)}return[a(),e,e]})),$t(u)}if(u.length>35)throw m("promptSelect only supports up to 35 options.");var l=i.displayFn||((e,n)=>"["+e+"] "+n);this.quickDisableHistory((()=>{for(var e=0;e<u.length;e++){var[n,r,i]=u[e];this.write(l(n,r,i,u)+"\n")}}));var c=Ri(u,(e=>[e[0],e])),f=await this.promptKey(e,Object.keys(c)),h=c[f];if(null==h)throw Et(h,"choice");var p=h[2];return s(p)&&(p=await p(h)),i.asObj?{key:f,name:h[1],value:p}:i.asIndex?yu(f)-1:p},blockExcept(e,n){e=i(e).map((e=>String(e).toLowerCase())),0!=n&&bu(e,"return"),this._blockExcept=e},unblock(){delete this._blockExcept},async quickBlockExcept(e,n,r){var i=this._blockExcept;this.blockExcept(e,n);var u=await r();return i?this.blockExcept(i):this.unblock(),u},disable(){this.pause(),this.mute()},enable(){this._mutex?this._mutex.enable(this):this._enable()},_enable(){this.resume(),this.unmute()},mutex(e){var n=xu(this,e,(e=>e._enable()),(e=>e.disable()));this.pause(),this.resume(),n.members.forEach((e=>e._mutex=n))},mask(e){this._mask=e},unmask(){delete this._mask},mute(){this._muted=!0},unmute(){delete this._muted},disableHistory(){this._historyDisabled=!0,this._historyPrev=Oi,this._historyNext=Oi},enableHistory(){delete this._historyDisabled,delete this._historyPrev,delete this._historyNext},async quickDisableHistory(e){var n=this._historyDisabled;this.disableHistory();try{var r=await e()}finally{return n||this.enableHistory(),r}},awaitLine(){return _u(this,"line")},newLine(){this.write("\n")},newline(){return this.newLine()},onKey(e,n,i){var u=e,o=this.input;if(this.rl.emitKeypressEvents(o),o.isTTY&&o.setRawMode(!0),u){var s=n;if(r(u)){var a=u.map((e=>String(e).toLowerCase()));n=(e,n)=>{e||(e=n.name),a.includes(e.toLowerCase())&&s.call(this,e,n)}}else{var l=String(u).toLowerCase();n=(e,n)=>{e||(e=n.name),e.toLowerCase()===l&&s.call(this,e,n)}}}return mi(o,"keypress",n,i)},async awaitKey(e){return new Promise((n=>{var r=this.onKey(e,(e=>{r.remove(),n(e)}))}))},moveCursor(e,n){return this._moveCursor(e,n)},cursorLeft(e){return this.moveCursor(-e)},cursorRight(e){return this.moveCursor(e)},cursorUp(e){return this.moveCursor(null,-e)},cursorDown(e){return this.moveCursor(null,e)},close(){super.close(),this.input.setRawMode(this.internal.inputWasRaw)}}),Lu=function(e,n){return Ti((async function(){var r=new ku(n);try{var i=await e(r)}finally{r.close()}return i}))},Fu=function(e,n){return Lu((n=>n.promptLine(e)),n)},Su=async function(e,n,r){for(var i={},u=n.length,o=0;o<u;o++){var s,a=n[o];if(a.endsWith("?")&&(a=a.slice(0,-1),s=!0),void 0===(l=e[a])){var l=e[o];if(void 0===l&&!s&&(!1!==r?.prompt&&(l=await Fu(a+": ")),!l))throw Ar(void 0,o,a)}i[a]=l}return i},Au={node:{onError:function(e){return yi(process,["uncaughtException","unhandledRejection"],e)},is:T,display:de,util:pe,_builtInModule:he,requireBuiltIn:fe,require:Gr,_basicRequire:Yt,child_process:Xt,requireLocal:sn,path:un,_requireFromDir:hn,_requireDirCache:ln,_createRequire:fn,module:cn,promptYNSync:Pr,run:Fr,getScriptPath:Rn,sigint:Ir,interrupt:Cr,ensureRequireDir:Dr,addRequireDir:Mr,fs:Kr,pause:function(e){Gr("press-any-key-sync")(String(e))},beforeExit:function(e){return mi(process,"beforeExit",e)},args:gi,prompt:Fu,quickCLI:Lu,quickDisableREPL:Ti,getREPL:Ei,CLI:ku,readline:Ci},ev:{onAny:yi,multiHandle:Pt,on:mi,resolveValue:Nt,enable:ei,EventInterface:Zr,Interface:Xr,_ensureHasTarget:$r,targetSym:Kt,EventTarget:Jr,polyfill:Qr,handle:fi,ListenerHandle:ci,ensureEnabled:ni,can:ti,once:ui,off:hi,promise:_u},o:{multiHandle:jt,safeEnsure:w,ensure:g,isAny:_,setHidden:L,addNonEnumerable:k,hideKey:N,makeNonEnumerable:P,filterSplit:z,keys:D,allKeys:M,split:U,pick:B,iterateAll:re,iterate:ne,iterator:te,entries:ee,isPure:oe,is:ue,setProtoLazy:le,setGetter:se,forceSet:ae,display:gt,toLiteral:yt,constructorMatches:we,ensureCustom:Se,get:ke,set:Le,createEmpty:Re,remove:Ke,reduce:mt,each:vt,addInterface:Wt,Cache:an,setDefaults:dn,ensureMulti:pn,resolveKeys:Nr,diveGet:Br,safeSet:ii,touch:ri,fromLines:zi,safeDefault:Vi,mapArr:gu,mutex:xu,_Mutex:Eu},handle:{createMulti:It,MultiHandle:Tt,HandleInterface:Ot,Handle:li},class:{addInterface:e,create:j,setName:S,addStatics:A,setDisplay:I,isInterface:qt,interface:Ht},ifc:{create:St,Interface:Ft,is:Rt},f:{createClass:R,createConstructor:f,isArrowFn:l,isArrow:a,is:s,wrap:c,ensureConstructor:h,retThis:p,setName:F,one:O,eq:q,memoize:Qe,MemoizedFunction:Ge,not:Qt,body:kr,isArrowString:tr,_getArrowFnBody:xr,_getNormalFnBody:_r,hookAfterMethod:ai,hookAfter:si,injectAfter:oi,callbackify:xi,ensureAsync:Li,isAsync:ki,AsyncFunction:_i,noop:Oi},s:{is:n,toLiteral:ft,quote:ct,escape:lt,replaceAll:at,apply:ge,withIndices:ye,chars:Je,from:ht,spaceBefore:kt,fromKey:Lt,removeTrailing:kn,removeFromEnd:_n,_removeStringFromEnd:vn,_removeRegexFromEnd:xn,resolveIndex:yn,splitAtIndex:Ln,ensureStartsWith:Sn,replace:Cn,endsWith:In,decapitalize:qn,removeLineBreaks:Vn,removeMulti:zn,removeAll:Un,resolve:Lr,ensure:er,after:mr,match:dr,_matchWithIndices:nr,remove:lr,removeLeading:Er,removeFromStart:br,_removeStringFromStart:yr,_removeRegexFromStart:wr,splitLines:Ji,lines:Qi,LinesArray:Gi,repeat:Mi,splitFirst:Wi,_splitByMatch:Bi,escapeLineBreaks:hu,escapeNewLines:fu},a:{is:r,ensure:i,filterSplit:Y,iterate:J,iterator:Q,apply:Z,resolveIndices:X,resolveIndex:$,wrapIndices:me,wrapIndex:ve,pick:_e,create:xe,fill:Ee,push:je,add:Ie,splitLast:Me,splitTail:qe,toLiteral:pt,display:wt,unboxArgs:Ct,removeNullish:$t,removeByFilter:Jt,replaceContents:Gt,last:mn,pushMulti:ur,addMulti:ir,pushThroughMulti:rr,removeEmpty:Pi,removeIndex:Ni,mapToObj:Ri,slice:qi,copy:wu,ensureContains:bu},p:{asyncJoint:o,is:u},err:{create:m,Error:v,Enhanced:d,nyi:E,NYIError:y,defaultFromFn:b,value:Et,ValueError:ce,type:Bt,TypeError:Mt,prepend:Qn,req:Sr},v:{isPrimitive:x,constructorMatches:ie,display:bt,toLiteral:dt,resolve:Fe,type:Dt,req:Ar,isEmpty:ji,nullIfNaN:Hi},sym:{display:C,value:Ne,cleanup:At},macro:{config:function(e){}},set:{resolve:K,ensure:H,is:W},n:{cap:G,least:V,tryCoerce:Ui,tryParse:Yi,ensure:Ki,is:eu,toBase36:vu,toCustomBase:pu,_base36Digits:du,fromBase36:yu,fromCustomBase:mu},re:{is:be,ensureGlobal:rt,global:nt,addFlag:tt,copy:et,updateFlagString:Ze,parseFlagString:$e,createFlagString:Xe,createEscaped:st,create:ut,resolveFlags:it,escape:ot,matchEnd:En,matchLast:bn,matchAll:wn,setStartIndex:gn,slash:jn,safeCreateResult:ar,createResult:sr,RegexResult:or,match:pr,ensureLocal:hr,local:fr,removeFlag:cr,resultEndIndex:vr,matchStart:gr,newline:Ii,text:Di},map:{Cache:Ce,ensure:Te,get:Ae,set:Oe,MultiCache:Ve,diveEnsure:He,createEmpty:We,diveDelete:ze,remove:Ue},args:{ensureArray:Pe,unshift:vi,prepend:di,insert:pi},tree:{ensure:Be,dive:De,remove:Ye,setCustom:Rr},gen:{join:xt},npm:{isBuiltIn:Ut,isFile:zt,install:rn,_runCommand:nn},os:{run:tn,_resolveStdio:Vt},win:{is:Zt},shell:{_handleError:en},path:{abs:on,fws:Nn,ensureTrailingSlash:Pn,baseName:Bn,_removeExtsFromFile:Mn,file:Dn,dir:Hn},js:{enhance:Zn,ensureReturn:An,splitLastExpression:Fn,enableAwait:Tn,_nodeEnableAwait:On,useTitan:Yn,inline:Xn,removeComments:$n,fromAST:Gn,parse:Jn},titan:{getPackagePath:Kn,getPackageName:Wn},proc:{interrupt:Tr,signal:Or},bool:{fromYN:jr},env:{setConfig:qr,getConfig:Wr,resolveConfig:Hr,args:wi},fs:{ensureDir:Vr,exists:Yr,mkdir:zr,ensureParent:Ur,loadLines:Zi,loadText:Xi,load:$i,appendLine:cu,addLine:lu,append:au,formatRaw:su},cli:{parseArgs:function(e){for(var r,i=[],u=!1,o=(r=null==(a=e)?wi():n(a)?bi(a):a).length,s=0;s<o;s++){var a=r[s];if(!u){var l=a[0];let e;if("-"===l)if("-"===a[1]){if(2===a.length){u=!0;continue}e=2}else e=1;else"/"===l&&(e=1);if(e){var c,f,h=a.slice(e),p=h.indexOf("=");if(-1!==p)c=h.slice(0,p),f=h.slice(p+1);else{c=h;var d=r[s+1];null==d||"-"===d[0]?f=!0:(f=d,s++)}i[c]=f;continue}}i.push(a)}return i},splitArgs:bi,paramFn:function(e,n){return async function(...r){var i=await Su(e,r,n);Object.assign(globalThis,i)}},validateParams:Su},stream:{nodeWritable:Ai,NodeWritableStream:Si,_useNode:Fi},bin:{ensureByteSafe:ou,isByteSafe:iu,isNodeBuffer:tu,isTA:ru},ab:{isTA:nu,is:uu}};globalThis.t?Object.keys(Au).forEach((function(e){if(t[e]){var n=Au[e];Object.keys(n).forEach((function(r){t[e][r]=n[r]}))}else t[e]=Au[e]})):globalThis.t=Object.assign({},Au),globalThis.exports&&(exports.default=globalThis.t);
|